[NTG-context] White space around synonyms
Johannes Graumann
johannes_graumann at web.de
Mon May 8 05:54:29 CEST 2006
Hello,
please take a look at the output of the code appended. I'm plagued by
incorrect white space around the output: to much before and after the
expanded '\infull' and short versions. How to remedy that?
Thanks ... it sure took me a while to find the '\executeifdefined'
tidbit ...
Joh
% setup 'synonymes' list called 'abbreviations'
\definesynonyms[abbreviation][abbreviations][\infull]
% give out in the list the ones used
\setupsynonyms[abbreviation][criterium=used]
% <abbreviations/> calls the completelist as a 'chapter'
\defineXMLargument
[abbreviations]
{\expanded{\completelistofabbreviations}}
% abbreviations are defined as follows
\defineXMLenvironment
[abbreviationdev]
[key=]
{
\defineXMLsave[short]
\defineXMLsave[full]
}
{
\abbreviation
[\XMLop{key}]
{\XMLflush{short}}
{\XMLflush{full}}
}
% abbreviations are recalled like this (short version is the default)
\defineXMLargument
[abbreviation]
[key=,opt=short]
{
\doifelse{\XMLop{opt}}{full}
{\infull{\XMLop{key}}}
{\executeifdefined{\XMLop{key}}}
}
\starttext
\startXMLdata
<abbreviationdev key="id">
<short>short</short>
<full>full description of ``short''</full>
</abbreviationdev>
<abbreviations/>
Blabla <abbreviation key="id" opt="short"/>.
More blabla <abbreviation key="id" opt="full"/>.
\stopXMLdata
\stoptext
More information about the ntg-context
mailing list