[NTG-context] How to preserve a TeX token list across passes (the ConTeXt way)?

2006-05-11 Thread Jyrki Ruuskanen
I made a plain TeX module for simple abbreviation and bibliography  
handling. The problem is it currently uses a temporary file to keep  
track of used bibs / abbreviations. Essentially it writes \addToList 
[\usedAbbreviations]{abbr} and \addToList[\usedReferences]{cite}  
commands to it, and this file is input on the second pass.

After finding out that ConTeXt *really is* well thought of and robust  
I changed the functionality to use TeXutil with \writeutilitycommand.  
Everything seems to work, the commands appear in .tui/.tuo files and  
are executed, but the token lists are empty when execution reaches  
the document. I couldn't figure out how to fix it as I don't yet know  
enough about the anatomy of a ConTeXt run and the system.

Jyrki Ruuskanen

___
ntg-context mailing list
ntg-context@ntg.nl
http://www.ntg.nl/mailman/listinfo/ntg-context


[NTG-context] How to preserve a TeX token list across passes (the ConTeXt way)?

2006-05-11 Thread Jyrki Ruuskanen
Ok, the module is read in cont-sys.rme with \usemodule[jtex]. It  
initializes the lists inside protect / unprotect pair with \newtoks 
\usedAbbreviations and \newtoks\usedReferences along with macro  
definitions.


Abbreviations are introduced with \setAbbreviation[key]{abbr} 
{meaning}{description} which defines macros \key \key@meaning  
and \key@description. Each call to \key calls \writeutilitycommand 
{\addToList[\string\usedAbbreviations]{key}, so after the first run  
the .tui file has a number of c \addToList[\usedAbbreviations] 
{something} lines in it.


Functionality is similar for the bibliography. The \cite command  
writes \addToList[\usedReferences]{cite} into .tui.


So, the .tuo file should populate used* lists and I could typeset the  
list of used abbreviations in initialization order with  
\executeListIntersection[\abbreviations][\usedAbbreviations] 
{\printAbbreviation}. Same for used bib references. But well, lists  
remain empty.


I'll attach the module and the .tui file.

And excuse me, I have never ever used a mailing list. How am I  
supposed to answer to a certain message in the chain? Thanks guys.


Jyrki



final.tui
Description: Binary data


t-jtex.tex
Description: Binary data
___
ntg-context mailing list
ntg-context@ntg.nl
http://www.ntg.nl/mailman/listinfo/ntg-context


[NTG-context] How to preserve a TeX token list across passes (the ConTeXt way)?

2006-05-11 Thread Jyrki Ruuskanen
Thanks for the cont-sys tip, good to know.Yes, I have used \definesynonyms, but I need abbreviations to have three levels: the abbreviation itself, the meaning of abbreviation and the description of the abbreviation (for example, "WWW" is short for "World Wide Web" and is described as a "Worldwide interconnected mess of multimedia, which took off in early 90's."). ConTeXt synonyms seem to have two.I'm sure there are a million ways of doing this. I decided to implement it from the ground up to learn some plain TeX. But now I need to integrate my macros with ConTeXt to make passing the lists graceful without extra auxiliary files and forced double runs.And as for the reply button, I guess I have to subscribe to get the mails in my mailbox. I'll do that now ;)Jyrki___
ntg-context mailing list
ntg-context@ntg.nl
http://www.ntg.nl/mailman/listinfo/ntg-context


[NTG-context] Need a dot after float caption number (\floatcaptionsuffix)

2006-05-02 Thread Jyrki Ruuskanen
I need a dot after float caption number. Page-flt.tex has a variable  
called \floatcaptionsuffix which can do this. Still, this should  
really be handled by a parameter in \setupcaptions, for example  
separator (which seems to be unused at the moment).

I edited page-flt.tex like so:
1423c1423
\hbox{\doattributes{\??kj#1}\c!headstyle\c!headcolor{\strut#2 
\@@kjkjseparator}}%
---
 \hbox{\doattributes{\??kj#1}\c!headstyle\c!headcolor 
{\strut#2\floatcaptionsuffix}}%
1824d1823
   \def\@@kjkjseparator {\getvalue{\??kj#4\c!separator}}%

Which gives me the dot with \setupcaptions[separator=.].

Jyrki Ruuskanen
___
ntg-context mailing list
ntg-context@ntg.nl
http://www.ntg.nl/mailman/listinfo/ntg-context