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.
32 % \changes{v2.1a}{1994/03/10}{Update for \LaTeXe}
34 % \DoNotIndex{\@cclvi,\@cclv,\@gobble,\@gobbletwo,\@ifnextchar}
35 % \DoNotIndex{\@M,\@tempboxa,\advance,\alloc,\begingroup,\bgroup}
36 % \DoNotIndex{\box,\count@,\def,\do,\docdate,\egroup,\endgroup}
37 % \DoNotIndex{\fi,\filedate,\fileversion,\font,\fontdimen,\global}
38 % \DoNotIndex{\ifinner,\ifnum,\immediate,\let,\long,\loop,\m@ne}
39 % \DoNotIndex{\noexpand,\relax,\repeat,\scriptfont}
40 % \DoNotIndex{\scriptscriptfont,\setbox,\sixt@@n,\space,\textfont}
41 % \DoNotIndex{\toks,\toksdef,\write,\xdef,\z@}%
44 %\title{The file \texttt{syntonly.dtx} for use with
45 % \LaTeXe.\thanks{This file has version
46 % number \fileversion, dated \filedate.}\\[2pt]
47 % It contains the code for \texttt{syntonly.sty}}
48 % \author{Frank Mittelbach \and Rainer Sch\"opf}
51 % \MaintainedByLaTeXTeam{latex}
54 % This package implements the |\syntaxonly| declaration for \LaTeXe.
55 % This command can be used in the preamble for running a document
56 % through \LaTeX{} without actually getting any output.
61 % \section{Identification}
63 % We identify the package and its current version.
64 % \changes{v2.1b}{1995/04/22}{Removed surplus \cs{typeout} lines}
65 % \changes{v2.1c}{1996/06/14}{Rearange \cs{GetFileInfo} useage.}
66 % \changes{v2.1d}{1998/08/17}{(RmS) Minor documentation fixes.}
69 %<package>\ProvidesPackage{syntonly}
71 \ProvidesFile{syntonly.dtx}
74 [1999/09/17 v2.1e Standard LaTeX2e package]
80 % \section{The documentation driver file}
82 % The next bit of code contains the documentation driver file for
83 % \TeX{}, i.e., the file that will produce the documentation you are
84 % currently reading. It will be extracted from this file by the \dst{}
88 \documentclass{ltxdoc}
89 \GetFileInfo{syntonly.dtx}
90 \providecommand\dst{\expandafter{\normalfont\scshape docstrip}}
92 \DocInput{syntonly.dtx}
99 % \section{Implementation}
105 % \begin{macro}{\dummyft@}
106 % First of all we need to define the `dummy' font.
108 \font\dummyft@=dummy \relax
111 % \changes{v2.1b}{1995/05/25}{Removed unneeded fontdimen settings for
114 % \begin{macro}{\ifsyntax@}
115 % Now we can define the `syntax only' feature. We define a switch
116 % |\if@syntax| so that any macro can always find out if it
117 % is really supposed to typeset text. Its default is to run in
125 % \begin{macro}{\syntaxonly}
126 % The |\syntaxonly| macro sets up everything for syntax
131 % First of all it sets the |syntax@| switch to \texttt{true}.
135 % Then it globally sets all fonts to the dummy font. These are:
136 % the current font outside math mode,
140 % and the $3\times16$ math fonts for the $16$ math \emph{groups}.
141 % We use a loop to set these.
147 \global\textfont\count@\dummyft@
148 \global\scriptfont\count@\dummyft@
149 \global\scriptscriptfont\count@\dummyft@
152 % Since all font changes occur either via |\selectfont| (in
153 % text or |\mathversion| (for math mode) it is sufficient
154 % to change these to no-ops. In addition we must prevent
155 % the loading of math fonts, this is done by making
156 % |\getanddefine@fonts| a no-op.
158 \global\let\selectfont\relax
159 \global\let\mathversion\@gobble
160 \global\let\getanddefine@fonts\@gobbletwo
162 % We prevent \TeX{} from complaining about the dummy font
163 % having no characters.
167 % Then we disable the output routine, and set |\frenchspacing|
168 % (which is slightly faster than |\nonfrenchspacing|).
169 % Finally we set |\hbadness| to $10000$ to avoid overfull box
178 % \changes{v2.1b}{1995/05/25}{Removed non-outer newtoks@: newtoks is no
181 % \begin{macro}{\nopages@}
182 % \changes{v1.0b}{1990/01/14}{Rewrite of the \cs{nopages@} macro to
183 % correctly handle footnote insertions, floats and marginpars.}
184 % The |\nopages@| macro disables the \LaTeX{} output routine.
185 % To this end we define a very simple output routine that empties
186 % the output \emph{and} footnote boxes (remember that the latter
190 \output {\setbox\z@\box\@cclv
191 \setbox\z@\box\footins
194 % Then we protect it against definition by a style file.
195 % \changes{v2.1b}{1995/05/25}{newtoks is no longer outer}
199 % But this is not enough: normally the \LaTeX{} output routine
200 % is responsible for dealing with floating objects.
201 % We therefore also redefine the internal macros for handling
202 % floats and marginpars.
204 \def\@xfloat##1[##2]{%
206 % There are a few things that have to be retained:
207 % the definition of |\@captype| since it is used by the
208 % |\caption| command,
209 % \changes{v1.0c}{1990/01/16}{Definition of \cs{@captype} added.}
213 % the error message issued when not in outer paragraph mode,
215 \ifinner\@parmoderr\fi
217 % and the |\@parboxrestore| command for the body of the
218 % float. This is necessary since it restores the original
219 % definitions of important commands like |\par| or |\\|.
221 \setbox\@tempboxa\vbox\bgroup\@parboxrestore}%
223 % |\end@float| must now only close the brace:
225 \let\end@float\egroup
227 % The above would be enough also for two-column floats with the
228 % kernel algorithm. However with the refined algorithm inside
229 % \texttt{fixlxt2e} this doesn't any longer work, so there we also
230 % need to explicitly overwrite the end macro for two-column floats
231 % (the begin is still okay as it resolves to |\@xfloat| eventually).
233 \let\end@dblfloat\egroup
235 % The redefinition of the |\marginpar| command is a bit more
236 % complicated since we have to check for the optional argument.
237 % First we redefine the command itself:
239 \def\marginpar{\ifinner\@parmoderr\fi
241 % We open a group so that everything gathered in a temporary box
242 % can easily be thrown away by closing it again (see below).
244 \begingroup \@ifnextchar [\@xmpar\@ympar}
246 % |\@xmpar| and |\@ympar| are now defined similar to
248 % If an optional argument is present |\@xmpar| typesets
249 % it in a temporary box that is thrown away later.
250 % Then it calls up |\@ympar| to process |\marginpar|'s
252 % \changes{v1.0d}{1990/01/21}{Added forgotten \cs{vbox}.}
254 \long\def\@xmpar[##1]{%
255 \setbox\@tempboxa\vbox{\@parboxrestore ##1}\@ympar}%
257 % |\@ympar| gathers its argument in the same temporary box
258 % and throws away its contents by closing the group opened up in
259 % |\marginpar| above.
260 % \changes{v1.0d}{1990/01/21}{Added forgotten \cs{vbox}.}
262 \long\def\@ympar##1{%
263 \setbox\@tempboxa\vbox{\@parboxrestore ##1}\endgroup}%
265 % And that's all we had to do.
271 % \begin{macro}{\@preamblecmds}
272 % We disable the use of the |\syntaxonly| command after
275 \@onlypreamble\syntaxonly