From mboxrd@z Thu Jan 1 00:00:00 1970 From: Nicolas Goaziou Subject: Re: Better way to specify the latex documentclass of an exported file without changing my configuration? Date: Wed, 26 Mar 2014 14:21:40 +0100 Message-ID: <87ha6lumcb.fsf@gmail.com> References: Mime-Version: 1.0 Content-Type: text/plain Return-path: Received: from eggs.gnu.org ([2001:4830:134:3::10]:39243) by lists.gnu.org with esmtp (Exim 4.71) (envelope-from ) id 1WSnle-0001pq-13 for emacs-orgmode@gnu.org; Wed, 26 Mar 2014 09:21:23 -0400 Received: from Debian-exim by eggs.gnu.org with spam-scanned (Exim 4.71) (envelope-from ) id 1WSnlX-0003p0-P4 for emacs-orgmode@gnu.org; Wed, 26 Mar 2014 09:21:17 -0400 Received: from mail-we0-x232.google.com ([2a00:1450:400c:c03::232]:49144) by eggs.gnu.org with esmtp (Exim 4.71) (envelope-from ) id 1WSnlX-0003oo-I4 for emacs-orgmode@gnu.org; Wed, 26 Mar 2014 09:21:11 -0400 Received: by mail-we0-f178.google.com with SMTP id u56so1097035wes.23 for ; Wed, 26 Mar 2014 06:21:10 -0700 (PDT) In-Reply-To: (Alan Schmitt's message of "Wed, 26 Mar 2014 09:37:27 +0100") 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: Alan Schmitt Cc: emacs-orgmode Hello, Alan Schmitt writes: > I'm collaborating on a paper with some colleagues, and I convinced them > to use org-mode. I'm trying to make sure the paper is as self-contained > as possible (I don't want them to have to change their emacs > configuration file). To change the documentclass name of the exported > article, I added the following block in a section that is not exported: > > #+begin_src emacs-lisp :results silent :exports results > (add-to-list 'org-latex-classes > '("llncs" > "\\documentclass{llncs}" > ("\\section{%s}" . "\\section*{%s}") > ("\\subsection{%s}" . "\\subsection*{%s}") > ("\\subsubsection{%s}" . "\\subsubsection*{%s}"))) > #+end_src > > My questions are: > - is there a way to do this without an emacs-lisp block? Yes there is, with a BIND keyword, e.g.: #+BIND: org-latex-classes (("article" "\\documentclass{llncs}" ("\\section{%s}" . "\\section*{%s}"))) Though you need to activate it with `org-export-allow-bind-keywords', if only as a file local variable: # Local Variables: # org-export-allow-bind-keywords: t # End: > - is there a nicer way to make sure that an emacs-lisp block is > evaluated upon export than ":exports results :results silent"? (If > I don't put it there, the block is not evaluated.) You can put the block in a :noexport: section. Then, I don't think that you need to then :exports or :results parameters. > - is there a way to just say the name of the documentclass without all > the boilerplate code below? In other words, can I say "this is a llncs > documentclass with the same sectioning as an article"? You can use a final filter to replace "article" with "llncs" in the document, but there is no straightforward way, e.g., a keyword, to do so. Regards, -- Nicolas Goaziou