1 % \iffalse meta-comment
4 % The LaTeX3 Project and any individual authors listed elsewhere
7 % This file is part of the LaTeX base system.
8 % -------------------------------------------
10 % It may be distributed and/or modified under the
11 % conditions of the LaTeX Project Public License, either version 1.3c
12 % of this license or (at your option) any later version.
13 % The latest version of this license is in
14 % http://www.latex-project.org/lppl.txt
15 % and version 1.3c or later is part of all distributions of LaTeX
16 % version 2005/12/01 or later.
18 % This file has the LPPL maintenance status "maintained".
20 % The list of all files belonging to the LaTeX base distribution is
21 % given in the file `manifest.txt'. See also `legal.txt' for additional
24 % The list of derived (unpacked) files belonging to the distribution
25 % and covered by LPPL is defined by the unpacking scripts (with
26 % extension .ins) which are part of the distribution.
31 %% {Upper-case \A\B\C\D\E\F\G\H\I\J\K\L\M\N\O\P\Q\R\S\T\U\V\W\X\Y\Z
32 %% Lower-case \a\b\c\d\e\f\g\h\i\j\k\l\m\n\o\p\q\r\s\t\u\v\w\x\y\z
33 %% Digits \0\1\2\3\4\5\6\7\8\9
34 %% Exclamation \! Double quote \" Hash (number) \#
35 %% Dollar \$ Percent \% Ampersand \&
36 %% Acute accent \' Left paren \( Right paren \)
37 %% Asterisk \* Plus \+ Comma \,
38 %% Minus \- Point \. Solidus \/
39 %% Colon \: Semicolon \; Less than \<
40 %% Equals \= Greater than \> Question mark \?
41 %% Commercial at \@ Left bracket \[ Backslash \\
42 %% Right bracket \] Circumflex \^ Underscore \_
43 %% Grave accent \` Left brace \{ Vertical bar \|
44 %% Right brace \} Tilde \~}
48 % \changes{v2.1a}{1994/03/10}{Update for \LaTeXe}
50 % \DoNotIndex{\@cclvi,\@cclv,\@gobble,\@gobbletwo,\@ifnextchar}
51 % \DoNotIndex{\@M,\@tempboxa,\advance,\alloc,\begingroup,\bgroup}
52 % \DoNotIndex{\box,\count@,\def,\do,\docdate,\egroup,\endgroup}
53 % \DoNotIndex{\fi,\filedate,\fileversion,\font,\fontdimen,\global}
54 % \DoNotIndex{\ifinner,\ifnum,\immediate,\let,\long,\loop,\m@ne}
55 % \DoNotIndex{\noexpand,\relax,\repeat,\scriptfont}
56 % \DoNotIndex{\scriptscriptfont,\setbox,\sixt@@n,\space,\textfont}
57 % \DoNotIndex{\toks,\toksdef,\write,\xdef,\z@}%
60 %\title{The file \texttt{syntonly.dtx} for use with
61 % \LaTeXe.\thanks{This file has version
62 % number \fileversion, dated \filedate.}\\[2pt]
63 % It contains the code for \texttt{syntonly.sty}}
64 % \author{Frank Mittelbach \and Rainer Sch\"opf}
67 % \MaintainedByLaTeXTeam{latex}
70 % This package implements the |\syntaxonly| declaration for \LaTeXe.
71 % This command can be used in the preamble for running a document
72 % through \LaTeX{} without actually getting any output.
77 % \section{Identification}
79 % We identify the package and its current version.
80 % \changes{v2.1b}{1995/04/22}{Removed surplus \cs{typeout} lines}
81 % \changes{v2.1c}{1996/06/14}{Rearange \cs{GetFileInfo} useage.}
82 % \changes{v2.1d}{1998/08/17}{(RmS) Minor documentation fixes.}
85 %<package>\ProvidesPackage{syntonly}
87 \ProvidesFile{syntonly.dtx}
90 [1999/09/17 v2.1e Standard LaTeX2e package]
96 % \section{The documentation driver file}
98 % The next bit of code contains the documentation driver file for
99 % \TeX{}, i.e., the file that will produce the documentation you are
100 % currently reading. It will be extracted from this file by the \dst{}
104 \documentclass{ltxdoc}
105 \GetFileInfo{syntonly.dtx}
106 \providecommand\dst{\expandafter{\normalfont\scshape docstrip}}
108 \DocInput{syntonly.dtx}
115 % \section{Implementation}
121 % \begin{macro}{\dummyft@}
122 % First of all we need to define the `dummy' font.
124 \font\dummyft@=dummy \relax
127 % \changes{v2.1b}{1995/05/25}{Removed unneeded fontdimen settings for
130 % \begin{macro}{\ifsyntax@}
131 % Now we can define the `syntax only' feature. We define a switch
132 % |\if@syntax| so that any macro can always find out if it
133 % is really supposed to typeset text. Its default is to run in
141 % \begin{macro}{\syntaxonly}
142 % The |\syntaxonly| macro sets up everything for syntax
147 % First of all it sets the |syntax@| switch to \texttt{true}.
151 % Then it globally sets all fonts to the dummy font. These are:
152 % the current font outside math mode,
156 % and the $3\times16$ math fonts for the $16$ math \emph{groups}.
157 % We use a loop to set these.
163 \global\textfont\count@\dummyft@
164 \global\scriptfont\count@\dummyft@
165 \global\scriptscriptfont\count@\dummyft@
168 % Since all font changes occur either via |\selectfont| (in
169 % text or |\mathversion| (for math mode) it is sufficient
170 % to change these to no-ops. In addition we must prevent
171 % the loading of math fonts, this is done by making
172 % |\getanddefine@fonts| a no-op.
174 \global\let\selectfont\relax
175 \global\let\mathversion\@gobble
176 \global\let\getanddefine@fonts\@gobbletwo
178 % We prevent \TeX{} from complaining about the dummy font
179 % having no characters.
183 % Then we disable the output routine, and set |\frenchspacing|
184 % (which is slightly faster than |\nonfrenchspacing|).
185 % Finally we set |\hbadness| to $10000$ to avoid overfull box
194 % \changes{v2.1b}{1995/05/25}{Removed non-outer newtoks@: newtoks is no
197 % \begin{macro}{\nopages@}
198 % \changes{v1.0b}{1990/01/14}{Rewrite of the \cs{nopages@} macro to
199 % correctly handle footnote insertions, floats and marginpars.}
200 % The |\nopages@| macro disables the \LaTeX{} output routine.
201 % To this end we define a very simple output routine that empties
202 % the output \emph{and} footnote boxes (remember that the latter
206 \output {\setbox\z@\box\@cclv
207 \setbox\z@\box\footins
210 % Then we protect it against definition by a style file.
211 % \changes{v2.1b}{1995/05/25}{newtoks is no longer outer}
215 % But this is not enough: normally the \LaTeX{} output routine
216 % is responsible for dealing with floating objects.
217 % We therefore also redefine the internal macros for handling
218 % floats and marginpars.
220 \def\@xfloat##1[##2]{%
222 % There are a few things that have to be retained:
223 % the definition of |\@captype| since it is used by the
224 % |\caption| command,
225 % \changes{v1.0c}{1990/01/16}{Definition of \cs{@captype} added.}
229 % the error message issued when not in outer paragraph mode,
231 \ifinner\@parmoderr\fi
233 % and the |\@parboxrestore| command for the body of the
234 % float. This is necessary since it restores the original
235 % definitions of important commands like |\par| or |\\|.
237 \setbox\@tempboxa\vbox\bgroup\@parboxrestore}%
239 % |\end@float| must now only close the brace:
241 \let\end@float\egroup
243 % The above would be enough also for two-column floats with the
244 % kernel algorithm. However with the refined algorithm inside
245 % \texttt{fixlxt2e} this doesn't any longer work, so there we also
246 % need to explicitly overwrite the end macro for two-column floats
247 % (the begin is still okay as it resolves to |\@xfloat| eventually).
249 \let\end@dblfloat\egroup
251 % The redefinition of the |\marginpar| command is a bit more
252 % complicated since we have to check for the optional argument.
253 % First we redefine the command itself:
255 \def\marginpar{\ifinner\@parmoderr\fi
257 % We open a group so that everything gathered in a temporary box
258 % can easily be thrown away by closing it again (see below).
260 \begingroup \@ifnextchar [\@xmpar\@ympar}
262 % |\@xmpar| and |\@ympar| are now defined similar to
264 % If an optional argument is present |\@xmpar| typesets
265 % it in a temporary box that is thrown away later.
266 % Then it calls up |\@ympar| to process |\marginpar|'s
268 % \changes{v1.0d}{1990/01/21}{Added forgotten \cs{vbox}.}
270 \long\def\@xmpar[##1]{%
271 \setbox\@tempboxa\vbox{\@parboxrestore ##1}\@ympar}%
273 % |\@ympar| gathers its argument in the same temporary box
274 % and throws away its contents by closing the group opened up in
275 % |\marginpar| above.
276 % \changes{v1.0d}{1990/01/21}{Added forgotten \cs{vbox}.}
278 \long\def\@ympar##1{%
279 \setbox\@tempboxa\vbox{\@parboxrestore ##1}\endgroup}%
281 % And that's all we had to do.
287 % \begin{macro}{\@preamblecmds}
288 % We disable the use of the |\syntaxonly| command after
291 \@onlypreamble\syntaxonly