From mboxrd@z Thu Jan 1 00:00:00 1970 From: Eric S Fraga Subject: Re: "No definition for class" error in export to latex Date: Wed, 15 Jun 2011 20:08:09 +0100 Message-ID: <874o3qq5eu.fsf@ucl.ac.uk> References: <3134F11C-4D50-42A7-B160-7C8C921D5798@ucsd.edu> Mime-Version: 1.0 Content-Type: text/plain Return-path: Received: from eggs.gnu.org ([140.186.70.92]:37862) by lists.gnu.org with esmtp (Exim 4.71) (envelope-from ) id 1QWvRq-0004vE-BL for emacs-orgmode@gnu.org; Wed, 15 Jun 2011 15:08:20 -0400 Received: from Debian-exim by eggs.gnu.org with spam-scanned (Exim 4.71) (envelope-from ) id 1QWvRm-00079Q-Rk for emacs-orgmode@gnu.org; Wed, 15 Jun 2011 15:08:18 -0400 Received: from vscane-a2.ucl.ac.uk ([144.82.108.42]:42104) by eggs.gnu.org with esmtp (Exim 4.71) (envelope-from ) id 1QWvRm-000797-DT for emacs-orgmode@gnu.org; Wed, 15 Jun 2011 15:08:14 -0400 In-Reply-To: <3134F11C-4D50-42A7-B160-7C8C921D5798@ucsd.edu> (Roger Levy's message of "Sat, 11 Jun 2011 13:11:14 -0700") 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: "Levy, Roger" Cc: "emacs-orgmode@gnu.org" "Levy, Roger" writes: > Hi, > > I am an org-mode newbie and trying to learn how to export to latex and > html from the command line, and have encountered a difficulty when I > include a custom class in the latex header. Here's a sample file > ("test-file.org") I'm using: > > *** > > #+TITLE: Test > #+LaTeX_CLASS: apa > > file contents > > *** > > and here is the command I'm using: > > /Applications/Aquamacs.app/Contents/MacOS/Aquamacs -batch \ > --visit=test-file.org \ > --funcall org-export-as-latex-batch > > which gives me the output > > OVERVIEW > Exporting to LaTeX... > No definition for class `apa' in `org-export-latex-classes' > > and no .tex file output. From within Aquamacs, I don't get this error, presumably because I have the following in my .emacs file: > > (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}") > )) > > How can I make this modification of org-export-latex-classes from the command line? I have tried putting the above content in a file ("$HOME/tmp/add.el") and making the call > > /Applications/Aquamacs.app/Contents/MacOS/Aquamacs -batch \ > --load $HOME/tmp/add.el \ > --visit=test-file.org \ > --funcall org-export-as-latex-batch > > but this gives me the error > > Symbol's value as variable is void: org-export-latex-classes > > I would be very grateful for any suggestions! This is GNU Emacs > 23.3.1 (Aquamacs 2.2) and Org mode 7.5. I don't use this version of Emacs (not on a Mac) so cannot guarantee anything I say will be relevant... but have you tried adding (require 'org-latex) before you set the org-export-latex-classes variable? I'm assuming that org mode is actually already loaded by default. HTH. -- : Eric S Fraga (GnuPG: 0xC89193D8FFFCF67D) in Emacs 24.0.50.1 : using Org-mode version 7.5 (release_7.5.391.gfaccb.dirty)