emacs-orgmode@gnu.org archives
 help / color / mirror / code / Atom feed
From: Alan Schmitt <alan.schmitt@polytechnique.org>
To: Nicolas Goaziou <n.goaziou@gmail.com>
Cc: emacs-orgmode <emacs-orgmode@gnu.org>
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	[thread overview]
Message-ID: <m2lhvx12wn.fsf@polytechnique.org> (raw)
In-Reply-To: <87ha6lumcb.fsf@gmail.com> (Nicolas Goaziou's message of "Wed, 26 Mar 2014 14:21:40 +0100")

Hello Nicolas,

Nicolas Goaziou <n.goaziou@gmail.com> 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

  reply	other threads:[~2014-03-26 13:54 UTC|newest]

Thread overview: 12+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2014-03-26  8:37 Better way to specify the latex documentclass of an exported file without changing my configuration? Alan Schmitt
2014-03-26  9:24 ` Feng Shu
2014-03-26 12:38   ` Fabrice Niessen
2014-03-26 12:53     ` Alan Schmitt
2014-03-26 18:46       ` Thomas S. Dye
2014-03-26 22:03         ` Alan Schmitt
2014-03-26 12:47   ` Alan Schmitt
2014-03-26 23:26     ` Richard Lawrence
2014-03-26 13:21 ` Nicolas Goaziou
2014-03-26 13:54   ` Alan Schmitt [this message]
2014-03-26 14:10     ` Nicolas Goaziou
2014-03-26 14:57       ` Alan Schmitt

Reply instructions:

You may reply publicly to this message via plain-text email
using any one of the following methods:

* Save the following mbox file, import it into your mail client,
  and reply-to-all from there: mbox

  Avoid top-posting and favor interleaved quoting:
  https://en.wikipedia.org/wiki/Posting_style#Interleaved_style

  List information: https://www.orgmode.org/

* Reply using the --to, --cc, and --in-reply-to
  switches of git-send-email(1):

  git send-email \
    --in-reply-to=m2lhvx12wn.fsf@polytechnique.org \
    --to=alan.schmitt@polytechnique.org \
    --cc=emacs-orgmode@gnu.org \
    --cc=n.goaziou@gmail.com \
    /path/to/YOUR_REPLY

  https://kernel.org/pub/software/scm/git/docs/git-send-email.html

* If your mail client supports setting the In-Reply-To header
  via mailto: links, try the mailto: link
Be sure your reply has a Subject: header at the top and a blank line before the message body.
Code repositories for project(s) associated with this public inbox

	https://git.savannah.gnu.org/cgit/emacs/org-mode.git

This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox;
as well as URLs for read-only IMAP folder(s) and NNTP newsgroup(s).