From mboxrd@z Thu Jan 1 00:00:00 1970 From: Alan Schmitt Subject: Re: Better way to specify the latex documentclass of an exported file without changing my configuration? Date: Wed, 26 Mar 2014 14:54:16 +0100 Message-ID: References: <87ha6lumcb.fsf@gmail.com> Mime-Version: 1.0 Content-Type: text/plain Return-path: Received: from eggs.gnu.org ([2001:4830:134:3::10]:48845) by lists.gnu.org with esmtp (Exim 4.71) (envelope-from ) id 1WSoHo-0002OD-8z for emacs-orgmode@gnu.org; Wed, 26 Mar 2014 09:54:39 -0400 Received: from Debian-exim by eggs.gnu.org with spam-scanned (Exim 4.71) (envelope-from ) id 1WSoHg-00074F-VH for emacs-orgmode@gnu.org; Wed, 26 Mar 2014 09:54:32 -0400 Received: from mail2-relais-roc.national.inria.fr ([192.134.164.83]:38346) by eggs.gnu.org with esmtp (Exim 4.71) (envelope-from ) id 1WSoHg-000741-PR for emacs-orgmode@gnu.org; Wed, 26 Mar 2014 09:54:24 -0400 In-Reply-To: <87ha6lumcb.fsf@gmail.com> (Nicolas Goaziou's message of "Wed, 26 Mar 2014 14:21:40 +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: Nicolas Goaziou Cc: emacs-orgmode Hello Nicolas, Nicolas Goaziou writes: >> 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: Ah, yes, this is quite helpful. Thanks. >> - 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. It is in a :noexport: section already. Here is a quick test. Exporting --8<---------------cut here---------------start------------->8--- * Test :noexport: #+begin_src sh echo "date 1" >> ~/tmp/results echo `date` >> ~/tmp/results #+end_src #+begin_src sh :exports results :results silent echo "date 2" >> ~/tmp/results echo `date` >> ~/tmp/results #+end_src --8<---------------cut here---------------end--------------->8--- yields this "~/tmp/results" file: --8<---------------cut here---------------start------------->8--- date 2 Wed Mar 26 14:46:08 CET 2014 --8<---------------cut here---------------end--------------->8--- The behavior is identical if the ":noexport:" tag is absent. >> - 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. Thanks, Alan