Hi gurus, sorry for this long mail, but this is too difficult for me, and I have to apologize that I can't provide a minimal example. Here's what I want: I have one big xml-file which is my lecture course for the semester. Every single lecture is one section. This xml-file is processed (needless to say!) with ConTeXt. Every lecture is accompanied by a presentation, written in and processed by ConTeXt. The TeX files and the resulting pdfs are named by their dates, such as 07_11_23.pdf for today's lecture. I have defined a simple counter that will typeset a number in red at every place in the lecture where I show a new slide (and then increment the counter); here are the relevant definitions: \definelabel[SlideNumber][headstyle=normal,way=bytext] \define\SLN{\color[red]{[\nextSlideNumber]}} \defineXMLcommand[sln]{\sln} What I want: I would like to produce a "handout" of the lecture course which would include the slides at the relevant places. My idea was that everything is basically in place. I would simply need to define a "handout" mode which would redefine this \sln command and use the SlideNumber counter to insert the relevant pages from the presentation pdf. But I can't get it to work. Here's what I've tried: 1. the value of the \SlideNumber counter should be \currentSlideNumber, so basically I would like something along these lines: \define\sln {\externalfigure[presentations/07_11_23.pdf][page= \currentSlideNumber]\incrementSlideNumber} But this throws an error: ! Argument of \pp!doifinstringelse has an extra }. <inserted text> \par <to be read again> } \doif #1#2->\edef \!!stringa {#1} \edef \!!stringb {#2}\ifx \!!stringa \!!str... \checkfigureusersettings ...ntedfigurepage \empty {\let \wantedfigurepage \!... \calculateexternalfigure ...eckfigureusersettings \checkfigurecolorsettings ... <argument> ...lideNumber },width=.75\textwidth ][] \calculateexternalscreenfi... ... l.71 <SLN/> I assume it is an expansion problem. I tried page= \expanded{\currentSlideNumber]}, but that doesn't work either. So this is my first problem: how can I pass the value of SlideNumber on to the externalfigure command? 2. Next step: I would like to have the name of the corresponding presentation pdf in another macro so I can include this in the command definition as well. In TeX, I would simply write someting like \let\CurrentPresentation=07_11_23.pdf into my file and then refer to \CurrentPresentation. But how do I do this in XML? I was thinking something along the lines <section Current="07_11_23.pdf"> but am at a loss as to how to pick up this value later. Sorry for the long post; I'd be very happy if someone could provide some insights. Thomas
Thomas A. Schmitz wrote:
\define\sln {\externalfigure[presentations/07_11_23.pdf][page= \currentSlideNumber]\incrementSlideNumber}
does it work with simple filenames? like abc.pdf? ----------------------------------------------------------------- Hans Hagen | PRAGMA ADE Ridderstraat 27 | 8061 GH Hasselt | The Netherlands tel: 038 477 53 69 | fax: 038 477 53 74 | www.pragma-ade.com | www.pragma-pod.nl -----------------------------------------------------------------
On Nov 24, 2007, at 11:30 PM, Hans Hagen wrote:
Thomas A. Schmitz wrote:
\define\sln {\externalfigure[presentations/07_11_23.pdf][page= \currentSlideNumber]\incrementSlideNumber}
does it work with simple filenames? like abc.pdf?
Thank you, Hans. Wolfgang Schuster was kind enough to help me off- list; he provided a solution that works wonderfully. If anybody is interested, here's the relevant code: \def\CurPres#1{\gdef\doCurPres{#1}} \def\sln {\blank[line] \incrementSlideNumber % vor dem Bild notwendig? \midaligned{\externalfigure[\doCurPres] [page={\getnumber[SlideNumber]},width=.75\textwidth]} \blank[line]} and in order to provide the translation xml --> ConTeXt: \defineXMLargument [present] \CurPres Not sure if this is of interest to anybody; if it is, I'll wikify it. All best, and thanks to Wolfgang! Thomas
participants (2)
-
Hans Hagen
-
Thomas A. Schmitz