emacs-orgmode
[Top][All Lists]
Advanced

[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

Re: [O] Conditional source-block execution based on La TeX document clas


From: James Harkins
Subject: Re: [O] Conditional source-block execution based on La TeX document class?
Date: Mon, 27 Jan 2014 10:30:30 +0800
User-agent: Trojita/v0.3.96-git; Qt/4.8.1; X11; Linux; Ubuntu 12.04.4 LTS

On Monday, January 27, 2014 1:35:13 AM HKT, Eric Schulte wrote:
Hi James,

Maybe you could do something like the following...

#+name: export-hdr-arg-backend-dep
#+begin_src emacs-lisp
(message "do stuff")
#+end_src

#+call: export-hdr-arg-backend-dep() :exports (if (eq org-export-current-backend 'beamer) "none" "results")

Ah... that's really cool. I hadn't realized you could run lisp in the header arguments.

I couldn't check the current export backend because the org markup uses beamer-specific features. The way to export the article format is to use the beamer backend, but with document class = article and a "\usepackage{beamerarticle}" line in the preamble.

But, I figured out a little hack: to put this at the top of the container file:

# ###### top of slide container
#+name: set-slide-flag
#+begin_src emacs-lisp :exports results :results value latex
(setq hjh-exporting-slides 't)
""
#+end_src

# ###### top of article container
#+name: set-slide-flag
#+begin_src emacs-lisp :exports results :results value latex
(setq hjh-exporting-slides nil)
""
#+end_src

Then I can test this variable in all of the #+calls.

It seems to be working. When I export from the slide container file, it runs each #+call once. When I export from the article container (where I have the calls in the container), it runs the calls for the article container but it does *not* execute the calls redundantly for the two slide show source files I have now.

Thanks for the tip -- that's working a treat!

I think I owe it to the org community to write up this workflow, after the project is over. The help from Nicolas, you and others has been invaluable.

hjh



reply via email to

[Prev in Thread] Current Thread [Next in Thread]