ntg-context - mailing list for ConTeXt users
 help / color / mirror / Atom feed
* White space around synonyms
@ 2006-05-08  3:54 Johannes Graumann
  2006-05-08  8:08 ` Hans Hagen
  0 siblings, 1 reply; 3+ messages in thread
From: Johannes Graumann @ 2006-05-08  3:54 UTC (permalink / raw)


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

^ permalink raw reply	[flat|nested] 3+ messages in thread

* Re: White space around synonyms
  2006-05-08  3:54 White space around synonyms Johannes Graumann
@ 2006-05-08  8:08 ` Hans Hagen
  2006-05-08 16:07   ` Johannes Graumann
  0 siblings, 1 reply; 3+ messages in thread
From: Hans Hagen @ 2006-05-08  8:08 UTC (permalink / raw)


Johannes Graumann wrote:
> 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}}}
>   }
>   
end lines in the definitions with % or use setups

(spurious spaces)

Hans


-----------------------------------------------------------------
                                          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
-----------------------------------------------------------------

^ permalink raw reply	[flat|nested] 3+ messages in thread

* Re: White space around synonyms
  2006-05-08  8:08 ` Hans Hagen
@ 2006-05-08 16:07   ` Johannes Graumann
  0 siblings, 0 replies; 3+ messages in thread
From: Johannes Graumann @ 2006-05-08 16:07 UTC (permalink / raw)


Hans Hagen wrote:

> end lines in the definitions with % or use setups
> 
> (spurious spaces)

Tststs, can't see the forest for the trees ... spend hours with things
like '\ignorespaces' and '\removeunwantedspaces' in various positions ... 

Thanks, Hans!

^ permalink raw reply	[flat|nested] 3+ messages in thread

end of thread, other threads:[~2006-05-08 16:07 UTC | newest]

Thread overview: 3+ messages (download: mbox.gz / follow: Atom feed)
-- links below jump to the message on this page --
2006-05-08  3:54 White space around synonyms Johannes Graumann
2006-05-08  8:08 ` Hans Hagen
2006-05-08 16:07   ` Johannes Graumann

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).