emacs-orgmode@gnu.org archives
 help / color / mirror / code / Atom feed
From: Marcin Borkowski <mbork@wmi.amu.edu.pl>
To: emacs-orgmode@gnu.org
Subject: Re: Conditional source-block execution based on LaTeX document class?
Date: Sun, 26 Jan 2014 17:36:57 +0100	[thread overview]
Message-ID: <20140126173657.562c97bc@aga-netbook> (raw)
In-Reply-To: <b9be1562-d7d2-48a4-9257-ea2ba4fc4f30@dewdrop-world.net>

Dnia 2014-01-26, o godz. 23:44:48
James Harkins <jamshark70@gmail.com> napisał(a):

> Just ran into something that I'm really not sure how to handle. I
> thought I could handle it with export filters, but actually it
> involves babel, and that makes it more involved than I initially
> suspected.
> 
> I'm working on a large project involving five beamer presentations
> (one per day), and the sources for these will be combined into one
> massive beamerarticle document for the workshop attendees' reference.
> (If they want to print it out, it will look okay, but I won't
> encourage the killing of trees -- actually my early versions of the
> article layout looks fine on a tablet.)
> 
> I'm using LaTeX's glossaries package for indexed references at the
> end. But, \newglossaryentry is really annoying. So I made some org
> tables for the glossary entries and I wrote some emacs-lisp src
> blocks to convert them into the right syntax for LaTeX. So here's the
> problem...
> 
> In the individual beamer slideshows, I need to put the
> \newglossaryentry commands within a frame (because I'm also using
> beamer's "ignorenonframetext" class option, so that I can have text
> that appears only in the article but not the slides). That is (if I
> have H:3):
> 
> *** Some frame
> **** A block
>      Some text
> 
> #+call: makegloss
> #+results: makegloss
> 
> ... then the results of the src block to go into the frame, and then
> beamer doesn't ignore them and everything works.
> 
> For the final article, I need a structure like this:
> 
> #+options: H:4
> 
> * Day 1
> #+include "01-intro/01-contents.org"
> 
> * Day 2
> #+include "02-synthesis/02-contents.org"
> 
> And the problem is, if the #+call commands are replicated in each 
> 0x-contents file, then I will have redundant \newglossaryentry
> commands in the LaTeX output (in the end, multiplied five times).
> 
> If there's no other way, I could live with that, but ideally, I'd
> like to be able to put the #+call lines into the master file for the
> article, and then be able to suppress their execution in the
> #+includes. Ideally, this would be automatic based on the LaTeX
> document class.
> 
> Any way to do this? I suppose, at worst, I can just put all of the
> #+call lines in, and simply say "no" to the ones I don't want in the
> final compilation.

Ugly hack, but what about redefining \newglossaryentry?

In general, since Org-to-LaTeX export is a bit "simplistic" (as
compared to (La)TeX itself), I guess that solving such problems on the
LaTeX side might be easier.  (That said, beamer is rather opposite of
"simplistic", so it might as well be not true...)

> Thanks,
> hjh

HTH,

-- 
Marcin Borkowski
http://octd.wmi.amu.edu.pl/en/Marcin_Borkowski
Adam Mickiewicz University

  reply	other threads:[~2014-01-26 16:37 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 [this message]
2014-01-26 17:35 ` Eric Schulte
2014-01-27  2:30   ` James Harkins

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=20140126173657.562c97bc@aga-netbook \
    --to=mbork@wmi.amu.edu.pl \
    --cc=emacs-orgmode@gnu.org \
    /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).