From: "Thomas A. Schmitz" <thomas.schmitz@uni-bonn.de>
To: mailing list for ConTeXt users <ntg-context@ntg.nl>
Subject: defining and expanding in xml
Date: Fri, 23 Nov 2007 17:49:25 +0100 [thread overview]
Message-ID: <1195836565.5116.22.camel@g5.home> (raw)
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
___________________________________________________________________________________
next reply other threads:[~2007-11-23 16:49 UTC|newest]
Thread overview: 3+ messages / expand[flat|nested] mbox.gz Atom feed top
2007-11-23 16:49 Thomas A. Schmitz [this message]
2007-11-24 22:30 ` Hans Hagen
2007-11-26 20:14 ` Thomas A. Schmitz
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
* Reply using the --to, --cc, and --in-reply-to
switches of git-send-email(1):
git send-email \
--in-reply-to=1195836565.5116.22.camel@g5.home \
--to=thomas.schmitz@uni-bonn.de \
--cc=ntg-context@ntg.nl \
/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.
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).