From mboxrd@z Thu Jan 1 00:00:00 1970 From: Nick Dokos Subject: Re: calling to Emacs server to export to PDF Date: Tue, 07 Dec 2010 14:26:46 -0500 Message-ID: <13338.1291750006@gamaville.americas.hpqcorp.net> References: Reply-To: nicholas.dokos@hp.com Return-path: Received: from [140.186.70.92] (port=47151 helo=eggs.gnu.org) by lists.gnu.org with esmtp (Exim 4.43) id 1PQ3BZ-0008VB-St for emacs-orgmode@gnu.org; Tue, 07 Dec 2010 14:26:50 -0500 Received: from Debian-exim by eggs.gnu.org with spam-scanned (Exim 4.71) (envelope-from ) id 1PQ3BY-0003Io-IF for emacs-orgmode@gnu.org; Tue, 07 Dec 2010 14:26:49 -0500 Received: from g4t0017.houston.hp.com ([15.201.24.20]:25321) by eggs.gnu.org with esmtp (Exim 4.71) (envelope-from ) id 1PQ3BY-0003Ic-En for emacs-orgmode@gnu.org; Tue, 07 Dec 2010 14:26:48 -0500 In-Reply-To: Message from Herbert Sitz of "Tue, 07 Dec 2010 18:39:51 GMT." List-Id: "General discussions about Org-mode." List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , Sender: emacs-orgmode-bounces+geo-emacs-orgmode=m.gmane.org@gnu.org Errors-To: emacs-orgmode-bounces+geo-emacs-orgmode=m.gmane.org@gnu.org To: Herbert Sitz Cc: nicholas.dokos@hp.com, emacs-orgmode@gnu.org [Resending to the list: I got bitten by my old server verification nemesis. Hope this makes it. Apologies to Herb for the duplicates.] Herbert Sitz wrote: > I'm trying to call a function in an Emacs server to export a file to PDF usin g > the following command: > > "c:\program files (x86)\emacs\emacs\bin\emacs.exe" -batch --visit=[myfile] > --funcall org-export-as-pdf > > It works okay but it doesn't seem to use the default latex class that I've > defined in my .emacs. I can alter the LaTeX output by embedding #+LATEX_HEAD > lines in my file, but those come after the \documentclass command and all the > other default preamble lines Emacs is inserting. > > Printing from the same Emacs instance directly does seem to use the .emacs > configuration for LaTeX-related variables. > > So I have a couple of questions. > > (1) Is behavior I'm seeing expected? That is, when I call org-export-as-pdf > remotely it ignores settings in the .emacs file? > Yes, --batch implies -q, so you have to load your .emacs explicitly (or perhaps strip it down to its essentials and create a minimal .emacs for such a use). See appendix C.2 of the emacs manual: (info "(emacs)Initial Options") > (2) Is best workaround to just alter the default LaTeX class definitions in > org-latex.el? > Probably not: try emacs --batch --load $HOME/minimal.emacs --visit --funcall org-export-as-pdf (well, translated into whatever Windows needs). HTH, Nick