From mboxrd@z Thu Jan 1 00:00:00 1970 X-Msuck: nntp://news.gmane.io/gmane.comp.tex.context/37489 Path: news.gmane.org!not-for-mail From: "Thomas A. Schmitz" Newsgroups: gmane.comp.tex.context Subject: defining and expanding in xml Date: Fri, 23 Nov 2007 17:49:25 +0100 Message-ID: <1195836565.5116.22.camel@g5.home> Reply-To: mailing list for ConTeXt users NNTP-Posting-Host: lo.gmane.org Mime-Version: 1.0 Content-Type: text/plain; charset="us-ascii" Content-Transfer-Encoding: 7bit X-Trace: ger.gmane.org 1195836671 30245 80.91.229.12 (23 Nov 2007 16:51:11 GMT) X-Complaints-To: usenet@ger.gmane.org NNTP-Posting-Date: Fri, 23 Nov 2007 16:51:11 +0000 (UTC) To: mailing list for ConTeXt users Original-X-From: ntg-context-bounces@ntg.nl Fri Nov 23 17:51:17 2007 Return-path: Envelope-to: gctc-ntg-context-518@m.gmane.org Original-Received: from ronja.vet.uu.nl ([131.211.172.88] helo=ronja.ntg.nl) by lo.gmane.org with esmtp (Exim 4.50) id 1IvbkJ-0003kF-M1 for gctc-ntg-context-518@m.gmane.org; Fri, 23 Nov 2007 17:51:15 +0100 Original-Received: from localhost (localhost [127.0.0.1]) by ronja.ntg.nl (Postfix) with ESMTP id 357711FCDD; Fri, 23 Nov 2007 17:50:45 +0100 (CET) Original-Received: from ronja.ntg.nl ([127.0.0.1]) by localhost (smtp.ntg.nl [127.0.0.1]) (amavisd-new, port 10024) with LMTP id 09490-03-9; Fri, 23 Nov 2007 17:50:18 +0100 (CET) Original-Received: from ronja.vet.uu.nl (localhost [127.0.0.1]) by ronja.ntg.nl (Postfix) with ESMTP id C740F1FCD0; Fri, 23 Nov 2007 17:50:18 +0100 (CET) Original-Received: from localhost (localhost [127.0.0.1]) by ronja.ntg.nl (Postfix) with ESMTP id C21BB1FC61 for ; Fri, 23 Nov 2007 17:50:03 +0100 (CET) Original-Received: from ronja.ntg.nl ([127.0.0.1]) by localhost (smtp.ntg.nl [127.0.0.1]) (amavisd-new, port 10024) with LMTP id 09965-03-4 for ; Fri, 23 Nov 2007 17:49:53 +0100 (CET) Original-Received: from mailout01.sul.t-online.com (mailout01.sul.t-online.de [194.25.134.80]) by ronja.ntg.nl (Postfix) with ESMTP id 3320F1FCD0 for ; Fri, 23 Nov 2007 17:49:49 +0100 (CET) Original-Received: from fwd31.aul.t-online.de by mailout01.sul.t-online.com with smtp id 1Ivbit-0001ZA-00; Fri, 23 Nov 2007 17:49:47 +0100 Original-Received: from [192.168.0.6] (E29qaUZOQhLJYGGB2NXUfg-eB03zF-ilK+y9CEuWGCzLxUTcYGaIrkmDzyzPnX2gbb@[91.18.109.180]) by fwd31.aul.t-online.de with esmtp id 1IvbiU-0rPKwS0; Fri, 23 Nov 2007 17:49:22 +0100 X-Mailer: Evolution 2.12.1 X-ID: E29qaUZOQhLJYGGB2NXUfg-eB03zF-ilK+y9CEuWGCzLxUTcYGaIrkmDzyzPnX2gbb@t-dialin.net X-TOI-MSGID: 3b1ed171-b515-4e23-ad4e-5508c2fb4749 X-Virus-Scanned: amavisd-new at ntg.nl X-BeenThere: ntg-context@ntg.nl X-Mailman-Version: 2.1.9 Precedence: list List-Id: mailing list for ConTeXt users List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , Original-Sender: ntg-context-bounces@ntg.nl Errors-To: ntg-context-bounces@ntg.nl X-Virus-Scanned: amavisd-new at ntg.nl Xref: news.gmane.org gmane.comp.tex.context:37489 Archived-At: 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 }. \par } \doif #1#2->\edef \!!stringa {#1} \edef \!!stringb {#2}\ifx \!!stringa \!!str... \checkfigureusersettings ...ntedfigurepage \empty {\let \wantedfigurepage \!... \calculateexternalfigure ...eckfigureusersettings \checkfigurecolorsettings ... ...lideNumber },width=.75\textwidth ][] \calculateexternalscreenfi... ... l.71 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
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 ___________________________________________________________________________________