emacs-orgmode@gnu.org archives
 help / color / mirror / code / Atom feed
From: James Harkins <jamshark70@gmail.com>
To: Eric Schulte <schulte.eric@gmail.com>
Cc: orgmode <emacs-orgmode@gnu.org>
Subject: Re: Conditional source-block execution based on LaTeX document class?
Date: Mon, 27 Jan 2014 10:30:30 +0800	[thread overview]
Message-ID: <c2dd55d1-4b84-46ab-ac06-b3f5949dc89d@dewdrop-world.net> (raw)
In-Reply-To: <87iot6y2kf.fsf@gmail.com>

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	other threads:[~2014-01-27  2:30 UTC|newest]

Thread overview: 4+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2014-01-26 15:44 Conditional source-block execution based on LaTeX document class? James Harkins
2014-01-26 16:36 ` Marcin Borkowski
2014-01-26 17:35 ` Eric Schulte
2014-01-27  2:30   ` James Harkins [this message]

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=c2dd55d1-4b84-46ab-ac06-b3f5949dc89d@dewdrop-world.net \
    --to=jamshark70@gmail.com \
    --cc=emacs-orgmode@gnu.org \
    --cc=schulte.eric@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).