| 1 |
% \iffalse meta-comment |
| 2 |
% |
| 3 |
% Copyright (C) 1993-2025 |
| 4 |
% |
| 5 |
% The LaTeX Project and any individual authors listed elsewhere |
| 6 |
% in this file. |
| 7 |
% |
| 8 |
% This file is part of the Standard LaTeX `Tools Bundle'. |
| 9 |
% ------------------------------------------------------- |
| 10 |
% |
| 11 |
% It may be distributed and/or modified under the |
| 12 |
% conditions of the LaTeX Project Public License, either version 1.3c |
| 13 |
% of this license or (at your option) any later version. |
| 14 |
% The latest version of this license is in |
| 15 |
% https://www.latex-project.org/lppl.txt |
| 16 |
% and version 1.3c or later is part of all distributions of LaTeX |
| 17 |
% version 2005/12/01 or later. |
| 18 |
% |
| 19 |
% The list of all files belonging to the LaTeX `Tools Bundle' is |
| 20 |
% given in the file `manifest.txt'. |
| 21 |
% |
| 22 |
% \fi |
| 23 |
% \iffalse |
| 24 |
%% File: xspace.dtx Copyright (C) 1991-1997 David Carlisle |
| 25 |
%% File: xspace.dtx Copyright (C) 2004-2006 David Carlisle, |
| 26 |
%% Morten H\o gholm |
| 27 |
% |
| 28 |
%<*dtx> |
| 29 |
\ProvidesFile{xspace.dtx} |
| 30 |
%</dtx> |
| 31 |
%<package>\NeedsTeXFormat{LaTeX2e} |
| 32 |
%<package>\ProvidesPackage{xspace} |
| 33 |
%<driver>\ProvidesFile{xspace.drv} |
| 34 |
% \fi |
| 35 |
% \ProvidesFile{xspace.dtx} |
| 36 |
[2014/10/28 v1.13 Space after command names (DPC,MH)] |
| 37 |
% |
| 38 |
% \iffalse |
| 39 |
%<*driver> |
| 40 |
\documentclass{ltxdoc} |
| 41 |
\makeatletter |
| 42 |
\providecommand*\eTeX{{% |
| 43 |
\if b\expandafter\@car\f@series\@nil\boldmath\fi$\m@th |
| 44 |
\varepsilon$-\TeX}} |
| 45 |
\makeatother |
| 46 |
\usepackage{xspace}[2006/05/08] |
| 47 |
\begin{document} |
| 48 |
\DocInput{xspace.dtx} |
| 49 |
\end{document} |
| 50 |
%</driver> |
| 51 |
% \fi |
| 52 |
% |
| 53 |
% \GetFileInfo{xspace.dtx} |
| 54 |
% \title{The \textsf{xspace} package\thanks{This file |
| 55 |
% has version number \fileversion, last |
| 56 |
% revised \filedate.}} |
| 57 |
% \author{David Carlisle \and Morten H\o gholm} |
| 58 |
% \date{\filedate} |
| 59 |
% \MaintainedByLaTeXTeam{tools} |
| 60 |
% \maketitle |
| 61 |
% |
| 62 |
% %%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%% |
| 63 |
% |
| 64 |
% |
| 65 |
% \changes{v1.00}{1991/08/30}{Initial version} |
| 66 |
% \changes{v1.01}{1992/06/26}{Re-issue for the new doc and docstrip} |
| 67 |
% \changes{v1.02}{1994/01/31}{Re-issue for LaTeX2e (no change to |
| 68 |
% code)} |
| 69 |
% \changes{v1.07}{2004/12/07}{Make extensible. tools/3712} |
| 70 |
% \changes{v1.07}{2004/12/07}{Fix active characters. tools/3747} |
| 71 |
% \changes{v1.07}{2004/12/07}{Update documentation} |
| 72 |
% \changes{v1.08}{2005/05/07}{Better fix for active characters} |
| 73 |
% \changes{v1.09}{2005/07/26}{Improve test by exiting if |
| 74 |
% \cs{@let@token} is a letter} |
| 75 |
% \changes{v1.10}{2005/10/04}{Use higher level functions for |
| 76 |
% conditional processing} |
| 77 |
% \changes{v1.10}{2005/10/04}{Improve expansion method} |
| 78 |
% |
| 79 |
% \begin{abstract} |
| 80 |
% |\xspace| should be used at the end of a macro designed to |
| 81 |
% be used mainly in text. It adds a space unless the macro is |
| 82 |
% followed by certain punctuation characters. |
| 83 |
% \end{abstract} |
| 84 |
% |
| 85 |
% \section{Introduction} |
| 86 |
% \newcommand{\gb}{Great Britain\xspace}\DescribeMacro{\xspace} |
| 87 |
% After defining |\newcommand{\gb}{Great Britain\xspace}|, |
| 88 |
% the command |\gb| will determine when to insert a space |
| 89 |
% after itself and when not. Thus the input |
| 90 |
% \begin{quote} |
| 91 |
% |\gb is a very nice place to live.\\| \\ |
| 92 |
% |\gb, a small island off the coast of France.\\|\\ |
| 93 |
% |\gb\footnote{The small island off the coast of France.}|\\ |
| 94 |
% |is a very nice place to live.| |
| 95 |
% \end{quote} |
| 96 |
% results in the output |
| 97 |
% \begin{quote} |
| 98 |
% \gb is a very nice place to live. \\ |
| 99 |
% \gb, a small island off the coast of France.\\ |
| 100 |
% \gb\footnote{The small island off the coast of France.} |
| 101 |
% is a very nice place to live. |
| 102 |
% \end{quote} |
| 103 |
% |\xspace| saves the user from having to type \verb*+\ + or |
| 104 |
% |{}| after most occurrences of a macro name in text. |
| 105 |
% However if either of these constructions follows |\xspace|, |
| 106 |
% a space is not added by |\xspace|. This means that it is |
| 107 |
% safe to add |\xspace| to the end of an existing macro |
| 108 |
% without making too many changes in your document. In particular, |
| 109 |
% |\xspace| will always insert a space if the thing following it is |
| 110 |
% a normal letter which is the usual case. |
| 111 |
% |
| 112 |
% Sometimes |\xspace| may make the wrong decision, and add a |
| 113 |
% space when it is not required. There may be different |
| 114 |
% reasons for this behavior but it can always be handled by |
| 115 |
% following the macro with |{}|, as this has the effect of |
| 116 |
% suppressing the space. |
| 117 |
% |
| 118 |
% |
| 119 |
% \subsection{Adding new exceptions} |
| 120 |
% |
| 121 |
% One of the most common reasons for |\xspace| to add an |
| 122 |
% unwanted space is when it is followed by a macro not on its |
| 123 |
% list of exceptions. |
| 124 |
% \DescribeMacro{\xspaceaddexceptions}% |
| 125 |
% With |\xspaceaddexceptions| you can add new commands or |
| 126 |
% characters to be recognized by |\xspace|'s scanning |
| 127 |
% mechanism. Users of advanced footnote packages like |
| 128 |
% \textsf{manyfoot} will often define new footnote macros |
| 129 |
% that should not cause a command ``enhanced'' with |\xspace| |
| 130 |
% to insert a space. If you define the additional footnote |
| 131 |
% macros |\footnoteA| and |\footnoteB|, simply add the |
| 132 |
% following line to your preamble: |
| 133 |
% \begin{quote} |
| 134 |
% |\xspaceaddexceptions{\footnoteA \footnoteB}| |
| 135 |
% \end{quote} |
| 136 |
% |
| 137 |
% |
| 138 |
% \subsection{Support for active characters} |
| 139 |
% |
| 140 |
% |
| 141 |
% The other common instance of |\xspace| not working quite right |
| 142 |
% happens with active characters. Generally this package must be |
| 143 |
% loaded \emph{after} any language (or other) packages that make |
| 144 |
% punctuation characters `active'. This makes it difficult for |
| 145 |
% \textsf{xspace} to work flawlessly with the popular \textsf{babel} |
| 146 |
% package especially since the punctuation characters can switch |
| 147 |
% between being `active' and `other'. Starting at \textsf{xspace} |
| 148 |
% version~1.08 there are two different ways to handle this depending |
| 149 |
% on which engine your \LaTeX-format uses: |
| 150 |
% \begin{description} |
| 151 |
% \item[\TeX] The punctuation characters are added to the |
| 152 |
% exception list in both their normal and active states thus |
| 153 |
% ensuring that they are always recognized. |
| 154 |
% \item[\eTeX] The characters are re-read when going through |
| 155 |
% the exception list which means the internal comparison will test |
| 156 |
% against the current state of the character. This works for |
| 157 |
% whatever category code tricks some packages may use. |
| 158 |
% \end{description} |
| 159 |
% |
| 160 |
% At the time of writing all major \TeX\ distributions are using |
| 161 |
% \eTeX\ as engine for \LaTeX\ so usually everything should work out |
| 162 |
% of the box. If you find that you're running normal \TeX\ and |
| 163 |
% |\xspace| seems to be making the wrong choice then either use |{}| |
| 164 |
% as described above to fix it or add the character to the list but |
| 165 |
% with the desired category code. See the implementation for an example |
| 166 |
% of how to do that. |
| 167 |
% |
| 168 |
% \subsection{Still not satisfied?} |
| 169 |
% |
| 170 |
% Some people don't like the default list of exceptions so they can |
| 171 |
% remove one item at a time with the command |
| 172 |
% \DescribeMacro{\xspaceremoveexception}^^A |
| 173 |
% \cs{xspaceremoveexception}\marg{token}. Furthermore the command |
| 174 |
% \DescribeMacro{\@xspace@hook}\cs{@xspace@hook} can be redefined to |
| 175 |
% scan forward in the input stream in case you want to check more |
| 176 |
% tokens. It is called after \cs{xspace} has determined if it needed |
| 177 |
% to insert a space or if an exception was found (the default |
| 178 |
% definition is for \cs{@xspace@hook} to be empty). Hence you can use |
| 179 |
% \cs{unskip} to remove the space inserted if \cs{@let@token} matches |
| 180 |
% something special. Below is an example of how one can make sure an |
| 181 |
% endash gets a space inserted before it but a single dash not. |
| 182 |
% \begin{verbatim} |
| 183 |
% \xspaceremoveexception{-} |
| 184 |
% \makeatletter |
| 185 |
% \renewcommand*\@xspace@hook{% |
| 186 |
% \ifx\@let@token-% |
| 187 |
% \expandafter\@xspace@dash@i |
| 188 |
% \fi |
| 189 |
% } |
| 190 |
% \def\@xspace@dash@i-{\futurelet\@let@token\@xspace@dash@ii} |
| 191 |
% \def\@xspace@dash@ii{% |
| 192 |
% \ifx\@let@token-% |
| 193 |
% \else |
| 194 |
% \unskip |
| 195 |
% \fi |
| 196 |
% -% |
| 197 |
% } |
| 198 |
% \makeatother |
| 199 |
% \end{verbatim} |
| 200 |
% |
| 201 |
% |
| 202 |
% \MaybeStop{} |
| 203 |
% |
| 204 |
% \section{The Macros} |
| 205 |
% |
| 206 |
% |\xspace| peeks ahead for the next token. If the token is in our |
| 207 |
% exception list we break the loop and do nothing; else we try to |
| 208 |
% expand the token once and start over again. If this leads us to an |
| 209 |
% unexpandable token without finding one of the exceptions we insert a |
| 210 |
% space. |
| 211 |
% |
| 212 |
% \begin{macrocode} |
| 213 |
%<*package> |
| 214 |
% \end{macrocode} |
| 215 |
% |
| 216 |
% \begin{macro}{\xspace} |
| 217 |
% |\xspace| just looks ahead, and then calls |\@xspace|. |
| 218 |
% \changes{v1.03}{1994/11/15}{Make robust} |
| 219 |
% \begin{macrocode} |
| 220 |
\DeclareRobustCommand\xspace{\@xspace@firsttrue |
| 221 |
\futurelet\@let@token\@xspace} |
| 222 |
% \end{macrocode} |
| 223 |
% \end{macro} |
| 224 |
% |
| 225 |
% \begin{macro}{\if@xspace@first} |
| 226 |
% \changes{v1.11}{2006/02/12}{Added macro} |
| 227 |
% \begin{macro}{\@xspace@simple} |
| 228 |
% \changes{v1.11}{2006/02/12}{Added macro} |
| 229 |
% Some helpers to avoid multiple calls of |\@xspace@eTeX@setup|. |
| 230 |
% \begin{macrocode} |
| 231 |
\newif\if@xspace@first |
| 232 |
\def\@xspace@simple{\futurelet\@let@token\@xspace} |
| 233 |
% \end{macrocode} |
| 234 |
% \end{macro} |
| 235 |
% \end{macro} |
| 236 |
% |
| 237 |
% \begin{macro}{\@xspace@exceptions@tlp} |
| 238 |
% \changes{v1.07}{2004/12/07}{Added macro} |
| 239 |
% The exception list. If the scanning mechanism finds one of |
| 240 |
% these, it won't insert a space after the command. The |
| 241 |
% \texttt{tlp} in the name means `token list pointer.' |
| 242 |
% \begin{macrocode} |
| 243 |
\def\@xspace@exceptions@tlp{% |
| 244 |
,.'/?;:!~-)\ \/\bgroup\egroup\@sptoken\space\@xobeysp |
| 245 |
\footnote\footnotemark |
| 246 |
\xspace@check@icr |
| 247 |
} |
| 248 |
% \end{macrocode} |
| 249 |
% And here we get the non-empty definition of \cs{check@icr}. |
| 250 |
% \changes{v1.13}{2009/10/20}{fix for "tools/3895": `text font commands fool xspace'} |
| 251 |
% \begin{macrocode} |
| 252 |
\begingroup |
| 253 |
\text@command\relax |
| 254 |
\global\let\xspace@check@icr\check@icr |
| 255 |
\endgroup |
| 256 |
% \end{macrocode} |
| 257 |
% \end{macro} |
| 258 |
% |
| 259 |
% \begin{macro}{\xspaceaddexceptions} |
| 260 |
% \changes{v1.07}{2004/12/07}{Added macro} |
| 261 |
% The user command, which just adds tokens to the list. |
| 262 |
% \begin{macrocode} |
| 263 |
\newcommand*\xspaceaddexceptions{% |
| 264 |
\g@addto@macro\@xspace@exceptions@tlp |
| 265 |
} |
| 266 |
% \end{macrocode} |
| 267 |
% \end{macro} |
| 268 |
% \begin{macro}{\xspaceremoveexception} |
| 269 |
% \changes{v1.10}{2005/10/04}{Use higher level functions for |
| 270 |
% conditional processing} |
| 271 |
% This command removes an exception globally. |
| 272 |
% \begin{macrocode} |
| 273 |
\newcommand*\xspaceremoveexception[1]{% |
| 274 |
% \end{macrocode} |
| 275 |
% First check that it is in the list at all. |
| 276 |
% \begin{macrocode} |
| 277 |
\def\reserved@a##1#1##2##3\@@{% |
| 278 |
\@xspace@if@q@nil@NF##2{% |
| 279 |
% \end{macrocode} |
| 280 |
% It's in the list, remove it. |
| 281 |
% \begin{macrocode} |
| 282 |
\def\reserved@a####1#1####2\@@{% |
| 283 |
\gdef\@xspace@exceptions@tlp{####1####2}}% |
| 284 |
\expandafter\reserved@a\@xspace@exceptions@tlp\@@ |
| 285 |
}% |
| 286 |
}% |
| 287 |
\expandafter\reserved@a\@xspace@exceptions@tlp#1\@xspace@q@nil\@@ |
| 288 |
} |
| 289 |
% \end{macrocode} |
| 290 |
% \end{macro} |
| 291 |
% |
| 292 |
% \begin{macro}{\@xspace@break@loop} |
| 293 |
% \changes{v1.08}{2005/04/28}{Added macro} |
| 294 |
% \changes{v1.10}{2005/10/04}{Use quark instead} |
| 295 |
% To stop the loop. |
| 296 |
% \begin{macrocode} |
| 297 |
\def\@xspace@break@loop#1\@nil{} |
| 298 |
% \end{macrocode} |
| 299 |
% \end{macro} |
| 300 |
% |
| 301 |
% \begin{macro}{\@xspace@hook} |
| 302 |
% \changes{v1.09}{2005/07/26}{Added macro} |
| 303 |
% A hook for users with special needs. |
| 304 |
% \begin{macrocode} |
| 305 |
\providecommand*\@xspace@hook{} |
| 306 |
% \end{macrocode} |
| 307 |
% \end{macro} |
| 308 |
% |
| 309 |
% Now we check if we're running \eTeX. We can't use \cs{@ifundefined} |
| 310 |
% as that will lock catcodes and we need to change some of those. |
| 311 |
% As there is a small risk that someone already set \cs{eTeXversion} |
| 312 |
% to \cs{relax} by accident we make sure we check for that case but |
| 313 |
% without setting it to \cs{relax} if it wasn't already. |
| 314 |
% \begin{macrocode} |
| 315 |
\begingroup\expandafter\expandafter\expandafter\endgroup |
| 316 |
\expandafter\ifx\csname eTeXversion\endcsname\relax |
| 317 |
% \end{macrocode} |
| 318 |
% If we are running normal \TeX\ we add the most common cases of active |
| 319 |
% punctuation characters. First we make them active. |
| 320 |
% \begin{macrocode} |
| 321 |
\begingroup |
| 322 |
\catcode`\;=\active \catcode`\:=\active |
| 323 |
\catcode`\?=\active \catcode`\!=\active |
| 324 |
% \end{macrocode} |
| 325 |
% The \texttt{alltt} environment also makes |,|, |'|, and |-| active |
| 326 |
% so we add them as well. |
| 327 |
% \begin{macrocode} |
| 328 |
\catcode`\,=\active \catcode`\'=\active \catcode`\-=\active |
| 329 |
\xspaceaddexceptions{;:?!,'-} |
| 330 |
\endgroup |
| 331 |
\let\@xspace@eTeX@setup\relax |
| 332 |
% \end{macrocode} |
| 333 |
% \begin{macro}{\@xspace@eTeX@setup} |
| 334 |
% \changes{v1.10}{2005/10/04}{Added macro} |
| 335 |
% \changes{v1.12}{2006/05/08}{Bug fix for verbatim in output routine} |
| 336 |
% When we're running \eTeX, we have the advantage of \cs{scantokens} |
| 337 |
% which will rescan tokens with current catcodes. This little |
| 338 |
% expansion trick makes sure that the exception list is redefined to |
| 339 |
% itself but with the contents of it exposed to the current catcode |
| 340 |
% regime. That is why we must make sure the catcode of space is 10, |
| 341 |
% since we have a \verb*|\ | inside the list. |
| 342 |
% \begin{macrocode} |
| 343 |
\else |
| 344 |
\def\@xspace@eTeX@setup{% |
| 345 |
\begingroup |
| 346 |
\everyeof{}% |
| 347 |
\endlinechar=-1\relax |
| 348 |
\catcode`\ =10\relax |
| 349 |
\makeatletter |
| 350 |
% \end{macrocode} |
| 351 |
% We may also be so unfortunate that the re-reading of the list takes |
| 352 |
% place when the catcodes of |\|, |{| and |}| are ``other,'' e.g., if |
| 353 |
% it takes place in a header and the output routine was called in the |
| 354 |
% middle of a \texttt{verbatim} environment. |
| 355 |
% \begin{macrocode} |
| 356 |
\catcode`\\\z@ |
| 357 |
\catcode`\{\@ne |
| 358 |
\catcode`\}\tw@ |
| 359 |
\scantokens\expandafter{\expandafter\gdef |
| 360 |
\expandafter\@xspace@exceptions@tlp |
| 361 |
\expandafter{\@xspace@exceptions@tlp}}% |
| 362 |
\endgroup |
| 363 |
} |
| 364 |
\fi |
| 365 |
% \end{macrocode} |
| 366 |
% \end{macro} |
| 367 |
% \begin{macro}{\@xspace} |
| 368 |
% \changes{v1.03}{1994/11/15}{Add exclamation mark} |
| 369 |
% \changes{v1.04}{1996/05/17}{Add slash} |
| 370 |
% \changes{v1.05}{1996/12/06}{Add space for alltt etc. tools/2322} |
| 371 |
% \changes{v1.06}{1997/10/13}{Add normal space. tools/2632} |
| 372 |
% \changes{v1.07}{2004/12/07}{Now runs through a list of exceptions} |
| 373 |
% \changes{v1.07}{2004/12/07}{Added \cs{footnote} and |
| 374 |
% \cs{footnotemark}} |
| 375 |
% \changes{v1.08}{2005/05/07}{Use recursive loop instead of \cs{@tfor}} |
| 376 |
% \changes{v1.09}{2005/07/26}{Only check non-letters and add hook} |
| 377 |
% \changes{v1.10}{2005/10/04}{Use higher level functions for |
| 378 |
% conditional processing} |
| 379 |
% \changes{v1.10}{2005/10/04}{Improve expansion method} |
| 380 |
% If the next token is one of a specified list of characters, |
| 381 |
% do nothing, otherwise add a space. With version~1.07 the |
| 382 |
% approach was altered dramatically to run through the |
| 383 |
% exception list |\@xspace@exceptions@tlp| and check each |
| 384 |
% token one at a time. |
| 385 |
% \begin{macrocode} |
| 386 |
\def\@xspace{% |
| 387 |
% \end{macrocode} |
| 388 |
% Before we start checking the exception list it makes sense to |
| 389 |
% perform a quick check on the token in question. Most of the time |
| 390 |
% \cs{xspace} is used in regular text so \cs{@let@token} is set equal |
| 391 |
% to a letter. In that case there is no point in checking the list |
| 392 |
% because it will definitely not contain any tokens with catcode~11. |
| 393 |
% |
| 394 |
% You may wonder why there are special functions here instead of |
| 395 |
% simpler \cs{ifx} conditionals. The reason is that a)~this way we |
| 396 |
% don't have to add many, many \cs{expandafter}s to get the nesting |
| 397 |
% right and b)~we don't get into trouble when \cs{@let@token} has been |
| 398 |
% let equal to \cs{if} etc. |
| 399 |
% \begin{macrocode} |
| 400 |
\@xspace@lettoken@if@letter@TF \space{% |
| 401 |
% \end{macrocode} |
| 402 |
% Otherwise we start testing after setting up a few things. If running |
| 403 |
% \eTeX{} we rescan the catcodes but only the first time around. |
| 404 |
% \begin{macrocode} |
| 405 |
\if@xspace@first |
| 406 |
\@xspace@firstfalse |
| 407 |
\let\@xspace@maybespace\space |
| 408 |
\@xspace@eTeX@setup |
| 409 |
\fi |
| 410 |
\expandafter\@xspace@check@token |
| 411 |
\@xspace@exceptions@tlp\@xspace@q@nil\@nil |
| 412 |
% \end{macrocode} |
| 413 |
% If an exception was found \cs{@xspace@maybespace} is let to |
| 414 |
% \cs{relax} and we do nothing. |
| 415 |
% \begin{macrocode} |
| 416 |
\@xspace@token@if@equal@NNT \space \@xspace@maybespace |
| 417 |
% \end{macrocode} |
| 418 |
% Otherwise we check to see if we found something expandable and try |
| 419 |
% again with that token one level expanded. If no expandable token is |
| 420 |
% found we insert a space and then execute the hook. |
| 421 |
% \begin{macrocode} |
| 422 |
{% |
| 423 |
\@xspace@lettoken@if@expandable@TF |
| 424 |
{\expandafter\@xspace@simple}% |
| 425 |
{\@xspace@maybespace\@xspace@hook}% |
| 426 |
}% |
| 427 |
}% |
| 428 |
} |
| 429 |
% \end{macrocode} |
| 430 |
% \end{macro} |
| 431 |
% |
| 432 |
% \begin{macro}{\@xspace@check@token} |
| 433 |
% \changes{v1.07}{2004/12/07}{Added macro} |
| 434 |
% \changes{v1.08}{2005/05/07}{Made function recursive} |
| 435 |
% \changes{v1.10}{2005/10/04}{Use higher level functions for |
| 436 |
% conditional processing} |
| 437 |
% \changes{v1.11}{2006/02/12}{Modified so the \cs{@let@token} can be |
| 438 |
% \cs{outer}} |
| 439 |
% This macro just checks the current item in the exception list |
| 440 |
% against the \cs{@let@token}. If they are equal we make sure that no |
| 441 |
% space is inserted and break the loop. |
| 442 |
% \begin{macrocode} |
| 443 |
\def\@xspace@check@token #1{% |
| 444 |
\ifx\@xspace@q@nil#1% |
| 445 |
\expandafter\@xspace@break@loop |
| 446 |
\fi |
| 447 |
\expandafter\ifx\csname @let@token\endcsname#1% |
| 448 |
\let\@xspace@maybespace\relax |
| 449 |
\expandafter\@xspace@break@loop |
| 450 |
\fi |
| 451 |
\@xspace@check@token |
| 452 |
} |
| 453 |
% \end{macrocode} |
| 454 |
% \end{macro} |
| 455 |
% |
| 456 |
% That's all, folks! That is, if we were running \LaTeX3. In that case |
| 457 |
% we would have had nice functions for all the conditionals but here |
| 458 |
% we must define them ourselves. We also optimize them here as |
| 459 |
% \cs{@let@token} will always be the argument in some cases. |
| 460 |
% |
| 461 |
% \begin{macro}{\@xspace@if@lettoken@letter@TF} |
| 462 |
% \begin{macro}{\@xspace@if@lettoken@expandable@TF} |
| 463 |
% \begin{macro}{\@xspace@cs@if@equal@NNF} |
| 464 |
% First a few comparisons. |
| 465 |
% \begin{macrocode} |
| 466 |
\def\@xspace@lettoken@if@letter@TF{% |
| 467 |
\ifcat\noexpand\@let@token @% letter |
| 468 |
\expandafter\@firstoftwo |
| 469 |
\else |
| 470 |
\expandafter\@secondoftwo |
| 471 |
\fi} |
| 472 |
\def\@xspace@lettoken@if@expandable@TF{% |
| 473 |
\expandafter\ifx\noexpand\@let@token\@let@token% |
| 474 |
\expandafter\@secondoftwo |
| 475 |
\else |
| 476 |
\expandafter\@firstoftwo |
| 477 |
\fi |
| 478 |
} |
| 479 |
\def\@xspace@token@if@equal@NNT#1#2{% |
| 480 |
\ifx#1#2% |
| 481 |
\expandafter\@firstofone |
| 482 |
\else |
| 483 |
\expandafter\@gobble |
| 484 |
\fi} |
| 485 |
% \end{macrocode} |
| 486 |
% \end{macro} |
| 487 |
% \end{macro} |
| 488 |
% \end{macro} |
| 489 |
% \begin{macro}{\@xspace@q@nil} |
| 490 |
% \begin{macro}{\@xspace@if@q@nil@NF} |
| 491 |
% Some macros dealing with quarks. |
| 492 |
% \begin{macrocode} |
| 493 |
\def\@xspace@q@nil{\@xspace@q@nil} |
| 494 |
\def\@xspace@if@q@nil@NF#1{% |
| 495 |
\ifx\@xspace@q@nil#1% |
| 496 |
\expandafter\@gobble |
| 497 |
\else |
| 498 |
\expandafter\@firstofone |
| 499 |
\fi} |
| 500 |
% \end{macrocode} |
| 501 |
% \end{macro} |
| 502 |
% \end{macro} |
| 503 |
% \begin{macrocode} |
| 504 |
%</package> |
| 505 |
% \end{macrocode} |
| 506 |
% |
| 507 |
% \Finale |