* defining and expanding in xml
@ 2007-11-23 16:49 Thomas A. Schmitz
2007-11-24 22:30 ` Hans Hagen
0 siblings, 1 reply; 3+ messages in thread
From: Thomas A. Schmitz @ 2007-11-23 16:49 UTC (permalink / raw)
To: mailing list for ConTeXt users
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
___________________________________________________________________________________
If your question is of interest to others as well, please add an entry to the Wiki!
maillist : ntg-context@ntg.nl / http://www.ntg.nl/mailman/listinfo/ntg-context
webpage : http://www.pragma-ade.nl / http://tex.aanhet.net
archive : https://foundry.supelec.fr/projects/contextrev/
wiki : http://contextgarden.net
___________________________________________________________________________________
^ permalink raw reply [flat|nested] 3+ messages in thread
* Re: defining and expanding in xml
2007-11-23 16:49 defining and expanding in xml Thomas A. Schmitz
@ 2007-11-24 22:30 ` Hans Hagen
2007-11-26 20:14 ` Thomas A. Schmitz
0 siblings, 1 reply; 3+ messages in thread
From: Hans Hagen @ 2007-11-24 22:30 UTC (permalink / raw)
To: mailing list for ConTeXt users
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
-----------------------------------------------------------------
___________________________________________________________________________________
If your question is of interest to others as well, please add an entry to the Wiki!
maillist : ntg-context@ntg.nl / http://www.ntg.nl/mailman/listinfo/ntg-context
webpage : http://www.pragma-ade.nl / http://tex.aanhet.net
archive : https://foundry.supelec.fr/projects/contextrev/
wiki : http://contextgarden.net
___________________________________________________________________________________
^ permalink raw reply [flat|nested] 3+ messages in thread
* Re: defining and expanding in xml
2007-11-24 22:30 ` Hans Hagen
@ 2007-11-26 20:14 ` Thomas A. Schmitz
0 siblings, 0 replies; 3+ messages in thread
From: Thomas A. Schmitz @ 2007-11-26 20:14 UTC (permalink / raw)
To: mailing list for ConTeXt users
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
___________________________________________________________________________________
If your question is of interest to others as well, please add an entry to the Wiki!
maillist : ntg-context@ntg.nl / http://www.ntg.nl/mailman/listinfo/ntg-context
webpage : http://www.pragma-ade.nl / http://tex.aanhet.net
archive : https://foundry.supelec.fr/projects/contextrev/
wiki : http://contextgarden.net
___________________________________________________________________________________
^ permalink raw reply [flat|nested] 3+ messages in thread
end of thread, other threads:[~2007-11-26 20:14 UTC | newest]
Thread overview: 3+ messages (download: mbox.gz / follow: Atom feed)
-- links below jump to the message on this page --
2007-11-23 16:49 defining and expanding in xml Thomas A. Schmitz
2007-11-24 22:30 ` Hans Hagen
2007-11-26 20:14 ` Thomas A. Schmitz
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 NNTP newsgroup(s).