ntg-context - mailing list for ConTeXt users
 help / color / mirror / Atom feed
From: Giuseppe Bilotta <bourbaki@bigfoot.com>
Subject: Reimplementing xspace
Date: Thu, 17 Jan 2002 13:43:19 +0100	[thread overview]
Message-ID: <356831848.20020117134319@bigfoot.com> (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?


             reply	other threads:[~2002-01-17 12:43 UTC|newest]

Thread overview: 10+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2002-01-17 12:43 Giuseppe Bilotta [this message]
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

Reply instructions:

You may reply publicly to this message via plain-text email
using any one of the following methods:

* Save the following mbox file, import it into your mail client,
  and reply-to-all from there: mbox

  Avoid top-posting and favor interleaved quoting:
  https://en.wikipedia.org/wiki/Posting_style#Interleaved_style

* Reply using the --to, --cc, and --in-reply-to
  switches of git-send-email(1):

  git send-email \
    --in-reply-to=356831848.20020117134319@bigfoot.com \
    --to=bourbaki@bigfoot.com \
    /path/to/YOUR_REPLY

  https://kernel.org/pub/software/scm/git/docs/git-send-email.html

* If your mail client supports setting the In-Reply-To header
  via mailto: links, try the mailto: link
Be sure your reply has a Subject: header at the top and a blank line before the message body.
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).