ntg-context - mailing list for ConTeXt users
 help / color / mirror / Atom feed
* Reimplementing xspace
@ 2002-01-17 12:43 Giuseppe Bilotta
  2002-01-17 22:03 ` Marco Kuhlmann
  2002-01-20 20:35 ` Hans Hagen
  0 siblings, 2 replies; 10+ messages in thread
From: Giuseppe Bilotta @ 2002-01-17 12:43 UTC (permalink / raw)


Hello,

this is another request from it.comp.software.tex: reimplementing
xspace. By itself the thing is pretty easy, you just need the
code:

\catcode`\@=11
\protected\def\xspace{\futurelet\@let@token\@xspace}
\def\@xspace{%
  \ifx\@let@token\bgroup\else
  \ifx\@let@token\egroup\else
  \ifx\@let@token\/\else
  \ifx\@let@token\ \else
  \ifx\@let@token~\else
  \ifx\@let@token.\else
  \ifx\@let@token!\else
  \ifx\@let@token,\else
  \ifx\@let@token:\else
  \ifx\@let@token;\else
  \ifx\@let@token?\else
  \ifx\@let@token/\else
  \ifx\@let@token'\else
  \ifx\@let@token)\else
  \ifx\@let@token-\else
  %\ifx\@let@token\@xobeysp\else %this would be
  %                              %nobreakspace
  \ifx\@let@token\space\else
  \ifx\@let@token\blankspace\else
   \space
   \fi\fi\fi\fi\fi\fi\fi\fi\fi\fi\fi\fi\fi\fi\fi\fi\fi\fi}
\catcode`\@=12

so the problem is rather on how to integrate this with the rest of
ConTeXt: there are some features of ConTeXt (e.g. logos,
abbreviations) for which obeying spaces should be an option. Right
now, you have to do something like:

\logo[tempTEX]{\TeX}
\def\TEX{\tempTEX\xspace}

to achieve the same result.

Any comments?


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

end of thread, other threads:[~2002-01-21 14:37 UTC | newest]

Thread overview: 10+ messages (download: mbox.gz / follow: Atom feed)
-- links below jump to the message on this page --
2002-01-17 12:43 Reimplementing xspace Giuseppe Bilotta
2002-01-17 22:03 ` Marco Kuhlmann
2002-01-17 23:05   ` Re[2]: " Giuseppe Bilotta
2002-01-17 23:12     ` Marco Kuhlmann
2002-01-18 11:23       ` Re[2]: " Giuseppe Bilotta
2002-01-20 20:12         ` Hans Hagen
2002-01-20 20:09       ` Hans Hagen
2002-01-20 19:50   ` Hans Hagen
2002-01-20 20:35 ` Hans Hagen
2002-01-21 14:37   ` Re[2]: " Giuseppe Bilotta

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