From mboxrd@z Thu Jan 1 00:00:00 1970 From: "Levy, Roger" Subject: Re: "No definition for class" error in export to latex Date: Sat, 11 Jun 2011 19:10:50 -0700 Message-ID: References: <3134F11C-4D50-42A7-B160-7C8C921D5798@ucsd.edu> <8828.1307835478@alphaville.dokosmarshall.org> Mime-Version: 1.0 Content-Type: text/plain; charset="us-ascii" Content-Transfer-Encoding: quoted-printable Return-path: Received: from eggs.gnu.org ([140.186.70.92]:40334) by lists.gnu.org with esmtp (Exim 4.71) (envelope-from ) id 1QVa8e-0006Ie-RZ for emacs-orgmode@gnu.org; Sat, 11 Jun 2011 22:10:57 -0400 Received: from Debian-exim by eggs.gnu.org with spam-scanned (Exim 4.71) (envelope-from ) id 1QVa8d-0003xO-H4 for emacs-orgmode@gnu.org; Sat, 11 Jun 2011 22:10:56 -0400 Received: from iport-c1-out.ucsd.edu ([132.239.0.176]:3646) by eggs.gnu.org with esmtp (Exim 4.71) (envelope-from ) id 1QVa8d-0003xA-26 for emacs-orgmode@gnu.org; Sat, 11 Jun 2011 22:10:55 -0400 In-Reply-To: <8828.1307835478@alphaville.dokosmarshall.org> Content-Language: en-US List-Id: "General discussions about Org-mode." List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , Errors-To: emacs-orgmode-bounces+geo-emacs-orgmode=m.gmane.org@gnu.org Sender: emacs-orgmode-bounces+geo-emacs-orgmode=m.gmane.org@gnu.org To: "nicholas.dokos@hp.com" Cc: "emacs-orgmode@gnu.org" On Jun 11, 2011, at 4:37 PM, Nick Dokos wrote: > Levy, Roger wrote: >=20 >> and no .tex file output. From within Aquamacs, I don't get this error, = pre=3D >> sumably because I have the following in my .emacs file: >>=20 >> (add-to-list 'org-export-latex-classes >> '("apa" >> "\\documentclass{apa} >> [NO-DEFAULT-PACKAGES] >> \\usepackage{graphicx} >> \\usepackage{apacite}" >> ("\\section{%s}" . "\\section*{%s}") >> ("\\subsection{%s}" . "\\subsection*{%s}") >> ("\\subsubsection{%s}" . "\\subsubsection*{%s}") >> )) >>=20 >> How can I make this modification of org-export-latex-classes from the co= mma=3D >> nd line? I have tried putting the above content in a file ("$HOME/tmp/a= dd.=3D >> el") and making the call >>=20 >> /Applications/Aquamacs.app/Contents/MacOS/Aquamacs -batch \ >> --load $HOME/tmp/add.el \ >> --visit=3D3Dtest-file.org \ >> --funcall org-export-as-latex-batch >>=20 >> but this gives me the error >>=20 >> Symbol's value as variable is void: org-export-latex-classes >>=20 >> I would be very grateful for any suggestions! This is GNU Emacs 23.3.1 = (Aq=3D >> uamacs 2.2) and Org mode 7.5. >=20 > You should add to add.el some more initialization: you probably need to > set the load-path and require the org-latex package - something like > this, but you should more or less mimic the way you initialize org mode > in your .emacs: >=20 > --8<---------------cut here---------------start------------->8--- > (add-to-list 'load-path (expand-file-name "~/src/emacs/org/org-mode/lisp"= )) ;maybe > (add-to-list 'auto-mode-alist '("\\.\\(org\\|org_archive\\|txt\\)$" . org= -mode)) > (require 'org-install) ; maybe >=20 > (require 'org-latex) > ...apa stuff from above... > --8<---------------cut here---------------end--------------->8--- >=20 > Remember: -batch implies -q so your .emacs file is completely ignored: > you have to do any initialization you need in the add.el file. Many thanks, Nick. I have managed to get things to work with the following= add.el file contents: --8<---------------cut here---------------start------------->8--- (setq load-path (cons "/Users/rlevy/tmp/org-7.5/contrib/lisp" load-path)) (setq load-path (cons "/Users/rlevy/tmp/org-7.5/lisp" load-path)) (require 'org-install) (require 'org-latex) (require 'org-exp-bibtex) (add-to-list 'auto-mode-alist '("\\.org\\'" . org-mode)) (add-to-list 'org-export-latex-classes '("apa" "\\documentclass{apa} [NO-DEFAULT-PACKAGES] \\usepackage{graphicx} \\usepackage{apacite}" ("\\section{%s}" . "\\section*{%s}") ("\\subsection{%s}" . "\\subsection*{%s}") ("\\subsubsection{%s}" . "\\subsubsection*{%s}") )) --8<---------------cut here---------------start------------->8--- Probably some of that may be unnecessary too, but (require 'org-latex) was = definitely needed. >=20 >> Incidentally, trying to export to HTML with >>=20 >> /Applications/Aquamacs.app/Contents/MacOS/Aquamacs -batch \ >> --visit=3D3Dtest-file.org \ >> --funcall org-export-as-html-batch >>=20 >> complains differently:=3D20 >>=20 >> OVERVIEW >> Exporting... >> File mode specification error: (file-error "Cannot open load file" "html= -he=3D >> lper-mode") >> Exporting... >> Exporting... >> File mode specification error: (file-error "Cannot open load file" "html= -he=3D >> lper-mode") >=20 > I don't know who tries to load html-helper-mode but that's not even > present in my setup. >=20 >> Saving file /tmp/test-file.html... >> Wrote /tmp/test-file.html >> HTML export done, pushed to kill ring and clipboard >>=20 >> but it actually does produce a sensible html file. >>=20 >=20 > Probably because the autoload for org-export-as-html-batch is > in the default path of your emacs. OK -- I will not worry about this for now. Thanks again. Best Roger