1 % \iffalse meta-comment
3 % Copyright 1993 1994 1995 1996 1997 1998 1999 2000 2001 2002 2003 2004 2005 2006 2007 2008 2009
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}
69 % This package implements the |\syntaxonly| declaration for \LaTeXe.
70 % This command can be used in the preamble for running a document
71 % through \LaTeX{} without actually getting any output.
76 % \section{Identification}
78 % We identify the package and its current version.
79 % \changes{v2.1b}{1995/04/22}{Removed surplus \cs{typeout} lines}
80 % \changes{v2.1c}{1996/06/14}{Rearange \cs{GetFileInfo} useage.}
81 % \changes{v2.1d}{1998/08/17}{(RmS) Minor documentation fixes.}
84 %<package>\ProvidesPackage{syntonly}
86 \ProvidesFile{syntonly.dtx}
89 [1999/09/17 v2.1e Standard LaTeX2e package]
95 % \section{The documentation driver file}
97 % The next bit of code contains the documentation driver file for
98 % \TeX{}, i.e., the file that will produce the documentation you are
99 % currently reading. It will be extracted from this file by the \dst{}
103 \documentclass{ltxdoc}
104 \GetFileInfo{syntonly.dtx}
105 \providecommand\dst{\expandafter{\normalfont\scshape docstrip}}
107 \DocInput{syntonly.dtx}
114 % \section{Implementation}
120 % \begin{macro}{\dummyft@}
121 % First of all we need to define the `dummy' font.
123 \font\dummyft@=dummy \relax
126 % \changes{v2.1b}{1995/05/25}{Removed unneeded fontdimen settings for
129 % \begin{macro}{\ifsyntax@}
130 % Now we can define the `syntax only' feature. We define a switch
131 % |\if@syntax| so that any macro can always find out if it
132 % is really supposed to typeset text. Its default is to run in
140 % \begin{macro}{\syntaxonly}
141 % The |\syntaxonly| macro sets up everything for syntax
146 % First of all it sets the |syntax@| switch to \texttt{true}.
150 % Then it globally sets all fonts to the dummy font. These are:
151 % the current font outside math mode,
155 % and the $3\times16$ math fonts for the $16$ math \emph{groups}.
156 % We use a loop to set these.
162 \global\textfont\count@\dummyft@
163 \global\scriptfont\count@\dummyft@
164 \global\scriptscriptfont\count@\dummyft@
167 % Since all font changes occur either via |\selectfont| (in
168 % text or |\mathversion| (for math mode) it is sufficient
169 % to change these to no-ops. In addition we must prevent
170 % the loading of math fonts, this is done by making
171 % |\getanddefine@fonts| a no-op.
173 \global\let\selectfont\relax
174 \global\let\mathversion\@gobble
175 \global\let\getanddefine@fonts\@gobbletwo
177 % We prevent \TeX{} from complaining about the dummy font
178 % having no characters.
182 % Then we disable the output routine, and set |\frenchspacing|
183 % (which is slightly faster than |\nonfrenchspacing|).
184 % Finally we set |\hbadness| to $10000$ to avoid overfull box
193 % \changes{v2.1b}{1995/05/25}{Removed non-outer newtoks@: newtoks is no
196 % \begin{macro}{\nopages@}
197 % \changes{v1.0b}{1990/01/14}{Rewrite of the \cs{nopages@} macro to
198 % correctly handle footnote insertions, floats and marginpars.}
199 % The |\nopages@| macro disables the \LaTeX{} output routine.
200 % To this end we define a very simple output routine that empties
201 % the output \emph{and} footnote boxes (remember that the latter
205 \output {\setbox\z@\box\@cclv
206 \setbox\z@\box\footins
209 % Then we protect it against definition by a style file.
210 % \changes{v2.1b}{1995/05/25}{newtoks is no longer outer}
214 % But this is not enough: normally the \LaTeX{} output routine
215 % is responsible for dealing with floating objects.
216 % We therefore also redefine the internal macros for handling
217 % floats and marginpars.
219 \def\@xfloat##1[##2]{%
221 % There are a few things that have to be retained:
222 % the definition of |\@captype| since it is used by the
223 % |\caption| command,
224 % \changes{v1.0c}{1990/01/16}{Definition of \cs{@captype} added.}
228 % the error message issued when not in outer paragraph mode,
230 \ifinner\@parmoderr\fi
232 % and the |\@parboxrestore| command for the body of the
233 % float. This is necessary since it restores the original
234 % definitions of important commands like |\par| or |\\|.
236 \setbox\@tempboxa\vbox\bgroup\@parboxrestore}%
238 % |\end@float| must now only close the brace:
240 \let\end@float\egroup
242 % The redefinition of the |\marginpar| command is a bit more
243 % complicated since we have to check for the optional argument.
244 % First we redefine the command itself:
246 \def\marginpar{\ifinner\@parmoderr\fi
248 % We open a group so that everything gathered in a temporary box
249 % can easily be thrown away by closing it again (see below).
251 \begingroup \@ifnextchar [\@xmpar\@ympar}
253 % |\@xmpar| and |\@ympar| are now defined similar to
255 % If an optional argument is present |\@xmpar| typesets
256 % it in a temporary box that is thrown away later.
257 % Then it calls up |\@ympar| to process |\marginpar|'s
259 % \changes{v1.0d}{1990/01/21}{Added forgotten \cs{vbox}.}
261 \long\def\@xmpar[##1]{%
262 \setbox\@tempboxa\vbox{\@parboxrestore ##1}\@ympar}%
264 % |\@ympar| gathers its argument in the same temporary box
265 % and throws away its contents by closing the group opened up in
266 % |\marginpar| above.
267 % \changes{v1.0d}{1990/01/21}{Added forgotten \cs{vbox}.}
269 \long\def\@ympar##1{%
270 \setbox\@tempboxa\vbox{\@parboxrestore ##1}\endgroup}%
272 % And that's all we had to do.
278 % \begin{macro}{\@preamblecmds}
279 % We disable the use of the |\syntaxonly| command after
282 \@onlypreamble\syntaxonly