From mboxrd@z Thu Jan 1 00:00:00 1970 From: Marcin Borkowski Subject: Re: Conditional source-block execution based on LaTeX document class? Date: Sun, 26 Jan 2014 17:36:57 +0100 Message-ID: <20140126173657.562c97bc@aga-netbook> References: Mime-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: quoted-printable Return-path: Received: from eggs.gnu.org ([2001:4830:134:3::10]:50038) by lists.gnu.org with esmtp (Exim 4.71) (envelope-from ) id 1W7Shl-00012g-Nc for emacs-orgmode@gnu.org; Sun, 26 Jan 2014 11:37:10 -0500 Received: from Debian-exim by eggs.gnu.org with spam-scanned (Exim 4.71) (envelope-from ) id 1W7Shg-0002ZH-VH for emacs-orgmode@gnu.org; Sun, 26 Jan 2014 11:37:05 -0500 Received: from msg.wmi.amu.edu.pl ([2001:808:114:2::50]:39906) by eggs.gnu.org with esmtp (Exim 4.71) (envelope-from ) id 1W7Shg-0002Yi-P1 for emacs-orgmode@gnu.org; Sun, 26 Jan 2014 11:37:00 -0500 Received: from localhost (localhost [127.0.0.1]) by msg.wmi.amu.edu.pl (Postfix) with ESMTP id B14A1663A6 for ; Sun, 26 Jan 2014 17:36:58 +0100 (CET) Received: from msg.wmi.amu.edu.pl ([127.0.0.1]) by localhost (msg.wmi.amu.edu.pl [127.0.0.1]) (amavisd-new, port 10024) with ESMTP id MmkYPnr4rIHE for ; Sun, 26 Jan 2014 17:36:58 +0100 (CET) Received: from aga-netbook (101-138.echostar.pl [213.156.101.138]) by msg.wmi.amu.edu.pl (Postfix) with ESMTPSA id 8EEDC663A5 for ; Sun, 26 Jan 2014 17:36:58 +0100 (CET) In-Reply-To: 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: emacs-orgmode@gnu.org Dnia 2014-01-26, o godz. 23:44:48 James Harkins napisa=C5=82(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. >=20 > 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.) >=20 > 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... >=20 > 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): >=20 > *** Some frame > **** A block > Some text >=20 > #+call: makegloss > #+results: makegloss >=20 > ... then the results of the src block to go into the frame, and then > beamer doesn't ignore them and everything works. >=20 > For the final article, I need a structure like this: >=20 > #+options: H:4 >=20 > * Day 1 > #+include "01-intro/01-contents.org" >=20 > * Day 2 > #+include "02-synthesis/02-contents.org" >=20 > And the problem is, if the #+call commands are replicated in each=20 > 0x-contents file, then I will have redundant \newglossaryentry > commands in the LaTeX output (in the end, multiplied five times). >=20 > 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. >=20 > 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, --=20 Marcin Borkowski http://octd.wmi.amu.edu.pl/en/Marcin_Borkowski Adam Mickiewicz University