From bf7e5eda82d5177d838d28170dce0f539f5e1687 Mon Sep 17 00:00:00 2001 From: Karl Berry Date: Wed, 11 Jan 2006 23:51:04 +0000 Subject: trunk/Master/texmf-dist/source/latex/base git-svn-id: svn://tug.org/texlive/trunk@151 c570f23f-e606-0410-a88d-b1316a301751 --- Master/texmf-dist/source/latex/base/Makefile.unx | 56 + Master/texmf-dist/source/latex/base/alltt.dtx | 213 + Master/texmf-dist/source/latex/base/alltt.ins | 79 + Master/texmf-dist/source/latex/base/autoload.ins | 148 + Master/texmf-dist/source/latex/base/classes.dtx | 4452 ++++++++++++++++++++ Master/texmf-dist/source/latex/base/classes.ins | 113 + Master/texmf-dist/source/latex/base/cmextra.ins | 142 + Master/texmf-dist/source/latex/base/cmfonts.fdd | 1300 ++++++ Master/texmf-dist/source/latex/base/cmfonts.ins | 113 + Master/texmf-dist/source/latex/base/doc.dtx | 4894 ++++++++++++++++++++++ Master/texmf-dist/source/latex/base/docstrip.dtx | 4349 +++++++++++++++++++ Master/texmf-dist/source/latex/base/docstrip.ins | 126 + Master/texmf-dist/source/latex/base/ec.ins | 130 + Master/texmf-dist/source/latex/base/exscale.dtx | 183 + Master/texmf-dist/source/latex/base/exscale.ins | 95 + Master/texmf-dist/source/latex/base/fixltx2e.dtx | 1791 ++++++++ Master/texmf-dist/source/latex/base/fixltx2e.ins | 82 + Master/texmf-dist/source/latex/base/fontdef.dtx | 1337 ++++++ Master/texmf-dist/source/latex/base/format.ins | 207 + Master/texmf-dist/source/latex/base/graphpap.dtx | 189 + Master/texmf-dist/source/latex/base/graphpap.ins | 78 + Master/texmf-dist/source/latex/base/ifthen.dtx | 527 +++ Master/texmf-dist/source/latex/base/ifthen.ins | 78 + Master/texmf-dist/source/latex/base/inputenc.dtx | 2745 ++++++++++++ Master/texmf-dist/source/latex/base/inputenc.ins | 169 + Master/texmf-dist/source/latex/base/latex209.dtx | 1147 +++++ Master/texmf-dist/source/latex/base/latex209.ins | 121 + Master/texmf-dist/source/latex/base/latexbug.el | 502 +++ Master/texmf-dist/source/latex/base/latexsym.dtx | 218 + Master/texmf-dist/source/latex/base/latexsym.ins | 141 + Master/texmf-dist/source/latex/base/letter.dtx | 1918 +++++++++ Master/texmf-dist/source/latex/base/letter.ins | 101 + Master/texmf-dist/source/latex/base/ltalloc.dtx | 176 + Master/texmf-dist/source/latex/base/ltbibl.dtx | 407 ++ Master/texmf-dist/source/latex/base/ltboxes.dtx | 1174 ++++++ Master/texmf-dist/source/latex/base/ltclass.dtx | 1694 ++++++++ Master/texmf-dist/source/latex/base/ltcntrl.dtx | 323 ++ Master/texmf-dist/source/latex/base/ltcounts.dtx | 434 ++ Master/texmf-dist/source/latex/base/ltdefns.dtx | 1455 +++++++ Master/texmf-dist/source/latex/base/ltdirchk.dtx | 911 ++++ Master/texmf-dist/source/latex/base/lterror.dtx | 821 ++++ Master/texmf-dist/source/latex/base/ltfiles.dtx | 862 ++++ Master/texmf-dist/source/latex/base/ltfinal.dtx | 631 +++ Master/texmf-dist/source/latex/base/ltfloat.dtx | 1314 ++++++ Master/texmf-dist/source/latex/base/ltfntcmd.dtx | 777 ++++ Master/texmf-dist/source/latex/base/ltfssbas.dtx | 1910 +++++++++ Master/texmf-dist/source/latex/base/ltfsscmp.dtx | 414 ++ Master/texmf-dist/source/latex/base/ltfssdcl.dtx | 1521 +++++++ Master/texmf-dist/source/latex/base/ltfssini.dtx | 583 +++ Master/texmf-dist/source/latex/base/ltfsstrc.dtx | 1887 +++++++++ Master/texmf-dist/source/latex/base/lthyphen.dtx | 158 + Master/texmf-dist/source/latex/base/ltidxglo.dtx | 217 + Master/texmf-dist/source/latex/base/ltlength.dtx | 152 + Master/texmf-dist/source/latex/base/ltlists.dtx | 1075 +++++ Master/texmf-dist/source/latex/base/ltlogos.dtx | 123 + Master/texmf-dist/source/latex/base/ltmath.dtx | 996 +++++ Master/texmf-dist/source/latex/base/ltmiscen.dtx | 796 ++++ Master/texmf-dist/source/latex/base/ltoutenc.dtx | 3320 +++++++++++++++ Master/texmf-dist/source/latex/base/ltoutenc.ins | 97 + Master/texmf-dist/source/latex/base/ltoutput.dtx | 3963 ++++++++++++++++++ Master/texmf-dist/source/latex/base/ltpage.dtx | 334 ++ Master/texmf-dist/source/latex/base/ltpageno.dtx | 101 + Master/texmf-dist/source/latex/base/ltpar.dtx | 196 + Master/texmf-dist/source/latex/base/ltpictur.dtx | 1487 +++++++ Master/texmf-dist/source/latex/base/ltplain.dtx | 1112 +++++ Master/texmf-dist/source/latex/base/ltsect.dtx | 866 ++++ Master/texmf-dist/source/latex/base/ltspace.dtx | 1000 +++++ Master/texmf-dist/source/latex/base/lttab.dtx | 1621 +++++++ Master/texmf-dist/source/latex/base/ltthm.dtx | 289 ++ Master/texmf-dist/source/latex/base/ltvers.dtx | 146 + Master/texmf-dist/source/latex/base/ltxdoc.dtx | 518 +++ Master/texmf-dist/source/latex/base/ltxref.dtx | 341 ++ Master/texmf-dist/source/latex/base/makeindx.dtx | 313 ++ Master/texmf-dist/source/latex/base/makeindx.ins | 96 + Master/texmf-dist/source/latex/base/newdc.ins | 122 + Master/texmf-dist/source/latex/base/newlfont.dtx | 219 + Master/texmf-dist/source/latex/base/nfssfont.dtx | 445 ++ Master/texmf-dist/source/latex/base/nfssfont.ins | 79 + Master/texmf-dist/source/latex/base/olddc.ins | 113 + Master/texmf-dist/source/latex/base/oldlfont.dtx | 267 ++ Master/texmf-dist/source/latex/base/preload.dtx | 284 ++ Master/texmf-dist/source/latex/base/proc.dtx | 456 ++ Master/texmf-dist/source/latex/base/proc.ins | 97 + Master/texmf-dist/source/latex/base/slides.dtx | 2724 ++++++++++++ Master/texmf-dist/source/latex/base/slides.ins | 197 + Master/texmf-dist/source/latex/base/slifonts.fdd | 485 +++ Master/texmf-dist/source/latex/base/source2e.tex | 477 +++ Master/texmf-dist/source/latex/base/syntonly.dtx | 289 ++ Master/texmf-dist/source/latex/base/syntonly.ins | 80 + Master/texmf-dist/source/latex/base/unpack.ins | 128 + Master/texmf-dist/source/latex/base/utf8ienc.dtx | 1221 ++++++ 91 files changed, 72038 insertions(+) create mode 100644 Master/texmf-dist/source/latex/base/Makefile.unx create mode 100644 Master/texmf-dist/source/latex/base/alltt.dtx create mode 100644 Master/texmf-dist/source/latex/base/alltt.ins create mode 100644 Master/texmf-dist/source/latex/base/autoload.ins create mode 100644 Master/texmf-dist/source/latex/base/classes.dtx create mode 100644 Master/texmf-dist/source/latex/base/classes.ins create mode 100644 Master/texmf-dist/source/latex/base/cmextra.ins create mode 100644 Master/texmf-dist/source/latex/base/cmfonts.fdd create mode 100644 Master/texmf-dist/source/latex/base/cmfonts.ins create mode 100644 Master/texmf-dist/source/latex/base/doc.dtx create mode 100644 Master/texmf-dist/source/latex/base/docstrip.dtx create mode 100644 Master/texmf-dist/source/latex/base/docstrip.ins create mode 100644 Master/texmf-dist/source/latex/base/ec.ins create mode 100644 Master/texmf-dist/source/latex/base/exscale.dtx create mode 100644 Master/texmf-dist/source/latex/base/exscale.ins create mode 100644 Master/texmf-dist/source/latex/base/fixltx2e.dtx create mode 100644 Master/texmf-dist/source/latex/base/fixltx2e.ins create mode 100644 Master/texmf-dist/source/latex/base/fontdef.dtx create mode 100644 Master/texmf-dist/source/latex/base/format.ins create mode 100644 Master/texmf-dist/source/latex/base/graphpap.dtx create mode 100644 Master/texmf-dist/source/latex/base/graphpap.ins create mode 100644 Master/texmf-dist/source/latex/base/ifthen.dtx create mode 100644 Master/texmf-dist/source/latex/base/ifthen.ins create mode 100644 Master/texmf-dist/source/latex/base/inputenc.dtx create mode 100644 Master/texmf-dist/source/latex/base/inputenc.ins create mode 100644 Master/texmf-dist/source/latex/base/latex209.dtx create mode 100644 Master/texmf-dist/source/latex/base/latex209.ins create mode 100644 Master/texmf-dist/source/latex/base/latexbug.el create mode 100644 Master/texmf-dist/source/latex/base/latexsym.dtx create mode 100644 Master/texmf-dist/source/latex/base/latexsym.ins create mode 100644 Master/texmf-dist/source/latex/base/letter.dtx create mode 100644 Master/texmf-dist/source/latex/base/letter.ins create mode 100644 Master/texmf-dist/source/latex/base/ltalloc.dtx create mode 100644 Master/texmf-dist/source/latex/base/ltbibl.dtx create mode 100644 Master/texmf-dist/source/latex/base/ltboxes.dtx create mode 100644 Master/texmf-dist/source/latex/base/ltclass.dtx create mode 100644 Master/texmf-dist/source/latex/base/ltcntrl.dtx create mode 100644 Master/texmf-dist/source/latex/base/ltcounts.dtx create mode 100644 Master/texmf-dist/source/latex/base/ltdefns.dtx create mode 100644 Master/texmf-dist/source/latex/base/ltdirchk.dtx create mode 100644 Master/texmf-dist/source/latex/base/lterror.dtx create mode 100644 Master/texmf-dist/source/latex/base/ltfiles.dtx create mode 100644 Master/texmf-dist/source/latex/base/ltfinal.dtx create mode 100644 Master/texmf-dist/source/latex/base/ltfloat.dtx create mode 100644 Master/texmf-dist/source/latex/base/ltfntcmd.dtx create mode 100644 Master/texmf-dist/source/latex/base/ltfssbas.dtx create mode 100644 Master/texmf-dist/source/latex/base/ltfsscmp.dtx create mode 100644 Master/texmf-dist/source/latex/base/ltfssdcl.dtx create mode 100644 Master/texmf-dist/source/latex/base/ltfssini.dtx create mode 100644 Master/texmf-dist/source/latex/base/ltfsstrc.dtx create mode 100644 Master/texmf-dist/source/latex/base/lthyphen.dtx create mode 100644 Master/texmf-dist/source/latex/base/ltidxglo.dtx create mode 100644 Master/texmf-dist/source/latex/base/ltlength.dtx create mode 100644 Master/texmf-dist/source/latex/base/ltlists.dtx create mode 100644 Master/texmf-dist/source/latex/base/ltlogos.dtx create mode 100644 Master/texmf-dist/source/latex/base/ltmath.dtx create mode 100644 Master/texmf-dist/source/latex/base/ltmiscen.dtx create mode 100644 Master/texmf-dist/source/latex/base/ltoutenc.dtx create mode 100644 Master/texmf-dist/source/latex/base/ltoutenc.ins create mode 100644 Master/texmf-dist/source/latex/base/ltoutput.dtx create mode 100644 Master/texmf-dist/source/latex/base/ltpage.dtx create mode 100644 Master/texmf-dist/source/latex/base/ltpageno.dtx create mode 100644 Master/texmf-dist/source/latex/base/ltpar.dtx create mode 100644 Master/texmf-dist/source/latex/base/ltpictur.dtx create mode 100644 Master/texmf-dist/source/latex/base/ltplain.dtx create mode 100644 Master/texmf-dist/source/latex/base/ltsect.dtx create mode 100644 Master/texmf-dist/source/latex/base/ltspace.dtx create mode 100644 Master/texmf-dist/source/latex/base/lttab.dtx create mode 100644 Master/texmf-dist/source/latex/base/ltthm.dtx create mode 100644 Master/texmf-dist/source/latex/base/ltvers.dtx create mode 100644 Master/texmf-dist/source/latex/base/ltxdoc.dtx create mode 100644 Master/texmf-dist/source/latex/base/ltxref.dtx create mode 100644 Master/texmf-dist/source/latex/base/makeindx.dtx create mode 100644 Master/texmf-dist/source/latex/base/makeindx.ins create mode 100644 Master/texmf-dist/source/latex/base/newdc.ins create mode 100644 Master/texmf-dist/source/latex/base/newlfont.dtx create mode 100644 Master/texmf-dist/source/latex/base/nfssfont.dtx create mode 100644 Master/texmf-dist/source/latex/base/nfssfont.ins create mode 100644 Master/texmf-dist/source/latex/base/olddc.ins create mode 100644 Master/texmf-dist/source/latex/base/oldlfont.dtx create mode 100644 Master/texmf-dist/source/latex/base/preload.dtx create mode 100644 Master/texmf-dist/source/latex/base/proc.dtx create mode 100644 Master/texmf-dist/source/latex/base/proc.ins create mode 100644 Master/texmf-dist/source/latex/base/slides.dtx create mode 100644 Master/texmf-dist/source/latex/base/slides.ins create mode 100644 Master/texmf-dist/source/latex/base/slifonts.fdd create mode 100644 Master/texmf-dist/source/latex/base/source2e.tex create mode 100644 Master/texmf-dist/source/latex/base/syntonly.dtx create mode 100644 Master/texmf-dist/source/latex/base/syntonly.ins create mode 100644 Master/texmf-dist/source/latex/base/unpack.ins create mode 100644 Master/texmf-dist/source/latex/base/utf8ienc.dtx (limited to 'Master/texmf-dist/source/latex/base') diff --git a/Master/texmf-dist/source/latex/base/Makefile.unx b/Master/texmf-dist/source/latex/base/Makefile.unx new file mode 100644 index 00000000000..414293e93b0 --- /dev/null +++ b/Master/texmf-dist/source/latex/base/Makefile.unx @@ -0,0 +1,56 @@ + +######################################################################## +# Start of customization section +######################################################################## + +# The directory where all runtime files reside +DESTDIR= + +# The directory where the format files reside +FORMATDIR= + +######### Edit the following only if you want to move *.fd or *.ist +######### to a different place. + +# The directory where the .fd files reside: +FDDIR=$(DESTDIR) + +# The directory where class and package files reside: +INPUTDIR=$(DESTDIR) + +# The directory where the makeindex style files reside +ISTDIR=$(DESTDIR) + +######################################################################## +# End of customization section +######################################################################## + +FORMAT=latex + + +default: + @if test ! "${DESTDIR}" -o ! "$(FORMATDIR)" ; then \ + echo "Destination directories not set." ; \ + echo "Please edit the Makefile first!" ; \ + exit 1 ; \ + else \ + make format ; \ + fi + + +format: $(FORMAT).fmt + +$(FORMAT).fmt: $(FORMAT).ltx + initex $(FORMAT).ltx + + +install: $(FORMAT).fmt + cp -i $(FORMAT).fmt $(FORMATDIR) + cp -i *.fd $(FDDIR) + cp -i *.cls *.clo *.sty *.def *.tex $(INPUTDIR) + cp -i *.ist $(ISTDIR) + +clean: + rm $(FORMAT).fmt + rm *.dvi *.log *.aux *.glo *.idx *.ind *.gls *.lof *.lot *.toc + diff --git a/Master/texmf-dist/source/latex/base/alltt.dtx b/Master/texmf-dist/source/latex/base/alltt.dtx new file mode 100644 index 00000000000..9b546ca9d82 --- /dev/null +++ b/Master/texmf-dist/source/latex/base/alltt.dtx @@ -0,0 +1,213 @@ +% \iffalse meta-comment +% +% Copyright 1993 1994 1995 1996 1997 1998 1999 2000 2001 2002 2003 2004 +% The LaTeX3 Project and any individual authors listed elsewhere +% in this file. +% +% This file is part of the LaTeX base system. +% ------------------------------------------- +% +% It may be distributed and/or modified under the +% conditions of the LaTeX Project Public License, either version 1.3 +% of this license or (at your option) any later version. +% The latest version of this license is in +% http://www.latex-project.org/lppl.txt +% and version 1.3 or later is part of all distributions of LaTeX +% version 2003/12/01 or later. +% +% This file has the LPPL maintenance status "maintained". +% +% The list of all files belonging to the LaTeX base distribution is +% given in the file `manifest.txt'. See also `legal.txt' for additional +% information. +% +% The list of derived (unpacked) files belonging to the distribution +% and covered by LPPL is defined by the unpacking scripts (with +% extension .ins) which are part of the distribution. +% +% \fi +% \CheckSum{108} +% \iffalse +%% +%% File `alltt.dtx'. +%% Copyright (C) 1987 by Leslie Lamport +%% Copyright (C) 1994--1997 LaTeX3 project, Johannes Braams +%% all rights reserved. +%% +%<*dtx> +\ProvidesFile{alltt.dtx} +% +%\NeedsTeXFormat{LaTeX2e} +%\ProvidesPackage{alltt} +%\ProvidesFile{alltt.drv} +%\ProvidesFile{alltt.dtx} + [1997/06/16 v2.0g defines alltt environment] +% +%<*driver> +\documentclass{ltxdoc} +\begin{document} +\providecommand{\Lenv}[1]{\textsf{#1}} +\providecommand{\pkg}[1]{\texttt{#1}} +\providecommand{\file}[1]{\texttt{#1}} +\DocInput{alltt.dtx} +\end{document} +% +% \fi +% +% \changes{v2.0g}{1997/06/16}{A few documentation fixes (PR 2520)} +% \changes{v2.0d}{1995/04/02}{A few documentation fixes (PR 1517)} +% +% \GetFileInfo{alltt.dtx} +% \title{The \texttt{alltt} environment\thanks{This file +% has version number \fileversion, last +% revised \filedate.}} +% \author{Johannes Braams} +% \date{\filedate} +% \maketitle +% +% \begin{abstract} +% This package defines the \Lenv{alltt} environment, which is like +% the \Lenv{verbatim} environment except that |\|, |{|, and |}| +% have their usual meanings. +% +% Thus, other commands and environments can appear within an +% \Lenv{alltt} environment. +% \end{abstract} +% +% \section{Introduction} +% +% \DescribeEnv{alltt} +% Here are some things you may want to do in an \Lenv{alltt} +% environment: +% \begin{itemize} +% \item Change fonts--e.g., by typing |{\em emphasized text\/}| +% +% \item Insert text from a file \file{foo.tex} by typing +% |\input{foo}|. Beware that each || starts a new line, so +% if \file{foo.tex} ends with a || you can wind up with an +% extra blank line if you're not careful. +% +% \item Insert a math formula. Note that |$| just produces a dollar +% sign, so you'll have to type |\(...\)| or |\[...\]|. Also, |^| +% and |_| just produce their characters; use |\sp| or |\sb| for +% super- and subscripts, as in |\(x\sp{2}\)|. +% \end{itemize} +% +% \StopEventually{} +% +% \section{The Implementation} +% +% \begin{macrocode} +%<*package> +% \end{macrocode} +% +% \begin{environment}{alltt} +% The \Lenv{alltt} environment is similar to the \Lenv{verbatim} +% environment, except that |\|, |{| and |}| have their usual +% behaviour. +% \changes{v2.0b}{1994/10/29}{Added a missing \cs{dospecials}} +% \changes{v2.0c}{1995/01/27}{Reset \cs{dospecials} after its changed +% version is executed} +% \changes{v2.0e}{1995/05/13}{brought definition up to date with the +% verbatim environment} +% \changes{v2.0e}{1995/05/13}{Save and restore (in math mode) the +% definition of the \texttt{'} character} +% \begin{macrocode} +\begingroup +\lccode`\~=`\' +\lowercase{\endgroup +\newenvironment{alltt}{% + \trivlist + \item\relax + \if@minipage + \else + \vskip\parskip + \fi + \leftskip\@totalleftmargin + \rightskip\z@skip + \parindent\z@ + \parfillskip\@flushglue + \parskip\z@skip + \@@par + \@tempswafalse + \def\par{% + \if@tempswa + \leavevmode\null\@@par\penalty\interlinepenalty + \else + \@tempswatrue + \ifhmode\@@par\penalty\interlinepenalty\fi + \fi} + \obeylines + \verbatim@font + \let\org@prime~% + \@noligs +% \end{macrocode} +% \changes{v2.0f}{1995/07/24}{Added setting of the \cs{catcode} of the +% \texttt{'} character} +% \begin{macrocode} + \everymath\expandafter{\the\everymath + \catcode`\'=12 \let~\org@prime} + \everydisplay\expandafter{\the\everydisplay + \catcode`\'=12 \let~\org@prime} + \let\org@dospecials\dospecials + \g@remfrom@specials{\\} + \g@remfrom@specials{\{} + \g@remfrom@specials{\}} + \let\do\@makeother + \dospecials + \let\dospecials\org@dospecials + \frenchspacing\@vobeyspaces + \everypar \expandafter{\the\everypar \unpenalty}} +{\endtrivlist}} +% \end{macrocode} +% \end{environment} +% +% \begin{macro}{\g@remfrom@specials} +% In the old implementation of the \pkg{alltt} package a fixed +% |\dospecials| was used. However nowadays the |\dospecials| +% command might contain more special characters at run-time then as +% was defined in the format. Therefore we remove the necessary +% special character from |\dospecials| at the start of the +% \Lenv{alltt} environment. For this we need a macro. Remember that +% the list of special characters in |\dospecials| contains the +% control sequence |\do| between the characters. We use that to +% check whether a character has to be removed. +% +% The macro |\g@remfrom@specials| takes one argument, the chracter +% to be removed from the list. +% \begin{macrocode} +\def\g@remfrom@specials#1{% +% \end{macrocode} +% We build up a new list in |\@new@speicals|. +% \begin{macrocode} + \def\@new@specials{} +% \end{macrocode} +% The command |\@remove| compares its argument with the argument of\\ +% |\g@remfrom@specials|. +% \begin{macrocode} + \def\@remove##1{% + \ifx##1#1\else +% \end{macrocode} +% When they are not the same the argument of |\@remove| is added +% (together with |\do|) to the new list. +% \begin{macrocode} + \g@addto@macro\@new@specials{\do ##1}\fi} +% \end{macrocode} +% Now we |\let| |\do| be equal to |\@remove| and execute +% |\dospecials|. +% \begin{macrocode} + \let\do\@remove\dospecials +% \end{macrocode} +% All that's left is to make |\dospecials| point to the new list. +% \begin{macrocode} + \let\dospecials\@new@specials + } +% \end{macrocode} +% \end{macro} +% +% \begin{macrocode} +% +% \end{macrocode} +% +% \Finale +\endinput diff --git a/Master/texmf-dist/source/latex/base/alltt.ins b/Master/texmf-dist/source/latex/base/alltt.ins new file mode 100644 index 00000000000..eceb19c9c86 --- /dev/null +++ b/Master/texmf-dist/source/latex/base/alltt.ins @@ -0,0 +1,79 @@ +%% +%% This file will generate fast loadable files and documentation +%% driver files from the doc files in this package when run through +%% LaTeX or TeX. +%% +%% Copyright 1993 1994 1995 1996 1997 1998 1999 2000 2001 2002 2003 2004 +%% The LaTeX3 Project and any individual authors listed elsewhere +%% in this file. +%% +%% This file is part of the LaTeX base system. +%% ------------------------------------------- +%% +%% It may be distributed and/or modified under the +%% conditions of the LaTeX Project Public License, either version 1.3 +%% of this license or (at your option) any later version. +%% The latest version of this license is in +%% http://www.latex-project.org/lppl.txt +%% and version 1.3 or later is part of all distributions of LaTeX +%% version 2003/12/01 or later. +%% +%% This file has the LPPL maintenance status "maintained". +%% +%% In particular, NO PERMISSION is granted to modify the contents of this +%% file since it contains the legal notices that are placed in the files +%% it generates. +%% +%% The list of all files belonging to the LaTeX base distribution is +%% given in the file `manifest.txt'. See also `legal.txt' for additional +%% information. +%% +%% +%% +%% +%% --------------- start of docstrip commands ------------------ +%% + +\input docstrip + +\preamble + +This is a generated file. + +Copyright 1993 1994 1995 1996 1997 1998 1999 2000 2001 2002 2003 2004 +The LaTeX3 Project and any individual authors listed elsewhere +in this file. + +This file was generated from file(s) of the LaTeX base system. +-------------------------------------------------------------- + +It may be distributed and/or modified under the +conditions of the LaTeX Project Public License, either version 1.3 +of this license or (at your option) any later version. +The latest version of this license is in + http://www.latex-project.org/lppl.txt +and version 1.3 or later is part of all distributions of LaTeX +version 2003/12/01 or later. + +This file has the LPPL maintenance status "maintained". + +This file may only be distributed together with a copy of the LaTeX +base system. You may however distribute the LaTeX base system without +such generated files. + +The list of all files belonging to the LaTeX base distribution is +given in the file `manifest.txt'. See also `legal.txt' for additional +information. + +The list of derived (unpacked) files belonging to the distribution +and covered by LPPL is defined by the unpacking scripts (with +extension .ins) which are part of the distribution. +\endpreamble + +\keepsilent +\usedir{tex/latex/base} + +\generateFile{alltt.sty}{t}{% + \from{alltt.dtx}{package}} + +\endbatchfile diff --git a/Master/texmf-dist/source/latex/base/autoload.ins b/Master/texmf-dist/source/latex/base/autoload.ins new file mode 100644 index 00000000000..62da1132621 --- /dev/null +++ b/Master/texmf-dist/source/latex/base/autoload.ins @@ -0,0 +1,148 @@ +%% +%% This file will generate fast loadable files and documentation +%% driver files from the doc files in this package when run through +%% LaTeX or TeX. +%% +%% Copyright 1993 1994 1995 1996 1997 1998 1999 2000 2001 2002 2003 2004 +%% The LaTeX3 Project and any individual authors listed elsewhere +%% in this file. +%% +%% This file is part of the LaTeX base system. +%% ------------------------------------------- +%% +%% It may be distributed and/or modified under the +%% conditions of the LaTeX Project Public License, either version 1.3 +%% of this license or (at your option) any later version. +%% The latest version of this license is in +%% http://www.latex-project.org/lppl.txt +%% and version 1.3 or later is part of all distributions of LaTeX +%% version 2003/12/01 or later. +%% +%% This file has the LPPL maintenance status "maintained". +%% +%% In particular, NO PERMISSION is granted to modify the contents of this +%% file since it contains the legal notices that are placed in the files +%% it generates. +%% +%% The list of all files belonging to the LaTeX base distribution is +%% given in the file `manifest.txt'. See also `legal.txt' for additional +%% information. +%% +%% +%% +%% +%% --------------- start of docstrip commands ------------------ +%% + +\input docstrip + +\keepsilent +\declarepreamble\mainpreamble + +This is a generated file. + +Copyright 1993 1994 1995 1996 1997 1998 1999 2000 2001 2002 2003 2004 +The LaTeX3 Project and any individual authors listed elsewhere +in this file. + +This file was generated from file(s) of the LaTeX base system. +-------------------------------------------------------------- + +It may be distributed and/or modified under the +conditions of the LaTeX Project Public License, either version 1.3 +of this license or (at your option) any later version. +The latest version of this license is in + http://www.latex-project.org/lppl.txt +and version 1.3 or later is part of all distributions of LaTeX +version 2003/12/01 or later. + +This file has the LPPL maintenance status "maintained". + +This file may only be distributed together with a copy of the LaTeX +base system. You may however distribute the LaTeX base system without +such generated files. + +The list of all files belonging to the LaTeX base distribution is +given in the file `manifest.txt'. See also `legal.txt' for additional +information. + +The list of derived (unpacked) files belonging to the distribution +and covered by LPPL is defined by the unpacking scripts (with +extension .ins) which are part of the distribution. +\endpreamble +\usepreamble\mainpreamble +\usedir{tex/latex/base} + +\generate{ + \file{latexa.ltx}{% + \from{ltdirchk.dtx}{initex,2ekernel,dircheck} + \from{ltplain.dtx}{autoload} + \from{ltvers.dtx}{2ekernel,autoload} + \from{ltdefns.dtx}{2ekernel,autoload} + \from{ltalloc.dtx}{2ekernel} + \from{ltcntrl.dtx}{2ekernel} + \from{lterror.dtx}{autoload} + \from{ltpar.dtx}{2ekernel} + \from{ltspace.dtx}{2ekernel} + \from{ltlogos.dtx}{2ekernel} + \from{ltfiles.dtx}{autoload} + \from{ltoutenc.dtx}{autoload} + \from{ltfssbas.dtx}{autoload} + \from{ltfsstrc.dtx}{autoload} + \from{ltfsscmp.dtx}{compat,2ekernel} + \from{ltfssdcl.dtx}{autoload} + \from{ltfssini.dtx}{compat} + \from{ltfntcmd.dtx}{2ekernel} + \from{ltcounts.dtx}{2ekernel} + \from{ltpageno.dtx}{2ekernel} + \from{ltxref.dtx}{2ekernel} + \from{ltlength.dtx}{2ekernel} + \from{ltmiscen.dtx}{2ekernel} + \from{ltmath.dtx}{2ekernel} + \from{ltlists.dtx}{2ekernel} + \from{ltboxes.dtx}{2ekernel} + \from{lttab.dtx}{autoload} + \from{ltpictur.dtx}{autoload} + \from{ltthm.dtx}{2ekernel} + \from{ltsect.dtx}{2ekernel} + \from{ltfloat.dtx}{2ekernel} + \from{ltidxglo.dtx}{2ekernel} + \from{ltbibl.dtx}{2ekernel} + \from{ltpage.dtx}{2ekernel} + \from{ltoutput.dtx}{autoload} + \from{ltclass.dtx}{2ekernel} + \from{ltfinal.dtx}{2ekernel}} + \file{autopict.sty}{% + \from{ltpictur.dtx}{def}} + \file{autotabg.sty}{% + \from{lttab.dtx}{def}} + \file{autoerr.sty}{% + \from{ltplain.dtx}{autoerr} + \from{lterror.dtx}{def} + \from{ltfiles.dtx}{autoerr} + \from{ltoutenc.dtx}{autoerr} + \from{ltfssbas.dtx}{autoerr} + \from{ltfssdcl.dtx}{autoerr}} + \file{autofss1.sty}{% + \from{ltfssbas.dtx}{def1} + \from{ltfsstrc.dtx}{def1}} +% This one is disabled at present. +% \file{autofss2.sty}}{% +% \from{ltfssbas.dtx}{def2} +% \from{ltfsstrc.dtx}{def2}} + \file{autoout1.sty}{% + \from{ltoutput.dtx}{def1}} +} + + +\Msg{} +\Msg{***********************************} +\Msg{*} +\Msg{* Now run INITEX on latexa.ltx} +\Msg{* to generate the auto-load version} +\Msg{* of LaTeX.} +\Msg{*} +\Msg{***********************************} +\Msg{} + +\endbatchfile diff --git a/Master/texmf-dist/source/latex/base/classes.dtx b/Master/texmf-dist/source/latex/base/classes.dtx new file mode 100644 index 00000000000..498bed48e0b --- /dev/null +++ b/Master/texmf-dist/source/latex/base/classes.dtx @@ -0,0 +1,4452 @@ +% \iffalse meta-comment +% +% Copyright 1993 1994 1995 1996 1997 1998 1999 2000 2001 2002 2003 2004 +% The LaTeX3 Project and any individual authors listed elsewhere +% in this file. +% +% This file is part of the LaTeX base system. +% ------------------------------------------- +% +% It may be distributed and/or modified under the +% conditions of the LaTeX Project Public License, either version 1.3 +% of this license or (at your option) any later version. +% The latest version of this license is in +% http://www.latex-project.org/lppl.txt +% and version 1.3 or later is part of all distributions of LaTeX +% version 2003/12/01 or later. +% +% This file has the LPPL maintenance status "maintained". +% +% The list of all files belonging to the LaTeX base distribution is +% given in the file `manifest.txt'. See also `legal.txt' for additional +% information. +% +% The list of derived (unpacked) files belonging to the distribution +% and covered by LPPL is defined by the unpacking scripts (with +% extension .ins) which are part of the distribution. +% +% \fi +% \CheckSum{2976} +%% \CharacterTable +%% {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 +%% 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 +%% Digits \0\1\2\3\4\5\6\7\8\9 +%% Exclamation \! Double quote \" Hash (number) \# +%% Dollar \$ Percent \% Ampersand \& +%% Acute accent \' Left paren \( Right paren \) +%% Asterisk \* Plus \+ Comma \, +%% Minus \- Point \. Solidus \/ +%% Colon \: Semicolon \; Less than \< +%% Equals \= Greater than \> Question mark \? +%% Commercial at \@ Left bracket \[ Backslash \\ +%% Right bracket \] Circumflex \^ Underscore \_ +%% Grave accent \` Left brace \{ Vertical bar \| +%% Right brace \} Tilde \~} +% +% \iffalse +% \section{Identification} +% +% These document classes can only be used with \LaTeXe, so we make +% sure that an appropriate message is displayed when another \TeX{} +% format is used. +% \changes{v1.3p}{1995/11/30}{Added date of \LaTeX\ format to argument +% of \cs{NeedsTeXFormat}} +% \begin{macrocode} +%\NeedsTeXFormat{LaTeX2e}[1995/12/01] +% \end{macrocode} +% +% Announce the Class name and its version: +% \begin{macrocode} +%
\ProvidesClass{article} +%\ProvidesClass{report} +%\ProvidesClass{book} +%<10pt&!bk>\ProvidesFile{size10.clo} +%<11pt&!bk>\ProvidesFile{size11.clo} +%<12pt&!bk>\ProvidesFile{size12.clo} +%<10pt&bk>\ProvidesFile{bk10.clo} +%<11pt&bk>\ProvidesFile{bk11.clo} +%<12pt&bk>\ProvidesFile{bk12.clo} +%<*driver> +\ProvidesFile{classes.drv} +% + [2004/02/16 v1.4f +% Standard LaTeX document class] +%<10pt|11pt|12pt> Standard LaTeX file (size option)] +% \end{macrocode} +% +% \section{A driver for this document} +% +% The next bit of code contains the documentation driver file for +% \TeX{}, i.e., the file that will produce the documentation you are +% currently reading. It will be extracted from this file by the +% {\sc docstrip} program. +% +% \changes{1.0f}{1993/12/07}{Use class ltxdoc document class} +% \changes{1.0r}{1994/02/28}{Moved driver code in order not to need a +% separate driver} +% \begin{macrocode} +%<*driver> +] +\documentclass{ltxdoc} +% \end{macrocode} +% +% We don't want everything to appear in the index +% \begin{macrocode} +\DoNotIndex{\',\.,\@M,\@@input,\@Alph,\@alph,\@addtoreset,\@arabic} +\DoNotIndex{\@badmath,\@centercr,\@cite} +\DoNotIndex{\@dotsep,\@empty,\@float,\@gobble,\@gobbletwo,\@ignoretrue} +\DoNotIndex{\@input,\@ixpt,\@m,\@minus,\@mkboth} +\DoNotIndex{\@ne,\@nil,\@nomath,\@plus,\roman,\@set@topoint} +\DoNotIndex{\@tempboxa,\@tempcnta,\@tempdima,\@tempdimb} +\DoNotIndex{\@tempswafalse,\@tempswatrue,\@viipt,\@viiipt,\@vipt} +\DoNotIndex{\@vpt,\@warning,\@xiipt,\@xipt,\@xivpt,\@xpt,\@xviipt} +\DoNotIndex{\@xxpt,\@xxvpt,\\,\ ,\addpenalty,\addtolength,\addvspace} +\DoNotIndex{\advance,\ast,\begin,\begingroup,\bfseries,\bgroup,\box} +\DoNotIndex{\bullet} +\DoNotIndex{\cdot,\cite,\CodelineIndex,\cr,\day,\DeclareOption} +\DoNotIndex{\def,\DisableCrossrefs,\divide,\DocInput,\documentclass} +\DoNotIndex{\DoNotIndex,\egroup,\ifdim,\else,\fi,\em,\endtrivlist} +\DoNotIndex{\EnableCrossrefs,\end,\end@dblfloat,\end@float,\endgroup} +\DoNotIndex{\endlist,\everycr,\everypar,\ExecuteOptions,\expandafter} +\DoNotIndex{\fbox} +\DoNotIndex{\filedate,\filename,\fileversion,\fontsize,\framebox,\gdef} +\DoNotIndex{\global,\halign,\hangindent,\hbox,\hfil,\hfill,\hrule} +\DoNotIndex{\hsize,\hskip,\hspace,\hss,\if@tempswa,\ifcase,\or,\fi,\fi} +\DoNotIndex{\ifhmode,\ifvmode,\ifnum,\iftrue,\ifx,\fi,\fi,\fi,\fi,\fi} +\DoNotIndex{\input} +\DoNotIndex{\jobname,\kern,\leavevmode,\let,\leftmark} +\DoNotIndex{\list,\llap,\long,\m@ne,\m@th,\mark,\markboth,\markright} +\DoNotIndex{\month,\newcommand,\newcounter,\newenvironment} +\DoNotIndex{\NeedsTeXFormat,\newdimen} +\DoNotIndex{\newlength,\newpage,\nobreak,\noindent,\null,\number} +\DoNotIndex{\numberline,\OldMakeindex,\OnlyDescription,\p@} +\DoNotIndex{\pagestyle,\par,\paragraph,\paragraphmark,\parfillskip} +\DoNotIndex{\penalty,\PrintChanges,\PrintIndex,\ProcessOptions} +\DoNotIndex{\protect,\ProvidesClass,\raggedbottom,\raggedright} +\DoNotIndex{\refstepcounter,\relax,\renewcommand} +\DoNotIndex{\rightmargin,\rightmark,\rightskip,\rlap,\rmfamily} +\DoNotIndex{\secdef,\selectfont,\setbox,\setcounter,\setlength} +\DoNotIndex{\settowidth,\sfcode,\skip,\sloppy,\slshape,\space} +\DoNotIndex{\symbol,\the,\trivlist,\typeout,\tw@,\undefined,\uppercase} +\DoNotIndex{\usecounter,\usefont,\usepackage,\vfil,\vfill,\viiipt} +\DoNotIndex{\viipt,\vipt,\vskip,\vspace} +\DoNotIndex{\wd,\xiipt,\year,\z@} +% \end{macrocode} +% We do want an index, using linenumbers +% \begin{macrocode} +\EnableCrossrefs +% \end{macrocode} +% We use so many \file{docstrip} modules that we set the +% \texttt{StandardModuleDepth} counter to 1. +% \begin{macrocode} +\setcounter{StandardModuleDepth}{1} +% \end{macrocode} +% The following command retrieves the date and version information +% from the file. +% \begin{macrocode} +\GetFileInfo{classes.drv} +% \end{macrocode} +% Some commonly used abbreviations +% \changes{v1.2w}{1994/12/01}{Use \cs{newcommand*}} +% \begin{macrocode} +\newcommand*{\Lopt}[1]{\textsf {#1}} +\newcommand*{\file}[1]{\texttt {#1}} +\newcommand*{\Lcount}[1]{\textsl {\small#1}} +\newcommand*{\pstyle}[1]{\textsl {#1}} +% \end{macrocode} +% We also want the full details. +% \begin{macrocode} +\begin{document} +\DocInput{classes.dtx} +\PrintIndex +% ^^A\PrintChanges +\end{document} +% +% \end{macrocode} +% +% \fi +% +% \changes{v1.0d}{1993/11/30}{remove \cs{@in}, made option makeindex +% a synonym for option makeidx} +% \changes{v1.0d}{1993/11/30}{removed \cs{@minus}, \cs{@plus}, +% \cs{@settopoint}, \cs{@setfontsize}; they are now in the +% kernel} +% \changes{v1.0d}{1993/11/30}{Added use of \cs{NeedsTeXFormat}} +% \changes{v1.0d}{1993/11/30}{Replaced \cs{bf} with \cs{bfseries}; +% \cs{rm} with \cs{rmfamily}} +% \changes{v1.0d}{1993/11/30}{Made eqaution and eqnarray environments +% in the fleqn option up to date with latex.dtx} +% \changes{v1.0f}{1993/12/08}{Made all lines shorter than 72 characters} +% \changes{v1.0g}{1993/12/08}{Made change in eqnarray for the fleqn +% option, as suggested by Rainer.} +% \changes{v1.0h}{1993/12/18}{Made the definitions of the font- and +% size-changing commands use \cs{renew} rather than \cs{new}. +% Defined the float parameters with \cs{renewcommand} rather than +% \cs{newcommand}. Corrected some typos in the fleqn option. +% Replaced two occurrences of -\cs{@secpenalty} by +% \cs{@secpenalty}. ASAJ.} +% \changes{v1.0j}{1993/12/20}{Added \cs{ProvidesFile} to size files} +% \changes{v1.0j}{1993/12/10}{Use \cs{cmd} in change entries} +% \changes{v1.0k}{1994/01/09}{Removed some typos/bugs} +% \changes{v1.0l}{1994/01/11}{add the extension to the names of the +% files} +% \changes{v1.0l}{1994/01/10}{Changed version numbering; moved leqno +% and fleqn options to an external file.} +% \changes{v1.0n}{1994/01/19}{Removed code for makeidx option and made +% it a separate package; removed use of \cs{setlength} from list +% parameters.} +% \changes{v1.0o}{1994/01/31}{Small documention changes} +% \changes{v1.0q}{1994/02/16}{Small documention changes} +% \changes{v1.1a}{1994/03/12}{Removed \cs{typeout} messages} +% \changes{v1.1f}{1994/04/15}{Inserted forgotten line break} +% \changes{v1.2a}{1994/03/17}{Added openright option. (LL)} +% \changes{v1.2b}{1994/03/17}{Added the \ldots{}matter commands. (LL)} +% \changes{v1.2c}{1994/03/17}{Fixed page numbering in titlepage +% env. (LL)} +% \changes{v1.2d}{1994/04/11}{Checked the file for long lines and +% wrapped them when necessary; made a slight implementation +% modification to the openright and openany options.} +% \changes{v1.2i}{1994/04/28}{Use LaTeX instead of LaTeX2e in messages} +% \changes{v1.2j}{1994/05/01}{Removed the use of \cs{fileversion} +% c.s.} +% \changes{v1.2l}{1994/05/11}{changed some \cs{changes} entries} +% \changes{v1.2m}{1994/05/12}{Forgot a few entries} +% \changes{v1.2o}{1994/05/24}{Changed file information} +% \changes{v1.2p}{1994/05/27}{Moved identification and driver to the +% front of the file} +% \changes{v1.2t}{1994/06/22}{Refrased a few sentences to prevent +% overfull hboxes} +% \changes{v1.2v}{1994/12/01}{Made the oneside option work for the +% book class} +% \changes{v1.2w}{1994/12/01}{Use \cs{newcommand*} for commands with +% arguments} +% \changes{v1.2z}{1995/05/16}{Always use \cs{cs} in \cs{changes} +% entries} +% \changes{v1.3a}{1995/05/17}{Replaced all \cs{hbox to} by \cs{hb@xt@}} +% \changes{v1.3d}{1995/06/05}{Replaced all \cs{uppercase} by +% \cs{MakeUppercase}} +% \changes{v1.3l}{1995/10/20}{Disabled in compatibility mode all +% options that are new in \LaTeXe.} +% \changes{v1.3v}{1997/06/16}{Documentation fixes.} +% +% +% \title{Standard Document Classes for \LaTeX{} version 2e\thanks{This +% file has version number \fileversion, last revised \filedate.}} +% +% \author{% +% Copyright (C) 1992 by Leslie Lamport \and +% Copyright (C) 1994-97 by Frank Mittelbach \and Johannes Braams +% } +% \date{\filedate} +% \maketitle +% \tableofcontents +% +% \StopEventually{} ^^A +% +% \section{The {\sc docstrip} modules} +% +% The following modules are used in the implementation to direct +% {\sc docstrip} in generating the external files: +% \begin{center} +% \begin{tabular}{ll} +% article & produce the documentclass article\\ +% report & produce the documentclass report\\ +% size10 & produce the class option for 10pt\\ +% size11 & produce the class option for 11pt\\ +% size12 & produce the class option for 12pt\\ +% book & produce the documentclass book\\ +% bk10 & produce the book class option for 10pt\\ +% bk11 & produce the book class option for 11pt\\ +% bk12 & produce the book class option for 12pt\\ +% driver & produce a documentation driver file \\ +% \end{tabular} +% \end{center} +% +% \section{Initial Code} +% +% In this part we define a few commands that are used later on. +% +% \begin{macro}{\@ptsize} +% This control sequence is used to store the second digit of the +% pointsize we are typesetting in. So, normally, it's value is one +% of 0, 1 or 2. +% \begin{macrocode} +%<*article|report|book> +\newcommand\@ptsize{} +% \end{macrocode} +% \end{macro} +% +% \begin{macro}{\if@restonecol} +% When the document has to printed in two columns, we sometimes +% have to temporarily switch to one column. This switch is used to +% remember to switch back. +% \begin{macrocode} +\newif\if@restonecol +% \end{macrocode} +% \end{macro} +% +% \begin{macro}{\if@titlepage} +% A switch to indicate if a titlepage has to be produced. For the +% article document class the default is not to make a separate +% titlepage. +% \begin{macrocode} +\newif\if@titlepage +%
\@titlepagefalse +%\@titlepagetrue +% \end{macrocode} +% \end{macro} +% +% \begin{macro}{\if@openright} +% A switch to indicate if chapters must start on a right-hand page. +% The default for the report class is no; for the book class it's +% yes. +% \begin{macrocode} +%\newif\if@openright +% \end{macrocode} +% \end{macro} +% +% \changes{v1.3k}{1995/08/27}{Macro \cs{if@openbib} removed} +% +% \begin{macro}{\if@mainmatter} +% \changes{v1.2v}{1994/12/01}{Moved the allocation of +% \cs{if@mainmatter} here} +% +% The switch |\if@mainmatter|, only available in the document class +% book, indicates whether we are processing the main material in +% the book. +% \begin{macrocode} +%\newif\if@mainmatter \@mainmattertrue +% \end{macrocode} +% \end{macro} +% +% \section{Declaration of Options} +% +% +% \subsection{Setting Paper Sizes} +% +% The variables |\paperwidth| and |\paperheight| should reflect the +% physical paper size after trimming. For desk printer output this +% is usually the real paper size since there is no post-processing. +% Classes for real book production will probably add other paper +% sizes and additionally the production of crop marks for trimming. +% In compatibility mode, these (and some of the subsequent) options +% are disabled, as they were not present in \LaTeX 2.09. +% \changes{v1.0g}{1993/12/09}{Removed typo, A4 is not 279 mm high} +% \begin{macrocode} +\if@compatibility\else +\DeclareOption{a4paper} + {\setlength\paperheight {297mm}% + \setlength\paperwidth {210mm}} +\DeclareOption{a5paper} + {\setlength\paperheight {210mm}% + \setlength\paperwidth {148mm}} +\DeclareOption{b5paper} + {\setlength\paperheight {250mm}% + \setlength\paperwidth {176mm}} +\DeclareOption{letterpaper} + {\setlength\paperheight {11in}% + \setlength\paperwidth {8.5in}} +\DeclareOption{legalpaper} + {\setlength\paperheight {14in}% + \setlength\paperwidth {8.5in}} +\DeclareOption{executivepaper} + {\setlength\paperheight {10.5in}% + \setlength\paperwidth {7.25in}} +% \end{macrocode} +% +% The option \Lopt{landscape} switches the values of |\paperheight| +% and |\paperwidth|, assuming the dimensions were given for portrait +% paper. +% \begin{macrocode} +\DeclareOption{landscape} + {\setlength\@tempdima {\paperheight}% + \setlength\paperheight {\paperwidth}% + \setlength\paperwidth {\@tempdima}} +\fi +% \end{macrocode} +% +% \subsection{Choosing the type size} +% +% The type size options are handled by defining |\@ptsize| to contain +% the last digit of the size in question and branching on |\ifcase| +% statements. This is done for historical reasons to stay compatible +% with other packages that use the |\@ptsize| variable to select +% special actions. It makes the declarations of size options less +% than 10pt difficult, although one can probably use \texttt{9} +% and \texttt{8} assuming that a class wont define both +% \Lopt{8pt} and \Lopt{18pt} options. +% +% \begin{macrocode} +\if@compatibility + \renewcommand\@ptsize{0} +\else +\DeclareOption{10pt}{\renewcommand\@ptsize{0}} +\fi +\DeclareOption{11pt}{\renewcommand\@ptsize{1}} +\DeclareOption{12pt}{\renewcommand\@ptsize{2}} +% \end{macrocode} +% +% +% \subsection{Two-side or one-side printing} +% +% For two-sided printing we use the switch |\if@twoside|. In +% addition we have to set the |\if@mparswitch| to get any margin +% paragraphs into the outside margin. +% \begin{macrocode} +\if@compatibility\else +\DeclareOption{oneside}{\@twosidefalse \@mparswitchfalse} +\fi +\DeclareOption{twoside}{\@twosidetrue \@mparswitchtrue} +% \end{macrocode} +% +% +% \subsection{Draft option} +% +% If the user requests \Lopt{draft} we show any overfull boxes. +% We could probably add some more interesting stuff to this option. +% \begin{macrocode} +\DeclareOption{draft}{\setlength\overfullrule{5pt}} +\if@compatibility\else +\DeclareOption{final}{\setlength\overfullrule{0pt}} +\fi +% \end{macrocode} +% +% \subsection{Titlepage option} +% An article usually has no separate titlepage, but the user can +% request one. +% \begin{macrocode} +\DeclareOption{titlepage}{\@titlepagetrue} +\if@compatibility\else +\DeclareOption{notitlepage}{\@titlepagefalse} +\fi +% \end{macrocode} +% +% \subsection{openright option} +% This option determines whether or not a chapter must start on +% a right-hand page +% request one. +% \begin{macrocode} +%\if@compatibility +%\@openrighttrue +%\else +%\DeclareOption{openright}{\@openrighttrue} +%\DeclareOption{openany}{\@openrightfalse} +%\fi +% \end{macrocode} +% +% \subsection{Twocolumn printing} +% +% Two-column and one-column printing is again realized via a switch. +% \begin{macrocode} +\if@compatibility\else +\DeclareOption{onecolumn}{\@twocolumnfalse} +\fi +\DeclareOption{twocolumn}{\@twocolumntrue} +% \end{macrocode} +% +% \subsection{Equation numbering on the left} +% +% The option \Lopt{leqno} can be used to get the equation numbers +% on the left side of the equation. It loads code which is generated +% automatically from the kernel files when the format is built. +% If the equation number does get a special formatting then instead +% of using the kernel file the class would need to provide the code +% explicitly. +% \begin{macrocode} +\DeclareOption{leqno}{\input{leqno.clo}} +% \end{macrocode} +% +% \subsection{Flush left displays} +% +% The option \Lopt{fleqn} redefines the displayed math environments +% in such a way that they come out flush left, with an indentation +% of |\mathindent| from the prevailing left margin. It loads +% code which is generated +% automatically from the kernel files when the format is built. +% \changes{v1.0h}{1993/12/18}{Corrected some typos. ASAJ.} +% \begin{macrocode} +\DeclareOption{fleqn}{\input{fleqn.clo}} +% \end{macrocode} +% +% \subsection{Open bibliography} +% +% The option \Lopt{openbib} produces the ``open'' bibliography +% style, in which each block starts on a new line, and succeeding +% lines in a block are indented by |\bibindent|. +% \changes{v1.3k}{1995/08/27}{openbib option reimplemented} +% \begin{macrocode} +\DeclareOption{openbib}{% +% \end{macrocode} +% First some hook into the bibliography environment is filled. +% \begin{macrocode} + \AtEndOfPackage{% + \renewcommand\@openbib@code{% + \advance\leftmargin\bibindent + \itemindent -\bibindent + \listparindent \itemindent + \parsep \z@ + }% +% \end{macrocode} +% In addition the definition of |\newblock| is overwritten. +% \begin{macrocode} + \renewcommand\newblock{\par}}% +} +% \end{macrocode} +% +% +% \section{Executing Options} +% +% Here we execute the default options to initialize certain +% variables. Note that the document class `book' always uses two +% sided printing. +% \begin{macrocode} +%<*article> +\ExecuteOptions{letterpaper,10pt,oneside,onecolumn,final} +%
+%<*report> +\ExecuteOptions{letterpaper,10pt,oneside,onecolumn,final,openany} +%
+%<*book> +\ExecuteOptions{letterpaper,10pt,twoside,onecolumn,final,openright} +% +% \end{macrocode} +% +% The |\ProcessOptions| command causes the execution of the code +% for every option \Lopt{FOO} +% which is declared and for which the user typed +% the \Lopt{FOO} option in his +% |\documentclass| command. For every option \Lopt{BAR} he typed, +% which is not declared, the option is assumed to be a global option. +% All options will be passed as document options to any +% |\usepackage| command in the document preamble. +% \begin{macrocode} +\ProcessOptions +% \end{macrocode} +% Now that all the options have been executed we can load the +% chosen class option file that contains all size dependent code. +% \begin{macrocode} +%\input{size1\@ptsize.clo} +%\input{bk1\@ptsize.clo} +% +% \end{macrocode} +% +% \section{Loading Packages} +% +% The standard class files do not load additional packages. +% +% +% \section{Document Layout} +% \label{sec:classes:maincode} +% +% In this section we are finally dealing with the nasty typographical +% details. +% +% \subsection{Fonts} +% +% \LaTeX\ offers the user commands to change the size of the font, +% relative to the `main' size. Each relative size changing command +% |\size| executes the command +% |\@setfontsize||\size|\meta{font-size}\meta{baselineskip} where: +% +% \begin{description} +% \item[\meta{font-size}] The absolute size of the font to use from +% now on. +% +% \item[\meta{baselineskip}] The normal value of |\baselineskip| +% for the size of the font selected. (The actual value will be +% |\baselinestretch| * \meta{baselineskip}.) +% \end{description} +% +% A number of commands, defined in the \LaTeX{} kernel, shorten the +% following definitions and are used throughout. They are: +% \begin{center} +% \begin{tabular}{ll@{\qquad}ll@{\qquad}ll} +% \verb=\@vpt= & 5 & \verb=\@vipt= & 6 & \verb=\@viipt= & 7 \\ +% \verb=\@viiipt= & 8 & \verb=\@ixpt= & 9 & \verb=\@xpt= & 10 \\ +% \verb=\@xipt= & 10.95 & \verb=\@xiipt= & 12 & \verb=\@xivpt= & 14.4\\ +% ... +% \end{tabular} +% \end{center} +% +% \begin{macro}{\normalsize} +% \begin{macro}{\@normalsize} +% \changes{v1.0o}{1994/01/31}{\cs{@normalsize} now defined in the +% kernel} +% +% The user level command for the main size is |\normalsize|. +% Internally \LaTeX{} uses |\@normalsize| when it refers to the +% main size. |\@normalsize| will be defined to work like +% |\normalsize| if the latter is redefined from its default +% definition (that just issues an error message). Otherwise +% |\@normalsize| simply selects a 10pt/12pt size. +% +% The |\normalsize| macro also sets new values for\\ +% |\abovedisplayskip|, |\abovedisplayshortskip| and +% |\belowdisplayshortskip|. +% +% \changes{v1.0e}{1993/12/07}{\cs{normalsize} doesn't exist, so use +% \cs{newcommand}} +% \changes{v1.0h}{1993/12/18}{\cs{normalsize} is now defined in the +% kernel, so use \cs{renewcommand}. ASAJ.} +% \begin{macrocode} +%<*10pt|11pt|12pt> +\renewcommand\normalsize{% +%<*10pt> + \@setfontsize\normalsize\@xpt\@xiipt + \abovedisplayskip 10\p@ \@plus2\p@ \@minus5\p@ + \abovedisplayshortskip \z@ \@plus3\p@ + \belowdisplayshortskip 6\p@ \@plus3\p@ \@minus3\p@ +% +%<*11pt> + \@setfontsize\normalsize\@xipt{13.6}% + \abovedisplayskip 11\p@ \@plus3\p@ \@minus6\p@ + \abovedisplayshortskip \z@ \@plus3\p@ + \belowdisplayshortskip 6.5\p@ \@plus3.5\p@ \@minus3\p@ +% +%<*12pt> + \@setfontsize\normalsize\@xiipt{14.5}% + \abovedisplayskip 12\p@ \@plus3\p@ \@minus7\p@ + \abovedisplayshortskip \z@ \@plus3\p@ + \belowdisplayshortskip 6.5\p@ \@plus3.5\p@ \@minus3\p@ +% +% \end{macrocode} +% The |\belowdisplayskip| is always equal to the +% |\abovedisplayskip|. The parameters of the first level list are +% always given by |\@listI|. +% \begin{macrocode} + \belowdisplayskip \abovedisplayskip + \let\@listi\@listI} +% \end{macrocode} +% +% We initially choose the normalsize font. +% \begin{macrocode} +\normalsize +% \end{macrocode} +% \end{macro} +% \end{macro} +% +% \begin{macro}{\small} +% This is similar to |\normalsize|. +% \changes{v1.0h}{1993/12/18}{\cs{small} is now defined in the kernel, +% so use \cs{renewcommand}. ASAJ.} +% \changes{v1.2e}{1994/04/14}{\cs{small} is no longer defined in the +% kernel; use \cs{newcommand}} +% \begin{macrocode} +\newcommand\small{% +%<*10pt> + \@setfontsize\small\@ixpt{11}% + \abovedisplayskip 8.5\p@ \@plus3\p@ \@minus4\p@ + \abovedisplayshortskip \z@ \@plus2\p@ + \belowdisplayshortskip 4\p@ \@plus2\p@ \@minus2\p@ + \def\@listi{\leftmargin\leftmargini + \topsep 4\p@ \@plus2\p@ \@minus2\p@ + \parsep 2\p@ \@plus\p@ \@minus\p@ + \itemsep \parsep}% +% +%<*11pt> + \@setfontsize\small\@xpt\@xiipt + \abovedisplayskip 10\p@ \@plus2\p@ \@minus5\p@ + \abovedisplayshortskip \z@ \@plus3\p@ + \belowdisplayshortskip 6\p@ \@plus3\p@ \@minus3\p@ + \def\@listi{\leftmargin\leftmargini + \topsep 6\p@ \@plus2\p@ \@minus2\p@ + \parsep 3\p@ \@plus2\p@ \@minus\p@ + \itemsep \parsep}% +% +%<*12pt> + \@setfontsize\small\@xipt{13.6}% + \abovedisplayskip 11\p@ \@plus3\p@ \@minus6\p@ + \abovedisplayshortskip \z@ \@plus3\p@ + \belowdisplayshortskip 6.5\p@ \@plus3.5\p@ \@minus3\p@ + \def\@listi{\leftmargin\leftmargini + \topsep 9\p@ \@plus3\p@ \@minus5\p@ + \parsep 4.5\p@ \@plus2\p@ \@minus\p@ + \itemsep \parsep}% +% + \belowdisplayskip \abovedisplayskip +} +% \end{macrocode} +% \end{macro} +% +% \begin{macro}{\footnotesize} +% This is similar to |\normalsize|. +% \changes{v1.0h}{1993/12/18}{\cs{footnotesize} is now defined in the +% kernel, so use \cs{renewcommand}. ASAJ.} +% \changes{v1.2e}{1994/04/14}{use \cs{newcommand} again} +% \begin{macrocode} +\newcommand\footnotesize{% +%<*10pt> + \@setfontsize\footnotesize\@viiipt{9.5}% + \abovedisplayskip 6\p@ \@plus2\p@ \@minus4\p@ + \abovedisplayshortskip \z@ \@plus\p@ + \belowdisplayshortskip 3\p@ \@plus\p@ \@minus2\p@ + \def\@listi{\leftmargin\leftmargini + \topsep 3\p@ \@plus\p@ \@minus\p@ + \parsep 2\p@ \@plus\p@ \@minus\p@ + \itemsep \parsep}% +% +%<*11pt> + \@setfontsize\footnotesize\@ixpt{11}% + \abovedisplayskip 8\p@ \@plus2\p@ \@minus4\p@ + \abovedisplayshortskip \z@ \@plus\p@ + \belowdisplayshortskip 4\p@ \@plus2\p@ \@minus2\p@ + \def\@listi{\leftmargin\leftmargini + \topsep 4\p@ \@plus2\p@ \@minus2\p@ + \parsep 2\p@ \@plus\p@ \@minus\p@ + \itemsep \parsep}% +% +%<*12pt> + \@setfontsize\footnotesize\@xpt\@xiipt + \abovedisplayskip 10\p@ \@plus2\p@ \@minus5\p@ + \abovedisplayshortskip \z@ \@plus3\p@ + \belowdisplayshortskip 6\p@ \@plus3\p@ \@minus3\p@ + \def\@listi{\leftmargin\leftmargini + \topsep 6\p@ \@plus2\p@ \@minus2\p@ + \parsep 3\p@ \@plus2\p@ \@minus\p@ + \itemsep \parsep}% +% + \belowdisplayskip \abovedisplayskip +} +% +% \end{macrocode} +% \end{macro} +% +% \begin{macro}{\scriptsize} +% \begin{macro}{\tiny} +% \begin{macro}{\large} +% \begin{macro}{\Large} +% \begin{macro}{\LARGE} +% \begin{macro}{\huge} +% \begin{macro}{\Huge} +% These are all much simpler than the previous macros, they just +% select a new fontsize, but leave the parameters for displays and +% lists alone. +% \changes{v1.0h}{1993/12/18}{These are now defined in the kernel, +% so use \cs{renewcommand}. ASAJ.} +% \changes{v1.2e}{1994/04/14}{use \cs{newcommand} again} +% \begin{macrocode} +%<*10pt> +\newcommand\scriptsize{\@setfontsize\scriptsize\@viipt\@viiipt} +\newcommand\tiny{\@setfontsize\tiny\@vpt\@vipt} +\newcommand\large{\@setfontsize\large\@xiipt{14}} +\newcommand\Large{\@setfontsize\Large\@xivpt{18}} +\newcommand\LARGE{\@setfontsize\LARGE\@xviipt{22}} +\newcommand\huge{\@setfontsize\huge\@xxpt{25}} +\newcommand\Huge{\@setfontsize\Huge\@xxvpt{30}} +% +%<*11pt> +\newcommand\scriptsize{\@setfontsize\scriptsize\@viiipt{9.5}} +\newcommand\tiny{\@setfontsize\tiny\@vipt\@viipt} +\newcommand\large{\@setfontsize\large\@xiipt{14}} +\newcommand\Large{\@setfontsize\Large\@xivpt{18}} +\newcommand\LARGE{\@setfontsize\LARGE\@xviipt{22}} +\newcommand\huge{\@setfontsize\huge\@xxpt{25}} +\newcommand\Huge{\@setfontsize\Huge\@xxvpt{30}} +% +%<*12pt> +\newcommand\scriptsize{\@setfontsize\scriptsize\@viiipt{9.5}} +\newcommand\tiny{\@setfontsize\tiny\@vipt\@viipt} +\newcommand\large{\@setfontsize\large\@xivpt{18}} +\newcommand\Large{\@setfontsize\Large\@xviipt{22}} +\newcommand\LARGE{\@setfontsize\LARGE\@xxpt{25}} +\newcommand\huge{\@setfontsize\huge\@xxvpt{30}} +\let\Huge=\huge +% +% \end{macrocode} +% \end{macro} +% \end{macro} +% \end{macro} +% \end{macro} +% \end{macro} +% \end{macro} +% \end{macro} +% +% +% \subsection{Paragraphing} +% +% \begin{macro}{\lineskip} +% \begin{macro}{\normallineskip} +% These parameters control \TeX's behaviour when two lines tend to +% come too close together. +% \begin{macrocode} +%<*article|report|book> +\setlength\lineskip{1\p@} +\setlength\normallineskip{1\p@} +% \end{macrocode} +% \end{macro} +% \end{macro} +% +% \begin{macro}{\baselinestretch} +% This is used as a multiplier for |\baselineskip|. The default is +% to \emph{not} stretch the baselines. Note that if this command +% doesn't resolve to ``empty'' any \texttt{plus} or \texttt{minus} +% part in the specification of |\baselineskip| is ignored. +% \begin{macrocode} +\renewcommand\baselinestretch{} +% \end{macrocode} +% \end{macro} +% +% \begin{macro}{\parskip} +% \begin{macro}{\parindent} +% |\parskip| gives extra vertical space between paragraphs and +% |\parindent| is the width of the paragraph indentation. The value +% of |\parindent| depends on whether we are in two column mode. +% \changes{v1.0m}{1994/01/12}{\cs{parindent} should be different, +% depending on the pointsize} +% \begin{macrocode} +\setlength\parskip{0\p@ \@plus \p@} +% +%<*10pt|11pt|12pt> +\if@twocolumn + \setlength\parindent{1em} +\else +%<10pt> \setlength\parindent{15\p@} +%<11pt> \setlength\parindent{17\p@} +%<12pt> \setlength\parindent{1.5em} +\fi +% +% \end{macrocode} +% \end{macro} +% \end{macro} +% +% \begin{macro}{\smallskipamount} +% \begin{macro}{\medskipamount} +% \begin{macro}{\bigskipamount} +% The values for these three parameters are set in the \LaTeX\ +% kernel. They should perhaps vary, according to the size option +% specified. But as they have always had the same value regardless +% of the size option we do not change them to stay compatible with +% both \LaTeX~2.09 and older releases of \LaTeXe. +% \changes{v1.3n}{1995/10/29}{Added setting the values of +% \cs{...skipamount}} +% \begin{macrocode} +%<*10pt|11pt|12pt> +\setlength\smallskipamount{3\p@ \@plus 1\p@ \@minus 1\p@} +\setlength\medskipamount{6\p@ \@plus 2\p@ \@minus 2\p@} +\setlength\bigskipamount{12\p@ \@plus 4\p@ \@minus 4\p@} +% +% \end{macrocode} +% \end{macro} +% \end{macro} +% \end{macro} +% +% \begin{macro}{\@lowpenalty} +% \begin{macro}{\@medpenalty} +% \begin{macro}{\@highpenalty}% +% The commands |\nopagebreak| and |\nolinebreak| put in penalties +% to discourage these breaks at the point they are put in. +% They use |\@lowpenalty|, |\@medpenalty| or |\@highpenalty|, +% dependent on their argument. +% \begin{macrocode} +%<*article|report|book> +\@lowpenalty 51 +\@medpenalty 151 +\@highpenalty 301 +% \end{macrocode} +% \end{macro} +% \end{macro} +% \end{macro} +% +% \begin{macro}{\clubpenalty} +% \begin{macro}{\widowpenalty} +% These penalties are use to discourage club and widow lines. +% Because we use their default values we only show them here, +% commented out. +% \begin{macrocode} +% \clubpenalty 150 +% \widowpenalty 150 +% \end{macrocode} +% \end{macro} +% \end{macro} +% +% \begin{macro}{\displaywidowpenalty} +% \begin{macro}{\predisplaypenalty} +% \begin{macro}{\postdisplaypenalty} +% Discourage (but not so much) widows in front of a math display +% and forbid breaking directly in front of a display. Allow break +% after a display without a penalty. Again the default values are +% used, therefore we only show them here. +% \begin{macrocode} +% \displaywidowpenalty 50 +% \predisplaypenalty 10000 +% \postdisplaypenalty 0 +% \end{macrocode} +% \end{macro} +% \end{macro} +% \end{macro} +% +% \begin{macro}{\interlinepenalty} +% Allow the breaking of a page in the middle of a paragraph. +% \begin{macrocode} +% \interlinepenalty 0 +% \end{macrocode} +% \end{macro} +% +% +% \begin{macro}{\brokenpenalty} +% We allow the breaking of a page after a hyphenated line. +% \changes{v1.1a}{1994/03/12}{Show correct default which is 100} +% \begin{macrocode} +% \brokenpenalty 100 +% +% \end{macrocode} +% \end{macro} +% +% +% \subsection{Page Layout} +% +% All margin dimensions are measured from a point one inch from the +% top and lefthand side of the page. +% +% \subsubsection{Vertical spacing} +% +% \begin{macro}{\headheight} +% \begin{macro}{\headsep} +% \begin{macro}{\topskip} +% The |\headheight| is the height of the box that will contain the +% running head. The |\headsep| is the distance between the bottom +% of the running head and the top of the text. The |\topskip| is +% the |\baselineskip| for the first line on a page; \LaTeX's output +% routine will not work properly if it has the value 0pt, so do not +% do that! +% \begin{macrocode} +%<*10pt|11pt|12pt> +\setlength\headheight{12\p@} +%\setlength\headsep {25\p@} +%<10pt&bk>\setlength\headsep {.25in} +%<11pt&bk>\setlength\headsep {.275in} +%<12pt&bk>\setlength\headsep {.275in} +%<10pt>\setlength\topskip {10\p@} +%<11pt>\setlength\topskip {11\p@} +%<12pt>\setlength\topskip {12\p@} +% \end{macrocode} +% \end{macro} +% \end{macro} +% \end{macro} +% +% \begin{macro}{\footskip} +% The distance from the baseline of the box which contains the +% running footer to the baseline of last line of text is controlled +% by the |\footskip|. +% \begin{macrocode} +%\setlength\footskip{30\p@} +%<10pt&bk>\setlength\footskip{.35in} +%<11pt&bk>\setlength\footskip{.38in} +%<12pt&bk>\setlength\footskip{30\p@} +% \end{macrocode} +% \end{macro} +% +% \begin{macro}{\maxdepth} +% \changes{v1.2k}{1994/05/06}{Added setting of \cs{maxdepth} and +% \cs{@maxdepth}} +% \changes{v1.3j}{1995/08/16}{Take setting of +% \cs{@maxdepth} out again} +% The \TeX\ primitive register |\maxdepth| has a function that is +% similar to that of |\topskip|. The register |\@maxdepth| should +% always contain a copy of |\maxdepth|. This is achieved by setting +% it internally at |\begin{document}|. In both plain \TeX\ and +% \LaTeX~2.09 |\maxdepth| had a fixed value of \texttt{4pt}; in +% native \LaTeX2e\ mode we let the value depend on the typesize. We +% set it so that |\maxdepth| $+$ |\topskip| $=$ typesize $\times +% 1.5$. As it happens, in these classes |\topskip| is equal to the +% typesize, therefore we set |\maxdepth| to half the value of +% |\topskip|. +% \begin{macrocode} +\if@compatibility \setlength\maxdepth{4\p@} \else +\setlength\maxdepth{.5\topskip} \fi +% \end{macrocode} +% \end{macro} +% +% \subsubsection{The dimension of text} +% +% \begin{macro}{\textwidth} +% When we are in compatibility mode we have to make sure that the +% dimensions of the printed area are not different from what the +% user was used to see. +% +% \begin{macrocode} +\if@compatibility + \if@twocolumn + \setlength\textwidth{410\p@} + \else +%<10pt&!bk> \setlength\textwidth{345\p@} +%<11pt&!bk> \setlength\textwidth{360\p@} +%<12pt&!bk> \setlength\textwidth{390\p@} +%<10pt&bk> \setlength\textwidth{4.5in} +%<11pt&bk> \setlength\textwidth{5in} +%<12pt&bk> \setlength\textwidth{5in} + \fi +% \end{macrocode} +% When we are not in compatibility mode we can set some of the +% dimensions differently, taking into account the paper size for +% instance. +% \begin{macrocode} +\else +% \end{macrocode} +% First, we calculate the maximum |\textwidth|, which we will allow +% on the selected paper and store it in |\@tempdima|. Then we store +% the length of a line with approximately 60--70 characters in +% |\@tempdimb|. The values given are more or less suitable when +% Computer Modern fonts are used. +% \changes{v1.1a}{1994/03/12}{Have old values for width in native mode} +% \begin{macrocode} + \setlength\@tempdima{\paperwidth} + \addtolength\@tempdima{-2in} +%<10pt> \setlength\@tempdimb{345\p@} +%<11pt> \setlength\@tempdimb{360\p@} +%<12pt> \setlength\@tempdimb{390\p@} +% \end{macrocode} +% +% Now we can set the |\textwidth|, depending on whether we will be +% setting one or two columns. +% +% In two column mode each \emph{column} shouldn't be wider than +% |\@tempdimb| (which could happen on \textsc{a3} paper for +% instance). +% \begin{macrocode} + \if@twocolumn + \ifdim\@tempdima>2\@tempdimb\relax + \setlength\textwidth{2\@tempdimb} + \else + \setlength\textwidth{\@tempdima} + \fi +% \end{macrocode} +% +% In one column mode the text should not be wider than the minimum +% of the paperwidth (minus 2 inches for the margins) and the +% maximum length of a line as defined by the number of characters. +% \begin{macrocode} + \else + \ifdim\@tempdima>\@tempdimb\relax + \setlength\textwidth{\@tempdimb} + \else + \setlength\textwidth{\@tempdima} + \fi + \fi +\fi +% \end{macrocode} +% +% Here we modify the width of the text a little to be a whole +% number of points. +% \begin{macrocode} +\if@compatibility\else + \@settopoint\textwidth +\fi +% \end{macrocode} +% \end{macro} +% +% \begin{macro}{\textheight} +% Now that we have computed the width of the text, we have to take +% care of the height. The |\textheight| is the height of text +% (including footnotes and figures, excluding running head and +% foot). +% +% First make sure that the compatibility mode gets the same +% dimensions as we had with \LaTeX2.09. The number of lines was +% calculated as the floor of the old |\textheight| minus +% |\topskip|, divided by |\baselineskip| for |\normalsize|. The +% old value of |\textheight| was 528pt. +% +% \begin{macrocode} +\if@compatibility +%<10pt&!bk> \setlength\textheight{43\baselineskip} +%<10pt&bk> \setlength\textheight{41\baselineskip} +%<11pt> \setlength\textheight{38\baselineskip} +%<12pt> \setlength\textheight{36\baselineskip} +% \end{macrocode} +% +% Again we compute this, depending on the papersize and depending +% on the baselineskip that is used, in order to have a whole number +% of lines on the page. +% \begin{macrocode} +\else + \setlength\@tempdima{\paperheight} +% \end{macrocode} +% +% We leave at least a 1 inch margin on the top and the bottom of +% the page. +% \begin{macrocode} + \addtolength\@tempdima{-2in} +% \end{macrocode} +% +% We also have to leave room for the running headers and footers. +% \begin{macrocode} + \addtolength\@tempdima{-1.5in} +% \end{macrocode} +% +% Then we divide the result by the current |\baselineskip| and +% store this in the count register |\@tempcnta|, which then +% contains the number of lines that fit on this page. +% \begin{macrocode} + \divide\@tempdima\baselineskip + \@tempcnta=\@tempdima +% \end{macrocode} +% +% From this we can calculate the height of the text. +% \begin{macrocode} + \setlength\textheight{\@tempcnta\baselineskip} +\fi +% \end{macrocode} +% +% The first line on the page has a height of |\topskip|. +% \begin{macrocode} +\addtolength\textheight{\topskip} +% \end{macrocode} +% \end{macro} +% +% +% +% \subsubsection{Margins} +% +% Most of the values of these parameters are now calculated, based +% on the papersize in use. In the calcluations the |\marginparsep| +% needs to be taken into account so we give it its value first. +% +% \begin{macro}{\marginparsep} +% \begin{macro}{\marginparpush} +% The horizontal space between the main text and marginal notes is +% determined by |\marginparsep|, the minimum vertical separation +% between two marginal notes is controlled by |\marginparpush|. +% \begin{macrocode} +\if@twocolumn + \setlength\marginparsep {10\p@} +\else +%<10pt&!bk> \setlength\marginparsep{11\p@} +%<11pt&!bk> \setlength\marginparsep{10\p@} +%<12pt&!bk> \setlength\marginparsep{10\p@} +% \setlength\marginparsep{7\p@} +\fi +%<10pt|11pt>\setlength\marginparpush{5\p@} +%<12pt>\setlength\marginparpush{7\p@} +% \end{macrocode} +% \end{macro} +% \end{macro} +% +% Now we can give the values for the other margin parameters. For +% native \LaTeXe, these are calculated. +% \begin{macro}{\oddsidemargin} +% \begin{macro}{\evensidemargin} +% \begin{macro}{\marginparwidth} +% First we give the values for the compatibility mode. +% +% Values for two-sided printing: +% \begin{macrocode} +\if@compatibility +%<*bk> +%<10pt> \setlength\oddsidemargin {.5in} +%<11pt> \setlength\oddsidemargin {.25in} +%<12pt> \setlength\oddsidemargin {.25in} +%<10pt> \setlength\evensidemargin {1.5in} +%<11pt> \setlength\evensidemargin {1.25in} +%<12pt> \setlength\evensidemargin {1.25in} +%<10pt> \setlength\marginparwidth {.75in} +%<11pt> \setlength\marginparwidth {1in} +%<12pt> \setlength\marginparwidth {1in} +% +%<*!bk> + \if@twoside +%<10pt> \setlength\oddsidemargin {44\p@} +%<11pt> \setlength\oddsidemargin {36\p@} +%<12pt> \setlength\oddsidemargin {21\p@} +%<10pt> \setlength\evensidemargin {82\p@} +%<11pt> \setlength\evensidemargin {74\p@} +%<12pt> \setlength\evensidemargin {59\p@} +%<10pt> \setlength\marginparwidth {107\p@} +%<11pt> \setlength\marginparwidth {100\p@} +%<12pt> \setlength\marginparwidth {85\p@} +% \end{macrocode} +% Values for one-sided printing: +% \begin{macrocode} + \else +%<10pt> \setlength\oddsidemargin {63\p@} +%<11pt> \setlength\oddsidemargin {54\p@} +%<12pt> \setlength\oddsidemargin {39.5\p@} +%<10pt> \setlength\evensidemargin {63\p@} +%<11pt> \setlength\evensidemargin {54\p@} +%<12pt> \setlength\evensidemargin {39.5\p@} +%<10pt> \setlength\marginparwidth {90\p@} +%<11pt> \setlength\marginparwidth {83\p@} +%<12pt> \setlength\marginparwidth {68\p@} + \fi +% +% \end{macrocode} +% And values for two column mode: +% \begin{macrocode} + \if@twocolumn + \setlength\oddsidemargin {30\p@} + \setlength\evensidemargin {30\p@} + \setlength\marginparwidth {48\p@} + \fi +% \end{macrocode} +% +% When we are not in compatibility mode we can take the dimensions +% of the selected paper into account. +% +% The values for |\oddsidemargin| and |\marginparwidth| will be set +% depending on the status of the |\if@twoside|. +% +% If |@twoside| is true (which is always the case for book) we make +% the inner margin smaller than the outer one. +% \begin{macrocode} +\else + \if@twoside + \setlength\@tempdima {\paperwidth} + \addtolength\@tempdima {-\textwidth} + \setlength\oddsidemargin {.4\@tempdima} + \addtolength\oddsidemargin {-1in} +% \end{macrocode} +% The width of the margin for text is set to the remainder of the +% width except for a `real margin' of white space of width 0.4in. +% A check should perhaps be built in to ensure that the (text) +% margin width does not get too small! +% +% \changes{v1.1a}{1994/03/12}{New algorithm for \cs{oddsidemargin}} +% \changes{v1.1a}{1994/03/12}{New algorithm for \cs{marginparwidth}} +% \changes{v1.2z}{1995/04/14}{Also take \cs{marginparsep} into account +% here} +% \begin{macrocode} + \setlength\marginparwidth {.6\@tempdima} + \addtolength\marginparwidth {-\marginparsep} + \addtolength\marginparwidth {-0.4in} +% \end{macrocode} +% For one-sided printing we center the text on the page, by +% calculating the difference between |\textwidth| and +% |\paperwidth|. Half of that difference is than used for +% the margin (thus |\oddsidemargin| is |1in| less). +% \begin{macrocode} + \else + \setlength\@tempdima {\paperwidth} + \addtolength\@tempdima {-\textwidth} + \setlength\oddsidemargin {.5\@tempdima} + \addtolength\oddsidemargin {-1in} + \setlength\marginparwidth {.5\@tempdima} + \addtolength\marginparwidth {-\marginparsep} + \addtolength\marginparwidth {-0.4in} + \addtolength\marginparwidth {-.4in} + \fi +% \end{macrocode} +% With the above algorithm the |\marginparwidth| can come out quite +% large which we may not want. +% \begin{macrocode} + \ifdim \marginparwidth >2in + \setlength\marginparwidth{2in} + \fi +% \end{macrocode} +% Having done these calculations we make them pt values. +% \begin{macrocode} + \@settopoint\oddsidemargin + \@settopoint\marginparwidth +% \end{macrocode} +% +% The |\evensidemargin| can now be computed from the values set +% above. +% \changes{v1.0l}{1994/01/11}{Computing of \cs{evensidemargin} +% should only occur in compatibility mode} +% \begin{macrocode} + \setlength\evensidemargin {\paperwidth} + \addtolength\evensidemargin{-2in} + \addtolength\evensidemargin{-\textwidth} + \addtolength\evensidemargin{-\oddsidemargin} +% \end{macrocode} +% Setting |\evensidemargin| to a full point value may produce a +% small error. However it will lie within the error range a +% doublesided printer of today's technology can accurately print. +% \begin{macrocode} + \@settopoint\evensidemargin +\fi +% \end{macrocode} +% \end{macro} +% \end{macro} +% \end{macro} +% +% \begin{macro}{\topmargin} +% The |\topmargin| is the distance between the top of `the +% printable area'---which is 1 inch below the top of the +% paper--and the top of the box which contains the running head. +% +% It can now be computed from the values set above. +% \begin{macrocode} +\if@compatibility +% \setlength\topmargin{27pt} +%<10pt&bk> \setlength\topmargin{.75in} +%<11pt&bk> \setlength\topmargin{.73in} +%<12pt&bk> \setlength\topmargin{.73in} +\else + \setlength\topmargin{\paperheight} + \addtolength\topmargin{-2in} + \addtolength\topmargin{-\headheight} + \addtolength\topmargin{-\headsep} + \addtolength\topmargin{-\textheight} + \addtolength\topmargin{-\footskip} % this might be wrong! +% \end{macrocode} +% By changing the factor in the next line the complete page +% can be shifted vertically. +% \changes{v1.2u}{1994/07/13}{Moved rounding of \cs{topmargin} to +% native mode} +% \begin{macrocode} + \addtolength\topmargin{-.5\topmargin} + \@settopoint\topmargin +\fi +% \end{macrocode} +% \end{macro} +% +% +% \subsubsection{Footnotes} +% +% \begin{macro}{\footnotesep} +% |\footnotesep| is the height of the strut placed at the beginning +% of every footnote. It equals the height of a normal +% |\footnotesize| strut in this +% class, thus no extra space occurs between footnotes. +% \begin{macrocode} +%<10pt>\setlength\footnotesep{6.65\p@} +%<11pt>\setlength\footnotesep{7.7\p@} +%<12pt>\setlength\footnotesep{8.4\p@} +% \end{macrocode} +% \end{macro} +% +% \begin{macro}{\footins} +% |\skip\footins| is the space between the last line of the main +% text and the top of the first footnote. +% \begin{macrocode} +%<10pt>\setlength{\skip\footins}{9\p@ \@plus 4\p@ \@minus 2\p@} +%<11pt>\setlength{\skip\footins}{10\p@ \@plus 4\p@ \@minus 2\p@} +%<12pt>\setlength{\skip\footins}{10.8\p@ \@plus 4\p@ \@minus 2\p@} +% +% \end{macrocode} +% \end{macro} +% +% \subsubsection{Float placement parameters} +% +% All float parameters are given default values in the \LaTeXe{} +% kernel. For this reason parameters that are not counters +% need to be set with |\renewcommand|. +% +% \paragraph{Limits for the placement of floating objects} +% +% \begin{macro}{\c@topnumber} +% The \Lcount{topnumber} counter holds the maximum number of +% floats that can appear on the top of a text page. +% \begin{macrocode} +%<*article|report|book> +\setcounter{topnumber}{2} +% \end{macrocode} +% \end{macro} +% +% \begin{macro}{\topfraction} +% This indicates the maximum part of a text page that can be +% occupied by floats at the top. +% \changes{v1.0h}{1993/12/18}{Replaced \cs{newcommand} with +% \cs{renewcommand}. ASAJ.} +% \begin{macrocode} +\renewcommand\topfraction{.7} +% \end{macrocode} +% \end{macro} +% +% \begin{macro}{\c@bottomnumber} +% The \Lcount{bottomnumber} counter holds the maximum number of +% floats that can appear on the bottom of a text page. +% \begin{macrocode} +\setcounter{bottomnumber}{1} +% \end{macrocode} +% \end{macro} +% +% \begin{macro}{\bottomfraction} +% This indicates the maximum part of a text page that can be +% occupied by floats at the bottom. +% \changes{v1.0h}{1993/12/18}{Replaced \cs{newcommand} with +% \cs{renewcommand}. ASAJ.} +% \begin{macrocode} +\renewcommand\bottomfraction{.3} +% \end{macrocode} +% \end{macro} +% +% \begin{macro}{\c@totalnumber} +% This indicates the maximum number of floats that can appear on +% any text page. +% \begin{macrocode} +\setcounter{totalnumber}{3} +% \end{macrocode} +% \end{macro} +% +% \begin{macro}{\textfraction} +% This indicates the minimum part of a text page that has to be +% occupied by text. +% \changes{v1.0h}{1993/12/18}{Replaced \cs{newcommand} with +% \cs{renewcommand}. ASAJ.} +% \begin{macrocode} +\renewcommand\textfraction{.2} +% \end{macrocode} +% \end{macro} +% +% \begin{macro}{\floatpagefraction} +% This indicates the minimum part of a page that has to be +% occupied by floating objects before a `float page' is produced. +% \changes{v1.0h}{1993/12/18}{Replaced \cs{newcommand} with +% \cs{renewcommand}. ASAJ.} +% \begin{macrocode} +\renewcommand\floatpagefraction{.5} +% \end{macrocode} +% \end{macro} +% +% \begin{macro}{\c@dbltopnumber} +% The \Lcount{dbltopnumber} counter holds the maximum number of +% two column floats that can appear on the top of a two column text +% page. +% \begin{macrocode} +\setcounter{dbltopnumber}{2} +% \end{macrocode} +% \end{macro} +% +% \begin{macro}{\dbltopfraction} +% This indicates the maximum part of a two column text page that +% can be occupied by two column floats at the top. +% \changes{v1.0h}{1993/12/18}{Replaced \cs{newcommand} with +% \cs{renewcommand}. ASAJ.} +% \begin{macrocode} +\renewcommand\dbltopfraction{.7} +% \end{macrocode} +% \end{macro} +% +% \begin{macro}{\dblfloatpagefraction} +% This indicates the minimum part of a page that has to be +% occupied by two column wide floating objects before a `float +% page' is produced. +% \changes{v1.0h}{1993/12/18}{Replaced \cs{newcommand} with +% \cs{renewcommand}. ASAJ.} +% \begin{macrocode} +\renewcommand\dblfloatpagefraction{.5} +% +% \end{macrocode} +% \end{macro} +% +% \paragraph{Floats on a text page} +% +% \begin{macro}{\floatsep} +% \begin{macro}{\textfloatsep} +% \begin{macro}{\intextsep} +% When a floating object is placed on a page with text, these +% parameters control the separation between the float and the other +% objects on the page. These parameters are used for both +% one-column mode and single-column floats in two-column mode. +% +% |\floatsep| is the space between adjacent floats that are moved +% to the top or bottom of the text page. +% +% |\textfloatsep| is the space between the main text and floats +% at the top or bottom of the page. +% +% |\intextsep| is the space between in-text floats and the text. +% \begin{macrocode} +%<*10pt> +\setlength\floatsep {12\p@ \@plus 2\p@ \@minus 2\p@} +\setlength\textfloatsep{20\p@ \@plus 2\p@ \@minus 4\p@} +\setlength\intextsep {12\p@ \@plus 2\p@ \@minus 2\p@} +% +%<*11pt> +\setlength\floatsep {12\p@ \@plus 2\p@ \@minus 2\p@} +\setlength\textfloatsep{20\p@ \@plus 2\p@ \@minus 4\p@} +\setlength\intextsep {12\p@ \@plus 2\p@ \@minus 2\p@} +% +%<*12pt> +\setlength\floatsep {12\p@ \@plus 2\p@ \@minus 4\p@} +\setlength\textfloatsep{20\p@ \@plus 2\p@ \@minus 4\p@} +\setlength\intextsep {14\p@ \@plus 4\p@ \@minus 4\p@} +% +% \end{macrocode} +% \end{macro} +% \end{macro} +% \end{macro} +% +% \begin{macro}{\dblfloatsep} +% \begin{macro}{\dbltextfloatsep} +% When floating objects that span the whole |\textwidth| are placed +% on a text page when we are in twocolumn mode the separation +% between the float and the text is controlled by |\dblfloatsep| +% and |\dbltextfloatsep|. +% +% |\dblfloatsep| is the space between adjacent floats that are moved +% to the top or bottom of the text page. +% +% |\dbltextfloatsep| is the space between the main text and floats +% at the top or bottom of the page. +% +% \begin{macrocode} +%<*10pt> +\setlength\dblfloatsep {12\p@ \@plus 2\p@ \@minus 2\p@} +\setlength\dbltextfloatsep{20\p@ \@plus 2\p@ \@minus 4\p@} +% +%<*11pt> +\setlength\dblfloatsep {12\p@ \@plus 2\p@ \@minus 2\p@} +\setlength\dbltextfloatsep{20\p@ \@plus 2\p@ \@minus 4\p@} +% +%<*12pt> +\setlength\dblfloatsep {14\p@ \@plus 2\p@ \@minus 4\p@} +\setlength\dbltextfloatsep{20\p@ \@plus 2\p@ \@minus 4\p@} +% +% \end{macrocode} +% \end{macro} +% \end{macro} +% +% \paragraph{Floats on their own page or column} +% +% \begin{macro}{\@fptop} +% \begin{macro}{\@fpsep} +% \begin{macro}{\@fpbot} +% When floating objects are placed on separate pages the layout of +% such pages is controlled by these parameters. At the top of the +% page |\@fptop| amount of stretchable whitespace is inserted, at +% the bottom of the page we get an |\@fpbot| amount of stretchable +% whitespace. Between adjacent floats the |\@fpsep| is inserted. +% +% These parameters are used for the placement of floating objects +% in one column mode, or in single column floats in two column +% mode. +% +% Note that at least one of the two parameters |\@fptop| and +% |\@fpbot| should contain a |plus ...fil| to allow filling the +% remaining empty space. +% \begin{macrocode} +%<*10pt> +\setlength\@fptop{0\p@ \@plus 1fil} +\setlength\@fpsep{8\p@ \@plus 2fil} +\setlength\@fpbot{0\p@ \@plus 1fil} +% +%<*11pt> +\setlength\@fptop{0\p@ \@plus 1fil} +\setlength\@fpsep{8\p@ \@plus 2fil} +\setlength\@fpbot{0\p@ \@plus 1fil} +% +%<*12pt> +\setlength\@fptop{0\p@ \@plus 1fil} +\setlength\@fpsep{10\p@ \@plus 2fil} +\setlength\@fpbot{0\p@ \@plus 1fil} +% +% \end{macrocode} +% \end{macro} +% \end{macro} +% \end{macro} +% +% \begin{macro}{\@dblfptop} +% \begin{macro}{\@dblfpsep} +% \begin{macro}{\@dblfpbot} +% Double column floats in two column mode are handled with similar +% parameters. +% \begin{macrocode} +%<*10pt> +\setlength\@dblfptop{0\p@ \@plus 1fil} +\setlength\@dblfpsep{8\p@ \@plus 2fil} +\setlength\@dblfpbot{0\p@ \@plus 1fil} +% +%<*11pt> +\setlength\@dblfptop{0\p@ \@plus 1fil} +\setlength\@dblfpsep{8\p@ \@plus 2fil} +\setlength\@dblfpbot{0\p@ \@plus 1fil} +% +%<*12pt> +\setlength\@dblfptop{0\p@ \@plus 1fil} +\setlength\@dblfpsep{10\p@ \@plus 2fil} +\setlength\@dblfpbot{0\p@ \@plus 1fil} +% +%<*article|report|book> +% \end{macrocode} +% \end{macro} +% \end{macro} +% \end{macro} +% +% \subsection{Page Styles} +% +% The page style \pstyle{foo} is defined by defining the command +% |\ps@foo|. This command should make only local definitions. +% There should be no stray spaces in the definition, since they +% could lead to mysterious extra spaces in the output (well, that's +% something that should be always avoided). +% +% \begin{macro}{\@evenhead} +% \begin{macro}{\@oddhead} +% \begin{macro}{\@evenfoot} +% \begin{macro}{\@oddfoot} +% The |\ps@...| command defines the macros |\@oddhead|, +% |\@oddfoot|, |\@evenhead|, and |\@evenfoot| to define the running +% heads and feet---e.g., |\@oddhead| is the macro to produce the +% contents of the heading box for odd-numbered pages. It is called +% inside an |\hbox| of width |\textwidth|. +% \end{macro} +% \end{macro} +% \end{macro} +% \end{macro} +% +% \subsubsection{Marking conventions} +% +% To make headings determined by the sectioning commands, the page +% style defines the commands |\chaptermark|, |\sectionmark|, +% \ldots,\\ +% where |\chaptermark{|\meta{TEXT}|}| is called by +% |\chapter| to set a mark, and so on. +% +% The |\...mark| commands and the |\...head| macros are defined +% with the help of the following macros. (All the |\...mark| +% commands should be initialized to no-ops.) +% +% \LaTeX{} extends \TeX's |\mark| facility by producing two kinds +% of marks, a `left' and a `right' mark, using the following +% commands: +% \begin{flushleft} +% |\markboth{|\meta{LEFT}|}{|\meta{RIGHT}|}|: Adds both marks. +% +% |\markright{|\meta{RIGHT}|}|: Adds a `right' mark. +% +% |\leftmark|: Used in the |\@oddhead|, |\@oddfoot|, |\@evenhead| +% or |\@evenfoot| macros, it gets the current `left' +% mark. |\leftmark| works like \TeX's |\botmark| +% command. +% +% |\rightmark|: Used in the |\@oddhead|, |\@oddfoot|, |\@evenhead| +% or |\@evenfoot| macros, it gets the current +% `right' mark. |\rightmark| works like \TeX's +% |\firstmark| command. +% \end{flushleft} +% +% The marking commands work reasonably well for right marks +% `numbered within' left marks---e.g., the left mark is changed by a +% |\chapter| command and the right mark is changed by a |\section| +% command. However, it does produce somewhat anomalous results if +% two |\markboth|'s occur on the same page. +% +% +% Commands like |\tableofcontents| that should set the marks in some +% page styles use a |\@mkboth| command, which is |\let| by the +% pagestyle command (|\ps@...|) to |\markboth| for setting the +% heading or to |\@gobbletwo| to do nothing. +% +% +% \subsubsection{Defining the page styles} +% \label{sec:classes:pagestyle} +% +% The pagestyles \pstyle{empty} and \pstyle{plain} are defined in +% \file{latex.dtx}. +% +% \begin{macro}{\ps@headings} +% The definition of the page style \pstyle{headings} has to be +% different for two sided printing than it is for one sided +% printing. +% +% \begin{macrocode} +\if@twoside + \def\ps@headings{% +% \end{macrocode} +% The running feet are empty in this page style, the running head +% contains the page number and one of the marks. +% \begin{macrocode} + \let\@oddfoot\@empty\let\@evenfoot\@empty + \def\@evenhead{\thepage\hfil\slshape\leftmark}% + \def\@oddhead{{\slshape\rightmark}\hfil\thepage}% +% \end{macrocode} +% +% When using this page style, the contents of the running head is +% determined by the chapter and section titles. So we |\let| +% |\@mkboth| to |\markboth|. +% \begin{macrocode} + \let\@mkboth\markboth +% \end{macrocode} +% +% For the article document class we define |\sectionmark| to clear +% the right mark and put the number of the section (when it is +% numbered) and its title in the left mark. The rightmark is set by +% |\subsectionmark| to contain the subsection titles. +% +% Note the use of |##1| for the parameter of the |\sectionmark| +% command, which will be defined when |\ps@headings| is executed. +% +% \changes{v1.2z}{1995/04/03}{Removed extra dot after \cs{thesection} +% (PR 1519)} +% \changes{v1.3c}{1995/05/25}{Replace \cs{hskip} +% \texttt{1em}\cs{relax} with \cs{quad}} +% \begin{macrocode} +%<*article> + \def\sectionmark##1{% + \markboth {\MakeUppercase{% + \ifnum \c@secnumdepth >\z@ + \thesection\quad + \fi + ##1}}{}}% + \def\subsectionmark##1{% + \markright {% + \ifnum \c@secnumdepth >\@ne + \thesubsection\quad + \fi + ##1}}} +%
+% \end{macrocode} +% +% In the report and book document classes we use the |\chaptermark| +% and |\sectionmark| macros to fill the running heads. +% +% Note the use of |##1| for the parameter of the |\chaptermark| +% command, which will be defined when |\ps@headings| is executed. +% +% \begin{macrocode} +%<*report|book> + \def\chaptermark##1{% + \markboth {\MakeUppercase{% + \ifnum \c@secnumdepth >\m@ne +% \if@mainmatter + \@chapapp\ \thechapter. \ % +% \fi + \fi + ##1}}{}}% + \def\sectionmark##1{% + \markright {\MakeUppercase{% + \ifnum \c@secnumdepth >\z@ + \thesection. \ % + \fi + ##1}}}} +% +% \end{macrocode} +% +% The definition of |\ps@headings| for one sided printing can be +% much simpler, because we treat even and odd pages the same. +% Therefore we don't need to define |\@even...|. +% \begin{macrocode} +\else + \def\ps@headings{% + \let\@oddfoot\@empty + \def\@oddhead{{\slshape\rightmark}\hfil\thepage}% + \let\@mkboth\markboth +% \end{macrocode} +% We use |\markright| now instead of |\markboth| as we did for two +% sided printing. +% \begin{macrocode} +%<*article> + \def\sectionmark##1{% + \markright {\MakeUppercase{% + \ifnum \c@secnumdepth >\m@ne + \thesection\quad + \fi + ##1}}}} +% +% \end{macrocode} +% +% \begin{macrocode} +%<*report|book> + \def\chaptermark##1{% + \markright {\MakeUppercase{% + \ifnum \c@secnumdepth >\m@ne +% \if@mainmatter + \@chapapp\ \thechapter. \ % +% \fi + \fi + ##1}}}} +% +\fi +% \end{macrocode} +% \end{macro} +% +% \begin{macro}{\ps@myheadings} +% The definition of the page style \pstyle{myheadings} is fairly +% simple because the user determines the contents of the running +% head himself by using the |\markboth| and |\markright| commands. +% +% \begin{macrocode} +\def\ps@myheadings{% + \let\@oddfoot\@empty\let\@evenfoot\@empty + \def\@evenhead{\thepage\hfil\slshape\leftmark}% + \def\@oddhead{{\slshape\rightmark}\hfil\thepage}% +% \end{macrocode} +% +% We have to make sure that the marking commands that are used by +% the chapter and section headings are disabled. We do this +% |\let|ting them to a macro that gobbles its argument(s). +% \begin{macrocode} + \let\@mkboth\@gobbletwo +% \let\chaptermark\@gobble + \let\sectionmark\@gobble +%
\let\subsectionmark\@gobble + } +% \end{macrocode} +% \end{macro} +% +% \section{Document Markup} +% +% \subsection{The title} +% +% \begin{macro}{\title} +% \begin{macro}{\author} +% \begin{macro}{\date} +% These three macros are provided by \file{latex.dtx} to provide +% information about the title, author(s) and date of the document. +% The information is stored away in internal control sequences. +% It is the task of the |\maketitle| command to use the +% information provided. The definitions of these macros are shown +% here for information. +% \begin{macrocode} +% \newcommand*{\title}[1]{\gdef\@title{#1}} +% \newcommand*{\author}[1]{\gdef\@author{#1}} +% \newcommand*{\date}[1]{\gdef\@date{#1}} +% \end{macrocode} +% The |\date| macro gets today's date by default. +% \begin{macrocode} +% \date{\today} +% \end{macrocode} +% \end{macro} +% \end{macro} +% \end{macro} +% +% \begin{macro}{\maketitle} +% The definition of |\maketitle| depends on whether a separate +% title page is made. This is the default for the report and book +% document classes, but for the article class it is optional. +% +% When we are making a title page, we locally redefine +% |\footnotesize| and |footnoterule| to change the appearance of +% the footnotes that are produced by the |\thanks| command; +% these changes affect all footnotes. +% \changes{v1.3o}{1995/11/02}{(CAR) Make \cs{footnote} always work in +% title, etc} +% \begin{macrocode} + \if@titlepage + \newcommand\maketitle{\begin{titlepage}% + \let\footnotesize\small + \let\footnoterule\relax + \let \footnote \thanks +% \end{macrocode} +% We center the entire title vertically; the centering is set off a +% little by adding a |\vskip|. (In compatibility mode the pagenumber +% is set to 0 by the titlepage environment to keep the behaviour +% of \LaTeX\ 2.09 style files.) +% \changes{v1.0g}{1993/12/09}{Removed the setting of the page number, +% when not in compatibility mode} +% \changes{v1.2c}{1994/03/17}{Removed setting of page number, now done +% in titlepage environment} +% \begin{macrocode} + \null\vfil + \vskip 60\p@ +% \end{macrocode} +% Then we set the title, in a |\LARGE| font; leave a little space +% and set the author(s) in a |\large| font. We do this inside a +% tabular environment to get them in a single column. +% Before the date we leave a little whitespace again. +% \begin{macrocode} + \begin{center}% + {\LARGE \@title \par}% + \vskip 3em% + {\large + \lineskip .75em% + \begin{tabular}[t]{c}% + \@author + \end{tabular}\par}% + \vskip 1.5em% + {\large \@date \par}% % Set date in \large size. + \end{center}\par +% \end{macrocode} +% Then we call |\@thanks| to print the information that goes into +% the footnote and finish the page. +% \begin{macrocode} + \@thanks + \vfil\null + \end{titlepage}% +% \end{macrocode} +% We reset the \Lcount{footnote} counter, disable |\thanks| and +% |\maketitle| and save some storage space by emptying the internal +% information macros. +% \changes{v1.3j}{1995/08/16}{use \cs{let} to save space} +% \changes{v1.3n}{1995/10/29}{Empty \cs{@date} as well} +% \begin{macrocode} + \setcounter{footnote}{0}% + \global\let\thanks\relax + \global\let\maketitle\relax + \global\let\@thanks\@empty + \global\let\@author\@empty + \global\let\@date\@empty + \global\let\@title\@empty +% \end{macrocode} +% After the title is set the declaration commands |\title|, etc.\ +% can vanish. +% The definition of |\and| makes only sense within the argument of +% |\author| so this can go as well. +% \changes{v1.3k}{1995/08/27}{Disable \cs{title} and similar decls} +% \begin{macrocode} + \global\let\title\relax + \global\let\author\relax + \global\let\date\relax + \global\let\and\relax +} +% \end{macrocode} +% When the title is not on a page of its own, the layout of the +% title is a little different. We use symbols to mark the footnotes +% and we have to deal with two column documents. +% +% Therefore we first start a new group to keep changes local. Then +% we redefine |\thefootnote| to use |\fnsymbol|; and change +% |\@makefnmark| so that footnotemarks have zero width (to make the +% centering of the author names look better). +% \changes{v1.2s}{1994/06/02}{Reset \cs{@makefntext}} +% \changes{v1.3a}{1995/05/17}{Use \cs{@makefnmark} in definition of +% \cs{@makefntext}} +% \changes{v1.3g}{1995/06/26}{Fix definition of \cs{@makefnmark} and +% \cs{@makefntext} to a) work and b) without using math} +% \begin{macrocode} +\else +\newcommand\maketitle{\par + \begingroup + \renewcommand\thefootnote{\@fnsymbol\c@footnote}% + \def\@makefnmark{\rlap{\@textsuperscript{\normalfont\@thefnmark}}}% + \long\def\@makefntext##1{\parindent 1em\noindent + \hb@xt@1.8em{% + \hss\@textsuperscript{\normalfont\@thefnmark}}##1}% +% \end{macrocode} +% If this is a twocolumn document we start a new page in twocolumn +% mode, with the title set to the full width of the text. The +% actual printing of the title information is left to +% |\@maketitle|. +% \changes{v1.2k}{1994/05/06}{Added check on number of columns in use +% locally} +% \begin{macrocode} + \if@twocolumn + \ifnum \col@number=\@ne + \@maketitle + \else + \twocolumn[\@maketitle]% + \fi + \else +% \end{macrocode} +% When this is not a twocolumn document we just start a new page, +% prevent floating objects from appearing on the top of this page +% and print the title information. +% \begin{macrocode} + \newpage + \global\@topnum\z@ % Prevents figures from going at top of page. + \@maketitle + \fi +% \end{macrocode} +% This page gets a \pstyle{plain} layout. We call |\@thanks| to +% produce the footnotes. +% \begin{macrocode} + \thispagestyle{plain}\@thanks +% \end{macrocode} +% Now we can close the group, reset the \Lcount{footnote} counter, +% disable |\thanks|, |\maketitle| and |\@maketitle| and save some +% storage space by emptying the internal information macros. +% \changes{v1.3j}{1995/08/16}{use \cs{let} to save space} +% \changes{v1.3k}{1995/08/27}{Disable \cs{title} and similar decls} +% \changes{v1.3n}{1995/10/29}{Empty \cs{@date} as well} +% \begin{macrocode} + \endgroup + \setcounter{footnote}{0}% + \global\let\thanks\relax + \global\let\maketitle\relax + \global\let\@maketitle\relax + \global\let\@thanks\@empty + \global\let\@author\@empty + \global\let\@date\@empty + \global\let\@title\@empty + \global\let\title\relax + \global\let\author\relax + \global\let\date\relax + \global\let\and\relax +} +% \end{macrocode} +% \end{macro} +% +% \begin{macro}{\@maketitle} +% This macro takes care of formatting the title information when we +% have no separate title page. +% +% We always start a new page, leave some white space and center the +% information. The title is set in a |\LARGE| font, the author +% names and the in a |\large| font. +% \changes{v1.3o}{1995/11/02}{(CAR) Make \cs{footnote} always work in +% title, etc} +% \begin{macrocode} +\def\@maketitle{% + \newpage + \null + \vskip 2em% + \begin{center}% + \let \footnote \thanks + {\LARGE \@title \par}% + \vskip 1.5em% + {\large + \lineskip .5em% + \begin{tabular}[t]{c}% + \@author + \end{tabular}\par}% + \vskip 1em% + {\large \@date}% + \end{center}% + \par + \vskip 1.5em} +\fi +% \end{macrocode} +% \end{macro} +% +% \subsection{Chapters and Sections} +% +% \subsubsection{Building blocks} The definitions in this part of the +% class file make use of two internal macros, |\@startsection| and +% |\secdef|. To understand +% what is going on here, we describe their syntax. +% +% The macro |\@startsection| has 6 required arguments, optionally +% followed by a $*$, an optional argument and a required argument: +% +% |\@startsection|\meta{name}\meta{level}\meta{indent}^^A +% \meta{beforeskip}\meta{afterskip}\meta{style} +% optional *\\ +% \null\hphantom{\bslash @startsection}^^A +% |[|\meta{altheading}|]|\meta{heading} +% +% It is a generic command to start a section, the arguments have +% the following meaning: +% +% \begin{description} +% \item[\meta{name}] The name of the user level command, e.g., +% `section'. +% \item[\meta{level}] A number, denoting the depth of the section +% -- e.g., chapter=1, section = 2, etc. A section number +% will be printed if and only if \meta{level} $<=$ the value +% of the \Lcount{secnumdepth} counter. +% \item[\meta{indent}] The indentation of the heading from the left +% margin +% \item[\meta{beforeskip}] The absolute value of this argument +% gives the skip to leave above the heading. If it is +% negative, then the paragraph indent of the text following +% the heading is suppressed. +% \item[\meta{afterskip}] If positive, this gives the skip to leave +% below the heading, else it gives the skip to leave to the +% right of a run-in heading. +% \item[\meta{style}] Commands to set the style of the heading. +% \item[$*$] When this is missing the heading is numbered and the +% corresponding counter is incremented. +% \item[\meta{altheading}] Gives an alternative heading to use in +% the table of contents and in the running heads. This should +% be present when the $*$ form is used. +% \item[\meta{heading}] The heading of the new section. +% \end{description} +% A sectioning command is normally defined to |\@startsection| and +% its first six arguments. +% +% The macro |\secdef| can be used when a sectioning command is +% defined without using |\@startsection|. It has two arguments: +% +% |\secdef|\meta{unstarcmds}\meta{starcmds} +% +% \begin{description} +% \item[\meta{unstarcmds}] Used for the normal form of the +% sectioning command. +% \item[\meta{starcmds}] Used for the $*$-form of the +% sectioning command. +% \end{description} +% +% You can use |\secdef| as follows: +% \begin{verbatim} +% \def\chapter { ... \secdef \CMDA \CMDB } +% \def\CMDA [#1]#2{ ... } % Command to define +% % \chapter[...]{...} +% \def\CMDB #1{ ... } % Command to define +% % \chapter*{...} +% \end{verbatim} +% +% \subsubsection{Mark commands} +% +% \begin{macro}{\chaptermark} +% \begin{macro}{\sectionmark} +% \begin{macro}{\subsectionmark} +% \begin{macro}{\subsubsectionmark} +% \begin{macro}{\paragraphmark} +% \begin{macro}{\subparagraphmark} +% Default initializations of |\...mark| commands. These commands +% are used in the definition of the page styles (see +% section~\ref{sec:classes:pagestyle}) Most of them are already defined by +% \file{latex.dtx}, so they are only shown here. +% +% \begin{macrocode} +%\newcommand*\chaptermark[1]{} +% \newcommand*\sectionmark[1]{} +% \newcommand*\subsectionmark[1]{} +% \newcommand*\subsubsectionmark[1]{} +% \newcommand*\paragraphmark[1]{} +% \newcommand*\subparagraphmark[1]{} +% \end{macrocode} +% \end{macro} +% \end{macro} +% \end{macro} +% \end{macro} +% \end{macro} +% \end{macro} +% +% \subsubsection{Define Counters} +% +% \begin{macro}{\c@secnumdepth} +% The value of the counter \Lcount{secnumdepth} gives the depth of +% the highest-level sectioning command that is to produce section +% numbers. +% \begin{macrocode} +%
\setcounter{secnumdepth}{3} +%\setcounter{secnumdepth}{2} +% \end{macrocode} +% \end{macro} +% +% \begin{macro}{\c@part} +% \begin{macro}{\c@chapter} +% \begin{macro}{\c@section} +% \begin{macro}{\c@subsection} +% \begin{macro}{\c@subsubsection} +% \begin{macro}{\c@paragraph} +% \begin{macro}{\c@subparagraph} +% These counters are used for the section numbers. The macro\\ +% |\newcounter{|\meta{newctr}|}[|\meta{oldctr}|]|\\ +% defines\meta{newctr} to be a counter, which is reset to zero when +% counter \meta{oldctr} is stepped. Counter \meta{oldctr} must +% already be defined. +% +% \begin{macrocode} +\newcounter {part} +%
\newcounter {section} +%<*report|book> +\newcounter {chapter} +\newcounter {section}[chapter] +% +\newcounter {subsection}[section] +\newcounter {subsubsection}[subsection] +\newcounter {paragraph}[subsubsection] +\newcounter {subparagraph}[paragraph] +% \end{macrocode} +% \end{macro} +% \end{macro} +% \end{macro} +% \end{macro} +% \end{macro} +% \end{macro} +% \end{macro} +% +% \begin{macro}{\thepart} +% \begin{macro}{\thechapter} +% \begin{macro}{\thesection} +% \begin{macro}{\thesubsection} +% \begin{macro}{\thesubsubsection} +% \begin{macro}{\theparagraph} +% \begin{macro}{\thesubparagraph} +% For any counter \Lcount{CTR}, |\theCTR| is a macro that defines +% the printed version of counter \Lcount{CTR}. It is defined in +% terms of the following macros: +% +% |\arabic{|\Lcount{COUNTER}|}| prints the value of +% \Lcount{COUNTER} as an arabic numeral. +% +% |\roman{|\Lcount{COUNTER}|}| prints the value of +% \Lcount{COUNTER} as a lowercase roman numberal. +% +% |\Roman{|\Lcount{COUNTER}|}| prints the value of +% \Lcount{COUNTER} as an uppercase roman numberal. +% +% |\alph{|\Lcount{COUNTER}|}| prints the value of \Lcount{COUNTER} +% as a lowercase letter: $1 =$~a, $2 =$~ b, etc. +% +% |\Alph{|\Lcount{COUNTER}|}| prints the value of \Lcount{COUNTER} +% as an uppercase letter: $1 =$~A, $2 =$~B, etc. +% +% Actually to save space the internal counter repesentations +% and the commands operating on those are used. +% \begin{macrocode} +\renewcommand \thepart {\@Roman\c@part} +%
\renewcommand \thesection {\@arabic\c@section} +%<*report|book> +\renewcommand \thechapter {\@arabic\c@chapter} +\renewcommand \thesection {\thechapter.\@arabic\c@section} +% +\renewcommand\thesubsection {\thesection.\@arabic\c@subsection} +\renewcommand\thesubsubsection{\thesubsection .\@arabic\c@subsubsection} +\renewcommand\theparagraph {\thesubsubsection.\@arabic\c@paragraph} +\renewcommand\thesubparagraph {\theparagraph.\@arabic\c@subparagraph} +% \end{macrocode} +% \end{macro} +% \end{macro} +% \end{macro} +% \end{macro} +% \end{macro} +% \end{macro} +% \end{macro} +% +% \begin{macro}{\@chapapp} +% |\@chapapp| is initially defined to be `|\chaptername|'. The +% |\appendix| command redefines it to be `|\appendixname|'. +% +% \begin{macrocode} +%\newcommand\@chapapp{\chaptername} +% \end{macrocode} +% \end{macro} +% +% \subsubsection{Front Matter, Main Matter, and Back Matter} +% +% A book contains these three (logical) sections. The switch +% |\@mainmatter| is true iff we are processing Main Matter. When +% this switch is false, the |\chapter| command does not print +% chapter numbers. +% +% Here we define the commands that start these sections. +% \begin{macro}{\frontmatter} +% This command starts Roman page numbering and turns off chapter +% numbering. Since this restarts the page numbering from 1, it +% should also ensure that a recto page is used. +% \changes{v1.3r}{1996/05/26}{Make this command react to the option +% \texttt{openany}} +% \changes{v1.3y}{1998/05/05}{Two years on: Make this command not +% react to the option \texttt{openany} as this makes the +% verso/recto numbering wrong: see pr/2754 for discussion} +% \begin{macrocode} +%<*book> +\newcommand\frontmatter{% +% \if@openright + \cleardoublepage +% \else +% \clearpage +% \fi + \@mainmatterfalse + \pagenumbering{roman}} +% \end{macrocode} +% \end{macro} +% +% \begin{macro}{\mainmatter} +% This command clears the page, starts arabic page numbering and +% turns on chapter numbering. Since this restarts the page numbering +% from 1, it should also ensure that a recto page is used. +% \changes{v1.3r}{1996/05/26}{Make this command react to the option +% \texttt{openany}} +% \changes{v1.3y}{1998/05/05}{Two years on: Make this command not +% react to the option \texttt{openany} as this makes the +% verso/recto numbering wrong: see pr/2754 for discussion} +% \begin{macrocode} +\newcommand\mainmatter{% +% \if@openright + \cleardoublepage +% \else +% \clearpage +% \fi + \@mainmattertrue + \pagenumbering{arabic}} +% \end{macrocode} +% \end{macro} +% +% \begin{macro}{\backmatter} +% This clears the page, turns off chapter numbering and leaves page +% numbering unchanged. +% \begin{macrocode} +\newcommand\backmatter{% + \if@openright + \cleardoublepage + \else + \clearpage + \fi + \@mainmatterfalse} +% +% \end{macrocode} +% \end{macro} +% +% \subsubsection{Parts} +% +% \begin{macro}{\part} +% The command to start a new part of our document. +% +% In the article class the definition of |\part| is rather simple; +% we start a new paragraph, add a little white space, suppress the +% indentation of the first paragraph and make use of |\secdef|. +% As in other sectioning commands (cf.\ |\@startsection| in the +% {\LaTeXe} kernel), we need to check the |@noskipsec| switch and +% force horizontal mode if it is set. +% \changes{v1.4a}{1999/01/07}{Check \texttt{@noskipsec} switch and +% possibly force horizontal mode; see PR/2889.} +% \begin{macrocode} +%<*article> +\newcommand\part{% + \if@noskipsec \leavevmode \fi + \par + \addvspace{4ex}% + \@afterindentfalse + \secdef\@part\@spart} +%
+% \end{macrocode} +% +% For the report and book classes we things a bit different. +% +% We start a new (righthand) page and use the \pstyle{plain} +% pagestyle. +% \changes{v1.3r}{1996/05/26}{Make this command react to the option +% \texttt{openany}} +% \begin{macrocode} +%<*report|book> +\newcommand\part{% + \if@openright + \cleardoublepage + \else + \clearpage + \fi + \thispagestyle{plain}% +% \end{macrocode} +% When we are making a two column document, this will be a one +% column page. We use |@tempswa| to remember to switch back to two +% columns. +% \begin{macrocode} + \if@twocolumn + \onecolumn + \@tempswatrue + \else + \@tempswafalse + \fi +% \end{macrocode} +% We need an empty box to prevent the fil glue from disappearing. +% \changes{v1.3j}{1995/08/16}{Replace \cs{hbox} by \cs{null}} +% \begin{macrocode} + \null\vfil +% \end{macrocode} +% Here we use |\secdef| to indicate which commands to use to make +% the actual heading. +% \begin{macrocode} + \secdef\@part\@spart} +% +% \end{macrocode} +% +% \begin{macro}{\@part} +% This macro does the actual formatting of the title of the part. +% Again the macro is differently defined for the article document +% class than for the document classes report and book. + +% When \Lcount{secnumdepth} is larger than $-1$ for the +% document class article, we have a numbered +% part, otherwise it is unnumbered. +% \begin{macrocode} +%<*article> +\def\@part[#1]#2{% + \ifnum \c@secnumdepth >\m@ne + \refstepcounter{part}% + \addcontentsline{toc}{part}{\thepart\hspace{1em}#1}% + \else + \addcontentsline{toc}{part}{#1}% + \fi +% \end{macrocode} +% We print the title flush left in the article class. +% Also we prevent breaking between lines and reset the font. +% \changes{v1.3c}{1995/05/25}{replace \cs{reset@font} with +% \cs{normalfont}} +% \begin{macrocode} + {\parindent \z@ \raggedright + \interlinepenalty \@M + \normalfont +% \end{macrocode} +% When this is a numbered part we have to print the number and the +% title. The |\nobreak| should prevent a page break here. +% \changes{v1.4e}{2001/05/24}{Replaced tilde with \cs{nobreakspace} +% (pr/3310)} +% \begin{macrocode} + \ifnum \c@secnumdepth >\m@ne + \Large\bfseries \partname\nobreakspace\thepart + \par\nobreak + \fi + \huge \bfseries #2% +% \end{macrocode} +% Now we empty the mark registers, leave some white space and let +% |\@afterheading| take care of suppressing the indentation. +% \begin{macrocode} + \markboth{}{}\par}% + \nobreak + \vskip 3ex + \@afterheading} +%
+% \end{macrocode} +% +% When \Lcount{secnumdepth} is larger than $-2$ for the +% document class report and book, we have a numbered +% part, otherwise it is unnumbered. +% \begin{macrocode} +%<*report|book> +\def\@part[#1]#2{% + \ifnum \c@secnumdepth >-2\relax + \refstepcounter{part}% + \addcontentsline{toc}{part}{\thepart\hspace{1em}#1}% + \else + \addcontentsline{toc}{part}{#1}% + \fi +% \end{macrocode} +% We empty the mark registers and center the title on the page in the +% report and book document classes. +% Also we prevent breaking between lines and reset the font. +% \changes{v1.3c}{1995/05/25}{replace \cs{reset@font} with +% \cs{normalfont}} +% \changes{v1.3j}{1995/08/16}{add missing percent} +% \begin{macrocode} + \markboth{}{}% + {\centering + \interlinepenalty \@M + \normalfont +% \end{macrocode} +% When this is a numbered part we have to print the number. +% \changes{v1.4e}{2001/05/24}{Replaced tilde with \cs{nobreakspace} +% (pr/3310)} +% \begin{macrocode} + \ifnum \c@secnumdepth >-2\relax + \huge\bfseries \partname\nobreakspace\thepart + \par +% \end{macrocode} +% We leave some space before we print the title and leave the +% finishing up to |\@endpart|. +% \begin{macrocode} + \vskip 20\p@ + \fi + \Huge \bfseries #2\par}% + \@endpart} +% +% \end{macrocode} +% \end{macro} +% +% \begin{macro}{\@spart} +% This macro does the actual formatting of the title of the part +% when the star form of the user command was used. In this case we +% \emph{never} print a number. Otherwise the formatting is the +% same. +% +% The differences between the definition of this macro in the +% article document class and in the report and book document +% classes are similar as they were for |\@part|. +% \changes{v1.3c}{1995/05/25}{replace \cs{reset@font} with +% \cs{normalfont}} +% \begin{macrocode} +%<*article> +\def\@spart#1{% + {\parindent \z@ \raggedright + \interlinepenalty \@M + \normalfont + \huge \bfseries #1\par}% + \nobreak + \vskip 3ex + \@afterheading} +%
+%<*report|book> +\def\@spart#1{% + {\centering + \interlinepenalty \@M + \normalfont + \Huge \bfseries #1\par}% + \@endpart} +% +% \end{macrocode} +% \end{macro} +% +% \begin{macro}{\@endpart} +% \changes{v1.3j}{1995/08/16}{move docstrip guard to avoid defining +% \cs{@endpart} in article} +% This macro finishes the part page, for both |\@part| and +% |\@spart|. +% +% First we fill the current page. +% \begin{macrocode} +%<*report|book> +\def\@endpart{\vfil\newpage +% \end{macrocode} +% Then, when we are in twosided mode and chapters are supposed to +% be on right hand sides, we produce a completely blank page. +% \changes{v1.4b}{2000/05/19}{Only add empty page after part if +% twoside and openright (pr/3155)} +% \begin{macrocode} + \if@twoside + \if@openright + \null + \thispagestyle{empty}% + \newpage + \fi + \fi +% \end{macrocode} +% When this was a two column document we have to switch back to two +% column mode. +% \begin{macrocode} + \if@tempswa + \twocolumn + \fi} +% +% \end{macrocode} +% \end{macro} +% \end{macro} +% +% \subsubsection{Chapters} +% +% \begin{macro}{\chapter} +% A chapter should always start on a new page therefore we start by +% calling |\clearpage| and setting the pagestyle for this page to +% \pstyle{plain}. +% \begin{macrocode} +%<*report|book> +\newcommand\chapter{\if@openright\cleardoublepage\else\clearpage\fi + \thispagestyle{plain}% +% \end{macrocode} +% Then we prevent floats from appearing at the top of this page +% because it looks weird to see a floating object above a chapter +% title. +% \begin{macrocode} + \global\@topnum\z@ +% \end{macrocode} +% Then we suppress the indentation of the first paragraph by +% setting the switch |\@afterindent| to |false|. We use |\secdef| +% to specify the macros to use for actually setting the chapter +% title. +% \begin{macrocode} + \@afterindentfalse + \secdef\@chapter\@schapter} +% \end{macrocode} +% +% \begin{macro}{\@chapter} +% This macro is called when we have a numbered chapter. When +% \Lcount{secnumdepth} is larger than $-1$ and, in the book +% class, |\@mainmatter| is true, we display the chapter +% number. We also inform the user that a new chapter is about to be +% typeset by writing a message to the terminal. +% \begin{macrocode} +\def\@chapter[#1]#2{\ifnum \c@secnumdepth >\m@ne +% \if@mainmatter + \refstepcounter{chapter}% + \typeout{\@chapapp\space\thechapter.}% + \addcontentsline{toc}{chapter}% + {\protect\numberline{\thechapter}#1}% +%<*book> + \else + \addcontentsline{toc}{chapter}{#1}% + \fi +% + \else + \addcontentsline{toc}{chapter}{#1}% + \fi +% \end{macrocode} +% After having written an entry to the table of contents we store +% the (alternative) title of this chapter with |\chaptermark| and +% add some white space to the lists of figures and tables. +% \begin{macrocode} + \chaptermark{#1}% + \addtocontents{lof}{\protect\addvspace{10\p@}}% + \addtocontents{lot}{\protect\addvspace{10\p@}}% +% \end{macrocode} +% Then we call upon |\@makechapterhead| to format the actual +% chapter title. We have to do this in a special way when we are in +% twocolumn mode in order to have the chapter title use the entire +% |\textwidth|. In one column mode we call |\@afterheading| which +% takes care of suppressing the indentation. +% \begin{macrocode} + \if@twocolumn + \@topnewpage[\@makechapterhead{#2}]% + \else + \@makechapterhead{#2}% + \@afterheading + \fi} +% \end{macrocode} +% +% \begin{macro}{\@makechapterhead} +% The macro above uses |\@makechapterhead|\meta{text} to format the +% heading of the chapter. +% +% We begin by leaving some white space. The we open a group in +% which we have a paragraph indent of 0pt, and in which we have the +% text set ragged right. We also reset the font. +% \changes{v1.3c}{1995/05/25}{replace \cs{reset@font} with +% \cs{normalfont}} +% \begin{macrocode} +\def\@makechapterhead#1{% + \vspace*{50\p@}% + {\parindent \z@ \raggedright \normalfont +% \end{macrocode} +% Then we check whether the number of the chapter has to be printed. +% If so we leave some whitespace between the chapternumber and its +% title. +% \changes{v1.2v}{1994/11/30}{Added a \cs{nobreak} to prevent a +% pagebreak between the chapternumber and the chaptertitle} +% \changes{v1.3j}{1995/08/16}{replace braces by \cs{space}} +% \begin{macrocode} + \ifnum \c@secnumdepth >\m@ne +% \if@mainmatter + \huge\bfseries \@chapapp\space \thechapter + \par\nobreak + \vskip 20\p@ +% \fi + \fi +% \end{macrocode} +% Now we set the title in a large bold font. We prevent a pagebreak +% from occuring in the middle of or after the title. Finally we +% leave some whitespace before the text begins. +% \changes{v1.2v}{1994/11/30}{Added \cs{interlinepenalty}\cs{@M} to +% prevent a pagebreak in the middle of a title} +% \begin{macrocode} + \interlinepenalty\@M + \Huge \bfseries #1\par\nobreak + \vskip 40\p@ + }} +% \end{macrocode} +% \end{macro} +% \end{macro} +% +% \begin{macro}{\@schapter} +% This macro is called when we have an unnumbered chapter. It is +% much simpler than |\@chapter| because it only needs to typeset +% the chapter title. +% \begin{macrocode} +\def\@schapter#1{\if@twocolumn + \@topnewpage[\@makeschapterhead{#1}]% + \else + \@makeschapterhead{#1}% + \@afterheading + \fi} +% \end{macrocode} +% +% \begin{macro}{\@makeschapterhead} +% The macro above uses |\@makeschapterhead|\meta{text}to format +% the heading of the chapter. It is similar to |\@makechapterhead| +% except that it never has to print a chapter number. +% +% \changes{v1.2v}{1994/11/30}{Added \cs{interlinepenalty}\cs{@M} to +% prevent a pagebreak in the middle of a title} +% \changes{v1.3c}{1995/05/25}{replace \cs{reset@font} with +% \cs{normalfont}} +% \begin{macrocode} +\def\@makeschapterhead#1{% + \vspace*{50\p@}% + {\parindent \z@ \raggedright + \normalfont + \interlinepenalty\@M + \Huge \bfseries #1\par\nobreak + \vskip 40\p@ + }} +% +% \end{macrocode} +% \end{macro} +% \end{macro} +% \end{macro} +% +% +% \subsubsection{Lower level headings} +% +% These commands all make use of |\@startsection|. +% \begin{macro}{\section} +% This gives a normal heading with white space above and below the +% heading, the title set in |\Large\bfseries|, and no indentation +% on the first paragraph. +% \changes{v1.3c}{1995/05/25}{replace \cs{reset@font} with +% \cs{normalfont}} +% \begin{macrocode} +\newcommand\section{\@startsection {section}{1}{\z@}% + {-3.5ex \@plus -1ex \@minus -.2ex}% + {2.3ex \@plus.2ex}% + {\normalfont\Large\bfseries}} +% \end{macrocode} +% \end{macro} +% +% \begin{macro}{\subsection} +% This gives a normal heading with white space above and below the +% heading, the title set in |\large\bfseries|, and no indentation +% on the first paragraph. +% \begin{macrocode} +\newcommand\subsection{\@startsection{subsection}{2}{\z@}% + {-3.25ex\@plus -1ex \@minus -.2ex}% + {1.5ex \@plus .2ex}% + {\normalfont\large\bfseries}} +% \end{macrocode} +% \end{macro} +% +% \begin{macro}{\subsubsection} +% This gives a normal heading with white space above and below the +% heading, the title set in |\normalsize\bfseries|, and no +% indentation on the first paragraph. +% \begin{macrocode} +\newcommand\subsubsection{\@startsection{subsubsection}{3}{\z@}% + {-3.25ex\@plus -1ex \@minus -.2ex}% + {1.5ex \@plus .2ex}% + {\normalfont\normalsize\bfseries}} +% \end{macrocode} +% \end{macro} +% +% \begin{macro}{\paragraph} +% This gives a run-in heading with white space above and to the +% right of the heading, the title set in |\normalsize\bfseries|. +% \begin{macrocode} +\newcommand\paragraph{\@startsection{paragraph}{4}{\z@}% + {3.25ex \@plus1ex \@minus.2ex}% + {-1em}% + {\normalfont\normalsize\bfseries}} +% \end{macrocode} +% \end{macro} +% +% \begin{macro}{\subparagraph} +% This gives an indented run-in heading with white space above and +% to the right of the heading, the title set in +% |\normalsize\bfseries|. +% \begin{macrocode} +\newcommand\subparagraph{\@startsection{subparagraph}{5}{\parindent}% + {3.25ex \@plus1ex \@minus .2ex}% + {-1em}% + {\normalfont\normalsize\bfseries}} +% \end{macrocode} +% \end{macro} +% +% \subsection{Lists} +% +% \subsubsection{General List Parameters} +% +% The following commands are used to set the default values for the list +% environment's parameters. See the \LaTeX{} manual for an explanation +% of the meanings of the parameters. Defaults for the list +% environment are set as follows. First, |\rightmargin|, +% |\listparindent| and |\itemindent| are set to 0pt. Then, for a Kth +% level list, the command |\@listK| is called, where `K' denotes `i', +% '`i', ... , `vi'. (I.e., |\@listiii| is called for a third-level +% list.) By convention, |\@listK| should set |\leftmargin| to +% |\leftmarginK|. +% +% \begin{macro}{\leftmargin} +% \begin{macro}{\leftmargini} +% \begin{macro}{\leftmarginii} +% \begin{macro}{\leftmarginiii} +% \begin{macro}{\leftmarginiv} +% \begin{macro}{\leftmarginv} +% \begin{macro}{\leftmarginvi} +% \changes{v1.0m}{1994/01/12}{Use em instead of pt to remain +% compatible with old styles} +% \changes{v1.3q}{1995/12/20}{Temporary(?) fix: revert to setting +% \cs{leftmargin} at outer level} +% +% When we are in two column mode some of the margins are set somewhat +% smaller. +% \begin{macrocode} +\if@twocolumn + \setlength\leftmargini {2em} +\else + \setlength\leftmargini {2.5em} +\fi +% \end{macrocode} +% Until the whole of the parameter setting in these files is +% rationalised, we need to set the value of |\leftmargin| at this +% outer level. +% \begin{macrocode} +\leftmargin \leftmargini +% \end{macrocode} +% The following three are calculated so that they are larger than +% the sum of |\labelsep| and the width of the default labels (which +% are `(m)', `vii.' and `M.'). +% \begin{macrocode} +\setlength\leftmarginii {2.2em} +\setlength\leftmarginiii {1.87em} +\setlength\leftmarginiv {1.7em} +\if@twocolumn + \setlength\leftmarginv {.5em} + \setlength\leftmarginvi {.5em} +\else + \setlength\leftmarginv {1em} + \setlength\leftmarginvi {1em} +\fi +% \end{macrocode} +% \end{macro} +% \end{macro} +% \end{macro} +% \end{macro} +% \end{macro} +% \end{macro} +% \end{macro} +% +% \begin{macro}{\labelsep} +% \begin{macro}{\labelwidth} +% \changes{v1.0m}{1994/01/12}{Use em instead of pt to remain +% compatible with old styles} +% |\labelsep| is the distance between the label and the text of an +% item; |\labelwidth| is the width of the label. +% \begin{macrocode} +\setlength \labelsep {.5em} +\setlength \labelwidth{\leftmargini} +\addtolength\labelwidth{-\labelsep} +% \end{macrocode} +% \end{macro} +% \end{macro} +% +% \begin{macro}{\partopsep} +% When the user leaves a blank line before the environment an extra +% vertical space of |\partopsep| is inserted, in addition to +% |\parskip| and |\topsep|. +% \changes{v1.0m}{1994/01/12}{\cs{partopsep} should be different, +% depending on the pointsize} +% \begin{macrocode} +% +%<10pt>\setlength\partopsep{2\p@ \@plus 1\p@ \@minus 1\p@} +%<11pt>\setlength\partopsep{3\p@ \@plus 1\p@ \@minus 1\p@} +%<12pt>\setlength\partopsep{3\p@ \@plus 2\p@ \@minus 2\p@} +% \end{macrocode} +% \end{macro} +% +% \begin{macro}{\@beginparpenalty} +% \begin{macro}{\@endparpenalty} +% These penalties are inserted before and after a list or paragraph +% environment. They are set to a bonus value to encourage page +% breaking at these points. +% \begin{macro}{\@itempenalty} +% This penalty is inserted between list items. +% \begin{macrocode} +%<*article|report|book> +\@beginparpenalty -\@lowpenalty +\@endparpenalty -\@lowpenalty +\@itempenalty -\@lowpenalty +% +% \end{macrocode} +% \end{macro} +% \end{macro} +% \end{macro} +% +% \begin{macro}{\@listi} +% \begin{macro}{\@listI} +% |\@listi| defines the values of +% |\leftmargin|, |\parsep|, |\topsep|, |\itemsep|, etc.\ for the +% lists that appear on top-level. Its definition is modified by the +% font-size commands (eg within |\small| the list parameters get +% ``smaller'' values). +% +% For this reason \@listI is defined to hold a saved copy of \@listi +% so that |\normalsize| can switch all parameters back. +% +% \begin{macrocode} +%<*10pt|11pt|12pt> +\def\@listi{\leftmargin\leftmargini +%<*10pt> + \parsep 4\p@ \@plus2\p@ \@minus\p@ + \topsep 8\p@ \@plus2\p@ \@minus4\p@ + \itemsep4\p@ \@plus2\p@ \@minus\p@} +% +%<*11pt> + \parsep 4.5\p@ \@plus2\p@ \@minus\p@ + \topsep 9\p@ \@plus3\p@ \@minus5\p@ + \itemsep4.5\p@ \@plus2\p@ \@minus\p@} +% +%<*12pt> + \parsep 5\p@ \@plus2.5\p@ \@minus\p@ + \topsep 10\p@ \@plus4\p@ \@minus6\p@ + \itemsep5\p@ \@plus2.5\p@ \@minus\p@} +% +\let\@listI\@listi +% \end{macrocode} +% We initialise the parameters although strictly speaking that +% is not necessary. +% \begin{macrocode} +\@listi +% \end{macrocode} +% \end{macro} +% \end{macro} +% +% \begin{macro}{\@listii} +% \begin{macro}{\@listiii} +% \begin{macro}{\@listiv} +% \begin{macro}{\@listv} +% \begin{macro}{\@listvi} +% Here are the same macros for the higher level lists. Note that +% they don't have saved versions and are not modified by the font +% size commands. In other words this class assumes that nested +% lists only appear in |\normalsize|, i.e.\ the main document size. +% \begin{macrocode} +\def\@listii {\leftmargin\leftmarginii + \labelwidth\leftmarginii + \advance\labelwidth-\labelsep +%<*10pt> + \topsep 4\p@ \@plus2\p@ \@minus\p@ + \parsep 2\p@ \@plus\p@ \@minus\p@ +% +%<*11pt> + \topsep 4.5\p@ \@plus2\p@ \@minus\p@ + \parsep 2\p@ \@plus\p@ \@minus\p@ +% +%<*12pt> + \topsep 5\p@ \@plus2.5\p@ \@minus\p@ + \parsep 2.5\p@ \@plus\p@ \@minus\p@ +% + \itemsep \parsep} +\def\@listiii{\leftmargin\leftmarginiii + \labelwidth\leftmarginiii + \advance\labelwidth-\labelsep +%<10pt> \topsep 2\p@ \@plus\p@\@minus\p@ +%<11pt> \topsep 2\p@ \@plus\p@\@minus\p@ +%<12pt> \topsep 2.5\p@\@plus\p@\@minus\p@ + \parsep \z@ + \partopsep \p@ \@plus\z@ \@minus\p@ + \itemsep \topsep} +\def\@listiv {\leftmargin\leftmarginiv + \labelwidth\leftmarginiv + \advance\labelwidth-\labelsep} +\def\@listv {\leftmargin\leftmarginv + \labelwidth\leftmarginv + \advance\labelwidth-\labelsep} +\def\@listvi {\leftmargin\leftmarginvi + \labelwidth\leftmarginvi + \advance\labelwidth-\labelsep} +% +% \end{macrocode} +% \end{macro} +% \end{macro} +% \end{macro} +% \end{macro} +% \end{macro} +% +% \subsubsection{Enumerate} +% +% The enumerate environment uses four counters: \Lcount{enumi}, +% \Lcount{enumii}, \Lcount{enumiii} and \Lcount{enumiv}, where +% \Lcount{enumN} controls the numbering of the Nth level +% enumeration. +% +% \begin{macro}{\theenumi} +% \begin{macro}{\theenumii} +% \begin{macro}{\theenumiii} +% \begin{macro}{\theenumiv} +% The counters are already defined in \file{latex.dtx}, but their +% representation is changed here. +% +% \begin{macrocode} +%<*article|report|book> +\renewcommand\theenumi{\@arabic\c@enumi} +\renewcommand\theenumii{\@alph\c@enumii} +\renewcommand\theenumiii{\@roman\c@enumiii} +\renewcommand\theenumiv{\@Alph\c@enumiv} +% \end{macrocode} +% \end{macro} +% \end{macro} +% \end{macro} +% \end{macro} +% +% \begin{macro}{\labelenumi} +% \begin{macro}{\labelenumii} +% \begin{macro}{\labelenumiii} +% \begin{macro}{\labelenumiv} +% The label for each item is generated by the commands\\ +% |\labelenumi| \ldots\ |\labelenumiv|. +% \begin{macrocode} +\newcommand\labelenumi{\theenumi.} +\newcommand\labelenumii{(\theenumii)} +\newcommand\labelenumiii{\theenumiii.} +\newcommand\labelenumiv{\theenumiv.} +% \end{macrocode} +% \end{macro} +% \end{macro} +% \end{macro} +% \end{macro} +% +% \begin{macro}{\p@enumii} +% \begin{macro}{\p@enumiii} +% \begin{macro}{\p@enumiv} +% The expansion of |\p@enumN||\theenumN| defines the output of a +% |\ref| command when referencing an item of the Nth level of an +% enumerated list. +% \begin{macrocode} +\renewcommand\p@enumii{\theenumi} +\renewcommand\p@enumiii{\theenumi(\theenumii)} +\renewcommand\p@enumiv{\p@enumiii\theenumiii} +% \end{macrocode} +% \end{macro} +% \end{macro} +% \end{macro} +% +% \subsubsection{Itemize} +% +% \begin{macro}{\labelitemi} +% \begin{macro}{\labelitemii} +% \changes{v1.2k}{1994/05/06}{Inserted \cs{normalfont}} +% \changes{v1.3s}{1996/08/24}{Replaced -{}- with \cs{textendash}} +% \changes{v1.3u}{1996/10/31}{Changed to \cs{textbullet}, +% \cs{textasteriskcentered} and \cs{textperiodcentered}} +% \begin{macro}{\labelitemiii} +% \begin{macro}{\labelitemiv} +% Itemization is controlled by four commands: |\labelitemi|, +% |\labelitemii|, |\labelitemiii|, and |\labelitemiv|, which define +% the labels of thevarious itemization levels: the symbols used are +% bullet, bold en-dash, centered asterisk and centred dot. +% +% \begin{macrocode} +\newcommand\labelitemi{\textbullet} +\newcommand\labelitemii{\normalfont\bfseries \textendash} +\newcommand\labelitemiii{\textasteriskcentered} +\newcommand\labelitemiv{\textperiodcentered} +% \end{macrocode} +% \end{macro} +% \end{macro} +% \end{macro} +% \end{macro} +% +% \subsubsection{Description} +% +% \begin{environment}{description} +% The description environment is defined here -- while the itemize +% and enumerate environments are defined in \file{latex.dtx}. +% +% \begin{macrocode} +\newenvironment{description} + {\list{}{\labelwidth\z@ \itemindent-\leftmargin + \let\makelabel\descriptionlabel}} + {\endlist} +% \end{macrocode} +% \end{environment} +% +% \begin{macro}{\descriptionlabel} +% To change the formatting of the label, you must redefine +% |\descriptionlabel|. +% +% \changes{v1.2k}{1994/05/06}{Inserted \cs{normalfont}} +% \changes{v1.2y}{1995/01/31}{made command short} +% \begin{macrocode} +\newcommand*\descriptionlabel[1]{\hspace\labelsep + \normalfont\bfseries #1} +% \end{macrocode} +% \end{macro} +% +% \subsection{Defining new environments} +% +% \subsubsection{Abstract} +% +% \begin{environment}{abstract} +% When we are producing a separate titlepage we also put the +% abstract on a page of its own. It will be centred vertically on +% the page. +% +% Note that this environment is not defined for books. +% \changes{v1.3e}{1995/06/19}{Added setting of \cs{@endparpenalty} +% to avoid page break after abstract heading.} +% \begin{macrocode} +% \changes{v1.3m}{1995/10/23}{Added setting of \cs{beginparpenalty} to +% discourage page break before abstract heading.} +%<*article|report> +\if@titlepage + \newenvironment{abstract}{% + \titlepage + \null\vfil + \@beginparpenalty\@lowpenalty + \begin{center}% + \bfseries \abstractname + \@endparpenalty\@M + \end{center}}% + {\par\vfil\null\endtitlepage} +% \end{macrocode} +% When we are not making a separate titlepage --the default for the +% article document class-- we have to check if we are in twocolumn +% mode. In that case the abstract is as a |\section*|, otherwise +% the quotation environment is used to typeset the abstract. +% \begin{macrocode} +\else + \newenvironment{abstract}{% + \if@twocolumn + \section*{\abstractname}% + \else + \small + \begin{center}% + {\bfseries \abstractname\vspace{-.5em}\vspace{\z@}}% + \end{center}% + \quotation + \fi} + {\if@twocolumn\else\endquotation\fi} +\fi +% +% \end{macrocode} +% \end{environment} +% +% \subsubsection{Verse} +% +% \begin{environment}{verse} +% The verse environment is defined by making clever use of the +% list environment's parameters. The user types |\\| to end a line. +% This is implemented by |\let|'ing |\\| equal |\@centercr|. +% +% \changes{v1.3j}{1995/08/16}{stop \cs{item} scanning for [ with +% \cs{relax}} +% \begin{macrocode} +\newenvironment{verse} + {\let\\\@centercr + \list{}{\itemsep \z@ + \itemindent -1.5em% + \listparindent\itemindent + \rightmargin \leftmargin + \advance\leftmargin 1.5em}% + \item\relax} + {\endlist} +% \end{macrocode} +% \end{environment} +% +% \subsubsection{Quotation} +% +% \begin{environment}{quotation} +% The quotation environment is also defined by making clever use of +% the list environment's parameters. The lines in the environment +% are set smaller than |\textwidth|. The first line of a paragraph +% inside this environment is indented. +% +% \changes{v1.3j}{1995/08/16}{stop \cs{item} scanning for [ with +% \cs{relax}} +% \begin{macrocode} +\newenvironment{quotation} + {\list{}{\listparindent 1.5em% + \itemindent \listparindent + \rightmargin \leftmargin + \parsep \z@ \@plus\p@}% + \item\relax} + {\endlist} +% \end{macrocode} +% \end{environment} +% +% \subsubsection{Quote} +% +% \begin{environment}{quote} +% The quote environment is like the quotation environment except +% that paragraphs are not indented. +% +% \changes{v1.3j}{1995/08/16}{stop \cs{item} scanning for [ with +% \cs{relax}} +% \begin{macrocode} +\newenvironment{quote} + {\list{}{\rightmargin\leftmargin}% + \item\relax} + {\endlist} +% \end{macrocode} +% \end{environment} +% +% \subsubsection{Theorem} +% +% This document class does not define it's own theorem environments, +% the defaults, supplied by \file{latex.dtx} are available. +% +% \subsubsection{Titlepage} +% +% \begin{environment}{titlepage} +% In the normal environments, the titlepage environment does nothing +% but start and end a page, and inhibit page numbers. In the report +% style, it also resets the page number to one, and then sets it +% back to one at the end. In compatibility mode, it sets the +% page number to zero. This is incorrect since it results in using +% the page parameters for a right-hand page but it is the way it was. +% In two-column style, it still makes a +% one-column page. +% +% \changes{v1.0g}{1993/12/09}{Moved the setting of +% \cs{@restonecolfalse}} +% \changes{v1.2c}{1994/03/17}{page :!= 0 only in compatibility mode +% (LL)} +% \changes{v1.2d}{1994/04/11}{Moved \cs{cleardoublepage} inside +% definition of titlepage environment} +% \changes{v1.3i}{1995/08/08}{New implementation with support for +% twoside and openright option} +% +% First we do give the definition for compatibility mode. +% \begin{macrocode} +\if@compatibility +\newenvironment{titlepage} + {% +% \cleardoublepage + \if@twocolumn + \@restonecoltrue\onecolumn + \else + \@restonecolfalse\newpage + \fi + \thispagestyle{empty}% + \setcounter{page}\z@ + }% + {\if@restonecol\twocolumn \else \newpage \fi + } +% \end{macrocode} +% +% And here is the one for native \LaTeXe{}. +% \begin{macrocode} +\else +\newenvironment{titlepage} + {% +% \cleardoublepage + \if@twocolumn + \@restonecoltrue\onecolumn + \else + \@restonecolfalse\newpage + \fi + \thispagestyle{empty}% + \setcounter{page}\@ne + }% + {\if@restonecol\twocolumn \else \newpage \fi +% \end{macrocode} +% If we are not in two-side mode the first page after the title page +% should also get page number 1. +% \begin{macrocode} + \if@twoside\else + \setcounter{page}\@ne + \fi + } +\fi +% \end{macrocode} +% \end{environment} +% +% \subsubsection{Appendix} +% +% \begin{macro}{\appendix} +% +% The |\appendix| command is not really an environment, it is a +% macro that makes some changes in the way things are done. +% +% In the article document class the |\appendix| command must do the +% following: +% \begin{itemize} +% \item reset the section and subsection counters to zero, +% \item redefine |\thesection| to produce alphabetic appendix +% numbers. This redefinition is done globally to ensure that it +% survives even if |\appendix| is issued within an environment such +% as \texttt{multicols}. +% \end{itemize} +% +% \changes{1.3z}{1998/09/19}{Redefine \cs{thesection} globally (pr/2862)} +% \begin{macrocode} +%<*article> +\newcommand\appendix{\par + \setcounter{section}{0}% + \setcounter{subsection}{0}% + \gdef\thesection{\@Alph\c@section}} +%
+% \end{macrocode} +% +% In the report and book document classes the |\appendix| command +% must do the following: +% \begin{itemize} +% \item reset the chapter and section counters to zero, +% \item set |\@chapapp| to |\appendixname| (for messages), +% \item redefine the chapter counter to produce appendix numbers, +% \item possibly redefine the |\chapter| command if appendix titles +% and headings are to look different from chapter titles and +% headings. This redefinition is done globally to ensure that it +% survives even if |\appendix| is issued within an environment such +% as \texttt{multicols}. +% \end{itemize} +% +% \changes{1.3z}{1998/09/19}{Redefine \cs{thechapter} and +% \cs{@chapapp} globally (pr/2862)} +% \begin{macrocode} +%<*report|book> +\newcommand\appendix{\par + \setcounter{chapter}{0}% + \setcounter{section}{0}% + \gdef\@chapapp{\appendixname}% + \gdef\thechapter{\@Alph\c@chapter}} +% +% \end{macrocode} +% \end{macro} +% +% \subsection{Setting parameters for existing environments} +% +% \subsubsection{Array and tabular} +% +% \begin{macro}{\arraycolsep} +% The columns in an array environment are separated by +% 2|\arraycolsep|. +% \begin{macrocode} +\setlength\arraycolsep{5\p@} +% \end{macrocode} +% \end{macro} +% +% \begin{macro}{\tabcolsep} +% The columns in an tabular environment are separated by +% 2|\tabcolsep|. +% \begin{macrocode} +\setlength\tabcolsep{6\p@} +% \end{macrocode} +% \end{macro} +% +% \begin{macro}{\arrayrulewidth} +% The width of rules in the array and tabular environments is given +% by\\ |\arrayrulewidth|. +% \begin{macrocode} +\setlength\arrayrulewidth{.4\p@} +% \end{macrocode} +% \end{macro} +% +% \begin{macro}{\doublerulesep} +% The space between adjacent rules in the array and tabular +% environments is given by |\doublerulesep|. +% \begin{macrocode} +\setlength\doublerulesep{2\p@} +% \end{macrocode} +% \end{macro} +% +% \subsubsection{Tabbing} +% +% \begin{macro}{\tabbingsep} +% This controls the space that the |\'| command puts in. (See +% \LaTeX{} manual for an explanation.) +% \begin{macrocode} +\setlength\tabbingsep{\labelsep} +% \end{macrocode} +% \end{macro} +% +% \subsubsection{Minipage} +% +% \begin{macro}{\@minipagerestore} +% The macro |\@minipagerestore| is called upon entry to a minipage +% environment to set up things that are to be handled differently +% inside a minipage environment. In the current styles, it does +% nothing. +% \end{macro} +% +% \begin{macro}{\@mpfootins} +% Minipages have their own footnotes; |\skip||\@mpfootins| plays +% same r\^ole for footnotes in a minipage as |\skip||\footins| does +% for ordinary footnotes. +% +% \begin{macrocode} +\skip\@mpfootins = \skip\footins +% \end{macrocode} +% \end{macro} +% +% \subsubsection{Framed boxes} +% +% \begin{macro}{\fboxsep} +% The space left by |\fbox| and |\framebox| between the box and the +% text in it. +% \begin{macro}{\fboxrule} +% The width of the rules in the box made by |\fbox| and |\framebox|. +% \begin{macrocode} +\setlength\fboxsep{3\p@} +\setlength\fboxrule{.4\p@} +% \end{macrocode} +% \end{macro} +% \end{macro} +% +% \subsubsection{Equation and eqnarray} +% +% \begin{macro}{\theequation} +% When within chapters, the equation counter will be reset at +% the beginning of a new chapter and the equation number will +% be prefixed by the chapter number. +% \changes{v1.3u}{1996/10/31}{Added test for non-zero chapter number} +% +% This code must follow the |\chapter| definition or, more exactly, +% the definition of the chapter counter. +% \begin{macrocode} +%
\renewcommand \theequation {\@arabic\c@equation} +%<*report|book> +\@addtoreset {equation}{chapter} +\renewcommand\theequation + {\ifnum \c@chapter>\z@ \thechapter.\fi \@arabic\c@equation} +% +% \end{macrocode} +% \end{macro} +% +% \begin{macro}{\jot} +% |\jot| is the extra space added between lines of an eqnarray +% environment. The default value is used. +% \begin{macrocode} +% \setlength\jot{3pt} +% \end{macrocode} +% \end{macro} +% +% \begin{macro}{\@eqnnum} +% The macro |\@eqnnum| defines how equation numbers are to appear in +% equations. Again the default is used. +% +% \begin{macrocode} +% \def\@eqnnum{(\theequation)} +% \end{macrocode} +% \end{macro} +% +% \subsection{Floating objects} +% +% The file \file{latex.dtx} only defines a number of tools with +% which floating objects can be defined. This is done in the +% document class. It needs to define the following macros for each +% floating object of type \texttt{TYPE} (e.g., \texttt{TYPE} = +% figure). +% +% \begin{description} +% \item[\texttt{\bslash fps@TYPE}] +% The default placement specifier for floats of type +% \texttt{TYPE}. +% +% \item[\texttt{\bslash ftype@TYPE}] +% The type number for floats of type \texttt{TYPE}. Each +% \texttt{TYPE} has associated a unique positive \texttt +% {TYPE} number, which is a power of two. E.g., figures might +% have type number 1, tables type number 2, programs type +% number 4, etc. +% +% \item[\texttt{\bslash ext@TYPE}] +% The file extension indicating the file on which the contents +% list for float type \texttt{TYPE} is stored. For example, +% |\ext@figure| = `lof'. +% +% \item[\texttt{\bslash fnum@TYPE}] +% A macro to generate the figure number for a caption. For +% example, |\fnum@TYPE| == `Figure |\thefigure|'. +% +% \item[\texttt{\bslash @makecaption}{\meta{num}}{\meta{text}}] +% A macro to make a caption, with \meta{num} the value produced +% by |\fnum@...| and \meta{text} the text of the caption. It +% can assume it's in a |\parbox| of the appropriate width. +% This will be used for \emph{all} floating objects. +% +% \end{description} +% +% The actual environment that implements a floating object such as +% a figure is defined using the macros |\@float| and |\end@float|, +% which are defined in \file{latex.dtx}. +% +% An environment that implements a single column floating object is +% started with |\@float{|\texttt{TYPE}|}[|\meta{placement}|]| of type +% \texttt{TYPE} with \meta{placement} as the placement specifier. +% The default value of \meta{PLACEMENT} is defined by |\fps@TYPE|. +% +% The environment is ended by |\end@float|. E.g., |\figure| == +% |\@float|{figure}, |\endfigure| == |\end@float|. +% +% \subsubsection{Figure} +% +% Here is the implementation of the figure environment. +% +% \begin{macro}{\c@figure} +% First we have to allocate a counter to number the figures. +% +% In the report and book document classes figures within chapters are +% numbered per chapter. +% \changes{v1.3u}{1996/10/31}{Added test for non-zero chapter number} +% \begin{macrocode} +%<*article> +\newcounter{figure} +\renewcommand \thefigure {\@arabic\c@figure} +%
+%<*report|book> +\newcounter{figure}[chapter] +\renewcommand \thefigure + {\ifnum \c@chapter>\z@ \thechapter.\fi \@arabic\c@figure} +% +% \end{macrocode} +% \end{macro} +% +% \begin{macro}{\fps@figure} +% \begin{macro}{\ftype@figure} +% \begin{macro}{\ext@figure} +% \begin{macro}{\num@figure} +% Here are the parameters for the floating objects of type `figure'. +% \changes{v1.4e}{2001/05/24}{Replaced tilde with \cs{nobreakspace} +% (pr/3310)} +% \begin{macrocode} +\def\fps@figure{tbp} +\def\ftype@figure{1} +\def\ext@figure{lof} +\def\fnum@figure{\figurename\nobreakspace\thefigure} +% \end{macrocode} +% \end{macro} +% \end{macro} +% \end{macro} +% \end{macro} +% +% \begin{environment}{figure} +% \begin{environment}{figure*} +% And the definition of the actual environment. The form with the +% |*| is used for double column figures. +% \begin{macrocode} +\newenvironment{figure} + {\@float{figure}} + {\end@float} +\newenvironment{figure*} + {\@dblfloat{figure}} + {\end@dblfloat} +% \end{macrocode} +% \end{environment} +% \end{environment} +% +% \subsubsection{Table} +% +% Here is the implementation of the table environment. It is very +% much the same as the figure environment. +% +% \begin{macro}{\c@table} +% First we have to allocate a counter to number the tables. +% +% In the report and book document classes tables within chapters are +% numbered per chapter. +% \changes{v1.3u}{1996/10/31}{Added test for non-zero chapter number} +% \begin{macrocode} +%<*article> +\newcounter{table} +\renewcommand\thetable{\@arabic\c@table} +% +%<*report|book> +\newcounter{table}[chapter] +\renewcommand \thetable + {\ifnum \c@chapter>\z@ \thechapter.\fi \@arabic\c@table} +% +% \end{macrocode} +% \end{macro} +% +% \begin{macro}{\fps@table} +% \begin{macro}{\ftype@table} +% \begin{macro}{\ext@table} +% \begin{macro}{\num@table} +% Here are the parameters for the floating objects of type `table'. +% \changes{v1.4e}{2001/05/24}{Replaced tilde with \cs{nobreakspace} +% (pr/3310)} +% \begin{macrocode} +\def\fps@table{tbp} +\def\ftype@table{2} +\def\ext@table{lot} +\def\fnum@table{\tablename\nobreakspace\thetable} +% \end{macrocode} +% \end{macro} +% \end{macro} +% \end{macro} +% \end{macro} +% +% \begin{environment}{table} +% \begin{environment}{table*} +% And the definition of the actual environment. The form with the +% |*| is used for double column tables. +% \begin{macrocode} +\newenvironment{table} + {\@float{table}} + {\end@float} +\newenvironment{table*} + {\@dblfloat{table}} + {\end@dblfloat} +% \end{macrocode} +% \end{environment} +% \end{environment} +% +% \subsubsection{Captions} +% +% \begin{macro}{\@makecaption} +% The |\caption| command calls |\@makecaption| to format the +% caption of floating objects. It gets two arguments, +% \meta{number}, the number of the floating object and \meta{text}, +% the text of the caption. Usually \meta{number} contains a string +% such as `Figure 3.2'. The macro can assume it is called inside a +% |\parbox| of right width, with |\normalsize|. +% +% \begin{macro}{\abovecaptionskip} +% \begin{macro}{\belowcaptionskip} +% These lengths contain the amount of white space to leave above +% and below the caption. +% \begin{macrocode} +\newlength\abovecaptionskip +\newlength\belowcaptionskip +\setlength\abovecaptionskip{10\p@} +\setlength\belowcaptionskip{0\p@} +% \end{macrocode} +% \end{macro} +% \end{macro} +% +% The definition of this macro is |\long| in order to allow more +% then one paragraph in a caption. +% \begin{macrocode} +\long\def\@makecaption#1#2{% + \vskip\abovecaptionskip +% \end{macrocode} +% We want to see if the caption fits on one line on the page, +% therefore we first typeset it in a temporary box. +% \changes{v1.2q}{1994/05/29}{Use \cs{sbox}\cs{@tempboxa} instead of +% \cs{setbox}\cs{@tempboxa}\cs{hbox} to make this colour safe} +% \begin{macrocode} + \sbox\@tempboxa{#1: #2}% +% \end{macrocode} +% We can the measure its width. It that is larger than the current +% |\hsize| we typeset the caption as an ordinary paragraph. +% \begin{macrocode} + \ifdim \wd\@tempboxa >\hsize + #1: #2\par +% \end{macrocode} +% If the caption fits, we center it. Because this uses an |\hbox| +% directly in vertical mode, it does not execute the |\everypar| +% tokens; the only thing that could be needed here is resetting the +% `minipage flag' so we do this explicitly. +% \changes{v1.2x}{1994/12/09}{Due to a change in the way floats are +% handled we need to set the \cs{if@minipage} switch to false} +% \begin{macrocode} + \else + \global \@minipagefalse + \hb@xt@\hsize{\hfil\box\@tempboxa\hfil}% + \fi + \vskip\belowcaptionskip} +% \end{macrocode} +% \end{macro} +% +% \subsection{Font changing} +% +% Here we supply the declarative font changing commands that were +% common in \LaTeX\ version 2.09 and earlier. These commands work +% in text mode \emph{and} in math mode. They are provided for +% compatibility, but one should start using the |\text...| and +% |\math...| commands instead. These commands are defined using +% |\DeclareTextFontCommand|, a command with three arguments: the +% user command to be defined; \LaTeX\ commands to execute in text +% mode and \LaTeX\ commands to execute in math mode. +% +% \changes{v1.0g}{1993/12/12}{Distinguished between compatibility and +% `normal' mode for the font changing commands.} +% \changes{v1.0h}{1993/12/18}{These are now defined in the kernel, so +% use \cs{@renewfontswitch}. Compatibility mode defines +% \cs{@renewfontswitch} to do nothing, so we don't need to check +% for compatibility mode any more.} +% \changes{v1.0j}{1993/12/20}{Added \cs{normalfont} back in the +% definitions of \cs{rm} etc. as this should be the default +% behaviour} +% \changes{v1.2e}{1994/04/14}{\cs{@renewfontswitch} has become +% \cs{DeclareOldFontCommand}} +% +% \begin{macro}{\rm} +% \changes{v1.0f}{1993/12/08}{Macro added} +% \begin{macro}{\tt} +% \changes{v1.0f}{1993/12/08}{Macro added} +% \begin{macro}{\sf} +% \changes{v1.0f}{1993/12/08}{Macro added} +% +% The commands to change the family. When in compatibility mode we +% select the `default' font first, to get \LaTeX2.09 behviour. +% \begin{macrocode} +\DeclareOldFontCommand{\rm}{\normalfont\rmfamily}{\mathrm} +\DeclareOldFontCommand{\sf}{\normalfont\sffamily}{\mathsf} +\DeclareOldFontCommand{\tt}{\normalfont\ttfamily}{\mathtt} +% \end{macrocode} +% \end{macro} +% \end{macro} +% \end{macro} +% +% \begin{macro}{\bf} +% \changes{v1.0f}{1993/12/08}{Macro added} +% The command to change to the bold series. One should use +% |\mdseries| to explicitly switch back to medium series. +% \begin{macrocode} +\DeclareOldFontCommand{\bf}{\normalfont\bfseries}{\mathbf} +% \end{macrocode} +% \end{macro} +% +% \begin{macro}{\sl} +% \changes{v1.0f}{1993/12/08}{Macro added} +% \changes{v1.2g}{1994/04/24}{Added warning if used in math mode} +% \begin{macro}{\it} +% \changes{v1.0f}{1993/12/08}{Macro added} +% \begin{macro}{\sc} +% \changes{v1.0f}{1993/12/08}{Macro added} +% \changes{v1.2g}{1994/04/24}{Added warning if used in math mode} +% +% And the commands to change the shape of the font. The slanted and +% small caps shapes are not available by default as math alphabets, +% so those changes do nothing in math mode. However, we do warn the +% user that the selection will not have any effect.One should use +% |\upshape| to explicitly change back to the upright shape. +% \begin{macrocode} +\DeclareOldFontCommand{\it}{\normalfont\itshape}{\mathit} +\DeclareOldFontCommand{\sl}{\normalfont\slshape}{\@nomath\sl} +\DeclareOldFontCommand{\sc}{\normalfont\scshape}{\@nomath\sc} +% \end{macrocode} +% \end{macro} +% \end{macro} +% \end{macro} +% +% \begin{macro}{\cal} +% \changes{v1.0g}{1993/12/12}{Macro added} +% \begin{macro}{\mit} +% \changes{v1.0g}{1993/12/12}{Macro added} +% +% The commands |\cal| and |\mit| should only be used in math mode, +% outside math mode they have no effect. Currently the New Font +% Selection Scheme defines these commands to generate warning +% messages. Therefore we have to define them `by hand'. +% \changes{v1.2w}{1994/12/01}{Now define \cs{cal} and \cs{mit} using +% \cs{DeclareRobustCommand*}} +% \changes{v1.3j}{1995/08/16}{Remove surplus braces} +% \begin{macrocode} +\DeclareRobustCommand*\cal{\@fontswitch\relax\mathcal} +\DeclareRobustCommand*\mit{\@fontswitch\relax\mathnormal} +% \end{macrocode} +% \end{macro} +% \end{macro} +% +% \section{Cross Referencing} +% \subsection{Table of Contents, etc.} +% +% A |\section| command writes a +% |\contentsline{section}{|\meta{title}|}{|\meta{page}|}| command +% on the \file{.toc} file, where \meta{title} contains the +% contents of the entry and \meta{page} is the page number. If +% sections are being numbered, then \meta{title} will be of the +% form |\numberline{|\meta{num}|}{|\meta{heading}|}| where +% \meta{num} is the number produced by |\thesection|. Other +% sectioning commands work similarly. +% +% A |\caption| command in a `figure' environment writes +% +% |\contentsline{figure}{\numberline{|\meta{num}|}{|% +% \meta{caption}|}}{|\meta{page}|}| +% +% on the .\file{lof} file, where \meta{num} is the number produced +% by |\thefigure| and \meta{caption} is the figure caption. It +% works similarly for a `table' environment. +% +% The command |\contentsline{|\meta{name}|}| expands to +% |\l@|\meta{name}. So, to specify the table of contents, we must +% define |\l@chapter|, |\l@section|, |\l@subsection|, ... ; to +% specify the list of figures, we must define |\l@figure|; and so +% on. Most of these can be defined with the |\@dottedtocline| +% command, which works as follows. +% +% |\@dottedtocline{|\meta{level}|}{|\meta{indent}|}{|^^A +% \meta{numwidth}|}{|^^A +% \meta{title}|}{|\meta{page}|}| +% +% \begin{description} +% \item[\meta{level}] An entry is produced only if\meta{ level} +% $<=$ value of the \Lcount{tocdepth} counter. Note, +% |\chapter| is level 0, |\section| is level 1, etc. +% \item[\meta{indent}] The indentation from the outer left margin +% of the start of the contents line. +% \item[\meta{numwidth}] The width of a box in which the section +% number is to go, if \meta{title} includes a |\numberline| +% command. +% \end{description} +% +% \begin{macro}{\@pnumwidth} +% \begin{macro}{\@tocrmarg} +% \begin{macro}{\@dotsep} +% This command uses the following three parameters, which are set +% with a |\newcommand| (so em's can be used to make them depend upon +% the font). +% \begin{description} +% \item[\texttt{\bslash @pnumwidth}] The width of a box in which the +% page number is put. +% \changes{v1.2v}{1994/10/29}{Changed documentation from $!>$ or $!=$ to +% $\ge$} +% \item[\texttt{\bslash @tocrmarg}] The right margin for multiple +% line entries. One wants |\@tocrmarg| $\ge$ |\@pnumwidth| +% \item[\texttt{\bslash @dotsep}] Separation between dots, in mu +% units. Should be defined as a number like 2 or 1.7 +% \end{description} +% +% \begin{macrocode} +\newcommand\@pnumwidth{1.55em} +\newcommand\@tocrmarg{2.55em} +\newcommand\@dotsep{4.5} +%
\setcounter{tocdepth}{3} +%\setcounter{tocdepth}{2} +% \end{macrocode} +% \end{macro} +% \end{macro} +% \end{macro} +% +% \subsubsection{Table of Contents} +% +% \begin{macro}{\tableofcontents} +% This macro is used to request that \LaTeX{} produces a table of +% contents. In the report and book document classes the tables of +% contents, figures etc. are always set in single-column style. +% +% \changes{v1.0g}{1993/12/09}{Moved the setting of +% \cs{@restonecolfalse}} +% \begin{macrocode} +\newcommand\tableofcontents{% +%<*report|book> + \if@twocolumn + \@restonecoltrue\onecolumn + \else + \@restonecolfalse + \fi +% \end{macrocode} +% The title is set using the |\chapter*| command, making sure that +% the running head --if one is required-- contains the right +% information. +% \begin{macrocode} + \chapter*{\contentsname +% +%
\section*{\contentsname + \@mkboth{% + \MakeUppercase\contentsname}{\MakeUppercase\contentsname}}% +% \end{macrocode} +% The the actual table of contents is made by calling +% |\@starttoc{toc}|. After that we restore twocolumn mode if +% necessary. +% \begin{macrocode} + \@starttoc{toc}% +% \if@restonecol\twocolumn\fi + } +% \end{macrocode} +% \end{macro} +% +% \begin{macro}{\l@part} +% Each sectioning command needs an additional macro to format its +% entry in the table of contents, as described above. The macro for +% the entry for parts is defined in a special way. +% +% First we make sure that if a pagebreak should occur, it occurs +% \emph{before} this entry. Also a little whitespace is added and a +% group begun to keep changes local. +% \changes{v1.0h}{1993/12/18}{Replaced -\cs{@secpenalty} by +% \cs{@secpenalty}. ASAJ.} +% \changes{v1.2i}{1994/04/28}{Don't print a toc line when the tocdepth +% counter is less then -1} +% \changes{v1.3b}{1995/05/23}{Added missing braces around argument +% to \cs{addpenalty}.} +% \changes{v1.3x}{1997/10/10}{Removed setting of \cs{@tempdima} as +% this macro does not use \cs{numberline} to set the toc line.} +% \changes{v1.4a}{1998/10/12}{we should use \cs{@tocrmarg}; see PR/2881.} +% \begin{macrocode} +\newcommand*\l@part[2]{% + \ifnum \c@tocdepth >-2\relax +%
\addpenalty\@secpenalty +% \addpenalty{-\@highpenalty}% + \addvspace{2.25em \@plus\p@}% +% \end{macrocode} +% The macro |\numberline| requires that the width of the box that +% holds the part number is stored in \LaTeX's scratch register +% |\@tempdima|. Therefore we initialize it there even though we do +% not use |\numberline| internally---the value used is quite large +% so that something like |\numberline{VIII}| would still work. +% \changes{v1.4d}{2001/04/21}{Initialize \cs{@tempdima} to some +% sensible value (pr/3327)} +% \begin{macrocode} + \setlength\@tempdima{3em}% + \begingroup +% \end{macrocode} +% We set |\parindent| to 0pt and use |\rightskip| to leave +% enough room for the pagenumbers.\footnote{^^A +% We should really set \cs{rightskip} to \cs{@tocrmarg} instead +% of \cs{@pnumwidth} (no version of {\LaTeX} ever did this), +% otherwise the \cs{rightskip} is too small. +% Unfortunately this can't be changed in {\LaTeXe} as we don't +% want to create different versions of {\LaTeXe} which produce +% different typset output unless this is absolutely necessary; +% instead we suspend it for \LaTeX3.} +% To prevent overfull box messages the |\parfillskip| is set to a +% negative value. +% \begin{macrocode} + \parindent \z@ \rightskip \@pnumwidth + \parfillskip -\@pnumwidth +% \end{macrocode} +% Now we can set the entry, in a large bold font. We make sure to +% leave vertical mode, set the part title and add the pagenumber, +% set flush right. +% \begin{macrocode} + {\leavevmode + \large \bfseries #1\hfil \hb@xt@\@pnumwidth{\hss #2}}\par +% \end{macrocode} +% Prevent a pagebreak immediately after this entry, but use +% |\everypar| to reset the |\if@nobreak| switch. Finally we close +% the group. +% \changes{v1.3j}{1995/08/16}{Add missing percent} +% \begin{macrocode} + \nobreak +%
\if@compatibility + \global\@nobreaktrue + \everypar{\global\@nobreakfalse\everypar{}}% +%
\fi + \endgroup + \fi} +% \end{macrocode} +% \end{macro} +% +% \begin{macro}{\l@chapter} +% This macro formats the entries in the table of contents for +% chapters. It is very similar to |\l@part| +% +% First we make sure that if a pagebreak should occur, it occurs +% \emph{before} this entry. Also a little whitespace is added and a +% group begun to keep changes local. +% \changes{v1.2i}{1994/04/28}{Don't print a toc line when the tocdepth +% counter is less than 0} +% \changes{v1.3b}{1995/05/23}{Added missing braces around argument +% to \cs{addpenalty}.} +% \changes{v1.4a}{1998/10/12}{we should use \cs{@tocrmarg}; see PR/2881.} +% \begin{macrocode} +%<*report|book> +\newcommand*\l@chapter[2]{% + \ifnum \c@tocdepth >\m@ne + \addpenalty{-\@highpenalty}% + \vskip 1.0em \@plus\p@ +% \end{macrocode} +% +% The macro |\numberline| requires that the width of the box that +% holds the part number is stored in \LaTeX's scratch register +% |\@tempdima|. Therefore we initialize it there even though we do +% not use |\numberline| internally (the position as well as the +% values seems questionable but can't be changed without producing +% compatibility problems). We begin a group, and change +% some of the paragraph parameters (see also the remark at +% \cs{l@part} regarding \cs{rightskip}). +% \begin{macrocode} + \setlength\@tempdima{1.5em}% + \begingroup + \parindent \z@ \rightskip \@pnumwidth + \parfillskip -\@pnumwidth +% \end{macrocode} +% Then we leave vertical mode and switch to a bold font. +% \begin{macrocode} + \leavevmode \bfseries +% \end{macrocode} +% Because we do not use |\numberline| here, we have do some fine +% tuning `by hand', before we can set the entry. We discourage but +% not disallow a pagebreak immediately after a chapter entry. +% \begin{macrocode} + \advance\leftskip\@tempdima + \hskip -\leftskip + #1\nobreak\hfil \nobreak\hb@xt@\@pnumwidth{\hss #2}\par + \penalty\@highpenalty + \endgroup + \fi} +% +% \end{macrocode} +% \end{macro} +% +% \begin{macro}{\l@section} +% In the article document class the entry in the table of contents +% for sections looks much like the chapter entries for the report +% and book document classes. +% +% First we make sure that if a pagebreak should occur, it occurs +% \emph{before} this entry. Also a little whitespace is added and a +% group begun to keep changes local. +% \changes{v1.0h}{1993/12/18}{Replaced -\cs{@secpenalty} by +% \cs{@secpenalty}. ASAJ.} +% \changes{v1.2i}{1994/04/28}{Don't print a toc line when the tocdepth +% counter is less than 1.} +% \changes{v1.4a}{1998/10/12}{we should use \cs{@tocrmarg}; see PR/2881.} +% \begin{macrocode} +%<*article> +\newcommand*\l@section[2]{% + \ifnum \c@tocdepth >\z@ + \addpenalty\@secpenalty + \addvspace{1.0em \@plus\p@}% +% \end{macrocode} +% +% The macro |\numberline| requires that the width of the box that +% holds the part number is stored in \LaTeX's scratch register +% |\@tempdima|. Therefore we put it there. We begin a group, and +% change some of the paragraph parameters (see also the remark at +% \cs{l@part} regarding \cs{rightskip}). +% \begin{macrocode} + \setlength\@tempdima{1.5em}% + \begingroup + \parindent \z@ \rightskip \@pnumwidth + \parfillskip -\@pnumwidth +% \end{macrocode} +% Then we leave vertical mode and switch to a bold font. +% \begin{macrocode} + \leavevmode \bfseries +% \end{macrocode} +% Because we do not use |\numberline| here, we have do some fine +% tuning `by hand', before we can set the entry. We discourage but +% not disallow a pagebreak immediately after a chapter entry. +% \begin{macrocode} + \advance\leftskip\@tempdima + \hskip -\leftskip + #1\nobreak\hfil \nobreak\hb@xt@\@pnumwidth{\hss #2}\par + \endgroup + \fi} +%
+% \end{macrocode} +% In the report and book document classes the definition for +% |\l@section| is much simpler. +% \begin{macrocode} +%<*report|book> +\newcommand*\l@section{\@dottedtocline{1}{1.5em}{2.3em}} +% +% \end{macrocode} +% \end{macro} +% +% \begin{macro}{\l@subsection} +% \begin{macro}{\l@subsubsection} +% \begin{macro}{\l@paragraph} +% \begin{macro}{\l@subparagraph} +% All lower level entries are defined using the macro +% |\@dottedtocline| (see above). +% \begin{macrocode} +%<*article> +\newcommand*\l@subsection{\@dottedtocline{2}{1.5em}{2.3em}} +\newcommand*\l@subsubsection{\@dottedtocline{3}{3.8em}{3.2em}} +\newcommand*\l@paragraph{\@dottedtocline{4}{7.0em}{4.1em}} +\newcommand*\l@subparagraph{\@dottedtocline{5}{10em}{5em}} +%
+%<*report|book> +\newcommand*\l@subsection{\@dottedtocline{2}{3.8em}{3.2em}} +\newcommand*\l@subsubsection{\@dottedtocline{3}{7.0em}{4.1em}} +\newcommand*\l@paragraph{\@dottedtocline{4}{10em}{5em}} +\newcommand*\l@subparagraph{\@dottedtocline{5}{12em}{6em}} +% +% \end{macrocode} +% \end{macro} +% \end{macro} +% \end{macro} +% \end{macro} +% +% \subsubsection{List of figures} +% +% \begin{macro}{\listoffigures} +% This macro is used to request that \LaTeX{} produces a list of +% figures. It is very similar to |\tableofcontents|. +% +% \changes{v1.0g}{1993/12/09}{Moved the setting of +% \cs{@restonecolfalse}} +% \changes{v1.4c}{2001/01/06}{Moved \cs{@mkboth} out of heading +% arg (pr/3285)} +% \begin{macrocode} +\newcommand\listoffigures{% +%<*report|book> + \if@twocolumn + \@restonecoltrue\onecolumn + \else + \@restonecolfalse + \fi + \chapter*{\listfigurename}% +% +%
\section*{\listfigurename}% + \@mkboth{\MakeUppercase\listfigurename}% + {\MakeUppercase\listfigurename}% + \@starttoc{lof}% +% \if@restonecol\twocolumn\fi + } +% \end{macrocode} +% \end{macro} +% +% \begin{macro}{\l@figure} +% This macro produces an entry in the list of figures. +% \begin{macrocode} +\newcommand*\l@figure{\@dottedtocline{1}{1.5em}{2.3em}} +% \end{macrocode} +% \end{macro} +% +% \subsubsection{List of tables} +% +% \begin{macro}{\listoftables} +% This macro is used to request that \LaTeX{} produces a list of +% tables. It is very similar to |\tableofcontents|. +% +% \changes{v1.0g}{1993/12/09}{Moved the setting of +% \cs{@restonecolfalse}} +% \changes{v1.4c}{2001/01/06}{Moved \cs{@mkboth} out of heading +% arg (pr/3285)} +% \begin{macrocode} +\newcommand\listoftables{% +%<*report|book> + \if@twocolumn + \@restonecoltrue\onecolumn + \else + \@restonecolfalse + \fi + \chapter*{\listtablename}% +% +%
\section*{\listtablename}% + \@mkboth{% + \MakeUppercase\listtablename}% + {\MakeUppercase\listtablename}% + \@starttoc{lot}% +% \if@restonecol\twocolumn\fi + } +% \end{macrocode} +% \end{macro} +% +% \begin{macro}{\l@table} +% This macro produces an entry in the list of tables. +% \begin{macrocode} +\let\l@table\l@figure +% \end{macrocode} +% \end{macro} +% +% \subsection{Bibliography} +% +% \begin{macro}{\bibindent} +% The ``open'' bibliography format uses an indentation of +% |\bibindent|. +% \begin{macrocode} +\newdimen\bibindent +\setlength\bibindent{1.5em} +% \end{macrocode} +% \end{macro} +% +% \begin{environment}{thebibliography} +% The `thebibliography' environment executes the following +% commands: +% +% |\renewcommand{\newblock}{\hskip.11em \@plus.33em \@minus.07em}|\\ +% --- Defines the ``closed'' format, where the blocks (major units +% of information) of an entry run together. +% +% |\sloppy| --- Used because it's rather hard to do line breaks in +% bibliographies, +% +% |\sfcode`\.=1000\relax| --- +% Causes a `.' (period) not to produce an end-of-sentence space. +% +% The implementation of this environment is based on the generic +% list environment. It uses the \Lcount{enumiv} counter internally +% to generate the labels of the list. +% +% When an empty `thebibliography' environment is found, a warning +% is issued. +% +% \changes{v1.0i}{1993/12/19}{Corrected definition of thebibliography +% for article} +% \changes{v1.2z}{1995/05/09}{added a missing percent character} +% \changes{v1.3b}{1995/05/23}{Added missing braces in definition +% of thebibliography environment.} +% \changes{v1.3j}{1995/08/16}{remove surplus spaces} +% \changes{v1.3k}{1995/08/27}{Code for openbib changed} +% \changes{v1.3t}{1996/10/05}{Added setting value of \cs{@clubpenalty}} +% \begin{macrocode} +\newenvironment{thebibliography}[1] +%<*article> + {\section*{\refname}% +% \end{macrocode} +% The |\@mkboth| was moved out of the heading argument since at +% least in report and book (twocolumn option) there are definitions +% for |\chapter| which would swallow it otherwise. +% \changes{v1.4c}{2001/01/06}{Moved \cs{@mkboth} out of heading +% arg (pr/3285)} +% \begin{macrocode} + \@mkboth{\MakeUppercase\refname}{\MakeUppercase\refname}% +%
+%<*!article> + {\chapter*{\bibname}% + \@mkboth{\MakeUppercase\bibname}{\MakeUppercase\bibname}% +% + \list{\@biblabel{\@arabic\c@enumiv}}% + {\settowidth\labelwidth{\@biblabel{#1}}% + \leftmargin\labelwidth + \advance\leftmargin\labelsep + \@openbib@code + \usecounter{enumiv}% + \let\p@enumiv\@empty + \renewcommand\theenumiv{\@arabic\c@enumiv}}% + \sloppy +% \end{macrocode} +% This is setting the normal (non-infinite) value of +% |\clubpenalty| for the whole of this environment, +% so we must reset its stored value also. (Why is there a |%| after +% the second 4000 below?) +% \begin{macrocode} + \clubpenalty4000 + \@clubpenalty \clubpenalty + \widowpenalty4000% + \sfcode`\.\@m} + {\def\@noitemerr + {\@latex@warning{Empty `thebibliography' environment}}% + \endlist} +% \end{macrocode} +% \end{environment} +% +% \begin{macro}{\newblock} +% The default definition for |\newblock| is to produce a small space. +% \changes{v1.3k}{1995/08/27}{Default changed.} +% \begin{macrocode} +\newcommand\newblock{\hskip .11em\@plus.33em\@minus.07em} +% \end{macrocode} +% \end{macro} +% +% \begin{macro}{\@openbib@code} +% The default definition for |\@openbib@code| is to do nothing. +% It will be changed by the \Lopt{openbib} option. +% \changes{v1.3k}{1995/08/27}{Macro added} +% \begin{macrocode} +\let\@openbib@code\@empty +% \end{macrocode} +% \end{macro} +% +% \begin{macro}{\@biblabel} +% The label for a |\bibitem[...]| command is produced by this +% macro. The default from \file{latex.dtx} is used. +% \begin{macrocode} +% \renewcommand*{\@biblabel}[1]{[#1]\hfill} +% \end{macrocode} +% \end{macro} +% +% \begin{macro}{\@cite} +% The output of the |\cite| command is produced by this macro. The +% default from \file{latex.dtx} is used. +% \begin{macrocode} +% \renewcommand*{\@cite}[1]{[#1]} +% \end{macrocode} +% \end{macro} +% +% \subsection{The index} +% +% \begin{environment}{theindex} +% The environment `theindex' can be used for indices. It makes an +% index with two columns, with each entry a separate paragraph. At +% the user level the commands |\item|, |\subitem| and |\subsubitem| +% are used to produce index entries of various levels. When a new +% letter of the alphabet is encountered an amount of |\indexspace| +% white space can be added. +% +% +% \changes{v1.0g}{1993/12/09}{Moved the setting of +% \cs{@restonecoltrue}} +% \begin{macrocode} +\newenvironment{theindex} + {\if@twocolumn + \@restonecolfalse + \else + \@restonecoltrue + \fi +%
\twocolumn[\section*{\indexname}]% +% \twocolumn[\@makeschapterhead{\indexname}]% + \@mkboth{\MakeUppercase\indexname}% + {\MakeUppercase\indexname}% + \thispagestyle{plain}\parindent\z@ +% \end{macrocode} +% Parameter changes to |\columnseprule| and |\columnsep| have to be +% done after |\twocolumn| has acted. Otherwise they can affect the +% last page before the index. +% \changes{ v1.4f}{2004/02/16}{Moved setting of \cs{columnsep} and +% \cs{columnseprule} later to avoid affecting the wrong page (pr/3616)} +% \begin{macrocode} + \parskip\z@ \@plus .3\p@\relax + \columnseprule \z@ + \columnsep 35\p@ + \let\item\@idxitem} +% \end{macrocode} +% When the document continues after the index and it was a one +% column document we have to switch back to one column after the +% index. +% \begin{macrocode} + {\if@restonecol\onecolumn\else\clearpage\fi} +% \end{macrocode} +% \end{environment} +% +% \begin{macro}{\@idxitem} +% \begin{macro}{\subitem} +% \begin{macro}{\subsubitem} +% These macros are used to format the entries in the index. ^^AA ??? +% \changes{v1.3f}{1995/06/23}{Corrected error in definition of +% \cs{@idxitem}.} +% \changes{v1.3j}{1995/08/16}{use \cs{@idxitem} to save space} +% \begin{macrocode} +\newcommand\@idxitem{\par\hangindent 40\p@} +\newcommand\subitem{\@idxitem \hspace*{20\p@}} +\newcommand\subsubitem{\@idxitem \hspace*{30\p@}} +% \end{macrocode} +% \end{macro} +% \end{macro} +% \end{macro} +% +% \begin{macro}{\indexspace} +% The amount of white space that is inserted between `letter +% blocks' in the index. +% \begin{macrocode} +\newcommand\indexspace{\par \vskip 10\p@ \@plus5\p@ \@minus3\p@\relax} +% \end{macrocode} +% \end{macro} +% +% \subsection{Footnotes} +% +% \begin{macro}{\footnoterule} +% Usually, footnotes are separated from the main body of the text +% by a small rule. This rule is drawn by the macro |\footnoterule|. +% We have to make sure that the rule takes no vertical space (see +% \file{plain.tex}) so we compensate for the natural heigth of the +% rule of 0.4pt by adding the right amount of vertical skip. +% +% To prevent the rule from colliding with the footnote we first add +% a little negative vertical skip, then we put the rule and make +% sure we end up at the same point where we begun this operation. +% \changes{v1.3a}{1995/05/17}{use \cs{@width}} +% \begin{macrocode} +\renewcommand\footnoterule{% + \kern-3\p@ + \hrule\@width.4\columnwidth + \kern2.6\p@} +% \end{macrocode} +% \end{macro} +% +% \begin{macro}{\c@footnote} +% Footnotes are numbered within chapters in the report and book +% document styles. +% \begin{macrocode} +%\@addtoreset{footnote}{chapter} +% \end{macrocode} +% \end{macro} +% +% \begin{macro}{\@makefntext} +% The footnote mechanism of \LaTeX{} calls the macro |\@makefntext| +% to produce the actual footnote. The macro gets the text of the +% footnote as its argument and should use |\@thefnmark| as the mark +% of the footnote. The macro |\@makefntext|is called when +% effectively inside a |\parbox| of width |\columnwidth| (i.e., +% with |\hsize| = |\columnwidth|). +% +% An example of what can be achieved is given by the following piece +% of \TeX\ code. +% \begin{verbatim} +% \newcommand\@makefntext[1]{% +% \@setpar{\@@par +% \@tempdima = \hsize +% \advance\@tempdima-10pt +% \parshape \@ne 10pt \@tempdima}% +% \par +% \parindent 1em\noindent +% \hbox to \z@{\hss\@makefnmark}#1} +% \end{verbatim} +% The effect of this definition is that all lines of the footnote +% are indented by 10pt, while the first line of a new paragraph is +% indented by 1em. To change these dimensions, just substitute the +% desired value for `10pt' (in both places) or `1em'. The mark is +% flushright against the footnote. +% +% In these document classes we use a simpler macro, in which the +% footnote text is set like an ordinary text paragraph, with no +% indentation except on the first line of a paragraph, and the +% first line of the footnote. Thus, all the macro must do is set +% |\parindent| to the appropriate value for succeeding paragraphs +% and put the proper indentation before the mark. +% +% \changes{v1.1a}{1994/03/13}{Use \cs{@makefnmark} to generate +% footnote marker} +% \begin{macrocode} +\newcommand\@makefntext[1]{% + \parindent 1em% + \noindent + \hb@xt@1.8em{\hss\@makefnmark}#1} +% \end{macrocode} +% \end{macro} +% +% \begin{macro}{\@makefnmark} +% The footnote markers that are printed in the text to point to the +% footnotes should be produced by the macro |\@makefnmark|. We use +% the default definition for it. +% \begin{macrocode} +%\renewcommand\@makefnmark{\hbox{\@textsuperscript +% {\normalfont\@thefnmark}}} +% \end{macrocode} +% \end{macro} +% +% \section{Initialization} +% +% \subsection{Words} +% +% This document class is for documents prepared in the English language. +% To prepare a version for another language, various English words must +% be replaced. All the English words that require replacement are +% defined below in command names. These commands may be redefined in +% any class or package that is customising \LaTeX\ for use with +% non-English languages. +% \changes{v1.3h}{1995/07/20}{Split up to save save stack /1742} +% +% \begin{macro}{\contentsname} +% \begin{macro}{\listfigurename} +% \begin{macro}{\listtablename} +% \begin{macrocode} +\newcommand\contentsname{Contents} +\newcommand\listfigurename{List of Figures} +\newcommand\listtablename{List of Tables} +% \end{macrocode} +% \end{macro} +% \end{macro} +% \end{macro} +% +% \begin{macro}{\refname} +% \begin{macro}{\bibname} +% \begin{macro}{\indexname} +% \begin{macrocode} +%
\newcommand\refname{References} +%\newcommand\bibname{Bibliography} +\newcommand\indexname{Index} +% \end{macrocode} +% \end{macro} +% \end{macro} +% \end{macro} +% +% \begin{macro}{\figurename} +% \begin{macro}{\tablename} +% \begin{macrocode} +\newcommand\figurename{Figure} +\newcommand\tablename{Table} +% \end{macrocode} +% \end{macro} +% \end{macro} +% +% \begin{macro}{\partname} +% \begin{macro}{\chaptername} +% \begin{macro}{\appendixname} +% \begin{macro}{\abstractname} +% \begin{macrocode} +\newcommand\partname{Part} +%\newcommand\chaptername{Chapter} +\newcommand\appendixname{Appendix} +%\newcommand\abstractname{Abstract} +% \end{macrocode} +% \end{macro} +% \end{macro} +% \end{macro} +% \end{macro} +% +% \subsection{Date} +% +% \begin{macro}{\today} +% This macro uses the \TeX\ primitives |\month|, |\day| and |\year| +% to provide the date of the \LaTeX-run. +% +% At |\begin{document}| this definition will be optimised +% so that the names of all the `wrong' months are not stored. +% This optimisation is not done here as that would `freeze' +% |\today| in any special purpose format made by loading the class +% file into the format file. +% \changes{v1.3j}{1995/08/16}{use \cs{edef} to save a lot of space} +% \changes{v1.3w}{1997/10/06}{use \cs{def} again, latex/2620} +% \begin{macrocode} +\def\today{\ifcase\month\or + January\or February\or March\or April\or May\or June\or + July\or August\or September\or October\or November\or December\fi + \space\number\day, \number\year} +% \end{macrocode} +% \end{macro} +% +% \subsection{Two column mode} +% +% \begin{macro}{\columnsep} +% This gives the distance between two columns in two column mode. +% \begin{macrocode} +\setlength\columnsep{10\p@} +% \end{macrocode} +% \end{macro} +% +% \begin{macro}{\columnseprule} +% This gives the width of the rule between two columns in two +% column mode. We have no visible rule. +% \begin{macrocode} +\setlength\columnseprule{0\p@} +% \end{macrocode} +% \end{macro} +% +% \subsection{The page style} +% We have \pstyle{plain} pages in the document classes article and +% report unless the user specified otherwise. In the `book' +% document class we use the page style \pstyle{headings} by +% default. We use arabic pagenumbers. +% \begin{macrocode} +%\pagestyle{plain} +%\pagestyle{headings} +\pagenumbering{arabic} +% \end{macrocode} +% +% \subsection{Single or double sided printing} +% +% +% \changes{v1.2v}{1994/11/10}{removed typo} +% When the \Lopt{twoside} option wasn't specified, we don't try to +% make each page as long as all the others. +% \begin{macrocode} +\if@twoside +\else + \raggedbottom +\fi +% \end{macrocode} +% When the \Lopt{twocolumn} option was specified we call +% |\twocolumn| to activate this mode. We try to make each column as +% long as the others, but call |sloppy| to make our life easier. +% \begin{macrocode} +\if@twocolumn + \twocolumn + \sloppy + \flushbottom +% \end{macrocode} +% Normally we call |\onecolumn| to initiate typesetting in one +% column. +% \begin{macrocode} +\else + \onecolumn +\fi +% +% \end{macrocode} +% +% \changes{v1.3i}{1995/08/09}{Moved code for generic class options +% leqno and fleqn to kernel file} +% +% \Finale +% +\endinput + diff --git a/Master/texmf-dist/source/latex/base/classes.ins b/Master/texmf-dist/source/latex/base/classes.ins new file mode 100644 index 00000000000..0ae699f7832 --- /dev/null +++ b/Master/texmf-dist/source/latex/base/classes.ins @@ -0,0 +1,113 @@ +%% +%% This file will generate fast loadable files and documentation +%% driver files from the doc files in this package when run through +%% LaTeX or TeX. +%% +%% Copyright 1993 1994 1995 1996 1997 1998 1999 2000 2001 2002 2003 2004 +%% The LaTeX3 Project and any individual authors listed elsewhere +%% in this file. +%% +%% This file is part of the LaTeX base system. +%% ------------------------------------------- +%% +%% It may be distributed and/or modified under the +%% conditions of the LaTeX Project Public License, either version 1.3 +%% of this license or (at your option) any later version. +%% The latest version of this license is in +%% http://www.latex-project.org/lppl.txt +%% and version 1.3 or later is part of all distributions of LaTeX +%% version 2003/12/01 or later. +%% +%% This file has the LPPL maintenance status "maintained". +%% +%% In particular, NO PERMISSION is granted to modify the contents of this +%% file since it contains the legal notices that are placed in the files +%% it generates. +%% +%% The list of all files belonging to the LaTeX base distribution is +%% given in the file `manifest.txt'. See also `legal.txt' for additional +%% information. +%% +%% +%% +%% +%% --------------- start of docstrip commands ------------------ +%% + +\input docstrip + +\preamble + +This is a generated file. + +Copyright 1993 1994 1995 1996 1997 1998 1999 2000 2001 2002 2003 2004 +The LaTeX3 Project and any individual authors listed elsewhere +in this file. + +This file was generated from file(s) of the LaTeX base system. +-------------------------------------------------------------- + +It may be distributed and/or modified under the +conditions of the LaTeX Project Public License, either version 1.3 +of this license or (at your option) any later version. +The latest version of this license is in + http://www.latex-project.org/lppl.txt +and version 1.3 or later is part of all distributions of LaTeX +version 2003/12/01 or later. + +This file has the LPPL maintenance status "maintained". + +This file may only be distributed together with a copy of the LaTeX +base system. You may however distribute the LaTeX base system without +such generated files. + +The list of all files belonging to the LaTeX base distribution is +given in the file `manifest.txt'. See also `legal.txt' for additional +information. + +The list of derived (unpacked) files belonging to the distribution +and covered by LPPL is defined by the unpacking scripts (with +extension .ins) which are part of the distribution. +\endpreamble + +\keepsilent +\usedir{tex/latex/base} + +\generate{\file{article.cls}{\from{classes.dtx}{article}} + \file{report.cls}{\from{classes.dtx}{report}} + \file{book.cls}{\from{classes.dtx}{book}} + \file{size10.clo}{\from{classes.dtx}{10pt}} + \file{size11.clo}{\from{classes.dtx}{11pt}} + \file{size12.clo}{\from{classes.dtx}{12pt}} + \file{bk10.clo}{\from{classes.dtx}{10pt,bk}} + \file{bk11.clo}{\from{classes.dtx}{11pt,bk}} + \file{bk12.clo}{\from{classes.dtx}{12pt,bk}} + } + +\ifToplevel{ +\Msg{***********************************************************} +\Msg{*} +\Msg{* To finish the installation you have to move the following} +\Msg{* files into a directory searched by TeX:} +\Msg{*} +\Msg{* \space\space article.cls} +\Msg{* \space\space report.cls} +\Msg{* \space\space book.cls} +\Msg{* \space\space size10.clo} +\Msg{* \space\space size11.clo} +\Msg{* \space\space size12.clo} +\Msg{* \space\space bk10.clo} +\Msg{* \space\space bk11.clo} +\Msg{* \space\space bk12.clo} +\Msg{* \space\space leqno.clo} +\Msg{* \space\space fleqn.clo} +\Msg{*} +\Msg{* To produce the documentation run the files ending with} +\Msg{* `.dtx' through LaTeX.} +\Msg{*} +\Msg{* Happy TeXing} +\Msg{***********************************************************} +} + +\endbatchfile + diff --git a/Master/texmf-dist/source/latex/base/cmextra.ins b/Master/texmf-dist/source/latex/base/cmextra.ins new file mode 100644 index 00000000000..88df1a1a397 --- /dev/null +++ b/Master/texmf-dist/source/latex/base/cmextra.ins @@ -0,0 +1,142 @@ +%% +%% This file will generate fast loadable files and documentation +%% driver files from the doc files in this package when run through +%% LaTeX or TeX. +%% +%% Copyright 1993 1994 1995 1996 1997 1998 1999 2000 2001 2002 2003 2004 +%% The LaTeX3 Project and any individual authors listed elsewhere +%% in this file. +%% +%% This file is part of the LaTeX base system. +%% ------------------------------------------- +%% +%% It may be distributed and/or modified under the +%% conditions of the LaTeX Project Public License, either version 1.3 +%% of this license or (at your option) any later version. +%% The latest version of this license is in +%% http://www.latex-project.org/lppl.txt +%% and version 1.3 or later is part of all distributions of LaTeX +%% version 2003/12/01 or later. +%% +%% This file has the LPPL maintenance status "maintained". +%% +%% In particular, NO PERMISSION is granted to modify the contents of this +%% file since it contains the legal notices that are placed in the files +%% it generates. +%% +%% The list of all files belonging to the LaTeX base distribution is +%% given in the file `manifest.txt'. See also `legal.txt' for additional +%% information. +%% +%% +%% +%% +%% --------------- start of docstrip commands ------------------ +%% + +\input docstrip + +\preamble + +This is a generated file. + +Copyright 1993 1994 1995 1996 1997 1998 1999 2000 2001 2002 2003 2004 +The LaTeX3 Project and any individual authors listed elsewhere +in this file. + +This file was generated from file(s) of the LaTeX base system. +-------------------------------------------------------------- + +It may be distributed and/or modified under the +conditions of the LaTeX Project Public License, either version 1.3 +of this license or (at your option) any later version. +The latest version of this license is in + http://www.latex-project.org/lppl.txt +and version 1.3 or later is part of all distributions of LaTeX +version 2003/12/01 or later. + +This file may only be distributed together with a copy of the LaTeX +base system. You may however distribute the LaTeX base system without +such generated files. + +The list of all files belonging to the LaTeX base distribution is +given in the file `manifest.txt'. See also `legal.txt' for additional +information. + +In particular, permission is granted to customize the declarations in +this file to serve the needs of your installation. + +However, NO PERMISSION is granted to distribute a modified version +of this file under its original name. + +\endpreamble + +\keepsilent +\usedir{tex/latex/base} + +% Concrete font support removed: Use the contributed package available +% from ctan tex-archive/macros/latex/contrib/supported/ccfonts. +% +% \Ask\answer{% +% ************************************************************** +% ^^J* +% ^^J* Do you have the Concrete Roman fonts installed on your system, +% ^^J* or do you intend to install them? +% ^^J* +% ^^J* If so please answer with `y' otherwise with `n' below. +% ^^J* +% ^^J* You can easily redo this installation later in case you +% ^^J* change your mind. +% ^^J**************************************************************} +% +% {\ifx\answer\y +% +% \Msg{*** Generating font defs for Cork encoded fonts ***} +% \Msg{*** Generating font defs for old TeX Text encoding ***} +% \Msg{*** Generating font defs for math italic encoding ***} +% +% \generate{% +% \file{t1ccr.fd}{\from{cmfonts.fdd}{fd,T1ccr}} +% \file{ot1ccr.fd}{\from{cmfonts.fdd}{fd,OT1ccr}} +% \file{omlccm.fd}{\from{cmfonts.fdd}{fd,OMLccm}}} +% +% \fi} + +\Ask\answer{% + ************************************************************** + ^^J* + ^^J* Do you have the cyrillic fonts from the University of + ^^J* Washington installed on your system, + ^^J* or do you intend to install them? + ^^J* + ^^J* If so please answer with `y' otherwise with `n' below. + ^^J* + ^^J* You can easily redo this installation later in case you + ^^J* change your mind. + ^^J**************************************************************} + +{\ifx\answer\y + +\Msg{*** Generating font defs for old TeX cyrillic text encoding ***} + +\generate{% + \file{ot2cmr.fd}{\from{cmfonts.fdd}{fd,OT2cmr}} + \file{ot2cmss.fd}{\from{cmfonts.fdd}{fd,OT2cmss}}} + +\fi} + + + +\ifToplevel{ +\Msg{***********************************************************} +\Msg{*} +\Msg{* To finish the installation you have to move the following} +\Msg{* files into a directory searched by TeX:} +\Msg{*} +\Msg{* \space\space All *.fd} +\Msg{*} +\Msg{* Happy TeXing} +\Msg{***********************************************************} +} + +\endbatchfile diff --git a/Master/texmf-dist/source/latex/base/cmfonts.fdd b/Master/texmf-dist/source/latex/base/cmfonts.fdd new file mode 100644 index 00000000000..f493f30c724 --- /dev/null +++ b/Master/texmf-dist/source/latex/base/cmfonts.fdd @@ -0,0 +1,1300 @@ +% \iffalse meta-comment +% +% Copyright 1993 1994 1995 1996 1997 1998 1999 2000 2001 2002 2003 2004 +% The LaTeX3 Project and any individual authors listed elsewhere +% in this file. +% +% This file is part of the LaTeX base system. +% ------------------------------------------- +% +% It may be distributed and/or modified under the +% conditions of the LaTeX Project Public License, either version 1.3 +% of this license or (at your option) any later version. +% The latest version of this license is in +% http://www.latex-project.org/lppl.txt +% and version 1.3 or later is part of all distributions of LaTeX +% version 2003/12/01 or later. +% +% This file has the LPPL maintenance status "maintained". +% +% The list of all files belonging to the LaTeX base distribution is +% given in the file `manifest.txt'. See also `legal.txt' for additional +% information. +% +% The list of derived (unpacked) files belonging to the distribution +% and covered by LPPL is defined by the unpacking scripts (with +% extension .ins) which are part of the distribution. +% +% \fi +% \CheckSum{295} +% +%\iffalse This is a META comment +% +% File `cmfonts.fdd'. +% Copyright (C) 1989-1999 Frank Mittelbach and Rainer Sch\"opf, +% all rights reserved. +% +%\ProvidesFile{omlccm.fd} +%\ProvidesFile{omlcmm.fd} +%\ProvidesFile{omlcmr.fd} +%\ProvidesFile{omscmr.fd} +%\ProvidesFile{omscmsy.fd} +%\ProvidesFile{omxcmex.fd} +%\ProvidesFile{ot1ccr.fd} +%\ProvidesFile{ot1cmdh.fd} +%\ProvidesFile{ot1cmfib.fd} +%\ProvidesFile{ot1cmfr.fd} +%\ProvidesFile{ot1cmr.fd} +%\ProvidesFile{ot1cmss.fd} +%\ProvidesFile{ot1cmtt.fd} +%\ProvidesFile{ot1cmvtt.fd} +%\ProvidesFile{ot2cmr.fd} +%\ProvidesFile{ot2cmss.fd} +%\ProvidesFile{t1ccr.fd} +%\ProvidesFile{t1cmdh.fd} +%\ProvidesFile{t1cmfib.fd} +%\ProvidesFile{t1cmfr.fd} +%\ProvidesFile{t1cmr.fd} +%\ProvidesFile{t1cmss.fd} +%\ProvidesFile{t1cmtt.fd} +%\ProvidesFile{t1cmvtt.fd} +%\ProvidesFile{ts1cmr.fd} +%\ProvidesFile{ts1cmss.fd} +%\ProvidesFile{ts1cmtt.fd} +%\ProvidesFile{ts1cmvtt.fd} +%\ProvidesFile{ucmr.fd} +%\ProvidesFile{ucmss.fd} +%\ProvidesFile{ucmtt.fd} +%<*driver, > + \ProvidesFile{cmfonts.drv} +% + [1999/05/25 v2.5h Standard LaTeX font definitions] +% +%<*driver> +\documentclass{ltxdoc} +\GetFileInfo{cmfonts.drv} +\providecommand\dst{\expandafter{\normalfont\scshape docstrip}} +\title{The file \texttt{cmfonts.fdd} for use with + \LaTeXe.\thanks{This file has version + number \fileversion, dated \filedate.}} +\date{\filedate}\author{Frank Mittelbach \and Rainer Sch\"opf} +\begin{document} +\maketitle + \DocInput{cmfonts.fdd} +\end{document} +% +% +%\fi +% +% +% +% \changes{v2.5e}{1997/06/16}{Replaced reference to DC-fonts by ec +% fonts.} +% \changes{v2.5c}{1997/05/26}{Removed spaces in and around arguments +% to \cs{DeclareFontShape} and \cs{EC@family}.} +% \changes{v2.4j}{1996/11/20}{lowercase filenames /1044} +% \changes{v2.4h}{1996/05/19}{Added CM variable typewriter family} +% \changes{v2.4g}{1996/05/17} +% {Force \cs{hyphenchar} of OT1 fonts to 45, in case +% \cs{defaulthyphenchar} has changed.} +% \changes{v2.4g}{1996/05/17} +% {Remove some spurious extra empty arguments to +% \cs{DeclareFontFamily} calls} +% \changes{v2.4d}{1995/12/01} +% {Documentation changes from Ulrik Vieth /1989} +% \changes{v2.4d}{1995/12/01} +% {Dont force T1 hyphenchar to 127. latex/1853} +% \changes{v2.4c}{1995/11/07}{Use decimal rather than octal character +% specification for \cs{hyphenchar} and \cs{skewchar} so that there is +% no problem with an active quote character.} +% \changes{v2.4a}{1995/10/22}{Added support for new (v1.2) DC fonts +% and text companion fonts (TS1 encoding).} +% \changes{v2.3d}{1994/11/02}{Added more font substitutions for +% \cs{pounds}.} +% \changes{v2.3d}{1994/10/30}{Added OMLcmr.fd and OMScmr.fd.} +% \changes{v2.3b}{1994/05/12}{Added \cs{ProvidesFile} commands} +% \changes{v2.3a}{1994/05/03}{Included definitions for +% AMS-supplied cm fonts.} +% \changes{v2.2f}{1994/02/07}{Added missing size 10.95 for +% cmr/b/n and cmr/m/ui.} +% \changes{v2.2e}{1994/02/02}{Corrected encoding scheme U.} +% \changes{v2.2d}{1994/01/27}{Replaced most ssub with sub} +% \changes{v2.2a}{1993/12/13}{Removed \cs{CodelineIndex} from the +% driver code.} +% +% \changes{v2.1a}{1993/10/17}{Shape u renamed to ui.} +% \changes{v2.1a}{1993/10/17}{File renamed to cmfonts.fdd.} +% +% +% +% \section{Introduction} +% +% This file contains the external font information needed to load +% the Computer Modern fonts designed by Don Knuth and distributed with +% \TeX. +% +% From this file all {\ttfamily.fd} files (font definition files) for +% the Computer Modern fonts, both with old encoding (|OT1|) and Cork +% encoding (|T1|) are generated. The Cork encoded fonts are known +% under the name ec fonts. +% +% \section{Customization} +% +% If you plan to install the AMS font package or if you have it +% already installed, please note that within this package there are +% additional sizes of the Computer Modern symbol and math italic +% fonts. With the release of \LaTeXe, these AMS `extracm' fonts have +% been included in the \LaTeX\ font set. Therefore, the math |.fd| files +% produced here assume the presence of these AMS extensions. +% +% For text fonts in \texttt{T1} encoding, the directive |new| selects +% the new (version 1.2) DC fonts. +% +% For the text fonts in \texttt{OT1} and \texttt{U} encoding, +% the optional \dst{} directive |ori| selects a conservatively +% generated set of font definition files, +% which means that only the basic font sizes coming with an old +% \LaTeX~2.09 installation are included into the |\DeclareFontShape| +% commands. However, on many installations, people have added missing +% sizes by scaling up or down available Metafont sources. For example, +% the Computer Modern Roman italic font |cmti| is only available in +% the sizes 7, 8, 9, and 10pt. Nevertheless one could generate it for +% the sizes 5, and 6pt by using the source from |cmti7| scaled +% downwards. The corresponding enlarged font set is generated if the +% \dst{} directive |ori| is not used. +% +% When you generate the |.fd| files using the installation script +% |cmfonts.ins| distributed with \LaTeXe, the enlarged font set is +% selected. +% If you want to select the conservative set of |.fd| files, you have to +% replace statements like +% \begin{verbatim} +% \generateFile{OT1cmr.fd}{t}{\from{cmfonts.fdd}{fd,OT1cmr}} +%\end{verbatim} +% with +% \begin{verbatim} +% \generateFile{OT1cmr.fd}{t}{\from{cmfonts.fdd}{fd,OT1cmr,ori}} +%\end{verbatim} +% in the installation script, or more exactly by copying the +% installation script to a file with a new name and change that copy. +% +% \StopEventually{} +% +% \section{The \texttt{docstrip} modules} +% +% The following modules are used to direct \texttt{docstrip} in +% generating external files: +% \begin{center} +% \begin{tabular}{ll} +% driver & produce a documentation driver file \\ +% nowarn & produce |.fd| files that do not warn about substitutions\\ +% ori & make conservative |.fd| files\\ +% new & select version 1.2 DC fonts\\ +% ec & select EC fonts\\ +% fd & produce a font definition file (actually no longer used)\\[2pt] +% OMLccm & make Concrete Roman Math italic\\ +% OMLcmm & make Computer Modern Math italic\\ +% OMLcmr & make Computer Modern Roman (math italic encoding)\\ +% OMScmr & make Computer Modern Roman (math symbol encoding)\\ +% OMScmsy & make Computer Modern Symbols \\ +% OMXcmex & make Computer Modern large Symbols\\ +% OT1ccr & make Concrete Roman (old encoding) \\ +% OT1cmdh & make Computer Modern Dunhill (old encoding)\\ +% OT1cmfib & make Computer Modern Fibonacci (old encoding)\\ +% OT1cmfr & make Computer Modern Funny (old encoding)\\ +% OT1cmr & make Computer Modern Roman (old encoding)\\ +% OT1cmss & make Computer Modern Sans (old encoding)\\ +% OT1cmtt & make Computer Modern Typewriter (old encoding)\\ +% OT1cmvtt & make Computer Modern Variable Typewriter (old encoding)\\ +% OT2cmr & make Computer Modern Roman (old cyrillic encoding)\\ +% OT2cmss & make Computer Modern Sans (old cyrillic encoding)\\ +% T1ccr & make Concrete Roman (Cork encoding)\\ +% T1cmdh & make Computer Modern Dunhill (Cork encoding)\\ +% T1cmfib & make Computer Modern Fibonacci (Cork encoding)\\ +% T1cmfr & make Computer Modern Funny (Cork encoding)\\ +% T1cmr & make Computer Modern Roman (Cork encoding)\\ +% T1cmss & make Computer Modern Sans (Cork encoding)\\ +% T1cmtt & make Computer Modern Typewriter (Cork encoding)\\ +% T1cmvtt & make Computer Modern Variable Typewriter (Cork +% encoding)\\ +% TS1cmr & make Computer Modern Roman text companion fonts\\ +% TS1cmss & make Computer Modern Sans text companion fonts\\ +% TS1cmtt & make Computer Modern Typewriter text companion fonts\\ +% TS1cmvtt & make Computer Modern Variable Typewriter text +% companion fonts\\ +% Ucmr & make Computer Modern Roman (unknown encoding)\\ +% Ucmss & make Computer Modern Sans (unknown encoding)\\ +% Ucmtt & make Computer Modern Typewriter (unknown encoding)\\ +% \end{tabular} +% \end{center} +% A typical \texttt{docstrip} command file would then have entries like: +% \begin{verbatim} +%\generateFile{OT1cmr.fd}{t}{\from{cmfonts.fdd}{fd,OT1cmr}} +%\end{verbatim} +% +% +% \section{The font definition files} +% +% As always we begin by identifying the latest version of the files +% in the \textsf{log} file. The explicit spaces are necessary in an +% |.fd| file and the |\string| guards against situations where |`|, +% |<| or |>| is active. +% \changes{v2.2g}{1994/02/15}{Removed surplus \cs{string}} +% +% \subsection{Fonts with Cork encoding (\texttt{T1})} +% +% We start with the DC-fonts. These are Computer Modern fonts +% reimplemented originally by Norbert Schwarz, and since release~1.2 +% by J\"org Knappen. +% You can get them from \TeX{} +% archives and from \TeX{} organizations. We strongly recommend +% that you use them because they are encoded in the approved +% standard encoding for text fonts. +% +% \subsubsection{Commands for fonts with the `EC' naming scheme} +% Before the declarations for the individual fonts, first define +% some abreviations that may be used as most of the fonts in the +% `new' dc font distribution come in the same range of sizes. +% The same is true for the ec fonts, with a somewhat enlarged font +% size range. +% \changes{v2.5f}{1998/01/10}{Added larger sizes for ec fonts only +% (thanks to Christian Cornelssen)} +% \begin{macrocode} +%<*new|ec> +%<*!tt> +\providecommand{\EC@family}[5]{% + \DeclareFontShape{#1}{#2}{#3}{#4}% + {<5><6><7><8><9><10><10.95><12><14.4>% +% <17.28><20.74><24.88><29.86><35.83>genb*#5}{}} +% <17.28><20.74><24.88>genb*#5}{}} +% +% \end{macrocode} +% For monospaced fonts, the normal interpolation breaks down below +% 8pt, so scale the 8pt fonts instead. +% \changes{v2.5f}{1998/01/10}{Added larger sizes for ec fonts only +% (thanks to Christian Cornelssen)} +% \begin{macrocode} +%<*tt> +\providecommand{\EC@ttfamily}[5]{% + \DeclareFontShape{#1}{#2}{#3}{#4}% + {<5><6><7><8>#50800% +% <9><10><10.95><12><14.4><17.28><20.74><24.88><29.86>% +% <35.83>genb*#5}{}} +% <9><10><10.95><12><14.4><17.28><20.74><24.88>genb*#5}{}} +% +% +% \end{macrocode} +% +% \subsubsection{The Computer Modern Roman} +% +% This family is available in the shapes |n|, |sl|, |it|, |sc|, and +% |ui|. +% \begin{macrocode} +%<*T1cmr> +\DeclareFontFamily{T1}{cmr}{} +%<*!new&!ec> +\DeclareFontShape{T1}{cmr}{m}{n}{% + <5><6><7><8><9>gen*dcr% + <10><10.95>dcr10% + <12><14.4>dcr12% + <17.28><20.74><24.88>dcr17}{} +\DeclareFontShape{T1}{cmr}{m}{sl}{% + <5><6><7><8>dcsl8% + <9>dcsl9% + <10><10.95>dcsl10% + <12><14.4>dcsl12% + <17.28><20.74><24.88>dcsl17% + }{} +\DeclareFontShape{T1}{cmr}{m}{it}{% + <5><6>dcti7% + <7><8><9>gen*dcti% + <10><10.95>dcti10% + <12><14.4>dcti12% + <17.28><20.74><24.88>dcti17% + }{} +\DeclareFontShape{T1}{cmr}{m}{sc}{% + <5><6><7><8><9><10><10.95>dccsc10% + <12><14.4>dccsc12% + <17.28><20.74><24.88>dccsc17% + }{} +\DeclareFontShape{T1}{cmr}{m}{ui}{% + <5><6>dcu7% + <7><8><9>gen*dcu% + <10><10.95>dcu10% + <12><14.4>dcu12% + <17.28><20.74><24.88>dcu17% + }{} +% \end{macrocode} +% There is a bold `|b|' series, but unfortunately only the normal +% shape is available in this series. +% \begin{macrocode} +%<+T1cmr>%%%%%%% bold series +\DeclareFontShape{T1}{cmr}{b}{n}{% + <5><6><7><8><9>gen*dcb% + <10><10.95>dcb10% + <12><14.4>dcb12% + <17.28><20.74><24.88>dcb17% + }{} +% \end{macrocode} +% Finally there is a bold extended series `|bx|' with the shapes +% |n|, |sl|, and |it|. +% \begin{macrocode} +%<+T1cmr>%%%%%%%% bold extended series +\DeclareFontShape{T1}{cmr}{bx}{n}{% + <5><6><7><8><9>gen*dcbx% + <10><10.95>dcbx10% + <12><14.4><17.28><20.74><24.88>dcbx12% + }{} +\DeclareFontShape{T1}{cmr}{bx}{sl}{% + <5><6><7><8><9>gen*dcbxsl% + <10><10.95>dcbxsl10% + <12><14.4><17.28><20.74><24.88>dcbxsl12% + }{} +\DeclareFontShape{T1}{cmr}{bx}{it}{% + <5><6><7><8><9><10><10.95>dcbxti10% + <12><14.4>dcbxti12% + <17.28><20.74><24.88>dcbxti17% + }{} +% +% \end{macrocode} +% \changes{v2.4d}{1995/12/01} +% {Ulrik Vieth. Add ui shape /1989} +% \begin{macrocode} +%<*new> +\EC@family{T1}{cmr}{m}{n}{dcr} +\EC@family{T1}{cmr}{m}{sl}{dcsl} +\EC@family{T1}{cmr}{m}{it}{dcti} +\EC@family{T1}{cmr}{m}{sc}{dccc} +\EC@family{T1}{cmr}{bx}{n}{dcbx} +\EC@family{T1}{cmr}{b}{n}{dcb} +\EC@family{T1}{cmr}{bx}{it}{dcbi} +\EC@family{T1}{cmr}{bx}{sl}{dcbl} +\EC@family{T1}{cmr}{m}{ui}{dcu} +% +% \end{macrocode} +% \changes{v2.5a}{1997/01/14} +% {EC fonts} +% \changes{v2.5d}{1997/06/02}{bold sc fonts latex/2497} +% \begin{macrocode} +%<*ec> +\EC@family{T1}{cmr}{m}{n}{ecrm} +\EC@family{T1}{cmr}{m}{sl}{ecsl} +\EC@family{T1}{cmr}{m}{it}{ecti} +\EC@family{T1}{cmr}{m}{sc}{eccc} +\EC@family{T1}{cmr}{bx}{n}{ecbx} +\EC@family{T1}{cmr}{b}{n}{ecrb} +\EC@family{T1}{cmr}{bx}{it}{ecbi} +\EC@family{T1}{cmr}{bx}{sl}{ecbl} +\EC@family{T1}{cmr}{bx}{sc}{ecxc} +\EC@family{T1}{cmr}{m}{ui}{ecui} +% +% +% \end{macrocode} +% +% \subsubsection{Computer Modern Fibonacci} +% +% This family was created by Don Knuth as an experiment, supplying +% only Fibonacci numbers to the parameters of the Metafont sources +% of the Computer Modern Meta family. +% \begin{macrocode} +%<*T1cmfib> +\DeclareFontFamily{T1}{cmfib}{} +%<*!new&!ec> +\DeclareFontShape{T1}{cmfib}{m}{n}{% + <8><9><10><12>gen*dcfib% + }{} +% +% \end{macrocode} +% \changes{v2.4f}{1995/12/20} +% {Family name and external file name corrected Ulrik Vieth /2017} +% In fact these `dcfb' fonts are currently withdrawn as they generate +% metafont errors. +% \begin{macrocode} +%<*new> +\EC@family{T1}{cmfib}{m}{n}{dcfb} +% +% \end{macrocode} +% \changes{v2.5a}{1997/01/14} +% {EC fonts, new slanted fibonacci} +% \begin{macrocode} +%<*ec> +\EC@family{T1}{cmfib}{m}{n}{ecfb} +\EC@family{T1}{cmfib}{m}{sl}{ecfs} +% +% +% \end{macrocode} +% +% \subsubsection{Computer Modern Funny (Roman)} +% +% This family was created by Don Knuth as another experiment. +% \begin{macrocode} +%<*T1cmfr> +\DeclareFontFamily{T1}{cmfr}{} +%<*!new&!ec> +\DeclareFontShape{T1}{cmfr}{m}{n}{% + <10>dcff10% + }{} +\DeclareFontShape{T1}{cmfr}{m}{it}{% + <10>dcfi10% + }{} +% +%<*new> +\EC@family{T1}{cmfr}{m}{n}{dcff} +\EC@family{T1}{cmfr}{m}{it}{dcfi} +% +% \end{macrocode} +% \changes{v2.5a}{1997/01/14} +% {EC fonts} +% \begin{macrocode} +%<*ec> +\EC@family{T1}{cmfr}{m}{n}{ecff} +\EC@family{T1}{cmfr}{m}{it}{ecfi} +% +% +% \end{macrocode} +% +% \subsubsection{Computer Modern Sans} +% +% \begin{macrocode} +%<*T1cmss> +\DeclareFontFamily{T1}{cmss}{} +%<*!new&!ec> +\DeclareFontShape{T1}{cmss}{m}{n}{% + <5><6><7><8>dcss8% + <9>dcss9% + <10><10.95>dcss10% + <12><14.4>dcss12% + <17.28><20.74><24.88>dcss17% + }{} +\DeclareFontShape{T1}{cmss}{m}{it}% + {<->sub*cmss/m/sl}{} +\DeclareFontShape{T1}{cmss}{m}{sl}{% + <5><6><7><8>dcssi8% + <9>dcssi9% + <10><10.95>dcssi10% + <12><14.4>dcssi12% + <17.28><20.74><24.88>dcssi17% + }{} +% +%<*new> +\EC@family{T1}{cmss}{m}{n}{dcss} +\EC@family{T1}{cmss}{m}{sl}{dcsi} +\EC@family{T1}{cmss}{m}{it}{dcsi} +\EC@family{T1}{cmss}{bx}{n}{dcsx} +\EC@family{T1}{cmss}{bx}{it}{dcso} +\EC@family{T1}{cmss}{bx}{sl}{dcso} +% +% \end{macrocode} +% \changes{v2.5a}{1997/01/14} +% {EC fonts} +% \begin{macrocode} +%<*ec> +\EC@family{T1}{cmss}{m}{n}{ecss} +\EC@family{T1}{cmss}{m}{sl}{ecsi} +\EC@family{T1}{cmss}{m}{it}{ecsi} +\EC@family{T1}{cmss}{bx}{n}{ecsx} +\EC@family{T1}{cmss}{bx}{it}{ecso} +\EC@family{T1}{cmss}{bx}{sl}{ecso} +% +% \end{macrocode} +% The next substitution is very questionable. +% \begin{macrocode} +%<+T1cmss>%%%%%% Font/shape undefined, therefore substituted +\DeclareFontShape{T1}{cmss}{m}{sc}% + {<->sub*cmr/m/sc}{} +% \end{macrocode} +% The next font group is quite attractive for display. +% \begin{macrocode} +%<+T1cmss>%%%%%%% semibold condensed series +\DeclareFontShape{T1}{cmss}{sbc}{n}{% + <5><6><7><8><9><10><10.95><12><14.4><17.28>% + <20.74><24.88>% +%dcssdc10 +%ecssdc10 + }{} +% \end{macrocode} +% +% \begin{macrocode} +%<*!new&!ec> +%<+T1cmss>%%%%%%%% bold extended series +\DeclareFontShape{T1}{cmss}{bx}{n}{% + <5><6><7><8><9><10><10.95><12><14.4><17.28>% + <20.74><24.88>dcssbx10% + }{} +% \end{macrocode} +% Another questionable substitution, but if we have the above +% we might as well have this one +% \changes{v2.5g}{1998/03/27}{Added subst for cmss/bx/sc (pr/2586)} +% \begin{macrocode} +%<+T1cmss>%%%%%% Font/shape undefined, therefore substituted +\DeclareFontShape{T1}{cmss}{bx}{sc}% + {<->sub*cmr/m/sc}{} +% +% +% \end{macrocode} +% +% \subsubsection{Computer Modern Typewriter} +% +% Perhaps the best font in the Computer Modern suite. +% \begin{macrocode} +%<*T1cmtt> +\DeclareFontFamily{T1}{cmtt}{\hyphenchar \font\m@ne} +%<*!new&!ec> +\DeclareFontShape{T1}{cmtt}{m}{n}{% + <8><9>gen*dctt% + <10><10.95>dctt10% + <12><14.4><17.28><20.74><24.88>dctt12% + }{} +\DeclareFontShape{T1}{cmtt}{m}{it}{% + <8><9>gen*dcitt% + <10><10.95>dcitt10% + <12><14.4>dcitt12% + <17.28><20.74><24.88>dcitt17% + }{} +\DeclareFontShape{T1}{cmtt}{m}{sl}{% + <8><9>gen*dcsltt% + <10><10.95>dcsltt10% + <12><14.4><17.28><20.74><24.88>dcsltt12% + }{} +\DeclareFontShape{T1}{cmtt}{m}{sc}{% + <10><10.95>dctcsc10% + <12><14.4>dctcsc12% + <17.28><20.74><24.88>dctcsc17% + }{} +% +% \end{macrocode} +% \changes{v2.4e}{1995/12/04} +% {Ulrik Vieth. added dctc /1989} +% \begin{macrocode} +%<*new> +\EC@ttfamily{T1}{cmtt}{m}{n}{dctt} +\EC@ttfamily{T1}{cmtt}{m}{sl}{dcst} +\EC@ttfamily{T1}{cmtt}{m}{it}{dcit} +\EC@ttfamily{T1}{cmtt}{m}{sc}{dctc} +% \end{macrocode} +% \changes{v2.4i}{1996/09/26}{Added substitutions for T1 bold +% extended typewriter fonts (new version).} +% Finally, we define substitutions for the series |bx|. It comes +% with or without a warning. +% \begin{macrocode} +\DeclareFontShape{T1}{cmtt}{bx}{n}% +%<-nowarn> {<->sub*cmtt/m/n}{} +%<+nowarn> {<->ssub*cmtt/m/n}{} +\DeclareFontShape{T1}{cmtt}{bx}{it}% +%<-nowarn> {<->sub*cmtt/m/it}{} +%<+nowarn> {<->ssub*cmtt/m/it}{} +% +% \end{macrocode} +% \changes{v2.5a}{1997/01/14} +% {EC fonts} +% \begin{macrocode} +%<*ec> +\EC@ttfamily{T1}{cmtt}{m}{n}{ectt} +\EC@ttfamily{T1}{cmtt}{m}{sl}{ecst} +\EC@ttfamily{T1}{cmtt}{m}{it}{ecit} +\EC@ttfamily{T1}{cmtt}{m}{sc}{ectc} +% \end{macrocode} +% \changes{v2.4i}{1996/09/26}{Added substitutions for T1 bold +% extended typewriter fonts (new version).} +% Finally, we define substitutions for the series |bx|. It comes +% with or without a warning. +% \begin{macrocode} +\DeclareFontShape{T1}{cmtt}{bx}{n}% +%<-nowarn> {<->sub*cmtt/m/n}{} +%<+nowarn> {<->ssub*cmtt/m/n}{} +\DeclareFontShape{T1}{cmtt}{bx}{it}% +%<-nowarn> {<->sub*cmtt/m/it}{} +%<+nowarn> {<->ssub*cmtt/m/it}{} +% +% +% \end{macrocode} +% +% +% \subsubsection{Computer Modern Variable Typewriter} +% +% The Computer Modern Variable Typewriter family is the +% proportional spaced version of the Computer Modern Typewriter +% family. It is implemented as a separate family to allow easy use +% in normal text, including changes of shape/series etc if available. +% This family also allows normal hyphenation. +% +% In the first implementations for the Cork encoding only the +% normal shape is available. Starting with release 1.3 italic will +% be provided as well. +% \begin{macrocode} +%<*T1cmvtt> +\DeclareFontFamily{T1}{cmvtt}{} +%<*!new&!ec> +\DeclareFontShape{T1}{cmvtt}{m}{n}{% + <8><9>gen*dcvtt% + <10><10.95>dcvtt10% + <12><14.4><17.28><20.74><24.88>dcvtt12% + }{} +% +% \end{macrocode} +% With release 1.3 there will be an italic shape as well. +% \begin{macrocode} +%<*new> +\EC@ttfamily{T1}{cmvtt}{m}{n}{dcvt} +\EC@ttfamily{T1}{cmvtt}{m}{it}{dcvi} +% +%<*ec> +\EC@ttfamily{T1}{cmvtt}{m}{n}{ecvt} +\EC@ttfamily{T1}{cmvtt}{m}{it}{ecvi} +% +% +% \end{macrocode} +% +% +% \subsubsection{Computer Modern Dunhill} +% +% The smoker's choice? Within the Cork encoding this font comes with +% a full size range by default but only with one series. +% \begin{macrocode} +%<*T1cmdh> +\DeclareFontFamily{T1}{cmdh}{} +%<*!new&!ec> +\DeclareFontShape{T1}{cmdh}{m}{n}{% + <5><6><7><8><9>gen*dcdunh% + <10><10.95>dcdunh10% + <12><14.4>dcdunh12% + <17.28><20.74><24.88>dcdunh17}{} +% +%<*new> +\EC@family{T1}{cmdh}{m}{n}{dcdh} +% +%<*ec> +\EC@family{T1}{cmdh}{m}{n}{ecdh} +% +% +% \end{macrocode} +% +% \subsubsection{Concrete Roman} +% +% A font near to Computer Modern Typewriter designed to go with the +% Euler Math fonts. +% \begin{macrocode} +%<*T1ccr> +\DeclareFontFamily{T1}{ccr}{} +\DeclareFontShape{T1}{ccr}{m}{n}{% + <5><6><7><8><9><10><12>gen*dccr% + <10.95>dccr11 <14.4>dccr14% + <17.28><20.74><24.88>dccr17}{} +\DeclareFontShape{T1}{ccr}{m}{it}{% + <10><10.95><12>dcti10}{} +\DeclareFontShape{T1}{ccr}{m}{sc}{% + <10><10.95><12>dccsc10 }{} +% \end{macrocode} +% Note the condensed slanted variant (not used). +% \changes{v2.4d}{1995/12/01} +% {Ulrik Vieth. Removed dcslc9 (no such font...) /1989} +% \begin{macrocode} +%\DeclareFontShape{T1}{ccr}{c}{sl}{<9>dcslc9}{} +% \end{macrocode} +% Finally a few substitution fonts for combinations not available. +% As suggested by Leslie Lamport and several others the +% substitution should warn by default. We control this my a \dst{} +% module so that one can modify this behavior from the outside. +% \changes{v2.0f}{1993/09/24}{Added substitution fonts} +% \begin{macrocode} +\DeclareFontShape{T1}{ccr}{bx}{sl}{% +%<-nowarn> <->sub*cmr/bx/it +%<+nowarn> <->ssub*cmr/bx/it +}{} +\DeclareFontShape{T1}{ccr}{bx}{n}{% +%<-nowarn> <->sub*cmr/bx/n +%<+nowarn> <->ssub*cmr/bx/n +}{} +\DeclareFontShape{T1}{ccr}{bx}{it}{% +%<-nowarn> <->sub*cmr/bx/it +%<+nowarn> <->ssub*cmr/bx/it +}{} +% +% \end{macrocode} +% +% +% \subsubsection{The text companion fonts for \texttt{T1} encoding} +% +% \changes{v2.4e}{1995/12/04} +% {Ulrik Vieth. added tcu /1989} +% \begin{macrocode} +%<*TS1cmr> +\DeclareFontFamily{TS1}{cmr}{\hyphenchar\font\m@ne} +%\EC@family{TS1}{cmr}{m}{n}{tcr} +%\EC@family{TS1}{cmr}{m}{n}{tcrm} +\EC@family{TS1}{cmr}{m}{sl}{tcsl} +\EC@family{TS1}{cmr}{m}{it}{tcti} +\EC@family{TS1}{cmr}{bx}{n}{tcbx} +%\EC@family{TS1}{cmr}{b}{n}{tcb} +%\EC@family{TS1}{cmr}{b}{n}{tcrb} +\EC@family{TS1}{cmr}{bx}{it}{tcbi} +\EC@family{TS1}{cmr}{bx}{sl}{tcbl} +%\EC@family{TS1}{cmr}{m}{ui}{tcu} +%\EC@family{TS1}{cmr}{m}{ui}{tcui} +% +%<*TS1cmss> +\DeclareFontFamily{TS1}{cmss}{\hyphenchar\font\m@ne} +\EC@family{TS1}{cmss}{m}{n}{tcss} +\EC@family{TS1}{cmss}{m}{sl}{tcsi} +\EC@family{TS1}{cmss}{m}{it}{tcsi} +\EC@family{TS1}{cmss}{bx}{n}{tcsx} +\EC@family{TS1}{cmss}{bx}{it}{tcso} +\EC@family{TS1}{cmss}{bx}{sl}{tcso} +% +%<*TS1cmtt> +\DeclareFontFamily{TS1}{cmtt}{\hyphenchar\font\m@ne} +\EC@ttfamily{TS1}{cmtt}{m}{n}{tctt} +\EC@ttfamily{TS1}{cmtt}{m}{sl}{tcst} +\EC@ttfamily{TS1}{cmtt}{m}{it}{tcit} +% +% \end{macrocode} +% Again the italic shape is only available with release 1.3. +% \begin{macrocode} +%<*TS1cmvtt> +\DeclareFontFamily{TS1}{cmvtt}{} +\EC@ttfamily{TS1}{cmvtt}{m}{n}{tcvt} +\EC@ttfamily{TS1}{cmvtt}{m}{it}{tcvi} +% +% \end{macrocode} +% +% \subsection{Fonts with the old \TeX{} text encoding (\texttt{OT1})} +% +% Note that in contrast to the Cork encoding, which is fully +% defined, the old \TeX{} text encoding isn't implemented consistent +% within all fonts. Most noticeably is that a dollar sign (\$) in +% some fonts is replaced by a pound symbol (\pounds) in others, +% which produced quite a number of bug fixes in the NFSS1. Also the +% typewriter fonts contain a few different characters which are not +% present in other fonts. +% +% If one would use the philosophy of NFSS2 consequently all these +% would therefore be different encodings and font mixing would +% therefore be nearly impossible with older fonts. Therefore such +% encodings are considered the same but one should be remember that +% in some situations this may cause problems. +% +% In other words, use |T1| encoding whenever possible, the |OT..| +% encodings will be removed in some future release. +% +% \subsubsection{Computer Modern Roman (\texttt{OT1})} +% +% Beside the |OT1| encoding we also define the same family as |U| +% encoded which is used for accepting old sources with stuff like +% |\newmathalphabet| in it. +% \begin{macrocode} +%<*OT1cmr,Ucmr> +%<+OT1cmr>\DeclareFontFamily{OT1}{cmr}{\hyphenchar\font45 } +%<+Ucmr>\DeclareFontFamily{U}{cmr}{\hyphenchar\font45 } +%<+OT1cmr>\DeclareFontShape{OT1}{cmr}{m}{n}% +%<+Ucmr>\DeclareFontShape{U}{cmr}{m}{n}% + {<5><6><7><8><9><10><12>gen*cmr% + <10.95>cmr10% + <14.4>cmr12% + <17.28><20.74><24.88>cmr17}{} +%<+OT1cmr>\DeclareFontShape{OT1}{cmr}{m}{sl}% +%<+Ucmr>\DeclareFontShape{U}{cmr}{m}{sl}% + {% +%<+ori> <5-8>sub*cmr/m/n% +%<-ori> <5><6><7>cmsl8% + <8><9>gen*cmsl% + <10><10.95>cmsl10% + <12><14.4><17.28><20.74><24.88>cmsl12% + }{} +%<+OT1cmr>\DeclareFontShape{OT1}{cmr}{m}{it}% +%<+Ucmr>\DeclareFontShape{U}{cmr}{m}{it}% + {% +%<+ori> <5-7>sub*cmr/m/n% +%<+ori> <7>cmti7% +%<-ori> <5><6><7>cmti7% + <8>cmti8% + <9>cmti9% + <10><10.95>cmti10% + <12><14.4><17.28><20.74><24.88>cmti12% + }{} +%<+OT1cmr>\DeclareFontShape{OT1}{cmr}{m}{sc}% +%<+Ucmr>\DeclareFontShape{U}{cmr}{m}{sc}% + {% +%<+ori> <5-8>sub*cmr/m/n% +%<+ori> <8><9><10><10.95><12>% +%<+ori> <14.4><17.28><20.74><24.88>cmcsc10% +%<-ori> <5><6><7><8><9><10><10.95><12>% +%<-ori> <14.4><17.28><20.74><24.88>cmcsc10% + }{} +% \end{macrocode} +% Here we try to cure the famous \$ $\to$ \pounds{} bug: +% \changes{v2.2c}{1994/01/18}{Corrected forgotten renaming of font +% shape u to ui in substitution.} +% \begin{macrocode} +%<+OT1cmr,Ucmr>% Warning: please note that the upright shape below is +%<+OT1cmr,Ucmr>% used for the \pounds symbol of LaTeX. So this +%<+OT1cmr,Ucmr>% font definition shouldn't be removed. +%<+OT1cmr,Ucmr>% +%<+ori>% If cmu below 10pt is not available we substitute +%<+ori>% cmti as far as possible (sizes 7, 8, 9). This is +%<+ori>% done because cmu is used mainly for producing the +%<+ori>% the \pound symbol and it is better to get a slanted +%<+ori>% (or bigger) pound then to get a $ sign in such +%<+ori>% situations. +%<+OT1cmr>\DeclareFontShape{OT1}{cmr}{m}{ui} +%<+Ucmr>\DeclareFontShape{U}{cmr}{m}{ui} + { +%<+ori> <7>subf*cmti7% +%<+ori> <8>subf*cmti8% +%<+ori> <9>subf*cmti9% +%<+ori> <10><10.95><12><14.4><17.28><20.74><24.88>cmu10% +%<-ori> <5><6><7><8><9><10><10.95><12>% +%<-ori> <14.4><17.28><20.74><24.88>cmu10% + }{} +%<+OT1cmr,Ucmr>%%%%%%% bold series +%<+OT1cmr>\DeclareFontShape{OT1}{cmr}{b}{n} +%<+Ucmr>\DeclareFontShape{U}{cmr}{b}{n}% + {% +%<+ori> <-10>sub*cmr/bx/n% +%<+ori> <10><10.95><12><14.4><17.28><20.74><24.88>cmb10% +%<-ori> <5><6><7><8><9><10><10.95><12>% +%<-ori> <14.4><17.28><20.74><24.88>cmb10% + }{} +%<+OT1cmr,Ucmr>%%%%%%%% bold extended series +%<+OT1cmr>\DeclareFontShape{OT1}{cmr}{bx}{n} +%<+Ucmr>\DeclareFontShape{U}{cmr}{bx}{n}% + {% + <5><6><7><8><9>gen*cmbx% + <10><10.95>cmbx10% + <12><14.4><17.28><20.74><24.88>cmbx12% + }{} +%<+OT1cmr>\DeclareFontShape{OT1}{cmr}{bx}{sl} +%<+Ucmr>\DeclareFontShape{U}{cmr}{bx}{sl}% + {% +%<+ori> <-10>sub*cmr/bx/n% +%<+ori> <10><10.95><12><14.4><17.28><20.74><24.88>cmbxsl10% +%<-ori> <5><6><7><8><9>% +%<-ori> <10><10.95><12><14.4><17.28><20.74><24.88>cmbxsl10% + }{} +%<+OT1cmr>\DeclareFontShape{OT1}{cmr}{bx}{it} +%<+Ucmr>\DeclareFontShape{U}{cmr}{bx}{it}% + {% +%<+ori> <-10>sub*cmr/bx/n% +%<+ori> <10><10.95><12><14.4><17.28><20.74><24.88>cmbxti10% +%<-ori> <5><6><7><8><9>% +%<-ori> <10><10.95><12><14.4><17.28><20.74><24.88>cmbxti10% + }{} +% \end{macrocode} +% \changes{v2.5h}{1999/05/09}{docstrip `nowarn' guard was the wrong way +% around (pr/3036)} +% \begin{macrocode} +%<+OT1cmr,Ucmr>% Again this is necessary for a correct \pounds symbol in +%<+OT1cmr,Ucmr>% the cmr fonts Hopefully the dc/ec font layout will take +%<+OT1cmr,Ucmr>% over soon. +%<+OT1cmr,Ucmr>% +%<+OT1cmr>\DeclareFontShape{OT1}{cmr}{bx}{ui} +%<+Ucmr>\DeclareFontShape{U}{cmr}{bx}{ui}% +%<-nowarn> {<->sub*cmr/m/ui}{} +%<+nowarn> {<->ssub*cmr/m/ui}{} +% +% \end{macrocode} +% +% \subsubsection{Computer Modern Sans (\texttt{OT1})} +% +% Same game for the Sans family. +% \begin{macrocode} +%<*OT1cmss,Ucmss> +%<+OT1cmss>\DeclareFontFamily{OT1}{cmss}{\hyphenchar\font45 } +%<+Ucmss>\DeclareFontFamily{U}{cmss}{\hyphenchar\font45 } +%<+OT1cmss>\DeclareFontShape{OT1}{cmss}{m}{n} +%<+Ucmss>\DeclareFontShape{U}{cmss}{m}{n}% + {% +%<+ori> <-8>sub*cmr/m/n% +%<+ori> <8>cmss8% +%<-ori> <5><6><7><8>cmss8% + <9>cmss9% + <10><10.95>cmss10% + <12><14.4>cmss12% + <17.28><20.74><24.88>cmss17% + }{} +%<+OT1cmss,Ucmss>% Font undefined, therefore substituted +%<+OT1cmss>\DeclareFontShape{OT1}{cmss}{m}{it} +%<+Ucmss>\DeclareFontShape{U}{cmss}{m}{it}% +%<-nowarn> {<->sub*cmss/m/sl}{} +%<+nowarn> {<->ssub*cmss/m/sl}{} +%<+OT1cmss>\DeclareFontShape{OT1}{cmss}{m}{sl} +%<+Ucmss>\DeclareFontShape{U}{cmss}{m}{sl}% + {% +%<+ori> <-8>sub*cmss/m/n% +%<+ori> <8><9>gen*cmssi% +%<-ori> <5><6><7><8>cmssi8<9>cmssi9% + <10><10.95>cmssi10% + <12><14.4>cmssi12% + <17.28><20.74><24.88>cmssi17% + }{} +%<+OT1cmss,Ucmss>%%%%%%% Font/shape undefined, therefore substituted +%<+OT1cmss>\DeclareFontShape{OT1}{cmss}{m}{sc} +%<+Ucmss>\DeclareFontShape{U}{cmss}{m}{sc}% + {<->sub*cmr/m/sc}{} +%<+OT1cmss,Ucmss>%%%%%%% Font/shape undefined, therefore substituted +%<+OT1cmss>\DeclareFontShape{OT1}{cmss}{m}{ui} +%<+Ucmss>\DeclareFontShape{U}{cmss}{m}{ui}% + {<->sub*cmr/m/ui}{} +%<+OT1cmss,Ucmss>%%%%%%%% semibold condensed series +%<+OT1cmss>\DeclareFontShape{OT1}{cmss}{sbc}{n} +%<+Ucmss>\DeclareFontShape{U}{cmss}{sbc}{n}% + {% +%<+ori> <-10>sub*cmss/m/n% +%<-ori> <5><6><7><8><9>cmssdc10% + <10><10.95><12><14.4><17.28><20.74><24.88>cmssdc10% + }{} + +%<+OT1cmss,Ucmss>%%%%%%%%% bold extended series +%<+OT1cmss>\DeclareFontShape{OT1}{cmss}{bx}{n} +%<+Ucmss>\DeclareFontShape{U}{cmss}{bx}{n}% + {% +%<+ori> <-10>sub*cmss/m/n% +%<-ori> <5><6><7><8><9>cmssbx10% + <10><10.95><12><14.4><17.28><20.74><24.88>cmssbx10% + }{} +%<+OT1cmss,Ucmss>%%%%%%% Font/shape undefined, therefore substituted +%<+OT1cmss>\DeclareFontShape{OT1}{cmss}{bx}{ui} +%<+Ucmss>\DeclareFontShape{U}{cmss}{bx}{ui}% + {<->sub*cmr/bx/ui}{} +% +% \end{macrocode} +% +% \subsubsection{Computer Modern Typewriter (\texttt{OT1})} +% +% Notice that this encoding is in fact quite different and we +% shouldn't therefore substitute some other font group if the +% correct size or shape isn't available. Otherwise, we may end with +% a |\verb| suddenly producing a lot of funny chars instead of the +% desired ones. +% \begin{macrocode} +%<*OT1cmtt,Ucmtt> +%<+OT1cmtt>\DeclareFontFamily{OT1}{cmtt}{\hyphenchar \font\m@ne} +%<+Ucmtt>\DeclareFontFamily{U}{cmtt}{\hyphenchar \font\m@ne} +%<+OT1cmtt>\DeclareFontShape{OT1}{cmtt}{m}{n} +%<+Ucmtt>\DeclareFontShape{U}{cmtt}{m}{n}% + {% +% \end{macrocode} +% This substitution for |ori| is wrong and only in here because +% that was the way stuff has be set up in the old |lfonts.tex| file. +% \begin{macrocode} +%<+ori> <-8>sub*cmr/m/n% +%<+ori> <8><9>gen*cmtt% +%<-ori> <5><6><7><8>cmtt8<9>cmtt9% + <10><10.95>cmtt10% + <12><14.4><17.28><20.74><24.88>cmtt12% + }{} +%<+OT1cmtt,Ucmtt>%%%%%% make sure subst shapes are available +%<+OT1cmtt>\DeclareFontShape{OT1}{cmtt}{m}{it} +%<+Ucmtt>\DeclareFontShape{U}{cmtt}{m}{it}% + {% +% \end{macrocode} +% The following substitution however is okay since both fonts have +% the same encoding. +% \begin{macrocode} +%<+ori> <-10>sub*cmtt/m/n% +%<-ori> <5><6><7><8><9>% + <10><10.95><12><14.4><17.28><20.74><24.88>cmitt10% + }{} +%<+OT1cmtt>\DeclareFontShape{OT1}{cmtt}{m}{sl} +%<+Ucmtt>\DeclareFontShape{U}{cmtt}{m}{sl}% + {% +%<+ori> <-10>sub*cmtt/m/n% +%<-ori> <5><6><7><8><9>% + <10><10.95><12><14.4><17.28><20.74><24.88>cmsltt10% + }{} +%<+OT1cmtt>\DeclareFontShape{OT1}{cmtt}{m}{sc} +%<+Ucmtt>\DeclareFontShape{U}{cmtt}{m}{sc}% + {% +%<+ori> <-10>sub*cmtt/m/n% +%<-ori> <5><6><7><8><9>% + <10><10.95><12><14.4><17.28><20.74><24.88>cmtcsc10% + }{} +%<+OT1cmtt>\DeclareFontShape{OT1}{cmtt}{m}{ui} +%<+Ucmtt>\DeclareFontShape{U}{cmtt}{m}{ui}% +%<-nowarn> {<->sub*cmtt/m/it}{} +%<+nowarn> {<->ssub*cmtt/m/it}{} +%<+OT1cmtt>\DeclareFontShape{OT1}{cmtt}{bx}{n} +%<+Ucmtt>\DeclareFontShape{U}{cmtt}{bx}{n}% +%<-nowarn> {<->sub*cmtt/m/n}{} +%<+nowarn> {<->ssub*cmtt/m/n}{} +%<+OT1cmtt>\DeclareFontShape{OT1}{cmtt}{bx}{it} +%<+Ucmtt>\DeclareFontShape{U}{cmtt}{bx}{it}% +%<-nowarn> {<->sub*cmtt/m/it}{} +%<+nowarn> {<->ssub*cmtt/m/it}{} +%<+OT1cmtt>\DeclareFontShape{OT1}{cmtt}{bx}{ui} +%<+Ucmtt>\DeclareFontShape{U}{cmtt}{bx}{ui}% +%<-nowarn> {<->sub*cmtt/m/it}{} +%<+nowarn> {<->ssub*cmtt/m/it}{} +% +% \end{macrocode} +% +% +% \subsubsection{Computer Modern Variable Typewriter (\texttt{OT1})} +% +% The Computer Modern Variable Typewriter family is the +% proportional spaced version of the Computer Modern Typewriter +% family. It is implemented as a separate family to allow easy use +% in normal text, including changes of shape/series etc if available. +% This family also allows normal hyphenation. +% \changes{v2.5b}{1997/02/25} +% {typo fixed in ot1cmvtt \cs{ProvidesFile} latex/2394} +% \begin{macrocode} +%<*OT1cmvtt> +\DeclareFontFamily{OT1}{cmvtt}{\hyphenchar\font45 } +\DeclareFontShape{OT1}{cmvtt}{m}{n}% + {% + <5><6><7><8><9><10><10.95>% + <12><14.4><17.28><20.74><24.88>cmvtt10% + }{} +% \end{macrocode} +% This font is probably not available to everybody as it is not +% part of the standard distribution. One might find it in +% \texttt{.../systems/knuth/local} on CTAN. +% \begin{macrocode} +\DeclareFontShape{OT1}{cmvtt}{m}{it}% + {% + <5><6><7><8><9><10><10.95>% + <12><14.4><17.28><20.74><24.88>cmvtti10% + }{} +% +% \end{macrocode} +% +% +% \subsubsection{Computer Modern Funny (\texttt{OT1})} +% +% \begin{macrocode} +%<*OT1cmfr> +\DeclareFontFamily{OT1}{cmfr}{\hyphenchar\font45 } +\DeclareFontShape{OT1}{cmfr}{m}{n}{% + <10>cmff10% + }{} +\DeclareFontShape{OT1}{cmfr}{m}{it}{% + <10>cmfi10% + }{} +% +% \end{macrocode} +% +% \subsubsection{Computer Modern Dunhill (\texttt{OT1})} +% +% \begin{macrocode} +%<*OT1cmdh> +\DeclareFontFamily{OT1}{cmdh}{\hyphenchar\font45 } +\DeclareFontShape{OT1}{cmdh}{m}{n}{% + <10>cmdunh10% + }{} +% +% \end{macrocode} +% +% \subsubsection{Computer Modern Fibonacci (\texttt{OT1})} +% +% \begin{macrocode} +%<*OT1cmfib> +\DeclareFontFamily{OT1}{cmfib}{\hyphenchar\font45 } +\DeclareFontShape{OT1}{cmfib}{m}{n}{% + <8>cmfib8% + }{} +% +% \end{macrocode} +% +% \subsection{Math fonts} +% +% \subsubsection{Computer Modern Math italics} +% \changes{v2.0d}{1993/06/12}{OML/cmm/bx/it added for +% \cs{oldstylenums}} +% \changes{v2.3a}{1994/05/02}{Included font definitions for +% AMS-supplied cm fonts.} +% \begin{macrocode} +%<*OMLcmm> +\DeclareFontFamily{OML}{cmm}{\skewchar\font127 } +\DeclareFontShape{OML}{cmm}{m}{it}% + {<5><6><7><8><9>gen*cmmi% + <10><10.95>cmmi10% + <12><14.4><17.28><20.74><24.88>cmmi12% + }{} +\DeclareFontShape{OML}{cmm}{b}{it}{% + <5><6><7><8><9>gen*cmmib% + <10><10.95><12><14.4><17.28><20.74><24.88>cmmib10% + }{} +% \end{macrocode} +% This will allow the |\oldstylenums| command to work within +% |\textbf|. +% \begin{macrocode} +\DeclareFontShape{OML}{cmm}{bx}{it}% + {<->ssub*cmm/b/it}{} +% +% \end{macrocode} +% +% \subsubsection{Computer Modern Roman Math italics} +% +% \changes{v2.3d}{1994/10/30}{Added OMLcmr font substitutions pointing +% to OMLcmm. } +% \changes{v2.3f}{1995/04/22}{Corrected OMLcmr \cs{skewchar}} +% +% Some text symbols like `\t oo' and `$<$' are kept in the OML +% encoding, so we need font substititutions from OML/cmr to OML/cmm. +% \begin{macrocode} +%<*OMLcmr> +\DeclareFontFamily{OML}{cmr}{\skewchar\font127 } +\DeclareFontShape{OML}{cmr}{m}{n}% + {<->ssub*cmm/m/it}{} +\DeclareFontShape{OML}{cmr}{m}{it}% + {<->ssub*cmm/m/it}{} +\DeclareFontShape{OML}{cmr}{m}{sl}% + {<->ssub*cmm/m/it}{} +\DeclareFontShape{OML}{cmr}{m}{sc}% + {<->ssub*cmm/m/it}{} +\DeclareFontShape{OML}{cmr}{bx}{n}% + {<->ssub*cmm/b/it}{} +\DeclareFontShape{OML}{cmr}{bx}{it}% + {<->ssub*cmm/b/it}{} +\DeclareFontShape{OML}{cmr}{bx}{sl}% + {<->ssub*cmm/b/it}{} +\DeclareFontShape{OML}{cmr}{bx}{sc}% + {<->ssub*cmm/b/it}{} +% +% \end{macrocode} +% +% \subsubsection{Computer Modern Math symbols} +% +% \changes{v2.3a}{1994/05/02}{Included font definitions for +% AMS-supplied cm fonts.} +% \begin{macrocode} +%<*OMScmsy> +\DeclareFontFamily{OMS}{cmsy}{\skewchar\font48 } +\DeclareFontShape{OMS}{cmsy}{m}{n}{% + <5><6><7><8><9><10>gen*cmsy% + <10.95><12><14.4><17.28><20.74><24.88>cmsy10% + }{} +\DeclareFontShape{OMS}{cmsy}{b}{n}{% + <5><6><7><8><9>gen*cmbsy% + <10><10.95><12><14.4><17.28><20.74><24.88>cmbsy10% + }{} +% +% \end{macrocode} +% +% \subsubsection{Computer Modern Roman Math symbols} +% +% \changes{v2.3d}{1994/10/30}{Added OMScmr font substitutions pointing +% to OMScmm. } +% +% Some text symbols like `\P' and `\dag' are kept in the OMS encoding, +% so we need font substititutions from OMS/cmr to OMS/cmsy. +% \begin{macrocode} +%<*OMScmr> +\DeclareFontFamily{OMS}{cmr}{\skewchar\font48 } +\DeclareFontShape{OMS}{cmr}{m}{n}% + {<->ssub*cmsy/m/n}{} +\DeclareFontShape{OMS}{cmr}{m}{it}% + {<->ssub*cmsy/m/n}{} +\DeclareFontShape{OMS}{cmr}{m}{sl}% + {<->ssub*cmsy/m/n}{} +\DeclareFontShape{OMS}{cmr}{m}{sc}% + {<->ssub*cmsy/m/n}{} +\DeclareFontShape{OMS}{cmr}{bx}{n}% + {<->ssub*cmsy/b/n}{} +\DeclareFontShape{OMS}{cmr}{bx}{it}% + {<->ssub*cmsy/b/n}{} +\DeclareFontShape{OMS}{cmr}{bx}{sl}% + {<->ssub*cmsy/b/n}{} +\DeclareFontShape{OMS}{cmr}{bx}{sc}% + {<->ssub*cmsy/b/n}{} +% +% \end{macrocode} +% +% \subsubsection{Computer Modern large symbols} +% +% \begin{macrocode} +%<*OMXcmex> +\DeclareFontFamily{OMX}{cmex}{} +\DeclareFontShape{OMX}{cmex}{m}{n}{% + <->sfixed*cmex10% + }{} +% +% \end{macrocode} +% +% +% \subsubsection{Concrete Roman} +% +% \changes{v2.3d}{1994/07/13}{Added new concrete shapes} +% \begin{macrocode} +%<*OT1ccr> +\DeclareFontFamily{OT1}{ccr}{\hyphenchar\font45 } +\DeclareFontShape{OT1}{ccr}{m}{n}{% + <5><6><7><8><9><10>gen*ccr% + <10.95><12><14.4><17.28><20.74><24.88>ccr10}{} +\DeclareFontShape{OT1}{ccr}{m}{it}{% + <10><10.95><12>ccti10}{} +\DeclareFontShape{OT1}{ccr}{m}{sc}{% + <10><10.95><12>cccsc10}{} +\DeclareFontShape{OT1}{ccr}{m}{sl}{% + <9>ccsl9% + <10><10.95><12>ccsl10}{} +\DeclareFontShape{OT1}{ccr}{c}{sl}{<9>ccslc9}{} +% \end{macrocode} +% Finally a few substitution fonts for combinations not available. +% \changes{v2.0f}{1993/09/24}{Added substitution fonts} +% \begin{macrocode} +\DeclareFontShape{OT1}{ccr}{bx}{n}% + {<->sub*cmr/bx/n}{} +\DeclareFontShape{OT1}{ccr}{bx}{sl}% + {<->sub*cmr/bx/sl}{} +\DeclareFontShape{OT1}{ccr}{bx}{it}% + {<->sub*cmr/bx/it}{} +% +% \end{macrocode} +% +% \subsubsection{Concrete Roman math italic} +% +% \changes{v2.4d}{1995/12/01} +% {Ulrik Vieth. Add 10.95 and 12 size for ccmi10 /1989} +% \begin{macrocode} +%<*OMLccm> +\DeclareFontFamily{OML}{ccm}{\skewchar\font127 } +\DeclareFontShape{OML}{ccm}{m}{it}{% + <10><10.95><12>ccmi10}{} +% +% \end{macrocode} +% +% \subsubsection{Computer Modern Roman in \texttt{OT2} encoding} +% +% These fonts are from the University of Washington. They do not +% belong into this file but at the moment there is no other place. +% \begin{macrocode} +%<*OT2cmr> +\DeclareFontFamily{OT2}{cmr}{\hyphenchar\font45 } +\DeclareFontShape{OT2}{cmr}{m}{n}{% + <5><6><7><8><9>gen*wncyr% + <10><10.95><12><14.4><17.28><20.74><24.88>wncyr10}{} +\DeclareFontShape{OT2}{cmr}{m}{it}{% + <5><6><7><8><9>gen*wncyi% + <10><10.95><12><14.4><17.28><20.74><24.88>wncyi10}{} +\DeclareFontShape{OT2}{cmr}{m}{sc}{% + <5><6><7><8><9><10><10.95><12><14.4>% + <17.28><20.74><24.88>wncysc10}{} +%<+OT2cmr>%%%%%%%%%%%%% bold series +\DeclareFontShape{OT2}{cmr}{b}{n}{% + <5><6><7><8><9>gen*wncyb% + <10><10.95><12><14.4><17.28><20.74><24.88>wncyb10}{} +% +% \end{macrocode} +% +% \subsubsection{Computer Modern Sans in \texttt{OT2} encoding} +% +% Some more fonts from the University of Washington. +% \begin{macrocode} +%<*OT2cmss> +\DeclareFontFamily{OT2}{cmss}{\hyphenchar\font45 } +\DeclareFontShape{OT2}{cmss}{m}{n}{% + <8><9>gen*wncyss% + <10><10.95><12><14.4><17.28><20.74><24.88>wncyss10}{} +% +% \end{macrocode} +% +% The next line goes into all files and in addition prevents \dst{} +% from adding any further code from the main source file (such as a +% character table. +% \begin{macrocode} +\endinput +% \end{macrocode} +% +% \Finale +% diff --git a/Master/texmf-dist/source/latex/base/cmfonts.ins b/Master/texmf-dist/source/latex/base/cmfonts.ins new file mode 100644 index 00000000000..8c06ef303f1 --- /dev/null +++ b/Master/texmf-dist/source/latex/base/cmfonts.ins @@ -0,0 +1,113 @@ +%% +%% This file will generate fast loadable files and documentation +%% driver files from the doc files in this package when run through +%% LaTeX or TeX. +%% +%% Copyright 1993 1994 1995 1996 1997 1998 1999 2000 2001 2002 2003 2004 +%% The LaTeX3 Project and any individual authors listed elsewhere +%% in this file. +%% +%% This file is part of the LaTeX base system. +%% ------------------------------------------- +%% +%% It may be distributed and/or modified under the +%% conditions of the LaTeX Project Public License, either version 1.3 +%% of this license or (at your option) any later version. +%% The latest version of this license is in +%% http://www.latex-project.org/lppl.txt +%% and version 1.3 or later is part of all distributions of LaTeX +%% version 2003/12/01 or later. +%% +%% This file has the LPPL maintenance status "maintained". +%% +%% In particular, NO PERMISSION is granted to modify the contents of this +%% file since it contains the legal notices that are placed in the files +%% it generates. +%% +%% The list of all files belonging to the LaTeX base distribution is +%% given in the file `manifest.txt'. See also `legal.txt' for additional +%% information. +%% +%% +%% +%% +%% --------------- start of docstrip commands ------------------ +%% + +\input docstrip + +\preamble + +This is a generated file. + +Copyright 1993 1994 1995 1996 1997 1998 1999 2000 2001 2002 2003 2004 +The LaTeX3 Project and any individual authors listed elsewhere +in this file. + +This file was generated from file(s) of the LaTeX base system. +-------------------------------------------------------------- + +It may be distributed and/or modified under the +conditions of the LaTeX Project Public License, either version 1.3 +of this license or (at your option) any later version. +The latest version of this license is in + http://www.latex-project.org/lppl.txt +and version 1.3 or later is part of all distributions of LaTeX +version 2003/12/01 or later. + +This file may only be distributed together with a copy of the LaTeX +base system. You may however distribute the LaTeX base system without +such generated files. + +The list of all files belonging to the LaTeX base distribution is +given in the file `manifest.txt'. See also `legal.txt' for additional +information. + +In particular, permission is granted to customize the declarations in +this file to serve the needs of your installation. + +However, NO PERMISSION is granted to distribute a modified version +of this file under its original name. + +\endpreamble + + +\keepsilent +\usedir{tex/latex/base} + +\generate{\file{ot1cmss.fd}{\from{cmfonts.fdd}{OT1cmss}} + \file{ot1cmr.fd}{\from{cmfonts.fdd}{OT1cmr}} + \file{ot1cmtt.fd}{\from{cmfonts.fdd}{OT1cmtt,nowarn}} + \file{ot1cmvtt.fd}{\from{cmfonts.fdd}{OT1cmvtt}} + \file{ot1cmfib.fd}{\from{cmfonts.fdd}{OT1cmfib}} + \file{ot1cmfr.fd}{\from{cmfonts.fdd}{OT1cmfr}} + \file{ot1cmdh.fd}{\from{cmfonts.fdd}{OT1cmdh}}} + +\generate{\file{ucmr.fd}{\from{cmfonts.fdd}{Ucmr}} + \file{ucmss.fd}{\from{cmfonts.fdd}{Ucmss}} + \file{ucmtt.fd}{\from{cmfonts.fdd}{Ucmtt}} + \file{omlcmm.fd}{\from{cmfonts.fdd}{OMLcmm}} + \file{omscmsy.fd}{\from{cmfonts.fdd}{OMScmsy}} + \file{omxcmex.fd}{\from{cmfonts.fdd}{OMXcmex}} + \file{omlcmr.fd}{\from{cmfonts.fdd}{OMLcmr}} + \file{omscmr.fd}{\from{cmfonts.fdd}{OMScmr}} + } + + +\ifToplevel{ +\Msg{***********************************************************} +\Msg{*} +\Msg{* To finish the installation you have to move the following} +\Msg{* files into a directory searched by TeX:} +\Msg{*} +\Msg{* \space\space All *.fd} +\Msg{*} +\Msg{* To produce the documentation run the files ending with} +\Msg{* `.fdd' through LaTeX.} +\Msg{*} +\Msg{* Happy TeXing} +\Msg{***********************************************************} +} + +\endbatchfile + diff --git a/Master/texmf-dist/source/latex/base/doc.dtx b/Master/texmf-dist/source/latex/base/doc.dtx new file mode 100644 index 00000000000..cb658e0c800 --- /dev/null +++ b/Master/texmf-dist/source/latex/base/doc.dtx @@ -0,0 +1,4894 @@ +% \iffalse meta-comment +% +% Copyright 1993 1994 1995 1996 1997 1998 1999 2000 2001 2002 2003 2004 +% The LaTeX3 Project and any individual authors listed elsewhere +% in this file. +% +% This file is part of the LaTeX base system. +% ------------------------------------------- +% +% It may be distributed and/or modified under the +% conditions of the LaTeX Project Public License, either version 1.3 +% of this license or (at your option) any later version. +% The latest version of this license is in +% http://www.latex-project.org/lppl.txt +% and version 1.3 or later is part of all distributions of LaTeX +% version 2003/12/01 or later. +% +% This file has the LPPL maintenance status "maintained". +% +% The list of all files belonging to the LaTeX base distribution is +% given in the file `manifest.txt'. See also `legal.txt' for additional +% information. +% +% The list of derived (unpacked) files belonging to the distribution +% and covered by LPPL is defined by the unpacking scripts (with +% extension .ins) which are part of the distribution. +% +% \fi +% ^^A -*-LaTeX-*- +% +% ^^A These shouldn't come out in .ist files, hence the module +% ^^A comments, or in the printed version, hence temporary comment +% ^^A category for `<' +%\catcode`\<=14 +%<+package|shortvrb>\NeedsTeXFormat{LaTeX2e}[1994/12/01] +%<+package> \ProvidesPackage{doc} +%<+shortvrb>\ProvidesPackage{shortvrb} +%<+package|shortvrb> [2004/02/09 v2.1b +%<+package|shortvrb> Standard LaTeX documentation package (FMi)] +%\catcode`\<=12 +% +% \CheckSum{2171} +%% \CharacterTable +%% {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 +%% 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 +%% Digits \0\1\2\3\4\5\6\7\8\9 +%% Exclamation \! Double quote \" Hash (number) \# +%% Dollar \$ Percent \% Ampersand \& +%% Acute accent \' Left paren \( Right paren \) +%% Asterisk \* Plus \+ Comma \, +%% Minus \- Point \. Solidus \/ +%% Colon \: Semicolon \; Less than \< +%% Equals \= Greater than \> Question mark \? +%% Commercial at \@ Left bracket \[ Backslash \\ +%% Right bracket \] Circumflex \^ Underscore \_ +%% Grave accent \` Left brace \{ Vertical bar \| +%% Right brace \} Tilde \~} +%% +%\iffalse This is a METACOMMENT +% Everything up to the next `\ fi' (without a blank) will +% be ignored. This is necessary because `%' may no longer +% be a comment mark when this file is read in. +% +% +%% Package `doc' to use with LaTeX 2e +%% Copyright (C) 1989-1999 Frank Mittelbach, all rights reserved. +% +% +% Version: Date: Changes: +% +% 1.0a 5.5.88 This is nothing but a collection of tests and +% hacks. It is certainly going to be greatly +% changed. +% Better not to use it! +% 1.5a and earlier... are not longer recorded +% 1.5b and higher... are documented with the (undocumented) \changes +% feature. +%\fi +% \changes{v1.5f}{1989/4/29}{Thanks to Brian who documented the +% \cs{changes} macro feature.} +% \changes{v1.5g}{1989/5/07}{MacroTopsep now called MacrocodeTopsep and +% new MacroTopsep added} +% \changes{v1.5h}{1989/05/17}{All lines shortened to <72 characters} +% \changes{v1.5j}{1989/06/09}{Corrections by Ron Whitney added} +% \changes{v1.5q}{1989/11/03}{`\ldots{}Listing macros renamed to +% `\ldots{}Input. Suggested by R. Wonneberger} +% \changes{v1.5w}{1990/02/05}{Counter codelineno renamed to CodelineNo} +% \changes{v1.9a}{1993/12/02}{Upgrade for LaTeX2e} +% \changes{v1.9d}{1993/12/20}{Protected changes entry.} +% \changes{v1.0p}{1994/05/21}{Use new error commands} +% +% +% \hyphenation{make-index} +% +% \DoNotIndex{\@,\@@par,\@beginparpenalty,\@empty} +% \DoNotIndex{\@flushglue,\@gobble,\@input} +% \DoNotIndex{\@makefnmark,\@makeother,\@maketitle} +% \DoNotIndex{\@namedef,\@ne,\@spaces,\@tempa} +% \DoNotIndex{\@tempb,\@tempswafalse,\@tempswatrue} +% \DoNotIndex{\@thanks,\@thefnmark,\@topnum} +% \DoNotIndex{\@@,\@elt,\@forloop,\@fortmp,\@gtempa,\@totalleftmargin} +% \DoNotIndex{\",\/,\@ifundefined,\@nil,\@verbatim,\@vobeyspaces} +% \DoNotIndex{\|,\~,\ ,\active,\advance,\aftergroup,\begingroup,\bgroup} +% \DoNotIndex{\mathcal,\csname,\def,\documentstyle,\dospecials,\edef} +% \DoNotIndex{\egroup} +% \DoNotIndex{\else,\endcsname,\endgroup,\endinput,\endtrivlist} +% \DoNotIndex{\expandafter,\fi,\fnsymbol,\futurelet,\gdef,\global} +% \DoNotIndex{\hbox,\hss,\if,\if@inlabel,\if@tempswa,\if@twocolumn} +% \DoNotIndex{\ifcase} +% \DoNotIndex{\ifcat,\iffalse,\ifx,\ignorespaces,\index,\input,\item} +% \DoNotIndex{\jobname,\kern,\leavevmode,\leftskip,\let,\llap,\lower} +% \DoNotIndex{\m@ne,\next,\newpage,\nobreak,\noexpand,\nonfrenchspacing} +% \DoNotIndex{\obeylines,\or,\protect,\raggedleft,\rightskip,\rm,\sc} +% \DoNotIndex{\setbox,\setcounter,\small,\space,\string,\strut} +% \DoNotIndex{\strutbox} +% \DoNotIndex{\thefootnote,\thispagestyle,\topmargin,\trivlist,\tt} +% \DoNotIndex{\twocolumn,\typeout,\vss,\vtop,\xdef,\z@} +% \DoNotIndex{\,,\@bsphack,\@esphack,\@noligs,\@vobeyspaces,\@xverbatim} +% \DoNotIndex{\`,\catcode,\end,\escapechar,\frenchspacing,\glossary} +% \DoNotIndex{\hangindent,\hfil,\hfill,\hskip,\hspace,\ht,\it,\langle} +% \DoNotIndex{\leaders,\long,\makelabel,\marginpar,\markboth,\mathcode} +% \DoNotIndex{\mathsurround,\mbox,\newcount,\newdimen,\newskip} +% \DoNotIndex{\nopagebreak} +% \DoNotIndex{\parfillskip,\parindent,\parskip,\penalty,\raise,\rangle} +% \DoNotIndex{\section,\setlength,\TeX,\topsep,\underline,\unskip,\verb} +% \DoNotIndex{\vskip,\vspace,\widetilde,\\,\%,\@date,\@defpar} +% \DoNotIndex{\[,\{,\},\]} +% \DoNotIndex{\count@,\ifnum,\loop,\today,\uppercase,\uccode} +% \DoNotIndex{\baselineskip,\begin,\tw@} +% \DoNotIndex{\a,\b,\c,\d,\e,\f,\g,\h,\i,\j,\k,\l,\m,\n,\o,\p,\q} +% \DoNotIndex{\r,\s,\t,\u,\v,\w,\x,\y,\z,\A,\B,\C,\D,\E,\F,\G,\H} +% \DoNotIndex{\I,\J,\K,\L,\M,\N,\O,\P,\Q,\R,\S,\T,\U,\V,\W,\X,\Y,\Z} +% \DoNotIndex{\1,\2,\3,\4,\5,\6,\7,\8,\9,\0} +% \DoNotIndex{\!,\#,\$,\&,\',\(,\),\+,\.,\:,\;,\<,\=,\>,\?,\_} +% \DoNotIndex{\discretionary,\immediate,\makeatletter,\makeatother} +% \DoNotIndex{\meaning,\newenvironment,\par,\relax,\renewenvironment} +% \DoNotIndex{\repeat,\scriptsize,\selectfont,\the,\undefined} +% \DoNotIndex{\arabic,\do,\makeindex,\null,\number,\show,\write,\@ehc} +% \DoNotIndex{\@author,\@ehc,\@ifstar,\@sanitize,\@title,\everypar} +% \DoNotIndex{\if@minipage,\if@restonecol,\ifeof,\ifmmode} +% \DoNotIndex{\lccode,\newtoks,\onecolumn,\openin,\p@,\SelfDocumenting} +% \DoNotIndex{\settowidth,\@resetonecoltrue,\@resetonecolfalse,\bf} +% \DoNotIndex{\clearpage,\closein,\lowercase,\@inlabelfalse} +% \DoNotIndex{\selectfont,\mathcode,\newmathalphabet,\rmdefault} +% \DoNotIndex{\bfdefault} +% +% \MakeShortVerb{\"} +% \setcounter{StandardModuleDepth}{1} +% +% {\catcode`\p=12 \catcode`\t=12 ^^A hack used later on to print +% \gdef\dimenvalue#1pt{$#1$pt}} ^^A a register value with a - sign +% +% \newcommand{\DOC}{\texttt{doc}} +% +% \changes{v1.9t}{1995/05/11}{Use \cs{GetFileInfo}} +% \GetFileInfo{doc.sty} +% +% \title{The \DOC{} and \texttt{shortvrb} Packages\thanks +% {This file has version number \fileversion{} dated \filedate{}.}} +% \author{Frank Mittelbach\thanks{Further commentary added at Royal +% Military College of Science by B. Hamilton Kelly; English +% translation of parts of the original German commentary +% provided by Andrew Mills; fairly substantial additions, +% particularly from \texttt{newdoc}, and +% documentation of post-v1.5q features added at v1.7a by Dave +% Love (SERC Daresbury Lab). Extraction of \texttt{shortvrb} +% package added by Joachim Schrod (TU~Darmstadt).}\\ +% Gutenberg Universit\"at Mainz} +% +% \maketitle +% +% \begin{abstract} +% This package contains the definitions that are necessary to +% format the documentation of package files. The package was +% developed in Mainz in cooperation with the Royal Military College +% of Science. This is an update which documents various changes +% and new features in \DOC{} and integrates the features of +% \textsf{newdoc}. +% \end{abstract} +% +% \newif\ifmulticols +% \IfFileExists{multicol.sty}{\multicolstrue}{} +% +% \ifmulticols +% \addtocontents{toc}{\protect\begin{multicols}{2}} +% \fi +% +% {\parskip 0pt ^^A We have to reset \parskip +% ^^A (bug in \LaTeX) +% \tableofcontents +% } +% +% \changes{v1.7a}{1992/02/25}{Miscellaneous small changes to the text} +% +% \ifmulticols +% \begin{multicols}{2}[\section*{Preface to version 1.7}] +% \else \section*{Preface to version 1.7} \fi +% +% This version of \texttt{doc.dtx} documents changes which have occurred +% since the last published version \cite{art:doc} but which have been +% present in distributed versions of \texttt{doc.sty} for some time. It +% also integrates the (undocumented) features of the distributed +% \texttt{newdoc.sty}. +% +% The following changes and additions have been made to the user +% interface since the published version~\cite{art:doc}. See +% \S\ref{sec:interface} for more details. +% \begin{description} +% \item[Driver mechanism] "\DocInput" is now used in the driver file +% to input possibly multiple independent \DOC{} files and \DOC{} no +% longer has to be the last package. "\IndexListing" is replaced +% by "\IndexInput"; +% \item[Indexing] is controlled by "\PageIndex" and "\CodelineIndex", +% one of which must be specified to produce an index---there is no +% longer a "\makeindex" in the default "\DocstyleParms"; +% \item[The \texttt{macro} environment] now takes as argument the +% macro name {\em with\/} the backslash; +% \item[Verbatim text] Newlines are now forbidden inside "\verb" and +% commands "\MakeShortVerb" and "\DeleteShortVerb" are provided for +% verbatim shorthand; +% \item[\texttt{\bslash par}] can now be used in "\DoNotIndex"; +% \item[Checksum/character table support] for ensuring the integrity +% of distributions is added; +% \item[\texttt{\bslash printindex}] becomes "\PrintIndex"; +% \item[\texttt{multicol.sty}] is no longer necessary to use \DOC{} or +% print the documentation (although it is recommended); +% \item[`Docstrip' modules] are recognised and formatted specially. +% \end{description} +% +% As well as adding some completely new stuff, +% the opportunity has been taken to add some commentary to the code +% formerly in \texttt{newdoc.sty} and that added after version 1.5k of +% \texttt{doc.sty}. Since (as noted in the sections concerned) this +% commentary wasn't written by Frank Mittelbach but the code was, it is +% probably {\em not\/} true in this case that ``if the code and +% comments disagree both are probably wrong''! +% +% \subsection*{Bugs} +% +% There are some known bugs in this version: +% \begin{itemize} +% \item The "\DoNotIndex" command doesn't work for some single +% character commands most noticeable "\%". +% \item The `General changes' glossary entry would come out after +% macro names with a leading "!" and possibly a leading |"|; +% \item If you have an old version of \textsf{makeindex} long "\changes" +% entries will come out strangely and you may find the section +% header amalgamated with the first changes entry. Try to get an +% up-to-date one (see p.~\pageref{makeindex:version}); +% \item Because the accompanying \textsf{makeindex} style files support +% the inconsistent attribute specifications of older and newer +% versions \textsf{makeindex} always complains about three `unknown +% specifier's when sorting the index and changes entries. +% \item If "\MakeShortVerb" and "\DeleteShortVerb" are used with +% single character arguments, e.g., "{|}" instead of "{\|}" chaos +% may happen. +% \end{itemize} +% (Some `features' are documented below.) +% +% \subsection*{Wish list} +% +% \begin{itemize} +% \item Hooks to allow "\DescribeMacro" and "\DescribeEnv" to write +% out to a special file information about the package's `exported' +% definitions which they describe. This could subsequently be +% included in the \texttt{docstrip}ped \texttt{.sty} file in a +% suitable form for use by smart editors in command completion, +% spelling checking etc., based on the packages used in a document. +% This would need agreement on a `suitable form'. \item Indexing of +% the modules used in \texttt{docstrip}'s "%<" directives. I'm not +% sure how to index directives containing module combinations; \item +% Writing out bibliographic information about the package; \item Allow +% turning off use of the special font for, say, the next guarded +% block. +% \end{itemize} +% +% \ifmulticols +% \end{multicols} +% +% \begin{multicols}{2}[\medskip \rule{\textwidth}{.3pt} +% \section{Introduction}] +% \else +% \section{Introduction} +% \fi +% +% The \TeX{} macros which are described here allow definitions and +% documentation to be held in one and the same file. This has the +% advantage that normally very complicated instructions are made +% simpler to understand by comments inside the definition. In addition +% to this, updates are easier and only one source file needs to be +% changed. On the other hand, because of this, the package files are +% considerably longer: thus \TeX{} takes longer to load them. If this +% is a problem, there is an easy remedy: one needs only to run the +% \texttt{docstrip.tex} program that removes nearly all lines that begin +% with a +% percent sign. +% +% The idea of integrated documentation was born with the development +% of the \TeX{} program; it was crystallized in Pascal with the \Web{} +% system. The advantages of this method are plain to see (it's easy +% to make comparisons \cite{art:Knuthliterat}). Since this +% development, systems similar to \Web{} have been developed for other +% programming languages. But for one of the most complicated +% programming languages (\TeX) the documentation has however been +% neglected. The \TeX{} world seems to be divided between:--- +% \begin{itemize} \item a couple of ``wizards'', who produce many +% lines of completely unreadable code ``off the cuff'', and \item many +% users who are amazed that it works just how they want it to do. Or +% rather, who despair that certain macros refuse to do what is +% expected of them.\end{itemize} +% +% I do not think that the \Web{} system is {\em the\/} reference work; +% on the contrary, it is a prototype which suffices for the +% development of programs within the \TeX{} world. It is sufficient, +% but not totally sufficient.\footnote{I know that this will be seen +% differently by a few people, but this product should not be seen as +% the finished product, at least as far as applications concerning +% \TeX{} are concerned. The long-standing debate over `multiple +% change files' shows this well.} As a result of \Web, new programming +% perspectives have been demonstrated; unfortunately, though, they +% haven't been developed further for other programming languages. +% +% The method of documentation of \TeX{} macros which I have introduced +% here should also only be taken as a first sketch. It is designed +% explicitly to run under \LaTeX{} alone. Not because I was of the +% opinion that this was the best starting point, but because from this +% starting point it was the quickest to develop.\footnote{This +% argument is a bad one, however, it is all too often trotted out.} As +% a result of this design decision, I had to move away from the +% concept of modularization; this was certainly a step backward. +% +% I would be happy if this article could spark off discussion over +% \TeX\ documentation. I can only advise anyone who thinks that they +% can cope without documentation to ``Stop Time'' until he or she +% completely understands the \AmSTeX{} source code. +% +% +% +% +% +% \subsection{Using the \DOC{} package} +% +% Just like any other package, invoke it by requesting it with a +% |\usepackage| command in the preamble. \textsf{Doc}'s use of +% |\reversemarginpars| may make it incompatible with some classes. +% \changes{v1.7a}{1992/02/25}{Altered usage info} +% +% +% \ifmulticols\end{multicols}\fi +% +% +% \section{The User Interface}\label{sec:interface} +% \subsection{The driver file} +% +% If one is going to document a set of macros with the \DOC{} +% package one has to prepare a special driver file which produces the +% formatted document. This driver file has the following +% characteristics: +% +% \noindent |\documentclass[|\meta{options}]^^A +% |{|\meta{document-class}|}|\\[1pt] +% |\usepackage{doc}|\\[3pt] +% \hspace*{10pt}\meta{preamble}\\[3pt] +% |\begin{document}|\\[3pt] +% \hspace*{10pt}\meta{special input commands}\\[3pt] +% |\end{document}| +% +% The \meta{document-class} might be any document class, I normally +% use \texttt{article}. +% +% In the \meta{preamble} one should place declarations which +% manipulate the behavior of the \DOC{} package like +% |\DisableCrossrefs| or |\OnlyDescription|. +% +% \DescribeMacro\DocInput \DescribeMacro\IndexInput +% Finally the \meta{special input commands} part should contain one or +% more |\DocInput|\meta{file name} and/or +% |\IndexInput|\meta{file name} commands. The +% |\DocInput| command is used for files prepared for the +% \DOC{} package whereas |\IndexInput| can be used for all kinds of +% macro files. See page \pageref{..Input} for more details of +% "\IndexInput". Multiple "\DocInput"s can be used with a +% number of included files which are each self-contained +% self-documenting packages---for instance, each containing +% "\maketitle". +% +% As an example, the driver file for the \DOC{} package itself is +% the following text surrounded by "%<*driver>" and "%". +% To produce the documentation you can simply run the \texttt{.dtx} +% file through \LaTeX{} in which case this code will be executed +% (loading the document class \texttt{ltxdoc}, etc.) or you can +% extract this into a separate file by using +% the \texttt{docstrip} program. +% The line numbers below are added by +% \DOC{}'s formatting. +% Note that the class \textsf{ltxdoc} has the \DOC{} package +% preloaded. +% \changes{v1.7a}{1992/03/06}{Added +% docstrip-derivable driver file as example.} +% \changes{v1.7c}{1992/04/01}{Expurgated ltugboat.sty from driver.} +% \begin{macrocode} +%<*driver> +\documentclass{ltxdoc} +\EnableCrossrefs + %\DisableCrossrefs % Say \DisableCrossrefs if index is ready +\CodelineIndex +\RecordChanges % Gather update information + %\OnlyDescription % comment out for implementation details + %\OldMakeindex % use if your MakeIndex is pre-v2.9 +\setlength\hfuzz{15pt} % dont make so many +\hbadness=7000 % over and under full box warnings +\begin{document} + \DocInput{doc.dtx} +\end{document} +% +% \end{macrocode} +% +% +% \subsection{General conventions} +% +% A \TeX{} file prepared to be used with the `doc' package +% consists of `documentation parts' intermixed with `definition +% parts'. +% +% Every line of a `documentation part' starts with a percent sign +% (|%|) in column one. It may contain arbitrary \TeX{} or +% \LaTeX{} commands except that the character `|%|' cannot be +% used as a comment character. +% \SortIndex{\string^\string^A}{\string\verb\verbatimchar +% \string^\string^A\verbatimchar \encapchar usage} To allow user +% comments, the |^^A| character is defined as a comment character +% later on. Such `metacomments' may be also be included simply by +% surrounding them with "\iffalse" \ldots~"\fi". +% +% All other parts of the file are called `definition parts'. They +% contain fractions of the macros described in the `documentation +% parts'. +% +% If the file is used to define new macros (e.g.\ as a package file in +% the |\usepackage| macro), the `documentation parts' are +% bypassed at high speed and the macro definitions are pasted +% together, even if they are split into several `definition parts'. +% +% \DescribeEnv{macrocode} +% On the other hand, if the documentation of these macros is to be +% produced, the `definition parts' should be typeset verbatim. To +% achieve this, these parts are surrounded by the \textsf{macrocode} +% environment. +% More exactly: before a `definition part' there should be a line +% containing\\ +% \hspace*{\MacroIndent}\verb*+% \begin{macrocode}+\\ +% and after this part a line\\ +% \hspace*{\MacroIndent}\verb*+% \end{macrocode}+\\ +% There must be {\em exactly\/} four spaces between the |%| +% and |\end{macrocode}| --- \TeX{} is looking for this string +% and not for the macro while processing a `definition part'. +% +% Inside a `definition part' all \TeX{} commands are allowed; even the +% percent sign could be used to suppress unwanted spaces etc. +% +% \DescribeEnv{macrocode*} Instead of the \textsf{macrocode} +% environment one can also use the \textsf{macrocode$*$} environment +% which produces the same results except that spaces are printed as +% \nopagebreak\verb*+ + characters. +% +% +% +% \subsection{Describing the usage of new macros} +% +% \DescribeMacro\DescribeMacro +% When you describe a new macro you may use |\DescribeMacro| to +% indicate that at this point the usage of a specific macro is +% explained. It takes one argument which will be printed in the margin +% and also produces a special index entry. For example, I used +% |\DescribeMacro{\DescribeMacro}| to make clear that this is the +% point where the usage of |\DescribeMacro| is explained. +% +% \DescribeMacro\DescribeEnv +% An analogous macro |\DescribeEnv| should be used to indicate +% that a \LaTeX{} environment is explained. It will produce a somewhat +% different index entry. Below I used |\DescribeEnv{verbatim}|. +% +% \DescribeEnv{verbatim} +% It is often a good idea to include examples of the usage of new macros +% in the text. Because of the |%| sign in the first column of every +% row, the \textsf{verbatim} environment is slightly altered to suppress +% those +% characters.\footnote{These macros were written by Rainer +% Sch\"opf~\cite{art:verbatim}. He also +% provided a new \textsf{verbatim} environment +% which can be used inside of other macros.} +% \DescribeEnv{verbatim*} +% The \textsf{verbatim$*$} environment is changed in the same way. +% \changes{v1.7a}{1992/02/26}{Documented \cs{verb} change.} +% \DescribeMacro\verb +% The "\verb" command is re-implemented to give an error report if a +% newline appears in its argument. +% The \textsf{verbatim} and \textsf{verbatim$*$} environments set text +% in the style defined by "\MacroFont"~(\S\ref{sec:macrofont}). +% +% +% +% \subsection{Describing the definition of new macros} +% +% \DescribeEnv{macro} +% To describe the definition of a new macro we use the \textsf{macro} +% environment. It has one argument: the name of the new +% macro.\footnote{This is a change to the style design I described in +% ^^A \TUB ^^A removed in case ltugboat.sty not used +% \textsl{TUGboat\/}\ 10\#1 (Jan.~89). We finally decided +% that it would +% be better to use the macro name {\em with\/} the +% backslash as an argument.} +% This argument is also used to print the name in the margin and to +% produce an index entry. +% Actually the index entries for usage and definition are different to +% allow an easy reference. +% This environment might be nested. In this case the +% labels in the margin are placed under each other. +% \changes{v1.7a}{1992/02/26}{Note on need for some text in macro env.} +% There should be some text---even if it's just an empty +% "\mbox{}"---in this environment before "\begin{macrocode}" or the +% marginal label won't print in the right place. +% +% \DescribeMacro\MacrocodeTopsep +% \DescribeMacro\MacroTopsep +% There also exist four style parameters: |\MacrocodeTopsep| and +% |\MacroTopsep| are used to control the vertical spacing above +% and below the \textsf{macrocode} and the \textsf{macro} +% \DescribeMacro\MacroIndent +% environment, |\MacroIndent| is used to indent the lines of code +% and +% \DescribeMacro\MacroFont \label{sec:macrofont} +% |\MacroFont| holds the font and a possible size change command +% for the code lines, the "verbatim"["*"] environment and the macro +% names printed in the margin. If you want +% to change their default values in a +% class file (like \texttt{ltugboat.cls}) use the |\DocstyleParms| +% command described below. Starting with release 2.0a it can now +% be changed directly as long as the redefinition happens before +% the |\begin{document}|. +% +% +% +% +% \subsection{Formatting the margins} +% +% \DescribeMacro\PrintDescribeMacro +% \DescribeMacro\PrintDescribeEnv +% \DescribeMacro\PrintMacroName +% \DescribeMacro\PrintEnvName +% As mentioned earlier, some macros and the \textsf{macro} environment +% print their arguments in the margin. This is actually done by four +% macros which are user +% definable.\footnote{You may place the changed definitions in a +% separate package +% file or at the beginning of the documentation +% file. +% For example, if you don't like any names in the +% margin +% but want a fine index you can simply +% \texttt{\bslash let} +% these macros equal \texttt{\bslash @gobble}. +% The doc package won't redefine any existing +% definitions of these macros.} +% They are named |\PrintDescribeMacro|, |\PrintDescribeEnv|, +% |\PrintMacroName| (called by the \textsf{macro} environment) and +% |\PrintEnvName| (called by the \textsf{environment} environment). +% +% +% \subsection{Using a special escape character} +% +% \DescribeMacro\SpecialEscapechar +% If one defines complicated macros it is sometimes necessary to +% introduce a new escape character because the `|\|' has got a +% special |\catcode|. In this case one can use +% |\SpecialEscapechar| to indicate which character is actually +% used to play the r\^ole of the `|\|'. A scheme like this is +% needed because the \textsf{macrocode} environment and its counterpart +% \textsf{macrocode$*$} produce an index entry for every occurrence of a +% macro name. They would be very confused if you didn't tell them that +% you'd changed |\catcode|$\,$s. The argument to +% |\SpecialEscapechar| is a single-letter control sequence, that +% is, one has to use "\|" for example to denote that `\verb+|+' +% is used as an escape character. |\SpecialEscapechar| only +% changes the behavior of the next \textsf{macrocode} or +% \textsf{macrocode$*$} environment. +% +% The actual index entries created will all be printed with |\| +% rather than \verb+|+, but this probably reflects their usage, if not +% their definition, and anyway must be preferable to not having any +% entry at all. The entries {\em could\/} be formatted appropriately, +% but the effort is hardly worth it, and the resulting index might be +% more confusing (it would certainly be longer!). +% +% +% \subsection{Cross-referencing all macros used} +% +% \DescribeMacro\DisableCrossrefs \DescribeMacro\EnableCrossrefs As +% already mentioned, every new macro name used within a +% \textsf{macrocode} or \textsf{macrocode$*$} environment will produce +% an index entry. In this way one can easily find out where a specific +% macro is used. Since \TeX{} is considerably slower when it has to +% produce such a bulk of index entries one can turn off this feature +% by using |\DisableCrossrefs| in the driver file. To turn it on again +% just use |\EnableCrossrefs|.\footnote{Actually, \texttt{\bslash +% EnableCrossrefs} changes things more drastically; any following +% \texttt{\bslash DisableCrossrefs} which might be present in the +% source will be ignored.} +% +% +% \DescribeMacro\DoNotIndex +% But also finer control is provided. The |\DoNotIndex| macro +% takes a list of macro names separated by commas. Those names won't +% show up in the index. You might use several |\DoNotIndex| +% commands: their lists will be concatenated. In this article I used +% |\DoNotIndex| for +% all macros which are already defined in \LaTeX. +% +% All three above declarations are local to the current group. +% +% Production (or not) of the index (via the "\makeindex" commend) is +% controlled by using or omitting the following declarations in the +% driver file preamble; if neither is used, no index is produced. +% \DescribeMacro\PageIndex Using "\PageIndex" makes all index +% entries refer to their page number; with +% \DescribeMacro\CodelineIndex "\CodelineIndex", index entries +% produced by "\DescribeMacro" and "\DescribeEnv" refer to page number +% but those produced by the \textsf{macro} environment refer to the +% code lines, which will be numbered automatically.\footnote{The line +% number is actually that of the first line of the first +% \textsf{macrocode} environment in the \textsf{macro} environment.} +% \DescribeMacro\theCodelineNo +% The style of this numbering can be controlled by defining the macro +% "\theCodelineNo". Its default definition is to use scriptsize +% arabic numerals; a user-supplied definition won't be overwritten. +% +% \DescribeMacro\CodelineNumbered +% When you don't wish to get an index but want your code lines +% numbered use "\CodelineNumbered" instead of "\CodelineIndex". This +% prevents the generation of an unnecessary ".idx" file. +% +% +% \subsection{Producing the actual index entries} +% +% Several of the aforementioned macros will produce some sort of index +% entries. These entries have to be sorted by an external +% program---the current implementation assumes that the +% \textsf{makeindex} program by Chen~\cite{art:Chen} is used. +% +% But this isn't built in: one has only to redefine some of the +% following macros to be able to use any other index program. All +% macros which are installation +% dependent are defined in such a way that they won't overwrite a +% previous definition. Therefore it is safe to put the changed +% versions in a package file which might be read in before the doc +% package. +% +% To allow the user to change the specific characters recognized by +% his or her index program all characters which have special meaning +% in the \textsf{makeindex} program are given symbolic +% names.\footnote{I don't know if there exists a program which needs +% more command characters, but I hope not.} +% However, all characters used should be of |\catcode| other than +% `letter' (11). +% +% \DescribeMacro{\actualchar} +% The |\actualchar| is used to separate the `key' and the actual +% index entry. +% \DescribeMacro{\quotechar} +% The |\quotechar| is used before a special index program +% character to suppress its special meaning. +% \DescribeMacro{\encapchar} +% The |\encapchar| separates the indexing information from a +% letter string which \textsf{makeindex} uses as a \TeX{} command to +% format the page number associated with a special entry. It is used +% in this package to apply the |\main| and the |\usage| +% commands. +% \DescribeMacro{\levelchar} +% Additionally |\levelchar| is used to separate `item', +% `subitem' and `subsubitem' entries. +% +% It is a good idea to stick to these symbolic names even if you know +% which index program is used. In this way your files will be +% portable. +% +% \DescribeMacro\SpecialMainIndex +% \DescribeMacro\SpecialMainEnvIndex +% To produce a main index entry for a macro the +% |\SpecialMainIndex| macro\footnote{This macro is called by the +% \textsf{macro} environment.} may be used. It is called `special' +% because it has to print its argument verbatim. +% A similar macro, called |\SpecialMainEnvIndex| is used for indexing +% the main definition point of an +% environment.\footnote{This macro is called by the +% \textsf{environment} environment.} +% \DescribeMacro\SpecialIndex +% If you want a normal index entry for a macro name +% |\SpecialIndex| might be used.\footnote{This macro is called +% within the \textsf{macrocode} environment when encountering a macro +% name.} +% \DescribeMacro\SpecialUsageIndex +% \DescribeMacro\SpecialEnvIndex +% To index the usage of a macro or an environment +% |\SpecialUsageIndex| and |\SpecialEnvIndex| may be used. +% \DescribeMacro\SortIndex +% Additionally a |\SortIndex| command is provided. It takes two +% arguments---the sort key and the actual index entry. +% +% All these macros are normally used by other macros; you will need +% them only in an emergency. +% +% \DescribeMacro\verbatimchar +% But there is one characteristic worth mentioning: all macro names in +% the index are typeset with the |\verb*| command. Therefore one +% special character is needed to act as a delimiter for this command. +% To allow a change in this respect, again this character is +% referenced indirectly, by the macro |\verbatimchar|. It expands +% by default to \verb?+? but if your code lines contain macros with +% `\texttt{+}' characters in their names (e.g.\ when you use \verb?\+?) +% you will end up with an index entry containing \verb?\verb+\++? +% which will be typeset as `\verb+\++' and not as `\verb?\+?'. In this +% case you should redefine |\verbatimchar| globally or locally to +% overcome this problem. +% +% \DescribeMacro\* +% We also provide a |\*| macro. This is intended to be used for +% index entries like +% \begin{quote} +% index entries \\ +% \hspace*{30pt} Special macros for \* +% \end{quote} +% Such an entry might be produced with the line: +%\begin{verbatim} +% \index{index entries\levelchar Special macros for \*} +%\end{verbatim} +% +% \DescribeMacro\OldMakeindex +% Versions of \textsf{makeindex} prior to 2.9 had some bugs affecting +% \DOC{}. One of these, +% pertaining to the "%" character doesn't have a work-around +% appropriate for versions with and without the +% bug.\label{makeindex:version} If +% you have an old version, invoke "\OldMakeindex" in a +% package file or the driver file to prevent problems with index entries +% such as "\%", although you'll probably normally want to turn off +% indexing of "\%" anyway. Try to get an up-to-date \textsf{makeindex} +% from one of the \TeX{} repositories. +% +% +% \subsection{Setting the index entries} +% +% \changes{v1.7a}{1992/03/11}{Usage note on gind.ist.} After the first +% formatting pass through the \texttt{.dtx} file you need to sort the +% index entries written to the \texttt{.idx} file using +% \textsf{makeindex} or your favourite alternative. You need a +% suitable style file for \textsf{makeindex} (specified by the +% \texttt{-s} switch). A suitable one is supplied with \DOC{}, +% called \texttt{gind.ist}. +% +% \DescribeMacro\PrintIndex +% To read in and print the sorted index, just put the +% |\PrintIndex| command as the last (commented-out, and thus +% executed during the documentation pass through the file) command +% in your package file. Precede it by any bibliography commands +% necessary for your citations. +% Alternatively, it may be more convenient to put all such calls +% amongst the arguments of the |\StopEventually| macro, in +% which case a |\Finale| command should appear at the end of +% your file. +% +% \DescribeEnv{theindex} +% Contrary to standard \LaTeX, the index is typeset in three columns +% by default. This is controlled by the \LaTeX{} counter +% `\textsf{IndexColumns}' and can therefore be changed with a +% |\setcounter| declaration. Additionally one doesn't want to +% start a new page unnecessarily. Therefore the \textsf{theindex} +% environment is redefined. +% \DescribeMacro\IndexMin +% When the \textsf{theindex} environment starts it will measure how much +% space is left on the current page. If this is more than +% |\IndexMin| then the index will start on this page. Otherwise +% |\newpage| is called. +% +% Then a short introduction about the meaning of several index entries +% is typeset (still in onecolumn mode). Afterwards the actual index +% entries follow in multi-column mode. +% \DescribeMacro\IndexPrologue +% You can change this prologue with the help of the +% |\IndexPrologue| macro. Actually the section heading is also +% produced in this way, so you'd better write something like: +% \begin{verbatim} +% \IndexPrologue{\section*{Index} The index entries underlined ...} +%\end{verbatim} +% When the \textsf{theindex} environment is finished the last page will +% be reformatted to produce balanced columns. This improves the layout +% and allows the next article to start on the same page. +% \DescribeMacro\IndexParms +% Formatting of the index columns (values for |\columnssep| +% etc.)\ is controlled by the |\IndexParms| macro. It assigns the +% following values: +% \SpecialUsageIndex{\parindent}\SpecialUsageIndex{\columnsep}^^A +% \SpecialUsageIndex{\parskip}\SpecialUsageIndex{\rightskip}^^A +% \SpecialUsageIndex{\mathsurround}\SpecialUsageIndex{\parfillskip} +% \begin{center} +% \begin{tabular}{l@{\,=\,}ll@{\,=\,}l} +% |\parindent| & \IndexParms \the\parindent & +% |\columnsep| & \IndexParms \the\columnsep \\ +% |\parskip| & \IndexParms \the\parskip & +% |\rightskip| & \IndexParms +% \expandafter\dimenvalue\the\rightskip \\ +% |\mathsurround| & \IndexParms \the\mathsurround & +% |\parfillskip| & \IndexParms +% \expandafter\dimenvalue\the\parfillskip +% \end{tabular} +% \end{center} +% \DescribeMacro{\@idxitem} +% Additionally it defines |\@idxitem| (which will be used when an +% |\item| command is encountered) and selects |\small| size. +% If you want to change any of these values you have to define them +% all. +% +% \DescribeMacro\main +% \DescribeMacro\usage +% The page numbers for main index entries are encapsulated by the +% |\main| macro (underlining its argument) and the numbers +% denoting the description are encapsulated by the |\usage| macro +% (which produces {\em italics}). As usual these commands are user +% definable. +% +% +% \subsection{Changing the default values of style parameters} +% +% \DescribeMacro\DocstyleParms If you want to overwrite some default +% settings made by the \DOC{} package, you can either put your +% declarations in the driver file (that is after \texttt{doc.sty} is +% read in) or use a separate package file for doing this work. In the +% latter case you can define the macro |\DocstyleParms| to contain all +% assignments. This indirect approach is necessary if your package file +% might be read before the \texttt{doc.sty}, when some of the +% registers are not allocated. Its default definition is null. +% +% The doc package currently assigns values to the following +% registers: +% \SpecialUsageIndex{\IndexMin}\SpecialUsageIndex{\MacrocodeTopsep}^^A +% \SpecialUsageIndex{\MacroTopsep}^^A +% \SpecialUsageIndex{\MacroIndent}\SpecialUsageIndex{\marginparpush}^^A +% \SpecialUsageIndex{\marginparwidth}\SpecialUsageIndex{\tolerance} +% \begin{center} +% \begin{tabular}{l@{\,=\,}ll@{\,=\,}l} +% |\IndexMin| & \the\IndexMin & +% |\MacroTopsep| & \the\MacroTopsep \\ +% |\marginparwidth|& \the\marginparwidth & +% |\MacroIndent| & \the\MacroIndent \\ +% |\marginparpush| & \the\marginparpush & +% |\MacrocodeTopsep| & \the\MacrocodeTopsep \\ +% |\tolerance| & \the\tolerance +% \end{tabular} +% \end{center} +% +% +% \subsection{Short input of verbatim text pieces} +% +% \DescribeMacro\MakeShortVerb +% \DescribeMacro{\MakeShortVerb*} \DescribeMacro\DeleteShortVerb It is +% awkward to have to type, say, "\verb|"\ldots"|" continually when +% quoting +% verbatim bits (like macro names) in the text, so an abbreviation +% mechanism is provided. Pick a character \meta{c}---one which +% normally has catcode `other' unless you have very good reason not +% to---which you don't envisage using in the text, or not using often. +% (I like |"|, but you may prefer "|" if you have |"| active to do +% umlauts, for instance.) Then if you say +% "\MakeShortVerb{\"\meta{c}"}" you can subsequently use +% \meta{c}\meta{text}\meta{c} as the equivalent of +% "\verb"\meta{c}\meta{text}\meta{c}; analogously, the "*"-form +% "\MakeShortVerb*{\"\meta{c}"}" gives you the equivalent of +% "\verb*"\meta{c}\meta{text}\meta{c}. Use +% "\DeleteShortVerb{\"\meta{c}"}" if you subsequently want \meta{c} to +% revert to its previous meaning---you can always turn it on again +% after the unusual section. The `short verb' commands make global +% changes. The abbreviated "\verb" may not appear in the argument of +% another command just like "\verb". However the `short verb' +% character may be used freely in the \textsf{verbatim} and +% \textsf{macrocode} environments without ill effect. +% "\DeleteShortVerb" is silently ignored if its argument does not +% currently represent a short verb character. Both commands type a +% message to tell you the meaning of the character is being changed. +% +% Please remember that the command "\verb" cannot be used in arguments +% of other commands. Therefore abbreviation characters for "\verb" +% cannot be used there either. +% +% This feature is also available as a sole package, \texttt{shortvrb}. +% +% +% \subsection{Additional bells and whistles} +% +% We provide macros for logos such as \Web, \AmSTeX, \BibTeX, +% \SliTeX{} and \PlainTeX. Just type |\Web|, |\AmSTeX|, +% |\BibTeX|, |\SliTeX| or |\PlainTeX|, respectively. +% \LaTeX{} and \TeX{} are already defined in \texttt{latex.tex}. +% +% \DescribeMacro\meta +% Another useful macro is |\meta| which has one argument and +% produces something like \meta{dimen parameter}. +% +% \DescribeMacro\OnlyDescription +% \DescribeMacro\StopEventually +% You can use the |\OnlyDescription| declaration in the driver +% file to suppress the last part of your document (which presumably +% exhibits the code). To make this work +% you have to place the command |\StopEventually| at a suitable +% point in your file. This macro has one argument in which you put +% all information you want to see printed if your document ends at +% this point (for example a bibliography which is normally printed at +% the very end). When the |\OnlyDescription| declaration is +% missing the |\StopEventually| +% \DescribeMacro\Finale +% macro saves its argument in a macro called |\Finale| which can +% afterwards be used to get things back (usually at the very end). +% Such a scheme makes changes in two places unnecessary. +% +% Thus you can use this feature to produce a local guide for the +% \TeX{} users which describes only the usage of macros (most of them +% won't be interested in your definitions anyway). For the same +% reason the |\maketitle| \DescribeMacro\maketitle command is slightly +% changed to allow multiple titles in one document. So you can make +% one driver file reading in several articles at once. +% \DescribeMacro{\ps@titlepage} To avoid an unwanted +% \textsf{pagestyle} on the title page the |\maketitle| command issues +% a |\thispagestyle{titlepage}| declaration which produces a +% \textsf{plain} page if the \textsf{titlepage} page style is +% undefined. This allows class files like \textsf{ltugboat.cls} to +% define their own page styles for title pages. +% +% \DescribeMacro\AlsoImplementation +% Typesetting the whole document is the default. However, this default +% can also be explicitly selected using the declaration +% |\AlsoImplementation|. This overwrites any previous +% |\OnlyDescription| declaration. The \LaTeXe{} distribution, for +% example, is documented using the \texttt{ltxdoc} class which allows +% for a configuration file \texttt{ltxdoc.cfg}. In such a file one +% could then add the statement +% \begin{quote} +% |\AtBeginDocument{\AlsoImplementation}| +% \end{quote} +% to make sure that all documents will show the code part. +% +% \DescribeMacro\IndexInput \label{..Input} Last but not least I +% defined an |\IndexInput| macro which takes a file name as an +% argument and produces a verbatim listing of the file, indexing every +% command as it goes along. This might be handy, if you want to learn +% something about macros without enough documentation. I used this +% feature to cross-reference \texttt{latex.tex} getting a verbatim +% copy with about 15 pages index.\footnote{It took quite a long time +% and the resulting \texttt{.idx} file was longer than the +% \texttt{.dvi} file. Actually too long to be handled by the +% \textsf{makeindex} program directly (on our MicroVAX) but the final +% result was worth the trouble.} +% +% \DescribeMacro\changes +% To maintain a change history within the file, the |\changes| +% command may be placed amongst the description part of the changed +% code. It takes three arguments, thus: +% \begin{quote} +% |\changes{|\meta{version}|}{|\meta{date}|}{|^^A +% \meta{text}|}| +% \end{quote} +% The changes may be used to produce an auxiliary file (\LaTeX's +% |\glossary| mechanism is used for this) which may be printed +% after suitable formatting. The |\changes| macro encloses the +% \meta{date} in parentheses and appends the \meta{text} to form the +% printed entry in such a change history; because old +% versions\footnote{Before 2.6.} of the \textsf{makeindex} +% program limit such fields to 64 characters, care should be taken +% not to exceed this limit when describing the change. When +% referring to macros in change descriptions it is conventional to use +% "`"\meta{macroname} rather than attempting to format it properly and +% using up valuable characters in the entry with old \textsf{makeindex} +% versions. +% +% \changes{v1.7a}{1992/02/26}{Description of \cs{RecordChanges} etc. +% added +% to interface section.} \DescribeMacro\RecordChanges To cause the +% change information to be written out, include "\RecordChanges" in +% the driver file. \DescribeMacro\PrintChanges To read in and print +% the sorted change history (in two columns), just put the +% |\PrintChanges| command as the last (commented-out, and thus +% executed during the documentation pass through the file) command in +% your package file. Alternatively, this command may form one of the +% arguments of the |\StopEventually| command, although a change +% history is probably {\em not\/} required if only the description is +% being printed. The command assumes that \textsf{makeindex} or some +% other program has processed the \texttt{.glo} file to generate a +% sorted \texttt{.gls} file. You need a special \textsf{makeindex} +% style file; a suitable one is supplied with \DOC{}, called +% \texttt{gglo.ist}. \DescribeMacro\GlossaryMin +% \DescribeMacro\GlossaryPrologue \DescribeMacro\GlossaryParms The +% "\GlossaryMin", "\GlossaryPrologue" and "\GlossaryParms" macros are +% analagous to the "\Index"\ldots\ versions. (The \LaTeX{} `glossary' +% mechanism is used for the change entries.) +% +% \label{sec:checksum} +% \DescribeMacro\CharacterTable +% \DescribeMacro\CheckSum +% To overcome some of the problems of sending files over the networks +% we developed two macros which should detect corrupted files. If one +% places the lines +% \begin{flushleft} +% \small\ttfamily ^^A \ttfamily to get the blanks between "..."s +% ^^A right +%"%%\CharacterTable"\\ +%"%% {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"\\ +%"%% 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"\\ +%"%% Digits \0\1\2\3\4\5\6\7\8\9"\\ +%"%% Exclamation \! Double quote "\verb=\"= +%" Hash (number) \#"\\ +%"%% Dollar \$ Percent \% Ampersand \&"\\ +%"%% Acute accent \' Left paren \( Right paren \)"\\ +%"%% Asterisk \* Plus \+ Comma \,"\\ +%"%% Minus \- Point \. Solidus \/"\\ +%"%% Colon \: Semicolon \; Less than \<"\\ +%"%% Equals \= Greater than \> Question mark \?"\\ +%"%% Commercial at \@ Left bracket \[ Backslash \\"\\ +%"%% Right bracket \] Circumflex \^ Underscore \_"\\ +%"%% Grave accent \` Left brace \{ Vertical bar \|"\\ +%"%% Right brace \} Tilde \~}"\\ +%"%%" +%\end{flushleft} +% at the beginning of the file then character translation failures +% will be detected, provided of course, that the used \DOC{} +% package has a correct default table. The percent +% signs\footnote{There are two percent signs in each line. This has +% the effect that these lines are not removed by the +% \texttt{docstrip.tex} program.} at the beginning of the lines should +% be typed in, since only the \DOC{} package should look at this +% command. +% +% Another problem of mailing files is possible truncation. To detect +% these sort of errors we provide a |\CheckSum| macro. The check-sum +% of a file is simply the number of backslashes in the code, i.e.\ all +% lines between the \textsf{macrocode} environments. But don't be +% afraid: you don't have count the code-lines yourself; this is done +% by the \DOC{} package for you. You simply have to use +% the |\StopEventually| (which starts looking for backslashes) and the +% |\Finale| command. The latter will inform you either that your file +% has no check-sum (telling you the right number) or that your number +% is incorrect (this time telling you both the correct and the +% incorrect one). Then you go to the top of your file inserting the +% line +% \begin{quote} +% |%% \CheckSum{|\meta{number}|}| +% \end{quote} +% and that's all. If you precede it only with one percent then the +% line will not show up in \texttt{docstrip} versions of the file. +% You should do so whenever you are using conditional code (see +% \texttt{docstrip} documentation) since then the check-sum will not +% reflect the number of backslashes in the stripped of versions. +% +% \DescribeMacro\bslash +% From time to time, it is necessary to print a |\| without +% being able to use the |\verb| command because the +% |\catcode|$\,$s of the symbols are already firmly +% established. In this instance we can use the command +% |\bslash| presupposing, of course, that the actual font in +% use at this point contains a `backslash' as a symbol. Note that +% this definition of |\bslash| is expandable; it inserts a +% $"\"_{12}$. This means that you have to |\protect| +% it if it is used in `moving arguments'. +% +% \DescribeMacro\MakePrivateLetters +% \changes{v1.7a}{1992/02/26}{Documented \cs{MakePrivateLetters} in +% interface section}^^A +% If your macros "\catcode" anything other than "@" to `letter', you +% should redefine "\MakePrivateLetters" so that it also makes the +% relevant characters `letters' for the benefit of the indexing. The +% default definition is just "\makeatletter". +% +% \DescribeMacro\DontCheckModules \DescribeMacro\CheckModules +% \DescribeMacro\Module \DescribeMacro\AltMacroFont The `module' +% directives of the \textsf{docstrip} system \cite{art:docstrip} are +% normally recognised and invoke special formatting. This can be +% turned on and off in the \texttt{.dtx} file or the driver file using +% "\CheckModules" and "\DontCheckModules". If checking for module +% directives is on (the default) then code in the scope of the +% directives is set as determined by the hook "\AltMacroFont", which +% gives {\small\ttfamily\itshape small italic type\-writer\/} by +% default in the New Font Selection Scheme but just ordinary +% {\small\ttfamily small type\-writer} in the old one, where a font +% such as italic typewriter can't be used portably (plug for NFSS); +% you will need to override this if you don't have the italic +% typewriter font available. Code is in such a scope if it's on a +% line beginning with "%<" or is between lines starting with +% "%<*"\meta{name list}">" and "%". The +% directive is formatted by the macro "\Module" whose single argument +% is the text of the directive between, but not including, the angle +% brackets; this macro may be re-defined in the driver or package file +% and by default produces results like \Module{+foo\string|bar} with no +% following space. +% +% \DescribeMacro{StandardModuleDepth} Sometimes (as in this file) the +% whole code is surrounded by modules to produce several files from a +% single source. In this case it is clearly not appropriate to format +% all code lines in a special "\AltMacroFont". For this reason a +% counter "StandardModuleDepth" is provided which defines the level of +% module nesting which is still supposed to be formatted in +% "\MacroFont" rather then "\AltMacroFont". The default setting is +% "0", for this documentation it was set to +%\begin{verbatim} +% \setcounter{StandardModuleDepth}{1} +%\end{verbatim} +% at the beginning of the file. +% +% +% \subsection{Basic usage summary} +% \changes{v1.7a}{1992/03/11}{Added basic usage summary to spell +% it out.} +% +% To sum up, the basic structure of a \texttt{.dtx} file without any +% refinements is like this: +% \begin{verse}\small +% "% "\meta{waffle}\ldots\\ +% \quad\ldots \\ +% "% \DescribeMacro{\fred}"\\ +% "% "\meta{description of fred's use}\\ +% \quad\ldots\\ +% "% \StopEventually{"\meta{finale code}"}"\\ +% \quad\ldots\\ +% "% \begin{macro}{\fred}"\\ +% "% "\meta{commentary on macro fred}\\ +% \verb*+% \begin{macrocode}+\\ +% \meta{code for macro fred}\\ +% \verb*+% \end{macrocode}+\\ +% "% \end{macro}"\\ +% \quad\ldots\\ +% "% \Finale \PrintIndex \PrintChanges" +% \end{verse} +% For examples of the use of most---if not all---of the features +% described above consult the \texttt{doc.dtx} source itself. +% +% \subsection{Acknowledgements} +% +% I would like to thank all folks at Mainz and at the Royal Military +% College of Science for their help in this project. Especially Brian +% and Rainer who pushed everything with their suggestions, bug fixes, +% etc. +% +% A big thank you to David Love who brought the documentation +% up-to-date again, after I neglected this file for more than two +% years. This was most certainly a tough job as many features added to +% \texttt{doc.dtx} after its publication in \textsl{TUGboat\/} have +% been never properly described. Beside this splendid work he kindly +% provided additional code (like ``docstrip'' module formatting) which +% I think every \textsf{doc.dtx} user will be grateful for. +% +% +% \StopEventually{ +% \begin{thebibliography}{1} +% \bibitem{book:Buerger} \textsc{G. A. B\"urger}. +% \newblock Wunderbare Reisen zu Wasser und zu Lande, Feldz\"uge +% und lustige Abenteuer des Freyherrn v.\ M\"unchhausen. +% \newblock London, 1786 \& 1788. +% \bibitem{art:Knuthliterat} \textsc{D. E. Knuth}. +% \newblock Literate Programming. +% \newblock Computer Journal, Vol.~27, \textit{pp}.~97--111, +% May 1984. +% \bibitem{book:KnuthA} \textsc{D. E. Knuth}. +% \newblock Computers \& Typesetting (The \TeX book). +% \newblock Addison-Wesley, Vol. A, 1986. +% \bibitem{art:Chen} \textsc{L. Lamport}. +% \newblock MakeIndex: An Index Processor for \LaTeX. +% \newblock 17 February 1987. +% \newblock (Taken from the file \texttt{makeindex.tex} provided +% with +% the program source code.) +% \bibitem{art:doc} \textsc{Frank Mittelbach}. +% \newblock The \DOC{}-option. +% \newblock \textsl{TUGboat}, Vol.~10(2), \textit{pp}.~245--273, +% July 1989. +% \bibitem{art:docstrip} \textsc{Frank Mittelbach, Denys Duchier and +% Johannes Braams}. +% \newblock \texttt{docstrip.dtx} (to appear). +% \newblock The file is part of the DOC package. +% \bibitem{book:Raspe} \textsc{R. E. Raspe} (*1737, \dag 1797). +% \newblock Baron M\"unchhausens narrative of his marvellous +% travels and campaigns in Russia. +% \newblock Oxford, 1785. +% \bibitem{art:verbatim} \textsc{Rainer Sch\"opf}. +% \newblock A New Implementation of \LaTeX's \texttt{verbatim} and +% \texttt{verbatim*} Environments. +% \newblock File \texttt{verbatim.doc}, version 1.4i. +% \end{thebibliography} +% ^^A\PrintIndex +% ^^A\PrintChanges +% +% \ifmulticols +% \addtocontents{toc}{\protect\end{multicols}} +% \fi +% +% } ^^A end \StopEventually +% +% +% \section{The Description of Macros} +% +% Most of the following code is destined for \texttt{doc.sty} after +% processing with \texttt{docstrip} to include the module +% \textbf{style} indicated here. (All code in this file not +% appropriate to \texttt{doc.sty} has to be included explicitly by +% docstrip so that this \texttt{.dtx} file can be used as directly as +% a package file rather than the stripped version.) The usual font +% change for the conditionally-included lines between the +% \Module{*style} and \Module{/style} directives is suppressed since +% only the lines with an explicit directive are special in this file. +% \begin{macrocode} +%<*package> +% \end{macrocode} +% Under \LaTeXe{} the test to avoid reading +% \DOC{} in twice is normally unnecessary. It was kept to only to +% stay compatible with \LaTeX209 styles that |\input| \DOC{} +% directly. +% \changes{v1.5i}{1989/06/07}{Avoid reading the file twice.} +% \begin{macrocode} +\@ifundefined{macro@cnt}{}{\endinput} +% \end{macrocode} +% +% \DescribeMacro\fileversion +% \DescribeMacro\filedate +% \DescribeMacro\docdate +% As you can see I used macros like |\fileversion| to denote the +% version number and the date. They are defined at the very beginning +% of the package file (without a surrounding \textsf{macrocode} +% environment), so I don't have to search for this place here when I +% change the version number. You can see their actual outcome in a +% footnote to the title. +% +% +% The first thing that we do next is to get ourselves a new comment +% sign. Because all sensible signs are already occupied, we will +% choose one that can only be entered indirectly: +% {\DoNotIndex{\^}^^A avoid misinterpretion !!!!! VERIFY +% \begin{macrocode} +\catcode`\^^A=14 +% \end{macrocode} +% We repeat this statement at the beginning of the document in case +% the \texttt{inputenc} package is used disabling it again. +% \changes{v2.0b}{1998/05/19}{Init docs private comment char at begin +% of document again (pr2581)} +% \begin{macrocode} +\AtBeginDocument{\catcode`\^^A=14\relax} +% \end{macrocode} +% \SortIndex{\string^\string^A}{\string\verb\verbatimchar +% \string^\string^A\verbatimchar +% \encapchar main} +% } +% +% +% \subsection{Options supported by \DOC{}} +% +% Not options available at the moment +% +% \begin{macrocode} +% \end{macrocode} +% +% +% \subsection{Macros surrounding the `definition parts'} +% +% \begin{macro}{\macrocode} +% Parts of the macro definition will be surrounded by the +% environment \textsf{macrocode}. Put more precisely, they will be +% enclosed by a macro whose argument (the text to be set +% `verbatim') is terminated by the string +% \verb*+% \end{macrocode}+. Carefully note the number of spaces. +% |\macrocode| is defined completely analogously to +% |\verbatim|, but because a few small changes were carried +% out, almost all internal macros have got new names. We start by +% calling the macro |\macro@code|, the macro which bears the +% brunt of most of the work, such as |\catcode| reassignments, +% etc. +% \changes{v1.5r}{1989/11/04}{Support for code line no. (Undoc)} +% \begin{macrocode} +\def\macrocode{\macro@code +% \end{macrocode} +% Then we take care that all spaces have the same width, and that +% they are not discarded. +% \begin{macrocode} + \frenchspacing \@vobeyspaces +% \end{macrocode} +% Before closing, we need to call |\xmacro@code|. It is this +% macro that expects an argument which is terminated by the above +% string. This way it is possible to keep the |\catcode| +% changes local. +% \changes{v1.5r}{1989/11/04}{Support for code line no. (Undoc)} +% \changes{v1.5t}{1989/11/07}{Common code moved to \cs{macro@code}.} +% \begin{macrocode} + \xmacro@code} +% \end{macrocode} +% \end{macro} +% +% +% \begin{macro}{\macro@code} +% We will now begin with the macro that does the actual work: +% \begin{macrocode} +\def\macro@code{% +% \end{macrocode} +% In theory it should consist of a \textsf{trivlist} environment, but +% the empty space before and after the environment should not be +% too large. +% \begin{macrocode} + \topsep \MacrocodeTopsep +% \end{macrocode} +% The next parameter we set is |\@beginparpenalty|, in order +% to prevent a page break before such an environment. +% \begin{macrocode} + \@beginparpenalty \predisplaypenalty +% \end{macrocode} +% We then start a |\trivlist|, set |\parskip| back to +% zero and start an empty |\item|. +% \changes{v1.9b}{1993/12/03}{Forcing any label from macro env.} +% \begin{macrocode} + \if@inlabel\leavevmode\fi + \trivlist \parskip \z@ \item[]% +% \end{macrocode} +% Additionally, everything should be set in \texttt{typewriter} font. +% Some people might prefer it somewhat differently; because of this +% the font choice is +% macro-driven.\footnote{The font change has to be placed +% {\em after\/} +% the \texttt{\bslash item}. Otherwise a change to +% \texttt{\bslash baselineskip} will affect the +% paragraph above.} +% \begin{macrocode} + \macro@font +% \end{macrocode} +% Because |\item| sets various parameters, we have found it +% necessary to alter some of these retrospectively. +% \begin{macrocode} + \leftskip\@totalleftmargin \advance\leftskip\MacroIndent + \rightskip\z@ \parindent\z@ \parfillskip\@flushglue +% \end{macrocode} +% The next line consists of the \LaTeX{} definition of |\par| +% used in |\verbatim| and should result in blank lines being +% shown as blank lines. +% \changes{v1.5l}{1989/09/10}{Code line numbers supported.} +% \changes{v1.5t}{1989/11/07}{Call \cs{leavevmode} to get \cs{everypar} +% on blank lines.} +% \changes{v1.7c}{1992/3/24}{Added \cs{interlinepenalty} to +% \cs{par} from +% verbatim.sty} +% \begin{macrocode} + \blank@linefalse \def\par{\ifblank@line + \leavevmode\fi + \blank@linetrue\@@par + \penalty\interlinepenalty} +% \end{macrocode} +% What use is this definition of |\par|\,? We use the macro +% |\obeylines| of \cite{book:KnuthA} which changes all |^^M| +% to |\par| so that each can control its own indentation. +% Next we must also ensure that all special signs are normalized; +% that is, they must be given |\catcode| $12$. +% \changes{v1.8b}{1993/09/21}{Changed to conform to new LaTeX verbatim, +% which handles more ligatures.} +% \begin{macrocode} + \obeylines + \let\do\do@noligs \verbatim@nolig@list + \let\do\@makeother \dospecials +% \end{macrocode} +% \changes{v1.5t}{1989/11/07}{Common code added.} +% \changes{v1.5w}{1990/02/05}{Skip of \cs{@totalleftmargin} added.} If +% indexing by code lines is switched on the line number is incremented +% and set appropriately. We also check whether the start of the next +% line indicates a \texttt{docstrip} module directive and process it +% appropriately if so using "\check@module". +% \begin{macrocode} + \global\@newlistfalse + \global\@minipagefalse + \ifcodeline@index + \everypar{\global\advance\c@CodelineNo\@ne + \llap{\theCodelineNo\ \hskip\@totalleftmargin}% + \check@module}% + \else \everypar{\check@module}% + \fi +% \end{macrocode} +% We also initialize the cross-referencing feature by calling +% |\init@crossref|. This will start the scanning mechanism +% when encountering an escape character. +% \begin{macrocode} + \init@crossref} +% \end{macrocode} +% \end{macro} +% +% +% \begin{macro}{\ifblank@line} +% \begin{macro}{\blank@linetrue} +% \begin{macro}{\blank@linefalse} +% |\ifblank@line| is the switch used in the definition above. +% In the original \textsf{verbatim} environment the |\if@tempswa| +% switch is used. This is dangerous because its value may change +% while processing lines in the \textsf{macrocode} environment. +% \begin{macrocode} +\newif\ifblank@line +% \end{macrocode} +% \end{macro} +% \end{macro} +% \end{macro} +% +% \begin{macro}{\endmacrocode} +% Because we have begun a \textsf{trivlist} environment in the +% \textsf{macrocode} environment, we must also end it. We must +% also act on the value of the "pm@module" flag (see below) and +% empty "\everypar". +% \changes{v1.5r}{1989/11/04}{Support for code line no. (Undoc)} +% \begin{macrocode} +\def\endmacrocode{% + \ifpm@module \endgroup \pm@modulefalse \fi + \everypar{}% + \global\@inlabelfalse + \endtrivlist +% \end{macrocode} +% Additionally |\close@crossref| is used to do anything needed +% to end the cross-referencing mechanism. +% \begin{macrocode} + \close@crossref} +% \end{macrocode} +% \end{macro} +% +% +% \begin{macro}{\MacroFont} +% Here is the default definition for the |\MacroFont| macro. +% With the new math font handling in NFSS2 it isn't any longer +% correct to suppress the math font setup since this is now handled +% differently. But to keep the font change fast we use only a +% single |\selectfont| (in |\small|) and do the rest by hand. +% \changes{v1.5x}{1990/02/17}{\cs{math@fontsfalse} added for NFSS.} +% \changes{v1.7a}{1992/03/13}{Added \cs{reset@font} for NFSS.} +% \changes{v1.8c}{1993/10/25}{NFSS standard} +% \changes{v1.9t}{1995/05/26}{Removed \cs{math@fontsfalse} (different +% math setup /pr1622} +% \begin{macrocode} +\@ifundefined{MacroFont}{% + \if@compatibility +% \end{macrocode} +% Despite the above statement we will call |\small| first if +% somebody is using a \LaTeX2.09 document with doc. I wouldn't have +% bothered since doc-sources should be up-to-date but since the +% request came from someone called David Carlisle \ldots :-) +% \changes{v1.9y}{1996/01/26}{Support compat mode} +% \begin{macrocode} + \def\MacroFont{\small + \usefont\encodingdefault + \ttdefault + \mddefault + \updefault + }% + \else + \def\MacroFont{\fontencoding\encodingdefault + \fontfamily\ttdefault + \fontseries\mddefault + \fontshape\updefault + \small}% + \fi + }{} +% \end{macrocode} +% \end{macro} +% +% \begin{macro}{\AltMacroFont} +% \begin{macro}{\macro@font} +% \changes{v1.7a}{1992/03/12}{Added to support distinction of modules.} +% \changes{v1.7c}{1992/03/26}{Altered font change for OFSS.} +% \changes{v1.7m}{1992/10/11}{Use sltt as default.} +% \changes{v1.8c}{1993/10/25}{NFSS standard} +% \changes{v1.9t}{1995/05/26}{Removed \cs{math@fontsfalse} (different +% math setup /pr1622} +% Although most of the macro code is set in "\MacroFont" we want to be +% able to switch to indicate module code set in "\AltMacroFont". +% "\macro@font" keeps track of which one we're using. We can't do the +% same thing sensibly in OFSS as in NFSS. +% \begin{macrocode} +\@ifundefined{AltMacroFont}{% + \if@compatibility +% \end{macrocode} +% Again have |\small| first if we are in compat mode. +% \changes{v1.9y}{1996/01/26}{Support compat mode} +% \begin{macrocode} + \def\AltMacroFont{\small + \usefont\encodingdefault + \ttdefault + \mddefault + \sldefault + }% + \else + \def\AltMacroFont{\fontencoding\encodingdefault + \fontfamily\ttdefault + \fontseries\mddefault + \fontshape\sldefault + \small + }% + \fi + }{} +% \end{macrocode} +% To allow changing the "\MacroFont" in the preamble we defer +% defining the internally used "\macro@font" until after the +% preamble. +% \changes{v2.0a}{1998/05/16}{Support changing \cs{MacroFont} in +% preamble} +% \begin{macrocode} +\AtBeginDocument{\let\macro@font\MacroFont} +% \end{macrocode} +% \end{macro} +% \end{macro} +% +% \begin{macro}{\check@module} +% \begin{macro}{\ifpm@module} +% \changes{v1.7a}{1992/03/12}{Added.} +% This is inserted by "\everypar" at the start of each macrocode line to +% check whether it starts with module information. (Such information is +% of the form "%<"\meta{switch}">", where the "%" must be at the +% start of the line and \meta{switch} comprises names with various +% possible separators and a possible leading "+", "-", "*" or "/" +% \cite{art:docstrip}. All that concerns us here is what the first +% character of \meta{switch} is.) First it checks the "pm@module" +% flag in case the previous line had a non-block module +% directive i.e., not "%<*" or "%|. +% \changes{v2.0n}{2001/05/16}{Partly support docstrip's ``verbatim'' +% directive (pr/3331)} +% \begin{macrocode} + \else\ifx <\next + \percentchar + \else + \let\next\pm@module + \fi\fi\fi\fi\fi + \next} +\endgroup +% \end{macrocode} +% \end{macro} +% \end{macro} +% \begin{macro}{\pm@module} +% If we're not dealing with a block +% directive ("*" or "/") i.e., it's a single special line, we set +% everything up to the next ">" appropriately and then change to the +% special macro font inside a group which will be ended at the start +% of the next line. If the apparent module directive is missing the +% terminating ">" this will lose, but then so will the \texttt{docstrip} +% implementation. An alternative strategy would be to have +% "\pm@module" make ">" active and clear a flag set here to indicate +% processing the directive. Appropriate action could then be taken if +% the flag was found still to be set when processing the next line. +% \changes{v1.7a}{1992/03/12}{Added.} +% \changes{v1.7i}{1992/07/11}{Support for fonts depending on nesting.} +% \begin{macrocode} +\begingroup +\catcode`\~=\active +\lccode`\~=`\> +\lowercase{\gdef\pm@module#1~}{\pm@moduletrue + \Module{#1}\begingroup +% \end{macrocode} +% We switch to a special font as soon the nesting is higher than +% the current value of "\c@StandardModuleDepth". We do a local +% update to the "\guard@level" here which will be restored after +% the current input line. +% \begin{macrocode} + \advance\guard@level\@ne + \ifnum\guard@level>\c@StandardModuleDepth\AltMacroFont\fi +} +% \end{macrocode} +% \end{macro} +% \begin{macro}{\star@module} +% \begin{macro}{\slash@module} +% \changes{v1.7a}{1992/03/12}{Added.} +% \changes{v1.7f}{1992/05/16}{Take account of nested guards.} +% \changes{v1.7i}{1992/07/11}{Add counter to determine when to switch to +% special font.} +% If the start or end of a module {\em block\/} is indicated, after +% setting the guard we have to check whether a change in the macrocode +% font should be done. This will be the case if we are already inside +% a block or are ending the outermost block. If so, we globally +% toggle the font for subsequent macrocode sections between the normal +% and special form, switching to the new one immediately. +% \changes{v1.7i}{1992/07/17}{Support for fonts depending on module +% nesting} +% \begin{macrocode} +\lowercase{\gdef\star@module#1~}{% + \Module{#1}% + \global \advance \guard@level\@ne + \ifnum \guard@level>\c@StandardModuleDepth + \global\let\macro@font=\AltMacroFont \macro@font + \fi} +\catcode`\>=\active +\gdef\slash@module#1>{% + \Module{#1}% + \global \advance \guard@level\m@ne + \ifnum \guard@level=\c@StandardModuleDepth + \global\let\macro@font\MacroFont \macro@font + \fi +} +\endgroup +% \end{macrocode} +% \end{macro} +% \end{macro} +% +% +% \begin{macro}{\c@StandardModuleDepth} +% \changes{v1.7i}{1992/07/11}{Counter added.} +% Counter defining up to which level modules are considered part of +% the main code. If, for example, the whole code is surrounded by +% a |%<*package>| module we better set this counter to |1| to avoid +% getting the whole code be displayed in typewriter italic. +% \begin{macrocode} +\newcounter{StandardModuleDepth} +% \end{macrocode} +% \end{macro} +% +% +% \begin{macro}{\guard@level} +% \changes{v1.7f}{1992/05/16}{Added.} +% We need a counter to keep track of the guard nesting. +% \begin{macrocode} +\newcount \guard@level +% \end{macrocode} +% \end{macro} +% \begin{macro}{\Module} +% \changes{v1.7a}{1992/03/12}{Added.} +% \changes{v1.7d}{1992/04/25}{Use sans font for modules.} +% This provides a hook to determine the way the module directive is +% set. It gets as argument everything between the angle brackets. +% The default is to set the contents in sans serif text between +% $\langle\,\rangle$ with the special characters suitably "\mathcode"d +% by "\mod@math@codes". (You can't just set it in a sans text font +% because normally "|" will print as an em-dash.) This is done +% differently depending on whether we have the NFSS or the old one. In +% the latter case we can easily change "\fam" appropriately. +% \changes{v1.8c}{1993/10/25}{NFSS standard} +% \begin{macrocode} +\@ifundefined{Module}{% +% \end{macrocode} +% With NFSS what we probably {\em should\/} do is change to a new +% "\mathversion" but I (Dave Love) haven't spotted an easy way to +% do so correctly if the document uses a version other than +% "normal". (We need to know in what font to set the other +% groups.) This uses a new math alphabet rather than version and +% consequently has to worry about whether we're using +% \textsf{oldlfnt} or not. I expect there's a better +% way\ldots +% \begin{macrocode} + \def\Module#1{\mod@math@codes$\langle\mathsf{#1}\rangle$} + }{} +% \end{macrocode} +% \end{macro} +% +% \begin{macro}{\mod@math@codes} +% \changes{v1.7c}{1992/03/26}{Added.} As well as `words', the module +% directive text might contain any of the characters "*/+-,&|!()" +% for the current version of \textsf{docstrip}. We only need +% special action for two of them in the math code changing required +% above: "|" is changed to a "\mathop" (it's normally |"026A|) and +% "&" is also made a "\mathop", but in family 0. Remember that "&" +% will not have a special catcode when it's encountered. +% \begin{macrocode} +\def\mod@math@codes{\mathcode`\|="226A \mathcode`\&="2026} +% \end{macrocode} +% \end{macro} +% +% \begin{macro}{\mathsf} +% \changes{v1.7c}{1992/03/26}{Added.} +% \changes{v1.7d}{1992/04/25}{Use sans font for modules.} +% \changes{v1.7n}{1993/02/21}{\cs{sfmath} Renamed to \cs{mathsf}.} +% \changes{v1.8c}{1993/10/25}{NFSS standard} +% If NFSS is in use we need a new math alphabet which uses a sans serif +% font. To support both the release one and two of NFSS the alphabet +% was renamed to "\mathsf" which is defined in NFSS2. +% \begin{macrocode} +%\ifx\selectfont\undefined +%\else +% \ifx\mathsf\undefined +% \newmathalphabet*{\mathsf}{\sfdefault}{m}{n}\fi +%\fi +% \end{macrocode} +% \end{macro} +% +% +% +% \begin{macro}{\MacrocodeTopsep} +% \begin{macro}{\MacroIndent} +% In the code above, we have used two registers. Therefore we have +% to allocate them. The default values might be overwritten with +% the help of the |\DocstyleParms| macro. +% \changes{v1.5s}{1989/11/05}{Support for code line no. (Undoc)} +% \changes{v1.5y}{1990/02/24}{Default changed.} +% \changes{v1.6b}{1990/06/15}{\cs{rm} moved before \cs{scriptsize} to +% avoid unnecessary fontwarning.} +% \begin{macrocode} +\newskip\MacrocodeTopsep \MacrocodeTopsep = 3pt plus 1.2pt minus 1pt +\newdimen\MacroIndent +\settowidth\MacroIndent{\rmfamily\scriptsize 00\ } +% \end{macrocode} +% \end{macro} +% \end{macro} +% +% +% +% +% \begin{macro}{\macrocode*} +% \begin{macro}{\endmacrocode*} +% Just as in the \textsf{verbatim} environment, there is also a +% `star' variant of the \textsf{macrocode} environment in which a +% space is shown by the symbol \verb*+ +. Until this moment, I +% have not yet used it (it will be used in the description of the +% definition of |\xmacro@code| below) but it's exactly on this one +% occasion {\em here\/} that you can't use it (cf.\ M\"unchhausens +% Marsh problem)\footnote{Karl Friedrich Hieronymus Frhr.\ v.\ +% M\"unchhausen (*1720, \dag1797). Several books were written +% about fantastic adventures supposedly told by him (see +% \cite{book:Raspe} or \cite{book:Buerger}). In one story he +% escaped from the marsh by pulling himself out by his hair.} +% directly. Because of this, on this one occasion we'll cheat +% around the problem with an additional comment character. But now +% back to |\macrocode*|. We start with the macro |\macro@code| +% which prepares everything and then call the macro |\sxmacro@code| +% whose argument is terminated by the string +%\verb*+% \end{macrocode*}+. +% \begin{macrocode} +\@namedef{macrocode*}{\macro@code\sxmacro@code} +% \end{macrocode} +% As we know, |\sxmacro@code| and then |\end{macrocode*}| +% (the macro, not the string), will be executed, so that for a +% happy ending we still need to define the macro +% |\endmacrocode*|. +% \begin{macrocode} +\expandafter\let\csname endmacrocode*\endcsname = \endmacrocode +% \end{macrocode} +% \end{macro} +% \end{macro} +% +% +% +% +% +% +% +% \begin{macro}{\xmacro@code} +\catcode`\!=\catcode`\% ^^A In this section there must not be + ^^A any exclamation marks. + ^^A +% As already mentioned, the macro |\xmacro@code| expects an +% argument delimited by the string \verb*+% \end{macrocode}+. At +% the moment that this macro is called, the |\catcode| of +% \TeX's special characters are 12 (`other') or 13 (`active'). +% Because of this we need to utilize a different escape character +% during the definition. This happens locally. +% \begin{macrocode*} +\begingroup +\catcode`\|=\z@ \catcode`\[=\@ne \catcode`\]=\tw@ +% \end{macrocode*} +% Additionally, we need to ensure that the symbols in the above +% string contain the |\catcode|$\,$s which are available +% within the \textsf{macrocode} environment. +% \begin{macrocode*} +\catcode`\{=12 \catcode`\}=12 +\catcode`\%=12 \catcode`\ =\active \catcode`\\=\active +!% \end{macrocode*} +! Next follows the actual definition of |\macro@code|; +! notice the +! use of the new escape character. We manage to get the argument +! surrounded by the string |\end{macrocode}|, but at the end +! however, in spite of the actual characters used during the +! definition of +! this macro, |\end| with the argument |{macrocode}| +! will be executed, to ensure a balanced environment. +! \begin{macrocode*} +|gdef|xmacro@code#1% \end{macrocode}[#1|end[macrocode]] +!% \end{macrocode*} +! \begin{macro}{\sxmacro@code} +! The definition of |\sxmacro@code| is completely analogous, +! only +! here a slightly different terminating string will be used. +! Note that the space is not active in this environment. +! \begin{macrocode} +|catcode`| =12 +|gdef|sxmacro@code#1% \end{macrocode*}[#1|end[macrocode*]] +!% \end{macrocode} +! because the |\catcode| changes have been made local by +! commencing a +! new group, there now follows the matching |\endgroup| +! in a rather +! unusual style of writing. +! \begin{macrocode} +|endgroup +!% \end{macrocode} +\catcode`\!=12 +% \end{macro} +% \end{macro} +% +% +% +% +% \subsection{Macros for the `documentation parts'} +% +% +% \begin{macro}{\DescribeMacro} +% \begin{macro}{\Describe@Macro} +% \changes{v1.5v}{1990/01/28}{Macro added.} +% \changes{v1.5j}{1989/06/09}{\cs{ignorespaces} added as a temporary +% fix} +% \begin{macro}{\DescribeEnv} +% \begin{macro}{\Describe@Env} +% \changes{v1.5v}{1990/01/28}{Macro added.} +% \changes{v1.5j}{1989/06/09}{\cs{ignorespaces} added as a temporary +% fix} +% The |\DescribeMacro| and |\DescribeEnv| macros should +% print their arguments in the margin and produce an index entry. +% We simply use |\marginpar| to get the desired result. This +% is however not the best solution because the labels might be +% slightly misplaced. One also might get a lot of `marginpar moved' +% messages which are hard-wired into the \LaTeX{} output +% routine.\footnote{It might be better to change these macros into +% environments like the \textsf{macro} environment.} First we change +% to horizontal mode if necessary. The \LaTeX{} macros +% |\@bsphack| and |\@esphack| are used to make those +% commands invisible (i.e.\ to normalize the surrounding space and +% to make the |\spacefactor| transparent). +% \changes{v1.5v}{1990/01/28}{\cs{MakePrivateLetters} added.} +% \begin{macrocode} +\def\DescribeMacro{\leavevmode\@bsphack +% \end{macrocode} +% When documenting the code for the \texttt{amstex.sty} option we +% encountered a bug: the |\catcode| of |@| was active and +% therefore couldn't be used in command names. So we first have to +% make sure that we get all |\catcode|s right by calling +% |\MakePrivateLetters| inside a group. Then we call +% |\Describe@Macro| to do the work. +% \changes{v2.0g}{1999/03/22}{Parse backslash as letter in argument +% to \cs{DescribeMacro}.} +% \changes{v2.0h}{1999/03/25}{Correct errors introduced in v2.0g.} +% \begin{macrocode} + \begingroup\MakePrivateLetters\Describe@Macro} +\def\Describe@Macro#1{\endgroup + \marginpar{\raggedleft\PrintDescribeMacro{#1}}% +% \end{macrocode} +% Note the use of |\raggedleft| to place the output flushed +% right. Finally we call a macro which produces the actual index +% entry and finish with |\@esphack| to leave no +% trace.\footnote{The whole mechanism won't work because +% of the \texttt{\bslash leavevmode} in front. +% As a temporary change \texttt{\bslash ignorespaces} +% is added.} +% \begin{macrocode} + \SpecialUsageIndex{#1}\@esphack\ignorespaces} +% \end{macrocode} +% The |\DescribeEnv| macro is completely analogous. +% \changes{v1.5v}{1990/01/28}{\cs{MakePrivateLetters} added.} +% \begin{macrocode} +\def\DescribeEnv{\leavevmode\@bsphack\begingroup\MakePrivateLetters + \Describe@Env} +\def\Describe@Env#1{\endgroup + \marginpar{\raggedleft\PrintDescribeEnv{#1}}% + \SpecialEnvIndex{#1}\@esphack\ignorespaces} +% \end{macrocode} +% To put the labels in the left margin we have to use the +% |\reversemarginpar| declaration. (This means that the +% \texttt{doc.sty} can't be used with all classes or packages.) +% We also +% make the |\marginparpush| zero and |\marginparwidth| suitably +% wide. +% \changes{v1.5d}{1989/4/28}{\cs{marginparwidth} setting added.} +% \begin{macrocode} +\reversemarginpar +\setlength\marginparpush{0pt} \setlength\marginparwidth{8pc} +% \end{macrocode} +% \end{macro} +% \end{macro} +% \end{macro} +% \end{macro} +% +% \begin{macro}{\bslash} +% \changes{v1.7a}{1992/02/26}{Moved \cs{bslash} documentation to `user +% interface' part} +% We start a new group in which to hide the alteration of +% |\catcode|$\,$s, and make \verb+|+ introduce commands, +% whilst |\| becomes an `other' character. +% +% \begin{macrocode} +{\catcode`\|=\z@ \catcode`\\=12 +% \end{macrocode} +% Now we are able to define |\bslash| (globally) to generate a +% backslash of |\catcode| `other'. We then close this group, +% restoring original |\catcode|$\,$s. +% \SpecialEscapechar{\|} +% \begin{macrocode} +|gdef|bslash{\}} +% \end{macrocode} +% \end{macro} +% +% +% +% \begin{macro}{\verbatim} +% \begin{macro}{\verbatim*} +% \changes{v1.7i}{1992/07/12}{Added changed definition for verbatim!*.} +% The \textsf{verbatim} environment holds no secrets; it consists of +% the normal \LaTeX{} environment. We also set the +% |\@beginparpenalty| and change to the font given by +% |\MacroFont|. +% \begin{macrocode} +\def\verbatim{\@beginparpenalty \predisplaypenalty \@verbatim + \MacroFont \frenchspacing \@vobeyspaces \@xverbatim} +% \end{macrocode} +% We deal in a similar way with the star form of this environment. +% \begin{macrocode} +\@namedef{verbatim*}{\@beginparpenalty \predisplaypenalty \@verbatim + \MacroFont \@sxverbatim} +% \end{macrocode} +% \end{macro} +% \end{macro} +% +% \begin{macro}{\@verbatim} +% Additionally we redefine the |\@verbatim| macro so that it +% suppresses |%| characters at the beginning of the line. The +% first lines are copied literally from \texttt{latex.tex}. +% \changes{v1.7i}{1992/07/12}{Added \cs{@@par} to clear possible +% \cs{parshape}.} +% \begin{macrocode} +\def\@verbatim{\trivlist \item[]\if@minipage\else\vskip\parskip\fi + \leftskip\@totalleftmargin\rightskip\z@ + \parindent\z@\parfillskip\@flushglue\parskip\z@ + \@@par + \@tempswafalse +% \end{macrocode} +% |\@verbatim| sets |^^M|, the end of line character, to +% be equal to |\par|. This control sequence is redefined +% here; |\@@par| is the paragraph primitive of \TeX. +% \changes{v1.7c}{1992/3/24}{Added \cs{interlinepenalty} to +% \cs{par} from verbatim.sty} +% \begin{macrocode} + \def\par{\if@tempswa\hbox{}\fi\@tempswatrue\@@par + \penalty\interlinepenalty +% \end{macrocode} +% We add a control sequence |\check@percent| to the definition +% of |\par| whose task it is to check for a percent character. +% \begin{macrocode} + \check@percent}% +% \end{macrocode} +% The rest is again copied literally from \texttt{latex.tex} (less +% "\tt"). +% \changes{v1.7a}{1992/02/26}{Removed redundant \cs{tt}.} +% \changes{v1.8b}{1993/09/21}{Changed to conform to new LaTeX verbatim, +% which handles more ligatures.} +% \begin{macrocode} + \obeylines + \let\do\do@noligs \verbatim@nolig@list + \let\do\@makeother \dospecials} +% \end{macrocode} +% \end{macro} +% +% \begin{macro}{\check@percent} +% Finally we define |\check@percent|. Since this must compare a +% character with a percent sign we must first (locally) change +% percent's |\catcode| so that it is seen by \TeX. The definition +% itself is nearly trivial: grab the following character, check if +% it is a |%|, and insert it again if not. At the end of the +% \textsf{verbatim} environment this macro will peek at the next +% input line. In that case the argument to |\check@percent| might +% be a |\par| or a macro with arguments. Therefore we make the +% definition |\long| (|\par| allowed) and use the normal |\next| +% mechanism to reinsert the argument after the |\fi| if necessary. +% \changes{v1.5i}{1989/06/07}{Definition changed to `long'} +% \changes{v1.5i}{1989/06/07}{Macro \cs{next} used to guard against +% macro with arguments} +% There is a subtle problem here, the equal sign between +% |\next| and |#1| is actually necessary. Do you see why? +% The omission of this token once caused a funny error. +% \changes{v1.5u}{1989/11/14}{equal sign added.} +% \begin{macrocode} +{\catcode`\%=12 + \long\gdef\check@percent#1{\ifx #1%\let\next\@empty \else + \let\next=#1\fi \next}} +% \end{macrocode} +% \end{macro} +% +% \begin{macro}{\verb} +% \changes{v1.7a}{1992/02/27}{Now warns about newlines (from +% newdoc with `@noligs added).} +% \changes{v1.8b}{1993/09/21}{Changed to conform to new LaTeX \cs{verb}} +% We re-define "\verb" to check for newlines in its argument since a +% missing delimiter is difficult to detect in \DOC{} source. +% The code is the saem as in latex.tex of September 19, 1993. +% Perhaps there should be a font-changing +% hook rather than just using "\tt", but if so it probably should be +% different from "\MacroFont" since that normally includes "\small" +% and would look wrong inline. +% \changes{v1.7a}{1992/02/28}{Added math mode check (from verbatim.sty)} +% \begin{macrocode} +\def\verb{\relax\ifmmode\hbox\else\leavevmode\null\fi + \bgroup \let\do\do@noligs \verbatim@nolig@list + \ttfamily \verb@eol@error \let\do\@makeother \dospecials + \@ifstar{\@sverb}{\@vobeyspaces \frenchspacing \@sverb}} +% \end{macrocode} +% \end{macro} +% +% \begin{macro}{\verb@balance@group} +% \begin{macro}{\verb@egroup} +% \begin{macro}{\verb@eol@error} +% \changes{v1.8b}{1993/09/21}{Renamed \cs{verb@err} to +% \cs{verb@eol@error}, as in new LaTeX verbatim.} +% \begin{macrocode} +\let\verb@balance@group\@empty + +\def\verb@egroup{\global\let\verb@balance@group\@empty\egroup} + +\begingroup + \obeylines% + \gdef\verb@eol@error{\obeylines% + \def^^M{\verb@egroup\@latex@error{% + Text for \noexpand\verb command ended by end of line}\@ehc}}% +\endgroup +% \end{macrocode} +% \end{macro} +% \end{macro} +% \end{macro} +% +% \begin{macro}{\@sverb} +% \changes{v1.7a}{1992/02/27}{Added for \cs{verb} change.} +% \changes{v1.7a}{1992/02/28}{Now same as in verbatim.sty.} +% \changes{v1.8b}{1993/09/21}{Changed to conform to new LaTeX verbatim, +% which has better error trapping.} +% See \cite{art:verbatim} for commentary. +% \begin{macrocode} +\def\@sverb#1{% + \catcode`#1\active \lccode`\~`#1% + \gdef\verb@balance@group{\verb@egroup + \@latex@error{Illegal use of \noexpand\verb command}\@ehc}% + \aftergroup\verb@balance@group + \lowercase{\let~\verb@egroup}} +% \end{macrocode} +% \end{macro} +% +% +% \begin{macro}{\verbatim@nolig@list} +% \begin{macro}{\do@noligs} +% These macros replace the old "\@noligs" mechanism by an +% extensible version to allow more ligatures to be added. +% \begin{macrocode} +\def\verbatim@nolig@list{\do\`\do\<\do\>\do\,\do\'\do\-} +\def\do@noligs#1{% + \catcode`#1\active + \begingroup + \lccode`\~=`#1\relax + \lowercase{\endgroup\def~{\leavevmode\kern\z@\char`#1}}} +% \end{macrocode} +% \end{macro} +% \end{macro} +% +% +% \begin{macro}{\macro} +% \begin{macro}{\m@cro@} +% \changes{v1.5v}{1990/01/28}{\cs{macro@} renamed to \cs{m@cro@} +% since AmSTeX +% defines another macro of the same name.} +% \begin{macro}{\macro@cnt} +% \label{page:macro} The \textsf{macro} environment is implemented as +% a \textsf{trivlist} environment, whereby in order that the macro +% names can be placed under one another in the margin +% (corresponding to the macro's nesting depth), the macro +% |\makelabel| must be altered. In order to store the nesting +% depth, we use a counter. We also need a counter to count the +% number of nested \textsf{macro} environments. +% \changes{v1.5k}{1989/08/17}{Fix for save stack problem.} +% \changes{v1.9k}{1994/02/22}{Fix probably no longer necessary} +% \begin{macrocode} +\newcount\macro@cnt \macro@cnt=0 +% \end{macrocode} +% The environment takes an argument---the macro name to be +% described. Since this name may contain special `letters' we have +% to re-|\catcode| them before scanning the argument. This is done +% by the |\MakePrivateLetters| macro. +% \changes{v1.5k}{1989/08/17}{Fix for save stack problem.} +% \changes{v1.7a}{1992/02/26}{Catcode backslash to other (from newdoc).} +% \changes{v1.9k}{1994/02/22}{Don't omit extra group} +% \begin{macrocode} +\def\macro{\begingroup + \catcode`\\12 + \MakePrivateLetters \m@cro@ \iftrue} +% \end{macrocode} +% +% \begin{macro}{\environment} +% \changes{v1.8c}{1993/10/25}{Environment added} +% The ``environment'' envrionment will be implemented just like the +% ``macro'' environment flagging any differences in the code by +% passing |\iffalse| or |\iftrue| to the |\m@cro@| environment +% doing the actual work. +% \begin{macrocode} +\def\environment{\begingroup + \catcode`\\12 + \MakePrivateLetters \m@cro@ \iffalse} +% \end{macrocode} +% \end{macro} +% +% After scanning the argument we close the group to get the normal +% |\catcode|$\,$s back. Then we assign a special value to +% |\topsep| and start a \textsf{trivlist} environment. +% \changes{v1.5f}{1989/5/07}{MacroTopsep parameter added.} +% \changes{v1.5k}{1989/08/17}{Fix for save stack problem.} +% \changes{v1.8c}{1993/10/25}{Support ``environment'' env} +% \changes{v1.9k}{1994/02/22}{Remove \cs{macro@level}} +% \begin{macrocode} +\long\def\m@cro@#1#2{\endgroup \topsep\MacroTopsep \trivlist +% \end{macrocode} +% We also save the name being described in |\saved@macroname| for +% use in conjunction with the |\changes| macro. +% \begin{macrocode} + \edef\saved@macroname{\string#2}% +% \end{macrocode} +% Now there follows a variation of |\makelabel| which is used +% should the environment not be nested, or should it lie between +% two successive |\begin{macro}| instructions or explanatory +% text. One can recognize this with the switch |\if@inlabel| +% which will be |true| in the case of successive |\item| +% commands. +% \begin{macrocode} + \def\makelabel##1{\llap{##1}}% +% \end{macrocode} +% If |@inlabel| is |true| and if $\verb=\macro@cnt= > 0$ +% then the above definition needs to be changed, because in this +% case \LaTeX{} would otherwise put the labels all on the same line +% and this would lead to them being overprinted on top of each +% other. Because of this |\makelabel| needs to be redefined +% in this case. +% \begin{macrocode} + \if@inlabel +% \end{macrocode} +% If |\macro@cnt| has the value $1$, then we redefine +% |\makelabel| so that the label will be positioned in the +% second line of the margin. As a result of this, two macro names +% appear correctly, one under the other. It's important whilst +% doing this that the generated label box is not allowed to have +% more depth than a normal line since otherwise the distance +% between the first two text lines of \TeX{} will be incorrectly +% calculated. The definition should then look like: +%\begin{verbatim} +% \def\makelabel##1{\llap{\vtop to \baselineskip +% {\hbox{\strut}\hbox{##1}\vss}}} +%\end{verbatim} +% Completely analogous to this is the case where labels need to be +% placed one under the other. The lines above are only an example +% typeset with the \textsf{verbatim} environment. To produce the real +% definition we save the value of |\macro@cnt| in +% |\count@| and empty the temp macro |\@tempa| for later +% use. +% \begin{macrocode} + \let\@tempa\@empty \count@\macro@cnt +% \end{macrocode} +% In the following loop we append for every already typeset label +% an |\hbox{\strut}| to the definition of |\@tempa|. +% \begin{macrocode} + \loop \ifnum\count@>\z@ + \edef\@tempa{\@tempa\hbox{\strut}}\advance\count@\m@ne \repeat +% \end{macrocode} +% Now be put the definition of |\makelabel| together. +% \changes{v1.5b}{1989/04/27}{vbox to vtop changed in makelabel (test)} +% \changes{v1.5e}{1989/04/28}{ht strutbox changed to baselineskip +% (test)} +% \begin{macrocode} + \edef\makelabel##1{\llap{\vtop to\baselineskip + {\@tempa\hbox{##1}\vss}}}% +% \end{macrocode} +% Next we increment the value of the nesting depth counter. This +% value inside the \textsf{macro} environment is always at least one +% after this point, but its toplevel definition is zero. Provided +% this environment has been used correctly, $|\macro@cnt|=0$ +% should not occur when |@inlabel|=\textsf{true}. It is +% however possible if this environment is used within other list +% environments (but this would have little point). +% \begin{macrocode} + \advance \macro@cnt \@ne +% \end{macrocode} +% If |@inlabel| is false we reset |\macro@cnt| assuming +% that there is enough room to print the macro name without +% shifting. +% \begin{macrocode} + \else \macro@cnt\@ne \fi +% \end{macrocode} +% Now the label will be produced using |\item|. The following +% line is only a hack saving the day until a better solution is +% implemented. We have to face two problems: the argument might be +% a |\par| which is forbidden in the argument of other macros +% if they are not defined as |\long|, or it is something like +% |\iffalse| or |\else|, i.e.\ something which will be +% misinterpreted when \TeX{} is skipping conditional text. In both +% cases |\item| will bomb, so we protect the argument by using +% |\string|. +% \begin{macrocode} + \edef\@tempa{\noexpand\item[% +% \end{macrocode} +% Depending on whether we are inside a ``macro'' or ``environment'' +% environment we use |\PrintMacroName| or |\PrintEnvName| to +% display the name. +% \begin{macrocode} + #1% + \noexpand\PrintMacroName + \else + \noexpand\PrintEnvName + \fi + {\string#2}]}% + \@tempa +% \end{macrocode} +% At this point we also produce an index entry. Because it is not +% known which index sorting program will be used, we do not use the +% command |\index|, but rather a command +% |\SpecialMainIndex| after advancing the counter for indexing +% by line number. This may be redefined by the user in +% order to generate an index entry which will be understood by the +% index program in use (note the definition of +% |\SpecialMainIndex| for our installation). +% \changes{v1.5s}{1989/11/05}{Support for code line no. (Undoc)} +% \changes{v1.9u}{1995/08/06}{Removed brace group which +% killed \cs{DoNotIndex}} +% We advance the current codeline number and after producing an +% index entry revert to the original value +% \begin{macrocode} + \global\advance\c@CodelineNo\@ne +% \end{macrocode} +% Again the macro to call depends on the environment we are +% actually in. +% \begin{macrocode} + #1% + \SpecialMainIndex{#2}\nobreak + \DoNotIndex{#2}% + \else + \SpecialMainEnvIndex{#2}\nobreak + \fi + \global\advance\c@CodelineNo\m@ne +% \end{macrocode} +% The |\nobreak| is needed to prevent a page break after the +% |\write| produced by the |\SpecialMainIndex| macro. We +% exclude the new macro in the cross-referencing feature, to +% prevent spurious non-main entry references. Regarding possibly +% problematic arguments, the implementation takes +% care of |\par| and the conditionals are uncritical. +% \changes{v1.7a}{1992/03/02}{Removed redundant code checking for +% \cs{par}.}^^A +% +% Because the space symbol should be ignored between the +% |\begin{macro}{...}| and the following text we must take +% care of this with |\ignorespaces|. +% \begin{macrocode} + \ignorespaces} +% \end{macrocode} +% \end{macro} +% \end{macro} +% \end{macro} +% +% +% +% \begin{macro}{\endmacro} +% \begin{macro}{\endenvironment} +% Older releases of this environment omit the |\endgroup| token, +% when being nested. This was done to avoid unnessary stack usage. +% However it does not work if \textsf{macro} and +% \textsf{environment} environments are mixed, therefore we now +% use a simpler approach. +% \changes{v1.5k}{1989/08/17}{Fix for save stack problem.} +% \changes{v1.9k}{1994/02/22}{Don't checkfor nesting} +% \begin{macrocode} +\let\endmacro \endtrivlist +\let\endenvironment\endmacro +% \end{macrocode} +% \end{macro} +% \end{macro} +% +% \begin{macro}{\MacroTopsep} +% Here is the default value for the |\MacroTopsep| parameter +% used above. +% \begin{macrocode} +\newskip\MacroTopsep \MacroTopsep = 7pt plus 2pt minus 2pt +% \end{macrocode} +% \end{macro} +% +% +% +% +% +% \subsection{Formatting the margin} +% +% The following three macros should be user definable. +% Therefore we define those macros only if they have not already +% been defined. +% +% \begin{macro}{\PrintMacroName} +% \begin{macro}{\PrintEnvName} +% \begin{macro}{\PrintDescribeMacro} +% \begin{macro}{\PrintDescribeEnv} +% The formatting of the macro name in the left margin is done by +% these macros. We first set a |\strut| to get the height and +% depth of the normal lines. Then we change to the +% |\MacroFont| using |\string| to |\catcode| the +% argument to other (assuming that it is a macro name). Finally we +% print a space. The font change remains local since this macro +% will be called inside an |\hbox|. +% \begin{macrocode} +\@ifundefined{PrintMacroName} + {\def\PrintMacroName#1{\strut \MacroFont \string #1\ }}{} +% \end{macrocode} +% We use the same formatting conventions when describing a macro. +% \begin{macrocode} +\@ifundefined{PrintDescribeMacro} + {\def\PrintDescribeMacro#1{\strut \MacroFont \string #1\ }}{} +% \end{macrocode} +% To format the name of a new environment there is no need to use +% |\string|. +% \begin{macrocode} +\@ifundefined{PrintDescribeEnv} + {\def\PrintDescribeEnv#1{\strut \MacroFont #1\ }}{} +\@ifundefined{PrintEnvName} + {\def\PrintEnvName#1{\strut \MacroFont #1\ }}{} +% \end{macrocode} +% \end{macro} +% \end{macro} +% \end{macro} +% \end{macro} +% +% +% +% \subsection{Creating index entries by scanning `macrocode'} +% +% The following macros ensure that index entries are created for each +% occurrence of a \TeX-like command (something starting with +% `|\|') providing indexing has been turned on with "\PageIndex" +% or "\CodelineIndex". With the default definitions of +% |\SpecialMainIndex|, etc., the index file generated is +% intended to be processed by Chen's \textsf{makeindex} program +% \cite{art:Chen}. +% +% +% Of course, in {\em this\/} package file itself we've sometimes had to +% make \verb+|+ take the r\^ole of \TeX's escape character to +% introduce command names at places where |\| has to belong to +% some other category. Therefore, we may also need to recognize +% \verb+|+ as the introducer for a command when setting the text +% inside the \textsf{macrocode} environment. Other users may have the +% need to make similar reassignments for their macros. +% +% +% \begin{macro}{\SpecialEscapechar}\label{sect:specialescapechar} +% \begin{macro}{\active@escape@char} +% \begin{macro}{\special@escape@char} +% The macro |\SpecialEscapechar| is used to denote a special escape +% character for the next \textsf{macrocode} environment. It has one +% argument---the new escape character given as a `single-letter' +% control sequence. Its main purpose is defining +% |\special@escape@char| to produce the chosen escape character +% |\catcode|$\,$d to 12 and |\active@escape@char| to produce the +% same character but with |\catcode| 13. +% +% The macro |\special@escape@char| is used to {\em print\/} +% the escape character while |\active@escape@char| is needed +% in the definition of |\init@crossref| to start the scanning +% mechanism. +% +% In the definition of |\SpecialEscapechar| we need an +% arbitrary character with |\catcode| 13. We use `\~{}' and +% ensure that it is active. The |\begingroup| is used to make +% a possible change local to the expansion of +% |\SpecialEscapechar|. +% \changes{v1.7g}{1992/6/19}{Making tilde active moved outside +% definition} +% \begin{macrocode} +\begingroup +\catcode`\~\active +\gdef\SpecialEscapechar#1{% + \begingroup +% \end{macrocode} +% Now we are ready for the definition of +% |\active@escape@char|. It's a little tricky: we first +% define locally the uppercase code of `\~{}' to be the new escape +% character. +% \begin{macrocode} + \uccode`\~`#1% +% \end{macrocode} +% Around the definition of |\active@escape@char| we place an +% |\uppercase| command. Recall that the expansion of +% |\uppercase| changes characters according to their +% |\uccode|, but leaves their |\catcode|$\,$s untouched +% (cf.\ \TeX{}book page 41). +% \begin{macrocode} + \uppercase{\gdef\active@escape@char{~}}% +% \end{macrocode} +% The definition of |\special@escape@char| is easier, we use +% |\string| to |\catcode| the argument of +% |\SpecialEscapechar| to 12 and suppress the preceding +% |\escapechar|. +% \begin{macrocode} + \escapechar\m@ne \xdef\special@escape@char{\string#1}% +% \end{macrocode} +% Now we close the group and end the definition: the value of +% |\escapechar| as well as the |\uccode| and +% |\catcode| of `\~{}' will be restored. +% \begin{macrocode} + \endgroup} +\endgroup +% \end{macrocode} +% \end{macro} +% \end{macro} +% \end{macro} +% +% +% +% +% \begin{macro}{\init@crossref} +% The replacement text of |\init@crossref| should fulfill the +% following tasks: +% \begin{itemize} +% \parindent4em +% \item[1)] +% |\catcode| all characters used in macro names to +% 11 (i.e.\ `letter'). +% \item[2)] +% |\catcode| the `|\|' character to 13 +% (i.e.\ `active'). +% \item[3a)] +% |\let| the `|\|' equal |\scan@macro| +% (i.e.\ start the macro scanning mechanism) if there is +% no special escape character (i.e.\ the +% |\special@escape@char| is `|\|'). +% \item[3b)] +% Otherwise |\let| it equal |\bslash|, i.e.\ +% produce a printable |\|. +% \item[4)] +% Make the \meta{special escape character} active. +% \item[5)] +% |\let| the active version of the special escape +% character +% (i.e.\ the expansion of |\active@escape@char|) equal +% |\scan@macro|. +% \end{itemize} +% The reader might ask why we bother to |\catcode| the +% `|\|' first to 12 (at the end of |\macro@code|) then +% re-|\catcode| it to 13 in order to produce a $|\|_{12}$ +% in case 3b) above. This is done because we have to ensure that +% `|\|' has |\catcode| 13 within the \textsf{macrocode} +% environment. Otherwise the delimiter for the argument of +% |\xmacro@code| would not be found (parameter matching +% depends on |\catcode|$\,$s). +% +% Therefore we first re-|\catcode| some characters. +% \begin{macrocode} +\begingroup \catcode`\|=\z@ \catcode`\\=\active +% \end{macrocode} +% We carry out tasks 2) and 3b) first. +% \SpecialEscapechar{\|} +% \begin{macrocode} +|gdef|init@crossref{|catcode`|\|active |let\|bslash +% \end{macrocode} +% Because of the popularity of the `|@|' character as a +% `letter' in macros, we normally have to change its +% |\catcode| here, and thus fulfill task 1). But the macro +% designer might use other characters as private letters as well, +% so we use a macro to do the |\catcode| switching. +% \SpecialEscapechar\| +% \begin{macrocode} + |MakePrivateLetters +% \end{macrocode} +% Now we |\catcode| the special escape character to 13 and +% |\let| it equal |\scan@macro|, i.e.\ fulfill tasks 4) +% and 5). Note the use of |\expandafter| to insert the chosen +% escape character saved in |\special@escape@char| and +% |\active@escape@char|. +% \SpecialEscapechar\| +% \begin{macrocode} + |catcode|expandafter`|special@escape@char|active + |expandafter|let|active@escape@char|scan@macro} +|endgroup +% \end{macrocode} +% If there is no special escape character, i.e.\ if +% |\SpecialEscapechar| is |\\|, the second last line will +% overwrite the previous definition of $|\|_{13}$. In this +% way all tasks are fulfilled. +% +% For happy documenting we give default values to +% |\special@escape@char| and |\active@escape@char| with +% the following line: +% \begin{macrocode} +\SpecialEscapechar{\\} +% \end{macrocode} +% \end{macro} +% +% +% +% \begin{macro}{\MakePrivateLetters} +% Here is the default definition of this command, which makes just +% the |@| into a letter. The user may change it if he/she +% needs more or other characters masquerading as letters. +% \begin{macrocode} +\@ifundefined{MakePrivateLetters} + {\let\MakePrivateLetters\makeatletter}{} +% \end{macrocode} +% \end{macro} +% +% \begin{macro}{\close@crossref} +% At the end of a cross-referencing part we prepare ourselves for +% the next one by setting the escape character to `|\|'. +% \begin{macrocode} +\def\close@crossref{\SpecialEscapechar\\} +% \end{macrocode} +% \end{macro} +% +% +% +% +% \subsection{Macros for scanning macro names} +% +% \begin{macro}{\scan@macro} +% \changes{v1.5k}{1989/09/04}{Support for checksum added.} +% \begin{macro}{\macro@namepart} +% The |\init@crossref| will have made |\active| our +% |\special@escape@char|, so that each +% |\active@escape@char| will invoke |\scan@macro| when +% within the \textsf{macrocode} environment. By this means, we can +% automatically add index entries for every \TeX-like command which +% is met whilst setting (in verbatim) the contents of +% \textsf{macrocode} environments. +% \begin{macrocode} +\def\scan@macro{% +% \end{macrocode} +% First we output the character which triggered this macro. Its +% version |\catcode|$\,$d to 12 is saved in +% |\special@escape@char|. We also call |\step@checksum| +% to generate later on a proper check-sum (see section +% \ref{sec:checksum} for details). +% \begin{macrocode} + \special@escape@char + \step@checksum +% \end{macrocode} +% If the \textsf{macrocode} environment contains, for example, the +% command |\\|, the second |\| should not start the +% scanning mechanism. Therefore we use a switch to decide if +% scanning of macro names is allowed. +% \begin{macrocode} + \ifscan@allowed +% \end{macrocode} +% The macro assembles the letters forming a \TeX\ command in +% |\macro@namepart| so this is initially cleared; we then set +% |\next| to the \textit{first\/} character following the +% |\| and call |\macro@switch| to determine whether that +% character is a letter or not. +% \begin{macrocode} + \let\macro@namepart\@empty + \def\next{\futurelet\next\macro@switch}% +% \end{macrocode} +% As you recognize, we actually did something else, because we have +% to defer the |\futurelet| call until after the final +% |\fi|. If, on the other hand, the scanning is disabled we +% simply |\let| |\next| equal `empty'. +% \begin{macrocode} + \else \let\next\@empty \fi +% \end{macrocode} +% Now we invoke |\next| to carry out what's needed. +% \begin{macrocode} + \next} +% \end{macrocode} +% \end{macro} +% \end{macro} +% +% +% \begin{macro}{\ifscan@allowed} +% \begin{macro}{\scan@allowedtrue} +% \begin{macro}{\scan@allowedfalse} +% |\ifscan@allowed| is the switch used above to determine if +% the |\active@escape@char|\SpecialIndex{\active@escape@char} +% should start the macro scanning mechanism. +% \begin{macrocode} +\newif\ifscan@allowed \scan@allowedtrue +% \end{macrocode} +% \end{macro} +% \end{macro} +% \end{macro} +% +% +% \begin{macro}{\EnableCrossrefs} +% \begin{macro}{\DisableCrossrefs} +% At this point we might define two macros which allow the user to +% disable or enable the cross-referencing mechanism. Processing of +% files will be faster if only main index entries are generated +% (i.e., if |\DisableCrossrefs| is in force). +% \begin{macrocode} +\def\DisableCrossrefs{\@bsphack\scan@allowedfalse\@esphack} +% \end{macrocode} +% The macro |\EnableCrossrefs| will also disable any +% |\DisableCrossrefs| command encountered afterwards. +% \begin{macrocode} +\def\EnableCrossrefs{\@bsphack\scan@allowedtrue + \def\DisableCrossrefs{\@bsphack\@esphack}\@esphack} +% \end{macrocode} +% \end{macro} +% \end{macro} +% +% +% +% +% \begin{macro}{\macro@switch} +% Now that we have the character which follows the escape character +% (in |\next|), we can determine whether it's a `letter' +% (which probably includes |@|). +% +% If it is, we let |\next| invoke a macro which assembles the +% full command name. +% \begin{macrocode} +\def\macro@switch{\ifcat\noexpand\next a% + \let\next\macro@name +% \end{macrocode} +% Otherwise, we have a `single-character' command name. For all +% those single-character names, we use |\short@macro| to +% process them into suitable index entries. +% \begin{macrocode} + \else \let\next\short@macro \fi +% \end{macrocode} +% Now that we know what macro to use to process the macro name, we +% invoke it~\ldots +% \begin{macrocode} + \next} +% \end{macrocode} +% \end{macro} +% +% +% \begin{macro}{\short@macro} +% \changes{v1.5c}{1989/4/27}{Corrected bad bug by putting the +% scan@allowedfalse macro before printing +% the argument.} +% \changes{v1.7a}{1992/03/10}{Ensure character stored in +% \cs{macro@namepart} as `letter' so index exclusion works.} +% This macro will be invoked (with a single character as parameter) +% when a single-character macro name has been spotted whilst +% scanning within the \textsf{macrocode} environment. +% +% First we take a look at the |\index@excludelist| to see +% whether this macro name should produce an index entry. This is +% done by the |\ifnot@excluded| macro which assumes that the +% macro name is saved in |\macro@namepart|. The character +% mustn't be stored with a special category code or exclusion from +% the index won't work, so we employ the case-changing trick used +% elsewhere. Since the argument might be an active character, +% |\string| is used to normalize it. +% \changes{v2.0e}{1998/12/28}{Correctly use the case-changing trick.} +% \begin{macrocode} +\begingroup +\catcode`\&=12 +\gdef\short@macro#1{\begingroup + \uccode`\&=\expandafter`\string#1% + \uppercase{\def\x{\def\macro@namepart{&}}}% + \expandafter\endgroup\x + \ifnot@excluded +% \end{macrocode} +% If necessary the index entry is produced by the macro +% |\produce@index|. Depending on the actual character seen, +% this macro has to do different things, so we pass the character +% as an argument. +% \begin{macrocode} + \produce@index{#1}\fi +% \end{macrocode} +% Then we disable the cross-referencing mechanism with +% |\scan@allowedfalse| and print the actual character. The +% index entry was generated first to ensure that no page break +% intervenes (recall that a |^^M| will start a new line). +% \begin{macrocode} + \scan@allowedfalse#1% +% \end{macrocode} +% After typesetting the character we can safely enable the +% cross-referencing feature again. Note that this macro won't be +% called (since |\macro@switch| won't be called) if +% cross-referencing is globally disabled. +% \begin{macrocode} + \scan@allowedtrue } +\endgroup +% \end{macrocode} +% \end{macro} +% +% +% +% \begin{macro}{\produce@index} +% \changes{v1.4s}{1989/04/23}{Added noexpand to all +% \cs{if} tests +% to avoid garbage produced by new active chars} +% \changes{v1.4s}{1989/04/23}{Used \texttt{\protect\bslash string} for +% the same reason.} +% \changes{v1.5c}{1989/4/27}{Corrected bad bug by placing the +% scan@allowedfalse macro into short@macro} +% This macro is supposed to generate a suitable |\SortIndex| +% command for a given single-letter control sequence. We test +% first for the cases which involve active characters (i.e.\ the +% backslash, the special escape character (if any), the space and +% the |^^M|). Using the |\if| test (testing for +% character codes), we have to ensure that the argument isn't +% expanded. +% \begin{macrocode} +\def\produce@index#1{% + \if\noexpand#1\special@escape@char +% \end{macrocode} +% If the character is the special escape character (or the +% `|\|' in case there was none) the |\it@is@a| macro is +% used to produce the actual |\SortIndex| call. +% \begin{macrocode} + \scan@allowedfalse \it@is@a\special@escape@char \else +% \end{macrocode} +% Next comes the test for a `|\|' which must be the +% $|\|_{13}$ expanding to |\bslash|. +% \begin{macrocode} + \if\noexpand#1\bslash \it@is@a\bslash \else +% \end{macrocode} +% Another possibility is \verb*+ +$_{13}$. Recall that |\space| +% produces a \verb*+ +$_{10}$. +% \begin{macrocode} + \if\noexpand#1\space \it@is@a\space \else +% \end{macrocode} +% The last\footnote{Well, it isn't the last active character after +% all. I added \texttt{\bslash @noligs} some days ago and now +% \texttt{`} too is active. So we have to make sure that such +% characters don't get expanded in the index.} possibility of an +% active character is |^^M|\@. In this case we don't test for +% character codes, since it is easier to look if the character is +% equal to |\par|. (We are inside the \textsf{macrocode} +% environment.) +% \begin{macrocode} + \ifx#1\par +% \end{macrocode} +% If we end up here we have just scanned a |\^^M| or something +% similar. Since this will be treated like \verb*+\ + by \TeX{} we +% produce a corresponding index entry. +% \begin{macrocode} + \it@is@a\space \else +% \end{macrocode} +% If it is the token |\relax| we do nothing. This can't happen +% when the `doc' package is used in the way described here, but was +% added to allow extensions like the \texttt{idxverb} option. +% \changes{v1.5t}{1989/11/14}{Added \cs{relax} as a possible token to +% allow extensions.} +% \begin{macrocode} + \ifx#1\relax \else +% \end{macrocode} +% The next three branches are needed because of bugs in +% our \textsf{makeindex} program. You can't produce unbalanced index +% entries\footnote{This is possible for \TeX{} if you use +% \texttt{\string{$_{12}$ \rmfamily or +% \ttfamily\string}$_{12}$}, +% but \textsf{makeindex} will complain.} +% and you have to double a percent character. To get around these +% restrictions we use special macros to produce the |\index| +% calls.\footnote{Brian \textsc{Hamilton Kelly} has written fixes for +% all three +% bugs. When they've found their way through all +% installations, +% the lines above will be removed. See +% page~\pageref{bug:fixes} if you already have them. +% (I'm not sure which versions incorporate these, but +% 2.11 is OK. See also +% \pageref{makeindex:version}.)} +% \begin{macrocode} + \if\noexpand#1\bgroup \LeftBraceIndex \else + \if\noexpand#1\egroup \RightBraceIndex \else + \if\noexpand#1\percentchar \PercentIndex \else +% \end{macrocode} +% All remaining characters are used directly to produce their index +% entries. This is possible even for the characters which have +% special meanings in the index program, provided we quote the +% characters. (This is correctly done in |\it@is@a|.) +% \begin{macrocode} + \it@is@a{\string#1}% +% \end{macrocode} +% We now need a whole pile of |\fi|$\,$s to match up with +% the |\if|$\,$s. +% \begin{macrocode} + \fi \fi \fi \fi \fi \fi \fi \fi} +% \end{macrocode} +% \end{macro} +% +% +% +% \begin{macro}{\macro@name} +% We now come to the macro which assembles command names which +% consist of one or more `letters' (which might well include +% |@| symbols, or anything else which has a |\catcode| of +% 11). +% +% To do this we add the `letter' to the existing definition of +% |\macro@namepart| (which you will recall was originally set +% to |\@empty|). +% \begin{macrocode} +\def\macro@name#1{\edef\macro@namepart{\macro@namepart#1}% +% \end{macrocode} +% Then we grab hold of the {\em next\/} single character and let +% |\more@macroname| determine whether it belongs to the letter +% string forming the command name or is a `non-letter'. +% \begin{macrocode} + \futurelet\next\more@macroname} +% \end{macrocode} +% \end{macro} +% +% +% +% +% +% \begin{macro}{\more@macroname} +% +% This causes another call of |\macro@name| to add in the next +% character, if it is indeed a `letter'. +% \begin{macrocode} +\def\more@macroname{\ifcat\noexpand\next a% + \let\next\macro@name +% \end{macrocode} +% Otherwise, it finishes off the index entry by invoking +% |\macro@finish|. +% \begin{macrocode} + \else \let\next\macro@finish \fi +% \end{macrocode} +% Here's where we invoke whatever macro was |\let| equal to +% |\next|. +% \begin{macrocode} + \next} +% \end{macrocode} +% \end{macro} +% +% +% +% +% +% \begin{macro}{\macro@finish} +% When we've assembled the full `letter'-string which forms the +% command name, we set the characters forming the entire command +% name, and generate an appropriate |\index| command (provided +% the command name is not on the list of exclusions). The +% `|\|' is already typeset; therefore we only have to output +% all `letters' saved in |\macro@namepart|. +% \begin{macrocode} +\def\macro@finish{% + \macro@namepart +% \end{macrocode} +% Then we call |\ifnot@excluded| to decide whether we have to +% produce an index entry. The construction with |\@tempa| is +% needed because we want the expansion of |\macro@namepart| in +% the |\index| command.\footnote{The \texttt{\bslash index} +% command will expand its argument in the \texttt{\bslash output} +% routine. At this time \texttt{\bslash macro@namepart} might have a +% new value.} +% \begin{macrocode} + \ifnot@excluded + \edef\@tempa{\noexpand\SpecialIndex{\bslash\macro@namepart}}% + \@tempa \fi} +% \end{macrocode} +% \end{macro} +% +% +% +% +% +% \subsection[The index exclude list]{The index exclude +% list\footnotemark} +% \footnotetext{Warning: the incomplete commentary on +% \texttt{\bslash DoNotIndex} and the macros it calls +% was written by Dave Love.} +% +% The internal form of the index exclude list is +% \begin{quote} +% \meta{macro name}|,|\meta{macro name}|,| +% \ldots|,| +% \end{quote} +% where \meta{macro name} is a macro name like +% $"\"_{12}"p"{_{11}}"@"_{11}$ or $"\"_{12}"$"_{11}$. Note that the "\" +% has category `other' and the other characters in the name are all +% `letter', regardless of their normal category. +% +% \begin{macro}{\DoNotIndex} +% This macro is used to suppress macro names in the index. It +% starts off with a new group because we have to change the +% |\catcode|$\,$s of all characters which belong to `letters' +% while macros are defined. +% \begin{macrocode} +\def\DoNotIndex{\begingroup \MakePrivateLetters + \catcode`\\12 +% \end{macrocode} +% Then we call the macro which actually reads the argument given by +% the user. +% \begin{macrocode} + \do@not@index} +% \end{macrocode} +% \end{macro} +% +% +% +% \begin{macro}{\do@not@index} +% We make the |\do@not@index| macro |\long| +% since the user might want to exclude the |\par| +% macro. +% \begin{macrocode} +\long\def\do@not@index#1{% +% \end{macrocode} +% It just adds to a token list after finishing the group in which +% the catcodes were changed. +% \changes{v1.7a}{1992/02/26}{Replaced with newdoc version.} +% \begin{macrocode} + \endgroup + \addto@hook\index@excludelist{#1,}} +% \end{macrocode} +% \end{macro} +% +% \begin{macro}{\addto@hook} +% The code for adding tokens (the second argument) to a token list +% (the first argument) is taken from~\cite{art:verbatim}, but it needs +% to be "\long" in case "\par" is amongst the tokens. +% \begin{macrocode} +\long\def\addto@hook#1#2{#1\expandafter{\the#1#2}} +% \end{macrocode} +% \end{macro} +% +% \begin{macro}{\index@excludelist} +% We need an initially-empty register for the excluded list. +% \begin{macrocode} +\newtoks\index@excludelist +\index@excludelist{} +% \end{macrocode} +% \end{macro} +% +% \begin{macro}{\ifnot@excluded} +% \changes{v1.7a}{1992/02/26}{Replaced with newdoc version.} +% \begin{macro}{\expanded@notin} +% Now we take a look at the |\index@excludelist| to see +% whether a macro name saved in |\macro@namepart| should +% produce an index entry. This macro is a pseudo |\if|; it +% should expand to |\iftrue| or |\iffalse| depending on +% the contents of |\index@excludelist|. +% \begin{macrocode} +\begingroup +% \end{macrocode} +% First we change "\catcode"s so that "\" is `other' and "|" a +% temporary for the escape character. This is necessary since our +% macro names are stored that way in the "\index@excludelist". +% \begin{macrocode} +\catcode`\|=0% +\catcode`\\=12 +% \end{macrocode} +% Then we define "\ifnot@excluded" to call "\expanded@notin" with +% two arguments: the first is the string "\" followed by the +% contents of "\macro@namepart" followed by a "," and the second is +% "\the" followed by "\index@excludelist". To achieve the expansion +% of "\macro@namepart", i.e.\ to pass its contents, we need a +% suitable number of "\expandafter"s. +% \SpecialEscapechar{\|} +% \begin{macrocode} +|gdef|ifnot@excluded{|expandafter + |expanded@notin|expandafter{|expandafter + \|macro@namepart,}{|the|index@excludelist}} +|endgroup +% \end{macrocode} +% The macro "\expanded@notin" now does the dirty work. It first +% defines a macro "\in@@" with a very special parameter text. If +% you look closely "\in@@" has three arguments, the first one is +% delimited by the first argument of "\expanded@notin" (i.e.\ by +% the string starting with a "\" and ending with a "," above), the +% second is undelimited (which means that it will get the next +% token after our string, and the third is delimited again and will +% get the rest up to the token "\in@@". In other words the token +% "\in@@" is also used as a delimiter. +% \begin{macrocode} +\def\expanded@notin#1#2{% + \def\in@@##1#1##2##3\in@@{% +% \end{macrocode} +% Now the replacement text simply compares the second argument +% (i.e.\ the undelimited one after our string) to the token +% "\expanded@notin". This is an unclosed "\ifx" statement which +% means that this macro behaves similar to a normal \TeX{} +% conditional. +% \begin{macrocode} + \ifx\expanded@notin##2}% +% \end{macrocode} +% After all these preparations we call "\in@@". First we expand the +% token after "\in@@" (which is "\the" from the second argument to +% "\expanded@notin"). As a result we get the contents of the +% "\index@excludelist" inserted after "\in@@". After this contents +% we add once more the string we are looking for, then the token +% "\expanded@notin" and finally the token "\in@@". +% \begin{macrocode} + \expandafter\in@@#2#1\expanded@notin\in@@} +% \end{macrocode} +% Now what happens when the macro "\in@@" above gets called? The +% first argument to "\in@@" is delimited by our string. In other +% words it will get everything from the contents of +% "\index@excludelist" before this string. If the string is not in +% "\index@excludelist" then it gets the whole contents, since after +% it we had inserted the string one more. In this case the next +% token is "\expanded@notin" which gets assigned to the second +% argument and the third argument will be empty. If, on the other +% hand, the string was inside "\index@excludelist" then the second +% argument will not be the token "\expanded@notin" and the third +% argument will be all the garbage up to "\in@@". Therefore testing +% the seconded argument, as done in the definition of "\in@@" will +% tell us whether or not the string is in "\index@includelist" and +% this was exactly what we wanted. (Deep breath.) You got +% that?\footnote{\TeX{}book page 125. The code described above is +% originally due to Michael Spivak who used a similar method within +% the \AmSTeX{} macros.} +% \end{macro} +% \end{macro} +% +% +% +% +% +% +% +% \subsection{Macros for generating index entries} +% +% Here we provide default definitions for the macros invoked to create +% index entries; these are either invoked explicitly, or automatically +% by |\scan@macro|. As already mentioned, the definitions given +% here presuppose that the |.idx| file will be processed by +% Chen's \textsf{makeindex} program --- they may be redefined for use +% with the user's favourite such program. +% +% To assist the reader in locating items in the index, all such +% entries are sorted alphabetically {\em ignoring\/} the initial +% `|\|'; this is achieved by issuing an |\index| command which +% contains the `actual' operator for \textsf{makeindex}. The default +% value for the latter operator is `|@|', but the latter character is +% so popular in \LaTeX\ package files that it is necessary to substitute +% another character. This is indicated to \textsf{makeindex} by means +% of an `index style file'; the character selected for this function +% is |=|, and therefore this character too must be specially treated +% when it is met in a \TeX\ command. A suitable index style file is +% provided amongst the supporting files for this style file in +% \texttt{gind.ist} and is generated from this source by processing +% with \texttt{docstrip} to extract the module \textbf{gind}. A +% similar style file \texttt{gglo.ist} is supplied for sorting the +% change information in the glossary file and is extracted as module +% \textbf{gglo}. First of all we add some information to the front of +% the \texttt{.ist} files. \changes{v1.7a}{1992/03/11}{glo.ist and +% gind.ist now derivable from doc.dtx with docstrip.} +% \begin{macrocode} +% +%<+gind|gglo>%% This is a MAKEINDEX style file which should be used to +%<+gind>%% generate the formatted index for use with the doc +%<+gglo>%% generate the formatted change history for use with the doc +%<+gind|gglo>%% package. The TeX commands used below are defined in +%<+gind|gglo>%% doc.sty. The commands for MAKEINDEX like `level' +%<+gind|gglo>%% `item_x1' are described in `` Makeindex, A General +%<+gind|gglo>%% Purpose, Formatter-Independent Index Processor'' by +%<+gind|gglo>%% Pehong Chen. +%<+gind|gglo> +% \end{macrocode} +% +% \begin{macro}{\actualchar} +% \begin{macro}{\quotechar} +% \begin{macro}{\levelchar} +% First come the definitions of |\actualchar|, +% |\quotechar| and |\levelchar|. Note, that our defaults +% are not the ones used by the \textsf{makeindex} program without a +% style file. +% \begin{macrocode} +%<*package> +\@ifundefined{actualchar}{\def\actualchar{=}}{} +\@ifundefined{quotechar}{\def\quotechar{!}}{} +\@ifundefined{levelchar}{\def\levelchar{>}}{} +% +%<+gind|gglo>actual '=' +%<+gind|gglo>quote '!' +%<+gind|gglo>level '>' +%<*package> +% \end{macrocode} +% \end{macro} +% \end{macro} +% \end{macro} +% +% +% \begin{macro}{\encapchar} +% The \textsf{makeindex} default for the |\encapchar| isn't +% changed. +% \begin{macrocode} +\@ifundefined{encapchar}{\def\encapchar{|}}{} +% \end{macrocode} +% \end{macro} +% +% +% \begin{macro}{\verbatimchar} +% We also need a special character to be used as a delimiter for +% the |\verb*| command used in the definitions below. +% \begin{macrocode} +\@ifundefined{verbatimchar}{\def\verbatimchar{+}}{} +% \end{macrocode} +% \end{macro} +% +% +% \begin{macro}{\SpecialIndex} +% The |\SpecialIndex| command creates index entries for +% macros. If the argument is |\|$xyz$, the command produces +% \verb|\indexentry{|$xyz$\verb|=\verb!*+\|$xyz$\verb|+}{|$n$\verb|}| +% given the above defined defaults for |\actualchar|, +% |\quotechar| and |\verbatimchar|. We first remove the +% initial `|\|' to get a better index. +% \changes{v1.5s}{1989/11/05}{Support for code line no. (Undoc)} +% \begin{macrocode} +\def\SpecialIndex#1{\@bsphack\special@index{\expandafter\@gobble + \string#1\actualchar +% \end{macrocode} +% Then follows the actual entry. A |\quotechar| is placed +% before the |*| to allow its use as a special \textsf{makeindex} +% character. Again |\@bsphack| and |\@esphack| are used +% to make the macros invisible. +% \begin{macrocode} + \string\verb\quotechar*\verbatimchar\string#1\verbatimchar}% + \@esphack} +% \end{macrocode} +% \end{macro} + +% \begin{macro}{\SpecialMainIndex} +% \begin{macro}{\SpecialMainEnvIndex} +% \begin{macro}{\SpecialUsageIndex} +% The |\SpecialMainIndex| macro is used to cross-reference the +% names introduced by the \textsf{macro} environment. The action is +% as for |\SpecialIndex|, except that \textsf{makeindex} is +% instructed to `encap'sulate the entry with the string +% \verb=|main= to cause it to generate a call of the |\main| +% macro. +% \changes{v1.5s}{1989/11/05}{Support for code line no. (Undoc)} +% \changes{v2.0c}{1998/08/22}{Correctly handle single character +% control sequences like \cs{<}.} +% +% |\SpecialMainIndex| passes the macro name to be indexed on to the +% macro |\SpecialIndex@|. +% \begin{macrocode} +\def\SpecialMainIndex#1{\@bsphack\SpecialIndex@{#1}{\encapchar main}% + \@esphack} +% \end{macrocode} +% +% \begin{macro}{\SpecialIndex@} +% \changes{v2.0c}{1998/08/22}{Macro added.} +% \changes{v2.0f}{1999/02/27}{Temp fix to allow strange code in arg 1 +% (PR 2968)} +% The macro |\SpecialIndex@| does the real work for |\SpecialMainIndex| +% and |\SpecialUsageIndex|. It takes two arguments: the macro to be +% indexed (as a control sequence or list of character tokens) and the +% additional text for the index. +% \changes{v2.0g}{1999/03/22}{Correct so-called temp fix. I'm not going to +% explain this.} +% \begin{macrocode} +\begingroup + \catcode`\|=0 + \catcode`\\=12 + |gdef|@SpecialIndexHelper@#1#2|@nil{% + |if |noexpand#1\% + |gdef|@gtempa{#2}% + |else + |begingroup + |escapechar|m@ne + |expandafter|gdef|expandafter|@gtempa|expandafter{|string#1#2}% + |endgroup + |fi} +|endgroup +\def\SpecialIndex@#1#2{% +% \end{macrocode} +% The first thing it does is to convert the macro into a list of +% characters. Note that a character token list remains (mostly) unchanged. +% \begin{macrocode} + \@SpecialIndexHelper@#1\@nil +% \end{macrocode} +% The macro name \verb*|\ | has to handled in a special way. The reason +% is that the space token is skipped when \TeX\ is scanning macro +% parameters, so that the trick used below will not work. +% So, we check whether the replacement text of |\@tempa| starts with +% a space token and write the appropriate index entry. +% \begin{macrocode} + \def\@tempb{ }% + \ifcat \@tempb\@gtempa + \special@index{\quotechar\space\actualchar + \string\verb\quotechar*\verbatimchar + \quotechar\bslash\quotechar\space\verbatimchar#2}% + \else +% \end{macrocode} +% Having handled this special case we have to distinguish control +% sequences consisting of one or more +% letters and those that consists of exactly one nonletter. As character +% tokens in the replacement text of the macro |\@gtempa| have all +% category code $12$ (other), this is difficult. For simplicity, we treat +% all single character control sequences alike, irregardless of whether +% the character is a letter or not. This has the advantage that it works +% even for strange settings of the category codes. +% +% We define a utility macro |\@tempb| with two arguments, the second +% delimited by |\relax|. +% It will be called later so that the first argument is the first character +% of the macro name, and the second argument receives the rest of the +% characters. So we distinguish the two cases above by checking whether +% the second argument is empty. +% \begin{macrocode} + \def\@tempb##1##2\relax{\ifx\relax##2\relax +% \end{macrocode} +% If so, we define the helper macro |\@tempc| in a way that it +% adds quotechars in critical places. +% \begin{macrocode} + \def\@tempc{\special@index{\quotechar##1\actualchar + \string\verb\quotechar*\verbatimchar + \quotechar\bslash\quotechar##1\verbatimchar#2}}% +% \end{macrocode} +% Otherwise we write the characters as in |\SpecialIndex|. +% \begin{macrocode} + \else + \def\@tempc{\special@index{##1##2\actualchar + \string\verb\quotechar*\verbatimchar + \bslash##1##2\verbatimchar#2}}% + \fi}% +% \end{macrocode} +% Now pass the list of characters to \@tempb and call \@tempc to do the +% work. +% \begin{macrocode} + \expandafter\@tempb\@gtempa\relax + \@tempc + \fi} +% \end{macrocode} +% \end{macro} +% +% Slightly simpler is the main entry for environments +% \changes{v1.9e}{1994/02/03}{use \cs{ttfamily} with \cs{string}} +% \changes{v1.9f}{1994/02/07}{should have used \cs{noexpand}, sigh} +% \changes{v1.9i}{1994/02/11}{should have used \cs{protect}} +% \changes{v1.9j}{1994/02/16}{Back to string:-)} +% \changes{v1.9s}{1994/10/14}{Added missing percent and changed to +% \cs{ttfamily}} +% \changes{v2.0d}{1998/12/20}{Correctly handle second index entry +% by using \cs{special@index} not \cs{index} (PR/2928).} +% \changes{v2.0e}{1998/12/28}{Use \cs{string}, not \cs{protect} in argument to +% \cs{special@index}.} +% \changes{v2.1b}{2004/02/09}{environment names incorrectly sorted in +% index (pr/3615)} +% \begin{macrocode} +\def\SpecialMainEnvIndex#1{\@bsphack\special@index{% + #1\actualchar + {\string\ttfamily\space#1} + (environment)% + \encapchar main}% + \special@index{environments:\levelchar#1\actualchar{% + \string\ttfamily\space#1}\encapchar + main}\@esphack} +% \end{macrocode} +% The |\SpecialUsageIndex| is similar to |\SpecialMainIndex|, except +% that it uses the standard |\index| command. +% \texttt{usage} instead of \texttt{main}. +% \begin{macrocode} +\def\SpecialUsageIndex#1{\@bsphack + {\let\special@index\index\SpecialIndex@{#1}{\encapchar usage}}% + \@esphack} +% \end{macrocode} +% \end{macro} +% \end{macro} +% \end{macro} +% +% +% +% +% \begin{macro}{\SpecialEnvIndex} +% Indexing environments is done a little bit differently; we produce +% two index entries with the |\SpecialEnvIndex| macro: +% \changes{v1.9e}{1994/02/03}{The index needs protecting} +% \changes{v1.9g}{1994/02/08}{should have used \cs{noexpand}, sigh} +% \changes{v1.9i}{1994/02/11}{should have used \cs{protect}} +% \begin{macrocode} +\def\SpecialEnvIndex#1{\@bsphack +% \end{macrocode} +% First we sort the environment under its own name stating in the +% actual entry that this is an environment. +% \begin{macrocode} + \index{#1\actualchar{\protect\ttfamily#1} + (environment)\encapchar usage}% +% \end{macrocode} +% The second entry is sorted as a subitem under the key +% `environments:'. +% \changes{v2.1b}{2004/02/09}{environment names incorrectly sorted in +% index (pr/3615)} +% \begin{macrocode} + \index{environments:#1\actualchar\levelchar{\protect\ttfamily#1}\encapchar + usage}\@esphack} +% \end{macrocode} +% Because both entries correspond to `descriptions' of the +% environment, we encapsulate the page numbers with the +% |\usage| macro. +% \end{macro} +% +% +% +% \begin{macro}{\SortIndex} +% This macro is used to generate the index entries for any +% single-character command that |\scan@macro| encounters. The +% first parameter specifies the lexical order for the character, +% whilst the second gives the actual characters to be printed in +% the entry. It can also be used directly to generate index entries +% which differ in sort key and actual entry. +% \begin{macrocode} +\def\SortIndex#1#2{\index{#1\actualchar#2}} +% \end{macrocode} +% \end{macro} +% +% +% +% \begin{macro}{\it@is@a} +% This macro is supposed to produce a correct |\SortIndex| +% entry for a given character. Since this character might be +% recognised as a `command' character by the index program used, +% all characters are quoted with the |\quotechar|. +% \changes{v1.5s}{1989/11/05}{Support for code line no. (Undoc)} +% \begin{macrocode} +\def\it@is@a#1{\special@index{\quotechar #1\actualchar + \string\verb\quotechar*\verbatimchar + \quotechar\bslash\quotechar#1\verbatimchar}} +% \end{macrocode} +% \end{macro} +% +% +% +% \begin{macro}{\LeftBraceIndex} +% \changes{v1.5s}{1989/11/05}{Support for code line no. (Undoc)} +% \begin{macro}{\RightBraceIndex} +% \changes{v1.5s}{1989/11/05}{Support for code line no. (Undoc)} These +% two macros fix the problems with \textsf{makeindex}. Note the +% `hack' with |\iffalse}\fi| to satisfy both \TeX{} and the +% \textsf{makeindex} program. When this is written to the +% \texttt{.idx} file \TeX{} will see both braces (so we get a +% balanced text). \textsf{makeindex} will also see balanced braces +% but when the actual index entry is again processed by \TeX{} the +% brace in between |\iffalse| |\fi| will vanish. +% \begin{macrocode} +\@ifundefined{LeftBraceIndex}{\def\LeftBraceIndex{% + \special@index{\bgroup\actualchar\string\verb\quotechar*\verbatimchar + \quotechar\bslash{\verbatimchar\string\iffalse}\string\fi}}}{} + +\@ifundefined{RightBraceIndex}{\def\RightBraceIndex{% + \special@index{\egroup\actualchar\string\iffalse{\string\fi\string\verb + \quotechar*\verbatimchar\quotechar\bslash}\verbatimchar}}}{} +% \end{macrocode} +% \end{macro} +% \end{macro} +% +% +% \begin{macro}{\PercentIndex} +% \changes{v1.5s}{1989/11/05}{Support for code line no. (Undoc)} +% \changes{v1.7c}{1992/03/25}{Default now for bug-fixed makeindex} +% By default we assume a version of \textsf{makeindex} without the +% percent bug is being used. +% \begin{macrocode} +\@ifundefined{PercentIndex} + {\def\PercentIndex{\it@is@a\percentchar}}{} +% \end{macrocode} +% \end{macro} +% \begin{macro}{\OldMakeindex} +% \changes{v1.7c}{1992/03/26}{Replaced \cs{NewMakeIndex}.} +% \begin{macro}{\percentchar} +% Here is one solution for the percent bug in \textsf{makeindex}. +% The macro |\percentchar| denotes a |%|$_{12}$. Calling this from +% a package or the driver file sets things up +% appropriately.\label{bug:fixes} +% \begin{macrocode} +\def\OldMakeindex{\def\PercentIndex{% + \special@index{\quotechar\percentchar\actualchar\string\verb + \quotechar*\verbatimchar\quotechar\bslash + \percentchar\percentchar\verbatimchar}}} +{\catcode`\%=12 \gdef\percentchar{%}} +% \end{macrocode} +% \end{macro} +% \end{macro} +% +% +% +% +% +% +% \subsection{Redefining the \textsf{index} environment} +% +%\changes{v1.4r}{1989/04/22}{twocols env. placed into separate file} +%\changes{v1.4?}{1989/04/19}{use DEK's algorithm and implement +% a twocols env.} +%\changes{v1.4?}{1989/04/16}{changes to the index env.} +%\changes{v1.5a}{1989/04/26}{Now input multicol.sty instead of +% multcols.sty} +% \begin{macro}{\ifhave@multicol} +% \changes{v1.7a}{1992/03/04}{Added to support avoiding multicol.sty} By +% default the index is set in three columns, and will start on the +% same page as, and underneath, the last part of the text of the +% documented package file, if possible. The last page will be +% reformatted with balanced columns. This requires the +% \textsf{multicols} environment which is described elsewhere. So +% that \DOC{} can be run independently of +% \texttt{multicol.sty} we first check for its existence and set +% the "have@multicol" flag appropriately for use below. +% \changes{v1.9a}{1993/12/02}{Use \cs{IfFileExists}} +% \changes{v1.9m}{1994/04/28}{Use \cs{RequirePackage} to load multicol} +% \begin{macrocode} +\newif\ifhave@multicol +% \end{macrocode} +% If we found \texttt{multicol.sty} we use it. It would be nice to +% delay this (and the re-definition of "theindex") until we knew +% whether an index was actually required \ldots +% \begin{macrocode} +\IfFileExists{multicol.sty}{\have@multicoltrue + \RequirePackage{multicol}% + }{} +% \end{macrocode} +% \end{macro} + +% +% \begin{macro}{\IndexMin} +% \begin{macro}{\c@IndexColumns} +% \changes{v1.4t}{1989/04/24}{Counter added.} +% If \texttt{multicol} is in use, +% when the index is started we compute the remaining space on the +% current page; if it is greater than |\IndexMin|, the first +% part of the index will then be placed in the available space. +% The number of columns set is controlled by the counter +% |\c@IndexColumns| which can be changed with a +% |\setcounter| declaration. +% \begin{macrocode} +\newdimen\IndexMin \IndexMin = 80pt +\newcount\c@IndexColumns \c@IndexColumns = 3 +% \end{macrocode} +% \end{macro} +% \end{macro} +% +% +% \begin{macro}{\theindex} +% Now we start the multi-column mechanism, if appropriate. We use the +% \LaTeX{} counter |\c@IndexColumns| declared above to denote +% the number of columns and insert the `index prologue' text (which +% might contain a |\section| call, etc.). See the default +% definition for an example. +% \changes{v1.4t}{1989/04/24}{Incorporated new multicols env.} +% \changes{v1.5a}{1989/04/26}{Call multicols first} +% \changes{v1.6e}{1991/04/03}{Turned into env definition.} +% \changes{v1.7a}{1992/03/04}{Include test for multicols.} +% \begin{macrocode} +\ifhave@multicol + \renewenvironment{theindex} + {\begin{multicols}\c@IndexColumns[\index@prologue][\IndexMin]% +% \end{macrocode} +% Then we make a few last minute assignments to read the individual +% index |\item|$\,$s and finish off by ignoring any initial +% space. +% \begin{macrocode} + \IndexParms \let\item\@idxitem \ignorespaces}% +% \end{macrocode} +% \end{macro} +% \begin{macro}{\endtheindex} +% \changes{v1.4t}{1989/04/24}{Incorporated new multicols env.} +% At the end of the index, we have only to end the \textsf{multicols} +% environment. +% \begin{macrocode} + {\end{multicols}} +% \end{macrocode} +% If we can't use \textsf{multicols} we warn the user and use an +% environment that's basically the one from \texttt{article.sty}. +% \begin{macrocode} +\else + \typeout{Can't find multicol.sty -- will use normal index layout if + necessary.} + \def\theindex{\@restonecoltrue\if@twocolumn\@restonecolfalse\fi + \columnseprule \z@ \columnsep 35\p@ + \twocolumn[\index@prologue]% + \IndexParms \let\item\@idxitem \ignorespaces} + \def\endtheindex{\if@restonecol\onecolumn\else\clearpage\fi} +\fi +% \end{macrocode} +% \end{macro} +% Here are the necessary \textsf{makeindex} declarations. We disable +% scanning of macro names inside the index with "\scan@allowedfalse\n" +% to avoid recursion. +% \begin{macrocode} +% +%<+gind>preamble +%<+gind>"\n \\begin{theindex} \n \\makeatletter\\scan@allowedfalse\n" +%<+gind>postamble +%<+gind>"\n\n \\end{theindex}\n" +%<*package> +% \end{macrocode} +% +% +% \begin{macro}{\IndexPrologue} +% \begin{macro}{\index@prologue} +% \changes{v1.9w}{1995/12/27}{Text changed} +% \changes{v1.9x}{1996/01/11}{Text depends on code lines used} +% The |\IndexPrologue| macro is used to place a short message +% into the document above the index. It is implemented by +% redefining |\index@prologue|, a macro which holds the +% default text. We'd better make it a |\long| macro to allow +% |\par| commands in its argument. +% \begin{macrocode} +\long\def\IndexPrologue#1{\@bsphack\def\index@prologue{#1}\@esphack} +% \end{macrocode} +% Now we test whether the default is already defined by another +% package file. If not we define it. +% \changes{v2.0j}{2000/05/22}{Less obscure wording? (CAR pr/3202)} +% \begin{macrocode} +\@ifundefined{index@prologue} + {\def\index@prologue{\section*{Index}% + \markboth{Index}{Index}% + Numbers written in italic refer to the page + where the corresponding entry is described; + numbers underlined refer to the + \ifcodeline@index + code line of the + \fi + definition; numbers in roman refer to the + \ifcodeline@index + code lines + \else + pages + \fi + where the entry is used. + }}{} +% \end{macrocode} +% \end{macro} +% \end{macro} +% +% +% +% \begin{macro}{\IndexParms} +% These are some last-minute assignments for formatting the index +% entries. They are defined in a separate macro so that a user can +% substitute different definitions. We start by defining the +% various parameters controlling leading and the separation between +% the two columns. The entire index is set in |\small| size. +% \begin{macrocode} +\@ifundefined{IndexParms} + {\def\IndexParms{% + \parindent \z@ + \columnsep 15pt + \parskip 0pt plus 1pt + \rightskip 15pt + \mathsurround \z@ + \parfillskip=-15pt + \small +% \end{macrocode} +% \begin{macro}{\@idxitem} +% \begin{macro}{\subitem} +% \begin{macro}{\subsubitem} +% Index items are formatted with hanging indentation for any items +% which may require more than one line. +% \begin{macrocode} + \def\@idxitem{\par\hangindent 30pt}% +% \end{macrocode} +% Any sub-item in the index is formatted with a 15pt indentation +% under its main heading. +% \begin{macrocode} + \def\subitem{\@idxitem\hspace*{15pt}}% +% \end{macrocode} +% Whilst sub-sub-items go in a further 10pt. +% \begin{macrocode} + \def\subsubitem{\@idxitem\hspace*{25pt}}% +% \end{macrocode} +% \begin{macro}{\indexspace} +% The \textsf{makeindex} program generates an |\indexspace| +% before each new alphabetic section commences. After this final +% definition we end the |\@ifundefined| and the definition of +% |\IndexParms|. +% \begin{macrocode} + \def\indexspace{\par\vspace{10pt plus 2pt minus 3pt}}% + }}{} +% \end{macrocode} +% \end{macro} +% \end{macro} +% \end{macro} +% \end{macro} +% \end{macro} +% +% +% \begin{macro}{\efill} +% This definition of |\efill| is intended to be used after index +% items which have no following text (for example, ``\textit{ +% see\/}'' entries). It just ensures that the current line is +% filled, preventing ``|Underfull \hbox|'' messages. +% \begin{macrocode} +\def\efill{\hfill\nopagebreak}% +% +%<+gind|gglo>item_x1 "\\efill \n \\subitem " +%<+gglo>item_x2 "\\ " +%<+gind>item_x2 "\\efill \n \\subsubitem " +%<*package> +% \end{macrocode} +% \end{macro} +% +% +% +% \begin{macro}{\pfill} +% \begin{macro}{\dotfil} +% \begin{macro}{\dotfill} +% The following definitions provide the |\pfill| command; if +% this is specified in the index style file to \textsf{makeindex} as +% the delimiter to appear after index items, then the intervening +% space before the referenced page numbers will be filled with +% dots, with a little white space interpolated at each end of the +% dots. If the line is broken the dots will show up on both lines. +% \begin{macrocode} +\def\dotfill{\leaders\hbox to.6em{\hss .\hss}\hskip\z@ plus 1fill}% +\def\dotfil{\leaders\hbox to.6em{\hss .\hss}\hfil}% +\def\pfill{\unskip~\dotfill\penalty500\strut\nobreak + \dotfil~\ignorespaces}% +% +%<+gind|gglo>delim_0 "\\pfill " +%<+gind|gglo>delim_1 "\\pfill " +%<+gind|gglo>delim_2 "\\pfill " +%<*package> +% \end{macrocode} +% \end{macro} +% \end{macro} +% \end{macro} +% +% +% +% \begin{macro}{\*} +% Here is the definition for the |\*| macro. It isn't used in +% this set of macros. +% \begin{macrocode} +\def\*{\leavevmode\lower.8ex\hbox{$\,\widetilde{\ }\,$}} +% \end{macrocode} +% \end{macro} +% +% +% \begin{macro}{\main} +% The \textit{defining\/} entry for a macro name is flagged with +% the string \texttt{\encapchar main}\footnote{With the current +% definition of \texttt{\bslash encapchar} substituted for +% \texttt{\encapchar}} in the |\index| command; \textsf{makeindex} +% processes this so that the |\main| macro will be invoked to +% underline the page number(s) on which the {\em definition\/} of +% the macro will be found. +% \begin{macrocode} +\@ifundefined{main}{\def\main#1{\underline{#1}}}{} +% \end{macrocode} +% \end{macro} +% +% \begin{macro}{\usage} +% The |\usage| macro is used to indicate entries describing +% the usage of a macro. The corresponding page number(s) will be +% set in \textit{italics}. +% \begin{macrocode} +\@ifundefined{usage}{\def\usage#1{\textit{#1}}}{} +% \end{macrocode} +% \end{macro} +% +% +% \begin{macro}{\PrintIndex} +% \changes{v1.5k}{1989/09/04}{\cs{printindex} changed to +% \cs{PrintIndex}} +% \changes{v1.7a}{1992/02/26}{Documentation moved to interface section.} +% \changes{v1.9h}{1994/02/10}{Use \cs{@input@} instead of \cs{@input}.} +% \changes{v1.9w}{1995/12/29}{Turn the cmd into a noop after use.} +% This is the same as "\printindex" in the \textsf{makeidx} package. +% \begin{macrocode} +\def\PrintIndex{\@input@{\jobname.ind}% + \global\let\PrintIndex\@empty} +% \end{macrocode} +% \end{macro} +% +% \begin{macro}{\printindex} +% Since the above macro was called |\printindex| in older versions +% of \texttt{doc.sty} the following definition was provided up to +% version 1.9y. +% \changes{v1.9z}{1996/04/17}{Commented out} +% \begin{macrocode} +%\def\printindex{\typeout{\string\printindex\space is obsolete!}% +% \typeout{Please use \string\PrintIndex\space +% if you are a macro implementor^^J +% or get a newer version of the documented +% software if you are a user}% +% \PrintIndex} +% \end{macrocode} +% \end{macro} +% +% We want headings in the index (and changes list) according to the +% initial character of the next block of entries and have to instruct +% \textsf{makeindex} appropriately. Unfortunately the specification +% for this changed sometime between versions 2.4 and 2.11 of +% \textsf{makeindex}. We provide both ways of doing it but +% unfortunately this will always produce a warning message from +% \textsf{makeindex}. This is for older versions: +% \changes{v1.7h}{1992/07/01}{Turn off headings in gls file} +% \begin{macrocode} +% +%<+gind,gglo>% The next lines will produce some warnings when +%<+gind,gglo>% running Makeindex as they try to cover two different +%<+gind,gglo>% versions of the program: +%<+gind,gglo>lethead_prefix "{\\bfseries\\hfil " +%<+gind,gglo>lethead_suffix "\\hfil}\\nopagebreak\n" +%<+gind>lethead_flag 1 +%<+gglo>lethead_flag 0 +% \end{macrocode} +% This works for newer ones: +% \begin{macrocode} +%<+gind,gglo>heading_prefix "{\\bfseries\\hfil " +%<+gind,gglo>heading_suffix "\\hfil}\\nopagebreak\n" +%<+gind>headings_flag 1 +%<+gglo>headings_flag 0 +%<*package> +% \end{macrocode} +% +% +% +% \subsection[Dealing with the change history] +% {Dealing with the change history\footnotemark} +% \footnotetext{The whole section was proposed by Brian \textsc{Hamilton +% Kelly}. He also documented and debugged the macros as +% well as many other parts of this package.} +% +% To provide a change history log, the |\changes| command has +% been introduced. This takes three arguments, respectively, the +% version number of the file, the date of the change, and some detail +% regarding what change has been made. The first of these arguments +% is otherwise ignored, but the others are written out and may be used +% to generate a history of changes, to be printed at the end of the +% document. However, note that older versions of Chen's standard +% \textsf{makeindex} +% program limit any textual field to just 64 characters; therefore, +% is important that the number of characters in the second and third +% parameters should not exceed 61 altogether (to allow for the +% parentheses placed around the date). +% +% \begin{macro}{\changes} +% \changes{BHK}{1989/04/26}{Documented \texttt{\protect\bslash changes} +% command.} +% \changes{BHK}{1989/04/26}{Changed definition of +% \texttt{\protect\bslash protect}.} The output of the |\changes| +% command goes into the \meta{Glossary\_File} and therefore uses +% the normal |\glossaryentry| commands.\footnote{Note that a recent +% change in \LaTeX{} 2.09 changed the command name in the +% \texttt{.glo} file from \texttt{\bslash indexentry} to +% \texttt{\bslash glossaryentry}. It is therefore necessary to +% have a special \textsf{makeindex} style file called +% \texttt{gglo.ist} to process this file correctly.} Thus +% \textsf{makeindex} or a similar program can be used to process +% the output into a sorted ``glossary''. The |\changes| command +% commences by taking the usual measures to hide its spacing, and +% then redefines |\protect| for use within the argument of the +% generated |\indexentry| command. +% +% We re-code nearly all chars found in |\sanitize| to letter +% since the use of special package which make some characters +% active might upset the |\changes| command when writing its +% entries to the file. However we have to leave |%| as comment +% and \verb*+ + as \meta{space} otherwise chaos will happen. +% And, of course the |\| should be available as escape +% character. +% \changes{v1.5v}{1990/01/28}{`Re-code a lot of chars.} +% \changes{v1.5m}{1989/09/20}{\cs{actualchar} in second level removed.} +% \changes{v1.5o}{1989/09/24}{New sorting.} +% \changes{v1.6c}{1990/06/29}{Again new sorting.} +% \changes{v1.9u}{1995/08/06}{Use \cs{protected@edef}} +% \begin{macrocode} +\def\changes{\@bsphack\begingroup\@sanitize + \catcode`\\\z@ \catcode`\ 10 \MakePercentIgnore + \changes@} +\def\changes@#1#2#3{% + \protected@edef\@tempa{\noexpand\glossary{#1\levelchar +% \end{macrocode} +% \changes{v1.9u}{1995/08/06}{Use value of \cs{saved@macroname} to +% find out about change entries at outer level} +% If the macro "\saved@macroname" doesn't contain any macro name +% (ie is empty) the current changes entry was done at top-level. +% In this case we preceed it by "\generalname". +% \begin{macrocode} + \ifx\saved@macroname\@empty + \space + \actualchar + \generalname + \else + \expandafter\@gobble + \saved@macroname + \actualchar + \string\verb\quotechar*% + \verbatimchar\saved@macroname + \verbatimchar + \fi + :\levelchar #3}}% + \@tempa\endgroup\@esphack} +% \end{macrocode} +% +% \begin{macro}{\saved@macroname} +% \changes{BHK}{1989/04/26}{Provided for sorting outside \textsf{macro} +% environment} The entries are sorted for convenience by the name +% of the most recently introduced macroname (i.e., that in the most +% recent |\begin{macro}| command). We therefore provide +% |\saved@macroname| to record that argument, and provide a default +% definition in case |\changes| is used outside a \textsf{macro} +% environment. (This is a {\em wicked\/} hack to get such entries +% at the beginning of the sorted list! It works providing no macro +% names start with "!" or |"|.) \changes{v1.7a}{1992/03/02}{Changed +% string used for better sorting.} +% \changes{v1.9u}{1995/08/06}{Now empty by default} +% \begin{macrocode} +\def\saved@macroname{} +% \end{macrocode} +% \end{macro} +% +% +% \begin{macro}{\generalname} +% \changes{v1.9u}{1995/08/06}{Macro added} +% This macro holds the string placed before changes entries on +% top-level. +% \begin{macrocode} +\def\generalname{General} +% \end{macrocode} +% \end{macro} +% +% +% \begin{macro}{\RecordChanges} +% \changes{BHK}{1989/04/26}{Renames former \texttt{\protect\bslash +% PrintChanges} command.} +% To cause the changes to be written (to a \texttt{.glo}) file, we +% define |\RecordChanges| to invoke \LaTeX's usual +% |\makeglossary| command. +% \begin{macrocode} +\let\RecordChanges\makeglossary +% \end{macrocode} +% \end{macro} +% \end{macro} +% +% +% \begin{macro}{\GlossaryMin} +% \changes{BHK}{1989/04/26}{Added to support +% \texttt{\protect\bslash changes}.} +% \begin{macro}{\c@GlossaryColumns} +% \changes{BHK}{1989/04/26}{Added to support \texttt{\protect\bslash +% changes}.} The remaining macros are all analogues of those used +% for the \textsf{theindex} environment. When the glossary is +% started we compute the space which remains at the bottom of the +% current page; if this is greater than |\GlossaryMin| then the +% first part of the glossary will be placed in the available space. +% The number of columns set are controlled by the counter +% |\c@GlossaryColumns| which can be changed with a |\setcounter| +% declaration. +% \begin{macrocode} +\newdimen\GlossaryMin \GlossaryMin = 80pt +\newcount\c@GlossaryColumns \c@GlossaryColumns = 2 +% \end{macrocode} +% \end{macro} +% \end{macro} +% +% +% \begin{macro}{\theglossary} +% \changes{BHK}{1989/04/26}{Added to support +% \texttt{\protect\bslash changes}.} +% \changes{v1.5p}{1989/09/28}{Now call \cs{multicols} first.} +% \changes{v1.6e}{1991/04/03}{Turned into env definition.} +% \changes{v1.7a}{1992/03/10}{Changed to work without multicols if +% necessary.} +% \begin{macro}{\endglossary} +% \changes{BHK}{1989/04/26}{Added to support +% \texttt{\protect\bslash changes}.} +% The environment \textsf{theglossary} is defined in the same manner +% as the \textsf{theindex} environment. +% \begin{macrocode} +\ifhave@multicol + \newenvironment{theglossary}{% + \begin{multicols}\c@GlossaryColumns + [\glossary@prologue][\GlossaryMin]% + \GlossaryParms \let\item\@idxitem \ignorespaces}% + {\end{multicols}} +\else + \newenvironment{theglossary}{% + \@restonecoltrue\if@twocolumn\@restonecolfalse\fi + \columnseprule \z@ \columnsep 35\p@ + \twocolumn[\glossary@prologue]% + \GlossaryParms \let\item\@idxitem \ignorespaces} + {\if@restonecol\onecolumn\else\clearpage\fi} +\fi +% \end{macrocode} +% \end{macro} +% \end{macro} +% Here are the necessary \textsf{makeindex} declarations with scanning +% disabled as for the index. +% \begin{macrocode} +% +%<+gglo>preamble +%<+gglo>"\n \\begin{theglossary} \n +%<+gglo> \\makeatletter\\scan@allowedfalse\n" +%<+gglo>postamble +%<+gglo>"\n\n \\end{theglossary}\n" +% \end{macrocode} +% This difference from \texttt{gind.ist} is necessary if you have an +% up-to-date \LaTeX. +% \begin{macrocode} +%<+gglo>keyword "\\glossaryentry" +%<*package> +% \end{macrocode} +% +% +% \begin{macro}{\GlossaryPrologue} +% \changes{BHK}{1989/04/26}{Added to support +% \texttt{\protect\bslash changes}.} +% \begin{macro}{\glossary@prologue} +% \changes{BHK}{1989/04/26}{Added to support +% \texttt{\protect\bslash changes}.} +% The |\GlossaryPrologue| macro is used to place a short +% message above the glossary into the document. It is implemented +% by redefining |\glossary@prologue|, a macro which holds the +% default text. We better make it a long macro to allow +% |\par| commands in its argument. +% \begin{macrocode} +\long\def\GlossaryPrologue#1{\@bsphack + \def\glossary@prologue{#1}% + \@esphack} +% \end{macrocode} +% Now we test whether the default is already defined by another +% package file. If not we define it. +% \begin{macrocode} +\@ifundefined{glossary@prologue} + {\def\glossary@prologue{\section*{{Change History}}% + \markboth{{Change History}}{{Change History}}% + }}{} +% \end{macrocode} +% \end{macro} +% \end{macro} +% +% \begin{macro}{\GlossaryParms} +% \changes{BHK}{1989/04/26}{Added to support +% \texttt{\protect\bslash changes}.} +% Unless the user specifies otherwise, we set the change history +% using the same parameters as for the index. +% \begin{macrocode} +\@ifundefined{GlossaryParms}{\let\GlossaryParms\IndexParms}{} +% \end{macrocode} +% \end{macro} +% \begin{macro}{\PrintChanges} +% \changes{BHK}{1989/04/26}{Added to support +% \texttt{\protect\bslash changes}.} +% To read in and print the sorted change history, just put the +% |\PrintChanges| command as the last (commented-out, and thus +% executed during the documentation pass through the file) command +% in your package file. Alternatively, this command may form one of +% the arguments of the |\StopEventually| command, although a +% change history is probably {\em not\/} required if only the +% description is being printed. +% +% The command assumes that \textsf{makeindex} or some other program +% has processed the \texttt{.glo} file to generate a sorted +% \texttt{.gls} file. +% \changes{v1.9h}{1994/02/10}{Use \cs{@input@} instead of \cs{@input}.} +% \changes{v1.9w}{1995/12/29}{Turn the cmd into a noop after use.} +% \begin{macrocode} +\def\PrintChanges{\@input@{\jobname.gls}% + \global\let\PrintChanges\@empty} +% \end{macrocode} +% \end{macro} +% +% +% +% +% +% \subsection{Bells and whistles} +% +% \begin{macro}{\StopEventually} +% \changes{v1.5k}{1989/09/04}{Support for checksum.} +% \begin{macro}{\Finale} +% \changes{v1.5k}{1989/09/04}{Support for checksum.} +% \changes{v1.5z}{1990/04/22}{Define \cs{Finale} globally.} +% \begin{macro}{\AlsoImplementation} +% \changes{v1.9w}{1995/12/27}{Macro added} +% \begin{macro}{\OnlyDescription} +% If |\AlsoImplementation| is in force the whole documentation +% including the code part will be typeset. This is the default. +% \begin{macrocode} +\newcommand\AlsoImplementation{% +% \end{macrocode} +% To make this happen we have to define +% |\StopEventually| in a way that its argument is typeset at the +% very end or more exactly at |\Finale|. For this we +% save its argument in the macro |\Finale|. +% \begin{macrocode} + \long\def\StopEventually##1{\@bsphack\gdef\Finale{##1% +% \end{macrocode} +% But |\Finale| will be called at the very end of a file. This +% is exactly the point were we want to know if the file is +% uncorrupted. Therefore we also call |\check@checksum| at this +% point. +% \begin{macrocode} + \check@checksum}% +% \end{macrocode} +% On the other hand: |\StopEventually| is more or less a +% dividing point between description and code. So we start to look +% for the check-sum of the documented file by calling +% |\init@checksum|. +% \begin{macrocode} + \init@checksum + \@esphack}% + } +% \end{macrocode} +% +% Since |\AlsoImplementation| should be the default we execute it +% and thus |\StopEventually| gets the desired meaning. +% \begin{macrocode} +\AlsoImplementation +% \end{macrocode} +% When the user places an |\OnlyDescription| declaration in +% the driver file the document should only be typeset up to +% |\StopEventually|. We therefore have to redefine this macro. +% \begin{macrocode} +\def\OnlyDescription{\@bsphack\long\def\StopEventually##1{% +% \end{macrocode} +% In this case the argument of |\StopEventually| should be set +% and afterwards \TeX{} should stop reading from this file. +% Therefore we finish this macro with +% \begin{macrocode} + ##1\endinput}\@esphack} +% \end{macrocode} +% If no |\StopEventually| command is given we silently ignore a +% |\Finale| issued. +% \changes{v1.9n}{1994/04/28}{Ignore \cs{Finale} if no +% \cs{StopEventually} is given} +% \begin{macrocode} +\let\Finale\relax +% \end{macrocode} +% \end{macro} +% \end{macro} +% \end{macro} +% \end{macro} +% +% \begin{macro}{\meta} +% \changes{v1.4t}{1989/04/24}{Macro added.} +% \changes{v1.5w}{1990/02/03}{Breaks at space allowed.} +% \changes{v1.6a}{1990/05/24}{Extra space bug corrected.} +% The |\meta| macro is a bit tricky. We want to allow line +% breaks at blanks in the argument but we don't want a break +% in between. In the past this was done by defining |\meta| in a way that a +% \verb*+ + is active when the argument is scanned. Words are then +% scanned into |\hbox|es. The active \verb*+ + will end the +% preceding |\hbox| add an ordinary space and open a new +% |\hbox|. In this way breaks are only possible at spaces. The +% disadvantage of this method was that |\meta| was neither robust +% nor could it be |\protect|ed. The new implementation fixes this +% problem by defining |\meta| in a radically different way: we +% prevent hypenation by defining a |\language| which has no +% patterns associated with it and use this to typeset the words +% within the angle brackets. +% \changes{v2.0i}{2000/05/21}{New implementation (pr/3170)} +% \begin{macrocode} +\ifx\l@nohyphenation\undefined + \newlanguage\l@nohyphenation +\fi +% \end{macrocode} +% +% \begin{macrocode} +\DeclareRobustCommand\meta[1]{% +% \end{macrocode} +% Since the old implementation of |\meta| could be used in math we +% better ensure that this is possible with the new one as +% well. So we use |\ensuremath| around |\langle| and +% |\rangle|. However this is not enough: if |\meta@font@select| +% below expands to |\itshape| it will fail if used in math +% mode. For this reason we hide the whole thing inside an +% |\nfss@text| box in that case. +% \changes{v2.0l}{2000/06/10}{Fixing changes for (pr/3170)} +% \begin{macrocode} + \ensuremath\langle + \ifmmode \expandafter \nfss@text \fi + {% + \meta@font@select +% \end{macrocode} +% Need to keep track of what we changed just in case the user +% changes font inside the argument so we store the font explicitly. +% \changes{v2.0m}{2000/07/04}{More fixing changes for (pr/3170)} +% \begin{macrocode} + \edef\meta@hyphen@restore + {\hyphenchar\the\font\the\hyphenchar\font}% + \hyphenchar\font\m@ne + \language\l@nohyphenation + #1\/% + \meta@hyphen@restore + }\ensuremath\rangle +} +% \end{macrocode} +% \end{macro} +% +% +% \begin{macro}{\meta@font@select} +% \changes{v2.0k}{2000/05/26}{Macro added (pr/3170)} +% Maske font used inside |\meta| customizable. +% \begin{macrocode} +\def\meta@font@select{\itshape} +% \end{macrocode} +% \end{macro} +% +% +% \begin{macro}{\IndexInput} +% This next macro may be used to read in a separate file (possibly +% a package file that is {\em not\/} documented by this means) and +% set it verbatim, whilst scanning for macro names and indexing the +% latter. This could be a useful first pass in preparing to +% generate documentation for the file read. +% \begin{macrocode} +\def\IndexInput#1{% +% \end{macrocode} +% We commence by setting up a group, and initializing a +% |\trivlist| as is normally done by a +% |\begin{macrocode}| command. +% \begin{macrocode} + \begingroup \macro@code +% \end{macrocode} +% We also make spacing behave as in the \textsf{macrocode} +% environment, because otherwise all the spaces will be shown +% explicitly. +% \begin{macrocode} + \frenchspacing \@vobeyspaces +% \end{macrocode} +% Then it only remains to read in the specified file, and finish +% off the |\trivlist|. +% \changes{v1.5t}{1989/11/07}{Call \cs{endmacrocode} instead +% of \cs{endtrivlist}.} +% \begin{macrocode} + \input{#1}\endmacrocode +% \end{macrocode} +% Of course, we need to finish off the group as well. +% \begin{macrocode} + \endgroup} +% \end{macrocode} +% \end{macro} +% +% +% \begin{macro}{\maketitle} +% The macro to generate titles is easily altered in order that it +% can be used more than once (an article with many titles). In the +% original, diverse macros were concealed after use with +% |\relax|. We must cancel anything that may have been put +% into |\@thanks|, etc., otherwise {\em all\/} titles will +% carry forward any earlier such setting! +% \changes{v1.5j}{1989/06/09}{thispagestyle plain removed} +% \changes{v1.9r}{1994/06/09}{Added new definitions of +% \cs{@makefnmark} and \cs{@makefntext}} +% \begin{macrocode} +\def\maketitle{\par + \begingroup \def \thefootnote {\fnsymbol {footnote}}% + \setcounter {footnote}\z@ + \def\@makefnmark{\hbox to\z@{$\m@th^{\@thefnmark}$\hss}}% + \long\def\@makefntext##1{\parindent 1em\noindent + \hbox to1.8em{\hss$\m@th^{\@thefnmark}$}##1}% + \if@twocolumn \twocolumn [\@maketitle ]% + \else \newpage \global \@topnum \z@ \@maketitle \fi +% \end{macrocode} +% \changes{v1.5k}{1989/09/04}{Added \cs{ps@titlepage}} +% For special formatting requirements (such as in TUGboat), we use +% pagestyle |titlepage| for this; this is later defined to be +% |plain|, unless already defined, as, for example, by +% |ltugboat.sty|. +% \begin{macrocode} + \thispagestyle{titlepage}\@thanks \endgroup +% \end{macrocode} +% If the driver file documents many files, we don't want parts of a +% title of one to propagate to the next, so we have to cancel +% these: +% \begin{macrocode} + \setcounter {footnote}\z@ + \gdef\@date{\today}\gdef\@thanks{}% + \gdef\@author{}\gdef\@title{}} +% \end{macrocode} +% \end{macro} +% +% +% \begin{macro}{\ps@titlepage} +% \changes{v1.5k}{1989/09/04}{Added \texttt{\protect\bslash +% ps@titlepage}} When a number of articles are concatenated into a +% journal, for example, it is not usual for the title pages of such +% documents to be formatted differently. Therefore, a class +% such as \textsf{ltugboat} can define this macro in advance. +% However, if no such definition exists, we use pagestyle +% \texttt{plain} for title pages. +% \begin{macrocode} +\@ifundefined{ps@titlepage} + {\let\ps@titlepage=\ps@plain}{} +% \end{macrocode} +% \end{macro} +% +% \begin{macro}{\MakeShortVerb} +% \changes{v1.7a}{1992/02/27}{Added (from newdoc but now alters +% \cs{dospecials}, \cs{@sanitize}).} +% This arranges an abbreviation for "\verb" such that if you say +% "\MakeShortVerb{\"\meta{c}"}" subsequently using +% \meta{c}\meta{text}\meta{c} is equivalent to +% "\verb"\meta{c}\meta{text}\meta{c}.\footnote{Warning: +% the commentary in the rest of this section was written by Dave +% Love.} In addition, the fact +% that \meta{c} is made active is recorded for the benefit of the +% \textsf{verbatim} and \textsf{macrocode} environments. +% Note particularly that the definitions below are global. +% The first thing we do (it needn't be first) is to record +% the---presumably new---special character in "\dospecials" and +% "\@sanitize" using "\add@special". +% +% \changes{v1.9e.2}{1994/02/07}{-js: Check if \protect\meta{c} is +% already an +% abbreviation for \cs{verb}.} +% Some unwary user might issue "\MakeShortVerb" for a second time, we +% better protect against this. We assume that this happened if a +% control sequence "\cc\"\meta{c} is bound, the probability that this +% name is used by another module is low. We will output a warning +% below, so that a possible error might be noticed by the programmer +% if he reads the "LOG" file. (Should have used module internal names, +% 'though.) +% +% \begin{macro}{\MakeShortVerb*} +% \changes{v2.1a}{2003/12/09}{(HjG) Added \texttt{*} form} +% This arranges an abbreviation for "\verb*" such that if you say +% "\MakeShortVerb*{\"\meta{c}"}" subsequently using +% \meta{c}\meta{text}\meta{c} is equivalent to +% "\verb*"\meta{c}\meta{text}\meta{c}. +% \begin{macrocode} +% +%<*package|shortvrb> +\def\MakeShortVerb{% + \@ifstar + {\def\@shortvrbdef{\verb*}\@MakeShortVerb}% + {\def\@shortvrbdef{\verb}\@MakeShortVerb}} +% \end{macrocode} +% \end{macro} +% \begin{macrocode} +\def\@MakeShortVerb#1{% + \expandafter\ifx\csname cc\string#1\endcsname\relax +% \end{macrocode} +% \changes{v1.9v}{1995/11/03}{(DPC) Use \cs{@shortvrbinfo}} +% \begin{macrocode} + \@shortvrbinfo{Made }{#1}\@shortvrbdef + \add@special{#1}% +% \end{macrocode} +% Then the character's current catcode is stored in "\cc\"\meta{c}. +% \begin{macrocode} + \expandafter + \xdef\csname cc\string#1\endcsname{\the\catcode`#1}% +% \end{macrocode} +% The character is spliced into the definition using the same trick as +% used in "\verb" (for instance), having activated "~" in a group. +% \begin{macrocode} + \begingroup + \catcode`\~\active \lccode`\~`#1% + \lowercase{% +% \end{macrocode} +% The character's old meaning is recorded in "\ac\"\meta{c} prior to +% assigning it a new one. +% \begin{macrocode} + \global\expandafter\let + \csname ac\string#1\endcsname~% + \expandafter\gdef\expandafter~\expandafter{\@shortvrbdef~}}% + \endgroup +% \end{macrocode} +% Finally the character is made active. +% \begin{macrocode} + \global\catcode`#1\active +% \end{macrocode} +% If we suspect that \meta{c} is already a short reference, we tell +% the user. Now he or she is responsible if anything goes wrong\,\dots +% \begin{macrocode} + \else +% \end{macrocode} +% \changes{v1.9v}{1995/11/03}{(DPC) Use \cs{@shortvrbinfo}} +% \begin{macrocode} + \@shortvrbinfo\@empty{#1 already}{\@empty\verb(*)}% + \fi} +% \end{macrocode} +% \end{macro} +% \begin{macro}{\DeleteShortVerb} +% \changes{v1.7a}{1992/02/27}{Added (from newdoc but now alters +% \cs{dospecials}, \cs{@sanitize}).} +% Here's the means of undoing a "\MakeShortVerb", for instance in a +% region where you need to use the character outside a verbatim +% environment. It arranges for "\dospecials" and "\@sanitize" to be +% altered appropriately, restores the saved catcode and, if necessary, +% the character's meaning (as stored by +% "\MakeShortVerb"). If the catcode wasn't stored in +% "\cc\"\meta{c} (by "\MakeShortVerb") the command is silently +% ignored. +% \changes{v1.7a}{1992/02/28}{Check for previous matched +% \cs{MakeShortVerb} +% to avoid error.} +% \begin{macrocode} +\def\DeleteShortVerb#1{% + \expandafter\ifx\csname cc\string#1\endcsname\relax +% \end{macrocode} +% \changes{v2.1a}{2003/12/10}{(HjG) Notify user +% if it's not a short verb character} +% \begin{macrocode} + \@shortvrbinfo\@empty{#1 not}{\@empty\verb(*)}% + \else +% \end{macrocode} +% \changes{v1.9v}{1995/11/03}{(DPC) Use \cs{@shortvrbinfo}} +% \begin{macrocode} + \@shortvrbinfo{Deleted }{#1 as}{\@empty\verb(*)}% + \rem@special{#1}% + \global\catcode`#1\csname cc\string#1\endcsname +% \end{macrocode} +% \changes{v1.9e.2}{1994/02/07}{-js: Reset `cc`\protect\meta{c} in +% in \cs{DeleteShortVerb}} +% We must not forget to reset "\cc\"\meta{c}, otherwise the check in +% "\MakeShortVerb" for a repeated definition will not work. +% \begin{macrocode} + \global \expandafter\let \csname cc\string#1\endcsname \relax + \ifnum\catcode`#1=\active + \begingroup + \catcode`\~\active \lccode`\~`#1% + \lowercase{% + \global\expandafter\let\expandafter~% + \csname ac\string#1\endcsname}% + \endgroup \fi \fi} +% \end{macrocode} +% \end{macro} +% +% \begin{macro}{\@shortvrbinfo} +% \changes{v1.9v}{1995/11/03}{(DPC) Macro added} +% \changes{v2.1a}{2003/12/10}{(HjG) Third argument added +% on behalf of \cmd{\MakeShortVerb*}} +% Helper function for info messages. +% \begin{macrocode} +\def\@shortvrbinfo#1#2#3{% +% \PackageInfo{shortvrb}{% +% \PackageInfo{doc}{% + #1\expandafter\@gobble\string#2 a short reference + for \expandafter\string#3}} +% \end{macrocode} +% \end{macro} +% +% \begin{macro}{\add@special} +% \changes{v1.7a}{1992/02/27}{Added for short verb facility.} +% This helper macro adds its argument to the +% "\dospecials" macro which is conventionally used by verbatim macros +% to alter the catcodes of the currently active characters. We need +% to add "\do\"\meta{c} to the expansion of "\dospecials" after +% removing the character if it was already there to avoid multiple +% copies building up should "\MakeShortVerb" not be balanced by +% "\DeleteShortVerb" (in case anything that uses "\dospecials" cares +% about repetitions). +% \begin{macrocode} +\def\add@special#1{% + \rem@special{#1}% + \expandafter\gdef\expandafter\dospecials\expandafter + {\dospecials \do #1}% +% \end{macrocode} +% Similarly we have to add "\@makeother\"\meta{c} to "\@sanitize" +% (which is used in things like "\index" to re-catcode all special +% characters except braces). +% \begin{macrocode} + \expandafter\gdef\expandafter\@sanitize\expandafter + {\@sanitize \@makeother #1}} +% \end{macrocode} +% \end{macro} +% \begin{macro}{\rem@special} +% \changes{v1.7a}{1992/02/27}{Added for short verb facility.} +% The inverse of "\add@special" is slightly trickier. "\do" is +% re-defined to expand to nothing if its argument is the character of +% interest, otherwise to expand simply to the argument. We can then +% re-define "\dospecials" to be the expansion of itself. The space +% after "=`##1" prevents an expansion to "\relax"! +% \begin{macrocode} +\def\rem@special#1{% + \def\do##1{% + \ifnum`#1=`##1 \else \noexpand\do\noexpand##1\fi}% + \xdef\dospecials{\dospecials}% +% \end{macrocode} +% Fixing "\@sanitize" is the same except that we need to re-define +% "\@makeother" which obviously needs to be done in a group. +% \begin{macrocode} + \begingroup + \def\@makeother##1{% + \ifnum`#1=`##1 \else \noexpand\@makeother\noexpand##1\fi}% + \xdef\@sanitize{\@sanitize}% + \endgroup} +% +%<*package> +% \end{macrocode} +% \end{macro} +% \begin{macro}{\MakeShortverb} +% \begin{macro}{\DeleteShortverb} +% \changes{v1.7a}{1992/02/27}{Added (from newdoc).} +% These commands from \textsf{newdoc} are now obsolete. +% \begin{macrocode} +\def\MakeShortverb{\typeout{*** Switch to \noexpand\MakeShortVerb + syntax, this is obsolete ***}\MakeShortVerb} +\def\DeleteShortverb{\typeout{*** Switch to \noexpand\DeleteShortVerb + syntax, this is obsolete ***}\DeleteShortVerb} +% \end{macrocode} +% \end{macro} +% \end{macro} +% +% +% +% \subsection[Providing a checksum and character table] +% {Providing a checksum and character table\footnotemark} +% \footnotetext{Warning: the commentary in this section was +% written by Dave Love. } +% +% +% \begin{macro}{\init@checksum} +% The checksum mechanism works by counting backslashes in the +% macrocode. This initialises the count (when called from +% "\StopEventually"). +% \changes{v1.5k}{1989/09/04}{Macro added to support checksum.} +% \begin{macrocode} +\def\init@checksum{\relax + \global\bslash@cnt\z@} +% \end{macrocode} +% \end{macro} +% +% +% \begin{macro}{\check@checksum} +% \changes{v1.5k}{1989/09/04}{Macro added to support checksum.} +% This reports the sum compared with the value ("\bslash@cnt") the +% file advertises. It's called from "\Finale" (if that hasn't been +% re-defined). +% \begin{macrocode} +\def\check@checksum{\relax + \ifnum\check@sum=\z@ + \typeout{**********************************}% + \typeout{* This macro file has no checksum!}% + \typeout{* The checksum should be \the\bslash@cnt!}% + \typeout{**********************************}% + \else + \ifnum\check@sum=\bslash@cnt + \typeout{*******************}% + \typeout{* Checksum passed *}% + \typeout{*******************}% + \else + \PackageError{doc}{Checksum not passed + (\the\check@sum<>\the\bslash@cnt)}% + {The file currently documented seems to be wrong.^^J% + Try to get a correct version.}% + \fi + \fi + \global\check@sum\z@} +% \end{macrocode} +% \end{macro} +% +% +% \begin{macro}{\check@sum} +% \changes{v1.5k}{1989/09/04}{Macro added to support checksum.} +% \begin{macro}{\bslash@cnt} +% \changes{v1.5k}{1989/09/04}{Macro added to support checksum.} +% We need to define counters, "\bslash@cnt" for the number of +% backslashes counted and "\check@sum" for the value advertised by the +% file. +% \begin{macrocode} +\newcount\check@sum \check@sum = \z@ +\newcount\bslash@cnt \bslash@cnt = \z@ +% \end{macrocode} +% \end{macro} +% \end{macro} +% +% +% \begin{macro}{\CheckSum} +% \changes{v1.5k}{1989/09/04}{Macro added to support checksum.} +% This is the interface to setting "\check@sum". +% \begin{macrocode} +\def\CheckSum#1{\@bsphack\global\check@sum#1\relax\@esphack} +% \end{macrocode} +% \end{macro} +% +% +% +% \begin{macro}{\step@checksum} +% \changes{v1.5k}{1989/09/04}{Macro added to support checksum.} +% This advances the count when a backslash is encountered in the +% macrocode. +% \begin{macrocode} +\def\step@checksum{\global\advance\bslash@cnt\@ne} +% \end{macrocode} +% \end{macro} +% +% \begin{macro}{\CharacterTable} +% The user interface to the character table-checking does some +% "\catcode"ing and then compares the following table with the +% stored version. We need to have "@" of type ``other'' within the +% table since this is the way it is usually returned when reading +% in a normal document. To nevertheless have a private letter we +% use "~" for this purpose. "~" does no harm as a ``letter'' as it +% comes last in the table and therefore will not gobble following +% space. +% \changes{v1.5m}{1989/09/20}{Macro added to check character translation +% problems.} +% \changes{v1.5q}{1989/11/01}{Made character table more readable.} +% \changes{v1.5t}{1989/11/07}{Make \string\~{} letter in chartable +% macros.} +% \changes{v1.5u}{1989/11/14}{Made @ other in default table.} +% \begin{macrocode} +\def\CharacterTable{\begingroup \CharTableChanges \character@table} +% \end{macrocode} +% \end{macro} +% \def\MakePrivateLetters{\catcode`\~=11\makeatletter} +% \begin{macro}{\character@table} +% This does the work of comparing the tables and reporting the result. +% Note that the following code is enclosed in a group +% with "~" catcoded to letter. +% \begin{macrocode} +\begingroup + \catcode`\~=11 + \gdef\character@table#1{\def\used~table{#1}% + \ifx\used~table\default~table + \typeout{***************************}% + \typeout{* Character table correct *}% + \typeout{***************************}% + \else + \PackageError{doc}{Character table corrupted} + {\the\wrong@table} + \show\default~table + \show\used~table + \fi + \endgroup} +% \end{macrocode} +% \end{macro} +% +% \begin{macro}{\CharTableChanges} +% When the character table is read in we need to scan it with a +% fixed set of "\catcode"s. The reference table below was defined by +% assuming the normal "\catcode"s of \TeX{}, i.e.\ "@" is of type +% other and the only token of type ``letter'' are the usual letters +% of the alphabet. If, for some reason, other characters are made +% ``letters'' then their "\catcode"s need to be restored before +% checking the table. Otherwise spaces in the table are gobbled and +% we get the information that the tables are different, even if +% they are actually equal. For this reason "\CharTableChanges" can +% be set up to locally restore the "\catcode"s of such ``letters'' +% to ``other''. +% \begin{macrocode} + \global\let\CharTableChanges\@empty +% \end{macrocode} +% \end{macro} +% +% \begin{macro}{\default~table} +% Here's what the table {\em should\/} look like (modulo spaces). +% \begin{macrocode} + \makeatother + \gdef\default~table + {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 + 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 + Digits \0\1\2\3\4\5\6\7\8\9 + Exclamation \! Double quote \" Hash (number) \# + Dollar \$ Percent \% Ampersand \& + Acute accent \' Left paren \( Right paren \) + Asterisk \* Plus \+ Comma \, + Minus \- Point \. Solidus \/ + Colon \: Semicolon \; Less than \< + Equals \= Greater than \> Question mark \? + Commercial at \@ Left bracket \[ Backslash \\ + Right bracket \] Circumflex \^ Underscore \_ + Grave accent \` Left brace \{ Vertical bar \| + Right brace \} Tilde \~} +\endgroup +% \end{macrocode} +% \end{macro} +% \let\MakePrivateLetters=\makeatletter +% +% \begin{macro}{\wrong@table} +% \changes{v1.7a}{1992/02/28}{Moved to where the catcodes are right +% so it works.} +% We need a help message in case of problems. +% \begin{macrocode} + \newhelp\wrong@table{Some of the ASCII characters are corrupted.^^J + I now \string\show\space you both tables for comparison.} +% \end{macrocode} +% \end{macro} +% +% +% \subsection[Attaching line numbers to code lines] +% {Attaching line numbers to code lines\footnotemark} +% \footnotetext{Warning: the commentary was written by Dave +% Love.} +% +% +% The code in this section allows index entries to refer to code line +% numbers---the number of the first line of macrocode in the +% \textsf{macro} environment. +% +% +% \begin{macro}{\codeline@index} +% Indexing by code line is controlled by the "codeline@index" switch. +% \changes{v1.5s}{1989/11/05}{Support for code line no. (Undoc)} +% \changes{v1.7a}{1992/02/24}{Documented code line no. support.} +% \begin{macro}{\CodelineNumbered} +% \changes{v1.8a}{1993/05/19}{Macro added} +% \begin{macrocode} +\newif\ifcodeline@index \codeline@indexfalse +\let\CodelineNumbered\codeline@indextrue +% \end{macrocode} +% \end{macro} +% \end{macro} +% \begin{macro}{\codeline@wrindex} +% The code index entries are written out by "\special@index". If +% indexing is by code line this is "\let" to "\codeline@wrindex"; +% if indexing is by page it is just "\index". However, if +% "\nofiles" is given, we omit writing such an index entry at all. +% \changes{v1.7j}{1992/08/14}{Added \cs{if@filesw}.} +% \begin{macrocode} +\def\codeline@wrindex#1{\if@filesw + \immediate\write\@indexfile + {\string\indexentry{#1}% + {\number\c@CodelineNo}}\fi} +% \end{macrocode} +% \end{macro} +% \begin{macro}{\special@index} +% By default no index entries are written out. +% \begin{macrocode} +\let\special@index = \@gobble +% \end{macrocode} +% \end{macro} +% \begin{macro}{\CodelineIndex} +% \changes{v1.5u}{1989/11/14}{Added \cs{PageIndex} and +% \cs{CodelineIndex} (Undoc)} +% This switches on use of the index file with "\makeindex", sets the +% switch to indicate code line numbering and defines "\special@index" +% appropriately. +% \begin{macrocode} +\def\CodelineIndex{\makeindex + \codeline@indextrue + \let\special@index\codeline@wrindex} +% \end{macrocode} +% \end{macro} +% \begin{macro}{\PageIndex} +% "\PageIndex" is similar. +% \begin{macrocode} +\def\PageIndex{\makeindex + \codeline@indexfalse + \let\special@index\index} +% \end{macrocode} +% \end{macro} +% +% +% \begin{macro}{\c@CodelineNo} +% \changes{v1.5l}{1989/09/10}{Counter added to support code line +% numbers} +% \changes{v1.5y}{1990/02/24}{Default changed.} +% \changes{v1.6b}{1990/06/15}{\cs{rm} moved before \cs{scriptsize} to +% avoid unnecessary fontwarning.} +% We need a counter to keep track of the line number. +% \begin{macrocode} +\newcount\c@CodelineNo \c@CodelineNo\z@ +% \end{macrocode} +% \end{macro} +% \begin{macro}{\theCodelineNo} +% \changes{v1.7a}{1992/02/25}{Existing definition not overwritten.} +% \changes{v1.7a}{1992/03/12}{Use \cs{reset@font} for NFSS.} +% This provides a hook to control the format of line numbers which may +% be defined in a class file. +% \begin{macrocode} +\@ifundefined{theCodelineNo} + {\ifx\selectfont\undefined + \def\theCodelineNo{\rmfamily\scriptsize\arabic{CodelineNo}}% + \else + \def\theCodelineNo{\reset@font\scriptsize\arabic{CodelineNo}}% + \fi} + {} +% \end{macrocode} +% \end{macro} +% +% +% +% +% \subsection{Layout Parameters for documenting package files} +% +% \begin{macro}{\tolerance} +% People documenting package files would probably rather have things +% ``sticking out'' in overfull |\hbox|es and poorish spacing, +% because they probably don't want to spend a lot of time on making +% all the line breaks perfect! +% \begin{macrocode} + \tolerance=1000\relax +% \end{macrocode} +% \end{macro} +% +% \DeleteShortVerb{\"} +% +% The following |\mathcode| definitions allow the characters +% `|\|' +% and `\texttt{@}' to appear in |\ttfamily| font when invoked in math +% mode;\footnote{You may wonder why the definitions state that both +% characters belong to the {\em variable family\/} +% (i.e.\ the number 7 in front). The reason is this: +% Originally the \texttt{\bslash mathcode} of +% \texttt{\bslash} was defined to be \texttt{"075C}, +% i.e.\ ordinary character number 92 (hex 5C) in +% math family number 7 which is the typewriter family in +% standard \LaTeX. +% But this file should not depend on this specific +% setting, so I changed these +% \texttt{\bslash mathcode}$\,$s +% to work with any family assignments. For an example +% see the article about the new font selection scheme.} +% particularly for something like $|\@abc|=1$. +% +% If an {\em old\/} version of the \textsf{german} package is in +% force, then the `|"|' character is active and would upset the +% definition of the \meta{16-bit number} quantities below, therefore +% we change the |\catcode| of |"| inside a group, and use +% |\global|. +% \begin{macrocode} +{ \catcode`\"=12 + \global\mathcode`\\="705C \global\mathcode`\@="7040 } +% \end{macrocode} +% \MakeShortVerb{\"} +% +% \begin{macro}{\DocstyleParms} +% This macro can be used, for example, to assign new values to +% |\MacrocodeTopsep| and |\MacroIndent| and some other internal +% registers. If it is already defined, the default definition +% won't be carried out. Note that it is necessary to assign new +% values via this macro if it should be done in a class file (like +% \texttt{ltugboat.cls} for example) since the registers are +% undefined before \texttt{doc.sty} is read in. The default values +% for the internal registers are scattered over this file. +% \changes{v1.5u}{1989/11/14}{\cs{DocStyleParms} now empty} +% \begin{macrocode} +\@ifundefined{DocstyleParms}{}{} +% \end{macrocode} +% Now we allow overwriting the values by calling +% |\DocstyleParms|. +% \begin{macrocode} +\DocstyleParms \let\DocstyleParms\relax +% \end{macrocode} +% \end{macro} +% +% +% +% \begin{macro}{\AmSTeX} +% \changes{v1.5j}{1989/06/09}{Macro AmsTeX renamed to AmSTeX} +% \begin{macro}{\BibTeX} +% \begin{macro}{\SliTeX} +% Here are a few definitions which can usefully be employed when +% documenting package files: now we can readily refer to \AmSTeX, +% \BibTeX\ and \SliTeX, as well as the usual \TeX\ and \LaTeX. +% \begin{macrocode} +\@ifundefined{AmSTeX} + {\def\AmSTeX{\leavevmode\hbox{$\mathcal A\kern-.2em\lower.376ex% + \hbox{$\mathcal M$}\kern-.2em\mathcal S$-\TeX}}}{} +\@ifundefined{BibTeX} + {\def\BibTeX{{\rmfamily B\kern-.05em% + \textsc{i\kern-.025em b}\kern-.08em% + T\kern-.1667em\lower.7ex\hbox{E}\kern-.125emX}}}{} +\@ifundefined{SliTeX} + {\def\SliTeX{{\rmfamily S\kern-.06emL\kern-.18em\raise.32ex\hbox + {\scshape i}\kern -.03em\TeX}}}{} +% \end{macrocode} +% \end{macro} +% \end{macro} +% \end{macro} +% \begin{macro}{\PlainTeX} +% \changes{v1.5g}{1989/05/07}{space between plain and TeX changed.} +% \begin{macro}{\Web} +% There's even a \PlainTeX{} and a \Web. +% \begin{macrocode} +\@ifundefined{PlainTeX}{\def\PlainTeX{\textsc{Plain}\kern2pt\TeX}}{} +\@ifundefined{Web}{\def\Web{\textsc{Web}}}{} +% \end{macrocode} +% \end{macro} +% \end{macro} +% +% +% \subsection{Changing the \texttt{\protect\bslash catcode} of \%} +% +% \begin{macro}{\MakePercentIgnore} +% \begin{macro}{\MakePercentComment} +% And finally the most important bit: we change the |\catcode| +% of `|%|' so that it is ignored (which is how we are able to +% produce this document!). We provide two commands to do the actual +% switching. +%^^A The |\MakePercentIgnore| is then called as the +%^^A last command in this file. +% \begin{macrocode} +\def\MakePercentIgnore{\catcode`\%9\relax} +\def\MakePercentComment{\catcode`\%14\relax} +% \end{macrocode} +% \end{macro} +% \end{macro} +% +% \begin{macro}{\DocInput} +% The two macros above are now used to define the |\DocInput| macro +% which was introduced in version v1.5l (or so) of the \DOC{} +% package. In older versions |\MakePercentIgnore| was placed +% at the very end of \texttt{doc.sty}. +% \begin{macrocode} +\def\DocInput#1{\MakePercentIgnore\input{#1}\MakePercentComment} +% \end{macrocode} +% \end{macro} +% +% \subsection{GetFileInfo} +% +% \begin{macro}{\GetFileInfo} +% \changes{v1.9o}{1994/05/08}{Macro added} +% \changes{v1.9z}{1997/02/05}{Missing percent latex/2404} +% Define |\filedate| and friends from info in the +% |\ProvidesPackage| etc.\ commands. +% \begin{macrocode} +\def\GetFileInfo#1{% + \def\filename{#1}% + \def\@tempb##1 ##2 ##3\relax##4\relax{% + \def\filedate{##1}% + \def\fileversion{##2}% + \def\fileinfo{##3}}% + \edef\@tempa{\csname ver@#1\endcsname}% + \expandafter\@tempb\@tempa\relax? ? \relax\relax} +% \end{macrocode} +% \end{macro} +% +% We can now finish the \texttt{docstrip} main module. +% \begin{macrocode} +% +% \end{macrocode} +% +% +% \Finale +% \PrintIndex \PrintChanges +\endinput diff --git a/Master/texmf-dist/source/latex/base/docstrip.dtx b/Master/texmf-dist/source/latex/base/docstrip.dtx new file mode 100644 index 00000000000..4f6c7b61bfb --- /dev/null +++ b/Master/texmf-dist/source/latex/base/docstrip.dtx @@ -0,0 +1,4349 @@ +% \iffalse meta-comment +% +% Copyright 1993 1994 1995 1996 1997 1998 1999 2000 2001 2002 2003 2004 +% The LaTeX3 Project and any individual authors listed elsewhere +% in this file. +% +% This file is part of the LaTeX base system. +% ------------------------------------------- +% +% It may be distributed and/or modified under the +% conditions of the LaTeX Project Public License, either version 1.3 +% of this license or (at your option) any later version. +% The latest version of this license is in +% http://www.latex-project.org/lppl.txt +% and version 1.3 or later is part of all distributions of LaTeX +% version 2003/12/01 or later. +% +% This file has the LPPL maintenance status "maintained". +% +% The list of all files belonging to the LaTeX base distribution is +% given in the file `manifest.txt'. See also `legal.txt' for additional +% information. +% +% The list of derived (unpacked) files belonging to the distribution +% and covered by LPPL is defined by the unpacking scripts (with +% extension .ins) which are part of the distribution. +% +% \fi +\catcode`\{=1 +\catcode`\}=2 +\def\filename{docstrip.dtx} +\def\fileversion{2.5c} +\def\filedate{2003/09/18} +\def\docdate {1999/03/31} +% \CheckSum{2436} +%% \CharacterTable +%% {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 +%% 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 +%% Digits \0\1\2\3\4\5\6\7\8\9 +%% Exclamation \! Double quote \" Hash (number) \# +%% Dollar \$ Percent \% Ampersand \& +%% Acute accent \' Left paren \( Right paren \) +%% Asterisk \* Plus \+ Comma \, +%% Minus \- Point \. Solidus \/ +%% Colon \: Semicolon \; Less than \< +%% Equals \= Greater than \> Question mark \? +%% Commercial at \@ Left bracket \[ Backslash \\ +%% Right bracket \] Circumflex \^ Underscore \_ +%% Grave accent \` Left brace \{ Vertical bar \| +%% Right brace \} Tilde \~} +%% +% +%\iffalse +% +%% The docstrip program for use with TeX. +%% Copyright (C) 1989-1991 Frank Mittelbach +%% Copyright (C) 1992-1995 Johannes Braams, Denys Duchier, +%% Frank Mittelbach +%% Copyright (C) 1995 Marcin Woli\'nski +%% Copyright (C) 1996-1997 Mark Wooding, Marcin Woli\'nski +%% Copyright (C) 1998-2003 LaTeX3 project and the above authors +%% All rights are reserved. +%% +% +% \fi +% +% \changes{2.0b}{1991/05/29}{Added bugfix from Denys} +% \changes{2.0c}{1991/05/29}{Allow almost all characters in guard (DD)} +% \changes{2.0d}{1991/05/31}{Started merging in some of Franks code} +% \changes{2.0j}{1992/03/05}{Wrote introduction} +% \changes{2.0m}{1992/04/21}{Renamed all macros that deal with the +% parsing of boolean expressions} +% \changes{2.0m}{1992/04/25}{Removed dependency from ltugboat, +% incorporated driver file into source.} +% \changes{2.0m}{1992/04/25}{Added some missing percents; corrected some +% typos} +% \changes{2.0m-DL}{1992/05/08}{Various small corrections to English and +% typos} +% \changes{2.0q}{1992/07/01}{Changed all dates to yy/mm/dd for better +% sorting} +% \changes{2.2a}{1993/12/02}{Update for LaTeX2e} +% \changes{2.2c}{1993/12/17}{Renamed texsys.tex to texsys.cfg.} +% \changes{2.3a}{1995/08/17}{Swapped Primary with Secondary since +% expressions are generally described bottom-up} +% \changes{2.3b}{1995/08/22}{Completely changed expressions parser} +% \changes{2.3b}{1995/08/23}{Removed mechanism for checking if previous +% one-line guard is same as current (\cs{testOption}, +% \cs{closeOption})---this is not a common +% case and testing complicates things unnecessarily} +% \changes{2.3c}{1995/08/24}{When file is multiply listed in \cs{file} +% clause it \emph{is} multiply read} +% \changes{2.3c}{1995/09/04}{Changed some dirty tricks to be +% less/more dirty---all uses of \cs{afterfi}} +% \changes{2.3e}{1995/09/25}{Directories support} +% \changes{2.3e}{1995/10/24}{added \cs{makepathname} to support +% systems with bizzare pathnames} +% \changes{2.3e}{1995/10/25}{batch files work by \cs{input}} +% \changes{2.3e}{1996/10/02}{Introduced ``open lists''} +% \changes{2.4a}{1996/06/06}{Add stream limits (MDW)} +% \changes{2.4c}{1996/06/11}{Add initex support (DPC)} +% +% \DoNotIndex{\#,\$,\%,\&,\@,\\,\{,\},\^,\_,\~,\ } +% \DoNotIndex{\@ne} +% \DoNotIndex{\advance,\begingroup,\catcode,\closein,\closeout} +% \DoNotIndex{\day,\def,\edef,\else,\empty,\endgroup,\errmessage} +% \DoNotIndex{\expandafter,\fi,\futurelet,\gdef,\global,\if,\ifeof} +% \DoNotIndex{\ifx,\immediate,\let,\loop,\m@ne,\message,\month} +% \DoNotIndex{\newcount} +% \DoNotIndex{\newif,\newlinechar,\newread,\newtoks,\newwrite} +% \DoNotIndex{\noexpand,\openin,\openout,\par,\read,\relax,\repeat} +% \DoNotIndex{\space,\the,\undefined,\write,\xdef,\year,\z@} +% +% ^^A some definitions for this documentation +% +% \newcommand{\ds}{\textsf{DocStrip}} ^^A maybe? +% \newcommand{\bsl}{\protect\bslash} +% \newcommand{\note}[1]{\marginpar{\textbf{#1}}} +% \newcommand{\netaddress}[1]{\texttt{#1}} +% +% ^^A override the default in doc.sty +% \makeatletter +% \renewenvironment{theglossary}{% +% \glossary@prologue% +% \GlossaryParms \let\item\@idxitem \ignorespaces}% +% {} +% \makeatother +% +% +% \changes{2.1c}{1993/02/25}{Added a setting for StandardModuleDepth} +% \setcounter{StandardModuleDepth}{1} +% +% \title{The \ds{} program% +% \thanks{This file has version number \fileversion, +% last revised \filedate, +% documentation dated \docdate.}} +% +% \changes{2.1b}{1993/02/23}{modified mailaddress of Johannes} +% \changes{2.4i}{1998/01/18}{removed mail addresses as it is hopeless +% to keep them uptodate} +% \author{% +% Frank Mittelbach +% \and +% Denys Duchier +% \and +% Johannes Braams +% \and +% Marcin Woli\'nski +% \and +% Mark Wooding +% } +% +% \date{Printed \today} +% +% \maketitle +% +% \begin{abstract} +% This document describes the implementation of the \ds{} program. +% The original version of this program was developed by Frank +% Mittelbach to accompany his \texttt{doc.sty} which enables literate +% programming in \LaTeX\@. Denys Duchier rewrote it to run either +% with \TeX\ or with \LaTeX, and to allow full boolean expressions in +% conditional guards instead of just comma-separated lists. +% Johannes Braams re-united the two implementations, documented and +% debugged the code. +% +% In September 1995 Marcin Woli\'nski changed many parts of the +% program to make use of \TeX's ability to write to multiple files +% at the same time to avoid re-reading sources. The performance +% improvement of version~2.3 came at a price of compatibility with +% some more obscure operating systems which limit the number of +% files a process can keep open. This was corrected in September +% 1996 by Mark Wooding and his changes were ``creatively merged'' +% by Marcin Woli\'nski who made at the same time changes in batch +% files processing, handling of preambles and introduced ``verbatim +% mode''. After all that, David Carlisle merged the new version into +% the \LaTeX\ sources, and made a few other changes, principally +% making \ds{} work under initex, and removing the need for +% batch files to say \verb|\def\batchfile{...}|. +% \end{abstract} +% +% \section{Introduction} +% +% \subsection{Why the \ds{} program?} When Frank Mittelbach created +% the \texttt{doc} package, he invented a way to combine \TeX\ code +% and its documentation. From then on it was more or less possible +% to do literate programming in \TeX. +% +% This way of writing \TeX\ programs obviously has great +% advantages, especially when the program becomes larger than a +% couple of macros. There is one drawback however, and that is +% that such programs may take longer than expected to run because +% \TeX\ is an interpreter and has to decide for each line of the +% program file what it has to do with it. Therefore, \TeX\ programs +% may be speeded up by removing all comments from them. +% +% By removing the comments from a \TeX\ program a new problem is +% introduced. We now have two versions of the program and both of +% them {\em have\/} to be maintained. Therefore it would be nice to +% have a possibility to remove the comments automatically, instead +% of doing it by hand. So we need a program to remove comments from +% \TeX\ programs. This could be programmed in any high level +% language, but maybe not everybody has the right compiler to +% compile the program. Everybody who wants to remove comments from +% \TeX\ programs has \TeX\@. Therefore the \ds{} program is +% implemented entirely in \TeX. +% +% \subsection{Functions of the \ds{} program} +% +% Having created the \ds{} program to remove comment lines from +% \TeX\ programs\footnote{Note that only comment lines, that is +% lines that start with a single \texttt{\%} character, are removed; +% all other comments stay in the code.} it became feasible to do more +% than just strip comments.\\ Wouldn't it be nice to have a way to +% include parts of the code only when some condition is set true? +% Wouldn't it be as nice to have the possibility to split the +% source of a \TeX\ program into several smaller files and combine +% them later into one `executable'?\\ Both these wishes have been +% implemented in the \ds{} program. +% +% \section{How to use the \ds{} program} +% A number of ways exist to use the \ds{} program: +% \begin{enumerate} +% \item The usual way to use \ds{} is to write a \emph{batch file} +% in such a way that it can be directly processed by \TeX{}. +% The batch file should contain the commands described below for +% controlling the \ds{} program. +% This allows you to set up a distribution where you can instruct +% the user to simply run +% \begin{quote} +% \texttt{TEX} \meta{batch file} +% \end{quote} +% to generate the executable versions of your files from the +% distribution sources. +% Most of the \LaTeX\ distribution is packaged this way. +% To produce such a batch file include a statement in your +% `batch file' that +% instructs \TeX\ to read \texttt{docstrip.tex}. +% The beginning of such a file would look like: +%\begin{verbatim} +% \input docstrip +% ... +%\end{verbatim} +% By convention the batch file should have extension |.ins|. But +% these days \ds{} in fact work with any extension. +% +% \item Alternatively you can instruct \TeX\ to read the file +% \texttt{docstrip.tex} and to see what happens. \TeX\ will ask +% you a few questions about the file you would like to be +% processed. When you have answered these questions it does +% its job and strips the comments from your \TeX\ code. +% \end{enumerate} +% +% \section{Configuring \ds} +% \subsection{Selecting output directories} +% \changes{2.3e}{1996/09/19}{Added documentation} +% Inspired by a desire to simplify reinstallations of \LaTeXe{} and +% to support operating systems which have an upper limit on the +% number of files allowed in a directory, \ds\ now allows +% installation scripts to specify output directories for files it +% creates. We suggest using TDS (\TeX\ directory structure) names +% of directories relative to \texttt{texmf} here. However these +% names should be thought of as a labels rather than actual names +% of directories. They get translated to actual system-dependent +% pathnames according to commands contained in a configuration file +% named \texttt{docstrip.cfg}. +% +% The configuration file is read by \ds{} just before it starts to +% process any batch file commands. +% +% If this file is not present \ds{} uses some default settings which +% ensure that files are only written to the current directory. +% However by use of this configuration file, a site maintainer can +% `enable' features of \ds{} that allow files to be written to +% alternative directories. +% +% \DescribeMacro{\usedir} +% Using this macro package author can tell where a file should be +% installed. All |\file|s generated in the scope of that +% declaration are written to a directory specified by its one +% argument. For example in \LaTeXe{} installation following +% declarations are used: +%\begin{verbatim} +% \usedir{tex/latex/base} +% \usedir{makeindex} +%\end{verbatim} +% And standard packages use +%\begin{verbatim} +% \usedir{tex/latex/tools} +% \usedir{tex/latex/babel} +%\end{verbatim} +% etc. +% +% \DescribeMacro{\showdirectory} +% Used to display directory names in messages. If some label is not +% defined it expands to |UNDEFINED (label is ...)| otherwise to a +% directory name. It is probably a good idea for every installation +% script to display at startup list of all directories that would +% be used and asking user to confirm that. +% +% The above macros are used by package/installation script +% author. The following macros are used in a configuration file, +% |docstrip.cfg|, by a system administrator to +% describe her/his local directory structure. +% +% \DescribeMacro{\BaseDirectory} This macro is administrator's way of +% saying ``yes, I want to use that directories support of +% yours''. \ds{} will write only to current directory unless your +% config has a call to this macro. (This means \ds{} won't write to +% random directories unless you tell it to, which is nice.) Using +% this macro you can specify a base directory for \TeX-related +% stuff. E.g., for many Unix systems that would be +%\begin{verbatim} +% \BaseDirectory{/usr/local/lib/texmf} +%\end{verbatim} +% and for standard em\TeX{} installation +%\begin{verbatim} +% \BaseDirectory{c:/emtex} +%\end{verbatim} +% +% \DescribeMacro{\DeclareDir} +% Having specified the base directory you should tell \ds{} how to +% interpret labels used in |\usedir| commands. This is done with +% |\DeclareDir| with two arguments. The first is the label and the +% second is actual name of directory relative to base +% directory. For example to teach \ds{} using standard em\TeX{} +% directories one would say: +%\begin{verbatim} +% \BaseDirectory{c:/emtex} +% \DeclareDir{tex/latex/base}{texinput/latex2e} +% \DeclareDir{tex/latex/tools}{texinput/tools} +% \DeclareDir{makeindex}{idxstyle} +%\end{verbatim} +% This will cause base latex files and font descriptions to be +% written to directory |c:\emtex\texinput\latex2e|, files of +% \texttt{tools} package to |c:\emtex\texinput\tools| and makeindex +% files to |c:\emtex\idxstyle|. +% +% Sometimes it is desirable to put some files outside of the base +% directory. For that reason |\DeclareDir| has a star form +% specifying absolute pathname. For example one could say +%\begin{verbatim} +% \DeclareDir*{makeindex}{d:/tools/texindex/styles} +%\end{verbatim} +% +% \DescribeMacro{\UseTDS} +% Users of systems conforming to TDS may well ask here ``do I +% really need to put a dozen of lines like +%\begin{verbatim} +% \DeclareDir{tex/latex/base}{tex/latex/base} +%\end{verbatim} +% in my config file''. The answer is |\UseTDS|. This macro causes +% \ds{} to use labels themselves for any directory you haven't +% overriden with |\DeclareDir|. The default behaviour is to raise +% an error on undefined labels because some users may want to know +% exactly where files go and not to allow \ds{} to write to random +% places. However I (MW) think this is pretty cool and my +% config says just (I'm running te\TeX{} under Linux) +%\begin{verbatim} +% \BaseDirectory{/usr/local/teTeX/texmf} +% \UseTDS +%\end{verbatim} +% +% The important thing to note here is that it is impossible to create +% a new directory from inside \TeX{}. So however you configure +% \ds, you need to create all needed directories before running +% the installation. Authors may want to begin +% every installation script by displaying a list of directories +% that will be used and asking user if he's sure all of them +% exist. +% +% Since file name syntax is OS specific \ds{} tries to guess it +% from the current directory syntax. It should succeed for Unix, +% MSDOS, Macintosh and VMS. However \ds{} will only initially +% know the current directory syntax if it is used with \LaTeX. +% If used with plain\TeX\ or initex it will not have this +% information\footnote{Except when processing the main +% \texttt{unpack.ins} batch file for the \LaTeX\ distribution, which +% takes special measures so that initex can learn the directory +% syntax.}. +% If you often use \ds{} with formats other than \LaTeX\ you should +% \emph{start} the file |docstrip.cfg| with a definition of +% |\WriteToDir|. E.g., +% |\def\WriteToDir{./}| on MSDOS/Unix, +% |\def\WriteToDir{:}| on Macintosh, +% |\def\WriteToDir{[]}| on VMS. +% +% If your system requires something +% completely different you can define in |docstrip.cfg| macros +% |\dirsep| and |\makepathname|. Check for their definition in the +% implementation part. If you want some substantially different +% scheme of translating |\usedir| labels into directory names try +% redefining macro |\usedir|. +% +% \subsection{Setting maximum numbers of streams} +% +% \DescribeMacro{\maxfiles} +% In support of some of the more obscure operating systems, there's +% a limit on the number of files a program can have open. This can +% be expressed to \ds\ through the |\maxfiles| macro. If the number +% of streams \ds\ is allowed to open is $n$, your configuration file +% can say |\maxfiles{|$n$|}|, and \ds\ won't try to open more files +% than this. Note that this limit won't include files which are +% already open. There'll usually be two of these: the installation +% script which you started, and the file |docstrip.tex| which it +% included; you must bear these in mind yourself. \ds\ assumes +% that it can open at least four files before it hits some kind of +% maximum: if this isn't the case, you have real problems. +% +% \DescribeMacro{\maxoutfiles} +% Maybe instead of having a limit on the number of files \TeX\ can +% have open, there's a limit on the number of files it can write +% to (e.g., \TeX\ itself imposes a limit of 16~files being written +% at a time). This can be expressed by saying |\maxoutfiles{|$m$|}| +% in a configuration file. You must be able to have at least one +% output file open at a time; otherwise \ds\ can't do anything at +% all. +% +% Both these options would typically be put in the |docstrip.cfg| +% file. +% +% +% \section{The user interface} +% +% \subsection{The main program} +% \DescribeMacro{\processbatchFile} The `main program' starts with +% trying to process a batch file, this is accomplished by calling +% the macro |\processbatchFile|. It counts the number of batch +% files it processes, so that when the number of files processed is +% still zero after the call to |\processbatchFile| appropriate +% action can be taken. +% +% \DescribeMacro{\interactive} When no batch files have been processed +% the macro |\interactive| is called. It prompts the user for +% information. First the extensions of the input and output files +% is determined. Then a question about optional code is asked and +% finally the user can give a list of files that have to be +% processed. +% +% \DescribeMacro{\ReportTotals} When the \texttt{stats} option is +% included in the \ds{}-program it keeps a record of the number of +% files and lines that are processed. Also the number of comments +% removed and passed as well as the number of code lines that were +% passed to the output are accounted. The macro |\ReportTotals| +% shows a summary of this information. +% +% \subsection{Batchfile commands} +% +% The commands described in this section are available to build a +% batch file for \TeX. +% +% \DescribeMacro{\input} +% All \ds{} batch files should start with the line: |\input docstrip| +% +% Do not use the \LaTeX\ syntax |\input{docstrip}| as batch files may +% be used with plain~\TeX\ or ini\TeX. +% You may that old batch files always have a line +% |\def\batchfile{|\meta{filename}|}| +% just before the input. +% Such usage is still supported but is now discouraged, as it causes +% \TeX\ to re-input the same file, using up one of its limited number +% of input streams. +% +% \DescribeMacro{\endbatchfile} +% All batch files should end with this command. Any lines after this +% in the file are ignored. In old files that start +% |\def\batchfile{|\ldots\ this command is optional, but is a good +% idea anyway. If this command is omitted from a batchfile then +% normally \TeX\ will go to its interactive |*| prompt, so you may +% stop \ds{} by typing |\endbatchfile| to this prompt. +% +% \DescribeMacro{\generate} +% \DescribeMacro{\file} +% \DescribeMacro{\from} +% The main reason for constructing a \ds{} command file is to +% describe what files should be generated, from what sources and +% what optional (`guarded') pieces of code should be included. The +% macro |\generate| is used to give \TeX\ this information. Its +% syntax is: +% \begin{quote} +% |\generate{|[|\file{|\meta{output}|}{|[|\from{|^^A +% \meta{input}|}{|\meta{optionlist}|}|]*|}|]*|}| +% \end{quote} +% The \meta{output} and \meta{input} are normal file specifications +% as are appropriate for your computer system. The +% \meta{optionlist} is a comma separated list of `options' that +% specify which optional code fragments in \meta{input} should be +% included in \meta{output}. Argument to |\generate| may contain +% some local declarations (e.g., the |\use...| commands described +% below) that will apply to all |\file|s after them. Argument to +% |\generate| is executed inside a group, so all local declarations +% are undone when |\generate| concludes. +% +% It is possible to specify multiple input files, each with its own +% \meta{optionlist}. This is indicated by the notation [\ldots]*. +% Moreover there can be many |\file| specifications in one +% |\generate| clause. This means that all these \meta{output} files +% should be generated while reading each of \meta{input} files +% once. Input files are read in order of first appearance in this +% clause. E.g. +%\begin{verbatim} +% \generate{\file{p1.sty}{\from{s1.dtx}{foo,bar}} +% \file{p2.sty}{\from{s2.dtx}{baz} +% \from{s3.dtx}{baz}} +% \file{p3.sty}{\from{s1.dtx}{zip} +% \from{s2.dtx}{zip}} +% } +%\end{verbatim} +% will cause \ds{} to read files \texttt{s1.dtx}, \texttt{s2.dtx}, +% \texttt{s3.dtx} (in that order) and produce files +% \texttt{p1.sty}, \texttt{p2.sty}, \texttt{p3.sty}. +% +% The restriction to at most 16 output streams open in a while +% does not mean that you can produce at most 16 files with one +% |\generate|. In the example above only 2 streams are needed, +% since while \texttt{s1.dtx} is processed only \texttt{p1.sty} and +% \texttt{p3.sty} are being generated; while reading +% \texttt{s2.dtx} only \texttt{p2.sty} and \texttt{p3.sty}; and +% while reading \texttt{s3.dtx} file \texttt{p2.sty} . However +% example below needs 3 streams: +%\begin{verbatim} +% \generate{\file{p1.sty}{\from{s1.dtx}{foo,bar}} +% \file{p2.sty}{\from{s2.dtx}{baz} +% \from{s3.dtx}{baz}} +% \file{p3.sty}{\from{s1.dtx}{zip} +% \from{s3.dtx}{zip}} +% } +%\end{verbatim} +% Although while reading \texttt{s2.dtx} file \texttt{p3.sty} is +% not written it must remain open since some parts of +% \texttt{s3.dtx} will go to it later. +% +% Sometimes it is not possible to create a file by reading all +% sources once. Consider the following example: +%\begin{verbatim} +% \generate{\file{p1.sty}{\from{s1.dtx}{head} +% \from{s2.dtx}{foo} +% \from{s1.dtx}{tail}} +% \file{s1.drv}{\from{s1.dtx}{driver}} +% } +%\end{verbatim} +% To generate \texttt{p1.sty} file \texttt{s1.dtx} must be read +% twice: first time with option \texttt{head}, then file +% \texttt{s2.dtx} is read and then \texttt{s1.dtx} again this time +% with option \texttt{tail}. \ds{} handles this case correctly: if +% inside one |\file| declaration there are multiple |\from|es with +% the same input file this file \emph{is} read multiple times. +% +% If the order of |\from|s specified in one of your |\file| +% specifications does not match the order of input files +% established by previous |\file|s, \ds{} will raise an error and +% abort. Then you may either read one of next sections or give up +% and put that file in separate |\generate| (but then sources will +% be read again just for that file). +% +% \paragraph{For impatient.} Try following algorithm: Find +% file that is generated from largest number of sources, start +% writing |\generate| clause with this file and its sources in +% proper order. Take other files that are to be generated and add +% them checking if they don't contradict order of sources for the +% first one. If this doesn't work read next sections. +% +% \paragraph{For mathematicians.} Relation ``file $A$ must be +% read before file $B$'' is a partial order on the set of all your +% source files. Each |\from| clause adds a chain to this order. +% What you have to do is to perform a topological sort i.e. to +% extend partial order to linear one. When you have done it just +% list your source files in |\generate| in such a way that order of +% their first appearance in the clause matches linear order. If +% this cannot be achieved read next paragraph. (Maybe future +% versions of \ds{} will perform this sort automatically, so all +% these troubles will disappear.) +% +% \paragraph{For that who must know that all.} There is a +% diverse case when it's not possible to achieve proper order of +% reading source files. Suppose you have to generate two files, +% first from \texttt{s1.dtx} and \texttt{s3.dtx} (in that order) +% and second from \texttt{s2.dtx} and \texttt{s3.dtx}. Whatever +% way you specify this the files will be read in either as +% \texttt{s1 s3 s2} or \texttt{s2 s3 s1}. The key to solution is +% magical macro |\needed| that marks a file as needed to be input +% but not directing any output from it to current |\file|. In our +% example proper specification is: +%\begin{verbatim} +% \generate{\file{p1.sty}{\from{s1.dtx}{foo} +% \needed{s2.dtx} +% \from{s3.dtx}{bar}} +% \file{p2.sty}{\from{s2.dtx}{zip} +% \from{s3.dtx}{zap}} +% } +%\end{verbatim} +% +% +% \DescribeMacro{\askforoverwritetrue} +% \DescribeMacro{\askforoverwritefalse} +% These macros specify what should happen if a file that is to be +% generated already exists. If |\askforoverwritetrue| is active +% (the default) the user is asked whether the file should be +% overwritten. If however |\askforoverwritefalse| was issued +% existing files will be overwritten silently. These switches are +% local and can be issued in any place in the file even inside +% |\generate| clause (between |\file|s however). +% +% \DescribeMacro{\askonceonly} +% You might not want to set |\askforoverwritefalse| in a batch file +% as that says that it us always all right to overwrite other people's +% files. However for large installations, such as the base \LaTeX\ +% distribution, being asked individually about hundreds of files +% is not very helpful either. A batchfile may therefore specify +% |\askonceonly|. This means that after the first time the batchfile +% asks the user a question, the user is given an option of to change +% the behaviour so that `yes' will be automatically assumed for all +% future questions. This applies to any use of the \ds{} commamnd +% |\Ask| including, but not restricted to, the file overwrite +% questions controlled by |\askforoverwritetrue|. +% +% \DescribeMacro{\preamble} +% \DescribeMacro{\endpreamble} +% \DescribeMacro{\postamble} +% \DescribeMacro{\endpostamble} +% It is possible to add a number of lines to the output of the +% \ds{} program. The information you want to add to the start of +% the output file should be listed between the |\preamble| and +% |\endpreamble| commands; the lines you want to add to the end of +% the output file should be listed between the |\postamble| and +% |\endpostamble| commands. Everything that \ds{} finds for both +% the pre- and postamble it writes to the output file, but preceded +% with value of |\MetaPrefix| (default is two \%-characters). If +% you include a |^^J| character in one of these lines, everything +% that follows it on the same line is written to a new line in the +% output file. This `feature' can be used to add a |\typeout| or +% |\message| to the the stripped file. +% +% \DescribeMacro{\declarepreamble} +% \DescribeMacro{\declarepostamble} +% \DescribeMacro{\usepreamble} +% \DescribeMacro{\usepostamble} +% \DescribeMacro{\nopreamble} +% \DescribeMacro{\nopostamble} +% Sometimes it is desirable to have different preambles for different +% files of a larger package (e.g., because some of them are +% customisable configuration files and they should be marked as +% such). In such a case one can say |\declarepreamble\somename|, +% then type in his/her preamble, end it with |\endpreamble|, +% and later on |\usepreamble\somename| to switch to this +% preamble. +% If no preamble should be used you can deploy the |\nopreamble| +% command. This command is equivalent to saying |\usepreamble\empty|. +% The same mechanism works for postambles, |\use...| +% declarations are local and can appear inside |\generate|. +% +% Commands |\preamble| and |\postamble| define and activate +% pre(post)ambles named |\defaultpreamble| and |\defaultpostamble|. +% +% \DescribeMacro{\batchinput} +% The batch file commands can be put into several batch files which +% are then executed from a master batch file. This is, for example, +% useful if a distribution consists of several distinct parts. You +% can then write individual batch files for every part and in +% addition a master file that simply calls the batch files for the +% parts. For this, call the individual batch files from the master +% file with the command |\batchinput{|\meta{file}|}|. Don't use +% |\input| for this purpose, this command +% should be used only for calling the \ds{} program as explained +% above and is ignored when used for any other purpose. +% +% \DescribeMacro{\ifToplevel} +% When batch files are nested you may want to suppress certain +% commands in the lower-level batch files such as terminal +% messages. For this purpose you can use the |\ifToplevel| command +% which executes its argument only if the current batch file is the +% outermost one. Make sure that you put the opening brace of the +% argument into the same line as the command itself, otherwise the +% \ds{} program will get confused. +% +% \DescribeMacro{\showprogress} +% \DescribeMacro{\keepsilent} +% When the option \texttt{stats} is included in \ds{} it can +% write message to the terminal as each line of the input file(s) is +% processed. This message consists of a single character, indicating +% kind of that particular line. We use the +% following characters: +% \begin{itemize} +% \item[\texttt{\%}] Whenever an input line is a comment +% \texttt{\%}-character is written to the terminal. +% \item[\texttt{.}] Whenever a code line is encountered +% a \texttt{.}-character is written on the terminal. +% \item[\texttt{/}] When a number of empty lines appear in a row in the +% input file, at most one of them is retained. The \ds{} +% program signals the removal of an empty line with the +% \texttt{/}-character. +% \item[\texttt{<}] When a `guard line' is found in the input and it +% starts a block of optionally included code, this is signalled +% on the terminal by showing the \texttt{<}-character, together +% with the boolean expression of the guard. +% \item[\texttt{>}] The end of a conditionally included block of code is +% indicated by showing the \texttt{>}-character. +% \end{itemize} +% This feature is turned on by default when the option +% \texttt{stats} is included, otherwise it is turned off. The +% feature can be toggled with the commands |\showprogress| and +% |\keepsilent|. +% +% +% \subsubsection{Supporting old interface} +% +% \DescribeMacro{\generateFile} +% Here is the old syntax for specifing what files are to be +% generated. It allows specification of just one output file. +% \begin{quote} +% |\generateFile{|\meta{output}|}{|\meta{ask}|}{|[|\from{|^^A +% \meta{input}|}{|\meta{optionlist}|}|]*|}| +% \end{quote} +% The meaning of \meta{output}, \meta{input} and +% \meta{optionslist} is just as for |\generate|. With +% \meta{ask} you can instruct \TeX\ to either silently overwrite a +% previously existing file (|f|) or to issue a warning and ask you +% if it should overwrite the existing file (|t|) (it overrides the +% |\askforoverwrite| setting). +% +% \DescribeMacro{\include} +% \DescribeMacro{\processFile} +% The earlier version of the \ds{} program supported a +% different kind of command to tell \TeX\ what to do. This command +% is less powerful than |\generateFile|; it can be used when +% \meta{output} is created from one \meta{input}. The syntax is: +% \begin{quote} +% |\include{|\meta{optionlist}|}| +% +% |\processFile{|\meta{name}|}{|\meta{inext}^^A +% |}{|\meta{outext}^^A +% |}{|\meta{ask}|}| +% \end{quote} +% This command is based on environments where filenames are +% constructed of two parts, the name and the extension, separated +% with a dot. The syntax of this command assumes that the +% \meta{input} and \meta{output} share the same name and only +% differ in their extension. This command is retained to be +% backwards compatible with the older version of \ds{}, but its use +% is not encouraged. +% +% \section{Conditional inclusion of code} +% +% When you use the \ds{} program to strip comments out of +% \TeX\ macro files you have the possibility to make more than one +% stripped macro file from one documented file. This is achieved by +% the support for optional code. The optional code is marked +% in the documented file with a `guard'. +% +% A guard is a boolean expression that is enclosed in |<| and |>|. +% It also {\em has\/} to follow the |%| at the beginning of the line. +% For example: +%\begin{verbatim} +% ... +% %\TeX code +% ... +%\end{verbatim} +% In this example the line of code will be included in \meta{output} +% if the option \texttt{bool} is present in the \meta{optionlist} of +% the |\generateFile| command. +% +% The syntax for the boolean expressions is: +% +%\DeleteShortVerb\| +% \begin{tabular}{lcl} +% \meta{Expression} & $::=$ & \meta{Secondary} +% [\{\texttt{|}, \texttt{,}\} +% \meta{Secondary}]*\\ +% \meta{Secondary} & $::=$ & +% \meta{Primary} [\texttt{\&} +% \meta{Primary}]*\\ +% \meta{Primary} & $::=$ & +% \meta{Terminal} $|$ \texttt{!}\meta{Primary} +% $|$ \texttt{(}\meta{Expression}\texttt{)}\\ +% \end{tabular} +% +% The \texttt{|} stands for disjunction, the \texttt{\&} stands for +% conjunction and the \texttt{!}\ stands for negation. The +% \meta{Terminal} is any sequence of letters and evaluates to +% \meta{true} iff\footnote{iff stands for `if and only if'} it +% occurs in the list of options that have to be included. +%\MakeShortVerb\| +% +% Two kinds of optional code are supported: one can either have +% optional code that `fits' on one line of text, like the example +% above, or one can have blocks of optional code. +% +% To distinguish both kinds of optional code the `guard modifier' +% has been introduced. The `guard modifier' is one character that +% immediately follows the |<| of the guard. It can be either |*| +% for the beginning of a block of code, or |/| for the end of a +% block of code\footnote{To be compatible with the earlier version +% of \ds{} also \texttt{+} and \texttt{-} are supported as `guard +% modifiers'. However, there is an incompatibility with the +% earlier version since a line with a \texttt{+}-modified guard is +% not included inside a block with a guard that evaluates to false, +% in contrast to the previous behaviour.}. The beginning and +% ending guards for a block of code have to be on a line by +% themselves. +% +% When a block of code is {\em not\/} included, any guards that occur +% within that block are {\em not\/} evaluated. +% +% \section{Those other languages} +% Since \TeX\ is an open system some of \TeX\ packages include +% non-\TeX\ files. Some authors use \ds\ to generate PostScript +% headers, shell scripts or programs in other languages. For them +% the comments-stripping activity of \ds\ may cause some +% trouble. This section describes how to produce non-\TeX\ files +% with \ds\ effectively. +% +% \subsection{Stuff \ds\ puts in every file} +% First problem when producing files in ``other'' languages is that +% \ds\ adds some bits to the begining and end of every generated +% file that may not fit with the syntax of the language in +% question. So we'll study carefully what exactly goes where. +% +% The whole text put on begining of file is kept in a macro defined +% by |\declarepreamble|. Every line of input presented to +% |\declarepreamble| is prepended with current value of +% |\MetaPrefix|. Standard \ds\ header is inserted before your text, +% and macros |\inFileName|, |\outFileName| and |\ReferenceLines| +% are used as placeholders for information which will be filled in +% later (specifically for each output file). Don't try to redefine +% these macros. After +%\begin{verbatim} +% \declarepreamble\foo +% ____________________________ +% Package FOO for use with TeX +% \endpreamble +%\end{verbatim} +% macro |\foo| is defined as +%\begin{verbatim} +% %%^^J +% %% This is file `\outFileName ',^^J +% %% generated with the docstrip utility.^^J +% \ReferenceLines^^J +% %% ____________________________^^J +% %% Package FOO for use with TeX. +%\end{verbatim} +% You can play with it freely or even define it from scratch. To +% embed the preamble in Adobe structured comments just use |\edef|: +%\begin{verbatim} +% \edef\foo{\perCent!PS-Adobe-3.0^^J% +% \DoubleperCent\space Title: \outFileName^^J% +% \foo^^J% +% \DoubleperCent\space EndComments} +%\end{verbatim} +% After that use |\usepreamble\foo| to select your new preamble. +% Everything above works as well for postambles. +% +% You may also prevent \ds\ from adding anything to your file, and +% put any language specific invocations directly in your code: +%\begin{verbatim} +% \generate{\usepreamble\empty +% \usepostamble\empty +% \file{foo.ps}{\from{mypackage.dtx}{ps}}} +%\end{verbatim} +% or alternatively |\nopreamble| and |\nopostamble|. +% +% \subsection{Meta comments} +% You can change the prefix used for putting meta comments to +% output files by redefining |\MetaPrefix|. Its default value is +% |\DoubleperCent|. The preamble uses value of |\MetaPrefix| +% current at time of |\declarepreamble| while meta comments in the +% source file use value current at time of |\generate|. Note that +% this means that you cannot produce concurrently two files using +% different |\MetaPrefix|es. +% +% \subsection{Verbatim mode} +% If your programming language uses some construct that can +% interferes badly with \ds\ (e.g., percent in column one) you may +% need a way for preventing it from being stripped off. For that +% purpose \ds\ features `verbatim mode'. +% +% A `Guard expression' of the form |%<<|\meta{END-TAG} marks +% the start of a section that will be copied verbatim upto a line +% containing only a percent in column 1 followed by \meta{END-TAG}. +% You can select any \meta{END-TAG} you want, but note that spaces +% count here. Example: +%\begin{verbatim} +% %<*myblock> +% some stupid() +% #computer +% %< +% % +%\end{verbatim} +% And the output is (when stripped with \texttt{myblock} defined): +%\begin{verbatim} +% some stupid() +% #computer +% % These two lines are copied verbatim (including percents +% %% even if \MetaPrefix is something different than %%). +% using*strange@programming +%\end{verbatim} +% +%\StopEventually{% +%^^A \section{Conclusion} +% \PrintIndex +% \PrintChanges +%^^A \makesignature +% } +% +% \section{Producing the documentation} +% +% We provide a short driver file that can be extracted by the +% \ds{} program using the the conditional `\textsf{driver}'. To +% allow the use of \texttt{docstrip.dtx} as a program at Ini\TeX{} +% time (e.g., to strip +% off its own comments) we need to add a bit of primitive code. +% With this extra checking it is still possible to process this +% file with \LaTeXe{} to typeset the documentation. +% \changes{2.1b}{1993/02/23}{Added fontdefinitions for doc to the driver +% file, in order to get the layout of the code +% right; also added the layout definitions +% that are in effect in \texttt{doc.drv}} +% \changes{2.1c}{1993/02/23}{Remove definitions for fonts again} +% \changes{2.2f}{1994/02/26}{Allow direct processing of source} +% \begin{macrocode} +%<*driver> +% \end{macrocode} +% If |\documentclass| is undefined, e.g., if Ini\TeX{} or plain +% \TeX{} is used for formatting, we bypass the driver file. +% +% \changes{2.3a}{1995/08/20}{Changed driver} +% We use some trickery to avoid issuing |\end{document}| when +% the |\ifx| construction is unfinished. If condition below is +% true a |\fi| is constructed on the fly, the |\ifx| is completed, +% and the real |\fi| will never be seen as it comes after +% |\end{document}|. On the other hand if condition is false +% \TeX\ skips over |\csname fi\endcsname| having no idea that +% this could stand for |\fi|, driver is skipped and only then +% the condition completed. +% +% Additional guard |gobble| prevents \ds\ from extracting +% these tricks to real driver file. +% \begin{macrocode} +%<*gobble> +\ifx\jobname\relax\let\documentclass\undefined\fi +\ifx\documentclass\undefined +\else \csname fi\endcsname +% +% \end{macrocode} +% Otherwise we process the following lines which will result in +% formatting the documentation. +% \begin{macrocode} + \documentclass{ltxdoc} + \EnableCrossrefs + % \DisableCrossrefs + % use \DisableCrossrefs if the + % index is ready + \RecordChanges + % \OnlyDescription + \typeout{Expect some Under- and overfull boxes} + \begin{document} + \DocInput{docstrip.dtx} + \end{document} +%<*gobble> +\fi +% +% +% \end{macrocode} +% +% +% \section{The implementation} +% +% \subsection{Initex initializations} +% Allow this program to run with |initex|. +% The |Z| trickery saves the need to worry about |\outer| stuff in +% plain \TeX. +% \begin{macrocode} +%<*initex> +\catcode`\Z=\catcode`\% +\ifnum13=\catcode`\~{\egroup\else + \catcode`\Z=9 +Z +Z \catcode`\{=1 \catcode`\}=2 +Z \catcode`\#=6 \catcode`\^=7 +Z \catcode`\@=11 \catcode`\^^L=13 +Z \let\bgroup={ \let\egroup=} +Z +Z \dimendef\z@=10 \z@=0pt \chardef\@ne=1 \countdef\m@ne=22 \m@ne=-1 +Z \countdef\count@=255 +Z +Z \def\wlog{\immediate\write\m@ne} \def\space{ } +Z +Z \count10=22 % allocates \count registers 23, 24, ... +Z \count15=9 % allocates \toks registers 10, 11, ... +Z \count16=-1 % allocates input streams 0, 1, ... +Z \count17=-1 % allocates output streams 0, 1, ... +Z +Z \def\alloc@#1#2#3{\advance\count1#1\@ne#2#3\count1#1\relax} +Z +Z \def\newcount{\alloc@0\countdef} \def\newtoks{\alloc@5\toksdef} +Z \def\newread{\alloc@6\chardef} \def\newwrite{\alloc@7\chardef} +Z +Z \def\newif#1{% +Z \count@\escapechar \escapechar\m@ne +Z \let#1\iffalse +Z \@if#1\iftrue +Z \@if#1\iffalse +Z \escapechar\count@} +Z \def\@if#1#2{% +Z \expandafter\def\csname\expandafter\@gobbletwo\string#1% +Z \expandafter\@gobbletwo\string#2\endcsname +Z {\let#1#2}} +Z +Z \def\@gobbletwo#1#2{} +Z \def\@gobblethree#1#2#3{} +Z +Z \def\loop#1\repeat{\def\body{#1}\iterate} +Z \def\iterate{\body \let\next\iterate \else\let\next\relax\fi \next} +Z \let\repeat\fi +Z +Z \def\empty{} +Z +Z \def\tracingall{\tracingcommands2 \tracingstats2 +Z \tracingpages1 \tracingoutput1 \tracinglostchars1 +Z \tracingmacros2 \tracingparagraphs1 \tracingrestores1 +Z \showboxbreadth 10000 \showboxdepth 10000 \errorstopmode +Z \errorcontextlines 10000 \tracingonline1 } +Z +\bgroup}\fi\catcode`\Z=11 +\let\bgroup={ \let\egroup=} +% +% \end{macrocode} +% +% \subsection{Declarations and initializations} +% +% In order to be able to include the \texttt{@}-sign in control +% sequences its category code is changed to \meta{letter}. The +% `program' guard here allows most of the code to be excluded when +% extracting the driver file. +% \begin{macrocode} +%<*program> +\catcode`\@=11 +% \end{macrocode} +% +% When we want to write multiple lines to the terminal with one +% statement, we need a character that tells \TeX\ to break the lines. +% We use \verb=^^J= for this purpose. +% \begin{macrocode} +\newlinechar=`\^^J +% \end{macrocode} +% +% \subsubsection{Switches} +% \begin{macro}{\ifGenerate} +% The program will check if a +% file of the same name as the file it would be creating already +% exists. The switch |\ifGenerate| is used to indicate if the +% stripped file has to be generated. +% \begin{macrocode} +\newif\ifGenerate +% \end{macrocode} +% \end{macro} +% +% \begin{macro}{\ifContinue} +% The switch |\ifContinue| is used in various places in the +% program to indicate if a |\loop| has to end. +% \begin{macrocode} +\newif\ifContinue +% \end{macrocode} +% \end{macro} +% +% \begin{macro}{\ifForlist} +% \changes{2.0g}{1991/06/05}{Macro added.} +% The program contains an implementation of a for-loop, based on +% plain \TeX{}'s |\loop| macros. The implementation needs a +% switch to terminate the loop. +% \begin{macrocode} +\newif\ifForlist +% \end{macrocode} +% \end{macro} +% +% \begin{macro}{\ifDefault} +% The switch |\ifDefault| is used to indicate whether the +% default batch file has to be used. +% \changes{2.0f}{1991/06/04}{Macro added.} +% \begin{macrocode} +\newif\ifDefault +% \end{macrocode} +% \end{macro} +% +% \begin{macro}{\ifMoreFiles} +% The switch |\ifMoreFiles| is used to decide if the user +% wants more files to be processed. It is used only in interactive +% mode; initially it evaluates to \meta{true}. +% \changes{2.0h}{1991/06/19}{Macro added.} +% \begin{macrocode} +\newif\ifMoreFiles \MoreFilestrue +% \end{macrocode} +% \end{macro} +% \begin{macro}{\ifaskforoverwrite} +% The switch |\askforoverwrite| is used to decide if the user +% should be asked when a file is to be overwritten. +% \begin{macrocode} +\newif\ifaskforoverwrite \askforoverwritetrue +% \end{macrocode} +% \end{macro} +% +% \subsubsection{Count registers} +% \begin{macro}{\blockLevel} +% Optionally included blocks of code can be nested. The counter +% |\blockLevel| will be used to keep track of the level of +% nesting. Its initial value is zero. +% \begin{macrocode} +\newcount\blockLevel \blockLevel\z@ +% \end{macrocode} +% \end{macro} +% +% \begin{macro}{\emptyLines} +% The count register |\emptyLines| is used to count the number +% of consecutive empty input lines. Only the first will be copied +% to the output file. +% \changes{2.0i}{1990/06/27}{Macro added} +% \begin{macrocode} +\newcount\emptyLines \emptyLines \z@ +% \end{macrocode} +% \end{macro} +% +% \begin{macro}{\processedLines} +% \begin{macro}{\commentsRemoved} +% \begin{macro}{\commentsPassed} +% \begin{macro}{\codeLinesPassed} +% To be able to provide the user with some statistics about the +% stripping process four counters are allocated if the statistics +% have been included when this program was \ds{}ped. The number of +% lines processed is stored in the counter |\processedLines|. +% The number of lines containing comments that are not written on +% the output file is stored in the counter |\commentsRemoved|; +% the number of comments copied to the output file is stored in the +% counter |\commentsPassed|. The number of lines containing +% macro code that are copied to the output file is stored in the +% counter |\codeLinesPassed|. +% \begin{macrocode} +%<*stats> +\newcount\processedLines \processedLines \z@ +\newcount\commentsRemoved \commentsRemoved \z@ +\newcount\commentsPassed \commentsPassed \z@ +\newcount\codeLinesPassed \codeLinesPassed \z@ +% \end{macrocode} +% \end{macro} +% \end{macro} +% \end{macro} +% \end{macro} +% +% \changes{2.0e}{1991/05/31}{Added counter allocation for the processing +% of multiple files} +% \begin{macro}{\TotalprocessedLines} +% \begin{macro}{\TotalcommentsRemoved} +% \begin{macro}{\TotalcommentsPassed} +% \begin{macro}{\TotalcodeLinesPassed} +% When more than one file is processed and when statistics have +% been included we provide the user also with information about the +% total amount of lines processed. For this purpose four more count +% registers are allocated here. +% \begin{macrocode} +\newcount\TotalprocessedLines \TotalprocessedLines \z@ +\newcount\TotalcommentsRemoved \TotalcommentsRemoved \z@ +\newcount\TotalcommentsPassed \TotalcommentsPassed \z@ +\newcount\TotalcodeLinesPassed \TotalcodeLinesPassed \z@ +% +% \end{macrocode} +% \end{macro} +% \end{macro} +% \end{macro} +% \end{macro} +% +% \begin{macro}{\NumberOfFiles} +% When more than one file is processed, the number of files is +% stored in the count register |\NumberOfFiles|. +% \changes{2.4h}{1997/07/07}{Declare counter always pr/2429} +% \begin{macrocode} +\newcount\NumberOfFiles \NumberOfFiles\z@ +% \end{macrocode} +% \end{macro} +% +% \subsubsection{I/O streams} +% \begin{macro}{\inFile} +% For reading the file with documented \TeX-code, an input stream +% |\inFile| is allocated. +% \begin{macrocode} +\newread\inFile +% \end{macrocode} +% \end{macro} +% +% \changes{2.3a}{1995/08/18}{No allocated streams for console} +% \begin{macro}{\ttyin} +% \begin{macro}{\ttyout} +% Communication with the user goes through (nonexistent) stream 16. +% \begin{macrocode} +\chardef\ttyin16 +\chardef\ttyout16 +% \end{macrocode} +% \end{macro} +% \end{macro} +% +% \begin{macro}{\inputcheck} +% This stream is only used for checking for existence of files. +% \begin{macrocode} +\newread\inputcheck +% \end{macrocode} +% \end{macro} +% +% \begin{macro}{\ifToplevel} +% Execute the argument if current batch file is the outermost one. +% Otherwise suppress it. +% \begin{macrocode} +\newif\iftopbatchfile \topbatchfiletrue +\def\ifToplevel{\relax\iftopbatchfile + \expandafter\iden \else \expandafter\@gobble\fi} +% \end{macrocode} +% \end{macro} +% +% \begin{macro}{\batchinput} +% \changes{2.0n}{1992/04/26}{Added macro} +% \changes{2.1a}{1993/02/22}{Completely redefined (so that it works)} +% +% When the file \texttt{docstrip.tex} is read because of an +% |\input| statement in a batch file we have to prevent an +% endless loop (well, limited by \TeX's stack). Therefore we save +% the original primitive |\input| and define a new macro with +% an argument delimited by \verb*= = (i.e.\ a space) that just +% gobbles the argument. Since the end-of-line character is +% converted by \TeX{} to a space. This means that |\input| is not +% available as a command within batch files. +% +% \begin{macro}{\@@input} +% \changes{2.1a}{1993/02/22}{Macro added} +% We therefore keep a copy of the original under the name +% |\@@input| for internal use. If \ds{} runs under \LaTeX{} this +% command is already defined, so we make a quick test. +% \begin{macrocode} +\ifx\undefined\@@input \let\@@input\input\fi +% \end{macrocode} +% \end{macro} +% +% To allow the nesting of batch files the |\batchinput| command is +% provided it takes one argument, the name of the batch file to +% switch to. +% \begin{macrocode} +\def\batchinput#1{% +% \end{macrocode} +% We start a new group and locally redefine |\batchFile| to hold +% the new batch file name. We toggle the |\iftopbatchfile| switch +% since this definitely is not top batch file. +% \begin{macrocode} + \begingroup + \def\batchfile{#1}% + \topbatchfilefalse + \Defaultfalse + \usepreamble\org@preamble + \usepostamble\org@postamble + \let\destdir\WriteToDir +% \end{macrocode} +% After this we can simply call |\processbatchFile| which will +% open the new batch file and read it until it +% is exhausted. Note that if the batch file is not available, or +% misspelled this routine will produce a warning and return. +% \begin{macrocode} + \processbatchFile +% \end{macrocode} +% The value of |\batchfile| as well as local definitions of +% preambles, directories etc. will be restored +% at this closing |\endgroup|, so that further processing +% continues in the calling batch file. +% \begin{macrocode} + \endgroup +} +% \end{macrocode} +% \begin{macro}{\skip@input} +% \changes{2.0j}{1992/03/03}{Added macro} +% \changes{2.0n}{1992/04/26}{Argument delimited by space not \cs{relax}} +% \changes{2.0n}{1992/04/26}{Macro renamed from \cs{skipinput}} +% And here is the promised redefinition of |\input|: +% \begin{macrocode} +\def\skip@input#1 {} +\let\input\skip@input +% \end{macrocode} +% \end{macro} +% \end{macro} +% +% \subsubsection{Empty macros and macros that expand to a string} +% \begin{macro}{\guardStack} +% \changes{2.0k}{1992/04/06}{Renamed from \texttt{\bsl blockStack}} +% Because blocks of code that will conditionally be included in the +% output can be nested, a stack is maintained to keep track of +% these blocks. The main reason for this is that we want to be able +% to check if the blocks are properly nested. The stack itself is +% stored in |\guardStack|. +% \begin{macrocode} +\def\guardStack{} +% \end{macrocode} +% \end{macro} +% +% \begin{macro}{\blockHead} +% The macro |\blockHead| is used for storing and retrieving +% the boolean expression that starts a block. +% \begin{macrocode} +\def\blockHead{} +% \end{macrocode} +% \end{macro} +% +% \begin{macro}{\yes} +% \begin{macro}{\y} +% When the user is asked a question that he has to answer with either +% \meta{yes} or \meta{no}, his response has to be evaluated. For this +% reason the macros |\yes| and |\y| are defined. +% \begin{macrocode} +\def\yes{yes} +\def\y{y} +% \end{macrocode} +% \begin{macro}{\n} +% We also define |\n| for use in \ds{} command files. +% \changes{2.1e}{1993/03/09}{Macro added} +% \begin{macrocode} +\def\n{n} +% \end{macrocode} +% \end{macro} +% \end{macro} +% \end{macro} +% +% \begin{macro}{\Defaultbatchile} +% \changes{2.0f}{1991/06/04}{Macro added.} +% When the \ds{} program has to process a batch file it +% can look for a batch file with a default name. This name +% is stored in |\DefaultbatchFile|. +% \begin{macrocode} +\def\DefaultbatchFile{docstrip.cmd} +% \end{macrocode} +% \end{macro} +% +% \begin{macro}{\perCent} +% \begin{macro}{\DoubleperCent} +% \begin{macro}{\MetaPrefix} +% To be able to display percent-signs on the terminal, a +% \texttt{\%} with category code 12 is stored in |\perCent| and +% |\DoubleperCent|. The macro |\MetaPrefix| is put on begining of +% every meta-comment line. It is defined indirect way since some +% applications need redefining it. +% \begin{macrocode} +{\catcode`\%=12 + \gdef\perCent{%} + \gdef\DoubleperCent{%%} +} +\let\MetaPrefix\DoubleperCent +% \end{macrocode} +% \end{macro} +% \end{macro} +% \end{macro} +% In order to allow formfeeds in the input we define a one-character +% control sequence \verb=^^L=. +% \begin{macrocode} +\def^^L{ } +% \end{macrocode} +% +% The only result of using |\Name| is slowing down execution since +% its typical use (e.g., |\Name\def{foo bar}...|) has exactly the +% same number of tokens as its expansion. However I think that it's +% easier to read. The meaning of |\Name| as a black box is: +% ``construct a name from second parameter and then pass it to your +% first parameter as a parameter''. +% +% |\@stripstring| is used to get tokens building name of a macro +% without leading backslash. +% \begin{macrocode} +\def\Name#1#2{\expandafter#1\csname#2\endcsname} +\def\@stripstring{\expandafter\@gobble\string} +% \end{macrocode} +% +% \subsubsection{Miscellaneous variables} +% \begin{macro}{\sourceFileName} +% The macro |\sourceFileName| is used to store the name of the +% current input file. +% \end{macro} +% \begin{macro}{\batchfile} +% The macro |\batchfile| is used to store the name of the +% batch file. +% \end{macro} +% \begin{macro}{\inLine} +% The macro |\inLine| is used to store the lines, read from +% the input file, before further processing. +% \end{macro} +% \begin{macro}{\answer} +% When some interaction with the user is needed the macro +% |\answer| is used to store his response. +% \end{macro} +% \begin{macro}{\tmp} +% Sometimes something has to be temporarily stored in a control +% sequence. For these purposes the control sequence |\tmp| is +% used. +% \end{macro} +% +% \subsection{Support macros} +% \subsubsection{The stack mechanism} +% +% It is possible to have `nested guards'. This means that within a +% block of optionally included code a subgroup is only included +% when an additional option is specified. To keep track of the +% nesting of the guards the currently `open' guard can be pushed on +% the stack |\guardStack| and later popped off the stack again. The +% macros that implement this stack mechanism are loosely based on +% code that is developed in the context of the \LaTeX3 project. +% +% To be able to implement a stack mechanism we need a couple of +% support macros. +% \begin{macro}{\eltStart} +% \changes{2.0k}{1992/04/06}{Macro added} +% \begin{macro}{\eltEnd} +% \changes{2.0k}{1992/04/06}{Macro added} +% The macros |\eltStart| and |\eltEnd| are used to delimit a stack +% element. They are both empty. +% \begin{macrocode} +\def\eltStart{} +\def\eltEnd{} +% \end{macrocode} +% \end{macro} +% \end{macro} +% +% \begin{macro}{\qStop} +% \changes{2.0k}{1992/04/06}{Macro added} +% The macro |\qStop| is a so-called `quark', a macro that expands to +% itself\footnote{The concept of `quarks' is developed for the +% \LaTeX3 project.}. +% \begin{macrocode} +\def\qStop{\qStop} +% \end{macrocode} +% \end{macro} +% +% \begin{macro}{\pop} +% \changes{2.0k}{1992/04/06}{Macro added} The macro +% |\pop|\meta{stack}\meta{cs} `pops' the top element from the +% stack. It assigns the value of the top element to \meta{cs} and +% removes it from \meta{stack}. When \meta{stack} is empty a +% warning is issued and \meta{cs} is assigned an empty value. +% \begin{macrocode} +\def\pop#1#2{% + \ifx#1\empty + \Msg{Warning: Found end guard without matching begin}% + \let#2\empty + \else +% \end{macrocode} +% To be able to `peel' off the first guard we use an extra macro +% |\popX| that receives both the expanded and the unexpanded stack +% in its arguments. The expanded stack is delimited with the quark +% |\qStop|. +% \begin{macrocode} + \def\tmp{\expandafter\popX #1\qStop #1#2}% + \expandafter\tmp\fi} +% \end{macrocode} +% \begin{macro}{\popX} +% \changes{2.0k}{1992/04/06}{Macro added} When the stack is expanded +% the elements are surrounded with |\eltStart| and |\eltEnd|. The +% first element of the stack is assigned to |#4|. +% \begin{macrocode} +\def\popX\eltStart #1\eltEnd #2\qStop #3#4{\def#3{#2}\def#4{#1}} +% \end{macrocode} +% \end{macro} +% \end{macro} +% +% \begin{macro}{\push} +% \changes{2.0k}{1992/04/06}{Macro added} +% Guards can be pushed on the stack using the macro +% |\push|\meta{stack}\meta{guard}. Again we need a secondary macro +% (|\pushX|) that has both the expanded and the unexpanded stack as +% arguments. +% \begin{macrocode} +\def\push#1#2{\expandafter\pushX #1\qStop #1{\eltStart #2\eltEnd}} +% \end{macrocode} +% \begin{macro}{\pushX} +% \changes{2.0k}{1992/04/06}{Macro added} +% The macro |\pushX| picks up the complete expansion of the stack as +% its first argument and places the guard in |#3| on the `top'. +% \begin{macrocode} +\def\pushX #1\qStop #2#3{\def #2{#3#1}} +% \end{macrocode} +% \end{macro} +% \end{macro} +% +% \subsubsection{Programming structures} +% +% \begin{macro}{\forlist} +% \changes{2.0g}{1991/06/05}{Macro added.} +% When the program is used in interactive mode the +% user can supply a list of files that have to be processed. +% In order to process this list a for-loop is needed. This +% implementation of such a programming construct is based on the +% use of the \verb=\loop{=\meta{body}\verb=}\repeat= macro that +% is defined in plain \TeX\@. The syntax for this loop is: +% \begin{flushleft} +% |\for|\meta{control sequence} |:=| \meta{list} +% |\do|\\ +% \meta{body}\\ +% |\od| +% \end{flushleft} +% The \meta{list} should be a comma separated list. +% +% The first actions that have to be taken are to set the switch +% |\ifForlist| to \meta{true} and to store the loop condition +% in the macro |\ListCondition|. This is done using an +% |\edef| to allow for a control sequence that contains a +% \meta{list}. +% \begin{macrocode} +\def\forlist#1:=#2\do#3\od{% + \edef\ListCondition{#2}% + \Forlisttrue +% \end{macrocode} +% Then we start the loop. +% We store the first element from the |\ListCondition| in the +% macro that was supplied as the first argument to |\forlist|. +% This element is then removed from the |\ListCondition|. +% \begin{macrocode} + \loop + \edef#1{\expandafter\FirstElt\ListCondition,\empty.}% + \edef\ListCondition{\expandafter\OtherElts\ListCondition,\empty.}% +% \end{macrocode} +% When the first element from the \meta{list} is empty, we are done +% processing, so we switch |\ifForlist| to \meta{false}. +% When it is not empty we execute the third argument that should +% contain \TeX\ commands to execute. +% \begin{macrocode} + \ifx#1\empty \Forlistfalse \else#3\fi +% \end{macrocode} +% Finally we test the switch |\ifForlist| to decide whether the +% loop has to be continued. +% \begin{macrocode} + \ifForlist + \repeat} +% \end{macrocode} +% \begin{macro}{\FirstElt} +% \changes{2.0g}{1991/06/05}{Macro added.} +% The macro |\FirstElt| is used to get the first element from a +% comma-separated list. +% \begin{macrocode} +\def\FirstElt#1,#2.{#1} +% \end{macrocode} +% \end{macro} +% \begin{macro}{\OtherElts} +% \changes{2.0g}{1991/06/05}{Macro added.} +% The macro |\OtherElts| is used to get all elements {\em but\/} +% the first element from a comma-separated list. +% \begin{macrocode} +\def\OtherElts#1,#2.{#2} +% \end{macrocode} +% \end{macro} +% \end{macro} +% +% \begin{macro}{\whileswitch} +% \changes{2.0h}{1991/06/19}{Macro added.} When the program is used in +% interactive mode the user might want to process several files +% with different options or extensions. This goal could be reached +% by running the program several times, but it is more +% user-friendly to ask if he would like to process more files when +% we are done processing his last request. To accomplish this we +% need the implementation of a \texttt{while}-loop. Again plain +% \TeX's \verb=\loop{=\meta{body}\verb=}\repeat= is used to +% implement this programming structure. +% +% The syntax for this loop is: +% \begin{flushleft} +% |\whileswitch|\meta{switch} \verb|\fi| \meta{list} +% \verb={=\meta{body}\verb=}=\\ +% \end{flushleft} +% The first argument to this macro has to be a switch, defined +% using |\newif|; the second argument contains the statements +% to execute while the switch evaluates to \meta{true}. +% \begin{macrocode} +\def\whileswitch#1\fi#2{#1\loop#2#1\repeat\fi} +% \end{macrocode} +% \end{macro} +% +% \changes{2.3a}{1995/08/18}{New mechanism: output streams allocation} +% +% \subsubsection{Output streams allocator} +% +% For each of sixteen output streams available we have a macro +% named |\s@0| through |\s@15| saying if the stream is assigned to a +% file~(1) or not~(0). Initially all streams are not assigned. +% +% We also declare 16 counters which will be needed by the conditional +% code inclusion algorithm. +% +% \begin{macrocode} +\ifx\@tempcnta\undefined \newcount\@tempcnta \fi +\@tempcnta=0 +\loop +\Name\chardef{s@\number\@tempcnta}=0 +\csname newcount\expandafter\endcsname% + \csname off@\number\@tempcnta\endcsname +\advance\@tempcnta1 +\ifnum\@tempcnta<16\repeat +% \end{macrocode} +% +% We will use \emph{The \TeX book} style list to search through streams. +% +% \begin{macrocode} +\let\s@do\relax +\edef\@outputstreams{% + \s@do\Name\noexpand{s@0}\s@do\Name\noexpand{s@1}% + \s@do\Name\noexpand{s@2}\s@do\Name\noexpand{s@3}% + \s@do\Name\noexpand{s@4}\s@do\Name\noexpand{s@5}% + \s@do\Name\noexpand{s@6}\s@do\Name\noexpand{s@7}% + \s@do\Name\noexpand{s@8}\s@do\Name\noexpand{s@9}% + \s@do\Name\noexpand{s@10}\s@do\Name\noexpand{s@11}% + \s@do\Name\noexpand{s@12}\s@do\Name\noexpand{s@13}% + \s@do\Name\noexpand{s@14}\s@do\Name\noexpand{s@15}% + \noexpand\@nostreamerror + } +% \end{macrocode} +% +% \begin{macro}{\@nostreamerror}\begin{macro}{\@streamfound} +% When |\@outputstreams| is executed |\s@do| is defined to do +% something on condition of some test. If condition +% always fails macro |\@nostreamerror| on the end of the list +% causes an error. When condition succeeds |\@streamfound| is +% called, which gobbles rest of the list including the ending +% |\@nostreamerror|. It also gobbles |\fi| ending the condition, so +% the |\fi| is reinserted. +% +% \begin{macrocode} +\def\@nostreamerror{\errmessage{No more output streams!}} +\def\@streamfound#1\@nostreamerror{\fi} +% \end{macrocode} +% \end{macro}\end{macro} +% +% |\@stripstr| is auxiliary macro eating characters |\s@| +% (backslash,s,@). It is defined in somewhat strange way since |\s@| +% must have all category code 12 (other). This macro is used to +% extract stream numbers from stream names. +% +% \begin{macrocode} +\bgroup\edef\x{\egroup + \def\noexpand\@stripstr\string\s@{}} +\x +% \end{macrocode} +% +% \begin{macro}{\StreamOpen}\begin{macro}{\StreamPut} +% \begin{macro}{\StreamClose} +% Here is stream opening operator. Its parameter should be a macro +% named the same as the external file being opened. E.g., to +% write to file |foo.tex| use |\StreamOpen\foo|, then +% |\StreamPut\foo| and |\StreamClose\foo|. +% +% \begin{macrocode} +\chardef\stream@closed=16 +\def\StreamOpen#1{% + \chardef#1=\stream@closed + \def\s@do##1{\ifnum##1=0 + \chardef#1=\expandafter\@stripstr\string##1 % + \global\chardef##1=1 % + \immediate\openout#1=\csname pth@\@stripstring#1\endcsname % + \@streamfound + \fi} + \@outputstreams + } +\def\StreamClose#1{% + \immediate\closeout#1% + \def\s@do##1{\ifnum#1=\expandafter\@stripstr\string##1 % + \global\chardef##1=0 % + \@streamfound + \fi} + \@outputstreams + \chardef#1=\stream@closed + } +\def\StreamPut{\immediate\write} +% \end{macrocode} +% \end{macro}\end{macro}\end{macro} +% +% \subsubsection{Input and Output} +% +% \begin{macro}{\maybeMsg} +% \begin{macro}{\showprogress} +% \begin{macro}{\keepsilent} +% When this program is used it can optionally show its progress on +% the terminal. In that case it will write a special character to +% the terminal (and the transcript file) for each input line. This +% option is on by default when statistics are included in +% \texttt{docstrip.tex}. It is off when statistics are excluded. The +% commands |\showprogress| and |\keepsilent| can be used +% to choose otherwise. +% \begin{macrocode} +\def\showprogress{\let\maybeMsg\message} +\def\keepsilent{\let\maybeMsg\@gobble} +%<*stats> +\showprogress +% +%<-stats>\keepsilent +% \end{macrocode} +% \end{macro} +% \end{macro} +% \end{macro} +% +% \begin{macro}{\Msg} +% For displaying messages on the terminal the macro |\Msg| is +% defined to write {\em immediately\/} to |\ttyout|. +% \begin{macrocode} +\def\Msg{\immediate\write\ttyout} +% \end{macrocode} +% \end{macro} +% +% \begin{macro}{\Ask} +% The macro +% \verb=\Ask{=\meta{cs}\verb=}{=\meta{string}\verb=}= is a +% slightly modified copy of the \LaTeX\ macro |\typein|. It is +% used to ask the user a question. The \meta{string} will be +% displayed on his terminal and the response will be stored in the +% \meta{cs}. The trailing space left over from the carriage return +% is stripped off by the macro |\strip|. If the user just +% types a carriage return, the result will be an empty macro. +% \changes{2.0i}{1991/06/27}{Added check for just \protect\meta{CR}} +% \begin{macrocode} +\def\iden#1{#1} +\def\strip#1#2 \@gobble{\def #1{#2}} +\def\@defpar{\par} +\def\Ask#1#2{% + \message{#2}\read\ttyin to #1\ifx#1\@defpar\def#1{}\else + \iden{\expandafter\strip + \expandafter#1#1\@gobble\@gobble} \@gobble\fi} +% \end{macrocode} +% \end{macro} +% +% \begin{macro}{\OriginalAsk} +% \changes{2.4e}{1996/10/24}{macro added (was in unpack.ins) (DPC)} +% \begin{macrocode} +\let\OriginalAsk=\Ask +% \end{macrocode} +% \end{macro} +% +% +% \begin{macro}{\askonceonly} +% \changes{2.4e}{1996/10/22} +% {macro added (essentially from unpack.ins) (DPC)} +% \begin{macrocode} +\def\askonceonly{% + \def\Ask##1##2{% + \OriginalAsk{##1}{##2}% + \global\let\Ask\OriginalAsk + \Ask\noprompt{% + By default you will be asked this question for every file.^^J% + If you enter `y' now,^^J% + I will asssume `y' for all future questions^^J% + without prompting.}% + \ifx\y\noprompt\let\noprompt\yes\fi + \ifx\yes\noprompt\gdef\Ask####1####2{\def####1{y}}\fi}} +% \end{macrocode} +% \end{macro} +% +% \subsubsection{Miscellaneous} +% +% \begin{macro}{\@gobble} +% \changes{2.0a}{1991/05/25}{Macro added.} +% A macro that has an argument and puts it in the bitbucket. +% \begin{macrocode} +\def\@gobble#1{} +% \end{macrocode} +% \end{macro} +% +% \begin{macro}{\Endinput} +% \changes{2.0f}{1991/06/04}{Macro added.} When a \texttt{doc} file +% contains a \verb+\endinput+ on a line by itself this normally +% means that anything following in this file should be ignored. +% Therefore we need a macro containing |\endinput| as its +% replacement text to check this against |\inLine| (the +% current line from the current input file). Of course the +% backslash has to have the correct |\catcode|. One way of +% doing this is feeding \verb=\\= to the |\string| operation +% and afterwards removing one of the |\| characters. +% \begin{macrocode} +\edef\Endinput{\expandafter\@gobble\string\\endinput} +% \end{macrocode} +% \end{macro} +% +% \begin{macro}{\makeOther} +% During the process of reading a file with \TeX\ code the category +% code of all special characters has to be changed to \meta{other}. +% The macro |\makeOther| serves this purpose. +% \begin{macrocode} +\def\makeOther#1{\catcode`#1=12\relax} +% \end{macrocode} +% \end{macro} +% +% \begin{macro}{\end} +% \changes{2.0h}{1991/06/19}{Macro added.} For now we want the \ds{} +% program to be compatible with both plain \TeX\ and \LaTeX\@. +% \LaTeX\ hides plain \TeX{}'s |\end| command and +% calls it |\@@end|. We unhide it here. +% \begin{macrocode} +\ifx\undefined\@@end\else\let\end\@@end\fi +% \end{macrocode} +% \end{macro} +% +% \begin{macro}{\@addto} +% A macro extending macro's definition. The trick with |\csname| +% is necessary to get around |\newtoks| being outer in plain \TeX{} +% and \LaTeX\ version 2.09. +% \begin{macrocode} +\ifx\@temptokena\undefined \csname newtoks\endcsname\@temptokena\fi +% \end{macrocode} +% +% \begin{macrocode} +\def\@addto#1#2{% + \@temptokena\expandafter{#1}% + \edef#1{\the\@temptokena#2}} +% \end{macrocode} +% \end{macro} +% +% \begin{macro}{\@ifpresent} +% This macro checks if its first argument is present on a +% list passed as the second argument. Depending on the result +% it executes either its third or fourth argument. +% +% \begin{macrocode} +\def\@ifpresent#1#2#3#4{% + \def\tmp##1#1##2\qStop{\ifx!##2!}% + \expandafter\tmp#2#1\qStop #4\else #3\fi + } +% \end{macrocode} +% \end{macro} +% +% \begin{macro}{\tospaces} +% This macro converts its argument delimited with |\secapsot| to +% appropriate number of spaces. We need this for smart displaying +% messages on the screen. +% +% |\@spaces| are used when we need many spaces in a row. +% \begin{macrocode} +\def\tospaces#1{% + \ifx#1\secapsot\secapsot\fi\space\tospaces} +\def\secapsot\fi\space\tospaces{\fi} +\def\@spaces{\space\space\space\space\space} +% \end{macrocode} +% \end{macro} +% +% \begin{macro}{\uptospace} +% \changes{2.3c}{1995/08/24}{Macro added} +% This macro extracts from its argument delimited with |\qStop| +% part up to first occurence of space. +% \begin{macrocode} +\def\uptospace#1 #2\qStop{#1} +% \end{macrocode} +% \end{macro} +% +% \begin{macro}{\afterfi} +% \changes{2.3c}{1995/09/04}{Macro added} +% This macro can be used in conditionals to perform some actions +% (its first parameter) after the condition is completed (i.e. +% after reading the matching |\fi|. Second parameter is used to +% gobble the rest of |\if ... \fi| construction (some |\else| +% maybe). Note that this won't work in nested |\if|s! +% \begin{macrocode} +\def\afterfi#1#2\fi{\fi#1} +% \end{macrocode} +% \end{macro} +% \begin{macro}{\@ifnextchar} +% \changes{2.3e}{1995/09/25}{Macro added} +% This is one of \LaTeX's macros not defined by plain. My +% devious definition differs from the standard one but +% functionality is the same. +% \begin{macrocode} +\def\@ifnextchar#1#2#3{\bgroup + \def\reserved@a{\ifx\reserved@c #1 \aftergroup\@firstoftwo + \else \aftergroup\@secondoftwo\fi\egroup + {#2}{#3}}% + \futurelet\reserved@c\@ifnch + } +\def\@ifnch{\ifx \reserved@c \@sptoken \expandafter\@xifnch + \else \expandafter\reserved@a + \fi} +\def\@firstoftwo#1#2{#1} +\def\@secondoftwo#1#2{#2} +\iden{\let\@sptoken= } % +\iden{\def\@xifnch} {\futurelet\reserved@c\@ifnch} +% \end{macrocode} +% \end{macro} +% +% +% \subsection{The evaluation of boolean expressions} +% +% For clarity we repeat here the syntax for the boolean expressions +% in a somewhat changed but equivalent way: +% +% \DeleteShortVerb\| +% \begin{tabular}{lcl} +% \meta{Expression} & $::=$ & \meta{Secondary} $|$ +% \meta{Secondary} \{\texttt{|}, \texttt{,}\} +% \meta{Expression}\\ +% \meta{Secondary} & $::=$ & \meta{Primary} $|$ +% \meta{Primary} \texttt{\&} +% \meta{Secondary}\\ +% \meta{Primary} & $::=$ & +% \meta{Terminal} $|$ \texttt{!}\meta{Primary} +% $|$ +% \texttt{(}\meta{Expression}\texttt{)}\\ +% \end{tabular} +% +% The \texttt{|} stands for disjunction, the \texttt{\&} stands for +% conjunction and the \texttt{!}\ stands for negation. The +% \meta{Terminal} is any sequence of letters and evaluates to +% \meta{true} iff it occurs in the list of options that have to be +% included. +% \MakeShortVerb\| +% +% Since we can generate multiple output files from one input, +% same guard expressions can be computed several times with +% different options. For that reason we first ``compile'' the +% expression to the form of one parameter macro |\Expr| +% expanding to nested |\if|s that when given current list of +% options produces 1 or 0 as a result. The idea is to say +% |\if1\Expr{|\meta{current set of options}|}...\fi| for all +% output files. +% +% Here is a table recursively defining translations for right +% sides of the grammar. $\tau(X)$ denotes translation of~$X$. +% +% \DeleteShortVerb\| +% \MakeShortVerb\" +% \begingroup +% \addtolength\arraycolsep{-2.1pt} +% \begin{eqnarray*} +% \tau(\meta{Terminal})&=&"\t@,#1,,\qStop"\\ +% \tau(!\meta{Primary})&=&"\if1"\,\tau(\meta{Primary})\,"0\else1\fi"\\ +% \tau(\mbox{\texttt{(}\meta{Expression}\texttt{)}}) +% &=&\tau(\meta{Expression})\\ +% \tau(\mbox{\meta{Primary}\texttt{\&}\meta{Secondary}}) +% &=&"\if0"\,\tau(\meta{Primary})\,"0\else" +% \,\tau(\meta{Secondary})\,"\fi"\\ +% \tau(\mbox{\meta{Secondary}\texttt{|}\meta{Expression}}) +% &=&"\if1"\,\tau(\meta{Secondary})\,"1\else" +% \,\tau(\meta{Expression})\,"\fi" +% \end{eqnarray*} +% \endgroup +% \DeleteShortVerb\" +% \MakeShortVerb\| +% |\t@| denotes macro with name constructed from |t@| +% with appended tokens of terminal. E.g., for terminal |foo| the +% translation would be +%\begin{verbatim} +% \t@foo,#1,foo,\qStop +%\end{verbatim} +% This will end up in definition of |\Expr|, so |#1| here will +% be substituted by current list of options when |\Expr| is +% called. Macro |\t@foo| would be defined as +%\begin{verbatim} +% \def\t@foo#1,foo,#2\qStop{\ifx>#2>0\else1\fi} +%\end{verbatim} +% When called as above this will expand to |1| if |foo| is +% present on current list of options and to |0| otherwise. +% +% Macros below work in ``almost expand-only'' mode i.e. +% expression is analyzed only by expansion but we have to define +% some macros on the way (e.g., |\Expr| and |\t@foo|). +% +% The first parameter of each of these macros is +% ``continuation'' (in the sense similar to the language +% \textsc{Scheme}). Continuation is a function of at least one +% argument (parameter) being the value of previous steps of +% computation. For example macro |\Primary| constructs +% translation of \meta{Primary} expression. When it decides that +% expression is completed it calls its continuation (its first +% argument) passing to it whole constructed translation. +% Continuation may expect more arguments if it wants to see what +% comes next on the input. +% +% We will perform recursive descent parse, but definitions will +% be presented in bottom-up order. +% +% \begin{macro}{\Terminal} +% +% \meta{Terminal}s are recognized by macro |\Terminal|. The +% proper way of calling it is |\Terminal{|\meta{current +% continuation}|}{}|. Parameters are: continuation, +% \meta{Terminal} so far and next character from the input. +% Macro checks if |#3| is one of terminal-ending characters and +% then takes appropriate actions. Since there are 7 ending +% chars and probably one |\csname| costs less than 7 nested +% |\if|s we construct a name and check if it is defined. +% +% We must expand |\ifx| completely before taking next actions so +% we use |\afterfi|. +% \begin{macrocode} +\def\Terminal#1#2#3{% + \expandafter\ifx\csname eT@#3\endcsname\relax +% \end{macrocode} +% If condition is true |#3| belongs to current \meta{Terminal} +% so we append it to \meta{Terminal}-so-far and call |\Terminal| +% again. +% \begin{macrocode} + \afterfi{\Terminal{#1}{#2#3}}\else +% \end{macrocode} +% When condition is false it's time to end the \meta{Terminal} +% so we call macro |\TerminalX|. Next character is reinserted to +% the input. +% +% In both cases continuation is passed unchanged. +% \begin{macrocode} + \afterfi{\TerminalX{#1}{#2}#3}\fi + } +% \end{macrocode} +% \end{macro} +% +% \begin{macro}{\eT@} +% Here we define macros marking characters that cannot appear +% inside terminal. The value is not important as long as it is +% different from |\relax|. +% \begin{macrocode} +\Name\let{eT@>}=1 +\Name\let{eT@&}=1 \Name\let{eT@!}=1 +\Name\let{eT@|}=1 \Name\let{eT@,}=1 +\Name\let{eT@(}=1 \Name\let{eT@)}=1 +% \end{macrocode} +% \end{macro} +% +% \begin{macro}{\TerminalX} +% This macro should end scanning of \meta{Terminal}. Parameters +% are continuation and gathered tokens of \meta{Terminal}. +% +% Macro starts by issuing an error message if \meta{Terminal} is +% empty. +% \begin{macrocode} +\def\TerminalX#1#2{% + \ifx>#2> \errmessage{Error in expression: empty terminal}\fi +% \end{macrocode} +% Then a macro is constructed for checking presence of +% \meta{Terminal} in options list. +% \begin{macrocode} + \Name\def{t@#2}##1,#2,##2\qStop{\ifx>##2>0\else1\fi}% +% \end{macrocode} +% And then current continuation is called with translation of +% \meta{Terminal} according to formula +% $$\tau(\meta{Terminal})=|\t@,#1,,\qStop|$$ +% \begin{macrocode} + #1{\Name\noexpand{t@#2},##1,#2,\noexpand\qStop}% + } +% \end{macrocode} +% \end{macro} +% +% \begin{macro}{\Primary} +% Parameters are continuation and next character from the input. +% +% According to the syntax \meta{Primari}es can have three forms. +% This makes us use even more dirty tricks than usual. Note the +% |\space| after a series of |\ifx|s. This series produces an +% one digit number of case to be executed. The number is given +% to |\ifcase| and |\space| stops \TeX{} scanning for a +% \meta{number}. Use of |\ifcase| gives possibility to have one +% of three actions selected without placing them in nested +% |\if|s and so to use |\afterfi|. +% \begin{macrocode} +\def\Primary#1#2{% + \ifcase \ifx!#20\else\ifx(#21\else2\fi\fi\space +% \end{macrocode} +% First case is for |!| i.e. negated \meta{Primary}. In this +% case we call |\Primary| recursively but we create new +% continuation: macro |\NPrimary| that will negate result +% passed by |\Primary| and pass it to current continuation +% (|#1|). +% \begin{macrocode} + \afterfi{\Primary{\NPrimary{#1}}}\or +% \end{macrocode} +% When next character is |(| we call |\Expression| giving it as +% continuation macro |\PExpression| which will just pass the +% result up but ensuring first that a |)| comes next. +% \begin{macrocode} + \afterfi{\Expression{\PExpression{#1}}}\or +% \end{macrocode} +% Otherwise we start a \meta{Terminal}. |#2| is not passed as +% \meta{Terminal}-so-far but reinserted to input since we didn't +% check if it can appear in a \meta{Terminal}. +% \begin{macrocode} + \afterfi{\Terminal{#1}{}#2}\fi + } +% \end{macrocode} +% \end{macro} +% +% \begin{macro}{\NPrimary} +% Parameters are continuation and previously computed +% \meta{Primary}. +% +% This macro negates result of previous computations according +% to the rule +% $$\tau(!\meta{Primary}) +% =|\if1|\,\tau(\meta{Primary})\,|0\else1\fi|$$ +% \begin{macrocode} +\def\NPrimary#1#2{% + #1{\noexpand\if1#20\noexpand\else1\noexpand\fi}% + } +% \end{macrocode} +% \end{macro} +% +% \begin{macro}{\PExpression} +% Parameters: continuation, \meta{Expression}, next character +% from input. We are checking if character is |)| and then pass +% unchanged result to our continuation. +% \begin{macrocode} +\def\PExpression#1#2#3{% + \ifx)#3\else + \errmessage{Error in expression: expected right parenthesis}\fi + #1{#2}} +% \end{macrocode} +% \end{macro} +% +% \begin{macro}{\Secondary} +% Each \meta{Secondary} expression starts with \meta{Primary}. +% Next checks will be performed by |\SecondaryX|. +% \begin{macrocode} +\def\Secondary#1{% + \Primary{\SecondaryX{#1}}} +% \end{macrocode} +% \end{macro} +% +% \begin{macro}{\SecondaryX} +% Parameters: continuation, translation of \meta{Primary}, next +% character. We start by checking if next character is |&|. +% \begin{macrocode} +\bgroup\catcode`\&=12 +\gdef\SecondaryX#1#2#3{% + \ifx% +% \end{macrocode} +% If it is we should parse next \meta{Secondary} and then +% combine it with results so far. Note that |\SecondaryXX| will +% have 3 parameters. +% \begin{macrocode} + \afterfi{\Secondary{\SecondaryXX{#1}{#2}}}\else +% \end{macrocode} +% Otherwise \meta{Secondary} turned out to be just +% \meta{Primary}. We call continuation passing to it translation +% of that \meta{Primary} not forgetting to reinsert |#3| to the +% input as it does not belong here. +% \begin{macrocode} + \afterfi{#1{#2}#3}\fi + } +\egroup +% \end{macrocode} +% \end{macro} +% +% \begin{macro}{\SecondaryXX} +% Parameters: continuation, translation of \meta{Primary}, +% translation of \meta{Secondary}. We construct translation of +% whole construction according to the rule: +% $$\tau(\mbox{\meta{Primary}\texttt{\&}\meta{Secondary}}) +% =|\if0|\,\tau(\meta{Primary})\,|0\else| +% \,\tau(\meta{Secondary})\,|\fi| $$ +% and pass it to our continuation. +% \begin{macrocode} +\def\SecondaryXX#1#2#3{% + #1{\noexpand\if0#20\noexpand\else#3\noexpand\fi}} +% \end{macrocode} +% \end{macro} +% +% \begin{macro}{\Expression} +% Every \meta{Expression} starts with \meta{Secondary}. We +% construct new continuation and pass it to |\Secondary|. +% \begin{macrocode} +\def\Expression#1{% + \Secondary{\ExpressionX{#1}}} +% \end{macrocode} +% \end{macro} +% +% \begin{macro}{\ExpressionX} +% Parameters: continuation, translation of \meta{Secondary}, +% next character. We perform check if character is +% \texttt{\char`\|} or |,|. +% \begin{macrocode} +\def\ExpressionX#1#2#3{% + \if0\ifx|#31\else\ifx,#31\fi\fi0 +% \end{macrocode} +% If it is not \meta{Expression} is just a \meta{Secondary}. We +% pass its translation to continuation and reinsert |#3|. +% \begin{macrocode} + \afterfi{#1{#2}#3}\else +% \end{macrocode} +% If we are dealing with complex \meta{Expression} we should +% parse another |\Expression| now. +% \begin{macrocode} + \afterfi{\Expression{\ExpressionXX{#1}{#2}}}\fi + } +% \end{macrocode} +% \end{macro} +% +% \begin{macro}{\ExpressionXX} +% Parameters: continuation, translation of \meta{Secondary}, +% translation of \meta{Expression}. +% We finish up translating of \meta{Expression} according to +% the formula: +% $$\tau(\mbox{\meta{Secondary}\texttt{\char`\|}\meta{Expression}}) +% =|\if1|\,\tau(\meta{Secondary})\,|1\else| +% \,\tau(\meta{Expression})\,|\fi|$$ +% \begin{macrocode} +\def\ExpressionXX#1#2#3{% + #1{\noexpand\if1#21\noexpand\else#3\noexpand\fi}} +% \end{macrocode} +% \end{macro} +% +% \begin{macro}{\StopParse} +% Here is initial continuation for whole parse process. It will +% be used by |\Evaluate|. Note that we assume that expression +% has |>| on its end. This macro eventually defines |\Expr|. +% Parameters: translation of whole \meta{Expression} and next +% character from input. +% \begin{macrocode} +\def\StopParse#1#2{% + \ifx>#2 \else\errmessage{Error in expression: spurious #2}\fi + \edef\Expr##1{#1}} +% \end{macrocode} +% \end{macro} +% +% \begin{macro}{\Evaluate} +% This macro is used to start parsing. We call |\Expression| +% with continuation defined above. On end of expression we +% append a |>|. +% \begin{macrocode} +\def\Evaluate#1{% + \Expression\StopParse#1>} +% \end{macrocode} +% \end{macro} +% +% \subsection{Processing the input lines} +% +% \begin{macro}{\normalLine} +% The macro |\normalLine| writes its argument (which has to be +% delimited with |\endLine|) on all active output files i.e. +% those with off-counters equal to zero. +% If statistics are included, the counter +% |\codeLinesPassed| is incremented by $1$. +% \begin{macrocode} +\def\normalLine#1\endLine{% +%<*stats> + \advance\codeLinesPassed\@ne +% + \maybeMsg{.}% + \def\inLine{#1}% + \let\do\putline@do + \activefiles + } +% \end{macrocode} +% \end{macro} +% +% \begin{macro}{\putline@do} +% \changes{2.3b}{1995/08/22}{Change for pre-constructed +% off-counters' names} +% This is a value for |\do| when copying line to output files. +% \begin{macrocode} +\def\putline@do#1#2#3{% + \StreamPut#1{\inLine}} +% \end{macrocode} +% \end{macro} +% +% \begin{macro}{\removeComment} +% The macro |\removeComment| throws its argument (which has to be +% delimited with |\endLine|) away. When statistics are included +% in the program the removed comment is counted. +% \begin{macrocode} +% +\def\removeComment#1\endLine{% +%<*stats> + \advance\commentsRemoved\@ne +% + \maybeMsg{\perCent}} +% \end{macrocode} +% \end{macro} +% +% \begin{macro}{\putMetaComment} +% \changes{2.3e}{1996/09/16}{Introduced \cs{MetaPrefix}} +% If a line starts with two consecutive percent signs, it is +% considered to be a {\em MetaComment\/}. Such a comment line is +% passed on to the output file unmodified. +% \begin{macrocode} +\bgroup\catcode`\%=12 +\iden{\egroup +\def\putMetaComment%}#1\endLine{% +% \end{macrocode} +% If statistics are included the line is counted. +% \begin{macrocode} +%<*stats> + \advance\commentsPassed\@ne +% +% \end{macrocode} +% The macro |\putMetaComment| has one argument, delimited with +% |\endLine|. It brings the source line with |%%| stripped. We +% prepend to it |\MetaPrefix| (which can be different from |%%|) +% and send the line to all active files. +% \begin{macrocode} + \edef\inLine{\MetaPrefix#1}% + \let\do\putline@do + \activefiles + } +% \end{macrocode} +% \end{macro} +% +% +% \begin{macro}{\processLine} +% \changes{2.3a}{1995/08/18}{Adaptation for concurrent version} +% \changes{2.3a}{1995/08/20}{Trying to avoid assignments} +% Each line that is read from the input stream has to be processed +% to see if it has to be written on the output stream. This task +% is performed by calling the macro |\processLine|. +% In order to do +% that, it needs to check whether the line starts with a +% `\texttt{\%}'. Therefore the macro is globally defined within a +% group. Within this group the category code of `\texttt{\%}' is +% changed to 12 (other). Because a comment character is needed, +% the category code of `\texttt{*}' is changed to 14 (comment +% character). +% +% The macro increments counter |\processedLines| by $1$ if +% statistics are included. We cannot include this line with +% |%<*stats>| since the category of \texttt{\%} is changed and the +% file must be loadable unstripped. So the whole definition is +% repeated embedded in guards. +% +% The next token from the input stream is passed in |#1|. If it is +% a `\texttt{\%}' further processing has to be done by +% |\processLineX|; otherwise this is normal (not commented out) +% line. +% +% In either case the character read is reinserted to the input +% as it may have to be written out. +% +% \begin{macrocode} +%<*!stats> +\begingroup +\catcode`\%=12 \catcode`\*=14 +\gdef\processLine#1{* + \ifx%#1 + \expandafter\processLineX + \else + \expandafter\normalLine + \fi + #1} +\endgroup +% +%<*stats> +\begingroup +\catcode`\%=12 \catcode`\*=14 +\gdef\processLine#1{* + \advance\processedLines\@ne + \ifx%#1 + \expandafter\processLineX + \else + \expandafter\normalLine + \fi + #1} +\endgroup +% +% \end{macrocode} +% \end{macro} +% +% +% \begin{macro}{\processLineX} +% \changes{2.3a}{1995/08/20}{Trying to avoid assignments} +% This macro is also defined within a group, +% because it also has to check if the next +% token in the input stream is a `\texttt{\%}' character. +% +% If the second token in the current line happens to be a +% `\texttt{\%}', a \meta{MetaComment} has been found. This has to +% be copied in its entirety to the output. Another possible second +% character is `\texttt{<}', which introduces a guard expression. +% The processing of such an expression is started by calling +% |\checkOption|. +% +% When the token was neither a `\texttt{\%}' nor a `\texttt{<}', +% the line contains a normal comment that has to be removed. +% +% We express conditions in such a way that all actions appear +% on first nesting level of |\if|s. In such conditions just one +% expandafter pushes us outside whole construction. A thing to +% watch here is |\relax|. It stops search for numeric constant. +% If it wasn't here \TeX\ would expand the first case of |\ifcase| +% before knowing the value. +% +% \begin{macrocode} +\begingroup +\catcode`\%=12 \catcode`\*=14 +\gdef\processLineX%#1{* + \ifcase\ifx%#10\else + \ifx<#11\else 2\fi\fi\relax + \expandafter\putMetaComment\or + \expandafter\checkOption\or + \expandafter\removeComment\fi + #1} +\endgroup +% \end{macrocode} +% \end{macro} +% +% \subsection{The handling of options} +% +% \begin{macro}{\checkOption} +% \changes{2.3a}{1995/08/18}{Adapted to concurrent version} +% \changes{2.3a}{1995/08/20}{Trying to avoid assignments} +% \changes{2.3e}{1996/09/16}{Verbatim mode} +% When the macros that process a line have found that the line +% starts with `\texttt{\%<}', a guard line has been encountered. +% The first character of a guard can be an asterisk (\texttt{*}), a +% slash (\texttt{/}) a plus (\texttt{+}), a minus (\texttt{-}), a +% less-than sign (\texttt{<}) starting verbatim mode or +% any other character that can be found in an option name. This +% means that we have to peek at the next token and +% decide what kind of guard we have. +% +% We reinsert |#1| as it may be needed by |\doOption|. +% \begin{macrocode} +\def\checkOption<#1{% + \ifcase + \ifx*#10\else \ifx/#11\else + \ifx+#12\else \ifx-#13\else + \ifx<#14\else 5\fi\fi\fi\fi\fi\relax + \expandafter\starOption\or + \expandafter\slashOption\or + \expandafter\plusOption\or + \expandafter\minusOption\or + \expandafter\verbOption\or + \expandafter\doOption\fi + #1} +% \end{macrocode} +% \end{macro} +% +% \begin{macro}{\doOption} +% When no guard modifier is found by |\checkOptions|, the +% macro |\doOption| is called. It evaluates a boolean +% expression. The result of this evaluation is stored in +% |\Expr|. The guard only affects the current +% line, so |\do| is defined in such a way that depending on the +% result of the test |\if1\Expr{|\meta{options}|}|, the current +% line is either copied to the output stream or removed. Then +% the test is computed for all active output files. +% \begin{macrocode} +\def\doOption#1>#2\endLine{% + \maybeMsg{<#1 . >}% + \Evaluate{#1}% + \def\do##1##2##3{% + \if1\Expr{##2}\StreamPut##1{#2}\fi + }% + \activefiles + } +% \end{macrocode} +% \end{macro} +% +% \begin{macro}{\plusOption} +% When a `\texttt{+}' is found as a guard modifier, +% |\plusOption| is called. This macro is very similar to +% |\doOption|, the only difference being that displayed +% message now contains `\texttt{+}'. +% \begin{macrocode} +\def\plusOption+#1>#2\endLine{% + \maybeMsg{<+#1 . >}% + \Evaluate{#1}% + \def\do##1##2##3{% + \if1\Expr{##2}\StreamPut##1{#2}\fi + }% + \activefiles + } +% \end{macrocode} +% \end{macro} +% +% \begin{macro}{\minusOption} +% When a `\texttt{-}' is found as a guard modifier, +% |\minusOption| is called. This macro is very similar to +% |\plusOption|, the difference is that condition is negated. +% \begin{macrocode} +\def\minusOption-#1>#2\endLine{% + \maybeMsg{<-#1 . >}% + \Evaluate{#1}% + \def\do##1##2##3{% + \if1\Expr{##2}\else \StreamPut##1{#2}\fi + }% + \activefiles + } +% \end{macrocode} +% \end{macro} +% +% \begin{macro}{\starOption} +% \changes{2.3a}{1995/08/18}{Adapted to concurrent version} +% When a `\texttt{*}' is found as a guard modifier, +% |\starOption| is called. In this case a block of code will +% be included in the output on the condition that the guard +% expression evaluates to \meta{true}. +% +% The current line is gobbled as |#2|, because it only contains +% the guard and possibly a comment. +% +% \begin{macrocode} +\def\starOption*#1>#2\endLine{% +% \end{macrocode} +% First we optionally write +% a message to the terminal to indicate that a new option starts +% here. +% \begin{macrocode} + \maybeMsg{<*#1}% +% \end{macrocode} +% Then we push the current contents of |\blockHead| on the +% stack of blocks, |\guardStack| and increment the counter +% |\blockLevel| to indicate that we are now one level of +% nesting deeper. +% \changes{2.0k}{1992/04/06}{Use new stack mechanism} +% \changes{2.0k}{1992/04/09}{The macro that holds the guard needs to be +% expanded} +% \begin{macrocode} + \expandafter\push\expandafter\guardStack\expandafter{\blockHead}% + \advance\blockLevel\@ne +% \end{macrocode} +% The guard for this block of code is now stored in +% |\blockHead|. +% \begin{macrocode} + \def\blockHead{#1}% +% \end{macrocode} +% Now we evaluate guard expression for all output files +% updating off-counters. Then we create new list of active +% output files. Only files that were active in the outer block +% can remain active now. +% \begin{macrocode} + \Evaluate{#1}% + \let\do\checkguard@do + \outputfiles + \let\do\findactive@do + \edef\activefiles{\activefiles} + } +% \end{macrocode} +% \end{macro} +% +% \begin{macro}{\checkguard@do} +% \changes{2.3b}{1995/08/22}{Change for pre-constructed +% off-counters' names} +% This form of |\do| updates off-counts according to the value of +% guard expression. +% \begin{macrocode} +\def\checkguard@do#1#2#3{% +% \end{macrocode} +% If this block of code occurs inside another block of code that is +% {\em not\/} included in the output, we increment the off counter. +% In that case the guard expression will not be +% evaluated, because a block inside another block that is excluded +% from the output will also be excluded, regardless of the +% evaluation of its guard. +% \begin{macrocode} + \ifnum#3>0 + \advance#3\@ne +% \end{macrocode} +% When the off count has value 0, we have +% to evaluate the guard expression. If the result is \meta{false} +% we increase the off-counter. +% \begin{macrocode} + \else + \if1\Expr{#2}\else + \advance#3\@ne\fi + \fi} +% \end{macrocode} +% \end{macro} +% +% \begin{macro}{\findactive@do} +% \changes{2.3b}{1995/08/22}{Change for pre-constructed +% off-counters' names} +% This form of |\do| picks elements of output files list which +% have off-counters equal to zero. +% \begin{macrocode} +\def\findactive@do#1#2#3{% + \ifnum#3=0 + \noexpand\do#1{#2}#3\fi} +% \end{macrocode} +% \end{macro} +% +% \begin{macro}{\slashOption} +% \changes{2.3a}{1995/08/18}{Adapted for concurrent version} +% The macro |\slashOption| is the counterpart to +% |\starOption|. It indicates the end of a block of +% conditionally included code. We store the argument in the +% temporary control sequence |\tmp|. +% \begin{macrocode} +\def\slashOption/#1>#2\endLine{% + \def\tmp{#1}% +% \end{macrocode} +% When the counter |\blockLevel| has a value less than $1$, +% this `end-of-block' line has no corresponding `start-of-block'. +% Therefore we signal an error and ignore this end of block. +% \begin{macrocode} + \ifnum\blockLevel<\@ne + \errmessage{Spurious end block ignored}% +% \end{macrocode} +% Next we compare the contents of |\tmp| with the contents +% of |\blockHead|. The latter macro contains the last guard for +% a block of code that was encountered. If the contents match, we +% pop the previous guard from the stack. +% \changes{2.0k}{1992/04/06}{Use new stack mechanism} +% \begin{macrocode} + \else + \ifx\tmp\blockHead + \pop\guardStack\blockHead +% \end{macrocode} +% When the contents of the two macros don't match something is +% amiss. We signal this to the user, but accept the `end-of-block'. +%\note{Is this the desired behaviour??} +% \begin{macrocode} + \else + \errmessage{Found instead of }% + \fi +% \end{macrocode} +% When the end of a block of optionally included code is encountered +% we optionally signal this on the terminal and decrement the counter +% |\blockLevel|. +% \begin{macrocode} + \maybeMsg{>}% + \advance\blockLevel\m@ne +% \end{macrocode} +% The last thing that has to be done is to decrement off-counters and +% make new list of active files. Now whole list of output files has +% to be searched since some inactive files could have been +% reactivated. +% \begin{macrocode} + \let\do\closeguard@do + \outputfiles + \let\do\findactive@do + \edef\activefiles{\outputfiles} + \fi + } +% \end{macrocode} +% \end{macro} +% +% \begin{macro}{\closeguard@do} +% \changes{2.3b}{1995/08/22}{Change for pre-constructed +% off-counters' names} +% This macro decrements non-zero off-counters. +% \begin{macrocode} +\def\closeguard@do#1#2#3{% + \ifnum#3>0 + \advance#3\m@ne + \fi} +% \end{macrocode} +% \end{macro} +% +% +% \begin{macro}{\verbOption} +% \changes{2.3e}{1996/09/16}{Macro added} +% \changes{2.4g}{1996/12/13}{Reset \cs{putline@do} for /2340} +% This macro is called when a line starts with |%<<|. It reads a +% bunch of lines in verbatim mode: the lines are passed unchanged +% to the output without even checking for starting |%|. This way of +% processing ends when a line containing only a percent sign +% followed by stop mark given on the |%<<| line is found. +% \begin{macrocode} +\def\verbOption<#1\endLine{{% + \edef\verbStop{\perCent#1}\maybeMsg{<<<}% + \let\do\putline@do + \loop + \ifeof\inFile\errmessage{Source file ended while in verbatim + mode!}\fi + \read\inFile to \inLine + \if 1\ifx\inLine\verbStop 0\fi 1% if not inLine==verbStop + \activefiles + \maybeMsg{.}% + \repeat + \maybeMsg{>}% + }} +% \end{macrocode} +% \end{macro} +% +% \subsection{Batchfile commands} +% \changes{2.3e}{1996/10/02}{Added doc} +% \ds{} keeps information needed to control inclusion of sources in +% several list structures. Lists are macros expanding to a series +% of calls to macro |\do| with two or three parameters. +% Subsequently |\do| is redefined in various ways and list +% macros sometimes are executed to perform some action on every +% element, and sometimes are used inside an |\edef| to make new +% list of elements having some properties. For every input file +% \meta{infile} the following lists are kept: +% \begin{itemize} +% \item[\cs{b@}\meta{infile}] the ``open list''---names of all output +% files such that their generation should start with +% reading of \meta{infile}, +% \item[\cs{o@}\meta{infile}] the ``output list''---names of all +% output files generated from that source together with +% suitable sets of options (guards), +% \item[\cs{e@}\meta{infile}] the ``close list''---names of all +% output files that should be closed when this source is +% read. +% \end{itemize} +% +% For every output file name \meta{outfile} \ds{} keeps following +% information: +% \begin{itemize} +% \item[\cs{pth@}\meta{outfile}] full pathname (including file name), +% \item[\cs{ref@}\meta{outfile}] reference lines for the file, +% \item[\cs{in@}\meta{outfile}] names of all source files separated +% with spaces (needed by \cs{InFileName}), +% \item[\cs{pre@}\meta{outfile}] preamble template (as defined with +% |\declarepreamble|), +% \item[\cs{post@}\meta{outfile}] postamble template. +% \end{itemize} +% +% \begin{macro}{\generate} +% \changes{2.3a}{1995/08/20}{Messages changed} +% \changes{2.4a}{1996/06/06}{Repeat processing of files until all +% done (MDW)} +% This macro executes its argument in a group. |\inputfiles| is +% a list of files to be read, |\filestogenerate| list of names +% of output files (needed for the message below). |\file|s +% contained in |#1| define |\inputfiles| in such a way that all +% that has to be done when the parameter is executed is to call +% this macro. |\inputfiles| command is called over and over again +% until no output files had to be postponed. +% \begin{macrocode} +\def\generate#1{\begingroup + \let\inputfiles\empty \let\filestogenerate\empty + \let\file\@file + #1 + \ifx\filestogenerate\empty\else + \Msg{^^JGenerating file(s) \filestogenerate}\fi + \def\inFileName{\csname in@\outFileName\endcsname}% + \def\ReferenceLines{\csname ref@\outFileName\endcsname}% + \processinputfiles + \endgroup} +% \end{macrocode} +% \end{macro} +% +% \begin{macro}{\processinputfiles} +% \changes{2.4a}{1996/10/02}{Macro added (MW)} +% This is a recurrent function which processes input files until +% they are all gone. +% \begin{macrocode} +\def\processinputfiles{% + \let\newinputfiles\empty + \inputfiles + \let\inputfiles\newinputfiles + \ifx\inputfiles\empty\else + \expandafter\processinputfiles + \fi + } +% \end{macrocode} +% \end{macro} +% +% \begin{macro}{\file} +% The first argument is the file to produce, the second +% argument contains the list of input files. Each entry should have +% the format +% \verb=\from{=\meta{filename.ext}\verb=}{=\meta{options}\verb=}=. +% +% \changes{2.3a}{1995/08/20}{Messages changed} +% ^^A The macro starts by displaying a message on the terminal to +% ^^A indicate which file is going to be made. +% The switch |\ifGenerate| is initially set to \meta{true}. +% \begin{macrocode} +\def\file#1#2{\errmessage{Command `\string\file' only allowed in + argument to `\string\generate'}} +\def\@file#1{% + \Generatetrue +% \end{macrocode} +% Next we construct full path name for output file and check if we +% have to be careful about overwriting existing files. If the user +% specified |\askforoverwritetrue| we will ask him if he wants to +% overwrite an existing file. Otherwise we simply go ahead. +% \begin{macrocode} + \makepathname{#1}% + \ifaskforoverwrite +% \end{macrocode} +% We try to open a file with the name of the output file for +% reading. If this succeeds the file exists and we ask the user if +% he wants to overwrite the file. +% \changes{2.0p}{1992/06/26}{Added \cs{WriteToDir} (FMi).} +% \changes{2.3a}{1995/08/18}{Changed \cs{@empty} (which was undefined) +% to \cs{empty}} +% \changes{2.3e}{1995/09/25}{Changed \cs{WriteToDir} to \cs{destdir}} +% \begin{macrocode} + \immediate\openin\inFile\@pathname\relax + \ifeof\inFile\else + \Ask\answer{File \@pathname\space already exists + \ifx\empty\destdir somewhere \fi + on the system.^^J% + Overwrite it% + \ifx\empty\destdir\space if necessary\fi + ? [y/n]}% +% \end{macrocode} +% We set the switch |\ifGenerate| according to his answer. We +% allow for both ``\texttt{y}'' and ``\texttt{yes}''. +% \begin{macrocode} + \ifx\y \answer \else + \ifx\yes\answer \else + \Generatefalse\fi\fi\fi +% \end{macrocode} +% Don't forget to close the file just opened as we want to write +% to it. +% \begin{macrocode} + \closein\inFile + \fi +% \end{macrocode} +% \changes{2.3e}{1995/09/25}{Destination directory handling} +% If file is to be generated we save its destination pathname and +% pass control to macro |\@fileX|. +% Note that file name is turned into control sequence and |\else| +% branch is skipped before calling |\@fileX|. +% \begin{macrocode} + \ifGenerate + \Name\let{pth@#1}\@pathname + \@addto\filestogenerate{\@pathname\space}% + \Name\@fileX{#1\expandafter}% + \else +% \end{macrocode} +% In case we were not allowed to overwrite an existing file +% we inform the user that we are {\em not\/} generating his file +% and we gobble |\from| specifications. +% \begin{macrocode} + \Msg{Not generating file \@pathname^^J}% + \expandafter\@gobble + \fi + } +% \end{macrocode} +% \end{macro} +% +% \begin{macro}{\@fileX} +% We put name of current output file in |\curout| and initialize +% |\curinfiles| (the list of source files for this output file) +% to empty---these will be needed by |\from|. Then we start +% defining preamble for the current file. +% \begin{macrocode} +\def\@fileX#1#2{% + \chardef#1=\stream@closed + \def\curout{#1}% + \let\curinfiles\empty + \let\curinnames\empty + \def\curref{\MetaPrefix ^^J% + \MetaPrefix\space The original source files were:^^J% + \MetaPrefix ^^J}% +% \end{macrocode} +% Next we execute second parameter. |\from|s will add reference +% lines to the preamble. +% \begin{macrocode} + \let\from\@from \let\needed\@needed + #2% + \let\from\err@from \let\needed\err@needed +% \end{macrocode} +% We check order of input files. +% \begin{macrocode} + \checkorder +% \end{macrocode} +% Each |\from| clause defines |\curin| to be its first parameter. +% So now |\curin| holds name of last input file for current output +% file. This means that current output file should be closed after +% processing |\curin|. We add |#1| to proper `close list'. +% \begin{macrocode} + \Name\@addto{e@\curin}{\noexpand\closeoutput{#1}}% +% \end{macrocode} +% Last we save all the interesting information about current file. +% \begin{macrocode} + \Name\let{pre@\@stripstring#1\expandafter}\currentpreamble + \Name\let{post@\@stripstring#1\expandafter}\currentpostamble + \Name\edef{in@\@stripstring#1}{\expandafter\iden\curinnames} + \Name\edef{ref@\@stripstring#1}{\curref} + } +% \end{macrocode} +% \end{macro} +% +% \begin{macro}{\checkorder} +% This macro checks if the order of files in |\curinfiles| +% agrees with that of |\inputfiles|. The coding is somewhat +% clumsy. +% \begin{macrocode} +\def\checkorder{% + \expandafter\expandafter\expandafter + \checkorderX\expandafter\curinfiles + \expandafter\qStop\inputfiles\qStop + } +\def\checkorderX(#1)#2\qStop#3\qStop{% + \def\tmp##1\readsource(#1)##2\qStop{% + \ifx!##2! \order@error + \else\ifx!#2!\else + \checkorderXX##2% + \fi\fi}% + \def\checkorderXX##1\readsource(#1)\fi\fi{\fi\fi + \checkorderX#2\qStop##1\qStop}% + \tmp#3\readsource(#1)\qStop + } +\def\order@error#1\fi\fi{\fi + \errmessage{DOCSTRIP error: Incompatible order of input + files specified for file + `\iden{\expandafter\uptospace\curin} \qStop'.^^J + Read DOCSTRIP documentation for explanation.^^J + This is a serious problem, I'm exiting}\end + } +% \end{macrocode} +% \end{macro} +% +% \begin{macro}{\needed} +% \changes{2.3c}{1995/08/24}{Macro added} +% \changes{2.3e}{1996/09/12}{Forced expansion of argument to fix a bug +% with filenames containing macros} +% \begin{macro}{\@needed} +% This macro uniquizes name of an input file passed as a +% parameter and marks it as needed to be input. It is used +% internally by |\from|, but can also be issued in argument to +% |\file| to influence the order in which files are read. +% \begin{macrocode} +\def\needed#1{\errmessage{\string\needed\space can only be used in + argument to \string\file}} +\let\err@needed\needed +\def\@needed#1{% + \edef\reserved@a{#1}% + \expandafter\@need@d\expandafter{\reserved@a}} +\def\@need@d#1{% + \@ifpresent{(#1)}\curinfiles +% \end{macrocode} +% If |#1| is present on list of input files for current output +% file we add a space on end of its name and try again. The idea +% is to construct a name that will look different for \TeX\ but +% will lead to the same file when seen by operating system. +% \begin{macrocode} + {\@need@d{#1 }}% +% \end{macrocode} +% When it is not we check if |#1| is present in the list of +% files to be processed. If not we add it and initialize list of +% output files for that input and list of output files that +% should be closed when this file closes. We also add +% constructed name to |\curinfiles| and define |\curin| to be +% able to access constructed name from |\@from|. +% \begin{macrocode} + {\@ifpresent{\readsource(#1)}\inputfiles + {}{\@addto\inputfiles{\noexpand\readsource(#1)}% + \Name\let{b@#1}\empty + \Name\let{o@#1}\empty + \Name\let{e@#1}\empty}% + \@addto\curinfiles{(#1)}% + \def\curin{#1}}% + } +% \end{macrocode} +% \end{macro} +% \end{macro} +% +% \begin{macro}{\from} +% \changes{2.3c}{1995/08/24}{part of code moved to \cs{needed}} +% |\from| starts by adding a line to preamble for output file. +% \begin{macrocode} +\def\from#1#2{\errmessage{Command `\string\from' only allowed in + argument to `\string\file'}} +\let\err@from\from +\def\@from#1#2{% + \@addto\curref{\MetaPrefix\space #1 \if>#2>\else + \space (with options: `#2')\fi^^J}% +% \end{macrocode} +% Then we mark the file as needed input file. +% \begin{macrocode} + \needed{#1}% +% \end{macrocode} +% \changes{2.3e}{1996/10/02}{Introduced ``open list''} +% If this is the first |\from| in current |\file| (i.e. if the +% |\curinnames| so far is empty) the file name is added to the +% ``open list'' for the current input file. +% And |\do|\meta{current output}|{|\meta{options}|}| is appended +% to the list of output files for current input file. +% \begin{macrocode} + \ifx\curinnames\empty + \Name\@addto{b@\curin}{\noexpand\openoutput\curout}% + \fi + \@addto\curinnames{ #1}% + \Name\@addto{o@\curin}{\noexpand\do\curout{#2}}% + } +% \end{macrocode} +% \end{macro} +% +% \begin{macro}{\readsource} +% \changes{2.4a}{1996/06/06}{Extensively hacked to honour stream +% limits (MDW)} +% \changes{2.3a}{1995/08/18}{Renamed to \cs{readsource}; adaptation for +% concurrent version} +% \changes{2.0f}{1991/06/04}{Added check for lines with \texttt{\bsl +% endinput}} This macro is called for each input file that +% is to be processed. +% +% \begin{macrocode} +\def\readsource(#1){% +% \end{macrocode} +% We try to open the input file. If this doesn't succeed, we +% tell the user so and nothing else happens. +% \begin{macrocode} + \immediate\openin\inFile\uptospace#1 \qStop\relax + \ifeof\inFile + \errmessage{Cannot find file \uptospace#1 \qStop}% + \else +% \end{macrocode} +% If statistics are included we nullify line counters +% \begin{macrocode} +%<*stats> + \processedLines\z@ + \commentsRemoved\z@ + \commentsPassed\z@ + \codeLinesPassed\z@ +% +% \end{macrocode} +% \changes{2.3b}{1995/08/22}{Change for pre-constructed +% off-counters' names} +% \changes{2.3e}{1996/10/02}{Introduced ``open list''} +% When the input file was successfully opened, we try to open all +% needed output files by executing the ``open list''. +% If any of files couldn't be opened because of number of streams +% limits, their names are put into |\refusedfiles| list. This list +% subsequently becomes the open list for the next pass. +% \begin{macrocode} + \let\refusedfiles\empty + \csname b@#1\endcsname + \Name\let{b@#1}\refusedfiles +% \end{macrocode} +% Now all output files that could be opened are open. So we go +% through the ``output list'' and for every open file we display a +% message and zero the off-counter, while closed files are appended +% to |\refusedfiles|. +% \begin{macrocode} + \Msg{} \def\@msg{Processing file \uptospace#1 \qStop} + \def\change@msg{% + \edef\@msg{\@spaces\@spaces\@spaces\space + \expandafter\tospaces\uptospace#1 \qStop\secapsot} + \let\change@msg\relax} + \let\do\showfiles@do + \let\refusedfiles\empty + \csname o@#1\endcsname +% \end{macrocode} +% If |\refusedfiles| is nonempty current source file needs reread, +% so we append it to |\newinputfiles|. +% \begin{macrocode} + \ifx\refusedfiles\empty\else + \@addto\newinputfiles{\noexpand\readsource(#1)} + \fi +% \end{macrocode} +% Finally we define |\outputfiles| and construct off-counters +% names. Now |\do|s will have 3 parameters! All output files become +% active. +% \begin{macrocode} + \let\do\makeoutlist@do + \edef\outputfiles{\csname o@#1\endcsname}% + \let\activefiles\outputfiles + \Name\let{o@#1}\refusedfiles +% \end{macrocode} +% Now we change the category code of a lot of characters to +% \meta{other} and make sure that no extra spaces appear in the +% lines read by setting the |\endlinechar| to $-1$. +% \begin{macrocode} + \makeOther\ \makeOther\\\makeOther\$% + \makeOther\#\makeOther\^\makeOther\^^K% + \makeOther\_\makeOther\^^A\makeOther\%% + \makeOther\~\makeOther\{\makeOther\}\makeOther\&% + \endlinechar-1\relax +% \end{macrocode} +% Then we start a loop to process the lines in the file one by one. +% \begin{macrocode} + \loop + \read\inFile to\inLine +% \end{macrocode} +% The first thing we check is whether the current line +% contains an |\endinput|. To allow also real |\endinput| +% commands in the source file, |\endinput| is only recognized +% when it occurs directly at the beginning of a line. +% \begin{macrocode} + \ifx\inLine\Endinput +% \end{macrocode} +% In this case we output a message to inform the programmer (in +% case this was a mistake) and end the loop immediately by setting +% \verb=Continue= to \meta{false}. Note that |\endinput| is +% not placed into the output file. This is important in cases where +% the output file is generated from several \texttt{doc} files. +% \begin{macrocode} + \Msg{File #1 ended by \string\endinput.}% + \Continuefalse + \else +% \end{macrocode} +% \changes{2.0j}{1992/03/03}{First check for end of file before check +% for empty lines} When the end of the file is found we have to +% interrupt the loop. +% \begin{macrocode} + \ifeof\inFile + \Continuefalse +% \end{macrocode} +% \changes{2.0i}{1991/06/27}{Added check for consecutive empty lines} +% If the file did not end we check if the input line is empty. +% If it is, the counter |\emptyLines| is incremented. +% \begin{macrocode} + \else + \Continuetrue + \ifx\inLine\empty + \advance\emptyLines\@ne + \else + \emptyLines\z@ + \fi +% \end{macrocode} +% When the number of empty lines seen so far exceeds 1, we skip them. +% If it doesn't, the expansion of |\inLine| is fed to |\processLine| +% with |\endLine| appended to indicate the end of the line. +% \begin{macrocode} + \ifnum \emptyLines<2 + \expandafter\processLine\inLine\endLine + \else + \maybeMsg{/}% + \fi + \fi + \fi +% \end{macrocode} +% When the processing of the line is finished, we check if there is +% more to do, in which case we repeat the loop. +% \begin{macrocode} + \ifContinue + \repeat +% \end{macrocode} +% The input file is closed. +% \begin{macrocode} + \closein\inFile +% \end{macrocode} +% We close output files for which this was the last input file. +% \begin{macrocode} + \csname e@#1\endcsname +% \end{macrocode} +% If the user was interested in statistics, we inform him of the +% number of lines processed, the number of comments that were +% either removed or passed and the number of codelines that were +% written to the output file. Also the totals are updated. +% \begin{macrocode} +%<*stats> + \Msg{Lines \space processed: \the\processedLines^^J% + Comments removed: \the\commentsRemoved^^J% + Comments \space passed: \the\commentsPassed^^J% + Codelines passed: \the\codeLinesPassed^^J}% + \global\advance\TotalprocessedLines by \processedLines + \global\advance\TotalcommentsRemoved by \commentsRemoved + \global\advance\TotalcommentsPassed by \commentsPassed + \global\advance\TotalcodeLinesPassed by \codeLinesPassed +% +% \end{macrocode} +% The |\NumberOfFiles| need to be known even if no statistics are +% gathered so we update it always. +% \changes{2.4h}{1997/07/07}{update \cs{NumberOfFiles} even if stats are +% not gathered pr/2429} +% \begin{macrocode} + \global\advance\NumberOfFiles by \@ne + \fi} +% \end{macrocode} +% \end{macro} +% +% \begin{macro}{\showfiles@do} +% \changes{2.4a}{1996/10/02}{Macro added (MW)} +% A message is displayed on the terminal telling the user what we +% are about to do. For each open output file we display one line +% saying what options it is generated with and the off-counter +% associated with the file is zeroed. First line contains also name +% of input file. +% Names of output files that are closed are appended to +% |\refusedfiles|. +% \begin{macrocode} +\def\showfiles@do#1#2{% + \ifnum#1=\stream@closed + \@addto\refusedfiles{\noexpand\do#1{#2}}% + \else + \Msg{\@msg + \ifx>#2>\else\space(#2)\fi + \space -> \@stripstring#1} + \change@msg + \csname off@\number#1\endcsname=\z@ + \fi +} +% \end{macrocode} +% \end{macro} +% +% \begin{macro}{\makeoutlist@do} +% \changes{2.3b}{1995/08/22}{Macro added --- pre-constructed +% off-counters' names} +% This macro selects only open output files and constructs names for +% off-counters. +% \begin{macrocode} +\def\makeoutlist@do#1#2{% + \ifnum#1=\stream@closed\else + \noexpand\do#1{#2}\csname off@\number#1\endcsname + \fi} +% \end{macrocode} +% \end{macro} +% +% \begin{macro}{\openoutput} +% \changes{2.3e}{1996/10/02}{Change for ``open lists'' -- renamed from +% \cs{ensureopen@do}} +% \changes{2.4a}{1996/06/06}{Check whether there are streams left (MDW)} +% This macro opens output streams if possible. +% \begin{macrocode} +\def\openoutput#1{% +% \end{macrocode} +% If both maxfile counters are non-zero\dots +% \begin{macrocode} + \if 1\ifnum\@maxfiles=\z@ 0\fi + \ifnum\@maxoutfiles=\z@ 0\fi1% +% \end{macrocode} +% \dots the stream may be opened and counters decremented. But if +% that cannot be done\dots +% \begin{macrocode} + \advance\@maxfiles\m@ne + \advance\@maxoutfiles\m@ne + \StreamOpen#1% + \WritePreamble#1% + \else +% \end{macrocode} +% \dots the file is added to the ``refuse list''. +% \begin{macrocode} + \@addto\refusedfiles{\noexpand\openoutput#1}% + \fi + } +% \end{macrocode} +% \end{macro} +% +% \begin{macro}{\closeoutput} +% \changes{2.4a}{1996/06/06} +% {Don't close the file if it's not open (MDW)} +% This macro closes open output stream when it is no longer +% needed and increments maxfiles counters. +% \begin{macrocode} +\def\closeoutput#1{% + \ifnum#1=\stream@closed\else + \WritePostamble#1% + \StreamClose#1% + \advance\@maxfiles\@ne + \advance\@maxoutfiles\@ne + \fi} +% \end{macrocode} +% \end{macro} +% +% \subsubsection{Preamble and postamble} +% +% \begin{macro}{\ds@heading} +% \changes{2.3e}{1996/09/16}{Macro added.} +% This is a couple of lines, stating what file is being written and +% how it was created. +% \begin{macrocode} +\def\ds@heading{% + \MetaPrefix ^^J% + \MetaPrefix\space This is file `\outFileName',^^J% + \MetaPrefix\space generated with the docstrip utility.^^J% + } +% \end{macrocode} +% \end{macro} +% +% \begin{macro}{\AddGenerationDate} +% \changes{2.3d}{1995/11/17}{(DPC) Macro added.} +% Older versions of \ds{} added the date that any file was generated +% and the version number of \ds{}. This confused some people as they +% mistook this for the version/date of the file that was being +% written. So now this information is not normally written, but +% a batch file may call this to get an old style header. +% \begin{macrocode} +\def\AddGenerationDate{% + \def\ds@heading{% + \MetaPrefix ^^J% + \MetaPrefix\space This is file `\outFileName', generated % + on <\the\year/\the\month/\the\day> ^^J% + \MetaPrefix\space with the docstrip utility (\fileversion).^^J% + }} +% \end{macrocode} +% \end{macro} +% +% \begin{macro}{\declarepreamble} +% \changes{2.3a}{1995/08/18}{renamed from \cs{preamble}; +% interface changed} +% \changes{2.0e}{1991/06/01}{Macro added.} +% \changes{2.3e}{1995/09/25} +% {Change for batchfiles working by \cs{input}} +% \changes{2.3e}{1996/09/16}{Change to allow customization.} +% When a batch file is used the +% user can specify a preamble of his own that will be written to +% each file that is created. This can be useful to include an extra +% copyright notice in the stripped version of a file. Also a +% warning that both versions of a file should {\em always\/} be +% distributed together could be written to a stripped file by +% including it in such a preamble. +% +% Every line that is written to |\outFile| that belongs to the +% preamble is preceded by two percent characters. This will prevent +% \ds{} from stripping these lines off the file. +% +% The preamble should be started with the macro +% |\declarepreamble|; it is ended by |\endpreamble|. All +% processing is done within a group in order to be able to locally +% change some values. +% +% |\ReferenceLines| is let equal |\relax| to be unexpandable. +% \begin{macrocode} +\let\inFileName\relax +\let\outFileName\relax +\let\ReferenceLines\relax +\def\declarepreamble{\begingroup +\catcode`\^^M=13 \catcode`\ =12 % +\declarepreambleX} +{\catcode`\^^M=13 % +\gdef\declarepreambleX#1#2 +\endpreamble{\endgroup% + \def^^M{^^J\MetaPrefix\space}% + \edef#1{\ds@heading% + \ReferenceLines% + \MetaPrefix\space\checkeoln#2\empty}}% +\gdef\checkeoln#1{\ifx^^M#1\else\expandafter#1\fi}% +} +% \end{macrocode} +% \end{macro} +% +% \begin{macro}{\declarepostamble} +% \changes{2.0e}{1991/06/01}{Macro added.} +% \changes{2.3e}{1995/09/25} +% {Change for batchfiles working by \cs{input}} +% Just as a preamble can be +% specified in a batch file, the same can be done for a {\em +% post\/}amble. +% +% The definition of |\declarepostamble| is very much like the +% definition above of |\declarepreamble|. +% \begin{macrocode} +\def\declarepostamble{\begingroup +\catcode`\ =12 \catcode`\^^M=13 +\declarepostambleX} +{\catcode`\^^M=13 % +\gdef\declarepostambleX#1#2 +\endpostamble{\endgroup% + \def^^M{^^J\MetaPrefix\space}% + \edef#1{\MetaPrefix\space\checkeoln#2\empty^^J% + \MetaPrefix ^^J% + \MetaPrefix\space End of file `\outFileName'.% + }}% +} +% \end{macrocode} +% \end{macro} +% +% \begin{macro}{\usepreamble} +% \begin{macro}{\usepostamble} +% Macros for selecting [pre/post]amble to be used. +% \begin{macrocode} +\def\usepreamble#1{\def\currentpreamble{#1}} +\def\usepostamble#1{\def\currentpostamble{#1}} +% \end{macrocode} +% \end{macro} +% \end{macro} +% +% \begin{macro}{\nopreamble} +% \changes{2.4i}{1998/01/18}{Macro added. pr/2726} +% \begin{macro}{\nopostamble} +% \changes{2.4i}{1998/01/18}{Macro added. pr/2726} +% Shortcuts for disabling the writing of [pre/post]ambles. +% This is not done by disabling |\WritePreamble| or |\WritePostamble| +% since that wouldn't +% revertable afterwards. Instead the empty [pre/post]ambles are handled +% specially in those macros. +% \begin{macrocode} +\def\nopreamble{\usepreamble\empty} +\def\nopostamble{\usepostamble\empty} +% \end{macrocode} +% \end{macro} +% \end{macro} +% +% \begin{macro}{\preamble} +% \changes{2.3c}{1995/08/28}{Bug fixed: default preamble is now selected +% not only defined} +% \begin{macro}{\postamble} +% \changes{2.3c}{1995/08/28}{As for \cs{preamble}} +% For backward compatibility we provide these macros defining +% default preamble and postamble. +% \begin{macrocode} +\def\preamble{\usepreamble\defaultpreamble + \declarepreamble\defaultpreamble} +\def\postamble{\usepostamble\defaultpostamble + \declarepostamble\defaultpostamble} +% \end{macrocode} +% \end{macro} +% \end{macro} +% \begin{macro}{\org@preamble} +% \changes{2.3a}{1995/08/18}{Macro added} +% \changes{2.3c}{1995/11/16}{With \cs{inFileName} again} +% \begin{macro}{\org@postamble} +% \changes{2.3a}{1995/08/18}{Macro added} +% Default values to use if nothing different is provided. +% \changes{2.2j}{1995/08/06}{Updated default preamble} +% \changes{2.5a}{1998/04/03}{Updated default preamble} +% \begin{macrocode} +\declarepreamble\org@preamble + +IMPORTANT NOTICE: + +For the copyright see the source file. + +Any modified versions of this file must be renamed +with new filenames distinct from \outFileName. + +For distribution of the original source see the terms +for copying and modification in the file \inFileName. + +This generated file may be distributed as long as the +original source files, as listed above, are part of the +same distribution. (The sources need not necessarily be +in the same archive or directory.) +\endpreamble +% \end{macrocode} +% +% \begin{macrocode} +\edef\org@postamble{\string\endinput^^J% + \MetaPrefix ^^J% + \MetaPrefix\space End of file `\outFileName'.% + } +% \end{macrocode} +% +% \begin{macrocode} +\let\defaultpreamble\org@preamble +\let\defaultpostamble\org@postamble +% \end{macrocode} +% +% \begin{macrocode} +\usepreamble\defaultpreamble +\usepostamble\defaultpostamble +% \end{macrocode} +% \end{macro} +% \end{macro} +% +% \begin{macro}{\originaldefault} +% \changes{2.5a}{1998/04/03}{Macro added} +% \changes{2.5b}{1998/04/28}{Macro renamed from \cs{orginaldefault} +% to \cs{originaldefault}} +% The default preamble header changed in v2.5 to allow distribution +% of generated files as long as source also distributed. If you need +% the original default, not allowing distribution of generated files +% add |\usepreamble\originaldefault| to your .ins files. +% Note then that your file can not be included in most TeX distributions +% on CD which are distributed `pre-installed' with all \LaTeX\ files +% extracted form th edocumented sources and moved to a suitable +% directory in \TeX's search path. +% \begin{macrocode} +\declarepreamble\originaldefault + +IMPORTANT NOTICE: + +For the copyright see the source file. + +You are *not* allowed to modify this file. + +You are *not* allowed to distribute this file. +For distribution of the original source see the terms +for copying and modification in the file \inFileName. + +\endpreamble +% \end{macrocode} +% \end{macro} +% +% \begin{macro}{\WritePreamble} +% \changes{2.0e}{1991/06/01}{Macro added.} +% \changes{2.3c}{1995/11/16}{Added definitions of \cs{inFileName} and +% \cs{outFileName}} +% \changes{2.3d}{1995/11/17}{(DPC) Macro added.} +% \changes{2.4i}{1998/01/18}{Test for \cs{empty} postamble and +% don't write it out. pr/2726} +% \begin{macrocode} +\def\WritePreamble#1{% +% \end{macrocode} +% We write out only non-empty preambles. +% \begin{macrocode} + \expandafter\ifx\csname pre@\@stripstring#1\endcsname\empty + \else + \edef\outFileName{\@stripstring#1}% +% \end{macrocode} +% Then the reference lines that tell from what source file(s) the +% stripped file was created and user supplied preamble. +% \begin{macrocode} + \StreamPut#1{\csname pre@\@stripstring#1\endcsname}% + \fi} +% \end{macrocode} +% \end{macro} +% +% \begin{macro}{\WritePostamble} +% \changes{2.0e}{1991/06/01}{Macro added.} +% \changes{2.3c}{1995/11/16}{Added defs of \cs{inFileName} and +% \cs{outFileName}} +% \changes{2.4i}{1998/01/18}{Test for \cs{empty} postamble and +% don't write it out. pr/2726} +% Postamble attributed to |#1| is written out. The +% last line written identifies the file again. +% \begin{macrocode} +\def\WritePostamble#1{% +% \end{macrocode} +% We write out only non-empty postambles. +% \begin{macrocode} + \expandafter\ifx\csname post@\@stripstring#1\endcsname\empty + \else + \edef\outFileName{\@stripstring#1}% + \StreamPut#1{\csname post@\@stripstring#1\endcsname}% + \fi} +% \end{macrocode} +% \end{macro} +% +% \subsection{Support for writing to specified directories} +% +% As we've seen before every output file is written to directory +% specifed by the value of |\destdir| current at the moment of +% this file's |\file| declaration. +% +% \begin{macro}{\usedir} +% \changes{2.3e}{1995/09/15}{Macro added} +% This macro when called should translate its one argument into a +% directory name and define |\destdir| to that value. The default +% for |\usedir| is to ignore its argument and return name of +% current directory (if known). This can be changed by commands +% from |docstrip.cfg| file. +% +% |\showdirectory| is used just to display directory name for +% user's information. +% \begin{macrocode} +\def\usedir#1{\edef\destdir{\WriteToDir}} +\def\showdirectory#1{\WriteToDir} +% \end{macrocode} +% \end{macro} +% +% \begin{macro}{\BaseDirectory} +% \changes{2.3e}{1995/09/15}{Macro added} +% \changes{2.4e}{1996/10/22}{\cs{@setwritetodir} added (DPC)} +% This is config file command for specifing root directory of the +% \TeX{} hierarchy. It enables the whole directory +% selecting mechanism by redefining |\usedir|. +% First make sure that the directory syntax commands have been set +% up by calling |\@setwritedir|, so that the value of |\dirsep| +% used by the |\edef| is (hopefully) correct. +% \begin{macrocode} +\def\BaseDirectory#1{% + \@setwritetodir + \let\usedir\alt@usedir + \let\showdirectory\showalt@directory + \edef\basedir{#1\dirsep}} +% \end{macrocode} +% \end{macro} +% +% \begin{macro}{\convsep} +% \changes{2.3e}{1995/09/15}{Macro added} +% This macro loops through slashes in its argument replacing them +% with current |\dirsep|. It should be called +% |\convsep some/directory/name/\qStop| (with slash on the end). +% \begin{macrocode} +\def\convsep#1/#2\qStop{% + #1\ifx\qStop#2\qStop \pesvnoc\fi\convsep\dirsep#2\qStop} +\def\pesvnoc#1\qStop{\fi} +% \end{macrocode} +% \end{macro} +% +% \begin{macro}{\alt@usedir} +% \changes{2.3e}{1995/09/15}{Macro added} +% Directory name construction macro enabling writing to various +% directories. +% \begin{macrocode} +\def\alt@usedir#1{% + \Name\ifx{dir@#1}\relax + \undefined@directory{#1}% + \else + \edef\destdir{\csname dir@#1\endcsname}% + \fi} +\def\showalt@directory#1{% + \Name\ifx{dir@#1}\relax + \showundef@directory{#1}% + \else\csname dir@#1\endcsname\fi} +% \end{macrocode} +% \end{macro} +% +% \begin{macro}{\undefined@directory} +% \changes{2.4a}{1996/10/04}{Macro added (MW)} +% \changes{2.4e}{1996/10/22}{Help text added (DPC)} +% This macro comes into action when undefined label is spotted. The +% action is to raise an error and define |\destdir| to point to the +% current directory. +% \begin{macrocode} +\def\undefined@directory#1{% + \errhelp{docstrip.cfg should specify a target directory for^^J% + #1 using \DeclareDir or \UseTDS.}% + \errmessage{You haven't defined the output directory for `#1'.^^J% + Subsequent files will be written to the current directory}% + \let\destdir\WriteToDir + } +\def\showundef@directory#1{UNDEFINED (label is #1)} +% \end{macrocode} +% \end{macro} +% +% \begin{macro}{\undefined@TDSdirectory} +% \changes{2.4a}{1996/10/04}{Macro added (MW)} +% This happens when label is undefined while using TDS. The label +% is converted to use proper separators and appended to base +% directory name. +% \begin{macrocode} +\def\undefined@TDSdirectory#1{% + \edef\destdir{% + \basedir\convsep#1/\qStop + }} +\def\showundef@TDSdirectory#1{\basedir\convsep#1/\qStop} +% \end{macrocode} +% \end{macro} +% +% \begin{macro}{\UseTDS} +% \changes{2.4a}{1996/10/04}{Macro added (MW)} +% \changes{2.4e}{1996/10/22}{\cs{@setwritetodir} added (DPC)} +% Change of behaviour for undefined labels is done simply: +% \begin{macrocode} +\def\UseTDS{% + \@setwritetodir + \let\undefined@directory\undefined@TDSdirectory + \let\showundef@directory\showundef@TDSdirectory + } +% \end{macrocode} +% \end{macro} +% +% \begin{macro}{\DeclareDir} +% \changes{2.3e}{1995/09/15}{Macro added} +% \changes{2.4e}{1996/10/22}{\cs{@setwritetodir} added (DPC)} +% This macro remaps some directory name to another. +% \begin{macrocode} +\def\DeclareDir{\@ifnextchar*{\DeclareDirX}{\DeclareDirX\basedir*}} +\def\DeclareDirX#1*#2#3{% + \@setwritetodir + \Name\edef{dir@#2}{#1#3}} +% \end{macrocode} +% \end{macro} +% +% +% \subsubsection{Compatibility with older versions} +% +% \begin{macro}{\generateFile} +% Main macro of previous versions of \ds. +% \begin{macrocode} +\def\generateFile#1#2#3{{% + \ifx t#2\askforoverwritetrue + \else\askforoverwritefalse\fi + \generate{\file{#1}{#3}}% + }} +% \end{macrocode} +% \end{macro} +% +% To support command files that were written for the first version +% of \ds{} the commands |\include| and |\processFile| +% are defined here. The use of this interface is not recommended +% as it may be removed in a future release of \ds{}. +% +% \begin{macro}{\include} +% \changes{2.0f}{1991/06/04}{Macro added} To provide the \ds{} program +% with a list of options that should be included in the output the +% command \verb=\include{=\meta{Options}\verb=}= can be used. This +% macro is meant to be used in conjunction with the +% |\processFile| command. +% \begin{macrocode} +\def\include#1{\def\Options{#1}} +% \end{macrocode} +% \end{macro} +% +% \begin{macro}{\processFile} +% \changes{2.0f}{1991/06/04}{Supply \texttt{\bsl generateFile} with +% \texttt{\bsl Options}} +%\DeleteShortVerb\| +% The macro +% \verb=\processFile{=\meta{filename}\verb=}{=\meta{inext}\verb=}{=% +%\unskip\meta{outext}\verb=}{=\meta{t{\fontshape{n}\ttfamily|}f}\verb=}= +% can be used when a single input file is used to produce +% a single output file. The macro is also used in the interactive +% mode of the \ds{} program. +%\MakeShortVerb\| +% +% The arguments \meta{inext} and \meta{outext} denote the +% extensions of the input and output files respectively. The fourth +% argument can be used to specify if an existing file should be +% overwritten without asking. If \meta{t} is specified the program +% will ask for permission before overwriting an existing file. +% +% This macro is defined using the more generic macro |\generateFile|. +% \begin{macrocode} +\def\processFile#1#2#3#4{% + \generateFile{#1.#3}{#4}{\from{#1.#2}{\Options}}} +% \end{macrocode} +% \end{macro} +% +% \begin{macro}{\processfile} +% \begin{macro}{\generatefile} +% \changes{2.0m}{1991/04/23}{Now issue a warning when \cs{processfile} +% or \cs{generatefile} are used} +% Early +% versions of \ds{} defined |\processfile| and +% |\generatefile| instead of the commands as they are defined in +% this version. To remain upwards compatible, we still provide +% these commands, but issue a warning when they are used. +% \begin{macrocode} +\def\processfile{\Msg{% + ^^Jplease use \string\processFile\space instead of + \string\processfile!^^J}% + \processFile} +\def\generatefile{\Msg{% + ^^Jplease use \string\generateFile\space instead of + \string\generatefile!^^J}% + \generateFile} +% \end{macrocode} +% \end{macro} +% \end{macro} +% +% +% \subsection{Limiting open file streams} +% +% (This section was written by Mark Wooding) +% +% \begin{macro}{\maxfiles} +% \changes{2.4a}{1996/06/06}{Macro added (MDW)} +% Some operating systems with duff libraries or other restrictions +% can't cope with all the files which \ds\ tries to output at once. +% A configuration file can say |\maxfiles{|\meta{number}|}| to +% describe the maximum limit for the environment. +% +% I'll need a counter for this value, so I'd better allocate one. +% +% \begin{macrocode} +\newcount\@maxfiles +% \end{macrocode} +% +% The configuration command |\maxfiles| is just slightly prettier than +% an assignment, for \LaTeX\ people. It also gives me an opportunity +% to check that the limit is vaguely sensible. I need at least 4 +% streams: +% \begin{enumerate} +% \item A batch file. +% \item A sub batch file, which \LaTeX's installation utility uses. +% \item An input stream for reading an unstripped file. +% \item An output stream for writing a stripped file. +% \end{enumerate} +% +% \begin{macrocode} +\def\maxfiles#1{% + \@maxfiles#1\relax + \ifnum\@maxfiles<4 + \errhelp{I'm not a magician. I need at least four^^J% + streams to be able to work properly, but^^J% + you've only let me use \the\@maxfiles.}% + \errmessage{\noexpand\maxfiles limit is too strict.}% + \@maxfiles4 + \fi +} +% \end{macrocode} +% +% \changes{2.4a}{1996/10/03}{No default limit since batchfiles are now +% \cs{input} (MW)} +% Since batchfiles are now |\input|ed there should be no default limit +% here. I'll just use some abstract large number. +% \begin{macrocode} +\maxfiles{1972} % year of my birth (MW) +% \end{macrocode} +% +% \end{macro} +% +% \begin{macro}{\maxoutfiles} +% \changes{2.4a}{1996/06/06}{Macro added (MDW)} +% +% Maybe there's a restriction on just output streams. (Well, there is: +% I know, because \TeX\ only allows 16.) I may as well allow the +% configuration to set this up. +% +% Again, I need a counter. +% +% \begin{macrocode} +\newcount\@maxoutfiles +% \end{macrocode} +% +% And now the macro. I need at least one output stream which I think is +% reasonable. +% +% \begin{macrocode} +\def\maxoutfiles#1{% + \@maxoutfiles=#1\relax + \ifnum\@maxoutfiles<1 + \@maxoutfiles1 + \errhelp{I'm not a magician. I need at least one output^^J% + stream to be able to do anything useful at all.^^J% + Please be reasonable.}% + \errmessage{\noexpand\maxoutfiles limit is insane}% + \fi +} +% \end{macrocode} +% +% The default limit is 16, because that's what \TeX\ says. +% +% \begin{macrocode} +\maxoutfiles{16} +% \end{macrocode} +% +% \end{macro} +% +% \begin{macro}{\checkfilelimit} +% +% This checks the file limit when a new batch file is started. If +% there's fewer than two files left here, we're not going to be able +% to strip any files. The file limit counter is local to the group +% which is set up around |\batchinput|, so that's all pretty cool. +% +% \begin{macrocode} +\def\checkfilelimit{% + \advance\@maxfiles\m@ne + \ifnum\@maxfiles<2 % + \errhelp{There aren't enough streams left to do any unpacking.^^J% + I can't do anything about this, so complain at the^^J% + person who made such a complicated installation.}% + \errmessage{Too few streams left.}% + \end + \fi +} +% \end{macrocode} +% +% \end{macro} +% +% \subsection{Interaction with the user} +% +% \begin{macro}{\strip@meaning} +% Throw away the first part of |\meaning| output. +% \changes{2.4c}{1996/06/11}{Macro added (DPC)} +% \begin{macrocode} +\def\strip@meaning#1>{} +% \end{macrocode} +% \end{macro} +% +% \begin{macro}{\processbatchFile} +% \changes{2.0f}{1991/06/04}{Macro added.} +% \changes{2.3e}{1995/09/25}{Batch file is \cs{input}ed not \cs{read}} +% When \ds{} is run it always tries to use a batch file. +% +% For this purpose it calls the macro |\processbatchFile|. +% +% \changes{2.4a}{1996/06/06} +% {Added check for file limits (MDW)} +% \changes{2.4c}{1996/06/11} +% {Add \cs{jobname} checks (DPC)} +% \changes{2.4d}{1996/06/17} +% {Move \cs{jobname} checks to top level (DPC)} +% The first thing is to check if there are any input streams left. +% \begin{macrocode} +\def\processbatchFile{% + \checkfilelimit + \let\next\relax +% \end{macrocode} +% Now we try to open the batch file for reading. +% \begin{macrocode} + \openin\inputcheck \batchfile\relax + \ifeof\inputcheck +% \end{macrocode} +% If we didn't succeed in opening the file, we assume that it does +% not exist. If we tried the default filename, we silently +% continue; the \ds{} program will switch to interactive mode in +% this case. +% \begin{macrocode} + \ifDefault + \else +% \end{macrocode} +% \changes{2.4d}{1996/10/17}{Missing batchfile an error (DPC)} +% If we failed to open the user-supplied file, something is wrong +% and we warn him about it. This will also result in a switch to +% interactive mode. +% \begin{macrocode} + \errhelp + {A batchfile specified in \batchinput could not be found.}% + \errmessage{^^J% + **************************************************^^J% + * Could not find your \string\batchfile=\batchfile.^^J% + **************************************************}% + \fi + \else +% \end{macrocode} +% When we were successful in opening a file, we again have to check +% whether it was the default file. In that case we tell the user +% we found that file and ask him if he wants to use it. +% \begin{macrocode} + \ifDefault + \Msg{**************************************************^^J% + * Batchfile \DefaultbatchFile\space found Use it? (y/n)?}% + \Ask\answer{% + **************************************************}% + \else +% \end{macrocode} +% When it was the user-supplied file we can safely assume he wants +% to use it so we set |\answer| to \texttt{y}. +% \begin{macrocode} + \let\answer\y + \fi +% \end{macrocode} +% If the macro |\answer| contains a \texttt{y} we can read in the +% batchfile. We do it in an indirect way---after completing |\if|s. +% \begin{macrocode} + \ifx\answer\y + \closein\inputcheck + \def\next{\@@input\batchfile\relax}% + \fi + \fi + \next} +% \end{macrocode} +% \end{macro} +% +% \begin{macro}{\ReportTotals} +% \changes{2.0g}{1991/06/05}{Macro added.} The macro +% |\ReportTotals| can be used to report total statistics for +% all files processed. This code is only included in the program if +% the option \texttt{stats} is included. +% \begin{macrocode} +%<*stats> +\def\ReportTotals{% + \ifnum\NumberOfFiles>\@ne + \Msg{Overall statistics:^^J% + Files \space processed: \the\NumberOfFiles^^J% + Lines \space processed: \the\TotalprocessedLines^^J% + Comments removed: \the\TotalcommentsRemoved^^J% + Comments \space passed: \the\TotalcommentsPassed^^J% + Codelines passed: \the\TotalcodeLinesPassed}% + \fi} +% +% \end{macrocode} +% \end{macro} +% +% \begin{macro}{\SetFileNames} +% The macro |\SetFileNames| is used when the program runs in +% interactive mode and the user was asked to supply extensions and +% a list of filenames. +% \begin{macrocode} +\def\SetFileNames{% + \edef\sourceFileName{\MainFileName.\infileext}% + \edef\destFileName{\MainFileName.\outfileext}} +% \end{macrocode} +% \end{macro} +% +% \begin{macro}{\CheckFileNames} +% In interactive mode, the user gets asked for the extensions for +% the input and output files. Also the name or names of the input +% files (without extension) is asked for. Then the names of the +% input and output files are constructed from this information by +% |\SetFileNames|. This assumes that the name of the input file is +% the same as the name of the output file. But we should not write +% to the same file we're reading from so the extensions should +% differ. +% +% The macro |\CheckFileNames| makes sure that the output goes to a +% different file to the one where the input comes from. +% \begin{macrocode} +\def\CheckFileNames{% + \ifx\sourceFileName\destFileName +% \end{macrocode} +% If input and output files are the same we signal an error and stop +% processing. +% \begin{macrocode} + \Msg{^^J% + !!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!^^J% + ! It is not possible to read from and write to the same file !^^J% + !!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!^^J}% + \Continuefalse + \else +% \end{macrocode} +% If they are not the same we check if the input file exists by +% trying to open it for reading. +% \begin{macrocode} + \Continuetrue + \immediate\openin\inFile \sourceFileName\relax + \ifeof\inFile +% \end{macrocode} +% If an end of file was found, the file couldn't be opened, so we +% signal an error and stop processing. +% \begin{macrocode} + \Msg{^^J% + !!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!^^J% + ! Your input file `\sourceFileName' was not found !^^J% + !!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!^^J}% + \Continuefalse + \else +% \end{macrocode} +% The last check we have to make is if the output file already +% exists. Therefore we try to open it for reading. +% As a precaution we first close the input stream. +% \changes{2.0p}{1992/06/26}{Added \cs{WriteToDir} (FMi).} +% \changes{2.0r}{1992/08/17}{Use \cs{inFile} for reading} +% \changes{2.0r}{1992/08/17}{Moved \cs{closein} statements} +% \begin{macrocode} + \immediate\closein\inFile + \immediate\openin\inFile\destdir \destFileName\relax + \ifeof\inFile +% \end{macrocode} +% If this fails, it didn't exist and all is well. +% \begin{macrocode} + \Continuetrue + \else +% \end{macrocode} +% If opening of the output file for reading succeeded we have to +% ask the user if he wants to overwrite it. We assume he doesn't +% want to overwrite it, so the switch |\ifContinue| is initially +% set to \meta{false}. Only if he answers the question positively +% with `\texttt{y}' or `\texttt{yes}' we set the switch back to +% \meta{true}. +% \changes{2.0p}{1992/06/26}{Changed question about overwriting.} +% \begin{macrocode} + \Continuefalse + \Ask\answer{File \destdir\destFileName\space already + exists + \ifx\empty\destdir somewhere \fi + on the system.^^J% + Overwrite it% + \ifx\empty\destdir\space if necessary\fi + ? [y/n]}% + \ifx\y \answer \Continuetrue \else + \ifx\yes\answer \Continuetrue \else + \fi\fi + \fi +% \end{macrocode} +% All checks have been performed now, so we can close any file that +% was opened just for this purpose. +% \begin{macrocode} + \fi + \fi + \closein\inFile} +% \end{macrocode} +% \end{macro} +% +% \begin{macro}{\interactive} +% The macro |\interactive| implements the interactive mode of the +% \ds{} program. The macro is implemented using the +% \meta{while} construction. While the switch |\ifMoreFiles| remains +% true, we continue processing. +% \begin{macrocode} +\def\interactive{% + \whileswitch\ifMoreFiles\fi% +% \end{macrocode} +% To keep macro redefinitions local we start a group and ask the +% user some questions about what he wants us to do. +% \begin{macrocode} + {\begingroup + \AskQuestions +% \end{macrocode} +% The names of the files that have to be processed are stored as a +% comma-separated list in the macro |\filelist| by |\AskQuestions|. +% We use a \meta{for} loop to process the files one by one. +% \begin{macrocode} + \forlist\MainFileName:=\filelist + \do +% \end{macrocode} +% First the names of the input and output files are constructed +% and a check is made if all filename information is correct. +% \begin{macrocode} + \SetFileNames + \CheckFileNames + \ifContinue +% \end{macrocode} +% If everything was well, produce output file. +% \changes{2.0q}{1992/07/01}{Preceded filename by \cs{WriteToDir}} +% \begin{macrocode} + \generateFile{\destFileName}{f}% + {\from{\sourceFileName}{\Options}} + \fi% +% \end{macrocode} +% This process is repeated until |\filelist| is exhausted. +% \begin{macrocode} + \od + \endgroup +% \end{macrocode} +% Maybe the user wants more files to be processed, possibly with +% another set of options, so we give him the opportunity. +% \begin{macrocode} + \Ask\answer{More files to process (y/n)?}% + \ifx\y \answer\MoreFilestrue \else + \ifx\yes\answer\MoreFilestrue \else +% \end{macrocode} +% If he didn't want to process any more files, the switch +% |\ifMoreFiles| is set to \meta{false} in order to interrupt the +% \meta{while} loop. +% \begin{macrocode} + \MoreFilesfalse\fi\fi + }} +% \end{macrocode} +% \end{macro} +% +% \begin{macro}{\AskQuestions} +% \changes{2.0e}{1991/06/01}{Macro added.} +% The macro |\AskQuestions| is called by |\interactive| to get +% some information from the user concerning the files that need +% to be processed. +% \begin{macrocode} +\def\AskQuestions{% + \Msg{^^J% + ****************************************************}% +% \end{macrocode} +% We want to know the extension of the input files, +% \begin{macrocode} + \Ask\infileext{% + * First type the extension of your input file(s): \space *}% + \Msg{****************************************************^^J^^J% + ****************************************************}% +% \end{macrocode} +% the extension of the output files, +% \begin{macrocode} + \Ask\outfileext{% + * Now type the extension of your output file(s) \space: *}% + \Msg{****************************************************^^J^^J% + ****************************************************}% +% \end{macrocode} +% if options are to be included and +% \begin{macrocode} + \Ask\Options{% + * Now type the name(s) of option(s) to include \space\space: *}% + \Msg{****************************************************^^J^^J% + ****************************************************^^J% + * Finally give the list of input file(s) without \space\space*}% +% \end{macrocode} +% the name of the input file or a list of names, separated by commas. +% \begin{macrocode} + \Ask\filelist{% + * extension seperated by commas if necessary % + \space\space\space\space: *}% + \Msg{****************************************************^^J}}% +% \end{macrocode} +% \end{macro} +% +% \subsection{The main program} +% When \TeX\ processes the \ds{} program it displays +% a message about the version of the program and its function +% on the terminal. +% \begin{macrocode} +\Msg{Utility: `docstrip' \fileversion\space <\filedate>^^J% + English documentation \space\space\space <\docdate>}% +\Msg{^^J% + **********************************************************^^J% + * This program converts documented macro-files into fast *^^J% + * loadable files by stripping off (nearly) all comments! *^^J% + **********************************************************^^J}% +% \end{macrocode} +% +% +% \begin{macro}{\WriteToDir} +% Macro |\WriteToDir| is either empty or holds the prefix +% necessary to read a file from the current directory. Under UNIX +% this is |./| but a lot of other systems addopted this concept. +% This macro is a default value for |\destdir|. +% +% The definition of this macro is now delayed until |\@setwritedir| +% is called. +% \changes{2.0p}{1992/06/26}{Macro added (FMi).} +% \changes{2.2a}{1993/12/02}{check texsys file} +% \changes{2.2d}{1994/01/20}{do not read dircheck/texsys file} +% \changes{2.4e}{1996/10/22}{set in \cs{@setwritedir} (DPC)} +% \end{macro} +% +% \begin{macro}{\makepathname} +% \changes{2.3e}{1995/10/24}{Macro added} +% \changes{2.4e}{1996/10/22}{set in \cs{@setwritedir} (DPC)} +% This macro should define |\@pathname| to full path name made by +% combining current value of |\destdir| with its one argument being +% a file name. Its default value defined here is suitable for +% \textsc{unix, ms-dos} and Macintosh, but for some systems it may +% be needed to redefine this in \texttt{docstrip.cfg} file. We +% provide such redefinition for VMS here. +% +% Macro |\dirsep| holds directory separator specific for a +% system. Default value suitable for UNIX and DOS is slash. It +% comes in action when |\usedir| labels are used directly. +% +% The definition of this macro is now delayed until |\@setwritedir| +% is called. +% \end{macro} +% +% \begin{macro}{\@setwritedir} +% \changes{2.4e}{1996/10/22}{macro added (DPC)} +% The following tests try to automatically set |\WriteToDir|, +% |\dirname| and |\makepathname| in Unix, Mac, or VMS style. +% The tests are not run at the top level but held in this macro +% so that a configuration file has a chance to define |\WriteToDir| +% which allows the other two to be set automatically. The tests could +% more simply be run after the configuration file is read, but the +% configuration commands like |\BaseDirectory| need (at least at +% present) to have |\dirsep| correctly defined. It does not define +% any command that is already defined, so by defining these commands +% a configuration file can produce different effects for special needs. +% So this command is called by |BaseDirectory|, |\UseTDS|, +% |\DeclareDir| and finally at the top level after the cfg is run. +% It begins by redefining itself to be a no-op so it effectively is +% only called once. +% \begin{macrocode} +\def\@setwritetodir{% + \let\setwritetodir\relax +% \end{macrocode} +% +% \begin{macrocode} + \ifx\WriteToDir\@undefined + \ifx\@currdir\@undefined + \def\WriteToDir{}% + \else + \let\WriteToDir\@currdir + \fi + \fi +% \end{macrocode} +% +% \begin{macrocode} + \let\destdir\WriteToDir +% \end{macrocode} +% +% VMS Style. +% \begin{macrocode} + \def\tmp{[]}% + \ifx\tmp\WriteToDir + \ifx\dirsep\@undefined + \def\dirsep{.}% + \fi + \ifx\makepathname\@undefined + \def\makepathname##1{% + \edef\@pathname{\ifx\WriteToDir\destdir + \WriteToDir\else[\destdir]\fi##1}}% + \fi + \fi +% \end{macrocode} +% +% Unix and Mac styles. +% \begin{macrocode} + \ifx\dirsep\@undefined + \def\dirsep{/}% + \def\tmp{:}% + \ifx\tmp\WriteToDir + \def\dirsep{:}% + \fi + \fi +% \end{macrocode} +% +% \begin{macrocode} + \ifx\makepathname\@undefined + \def\makepathname##1{% + \edef\@pathname{\destdir\ifx\empty\destdir\else + \ifx\WriteToDir\destdir\else\dirsep\fi\fi##1}}% + \fi} +% \end{macrocode} +% \end{macro} +% +% +% If the user has a |docstrip.cfg| file, use it now. +% \changes{2.4d}{1995/10/17}{Move config file test to outer level (DPC)} +% This macro tries to read \texttt{docstrip.cfg} file. If this +% succeeds executes its first argument, otherwise the second. +% \begin{macrocode} +\immediate\openin\inputcheck=docstrip.cfg\relax +\ifeof\inputcheck + \Msg{% + ********************************************************^^J% + * No Configuration file found, using default settings. *^^J% + ********************************************************^^J}% +\else + \Msg{% + ******************************************^^J% + * Using Configuration file docstrip.cfg. *^^J% + ******************************************^^J}% + \closein\inputcheck + \afterfi{\@@input docstrip.cfg\relax} +\fi +% \end{macrocode} +% +% Now run |\@setwritedir| in case it has not already been run +% by a command in a configuration file. +% \begin{macrocode} +\@setwritetodir +% \end{macrocode} +% +% \begin{macro}{\process@first@batchfile} +% \changes{2.4d}{1996/10/17} +% {Macro added (DPC)} +% Process the batch file, and then terminate cleanly. +% This may be set to |\relax| for `new style' batch files that +% do not start with |\def\batchfile{|\ldots +% \begin{macrocode} +\def\process@first@batchfile{% + \processbatchFile + \ifnum\NumberOfFiles=\z@ + \interactive + \fi + \endbatchfile} +% \end{macrocode} +% \end{macro} +% +% \begin{macro}{\endbatchfile} +% \changes{2.4d}{1996/10/17} +% {Macro added (DPC)} +% User level command to end batch file processing. +% At the top level, returns totals and then stops \TeX. +% At nested levels just does |\endinput|. +% \begin{macrocode} +\def\endbatchfile{% + \iftopbatchfile +%<*stats> + \ReportTotals +% + \expandafter\end + \else + \endinput + \fi} +% \end{macrocode} +% \end{macro} +% +% Now we see whether to process a batch file. +% \changes{2.4d}{1996/10/17} +% {Move default batchfile check to outer level (DPC)} +% +% +% \begin{macro}{\@jobname} +% \changes{2.4d}{1996/10/17} +% {Macro added (DPC)} +% Jobname (catcode 12) +% \begin{macrocode} +\edef\@jobname{\lowercase{\def\noexpand\@jobname{\jobname}}}% +\@jobname +% \end{macrocode} +% \end{macro} +% +% +% \begin{macro}{\@docstrip} +% \changes{2.4d}{1996/10/17} +% {Macro added (DPC)} +% docstrip (catcode 12) +% \begin{macrocode} +\def\@docstrip{docstrip}% +\edef\@docstrip{\expandafter\strip@meaning\meaning\@docstrip} +% \end{macrocode} +% \end{macro} +% +% First check whether the user has +% defined the control sequence |\batchfile|. If he did, it should +% contain the name of the file to process. +% If he didn't, try the current file, unless that is |docstrip.tex| +% in which case a default name is tried. +% Whether or not the default batch file is used is +% remembered by setting the switch |\ifDefault| to \meta{true} or +% \meta{false}. +% \begin{macrocode} +\Defaultfalse +% \end{macrocode} +% +% \begin{macrocode} +\ifx\undefined\batchfile +% \end{macrocode} +% |\@jobname| is lowercase jobname (catcode 12)\\ +% |\@docstrip| is docstrip (catcode 12) +% \begin{macrocode} + \ifx\@jobname\@docstrip +% \end{macrocode} +% Set the batchfile to the default +% \begin{macrocode} + \let\batchfile\DefaultbatchFile + \Defaulttrue +% \end{macrocode} +% Else don't process a new batchfile, just carry on with past the end +% of this file. In this case processing will move to the initial +% batchfile which \emph{must} then be terminated by |\endbatchfile| or +% \TeX\ will fall to the star prompt. +% \begin{macrocode} + \else + \let\process@first@batchfile\relax + \fi +\fi +\process@first@batchfile +% \end{macrocode} +% +% \begin{macrocode} +% +% \end{macrocode} +% +% \Finale +\endinput diff --git a/Master/texmf-dist/source/latex/base/docstrip.ins b/Master/texmf-dist/source/latex/base/docstrip.ins new file mode 100644 index 00000000000..90239d90df0 --- /dev/null +++ b/Master/texmf-dist/source/latex/base/docstrip.ins @@ -0,0 +1,126 @@ +%% +%% This file will generate fast loadable files and documentation +%% driver files from the doc files in this package when run through +%% LaTeX or TeX. +%% +%% Copyright 1993 1994 1995 1996 1997 1998 1999 2000 2001 2002 2003 2004 +%% The LaTeX3 Project and any individual authors listed elsewhere +%% in this file. +%% +%% This file is part of the LaTeX base system. +%% ------------------------------------------- +%% +%% It may be distributed and/or modified under the +%% conditions of the LaTeX Project Public License, either version 1.3 +%% of this license or (at your option) any later version. +%% The latest version of this license is in +%% http://www.latex-project.org/lppl.txt +%% and version 1.3 or later is part of all distributions of LaTeX +%% version 2003/12/01 or later. +%% +%% This file has the LPPL maintenance status "maintained". +%% +%% In particular, NO PERMISSION is granted to modify the contents of this +%% file since it contains the legal notices that are placed in the files +%% it generates. +%% +%% The list of all files belonging to the LaTeX base distribution is +%% given in the file `manifest.txt'. See also `legal.txt' for additional +%% information. +%% +%% +%% +%% +%% --------------- start of docstrip commands ------------------ +%% +% If the top level file is docstrip.ins, most TeXs set \jobname to +% docstrip which would make docstrip program think it should run +% in interactive mode. So redefine \jobname in this install file. + +\let\jobname\relax +\input docstrip.dtx + +\preamble + +This is a generated file. + +Copyright 1993 1994 1995 1996 1997 1998 1999 2000 2001 2002 2003 2004 +The LaTeX3 Project and any individual authors listed elsewhere +in this file. + +This file was generated from file(s) of the LaTeX base system. +-------------------------------------------------------------- + +It may be distributed and/or modified under the +conditions of the LaTeX Project Public License, either version 1.3 +of this license or (at your option) any later version. +The latest version of this license is in + http://www.latex-project.org/lppl.txt +and version 1.3 or later is part of all distributions of LaTeX +version 2003/12/01 or later. + +This file has the LPPL maintenance status "maintained". + +This file may only be distributed together with a copy of the LaTeX +base system. You may however distribute the LaTeX base system without +such generated files. + +The list of all files belonging to the LaTeX base distribution is +given in the file `manifest.txt'. See also `legal.txt' for additional +information. + +The list of derived (unpacked) files belonging to the distribution +and covered by LPPL is defined by the unpacking scripts (with +extension .ins) which are part of the distribution. +\endpreamble + + + +\declarepostamble\istpost +\endpostamble + +\keepsilent + +% programs and packages + +\usedir{tex/latex/base} + +\generate{\file{docstrip.tex}{\from{docstrip.dtx}{initex,program,stats}} + } + + +\generate{\file{doc.sty}{\from{doc.dtx}{package}} + \file{shortvrb.sty}{\from{doc.dtx}{shortvrb}} + \usepostamble\istpost + \file{gind.ist}{\from{doc.dtx}{gind}} + \file{gglo.ist}{\from{doc.dtx}{gglo}} + } + +\generate{\file{ltxdoc.cls}{\from{ltxdoc.dtx}{class}} + } + +\ifToplevel{ +\Msg{***********************************************************} +\Msg{*} +\Msg{* To finish the installation you have to move the following} +\Msg{* files into a directory searched by TeX:} +\Msg{*} +\Msg{* \space\space doc.sty} +\Msg{* \space\space shortvrb.sty} +\Msg{* \space\space docstrip.tex} +\Msg{*} +\Msg{* Also move the following files into a directory searched} +\Msg{* by MakeIndex:} +\Msg{*} +\Msg{* \space\space gind.ist} +\Msg{* \space\space gglo.ist} +\Msg{*} +\Msg{* To produce the documentation run the files ending with} +\Msg{* `.dtx' through LaTeX.} +\Msg{*} +\Msg{* Happy TeXing} +\Msg{***********************************************************} +} + + +\endbatchfile diff --git a/Master/texmf-dist/source/latex/base/ec.ins b/Master/texmf-dist/source/latex/base/ec.ins new file mode 100644 index 00000000000..58235d5d6fc --- /dev/null +++ b/Master/texmf-dist/source/latex/base/ec.ins @@ -0,0 +1,130 @@ +%% +%% This file will generate fast loadable files and documentation +%% driver files from the doc files in this package when run through +%% LaTeX or TeX. +%% +%% Copyright 1993 1994 1995 1996 1997 1998 1999 2000 2001 2002 2003 2004 +%% The LaTeX3 Project and any individual authors listed elsewhere +%% in this file. +%% +%% This file is part of the LaTeX base system. +%% ------------------------------------------- +%% +%% It may be distributed and/or modified under the +%% conditions of the LaTeX Project Public License, either version 1.3 +%% of this license or (at your option) any later version. +%% The latest version of this license is in +%% http://www.latex-project.org/lppl.txt +%% and version 1.3 or later is part of all distributions of LaTeX +%% version 2003/12/01 or later. +%% +%% This file has the LPPL maintenance status "maintained". +%% +%% In particular, NO PERMISSION is granted to modify the contents of this +%% file since it contains the legal notices that are placed in the files +%% it generates. +%% +%% The list of all files belonging to the LaTeX base distribution is +%% given in the file `manifest.txt'. See also `legal.txt' for additional +%% information. +%% +%% +%% +%% +%% --------------- start of docstrip commands ------------------ +%% + +\input docstrip + +\preamble + +This is a generated file. + +Copyright 1993 1994 1995 1996 1997 1998 1999 2000 2001 2002 2003 2004 +The LaTeX3 Project and any individual authors listed elsewhere +in this file. + +This file was generated from file(s) of the LaTeX base system. +-------------------------------------------------------------- + +It may be distributed and/or modified under the +conditions of the LaTeX Project Public License, either version 1.3 +of this license or (at your option) any later version. +The latest version of this license is in + http://www.latex-project.org/lppl.txt +and version 1.3 or later is part of all distributions of LaTeX +version 2003/12/01 or later. + +This file may only be distributed together with a copy of the LaTeX +base system. You may however distribute the LaTeX base system without +such generated files. + +The list of all files belonging to the LaTeX base distribution is +given in the file `manifest.txt'. See also `legal.txt' for additional +information. + +In particular, permission is granted to customize the declarations in +this file to serve the needs of your installation. + +However, NO PERMISSION is granted to distribute a modified version +of this file under its original name. + +\endpreamble + +\keepsilent +\usedir{tex/latex/base} + +\Msg{*** Generating font defs for Cork encoded + and Text Companion fonts ***} + +\generate{ + \file{t1cmfib.fd}{ + \from{cmfonts.fdd}{fd,T1cmfib,ec}} + \file{t1cmfr.fd}{ + \from{cmfonts.fdd}{fd,T1cmfr,ec}} + \file{t1cmdh.fd}{ + \from{cmfonts.fdd}{fd,T1cmdh,ec}} + \file{t1cmr.fd}{ + \from{cmfonts.fdd}{fd,T1cmr,ec}} + \file{t1cmss.fd}{ + \from{cmfonts.fdd}{fd,T1cmss,ec}} + \file{t1cmtt.fd}{ + \from{cmfonts.fdd}{fd,T1cmtt,tt,ec,nowarn}} + \file{t1cmvtt.fd}{ + \from{cmfonts.fdd}{fd,T1cmvtt,tt,ec}} + \file{ts1cmr.fd}{ + \from{cmfonts.fdd}{fd,TS1cmr,ec}} + \file{ts1cmss.fd}{ + \from{cmfonts.fdd}{fd,TS1cmss,ec}} + \file{ts1cmtt.fd}{ + \from{cmfonts.fdd}{fd,TS1cmtt,ec,tt}} + \file{ts1cmvtt.fd}{ + \from{cmfonts.fdd}{fd,TS1cmvtt,ec,tt}} +} + + +\generate{ + \file{t1lcmss.fd}{ + \from{slifonts.fdd}{lcmss,fd,ec}} + \file{t1lcmtt.fd}{ + \from{slifonts.fdd}{lcmtt,fd,ec}} + } + + + +\ifToplevel{ +\Msg{***********************************************************} +\Msg{*} +\Msg{* To finish the installation you have to move the following} +\Msg{* files into a directory searched by TeX:} +\Msg{*} +\Msg{* \space\space All *.fd} +\Msg{*} +\Msg{* To produce the documentation run the files ending with} +\Msg{* `.fdd' through LaTeX.} +\Msg{*} +\Msg{* Happy TeXing} +\Msg{***********************************************************} +} + +\endbatchfile diff --git a/Master/texmf-dist/source/latex/base/exscale.dtx b/Master/texmf-dist/source/latex/base/exscale.dtx new file mode 100644 index 00000000000..8728a43a87d --- /dev/null +++ b/Master/texmf-dist/source/latex/base/exscale.dtx @@ -0,0 +1,183 @@ +% \iffalse meta-comment +% +% Copyright 1993 1994 1995 1996 1997 1998 1999 2000 2001 2002 2003 2004 +% The LaTeX3 Project and any individual authors listed elsewhere +% in this file. +% +% This file is part of the LaTeX base system. +% ------------------------------------------- +% +% It may be distributed and/or modified under the +% conditions of the LaTeX Project Public License, either version 1.3 +% of this license or (at your option) any later version. +% The latest version of this license is in +% http://www.latex-project.org/lppl.txt +% and version 1.3 or later is part of all distributions of LaTeX +% version 2003/12/01 or later. +% +% This file has the LPPL maintenance status "maintained". +% +% The list of all files belonging to the LaTeX base distribution is +% given in the file `manifest.txt'. See also `legal.txt' for additional +% information. +% +% The list of derived (unpacked) files belonging to the distribution +% and covered by LPPL is defined by the unpacking scripts (with +% extension .ins) which are part of the distribution. +% +% \fi +% \iffalse +%%% File: exscale.dtx +%% Copyright (C) 1992-1997 Frank Mittelbach and Rainer Sch\"opf, +%% all rights reserved. +%\NeedsTeXFormat{LaTeX2e} +%\ProvidesPackage{exscale} +%\ProvidesFile{OMXcmex.fd} +% [1997/06/16 v2.1g +% Standard LaTeX package exscale] +% exscale package font definitions] +%<*driver> +\documentclass{ltxdoc} +\usepackage{exscale} +\GetFileInfo{exscale.sty} +\begin{document} +\title{The \texttt{exscale} package\thanks + {This file has version number \fileversion, dated \filedate.}\\ + for use with \LaTeX2e} +\author{Frank Mittelbach \and Rainer Sch\"opf} +\date{\filedate} + \maketitle + \DocInput{exscale.dtx} +\end{document} +% +% \fi +% +% \CheckSum{39} +% +% \changes{v2.1g}{1997/06/16}{Documentation fix.} +% \changes{v2.1d}{1994/05/09}{Added setting \cs{big}... sizes.} +% \changes{v2.1c}{1994/05/08}{Changed to new documentation standards.} +% \changes{v2.1a}{1993/12/12}{Update for \LaTeXe} +% +% \def\MF{\textsf{Metafont}} +% \def\dst{{\normalfont\scshape docstrip}} +% +% +% \section{Introduction} +% +% On popular request, this package implements scaling of the +% math extension font `cmex'. If this package is used the site needs +% scaled versions of the \texttt{cmex10} in the sizes 10.95pt, 12pt, +% 14.4pt , 17.28pt, 20.74pt, and 24.88pt which corresponds to standard +% magsteps using |\magstephalf|, and |\magstep1| through |\magstep5|. +% Additionally `cmex' variants for the sizes 7pt to 9pt are necessary. +% These fonts are part of the AMS font package and can be found on +% many servers. +% +% We don't think that using a scalable `cmex' font improves the +% appearance of the document very much because the linear scaling of +% the font introduces changes to font dimen parameters of the font +% that are used all over the place in \TeX's math placement routines +% and definitely shouldn't be scaled linearly. As a positive result, +% however, symbols from this font will come out in approximately the +% right size when used with a large basis font size. +% +% We therefore strongly recommend the generation of designed fonts for +% the larger sizes and hope that the corresponding \MF{} sources will +% be available in the near future. +% +% +% \section{Usage} +% +% This file can be used either as a package by placing its name +% in the argument of +% |\usepackage|, or by generating from it a |.fd| file which then +% replaces the normally used |.fd| file |OMXcmex.fd|. +% +% For the second solution you should prepare a small \dst{} command +% file containing the following statements: +% \begin{quote} +% |\def\batchfile{|\meta{name-of-your-command-file}|}| \\ +% |\input docstrip.tex| \\ +% |\generateFile{OMXcmex.fd}{t}{\from{exscale.dtx}{fd}}| +% \end{quote} +% and then run this file through \LaTeX. +% This would mean however, that your documents may look different if +% they are printed on another installation whereas when using the +% package file they would come out the same on both sites. +% +% \StopEventually{} +% +% +% \section{Implementation} +% +% +% In case this should produce a font definition file we write +% a message to the transcript file only. +% The explicit spaces are necessary in an +% |.fd| file and the |\string| guards against situations where |`|, +% |<| or |>| is active. +% \changes{v2.1f}{1995/11/27}{Use \cs{ProvidesFile}} +% \begin{macrocode} +%\ProvidesFile{OMXcmex.fd}[]% moved to top of the file +% \end{macrocode} +% +% We now define to which external fonts the font/shape Computer Modern +% Extension Medium Normal. For the sizes 7--10pt we use fonts that are +% designed for the corresponding size and for the higher sizes we use +% scaled versions of the 10pt font since for these sizes no designed +% fonts are easily available. +% \begin{macrocode} +%<*fd|package> +\DeclareFontShape{OMX}{cmex}{m}{n}{% +% \end{macrocode} +% According to Michael Downes `cmex5' and `cmex6' are not +% distributed currently. Therefore we use `cmex7' in those size but +% we omit a warning. +% \begin{macrocode} + <-8>sfixed * cmex7 + <8> cmex8 + <9> cmex9 + <10> <10.95> <12> <14.4> <17.28> <20.74> <24.88>cmex10 + }{} +% +% \end{macrocode} +% +% We also redeclare the symbol font for large symbols. This is +% already done when the base format also uses CM math fonts, but it +% doesn't hurt either. +% \begin{macrocode} +%<*package> +\DeclareSymbolFont{largesymbols}{OMX}{cmex}{m}{n} +% \end{macrocode} +% +% Finally we redefine the primitive commands |\big|, |\Big|, |\bigg| +% and |\Bigg| to change size with main size changes. To this end we +% need a new dimen register |\big@size|. +% \begin{macrocode} +\newdimen\big@size +% \end{macrocode} +% This dimen is set with every size change to $1.2$ times the height +% of a left parenthesis. +% \changes{v2.1e}{1994/11/06}{Renamed \cs{every@size} to +% \cs{every@math@size}} +% \changes{v2.1e}{1994/11/06}{Update \cs{big@size} globally} +% \begin{macrocode} +\addto@hook\every@math@size{\setbox\z@\vbox{\hbox{$($}\kern\z@}% + \global\big@size 1.2\ht\z@} +% \end{macrocode} +% Now we can define the macros. Note: |\n@space| sets the internal +% variables |\nulldelimiterspace| and |\mathsurropund| to zero length. +% \begin{macrocode} +\def\bBigg@#1#2{% + {\hbox{$\left#2\vcenter to#1\big@size{}\right.\n@space$}}} +\def\big{\bBigg@\@ne} +\def\Big{\bBigg@{1.5}} +\def\bigg{\bBigg@\tw@} +\def\Bigg{\bBigg@{2.5}} +% +% \end{macrocode} +% +% \Finale +% +\endinput diff --git a/Master/texmf-dist/source/latex/base/exscale.ins b/Master/texmf-dist/source/latex/base/exscale.ins new file mode 100644 index 00000000000..04ac8b87ec3 --- /dev/null +++ b/Master/texmf-dist/source/latex/base/exscale.ins @@ -0,0 +1,95 @@ +%% +%% This file will generate fast loadable files and documentation +%% driver files from the doc files in this package when run through +%% LaTeX or TeX. +%% +%% Copyright 1993 1994 1995 1996 1997 1998 1999 2000 2001 2002 2003 2004 +%% The LaTeX3 Project and any individual authors listed elsewhere +%% in this file. +%% +%% This file is part of the LaTeX base system. +%% ------------------------------------------- +%% +%% It may be distributed and/or modified under the +%% conditions of the LaTeX Project Public License, either version 1.3 +%% of this license or (at your option) any later version. +%% The latest version of this license is in +%% http://www.latex-project.org/lppl.txt +%% and version 1.3 or later is part of all distributions of LaTeX +%% version 2003/12/01 or later. +%% +%% This file has the LPPL maintenance status "maintained". +%% +%% In particular, NO PERMISSION is granted to modify the contents of this +%% file since it contains the legal notices that are placed in the files +%% it generates. +%% +%% The list of all files belonging to the LaTeX base distribution is +%% given in the file `manifest.txt'. See also `legal.txt' for additional +%% information. +%% +%% +%% +%% +%% --------------- start of docstrip commands ------------------ +%% + +\input docstrip + +\preamble + +This is a generated file. + +Copyright 1993 1994 1995 1996 1997 1998 1999 2000 2001 2002 2003 2004 +The LaTeX3 Project and any individual authors listed elsewhere +in this file. + +This file was generated from file(s) of the LaTeX base system. +-------------------------------------------------------------- + +It may be distributed and/or modified under the +conditions of the LaTeX Project Public License, either version 1.3 +of this license or (at your option) any later version. +The latest version of this license is in + http://www.latex-project.org/lppl.txt +and version 1.3 or later is part of all distributions of LaTeX +version 2003/12/01 or later. + +This file has the LPPL maintenance status "maintained". + +This file may only be distributed together with a copy of the LaTeX +base system. You may however distribute the LaTeX base system without +such generated files. + +The list of all files belonging to the LaTeX base distribution is +given in the file `manifest.txt'. See also `legal.txt' for additional +information. + +The list of derived (unpacked) files belonging to the distribution +and covered by LPPL is defined by the unpacking scripts (with +extension .ins) which are part of the distribution. +\endpreamble + +\keepsilent +\usedir{tex/latex/base} + +\generateFile{exscale.sty}{t}{% + \from{exscale.dtx}{package}} + + +\ifToplevel{ +\Msg{***********************************************************} +\Msg{*} +\Msg{* To finish the installation you have to move the following} +\Msg{* files into a directory searched by TeX:} +\Msg{*} +\Msg{* \space\space exscale.sty} +\Msg{*} +\Msg{* To produce the documentation run the files ending with} +\Msg{* `.dtx' through LaTeX2e.} +\Msg{*} +\Msg{* Happy TeXing} +\Msg{***********************************************************} +} + +\endbatchfile diff --git a/Master/texmf-dist/source/latex/base/fixltx2e.dtx b/Master/texmf-dist/source/latex/base/fixltx2e.dtx new file mode 100644 index 00000000000..a55e295fcac --- /dev/null +++ b/Master/texmf-dist/source/latex/base/fixltx2e.dtx @@ -0,0 +1,1791 @@ +% \iffalse meta-comment +% +% Copyright 1993 1994 1995 1996 1997 1998 1999 2000 2001 2002 2003 2004 +% The LaTeX3 Project and any individual authors listed elsewhere +% in this file. +% +% This file is part of the LaTeX base system. +% ------------------------------------------- +% +% It may be distributed and/or modified under the +% conditions of the LaTeX Project Public License, either version 1.3 +% of this license or (at your option) any later version. +% The latest version of this license is in +% http://www.latex-project.org/lppl.txt +% and version 1.3 or later is part of all distributions of LaTeX +% version 2003/12/01 or later. +% +% This file has the LPPL maintenance status "maintained". +% +% The list of all files belonging to the LaTeX base distribution is +% given in the file `manifest.txt'. See also `legal.txt' for additional +% information. +% +% The list of derived (unpacked) files belonging to the distribution +% and covered by LPPL is defined by the unpacking scripts (with +% extension .ins) which are part of the distribution. +% +% \fi +% +% \iffalse +% +%<*dtx> + \ProvidesFile{fixltx2e.dtx} +% +%\NeedsTeXFormat{LaTeX2e} +%\ProvidesPackage{fixltx2e} +%\ProvidesPackage{fix-cm} +%\ProvidesFile{fixltx2e.drv} +% \fi +% \ProvidesFile{fixltx2e.dtx} + [2004/02/13 v1.1h fixes to LaTeX] +% +% \iffalse +%<*driver> + \documentclass{ltxdoc} + \newcommand\Lopt[1]{\textsf{#1}} + \let\Lpack\Lopt + \providecommand{\file}[1]{\texttt{#1}} + \providecommand{\MF}{\textsf{Metafont}} + \providecommand{\danger}{\marginpar[\hfill\protect\Huge!!]{\protect\Huge!!\hfill}} + \begin{document} + \DocInput{fixltx2e.dtx} + \end{document} +% +% \fi +% +% \CheckSum{896} +% +%% \CharacterTable +%% {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 +%% 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 +%% Digits \0\1\2\3\4\5\6\7\8\9 +%% Exclamation \! Double quote \" Hash (number) \# +%% Dollar \$ Percent \% Ampersand \& +%% Acute accent \' Left paren \( Right paren \) +%% Asterisk \* Plus \+ Comma \, +%% Minus \- Point \. Solidus \/ +%% Colon \: Semicolon \; Less than \< +%% Equals \= Greater than \> Question mark \? +%% Commercial at \@ Left bracket \[ Backslash \\ +%% Right bracket \] Circumflex \^ Underscore \_ +%% Grave accent \` Left brace \{ Vertical bar \| +%% Right brace \} Tilde \~} +% +% +% +% \let\package\textsf +% +% +% \GetFileInfo{fixltx2e.dtx} +% +% \title{The \Lpack{fixltx2e} and \Lpack{fix-cm} packages\thanks{This file +% has version number \fileversion, last +% revised \filedate.}} +% \author{Frank Mittelbach, David Carlisle, Chris Rowley, Walter +% Schmidt\thanks{Walter wrote \Lpack{fix-cm}}} +% \date{\filedate} +% \maketitle +% +% \begin{abstract} +% These packages provides fixes to \LaTeXe{} which are desirable +% but cannot be integrated into the \LaTeXe{} kernel or the +% font definition files directly as they would produce a version +% incompatible to earlier releases (either in formatting or +% functionality). +% +% By providing these fixes in the form of packages, users can benefit +% from them without the danger that their documents will fail or +% produce unexpected results at other sites since the documents +% contain a clear indication (the |\usepackage| line, preferably +% with a required date) that the fixes are needed. +% \end{abstract} +% +% \tableofcontents +% +% \newpage +% +% \section{Introduction} +% +% In the newsletter \texttt{ltnews07.tex}, which accompanied the +% \LaTeXe{} maintenance release of June 1997, we wrote: +% \begin{quote} +% Many of the problem reports we receive concerning the standard +% classes are not concerned with bugs but are suggesting, more or +% less politely, that the design decisions embodied in them are +% `not optimal' and asking us to modify them. +% +% There are several reasons why we have decided not to make such +% changes to these files. +% \begin{itemize} +% \item However misguided, the current behaviour is clearly what +% was intended when these classes were designed. \item It is not +% good practice to change such aspects of `standard classes' +% because many people will be relying on them. +% \end{itemize} +% +% We have therefore decided not to even consider making such +% modifications, nor to spend time justifying that decision. This +% does not mean that we do not agree that there are many +% deficiencies in the design of these classes, but we have many +% tasks with higher priority than continually explaining why the +% standard classes for \LaTeX{} cannot be changed. +% \end{quote} +% +% Back then we probably should have said that this decision also +% covers changes to the \LaTeX{} kernel and font definitions, +% if the change results in +% noticeable differences in the formatting of documents or otherwise +% produces severe incompatibilities between releases. The important +% point to stress here is that ``people rely on the fact that a +% document formatted at one site produces identical output at a +% different site''. By fixing a certain problem in version +% \meta{date}, people making use of the fix will get incorrectly +% formatted documents if they send them to others who still run on a +% version prior to \meta{date}. +% +% In theory one could get around this by adding a line like +% \begin{quote} +% |\NeedsTeXFormat{latex2e}[|\meta{date}|]| +% \end{quote} +% on top of the document. However, this fails for two reasons. Firstly, +% most people will not be aware that they make use of a feature or fix +% that is only available in their version of \LaTeX{}; and thus do not +% add such a line in their documents. Secondly, even if there is such a +% line the receiving site might not be able to upgrade their \LaTeX{} +% in time to process the document properly (the latter is a sad fact +% of life). +% +% By providing the \Lpack{fixltx2e} and \Lpack{fix-cm} packages +% we hope to help people in this respect since, when they +% are used, a document will contain a clear +% indication that special features/fixes are needed and if the +% receiving site does not have the packages available (or not available +% with the right version) it is far easier to download and install them +% from some archive than to upgrade \LaTeX{} in a rush. +% +% The packages are independent from each other and deal with different +% subjects: +% \Lpack{fixltx2e} provides general changes to the \LaTeX{} kernel, +% while \Lpack{fix-cm} improves the definitions of the Computer Modern +% font families. +% +% We will try to maintain the packages in such a way that they can be used +% with all maintenance releases of \LaTeXe{} so that, if urgently +% needed, people can simply add them to the current directory in case +% they cannot upgrade their \LaTeX{} for whatever reason. +% +% The packages are \textbf{NOT} provided so that people can stop +% upgrading their \LaTeX{} system. They will contain only fixes of a +% certain nature, others will still go into the kernel and extensions +% in form of packages, and support files will still be added to the +% base system at regular intervals. +% +% +% \subsection{Using \Lpack{fixltx2e}} +% +% To use the \Lpack{fixltx2e} package include the line +% \begin{quote} +% |\usepackage{fixltx2e}[|\meta{date}|]| +% \end{quote} +% into the preamble of your document, where \meta{date} is the date of +% the \Lpack{fixltx2e} package that you are using. +% This way your document will produce a warning if processed at a site +% that only has an older version of of this package. +% +% \subsection{Using \Lpack{fix-cm}} +% +% \begin{sloppypar} +% To use the \Lpack{fix-cm} package, +% load \danger it \emph{before} \cmd{\documentclass}, +% and use the command \cmd{\RequirePackage} to do so, rather than the +% normal \cmd{\usepackage}: +% \end{sloppypar} +% \begin{verse} +% |\RequirePackage{fix-cm}|\\ +% |\documentclass| \dots +% \end{verse} +% \textbf{Do not to load any other package before the document class}, +% unless you have a thorough understanding of the \LaTeX{} internals +% and know exactly what you are doing! +% +% +% \section{Fixes added} +% +% This section describes all the fixes/features that have been added +% to the initial release of the package. If applicable the bug report +% info (see \texttt{bugs.txt}) is given. +% +% +% +% +% \subsection{2-col: 1-col fig can come before earlier 2-col fig +% (pr/2346)} +% +%\begin{verbatim} +% >Number: 2346 +% >Category: latex +% >Synopsis: 2-col: 1-col fig can come before earlier 2-col fig +% >Arrival-Date: Wed Dec 18 15:41:07 1996 +% >Originator: w.l.kleb@larc.nasa.gov (bil kleb) +% >Description: +% as documented in lamport's book, p. 198, concerning figure +% placement, "a figure will not be printed before an earlier +% figure, and a table will not be printed before an earlier +% table." however, there is a footnote stating, "However, +% in two-column page style, a single-column figure can come before +% an earlier double-column figure, and vice versa." +% +% this twocolumn behavior is undesireable---at least by me and +% most professional organizations i publish in. ed snyzter developed +% a hack fix for 2.09 several years ago which links the two +% counters, but i have not run across a similar "fix" for 2e... +% \end{verbatim} +% +% Originally fixed in package \Lpack{fix2col} which was merged into +% this package. Documentation and code from this package have been +% merged into this file. +% +% \subsubsection{Notes on the Implementation Strategy} +% +% The standard output routine maintains two lists of floats that have +% been `deferred' for later consideration. One list for single column +% floats, and one for double column floats (which are always +% immediately put onto their deferred list). This mechanism means +% that \LaTeX\ `knows' which type of float is contained in each box +% by the list that it is processing, but having two lists means +% that there is no mechanism for preserving the order between the +% floats in each list. +% +% The solution to this problem consists of two small changes to +% the output routine. +% +% Firstly, abandon the `double column float list' |\@dbldeferlist| +% and change every command where it is used so that instead the +% same |\@deferlist| is used as for single column floats. +% That one change ensures that double and single column floats +% stay in the same sequence, but as \LaTeX\ no longer `knows' +% whether a float is double or single column, it will happily +% insert a double float into a single column, overprinting the +% other column, or the margin. +% +% The second change is to provide an alternative mechanism for +% recording the two column floats. \LaTeX\ already has a compact +% mechanism for recording float information, an integer count register +% assigned to each float records information about the `type' of float +% `figure', `table' and the position information `htp' etc. +% +% The type information is stored in the `high' bits, one bit position +% (above `32') allocated to each float type. The `low' bits store +% information about the allowed positions, one bit each allocated for +% |h t b p|. In the \LaTeX2.09 system, the bit corresponding to `16' +% formed a `boundary' between these two sets of information, and it +% was never actually used by the system. Ed Sznyter's +% \package{fixfloats} package not unreasonably used this position to +% store the double column information, setting the bit for double +% column floats. Then at each point in the output routine at which a +% float is committed to a certain region, an additional check must be +% made to check that the float is (or is not) double column. If it +% spans the wrong number of columns it is deferred rather than being +% added. +% +% Unfortunately the bit `16' is not available in \LaTeXe. It is used +% to encode the extra float position possibility `|!|' that was added +% in that system. It would be possible to use position `32' and to +% move the flags for `table', `figure',\ldots\ up one position, to +% start at 64, but this would mean that in principle one less float +% type would be supported, and more importantly is likely to break +% any other packages that assume anything about the output routine +% internals. So here I instead use another mechanism for flagging +% double column floats: By default all floats have depth 0pt. +% This package arranges that double column ones have depth 1sp. +% This information may then be used in the same manner as in +% the \package{fixfloats} package, to defer any floats that are not of +% the correct column spanning type. +% +% +% +% \subsection{Wrong header for twocolumn (pr/2613)} +% +%\begin{verbatim} +% >Number: 2613 +% >Category: latex +% >Synopsis: wrong headline for twocolumn +% >Arrival-Date: Mon Sep 22 16:41:09 1997 +% >Originator: daniel@cs.uni-bonn.de (Daniel Reischert) +% >Description: +% When setting the document in two columns +% the headline shows the top mark of the second column, +% but it should show the top mark of the first column. +% \end{verbatim} +% +% Originally fixed in package \Lpack{fix2col} which was merged into +% this package. Documentation and code from this package have been +% merged into this file. +% +% \subsubsection{Notes on the Implementation Strategy} +% +% The standard \LaTeX\ twocolumn system works internally by making +% each column a separate `page' that is passed independently to \TeX's +% pagebreaker. (Unlike say the \package{multicol} package, where all +% columns are gathered together and then split into columns later, +% using |\vsplit|.) This means that the primitive \TeX\ marks that are +% normally used for header information, are globally reset after the +% first column. By default \LaTeX\ does nothing about this. +% A good solution is provided by Piet van Oostrum (building on earlier +% work of Joe Pallas) in his \package{fixmarks} package. +% +% After the first column box has been collected the mark information +% for that box is saved, so that any |\firstmark| can be +% `artificially' used to set the page-level marks after the second +% column has been collected. (The second column |\firstmark| is not +% normally required.) Unfortunately \TeX\ does not provide a direct +% way of knowing if any marks are in the page, |\firstmark| always has a +% value from previous pages, even if there is no mark in this page. +% The solution is to make a copy of the box and then |\vsplit| it +% so that any marks show up as |\splitfirstmark|. +% +% The use of |\vsplit| does mean that the output routine will globally +% change the value of |\splitfirstmark| and +% |\splitbotmark|. The \package{fixmarks} package goes to some trouble +% to save and restore these values so that the output routine does +% \emph{not} change the values. This part of \package{fixmarks} is not +% copied here as it is quite costly (having to be run on every page) and +% there is no reason why anyone writing code using |\vsplit| should +% allow the output routine to be triggered before the split marks have +% been accessed. +% +% +% \subsection{\texttt{\textbackslash @} discards spaces when moving +% (pr/3039)} +% +%\begin{verbatim} +% >Number: 3039 +% >Category: latex +% >Synopsis: \@ discards spaces when moving +% >Arrival-Date: Sat May 22 09:01:06 1999 +% >Originator: asnd@triumf.ca (Donald Arseneau) +% >Description: +% The \@ command expands to \spacefactor\@m in auxiliary files, +% which then ignores following spaces when it is reprocessed. +%\end{verbatim} +% +% \subsection{\texttt{\textbackslash setlength} produces error if +% used with registers like \texttt{\textbackslash dimen0} (pr/3066)} +% +%\begin{verbatim} +% >Number: 3066 +% >Category: latex +% >Synopsis: \setlength{\dimen0}{10pt} +% >Arrival-Date: Tue Jul 6 15:01:06 1999 +% >Originator: oberdiek@ruf.uni-freiburg.de (Heiko Oberdiek) +% >Description: +% The current implementation of \setlength causes an error, +% because the length specification isn't terminated properly. +% More safe: +% \def\setlength#1#2{#1=#2\relax} +%\end{verbatim} +% +% \subsection{\texttt{\textbackslash addpenalty} ruins flush-bottom (pr/3073)} +% +%\begin{verbatim} +% >Number: 3073 +% >Category: latex +% >Synopsis: \addpenalty ruins flush-bottom +% >Arrival-Date: Sat Jul 17 05:11:05 1999 +% >Originator: asnd@triumf.ca (Donald Arseneau) +% >Description: +% Just to keep in mind for further development eh? +% A page break at an \addpenalty after \vspace does *not* +% give a flush-bottom page. (The intent of \addpenalty is +% apparently just to preserve the flush bottom by putting +% the breakpoint `above' the skip.) +%\end{verbatim} +% +% +% +% \section{Fixes added for 2003/06/01} +% +% \subsection{\texttt{\textbackslash fnsymbol} should use text symbols +% if possible (pr/3400)} +% +%\begin{verbatim} +% >Number: 3400 +% >Category: latex +% >Synopsis: \fnsymbol should use text symbols if possible +% >Arrival-Date: Fri Jan 04 20:41:00 CET 2002 +% >Originator: was@VR-Web.de ( Walter Schmidt ) +% +% The \fnsymbol command can be used in both text and math +% mode. The symbols produced are, however, always taken from +% the math fonts. As a result, they may not match the text +% fonts, even if the symbols are actually available, for +% instance from the TS1 encoding. Since \fnsymbol is +% primarily used for footnotes in text, this should be fixed, +% IMO. +%\end{verbatim} +% +% +% \subsection{No hyphenation in first word after float environment(pr/3498)} +% +%\begin{verbatim} +% >Number: 3498 +% >Category: latex +% >Synopsis: No hyphenation in first word after float environment +% >Arrival-Date: Thu Jan 30 13:21:00 CET 2003 +% >Originator: h.harders@tu-bs.de (Harald Harders) +% +% If a float environment (figure, table) is written within a paragraph, +% the first word after the environment is not hyphenated. +%\end{verbatim} +% +% +% +% \subsection{Allowing \texttt{\textbackslash emph} to produce small +% caps, etc} +% +% By default |\em| or |\emph| switches to roman in an italic +% context but some designers prefer a switch to small caps in that +% case. This can be achieved by setting |\eminnershape|, e.g., +% +%\begin{verbatim} +%\renewcommand\eminnershape{\scshape} +%\end{verbatim} +% +% +% \subsection{Using EC fonts (T1 encoding) makes my documents look +% bl**dy horrible (from c.t.t.)\\ +% I can't use arbitrary sizes with CM fonts (from c.t.t.)} +% +% No I'm not trying to collect any cites from the news group +% discussion on this topic. In a nutshell, if one adds +%\begin{verbatim} +%\usepackage[T1]{fontenc} +%\end{verbatim} +% to a document that uses the Computer Modern typefaces, +% then not only the T1 encoding is used but the fonts +% used in the document look noticeably different. This is due to the fact +% that the EC fonts have more font series designs, e.g.\ a 14.4\,pt bold +% etc and those get used in the standard \texttt{.fd} files, while +% with Computer Modern (in OT1 encoding) such sizes were scaled +% versions of smaller sizes---with a noticeable different look and +% feel. +% +% So we provide a package \Lpack{fix-cm} to ensure that comparable +% definitions are used. In addition to that, the package +% \Lpack{fix-cm} also enables continuous scaling of the CM fonts. +% This package was written by Walter Schmidt. +% +% +% +%^^A \section{The macro package \textsf{fix-cm} for \LaTeXe} +% +%^^A The documentation in this section was prepared by Walter Schmidt. +% +% +% +% \subsubsection{What \Lpack{fix-cm} does} +% +% ^^A Are you bothered by the T1 and TS1 encoded Computer Modern fonts, +% ^^A which look partially worse than the traditional ones? Would you +% ^^A like to use the CM fonts with arbitrary sizes? If so, the macro +% ^^A package \Lpack{fix-cm} can help you. +% +% Loading the package \Lpack{fix-cm} changes the font definitions of the +% Computer Modern fonts, in order to achieve the following effects: +% \begin{itemize} +% \item +% The appearance of the T1 and TS1 encoded CM fonts (aka `EC') is +% made as similar as possible to the traditional (OT1 encoded) ones. +% Particularly, a number of broken or ugly design sizes are no +% longer used, the look of the bold sans serif typeface at large +% sizes is considerably improved, and mismatches between the text +% fonts and the corresponding math fonts are avoided. As a side +% effect, PostScript and PDF documents may become smaller, because +% fewer fonts need to be embedded. +% \item +% The Computer Modern fonts are made available with arbitrary sizes. +% \item +% Only those design sizes of the fonts will be used, that are +% normally available in Type1 format, too. You need not load the +% extra package \Lpack{cmmib57} for this purpose. +% \end{itemize} +% The package acts on the following font families: +% \begin{itemize} +% \item +% The text font families \file{cmr}, \file{cmss}, \file{cmtt} and +% \file{cmvtt} with OT1, T1 and TS1 encoding. +% \item +% The default math fonts used by \LaTeX, i.e., the font families +% \file{cmm} with encoding OML and \file{cms} with encoding OMS. +% \item +% The symbols used by the package \Lpack{latexsym}, i.e., the font +% family \file{lasy}. +% \end{itemize} +% Note that the package does \emph{not} act on: +% \begin{itemize} +% \item Font families such as CM~Fibonacci, CM~Dunhill etc., +% which are provided for experimental purposes or for fun only. +% \item +% CM text fonts with character sets other than Latin, e.g., +% Cyrillic. Loading of the required font and encoding definitions +% while the fonts are not actually used, would not be a good idea. +% This should be addressed by particular packages or by changing the +% standard FDs of these fonts. +% \item +% Extra math fonts such as the AMS symbol fonts. While +% they match the style of Computer Modern, they are frequently used +% in conjunction with other font families, too. Thus, +% \Lpack{fix-cm} is obviously not the right place to make sure that +% they can be scaled continuously. Ask the maintainers of these +% fonts to provide this feature, which is badly needed! +% \item +% The math extension font \file{cmex}. Whether or not this font +% should be scaled is a question of its own, and there are other +% packages (\Lpack{exscale}, \Lpack{amsmath}, \Lpack{amsfonts}) to +% take care of it. +% \end{itemize} +% +% \subsubsection{How to load the package} +% \begin{sloppypar} +% The package should be loaded \danger \emph{before} \cmd{\documentclass}, +% using the command |\RequirePackage{fix-cm}|, rather than the +% normal \cmd{\usepackage}. +% Rationale: +% If the package is loaded in the preamble, a preceding package or +% even the code of the document class may have used any of the CM +% fonts already. However, the definitions of those fonts, that are +% already in use, cannot be changed any more. +% \end{sloppypar} +% +% \subsubsection{Usage notes} +% In contrast to what you may expect, \Lpack{fix-cm} does \emph{not} +% ensure that line and page breaks stay the same, when you switch an +% existing document from OT1 to T1 encoding. The package does not +% turn off all of the additional design sizes in the EC fonts +% collection: Those, that contribute considerably to the typographical +% quality and do not conflict with the math fonts, +% are---indeed---used. +% +% Be careful when using arbitrary, non-standard font sizes with +% applications that need bitmap fonts: You may end up \danger with +% lots of possibly huge \file{.pk} files. Also, \MF{} chokes +% sometimes on extremely small or large sizes, because of arithmetic +% problems. +% +% \Lpack{fix-cm} supersedes the experimental packages \Lpack{cmsd} and +% \Lpack{fix-ec}, which are no longer distributed. +% +% The packages \Lpack{type1cm} and \Lpack{type1ec} must not be loaded +% additionally; they enable only continuous scaling. +% +% \StopEventually{} +% +% \section{Implementation} +% +% We require at least a somewhat sane version of \LaTeXe{}. Earlier +% ones where really quite different from one another. +% \begin{macrocode} +%<*fixltx2e> +\NeedsTeXFormat{LaTeX2e}[1996/06/01] +% \end{macrocode} +% +% +% +% \subsection{2-col: 1-col fig can come before earlier 2-col fig +% (pr/2346) \\ +% Wrong headline for twocolumn (pr/2613)} +% +% Originally fixed in package \Lpack{fix2col} which was merged into +% this package. Code and documentation are straight copies from that +% package. +% +% \subsubsection{Preserving Marks} +% +% This is just a change to the single command |\@outputdblcol| +% so that it saves mark information for the first column and restores +% it in the second column. +% \begin{macrocode} +\def\@outputdblcol{% + \if@firstcolumn + \global\@firstcolumnfalse +% \end{macrocode} +% Save the left column +% \begin{macrocode} + \global\setbox\@leftcolumn\copy\@outputbox +% \end{macrocode} +% +% Remember the marks from the first column +% \begin{macrocode} + \splitmaxdepth\maxdimen + \vbadness\maxdimen + \setbox\@outputbox\vsplit\@outputbox to\maxdimen +% \end{macrocode} +% +% One minor difference from the current \package{fixmarks}, pass the +% marks through a token register to stop any |#| tokens causing an +% error in a |\def|. +% \begin{macrocode} + \toks@\expandafter{\topmark}% + \xdef\@firstcoltopmark{\the\toks@}% + \toks@\expandafter{\splitfirstmark}% + \xdef\@firstcolfirstmark{\the\toks@}% +% \end{macrocode} +% +% This test does not work if truly empty marks have been inserted, but +% \LaTeX\ marks should always have (at least) two brace groups. +% (Except before the first mark is used, when the marks are empty, +% but that is OK here.) +% \begin{macrocode} + \ifx\@firstcolfirstmark\@empty + \global\let\@setmarks\relax + \else + \gdef\@setmarks{% + \let\firstmark\@firstcolfirstmark + \let\topmark\@firstcoltopmark}% + \fi +% \end{macrocode} +% +% End of change +% \begin{macrocode} + \else + \global\@firstcolumntrue + \setbox\@outputbox\vbox{% + \hb@xt@\textwidth{% + \hb@xt@\columnwidth{\box\@leftcolumn \hss}% + \hfil + \vrule \@width\columnseprule + \hfil + \hb@xt@\columnwidth{\box\@outputbox \hss}}}% + \@combinedblfloats +% \end{macrocode} +% Override current first and top with those of first column if necessary +% \begin{macrocode} + \@setmarks +% \end{macrocode} +% End of change +% \begin{macrocode} + \@outputpage + \begingroup + \@dblfloatplacement + \@startdblcolumn + \@whilesw\if@fcolmade \fi{\@outputpage\@startdblcolumn}% + \endgroup + \fi} +% \end{macrocode} +% +% \subsubsection{Preserving Float Order} +% +% Changes |\@dbldeferlist| to |\@deferlist| are not explicitly noted +% but are flagged by blank comment lines around the changed line. +% +% +% \begin{macrocode} +\def\end@dblfloat{% +\if@twocolumn + \@endfloatbox + \ifnum\@floatpenalty <\z@ + \@largefloatcheck +% \end{macrocode} +% +% Force the depth of two column float boxes. +% \begin{macrocode} + \global\dp\@currbox1sp % +% \end{macrocode} +% +% \changes{v1.1d}{2000/09/24}{FMi: use output routine to +% defer float} +% Next line assumes that first token of |\end@float| is +% |\@endfloatbox| so we gobble that. +% \begin{macrocode} +% \@cons\@deferlist\@currbox + \expandafter\@gobble\end@float +% \end{macrocode} +% |\@Esphack| is then added by |\@endfloat| above. +% \begin{macrocode} + \fi +% \ifnum \@floatpenalty =-\@Mii \@Esphack\fi +\else + \end@float +\fi +} +% \end{macrocode} +% +% Test if the float box has the wrong width. (Actually as noted above +% the test is for a conventional depth setting rather than for the +% width of the float). +% \begin{macrocode} +\def\@testwrongwidth #1{% + \ifdim\dp#1=\f@depth + \else + \global\@testtrue + \fi} +% \end{macrocode} +% +% Normally looking for single column floats, which have zero depth. +% \begin{macrocode} +\let\f@depth\z@ +% \end{macrocode} +% +% but when making two column float area, look for floats with 1sp +% depth. +% \begin{macrocode} +\def\@dblfloatplacement{\global\@dbltopnum\c@dbltopnumber + \global\@dbltoproom \dbltopfraction\@colht + \@textmin \@colht + \advance \@textmin -\@dbltoproom + \@fpmin \dblfloatpagefraction\textheight + \@fptop \@dblfptop + \@fpsep \@dblfpsep + \@fpbot \@dblfpbot +% \end{macrocode} +% +% \begin{macrocode} + \def\f@depth{1sp}} +% \end{macrocode} +% +% All the remaining changes are replacing the double column defer list +% or insering the extra test |\@testwrongwidth|\marg{box} at suitable +% places. That is at plces where a box is taken off the deferlist. +% \begin{macrocode} +\def \@doclearpage {% + \ifvoid\footins + \setbox\@tempboxa\vsplit\@cclv to\z@ \unvbox\@tempboxa + \setbox\@tempboxa\box\@cclv + \xdef\@deferlist{\@toplist\@botlist\@deferlist}% + \global \let \@toplist \@empty + \global \let \@botlist \@empty + \global \@colroom \@colht + \ifx \@currlist\@empty + \else + \@latexerr{Float(s) lost}\@ehb + \global \let \@currlist \@empty + \fi + \@makefcolumn\@deferlist + \@whilesw\if@fcolmade \fi{\@opcol\@makefcolumn\@deferlist}% + \if@twocolumn + \if@firstcolumn +% \end{macrocode} +% +% \begin{macrocode} + \xdef\@deferlist{\@dbltoplist\@deferlist}% +% \end{macrocode} +% +% \begin{macrocode} + \global \let \@dbltoplist \@empty + \global \@colht \textheight + \begingroup + \@dblfloatplacement +% \end{macrocode} +% +% \begin{macrocode} + \@makefcolumn\@deferlist + \@whilesw\if@fcolmade \fi{\@outputpage + \@makefcolumn\@deferlist}% +% \end{macrocode} +% +% \begin{macrocode} + \endgroup + \else + \vbox{}\clearpage + \fi + \fi +% \end{macrocode} +% the next line is needed to avoid loosing floats in certain +% circumstances a single call to the original |\doclearpage| +% will now no longer output all floats. +% \changes{v1.1d}{2000/09/24}{FMi: ensure \cs{doclearpage} +% is called again until all floats are output.} +% \begin{macrocode} + \ifx\@deferlist\@empty \else\clearpage \fi + \else + \setbox\@cclv\vbox{\box\@cclv\vfil}% + \@makecol\@opcol + \clearpage + \fi +} +% \end{macrocode} +% +% \begin{macrocode} +\def \@startdblcolumn {% + \@tryfcolumn \@deferlist + \if@fcolmade + \else + \begingroup + \let \reserved@b \@deferlist + \global \let \@deferlist \@empty + \let \@elt \@sdblcolelt + \reserved@b + \endgroup + \fi +} +% \end{macrocode} +% +% \begin{macrocode} +\def\@addtonextcol{% + \begingroup + \@insertfalse + \@setfloattypecounts + \ifnum \@fpstype=8 + \else + \ifnum \@fpstype=24 + \else + \@flsettextmin + \@reqcolroom \ht\@currbox + \advance \@reqcolroom \@textmin + \ifdim \@colroom>\@reqcolroom + \@flsetnum \@colnum + \ifnum\@colnum>\z@ + \@bitor\@currtype\@deferlist + \@testwrongwidth\@currbox + \if@test + \else + \@addtotoporbot + \fi + \fi + \fi + \fi + \fi + \if@insert + \else + \@cons\@deferlist\@currbox + \fi + \endgroup +} +% \end{macrocode} +% +% \begin{macrocode} +\def\@addtodblcol{% + \begingroup + \@insertfalse + \@setfloattypecounts + \@getfpsbit \tw@ + \ifodd\@tempcnta + \@flsetnum \@dbltopnum + \ifnum \@dbltopnum>\z@ + \@tempswafalse + \ifdim \@dbltoproom>\ht\@currbox + \@tempswatrue + \else + \ifnum \@fpstype<\sixt@@n + \advance \@dbltoproom \@textmin + \ifdim \@dbltoproom>\ht\@currbox + \@tempswatrue + \fi + \advance \@dbltoproom -\@textmin + \fi + \fi + \if@tempswa + \@bitor \@currtype \@deferlist +% \end{macrocode} +% +% not in fixfloats? +% \begin{macrocode} + \@testwrongwidth\@currbox +% \end{macrocode} +% +% \begin{macrocode} + \if@test + \else + \@tempdima -\ht\@currbox + \advance\@tempdima + -\ifx \@dbltoplist\@empty \dbltextfloatsep \else + \dblfloatsep \fi + \global \advance \@dbltoproom \@tempdima + \global \advance \@colht \@tempdima + \global \advance \@dbltopnum \m@ne + \@cons \@dbltoplist \@currbox + \@inserttrue + \fi + \fi + \fi + \fi + \if@insert + \else + \@cons\@deferlist\@currbox + \fi + \endgroup +} +% \end{macrocode} +% +% \begin{macrocode} +\def \@addtocurcol {% + \@insertfalse + \@setfloattypecounts + \ifnum \@fpstype=8 + \else + \ifnum \@fpstype=24 + \else + \@flsettextmin + \advance \@textmin \@textfloatsheight + \@reqcolroom \@pageht + \ifdim \@textmin>\@reqcolroom + \@reqcolroom \@textmin + \fi + \advance \@reqcolroom \ht\@currbox + \ifdim \@colroom>\@reqcolroom + \@flsetnum \@colnum + \ifnum \@colnum>\z@ + \@bitor\@currtype\@deferlist +% \end{macrocode} +% We need to defer the float also if its width +% doesn't fit. +% \changes{v1.1d}{2000/09/24}{FMi: test for wide float was +% in wrong place} +% \begin{macrocode} + \@testwrongwidth\@currbox +% \end{macrocode} +% +% \begin{macrocode} + \if@test + \else + \@bitor\@currtype\@botlist + \if@test + \@addtobot + \else + \ifodd \count\@currbox + \advance \@reqcolroom \intextsep + \ifdim \@colroom>\@reqcolroom + \global \advance \@colnum \m@ne + \global \advance \@textfloatsheight \ht\@currbox + \global \advance \@textfloatsheight 2\intextsep + \@cons \@midlist \@currbox + \if@nobreak + \nobreak + \@nobreakfalse + \everypar{}% + \else + \addpenalty \interlinepenalty + \fi + \vskip \intextsep + \box\@currbox + \penalty\interlinepenalty + \vskip\intextsep + \ifnum\outputpenalty <-\@Mii \vskip -\parskip\fi + \outputpenalty \z@ + \@inserttrue + \fi + \fi + \if@insert + \else + \@addtotoporbot + \fi + \fi + \fi + \fi + \fi + \fi + \fi + \if@insert + \else + \@resethfps + \@cons\@deferlist\@currbox + \fi +} +% \end{macrocode} +% +% \begin{macrocode} +\def\@xtryfc #1{% + \@next\reserved@a\@trylist{}{}% + \@currtype \count #1% + \divide\@currtype\@xxxii + \multiply\@currtype\@xxxii + \@bitor \@currtype \@failedlist + \@testfp #1% +% \end{macrocode} +% +% \begin{macrocode} + \@testwrongwidth #1% +% \end{macrocode} +% +% \begin{macrocode} + \ifdim \ht #1>\@colht + \@testtrue + \fi + \if@test + \@cons\@failedlist #1% + \else + \@ytryfc #1% + \fi} +% \end{macrocode} +% +% \begin{macrocode} +\def\@ztryfc #1{% + \@tempcnta\count #1% + \divide\@tempcnta\@xxxii + \multiply\@tempcnta\@xxxii + \@bitor \@tempcnta {\@failedlist \@flfail}% + \@testfp #1% +% \end{macrocode} +% +% not in fixfloats? +% \begin{macrocode} + \@testwrongwidth #1% +% \end{macrocode} +% +% \begin{macrocode} + \@tempdimb\@tempdima + \advance\@tempdimb\ht #1% + \advance\@tempdimb\@fpsep + \ifdim \@tempdimb >\@colht + \@testtrue + \fi + \if@test + \@cons\@flfail #1% + \else + \@cons\@flsucceed #1% + \@tempdima\@tempdimb + \fi} +% \end{macrocode} +% +% +% +% +% +% +% \subsection{\texttt{\textbackslash @} discards spaces when moving +% (pr3039)} +% +% \begin{macro}{\@} +% Ensure that |\@m| can't eat spaces. Alternative would be to make +% |\@| robust but that takes more space. +% \begin{macrocode} +\def\@{\spacefactor\@m{}} +% \end{macrocode} +% \end{macro} +% +% +% \subsection{\texttt{\textbackslash setlength} produces error if +% used with registers like \texttt{\textbackslash dimen0} (pr/3066)} +% +% \begin{macro}{\setlength} +% Add space after register (|#1|) but only if this is still the +% original definition. When, for example, \Lpack{calc} was already +% loaded this wouldn't be a good idea any more. +% \changes{v1.0c}{2000/09/21}{Don't change if definition was +% modified already} +% \begin{macrocode} +\def\@tempa#1#2{#1#2\relax} +\ifx\setlength\@tempa + \def\setlength#1#2{#1 #2\relax} +\fi +% \end{macrocode} +% \end{macro} +% +% +% \subsection{\texttt{\textbackslash addpenalty} ruins flush-bottom +% (pr/3073)} +% +% \begin{macro}{\addpenalty} +% Fix provided by Donald (though the original fix was not good enough). +% \begin{macrocode} +\def\addpenalty#1{% + \ifvmode + \if@minipage + \else + \if@nobreak + \else + \ifdim\lastskip=\z@ + \penalty#1\relax + \else + \@tempskipb\lastskip + \advance \@tempskipb + \ifdim\prevdepth>\maxdepth\maxdepth\else +% \end{macrocode} +% If |\prevdepth| is -1000pt due to |\nointerlineskip| we better +% not add it! +% \changes{v1.0c}{2000/09/21}{Don't add \cs{prevdepth} if it is a +% senile value!} +% \begin{macrocode} + \ifdim \prevdepth = -\@m\p@ \z@ \else \prevdepth \fi + \fi + \vskip -\@tempskipb + \penalty#1% + \vskip\@tempskipb + \fi + \fi + \fi + \else + \@noitemerr + \fi} +% \end{macrocode} +% \end{macro} +% +% +% +% \subsection{\texttt{\textbackslash fnsymbol} should use text symbols +% if possible (pr/3400)} +% +% \begin{macrocode} +\DeclareRobustCommand{\@fnsymbol}[1]{% + \ifmmode + \ifcase#1\or *\or\dagger\or \ddagger\or + \mathsection\or \mathparagraph\or \|\or **\or + \dagger\dagger + \or \ddagger\ddagger \else\@ctrerr\fi + \else + \ifcase#1\or \textasteriskcentered\or \textdagger\or + \textdaggerdbl\or \textsection\or \textparagraph\or + \textbardbl\or \textasteriskcentered\textasteriskcentered\or + \textdagger\textdagger\or \textdaggerdbl\textdaggerdbl + \else\@ctrerr\fi + \fi} +% \end{macrocode} +% +% \subsection{No hyphenation in first word after float environment(pr/3498)} +% +% Fix suggested by Donald Arseneau. +% \changes{v1.1g}{2003/09/19}{Fix for \cs{@esphack} (pr/3498)} +% \changes{v1.1h}{2004/02/13}{Fix for \cs{@Esphack} (pr/3498)} +% \begin{macrocode} +\def\@esphack{% + \relax + \ifhmode + \spacefactor\@savsf + \ifdim\@savsk>\z@ + \nobreak \hskip\z@skip % <------ + \ignorespaces + \fi + \fi} +% \end{macrocode} +% +% \begin{macrocode} +\def\@Esphack{% + \relax + \ifhmode + \spacefactor\@savsf + \ifdim\@savsk>\z@ + \nobreak \hskip\z@skip % <------ + \@ignoretrue + \ignorespaces + \fi + \fi} +% \end{macrocode} +% +% +% \subsection{Allowing \texttt{\textbackslash emph} to produce small +% caps, etc} +% +% \changes{v1.1g}{2003/09/19}{Allow \cs{emph} to produce small caps} +% \begin{macrocode} +\DeclareRobustCommand\em + {\@nomath\em \ifdim \fontdimen\@ne\font >\z@ + \eminnershape \else \itshape \fi} +\def\eminnershape{\upshape} +% \end{macrocode} +% +% \begin{macrocode} +% +% \end{macrocode} +% +% \subsection{Using EC fonts (T1 encoding) makes my documents look +% bl**dy horrible} +% +% \subsubsection{Preliminaries} +% The \LaTeX{} kernel does not declare the font encoding TS1. +% However, we are going to set up font definitions for this encoding, +% so we have to declare it now. +% \begin{macrocode} +%<*fix-cm> +\input{ts1enc.def} +% \end{macrocode} +% +% In case the package is loaded in the preamble, any of the CM fonts may +% have been used already and cannot be redefined. Yet we try to +% intercept at least the problem that is most likely to occur, i.e., +% a hidden \cmd{\normalfont}. Most of the standard definitions +% are ok, but those for T1 encoding and 10.95\,pt need to be removed: +% \begin{macrocode} +\expandafter \let \csname T1/cmr/m/n/10.95\endcsname \relax +\expandafter \let \csname T1/cmss/m/n/10.95\endcsname \relax +\expandafter \let \csname T1/cmtt/m/n/10.95\endcsname \relax +\expandafter \let \csname T1/cmvtt/m/n/10.95\endcsname \relax +% \end{macrocode} +% +% \Lpack{fix-cm} may still fail, if the EC fonts are preloaded in the +% \LaTeX{} format file. This situation is, however, very unlikely and could occur +% only with a customized format. +% +% The remainder of the package is enclosed in a group, where the catcodes +% are guaranteed to be appropriate for the processing of font definitions. +% \begin{macrocode} +\begingroup +\nfss@catcodes +% \end{macrocode} +% +% \subsubsection{T1 encoding} +% +% \paragraph{CM Roman} +% \begin{macrocode} +\DeclareFontFamily{T1}{cmr}{} +\DeclareFontShape{T1}{cmr}{m}{n}{ + <-6> ecrm0500 + <6-7> ecrm0600 + <7-8> ecrm0700 + <8-9> ecrm0800 + <9-10> ecrm0900 + <10-12> ecrm1000 + <12-17> ecrm1200 + <17-> ecrm1728 + }{} +\DeclareFontShape{T1}{cmr}{m}{sl}{ + <-6> ecsl0500 + <6-7> ecsl0600 + <7-8> ecsl0700 + <8-9> ecsl0800 + <9-10> ecsl0900 + <10-12> ecsl1000 + <12-17> ecsl1200 + <17-> ecsl1728 + }{} +\DeclareFontShape{T1}{cmr}{m}{it}{ + <-8> ecti0700 + <8-9> ecti0800 + <9-10> ecti0900 + <10-12> ecti1000 + <12-17> ecti1200 + <17-> ecti1728 + }{} +\DeclareFontShape{T1}{cmr}{m}{sc}{ + <-6> eccc0500 + <6-7> eccc0600 + <7-8> eccc0700 + <8-9> eccc0800 + <9-10> eccc0900 + <10-12> eccc1000 + <12-17> eccc1200 + <17-> eccc1728 + }{} +\DeclareFontShape{T1}{cmr}{m}{ui}{ + <-8> ecui0700 + <8-9> ecui0800 + <9-10> ecui0900 + <10-12> ecui1000 + <12-17> ecui1200 + <17-> ecui1728 + }{} +\DeclareFontShape{T1}{cmr}{b}{n}{ + <-6> ecrb0500 + <6-7> ecrb0600 + <7-8> ecrb0700 + <8-9> ecrb0800 + <9-10> ecrb0900 + <10-12> ecrb1000 + <12-17> ecrb1200 + <17-> ecrb1728 + }{} +\DeclareFontShape{T1}{cmr}{bx}{n}{ + <-6> ecbx0500 + <6-7> ecbx0600 + <7-8> ecbx0700 + <8-9> ecbx0800 + <9-10> ecbx0900 + <10-12> ecbx1000 + <12-> ecbx1200 + }{} +\DeclareFontShape{T1}{cmr}{bx}{sl}{ + <-6> ecbl0500 + <6-7> ecbl0600 + <7-8> ecbl0700 + <8-9> ecbl0800 + <9-10> ecbl0900 + <10-12> ecbl1000 + <12-> ecbl1200 + }{} +\DeclareFontShape{T1}{cmr}{bx}{it}{ + <-8> ecbi0700 + <8-9> ecbi0800 + <9-10> ecbi0900 + <10-12> ecbi1000 + <12-> ecbi1200 + }{} +\DeclareFontShape{T1}{cmr}{bx}{sc}{ + <-6> ecxc0500 + <6-7> ecxc0600 + <7-8> ecxc0700 + <8-9> ecxc0800 + <9-10> ecxc0900 + <10-12> ecxc1000 + <12-> ecxc1200 + }{} +% +% \end{macrocode} +% +% \paragraph{CM Sans} +% \begin{macrocode} +\DeclareFontFamily{T1}{cmss}{} +\DeclareFontShape{T1}{cmss}{m}{n}{ + <-9> ecss0800 + <9-10> ecss0900 + <10-12> ecss1000 + <12-17> ecss1200 + <17-> ecss1728 + }{} +\DeclareFontShape{T1}{cmss}{m}{sl}{ + <-9> ecsi0800 + <9-10> ecsi0900 + <10-12> ecsi1000 + <12-17> ecsi1200 + <17-> ecsi1728 + }{} +\DeclareFontShape{T1}{cmss}{m}{it} + {<->ssub*cmss/m/sl}{} +\DeclareFontShape{T1}{cmss}{m}{sc} + {<->sub*cmr/m/sc}{} +\DeclareFontShape{T1}{cmss}{sbc}{n}{ + <-> ecssdc10 + }{} +\DeclareFontShape{T1}{cmss}{bx}{n}{ + <-10> ecsx0900 + <10-> ecsx1000 + }{} +\DeclareFontShape{T1}{cmss}{bx}{sl}{ + <-10> ecso0900 + <10-> ecso1000 + }{} +\DeclareFontShape{T1}{cmss}{bx}{it} + {<->ssub*cmss/bx/sl}{} +% \end{macrocode} +% The following substitutions are not provided in the default +% \file{.fd} files. I have included them, so that you can +% easily use the EC fonts with the default bold series being +% \file{b} rather than \file{bx}. +% \begin{macrocode} +\DeclareFontShape{T1}{cmss}{b}{n} + {<->ssub*cmss/bx/n}{} +\DeclareFontShape{T1}{cmss}{b}{sl} + {<->ssub*cmss/bx/sl}{} +\DeclareFontShape{T1}{cmss}{b}{it} + {<->ssub*cmss/bx/sl}{} +% \end{macrocode} +% +% \paragraph{CM Typewriter} +% \begin{macrocode} +\DeclareFontFamily{T1}{cmtt}{\hyphenchar \font\m@ne} +\DeclareFontShape{T1}{cmtt}{m}{n}{ + <-9> ectt0800 + <9-10> ectt0900 + <10-12> ectt1000 + <12-17> ectt1200 + <17-> ectt1728 + }{} +\DeclareFontShape{T1}{cmtt}{m}{it}{ + <-9> ecit0800 + <9-10> ecit0900 + <10-12> ecit1000 + <12-17> ecit1200 + <17-> ecit1728 + }{} +\DeclareFontShape{T1}{cmtt}{m}{sl}{ + <-9> ecst0800 + <9-10> ecst0900 + <10-12> ecst1000 + <12-17> ecst1200 + <17-> ecst1728 + }{} +\DeclareFontShape{T1}{cmtt}{m}{sc}{ + <-9> ectc0800 + <9-10> ectc0900 + <10-12> ectc1000 + <12-17> ectc1200 + <17-> ectc1728 + }{} +\DeclareFontShape{T1}{cmtt}{bx}{n} + {<->sub * cmtt/m/n}{} +\DeclareFontShape{T1}{cmtt}{bx}{it} + {<->sub * cmtt/m/it}{} +\DeclareFontShape{T1}{cmtt}{bx}{sl} + {<->sub * cmtt/m/sl}{} +% \end{macrocode} +% Substitutions not provided in the default \file{.fd} files: +% \begin{macrocode} +\DeclareFontShape{T1}{cmtt}{b}{n} + {<->sub * cmtt/m/n}{} +\DeclareFontShape{T1}{cmtt}{b}{it} + {<->sub * cmtt/m/it}{} +\DeclareFontShape{T1}{cmtt}{b}{sl} + {<->sub * cmtt/m/sl}{} +% \end{macrocode} +% +% \paragraph{CM Typewiter (var.)} +% \begin{macrocode} +\DeclareFontFamily{T1}{cmvtt}{} +\DeclareFontShape{T1}{cmvtt}{m}{n}{ + <-9> ecvt0800 + <9-10> ecvt0900 + <10-12> ecvt1000 + <12-17> ecvt1200 + <17-> ecvt1728 + }{} +\DeclareFontShape{T1}{cmvtt}{m}{it}{ + <-9> ecvi0800 + <9-10> ecvi0900 + <10-12> ecvi1000 + <12-17> ecvi1200 + <17-> ecvi1728 + }{} +% \end{macrocode} +% +% \subsubsection{TS1 encoding} +% +% \paragraph{CM Roman} +% \begin{macrocode} +\DeclareFontFamily{TS1}{cmr}{\hyphenchar\font\m@ne} +\DeclareFontShape{TS1}{cmr}{m}{n}{ + <-6> tcrm0500 + <6-7> tcrm0600 + <7-8> tcrm0700 + <8-9> tcrm0800 + <9-10> tcrm0900 + <10-12> tcrm1000 + <12-17> tcrm1200 + <17-> tcrm1728 + }{} +\DeclareFontShape{TS1}{cmr}{m}{sl}{ + <-6> tcsl0500 + <6-7> tcsl0600 + <7-8> tcsl0700 + <8-9> tcsl0800 + <9-10> tcsl0900 + <10-12> tcsl1000 + <12-17> tcsl1200 + <17-> tcsl1728 + }{} +\DeclareFontShape{TS1}{cmr}{m}{it}{ + <-8> tcti0700 + <8-9> tcti0800 + <9-10> tcti0900 + <10-12> tcti1000 + <12-17> tcti1200 + <17-> tcti1728 + }{} +\DeclareFontShape{TS1}{cmr}{m}{ui}{ + <-8> tcui0700 + <8-9> tcui0800 + <9-10> tcui0900 + <10-12> tcui1000 + <12-17> tcui1200 + <17-> tcui1728 + }{} +\DeclareFontShape{TS1}{cmr}{b}{n}{ + <-6> tcrb0500 + <6-7> tcrb0600 + <7-8> tcrb0700 + <8-9> tcrb0800 + <9-10> tcrb0900 + <10-12> tcrb1000 + <12-17> tcrb1200 + <17-> tcrb1728 + }{} +\DeclareFontShape{TS1}{cmr}{bx}{n}{ + <-6> tcbx0500 + <6-7> tcbx0600 + <7-8> tcbx0700 + <8-9> tcbx0800 + <9-10> tcbx0900 + <10-12> tcbx1000 + <12-> tcbx1200 + }{} +\DeclareFontShape{TS1}{cmr}{bx}{sl}{ + <-6> tcbl0500 + <6-7> tcbl0600 + <7-8> tcbl0700 + <8-9> tcbl0800 + <9-10> tcbl0900 + <10-12> tcbl1000 + <12-> tcbl1200 + }{} +\DeclareFontShape{TS1}{cmr}{bx}{it}{ + <-8> tcbi0700 + <8-9> tcbi0800 + <9-10> tcbi0900 + <10-12> tcbi1000 + <12-> tcbi1200 + }{} +% \end{macrocode} +% +% \paragraph{CM Sans} +% \begin{macrocode} +\DeclareFontFamily{TS1}{cmss}{\hyphenchar\font\m@ne} +\DeclareFontShape{TS1}{cmss}{m}{n}{ + <-9> tcss0800 + <9-10> tcss0900 + <10-12> tcss1000 + <12-17> tcss1200 + <17-> tcss1728 + }{} +\DeclareFontShape{TS1}{cmss}{m}{it} + {<->ssub*cmss/m/sl}{} +\DeclareFontShape{TS1}{cmss}{m}{sl}{ + <-9> tcsi0800 + <9-10> tcsi0900 + <10-12> tcsi1000 + <12-17> tcsi1200 + <17-> tcsi1728 + }{} +\DeclareFontShape{TS1}{cmss}{sbc}{n}{ + <-> tcssdc10 + }{} +\DeclareFontShape{TS1}{cmss}{bx}{n}{ + <-10> tcsx0900 + <10-> tcsx1000 + }{} +\DeclareFontShape{TS1}{cmss}{bx}{sl}{ + <-10> tcso0900 + <10-> tcso1000 + }{} +\DeclareFontShape{TS1}{cmss}{bx}{it} + {<->ssub*cmss/bx/sl}{} +% \end{macrocode} +% Substitutions not provided in the default \file{.fd} files: +% \begin{macrocode} +\DeclareFontShape{TS1}{cmss}{b}{n} + {<->ssub*cmss/bx/n}{} +\DeclareFontShape{TS1}{cmss}{b}{sl} + {<->ssub*cmss/bx/sl}{} +\DeclareFontShape{TS1}{cmss}{b}{it} + {<->ssub*cmss/bx/sl}{} +% \end{macrocode} +% +% \paragraph{CM Typewriter} +% \begin{macrocode} +\DeclareFontFamily{TS1}{cmtt}{\hyphenchar \font\m@ne} +\DeclareFontShape{TS1}{cmtt}{m}{n}{ + <-9> tctt0800 + <9-10> tctt0900 + <10-12> tctt1000 + <12-17> tctt1200 + <17-> tctt1728 + }{} +\DeclareFontShape{TS1}{cmtt}{m}{it}{ + <-9> tcit0800 + <9-10> tcit0900 + <10-12> tcit1000 + <12-17> tcit1200 + <17-> tcit1728 + }{} +\DeclareFontShape{TS1}{cmtt}{m}{sl}{ + <-9> tcst0800 + <9-10> tcst0900 + <10-12> tcst1000 + <12-17> tcst1200 + <17-> tcst1728 + }{} +\DeclareFontShape{TS1}{cmtt}{bx}{n} + {<->sub * cmtt/m/n}{} +\DeclareFontShape{TS1}{cmtt}{bx}{it} + {<->sub * cmtt/m/it}{} +\DeclareFontShape{TS1}{cmtt}{bx}{sl} + {<->sub * cmtt/m/sl}{} +% \end{macrocode} +% Substitutions not provided in the default \file{.fd} files: +% \begin{macrocode} +\DeclareFontShape{TS1}{cmtt}{b}{n} + {<->sub * cmtt/m/n}{} +\DeclareFontShape{TS1}{cmtt}{b}{it} + {<->sub * cmtt/m/it}{} +\DeclareFontShape{TS1}{cmtt}{b}{sl} + {<->sub * cmtt/m/sl}{} +% \end{macrocode} +% +% \paragraph{CM Typewriter (var.)} +% \begin{macrocode} +\DeclareFontFamily{TS1}{cmvtt}{} +\DeclareFontShape{TS1}{cmvtt}{m}{n}{ + <-9> tcvt0800 + <9-10> tcvt0900 + <10-12> tcvt1000 + <12-17> tcvt1200 + <17-> tcvi1728 + }{} +\DeclareFontShape{TS1}{cmvtt}{m}{it}{ + <-9> tcvi0800 + <9-10> tcvi0900 + <10-12> tcvi1000 + <12-17> tcvi1200 + <17-> tcvi1728 + }{} +% \end{macrocode} +% +% \subsubsection{OT1 encoding} +% +% \paragraph{CM Roman} +% \begin{macrocode} +\DeclareFontFamily{OT1}{cmr}{\hyphenchar\font45 } +\DeclareFontShape{OT1}{cmr}{m}{n}{ + <-6> cmr5 + <6-7> cmr6 + <7-8> cmr7 + <8-9> cmr8 + <9-10> cmr9 + <10-12> cmr10 + <12-17> cmr12 + <17-> cmr17 + }{} +\DeclareFontShape{OT1}{cmr}{m}{sl}{ + <-9> cmsl8 + <9-10> cmsl9 + <10-12> cmsl10 + <12-> cmsl12 + }{} +\DeclareFontShape{OT1}{cmr}{m}{it}{ + <-8> cmti7 + <8-9> cmti8 + <9-10> cmti9 + <10-12> cmti10 + <12-> cmti12 + }{} +\DeclareFontShape{OT1}{cmr}{m}{sc}{ + <-> cmcsc10 + }{} +\DeclareFontShape{OT1}{cmr}{m}{ui}{ + <-> cmu10 + }{} +\DeclareFontShape{OT1}{cmr}{b}{n}{ + <-> cmb10 + }{} +\DeclareFontShape{OT1}{cmr}{bx}{n}{ + <-6> cmbx5 + <6-7> cmbx6 + <7-8> cmbx7 + <8-9> cmbx8 + <9-10> cmbx9 + <10-12> cmbx10 + <12-> cmbx12 + }{} +\DeclareFontShape{OT1}{cmr}{bx}{sl}{ + <-> cmbxsl10 + }{} +\DeclareFontShape{OT1}{cmr}{bx}{it}{ + <-> cmbxti10 + }{} +\DeclareFontShape{OT1}{cmr}{bx}{ui} + {<->sub*cmr/m/ui}{} +% \end{macrocode} +% +% \paragraph{CM Sans} +% \begin{macrocode} +\DeclareFontFamily{OT1}{cmss}{\hyphenchar\font45 } +\DeclareFontShape{OT1}{cmss}{m}{n}{ + <-9> cmss8 + <9-10> cmss9 + <10-12> cmss10 + <12-17> cmss12 + <17-> cmss17 + }{} +\DeclareFontShape{OT1}{cmss}{m}{it} + {<->sub*cmss/m/sl}{} +\DeclareFontShape{OT1}{cmss}{m}{sl}{ + <-9> cmssi8 + <9-10> cmssi9 + <10-12> cmssi10 + <12-17> cmssi12 + <17-> cmssi17 + }{} +\DeclareFontShape{OT1}{cmss}{m}{sc} + {<->sub*cmr/m/sc}{} +\DeclareFontShape{OT1}{cmss}{m}{ui} + {<->sub*cmr/m/ui}{} +\DeclareFontShape{OT1}{cmss}{sbc}{n}{ + <-> cmssdc10 + }{} +\DeclareFontShape{OT1}{cmss}{bx}{n}{ + <-> cmssbx10 + }{} +\DeclareFontShape{OT1}{cmss}{bx}{ui} + {<->sub*cmr/bx/ui}{} +% \end{macrocode} +% +% \paragraph{CM Typewriter} +% \begin{macrocode} +\DeclareFontFamily{OT1}{cmtt}{\hyphenchar \font\m@ne} +\DeclareFontShape{OT1}{cmtt}{m}{n}{ + <-9> cmtt8 + <9-10> cmtt9 + <10-12> cmtt10 + <12-> cmtt12 + }{} +\DeclareFontShape{OT1}{cmtt}{m}{it}{ + <-> cmitt10 + }{} +\DeclareFontShape{OT1}{cmtt}{m}{sl}{ + <-> cmsltt10 + }{} +\DeclareFontShape{OT1}{cmtt}{m}{sc}{ + <-> cmtcsc10 + }{} +\DeclareFontShape{OT1}{cmtt}{m}{ui} + {<->ssub*cmtt/m/it}{} +\DeclareFontShape{OT1}{cmtt}{bx}{n} + {<->ssub*cmtt/m/n}{} +\DeclareFontShape{OT1}{cmtt}{bx}{it} + {<->ssub*cmtt/m/it}{} +\DeclareFontShape{OT1}{cmtt}{bx}{ui} + {<->ssub*cmtt/m/it}{} +% \end{macrocode} +% +% \paragraph{CM Typewriter (var.)} +% \begin{macrocode} +\DeclareFontFamily{OT1}{cmvtt}{\hyphenchar\font45 } +\DeclareFontShape{OT1}{cmvtt}{m}{n}{ + <-> cmvtt10 + }{} +\DeclareFontShape{OT1}{cmvtt}{m}{it}{ + <-> cmvtti10 + }{} +% \end{macrocode} +% +% \subsubsection{OML and OMS encoded math fonts} +% \begin{macrocode} +\DeclareFontFamily{OML}{cmm}{\skewchar\font127 } +\DeclareFontShape{OML}{cmm}{m}{it}{ + <-6> cmmi5 + <6-7> cmmi6 + <7-8> cmmi7 + <8-9> cmmi8 + <9-10> cmmi9 + <10-12> cmmi10 + <12-> cmmi12 + }{} +\DeclareFontShape{OML}{cmm}{b}{it}{<-6>cmmib5<6-8>cmmib7<8->cmmib10}{} +\DeclareFontShape{OML}{cmm}{bx}{it} + {<->ssub*cmm/b/it}{} +% \end{macrocode} +% \begin{macrocode} +\DeclareFontFamily{OMS}{cmsy}{\skewchar\font48 } +\DeclareFontShape{OMS}{cmsy}{m}{n}{ + <-6> cmsy5 + <6-7> cmsy6 + <7-8> cmsy7 + <8-9> cmsy8 + <9-10> cmsy9 + <10-> cmsy10 + }{} +\DeclareFontShape{OMS}{cmsy}{b}{n}{<-6>cmbsy5<6-8>cmbsy7<8->cmbsy10}{} +% \end{macrocode} +% +% \subsubsection{\LaTeX{} symbols} +% \begin{macrocode} +\DeclareFontFamily{U}{lasy}{} +\DeclareFontShape{U}{lasy}{m}{n}{ + <-6> lasy5 + <6-7> lasy6 + <7-8> lasy7 + <8-9> lasy8 + <9-10> lasy9 + <10-> lasy10 + }{} +\DeclareFontShape{U}{lasy}{b}{n}{ + <-10> ssub * lasy/m/n + <10-> lasyb10 + }{} +% \end{macrocode} +% \begin{macrocode} +\endgroup +% +% \end{macrocode} +% +% +% \Finale +% +\endinput diff --git a/Master/texmf-dist/source/latex/base/fixltx2e.ins b/Master/texmf-dist/source/latex/base/fixltx2e.ins new file mode 100644 index 00000000000..5249b421a9b --- /dev/null +++ b/Master/texmf-dist/source/latex/base/fixltx2e.ins @@ -0,0 +1,82 @@ +%% +%% This file will generate fast loadable files and documentation +%% driver files from the doc files in this package when run through +%% LaTeX or TeX. +%% +%% Copyright 1993 1994 1995 1996 1997 1998 1999 2000 2001 2002 2003 2004 +%% The LaTeX3 Project and any individual authors listed elsewhere +%% in this file. +%% +%% This file is part of the LaTeX base system. +%% ------------------------------------------- +%% +%% It may be distributed and/or modified under the +%% conditions of the LaTeX Project Public License, either version 1.3 +%% of this license or (at your option) any later version. +%% The latest version of this license is in +%% http://www.latex-project.org/lppl.txt +%% and version 1.3 or later is part of all distributions of LaTeX +%% version 2003/12/01 or later. +%% +%% This file has the LPPL maintenance status "maintained". +%% +%% In particular, NO PERMISSION is granted to modify the contents of this +%% file since it contains the legal notices that are placed in the files +%% it generates. +%% +%% The list of all files belonging to the LaTeX base distribution is +%% given in the file `manifest.txt'. See also `legal.txt' for additional +%% information. +%% +%% +%% +%% +%% --------------- start of docstrip commands ------------------ +%% + +\input docstrip + +\preamble + +This is a generated file. + +Copyright 1993 1994 1995 1996 1997 1998 1999 2000 2001 2002 2003 2004 +The LaTeX3 Project and any individual authors listed elsewhere +in this file. + +This file was generated from file(s) of the LaTeX base system. +-------------------------------------------------------------- + +It may be distributed and/or modified under the +conditions of the LaTeX Project Public License, either version 1.3 +of this license or (at your option) any later version. +The latest version of this license is in + http://www.latex-project.org/lppl.txt +and version 1.3 or later is part of all distributions of LaTeX +version 2003/12/01 or later. + +This file has the LPPL maintenance status "maintained". + +This file may only be distributed together with a copy of the LaTeX +base system. You may however distribute the LaTeX base system without +such generated files. + +The list of all files belonging to the LaTeX base distribution is +given in the file `manifest.txt'. See also `legal.txt' for additional +information. + +The list of derived (unpacked) files belonging to the distribution +and covered by LPPL is defined by the unpacking scripts (with +extension .ins) which are part of the distribution. +\endpreamble + +\keepsilent +\usedir{tex/latex/base} + +\generateFile{fixltx2e.sty}{t}{% + \from{fixltx2e.dtx}{fixltx2e}} + +\generateFile{fix-cm.sty}{t}{% + \from{fixltx2e.dtx}{fix-cm}} + +\endbatchfile diff --git a/Master/texmf-dist/source/latex/base/fontdef.dtx b/Master/texmf-dist/source/latex/base/fontdef.dtx new file mode 100644 index 00000000000..4d9f5b35cd5 --- /dev/null +++ b/Master/texmf-dist/source/latex/base/fontdef.dtx @@ -0,0 +1,1337 @@ +% \iffalse meta-comment +% +% Copyright 1993 1994 1995 1996 1997 1998 1999 2000 2001 2002 2003 2004 +% The LaTeX3 Project and any individual authors listed elsewhere +% in this file. +% +% This file is part of the LaTeX base system. +% ------------------------------------------- +% +% It may be distributed and/or modified under the +% conditions of the LaTeX Project Public License, either version 1.3 +% of this license or (at your option) any later version. +% The latest version of this license is in +% http://www.latex-project.org/lppl.txt +% and version 1.3 or later is part of all distributions of LaTeX +% version 2003/12/01 or later. +% +% This file has the LPPL maintenance status "maintained". +% +% The list of all files belonging to the LaTeX base distribution is +% given in the file `manifest.txt'. See also `legal.txt' for additional +% information. +% +% The list of derived (unpacked) files belonging to the distribution +% and covered by LPPL is defined by the unpacking scripts (with +% extension .ins) which are part of the distribution. +% +% \fi +% \iffalse +%%% From File: fontdef.dtx +%<*dtx> + \ProvidesFile{fontdef.dtx} +% +%\ProvidesFile{fonttext.ltx} +%\ProvidesFile{fontmath.ltx} +%<+cfgtext>\ProvidesFile{fonttext.cfg} +%<+cfgmath>\ProvidesFile{fontmath.cfg} +%<+cfgprel>\ProvidesFile{preload.cfg} +%\ProvidesFile{fontdef.drv} +% \fi +% \ProvidesFile{fontdef.dtx} + [2004/02/04 v2.3a LaTeX Kernel +% \iftrue (\else +%(Text +%(Math +%<+cfgtext>(Uncustomised text +%<+cfgmath>(Uncustomised math +%<+cfgprel>(Uncustomised preload +% \fi + font setup)] +% +% \CheckSum{1463} +%% \CharacterTable +%% {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 +%% 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 +%% Digits \0\1\2\3\4\5\6\7\8\9 +%% Exclamation \! Double quote \" Hash (number) \# +%% Dollar \$ Percent \% Ampersand \& +%% Acute accent \' Left paren \( Right paren \) +%% Asterisk \* Plus \+ Comma \, +%% Minus \- Point \. Solidus \/ +%% Colon \: Semicolon \; Less than \< +%% Equals \= Greater than \> Question mark \? +%% Commercial at \@ Left bracket \[ Backslash \\ +%% Right bracket \] Circumflex \^ Underscore \_ +%% Grave accent \` Left brace \{ Vertical bar \| +%% Right brace \} Tilde \~} +% +%\iffalse This is a META comment +% +% File `fontdef.dtx'. +% Copyright (C) 1989-1999 Frank Mittelbach and Rainer Sch\"opf, +% All rights reserved. +% +%\fi +% +% \changes{v2.1a}{1993/12/01}{Update for LaTeX2e} +% \changes{v2.2a}{1994/10/14}{New coding} +% \changes{v2.2i}{1994/12/02}{Commented out \cs{ldots}. ASAJ.} +% \changes{v2.2j}{1995/05/11}{Updates to some plain macros} +% \changes{v2.2l}{1995/10/03}{\cs{@@sqrt} from patch file for /1701} +% \changes{v2.2o}{1996/05/17}{\cs{@@sqrt} removed, at last} +% \changes{v2.2p}{1996/11/20}{lowercase fd and enc.def file names /1044} +% \changes{v2.2x}{1999/01/05}{Need special protection for character +% \texttt{\char62} in \cs{changes} entry.} +% +% \title{The \texttt{fontdef.dtx} file\thanks +% {This file has version number \fileversion, dated \filedate}} +% \author{Frank Mittelbach \and Rainer Sch\"opf} +% +% \def\dst{{\normalfont\scshape docstrip}} +% \setcounter{StandardModuleDepth}{1} +% +% +% \maketitle +% +% \section{Introduction} +% +% This file is used to generate the files \texttt{fonttext.ltx} (text +% font declarations) and \texttt{fontmath.ltx} (math font +% declarations), which are used during the format generation. It +% contains the declaration of the standard text encodings used at the +% site as well as a minimal subset of font shape groups that NFSS will +% look at to ensure that the specified encodings are valid. +% +% The math part contains the setup for math encodings as well as the +% default math symbol declarations that belong to the encoding. +% +% It is possible to change this setup (by using other fonts, or +% defaults) without losing the ability to +% process documents written at other sites. Portability in this sense +% means that a document will compile without errors. It does not mean, +% however, that identical output will be produced. For this it is +% necessary that the distributed setup is used at both installations. +% +% \section{Customization} +% +% You are not allowed to change this source file! If you want to +% change the default encodings and/or the font shape groups preloaded +% you should should create a copy of \texttt{fonttext.ltx} +% under the name \texttt{fonttext.cfg} and change this copy. If +% \LaTeXe{} finds a file of this name it will use it, otherwise it +% uses the standard file which is \texttt{fontdef.ltx}. +% +% If you don't plan to use Computer Modern much or at all, it might +% (!) be a good idea to make your own \texttt{fonttext.cfg}. Look at +% the comments below (docstrip module `text') to see what should +% should go into such a file. +% +% To change the math font setup use a copy of \texttt{fontmath.ltx} +% under the name \texttt{fontmath.cfg} and change this copy. However, +% dealing with this interface is even more a job for an expert than +% changing the text font setup --- in short, we don't encourage either. +% +% \begin{quote} +% \textbf{Warning:} please note that we don't support customised +% \LaTeX{} versions. Thus, before sending in a bug report please try +% your test file with a \LaTeX{} format which is not customised and +% send in the log from that version (unless the problem goes away). +% \end{quote} +% +% Please note: the following standard encodings have to +% be defined in all local variants of \texttt{font....cfg} to guarantee +% that all \LaTeX{} installations behave in the same way. +% \begin{center} +% \begin{tabular}{ll} +% |T1| & Cork \TeX{} text encoding \\ +% |OT1| & old \TeX{} text encoding \\ +% |U| & unknown encoding \\ +% |OML| & old \TeX{} math letters encoding \\ +% |OMS| & old \TeX{} math symbols encoding \\ +% |OMX| & old \TeX{} math extension symbols encoding +% \end{tabular} +% \end{center} +% Notice that some of these encodings are `old' in the sense that we +% hope that they will be superseded soon by encoding standards defined +% by the \TeX{} user community. Therefore this set of default encodings +% may change in the future. +% +% The first candidate is |OT1| which will soon be replaced by |T1|, the +% official \TeX{} text encoding. +% +% \begin{quote}\textbf{Warning:} +% If you add additional encodings to this file there is no guarantee +% any longer that files processable at your installation will also be +% processable at other installations. Thus, if you make use of +% such an encoding in your document, e.g.~if you intend to typeset in +% Cyrillic (|OT2| encoding), you need to specify this encoding in the +% preamble of your document prior to sending it to another +% installation. Once the encoding is specified in that place in your +% document, the document is processable at all \LaTeX{} installations +% (provided they have suitable fonts installed). +% +% For this reason we suggest that you define a short package file that +% sets up an additional encoding used at your site (rather than +% putting the encoding into this file) since this package can easily +% be shipped with your document. +% \end{quote} +% +% +% \StopEventually{} +% +% \section{The \texttt{docstrip} modules} +% +% The following modules are used to direct \texttt{docstrip} in +% generating external files: +% \begin{center} +% \begin{tabular}{ll} +% driver & produce a documentation driver file \\ +% text & produce the file \texttt{fonttext.ltx}\\ +% math & produce the file \texttt{fontmath.ltx}\\ +% cfgtext & produce a dummy \texttt{fonttext.cfg} file\\ +% cfgmath & produce a dummy \texttt{fontmath.cfg} file\\ +% \end{tabular} +% \end{center} +% A typical \texttt{docstrip} command file would then have entries like: +% \begin{verbatim} +%\generateFile{fonttext.ltx}{t}{\from{fontdef.dtx}{text}} +%\end{verbatim} +% +% +% \section{A driver for this document} +% +% The next bit of code contains the documentation driver file for +% \TeX{}, i.e.~the file that will produce the documentation you are +% currently reading. It will be extracted from this file by the +% \dst{} program. +% \begin{macrocode} +%<*driver> +\documentclass{ltxdoc} +\GetFileInfo{fontdef.dtx} +\begin{document} + \DocInput{fontdef.dtx} +\end{document} +% +% \end{macrocode} +% +% +% +% \section{The \texttt{fonttext.ltx} file} +% +% The identification is done earlier on with a |\ProvidesFile| +% declaration. +% \begin{macrocode} +%<*text> +\typeout{=== Don't modify this file, use a .cfg file instead ===^^J} +% \end{macrocode} +% +% \subsection{Encodings} +% +% This file declares the standard encodings for text and math +% fonts. All others should be declared in packages or in the +% documents directly. +% +% For every text encoding there are normally a number of encoding +% specific commands, e.g.~accents, special characters, etc. (The +% definition for such a command might have to change when the +% encoding is changed, because the character is in a different +% position, or not available at all, or the accent is produced in a +% different way.) This is handled by a general mechanism which is +% described in \texttt{ltoutenc.dtx}. +% +% By convention, text encoding specific declarations, including the +% declaration |\DeclareFontEncoding|, are kept in separate file of +% the form \meta{enc}\texttt{enc.def}, e.g.~\texttt{ot1enc.def}. This +% allows other applications to make use of the declarations as +% well. +% +% Similar to the default encoding, the loading of the encoding +% files for the two major text encodings shouldn't be changed. +% In particular, the \texttt{inputenc} package depends on this. +% \changes{v2.2s}{1997/12/20}{Added documentation} +% +% \changes{v2.1d}{1994/01/05}{Removed nf prefix from file names.} +% \changes{v2.1f}{1994/05/14}{Removed .def files.} +% \changes{v2.1g}{1994/05/1g}{Removed \cs{DeclareFontEncoding} for ot1 +% and t1 and input .def files instead} +% \changes{v2.2c}{1994/10/25}{Added OMSenc.def} +% \changes{v2.2d}{1994/10/31}{Added OMLenc.def ...} +% \changes{v2.2e}{1994/10/31}{... and moved further down} +% \changes{v2.2f}{1994/11/07}{(DPC) Updated to use \cs{ProvidesFile}} +% \changes{v2.2h}{1994/11/16}{(DPC) Removed \cmd\{ and \cmd\}} +% \begin{macrocode} +\input {omlenc.def} +\input {t1enc.def} +\input {ot1enc.def} % <- should come after T1 for speed +\input {omsenc.def} +% \end{macrocode} +% +% We then set set the default text font encoding. This will +% hopefully change some day to |T1|. This setting should \emph{not} +% be changed to produce a portable format. +% \begin{macrocode} +\fontencoding{OT1} +% \end{macrocode} +% +% If different encodings for text fonts are in use one could put +% the common setup into |\DeclareFontEncodingDefaults|. There is +% now a better mechanism so using this interface is discouraged! +% \begin{macrocode} +\DeclareFontEncodingDefaults{}{} +% \end{macrocode} +% +% Then we define the default substitution for every encoding. +% This release of \LaTeXe{} assumes that the ec fonts are +% available. It is possible to change this to point to some other +% font family (e.g., Times with the appropriate encoding if it is +% available) without making documents non-portable. However, in +% such a case documents will produce different page breaks at other +% sites. The substitution defaults can all be changed without +% losing portability as long as there are font shape definitions +% for the selected substitutions. +% \begin{macrocode} +\DeclareFontSubstitution{T1}{cmr}{m}{n} +\DeclareFontSubstitution{OT1}{cmr}{m}{n} +% \end{macrocode} +% +% For every encoding declaration, \LaTeXe{} will try to verify that +% the given substitution information makes sense, i.e.~that it is +% impossible to go into an endless loop if font substitution +% happens. This is done at the moment the |\begin{document}| is +% encountered. \LaTeXe{} will then check that for every encoding the +% substitution defaults form a valid font shape group, which means +% that it will check if there is a |\DeclareFontShape| declaration +% for this combination. We will therefore load the corresponding +% |.fd| files now. If we don't do this they would be loaded at +% verification time (i.e.~at |\begin{document}| which would delay +% processing unnecessarily. +% +% \begin{quote} +% \textbf{Warning:} Please note that this means that you have to +% regenerate the format whenever you change any of these +% \texttt{.fd} files since \LaTeXe{} will not read \texttt{.fd} +% files if it already knows about the encoding/family +% combination. +% \end{quote} +% +% \changes{v2.2m}{1995/11/01}{add \cs{nfss@catcodes} for internal/1932} +% The |\nfss@catcodes| ensures that white space is ignored in any +% definitions made in the fd files. +% \begin{macrocode} +\begingroup +\nfss@catcodes +\input {t1cmr.fd} +\input {ot1cmr.fd} +\endgroup +% \end{macrocode} +% +% We also load some other font definition files which are normally +% needed in a document. This is only done for processing speed and +% you can comment the next two lines out to save some memory. If +% necessary these files are then loaded when your document is +% processed. (Loading |.fd| files is a less drastic step compared +% to preloading fonts because the number of fonts is limited 255 at +% (nearly) every \TeX{} installation, while the amount of main memory +% is not a limiting factor at most installations.) +% +% \begin{macrocode} +\begingroup +\nfss@catcodes +\input {ot1cmss.fd} +\input {ot1cmtt.fd} +\endgroup +% \end{macrocode} +% +% Even with all the precautions it is still possible that NFSS will +% run into problems, for example, when a |.fd| file contains +% corrupted data. To guard against such cases NFSS has a very +% low-level fallback font that is installed with the following line. +% \begin{macrocode} +\DeclareErrorFont{OT1}{cmr}{m}{n}{10} +% \end{macrocode} +% This means, ``if everything else fails use Computer Modern Roman +% normal shape at 10pt in the old text encoding''. +% You can change the font used but the encoding should be the same +% as the one specified with |\fontencoding| above. +% +% +% \subsection{Defaults} +% +% To allow the use of |\rmfamily|, |\sffamily|, etc.\ in documents +% even if non-standard families are used we provide nine macros +% which hold the name of the corresponding families, series, and so +% on. This makes it easy to use other font families (like Times +% Roman, etc.). One simply has to redefine these defaults. +% +% All these hooks have to be defined in this file but you can +% change their meaning (except for |\encodingdefault|) without +% making documents non-portable. +% +% +% \begin{macro}{\rmdefault} +% \begin{macro}{\sfdefault} +% \begin{macro}{\ttdefault} +% The following three definitions set up the meaning for +% |\rmfamily|, |\sffamily|, and |\ttfamily|. +% \begin{macrocode} +\newcommand\rmdefault{cmr} +\newcommand\sfdefault{cmss} +\newcommand\ttdefault{cmtt} +% \end{macrocode} +% \end{macro} +% \end{macro} +% \end{macro} +% +% \begin{macro}{\bfdefault} +% \begin{macro}{\mddefault} +% Series changing commands are influenced by the following hooks. +% \begin{macrocode} +\newcommand\bfdefault{bx} +\newcommand\mddefault{m} +% \end{macrocode} +% \end{macro} +% \end{macro} +% +% \begin{macro}{\itdefault} +% \begin{macro}{\sldefault} +% \begin{macro}{\scdefault} +% \begin{macro}{\updefault} +% Shape changing commands use the following hooks. +% \begin{macrocode} +\newcommand\itdefault{it} +\newcommand\sldefault{sl} +\newcommand\scdefault{sc} +\newcommand\updefault{n} +% \end{macrocode} +% \end{macro} +% \end{macro} +% \end{macro} +% \end{macro} +% +% \begin{macro}{\encodingdefault} +% \begin{macro}{\familydefault} +% \begin{macro}{\seriesdefault} +% \begin{macro}{\shapedefault} +% Finally we have the hooks that describe the behaviour of +% the |\normalfont| command. To stay portable, the definition of +% |\encodingdefault| should \emph{not} be changed and should match +% the setting above for |\fontencoding|. All other values can be +% set according to your taste. +% \begin{macrocode} +\newcommand\encodingdefault{OT1} +\newcommand\familydefault{\rmdefault} +\newcommand\seriesdefault{\mddefault} +\newcommand\shapedefault{\updefault} +% \end{macrocode} +% \end{macro} +% \end{macro} +% \end{macro} +% \end{macro} +% +% +% This finishes the low-level setup in \texttt{fonttext.ltx}. +% \begin{macrocode} +% +% \end{macrocode} +% +% +% +% +% \section{The \texttt{fontmath.ltx} file} +% +% The identification is done earlier on with a |\ProvidesFile| +% declaration. +% \begin{macrocode} +%<*math> +\typeout{=== Don't modify this file, use a .cfg file instead ===^^J} +% \end{macrocode} +% +% \subsection{The font encodings used} +% +% \begin{macrocode} +\DeclareFontEncoding{OML}{}{} +\DeclareFontEncoding{OMS}{}{} +\DeclareFontEncoding{OMX}{}{} +% \end{macrocode} +% Finally a declaration for |U| encoding which serves for all fonts +% that do not fit standard encodings. For math this sets up +% |\noaccents@| providing for AMS-\LaTeX{}. This macro is used +% therein to handle accented characters if they are not supported +% by the font. In other words, if fonts with |U| encoding are used +% in math, all accents (like from |\breve|) are obtained from some +% other font that has them. +% \begin{macrocode} +\DeclareFontEncoding{U}{}{\noaccents@} +% \end{macrocode} +% The encodings for math are next: +% \begin{macrocode} +\DeclareFontSubstitution{OML}{cmm}{m}{it} +\DeclareFontSubstitution{OMS}{cmsy}{m}{n} +\DeclareFontSubstitution{OMX}{cmex}{m}{n} +\DeclareFontSubstitution{U}{cmr}{m}{n} +% \end{macrocode} +% +% \begin{macrocode} +\begingroup +\nfss@catcodes +\input {omlcmm.fd} +\input {omscmsy.fd} +\input {omxcmex.fd} +\input {ucmr.fd} +\endgroup +% \end{macrocode} +% +% \subsubsection{Symbolfont and Alphabet declarations} +% +% We now define the basic symbol fonts used by \LaTeX{}. +% These four symbol fonts must be defined by this file. +% +% It is possible to make the symbol fonts point to other external +% fonts without losing the ability to process documents written +% at other sites, as long as one defines the same symbol font names +% with the same encodings, e.g.~|operators| with |OT1| etc. +% If other encodings are used documents become non-portable. +% Such a change should therefore be done in a package file. +% +% \changes{v2.1e}{1994/01/19}{Added missing setting for symbols in +% bold version.} +% \begin{macrocode} +\DeclareSymbolFont{operators} {OT1}{cmr} {m}{n} +\DeclareSymbolFont{letters} {OML}{cmm} {m}{it} +\DeclareSymbolFont{symbols} {OMS}{cmsy}{m}{n} +\DeclareSymbolFont{largesymbols}{OMX}{cmex}{m}{n} +% \end{macrocode} +% +% \begin{macrocode} +\SetSymbolFont{operators}{bold}{OT1}{cmr} {bx}{n} +\SetSymbolFont{letters} {bold}{OML}{cmm} {b}{it} +\SetSymbolFont{symbols} {bold}{OMS}{cmsy}{b}{n} +% \end{macrocode} +% +% Below are the seven math alphabets which are defined by NFSS. +% Again they must be defined by this file. +% However, as before you can change the fonts used without losing +% portability, but you should be careful when changing the encoding +% since that may make documents come out wrong. +% \begin{macrocode} +\DeclareSymbolFontAlphabet{\mathrm} {operators} +\DeclareSymbolFontAlphabet{\mathnormal}{letters} +\DeclareSymbolFontAlphabet{\mathcal} {symbols} +\DeclareMathAlphabet {\mathbf}{OT1}{cmr}{bx}{n} +\DeclareMathAlphabet {\mathsf}{OT1}{cmss}{m}{n} +\DeclareMathAlphabet {\mathit}{OT1}{cmr}{m}{it} +\DeclareMathAlphabet {\mathtt}{OT1}{cmtt}{m}{n} +% \end{macrocode} +% Given the currently available fonts we cannot bold-en |\mathbf| +% and |\mathtt| but in principle one could use `ultra bold' or +% something. The alphabets defined via |\DeclareSymbolFontAlphabet| +% will change automatically in a new math version if the +% corresponding symbol font changes. +% \begin{macrocode} +\SetMathAlphabet\mathsf{bold}{OT1}{cmss}{bx}{n} +\SetMathAlphabet\mathit{bold}{OT1}{cmr}{bx}{it} +% \end{macrocode} +% +% +% \subsection{Math font sizes} +% \changes{v2.2f}{1994/11/07} +% {(DPC) Add \cs{DeclareMathSizes} declarations} +% +% The declarations below declare the text, script and scriptscript +% size to be used for each text font size. +% +% All occurences of sizes longer than a single character are replaced +% with the macro name that holds them, saving a number of +% tokens (but losing a bit of speed, so this may not stay this way). +% \begin{macrocode} + \DeclareMathSizes{5}{5}{5}{5} + \DeclareMathSizes{6}{6}{5}{5} + \DeclareMathSizes{7}{7}{5}{5} + \DeclareMathSizes{8}{8}{6}{5} + \DeclareMathSizes{9}{9}{6}{5} + \DeclareMathSizes{\@xpt}{\@xpt}{7}{5} + \DeclareMathSizes{\@xipt}{\@xipt}{8}{6} + \DeclareMathSizes{\@xiipt}{\@xiipt}{8}{6} + \DeclareMathSizes{\@xivpt}{\@xivpt}{\@xpt}{7} + \DeclareMathSizes{\@xviipt}{\@xviipt}{\@xiipt}{\@xpt} + \DeclareMathSizes{\@xxpt}{\@xxpt}{\@xivpt}{\@xiipt} + \DeclareMathSizes{\@xxvpt}{\@xxvpt}{\@xxpt}{\@xviipt} +% \end{macrocode} +% +% \subsection{The math symbol assignments} +% +% We start by setting up math codes for most of the characters +% typed in directly from the keyboard. Most of them are normally +% already setup up in the same way by Ini\TeX{}. However, we repeat +% them here to have a complete setup which can be exchanged with +% another if desired. +% +% \subsubsection{The letters} +% \begin{macrocode} +\DeclareMathSymbol{a}{\mathalpha}{letters}{`a} +\DeclareMathSymbol{b}{\mathalpha}{letters}{`b} +\DeclareMathSymbol{c}{\mathalpha}{letters}{`c} +\DeclareMathSymbol{d}{\mathalpha}{letters}{`d} +\DeclareMathSymbol{e}{\mathalpha}{letters}{`e} +\DeclareMathSymbol{f}{\mathalpha}{letters}{`f} +\DeclareMathSymbol{g}{\mathalpha}{letters}{`g} +\DeclareMathSymbol{h}{\mathalpha}{letters}{`h} +\DeclareMathSymbol{i}{\mathalpha}{letters}{`i} +\DeclareMathSymbol{j}{\mathalpha}{letters}{`j} +\DeclareMathSymbol{k}{\mathalpha}{letters}{`k} +\DeclareMathSymbol{l}{\mathalpha}{letters}{`l} +\DeclareMathSymbol{m}{\mathalpha}{letters}{`m} +\DeclareMathSymbol{n}{\mathalpha}{letters}{`n} +\DeclareMathSymbol{o}{\mathalpha}{letters}{`o} +\DeclareMathSymbol{p}{\mathalpha}{letters}{`p} +\DeclareMathSymbol{q}{\mathalpha}{letters}{`q} +\DeclareMathSymbol{r}{\mathalpha}{letters}{`r} +\DeclareMathSymbol{s}{\mathalpha}{letters}{`s} +\DeclareMathSymbol{t}{\mathalpha}{letters}{`t} +\DeclareMathSymbol{u}{\mathalpha}{letters}{`u} +\DeclareMathSymbol{v}{\mathalpha}{letters}{`v} +\DeclareMathSymbol{w}{\mathalpha}{letters}{`w} +\DeclareMathSymbol{x}{\mathalpha}{letters}{`x} +\DeclareMathSymbol{y}{\mathalpha}{letters}{`y} +\DeclareMathSymbol{z}{\mathalpha}{letters}{`z} +% \end{macrocode} +% +% \begin{macrocode} +\DeclareMathSymbol{A}{\mathalpha}{letters}{`A} +\DeclareMathSymbol{B}{\mathalpha}{letters}{`B} +\DeclareMathSymbol{C}{\mathalpha}{letters}{`C} +\DeclareMathSymbol{D}{\mathalpha}{letters}{`D} +\DeclareMathSymbol{E}{\mathalpha}{letters}{`E} +\DeclareMathSymbol{F}{\mathalpha}{letters}{`F} +\DeclareMathSymbol{G}{\mathalpha}{letters}{`G} +\DeclareMathSymbol{H}{\mathalpha}{letters}{`H} +\DeclareMathSymbol{I}{\mathalpha}{letters}{`I} +\DeclareMathSymbol{J}{\mathalpha}{letters}{`J} +\DeclareMathSymbol{K}{\mathalpha}{letters}{`K} +\DeclareMathSymbol{L}{\mathalpha}{letters}{`L} +\DeclareMathSymbol{M}{\mathalpha}{letters}{`M} +\DeclareMathSymbol{N}{\mathalpha}{letters}{`N} +\DeclareMathSymbol{O}{\mathalpha}{letters}{`O} +\DeclareMathSymbol{P}{\mathalpha}{letters}{`P} +\DeclareMathSymbol{Q}{\mathalpha}{letters}{`Q} +\DeclareMathSymbol{R}{\mathalpha}{letters}{`R} +\DeclareMathSymbol{S}{\mathalpha}{letters}{`S} +\DeclareMathSymbol{T}{\mathalpha}{letters}{`T} +\DeclareMathSymbol{U}{\mathalpha}{letters}{`U} +\DeclareMathSymbol{V}{\mathalpha}{letters}{`V} +\DeclareMathSymbol{W}{\mathalpha}{letters}{`W} +\DeclareMathSymbol{X}{\mathalpha}{letters}{`X} +\DeclareMathSymbol{Y}{\mathalpha}{letters}{`Y} +\DeclareMathSymbol{Z}{\mathalpha}{letters}{`Z} +% \end{macrocode} +% +% \subsubsection{The digits} +% +% \begin{macrocode} +\DeclareMathSymbol{0}{\mathalpha}{operators}{`0} +\DeclareMathSymbol{1}{\mathalpha}{operators}{`1} +\DeclareMathSymbol{2}{\mathalpha}{operators}{`2} +\DeclareMathSymbol{3}{\mathalpha}{operators}{`3} +\DeclareMathSymbol{4}{\mathalpha}{operators}{`4} +\DeclareMathSymbol{5}{\mathalpha}{operators}{`5} +\DeclareMathSymbol{6}{\mathalpha}{operators}{`6} +\DeclareMathSymbol{7}{\mathalpha}{operators}{`7} +\DeclareMathSymbol{8}{\mathalpha}{operators}{`8} +\DeclareMathSymbol{9}{\mathalpha}{operators}{`9} +% \end{macrocode} +% +% +% \subsubsection{Punctuation, brace, etc. keys} +% +% \begin{macrocode} +\DeclareMathSymbol{!}{\mathclose}{operators}{"21} +\DeclareMathSymbol{*}{\mathbin}{symbols}{"03} % \ast +\DeclareMathSymbol{+}{\mathbin}{operators}{"2B} +\DeclareMathSymbol{,}{\mathpunct}{letters}{"3B} +\DeclareMathSymbol{-}{\mathbin}{symbols}{"00} +\DeclareMathSymbol{.}{\mathord}{letters}{"3A} +\DeclareMathSymbol{:}{\mathrel}{operators}{"3A} +\DeclareMathSymbol{;}{\mathpunct}{operators}{"3B} +\DeclareMathSymbol{=}{\mathrel}{operators}{"3D} +\DeclareMathSymbol{?}{\mathclose}{operators}{"3F} +% \end{macrocode} +% The following symbols are defined as delimiters below +% which automatically defines them as math symbols. +% \begin{macrocode} +%\DeclareMathSymbol{(}{\mathopen}{operators}{"28} +%\DeclareMathSymbol{)}{\mathclose}{operators}{"29} +%\DeclareMathSymbol{/}{\mathord}{letters}{"3D} +%\DeclareMathSymbol{[}{\mathopen}{operators}{"5B} +%\DeclareMathSymbol{]}{\mathclose}{operators}{"5D} +%\DeclareMathSymbol{|}{\mathord}{symbols}{"6A} +%\DeclareMathSymbol{<}{\mathrel}{letters}{"3C} +%\DeclareMathSymbol{>}{\mathrel}{letters}{"3E} +% \end{macrocode} +% +% Should all of the following being activated by default? Probably +% not. +% \begin{macrocode} +%\DeclareMathSymbol{`\{}{\mathopen}{symbols}{"66} +%\DeclareMathSymbol{`\}}{\mathclose}{symbols}{"67} +%\DeclareMathSymbol{`\\}{\mathord}{symbols}{"6E} % \backslash +\mathcode`\ ="8000 % \space +\mathcode`\'="8000 % ^\prime +\mathcode`\_="8000 % \_ +% \end{macrocode} +% +% +% \subsubsection{Delimitercodes for characters} +% \changes{v2.2q}{1997/01/08} +% {Use \cs{DeclareMathDelimiter} to set delimiter codes} +% \changes{v2.2u}{1998/04/15} +% {Use new syntax for \cs{DeclareMathDelimiter}} +% [to be completed] +% +% Finally, Ini\TeX{} sets all |\delcode| values to -1, except +% |\delcode`.=0| +% \begin{macrocode} +\DeclareMathDelimiter{(}{\mathopen} {operators}{"28}{largesymbols}{"00} +\DeclareMathDelimiter{)}{\mathclose}{operators}{"29}{largesymbols}{"01} +\DeclareMathDelimiter{[}{\mathopen} {operators}{"5B}{largesymbols}{"02} +\DeclareMathDelimiter{]}{\mathclose}{operators}{"5D}{largesymbols}{"03} +% \end{macrocode} +% +% The next two are considered to be relations when not used in the context +% of a delimiter! And worse, they do even represent different glyphs when +% being used as delimiter and not as delimiter. This is a user level syntax +% inherited from plain \TeX{}. Therefore we explicitly redefine the math +% symbol definitions for these symbols afterwards. +% \changes{v2.2v}{1998/04/17} +% {Reinsert symbol defs for \texttt{<} and \texttt{\char62} chars.} +% \begin{macrocode} +\DeclareMathDelimiter{<}{\mathopen}{symbols}{"68}{largesymbols}{"0A} +\DeclareMathDelimiter{>}{\mathclose}{symbols}{"69}{largesymbols}{"0B} +\DeclareMathSymbol{<}{\mathrel}{letters}{"3C} +\DeclareMathSymbol{>}{\mathrel}{letters}{"3E} +% \end{macrocode} +% And here is another case where the non-delimiter version produces a +% glyph different from the delimiter version. +% \changes{v2.2w}{1998/04/18} +% {Reinsert symbol def for \texttt{/} char.} +% \begin{macrocode} +\DeclareMathDelimiter{/}{\mathord}{operators}{"2F}{largesymbols}{"0E} +\DeclareMathSymbol{/}{\mathord}{letters}{"3D} +% \end{macrocode} +% +% \begin{macrocode} +\DeclareMathDelimiter{|}{\mathord}{symbols}{"6A}{largesymbols}{"0C} +% \end{macrocode} +% +% \begin{macrocode} +\expandafter\DeclareMathDelimiter\@backslashchar + {\mathord}{symbols}{"6E}{largesymbols}{"0F} +% \end{macrocode} +% N.B. |{| and |}| should NOT get delcodes; +% otherwise parameter grouping fails! +% +% +% \subsection{Symbols accessed via control sequences} +% +% \subsubsection{Greek letters} +% +% \begin{macrocode} +\DeclareMathSymbol{\alpha}{\mathord}{letters}{"0B} +\DeclareMathSymbol{\beta}{\mathord}{letters}{"0C} +\DeclareMathSymbol{\gamma}{\mathord}{letters}{"0D} +\DeclareMathSymbol{\delta}{\mathord}{letters}{"0E} +\DeclareMathSymbol{\epsilon}{\mathord}{letters}{"0F} +\DeclareMathSymbol{\zeta}{\mathord}{letters}{"10} +\DeclareMathSymbol{\eta}{\mathord}{letters}{"11} +\DeclareMathSymbol{\theta}{\mathord}{letters}{"12} +\DeclareMathSymbol{\iota}{\mathord}{letters}{"13} +\DeclareMathSymbol{\kappa}{\mathord}{letters}{"14} +\DeclareMathSymbol{\lambda}{\mathord}{letters}{"15} +\DeclareMathSymbol{\mu}{\mathord}{letters}{"16} +\DeclareMathSymbol{\nu}{\mathord}{letters}{"17} +\DeclareMathSymbol{\xi}{\mathord}{letters}{"18} +\DeclareMathSymbol{\pi}{\mathord}{letters}{"19} +\DeclareMathSymbol{\rho}{\mathord}{letters}{"1A} +\DeclareMathSymbol{\sigma}{\mathord}{letters}{"1B} +\DeclareMathSymbol{\tau}{\mathord}{letters}{"1C} +\DeclareMathSymbol{\upsilon}{\mathord}{letters}{"1D} +\DeclareMathSymbol{\phi}{\mathord}{letters}{"1E} +\DeclareMathSymbol{\chi}{\mathord}{letters}{"1F} +\DeclareMathSymbol{\psi}{\mathord}{letters}{"20} +\DeclareMathSymbol{\omega}{\mathord}{letters}{"21} +\DeclareMathSymbol{\varepsilon}{\mathord}{letters}{"22} +\DeclareMathSymbol{\vartheta}{\mathord}{letters}{"23} +\DeclareMathSymbol{\varpi}{\mathord}{letters}{"24} +\DeclareMathSymbol{\varrho}{\mathord}{letters}{"25} +\DeclareMathSymbol{\varsigma}{\mathord}{letters}{"26} +\DeclareMathSymbol{\varphi}{\mathord}{letters}{"27} +\DeclareMathSymbol{\Gamma}{\mathalpha}{operators}{"00} +\DeclareMathSymbol{\Delta}{\mathalpha}{operators}{"01} +\DeclareMathSymbol{\Theta}{\mathalpha}{operators}{"02} +\DeclareMathSymbol{\Lambda}{\mathalpha}{operators}{"03} +\DeclareMathSymbol{\Xi}{\mathalpha}{operators}{"04} +\DeclareMathSymbol{\Pi}{\mathalpha}{operators}{"05} +\DeclareMathSymbol{\Sigma}{\mathalpha}{operators}{"06} +\DeclareMathSymbol{\Upsilon}{\mathalpha}{operators}{"07} +\DeclareMathSymbol{\Phi}{\mathalpha}{operators}{"08} +\DeclareMathSymbol{\Psi}{\mathalpha}{operators}{"09} +\DeclareMathSymbol{\Omega}{\mathalpha}{operators}{"0A} +% \end{macrocode} +% +% +% \subsubsection{Ordinary symbols} +% +% \begin{macrocode} +\DeclareMathSymbol{\aleph}{\mathord}{symbols}{"40} +\def\hbar{{\mathchar'26\mkern-9muh}} +\DeclareMathSymbol{\imath}{\mathord}{letters}{"7B} +\DeclareMathSymbol{\jmath}{\mathord}{letters}{"7C} +\DeclareMathSymbol{\ell}{\mathord}{letters}{"60} +\DeclareMathSymbol{\wp}{\mathord}{letters}{"7D} +\DeclareMathSymbol{\Re}{\mathord}{symbols}{"3C} +\DeclareMathSymbol{\Im}{\mathord}{symbols}{"3D} +\DeclareMathSymbol{\partial}{\mathord}{letters}{"40} +\DeclareMathSymbol{\infty}{\mathord}{symbols}{"31} +\DeclareMathSymbol{\prime}{\mathord}{symbols}{"30} +\DeclareMathSymbol{\emptyset}{\mathord}{symbols}{"3B} +\DeclareMathSymbol{\nabla}{\mathord}{symbols}{"72} +\def\surd{{\mathchar"1270}} +\DeclareMathSymbol{\top}{\mathord}{symbols}{"3E} +\DeclareMathSymbol{\bot}{\mathord}{symbols}{"3F} +\def\angle{{\vbox{\ialign{$\m@th\scriptstyle##$\crcr + \not\mathrel{\mkern14mu}\crcr + \noalign{\nointerlineskip} + \mkern2.5mu\leaders\hrule \@height.34pt\hfill\mkern2.5mu\crcr}}}} +\DeclareMathSymbol{\triangle}{\mathord}{symbols}{"34} +\DeclareMathSymbol{\forall}{\mathord}{symbols}{"38} +\DeclareMathSymbol{\exists}{\mathord}{symbols}{"39} +\DeclareMathSymbol{\neg}{\mathord}{symbols}{"3A} + \let\lnot=\neg +\DeclareMathSymbol{\flat}{\mathord}{letters}{"5B} +\DeclareMathSymbol{\natural}{\mathord}{letters}{"5C} +\DeclareMathSymbol{\sharp}{\mathord}{letters}{"5D} +\DeclareMathSymbol{\clubsuit}{\mathord}{symbols}{"7C} +\DeclareMathSymbol{\diamondsuit}{\mathord}{symbols}{"7D} +\DeclareMathSymbol{\heartsuit}{\mathord}{symbols}{"7E} +\DeclareMathSymbol{\spadesuit}{\mathord}{symbols}{"7F} +% \end{macrocode} +% +% +% \subsubsection{Large Operators} +% +% \begin{macrocode} +\DeclareMathSymbol{\coprod}{\mathop}{largesymbols}{"60} +\DeclareMathSymbol{\bigvee}{\mathop}{largesymbols}{"57} +\DeclareMathSymbol{\bigwedge}{\mathop}{largesymbols}{"56} +\DeclareMathSymbol{\biguplus}{\mathop}{largesymbols}{"55} +\DeclareMathSymbol{\bigcap}{\mathop}{largesymbols}{"54} +\DeclareMathSymbol{\bigcup}{\mathop}{largesymbols}{"53} +\DeclareMathSymbol{\intop}{\mathop}{largesymbols}{"52} + \def\int{\intop\nolimits} +\DeclareMathSymbol{\prod}{\mathop}{largesymbols}{"51} +\DeclareMathSymbol{\sum}{\mathop}{largesymbols}{"50} +\DeclareMathSymbol{\bigotimes}{\mathop}{largesymbols}{"4E} +\DeclareMathSymbol{\bigoplus}{\mathop}{largesymbols}{"4C} +\DeclareMathSymbol{\bigodot}{\mathop}{largesymbols}{"4A} +\DeclareMathSymbol{\ointop}{\mathop}{largesymbols}{"48} + \def\oint{\ointop\nolimits} +\DeclareMathSymbol{\bigsqcup}{\mathop}{largesymbols}{"46} +\DeclareMathSymbol{\smallint}{\mathop}{symbols}{"73} +% \end{macrocode} +% +% +% \subsubsection{Binary symbols} +% +% \changes{v2.3a}{2004/02/04} +% {Added bigtriangle synonyms for stmaryrd} +% \begin{macrocode} +\DeclareMathSymbol{\triangleleft}{\mathbin}{letters}{"2F} +\DeclareMathSymbol{\triangleright}{\mathbin}{letters}{"2E} +\DeclareMathSymbol{\bigtriangleup}{\mathbin}{symbols}{"34} +\DeclareMathSymbol{\bigtriangledown}{\mathbin}{symbols}{"35} + \let \varbigtriangledown \bigtriangledown + \let \varbigtriangleup \bigtriangleup +% \end{macrocode} +% +% These last two synonyms are needed because the \textsf{stamryrd} +% package redefines them as Operators. +% +% \begin{macrocode} +\DeclareMathSymbol{\wedge}{\mathbin}{symbols}{"5E} + \let\land=\wedge +\DeclareMathSymbol{\vee}{\mathbin}{symbols}{"5F} + \let\lor=\vee +\DeclareMathSymbol{\cap}{\mathbin}{symbols}{"5C} +\DeclareMathSymbol{\cup}{\mathbin}{symbols}{"5B} +\DeclareMathSymbol{\ddagger}{\mathbin}{symbols}{"7A} +\DeclareMathSymbol{\dagger}{\mathbin}{symbols}{"79} +\DeclareMathSymbol{\sqcap}{\mathbin}{symbols}{"75} +\DeclareMathSymbol{\sqcup}{\mathbin}{symbols}{"74} +\DeclareMathSymbol{\uplus}{\mathbin}{symbols}{"5D} +\DeclareMathSymbol{\amalg}{\mathbin}{symbols}{"71} +\DeclareMathSymbol{\diamond}{\mathbin}{symbols}{"05} +\DeclareMathSymbol{\bullet}{\mathbin}{symbols}{"0F} +\DeclareMathSymbol{\wr}{\mathbin}{symbols}{"6F} +\DeclareMathSymbol{\div}{\mathbin}{symbols}{"04} +\DeclareMathSymbol{\odot}{\mathbin}{symbols}{"0C} +\DeclareMathSymbol{\oslash}{\mathbin}{symbols}{"0B} +\DeclareMathSymbol{\otimes}{\mathbin}{symbols}{"0A} +\DeclareMathSymbol{\ominus}{\mathbin}{symbols}{"09} +\DeclareMathSymbol{\oplus}{\mathbin}{symbols}{"08} +\DeclareMathSymbol{\mp}{\mathbin}{symbols}{"07} +\DeclareMathSymbol{\pm}{\mathbin}{symbols}{"06} +\DeclareMathSymbol{\circ}{\mathbin}{symbols}{"0E} +\DeclareMathSymbol{\bigcirc}{\mathbin}{symbols}{"0D} +\DeclareMathSymbol{\setminus}{\mathbin}{symbols}{"6E} +\DeclareMathSymbol{\cdot}{\mathbin}{symbols}{"01} +\DeclareMathSymbol{\ast}{\mathbin}{symbols}{"03} +\DeclareMathSymbol{\times}{\mathbin}{symbols}{"02} +\DeclareMathSymbol{\star}{\mathbin}{letters}{"3F} +% \end{macrocode} +% +% +% \subsubsection{Relations} +% +% \begin{macrocode} +\DeclareMathSymbol{\propto}{\mathrel}{symbols}{"2F} +\DeclareMathSymbol{\sqsubseteq}{\mathrel}{symbols}{"76} +\DeclareMathSymbol{\sqsupseteq}{\mathrel}{symbols}{"77} +\DeclareMathSymbol{\parallel}{\mathrel}{symbols}{"6B} +\DeclareMathSymbol{\mid}{\mathrel}{symbols}{"6A} +\DeclareMathSymbol{\dashv}{\mathrel}{symbols}{"61} +\DeclareMathSymbol{\vdash}{\mathrel}{symbols}{"60} +\DeclareMathSymbol{\nearrow}{\mathrel}{symbols}{"25} +\DeclareMathSymbol{\searrow}{\mathrel}{symbols}{"26} +\DeclareMathSymbol{\nwarrow}{\mathrel}{symbols}{"2D} +\DeclareMathSymbol{\swarrow}{\mathrel}{symbols}{"2E} +\DeclareMathSymbol{\Leftrightarrow}{\mathrel}{symbols}{"2C} +\DeclareMathSymbol{\Leftarrow}{\mathrel}{symbols}{"28} +\DeclareMathSymbol{\Rightarrow}{\mathrel}{symbols}{"29} +\def\neq{\not=} \let\ne=\neq +\DeclareMathSymbol{\leq}{\mathrel}{symbols}{"14} + \let\le=\leq +\DeclareMathSymbol{\geq}{\mathrel}{symbols}{"15} + \let\ge=\geq +\DeclareMathSymbol{\succ}{\mathrel}{symbols}{"1F} +\DeclareMathSymbol{\prec}{\mathrel}{symbols}{"1E} +\DeclareMathSymbol{\approx}{\mathrel}{symbols}{"19} +\DeclareMathSymbol{\succeq}{\mathrel}{symbols}{"17} +\DeclareMathSymbol{\preceq}{\mathrel}{symbols}{"16} +\DeclareMathSymbol{\supset}{\mathrel}{symbols}{"1B} +\DeclareMathSymbol{\subset}{\mathrel}{symbols}{"1A} +\DeclareMathSymbol{\supseteq}{\mathrel}{symbols}{"13} +\DeclareMathSymbol{\subseteq}{\mathrel}{symbols}{"12} +\DeclareMathSymbol{\in}{\mathrel}{symbols}{"32} +\DeclareMathSymbol{\ni}{\mathrel}{symbols}{"33} + \let\owns=\ni +\DeclareMathSymbol{\gg}{\mathrel}{symbols}{"1D} +\DeclareMathSymbol{\ll}{\mathrel}{symbols}{"1C} +\DeclareMathSymbol{\not}{\mathrel}{symbols}{"36} +\DeclareMathSymbol{\leftrightarrow}{\mathrel}{symbols}{"24} +\DeclareMathSymbol{\leftarrow}{\mathrel}{symbols}{"20} + \let\gets=\leftarrow +\DeclareMathSymbol{\rightarrow}{\mathrel}{symbols}{"21} + \let\to=\rightarrow +\DeclareMathSymbol{\mapstochar}{\mathrel}{symbols}{"37} + \def\mapsto{\mapstochar\rightarrow} +\DeclareMathSymbol{\sim}{\mathrel}{symbols}{"18} +\DeclareMathSymbol{\simeq}{\mathrel}{symbols}{"27} +\DeclareMathSymbol{\perp}{\mathrel}{symbols}{"3F} +\DeclareMathSymbol{\equiv}{\mathrel}{symbols}{"11} +\DeclareMathSymbol{\asymp}{\mathrel}{symbols}{"10} +\DeclareMathSymbol{\smile}{\mathrel}{letters}{"5E} +\DeclareMathSymbol{\frown}{\mathrel}{letters}{"5F} +\DeclareMathSymbol{\leftharpoonup}{\mathrel}{letters}{"28} +\DeclareMathSymbol{\leftharpoondown}{\mathrel}{letters}{"29} +\DeclareMathSymbol{\rightharpoonup}{\mathrel}{letters}{"2A} +\DeclareMathSymbol{\rightharpoondown}{\mathrel}{letters}{"2B} +% \end{macrocode} +% +% Here cometh much profligate robustification of math constructs. +% Warning: some of these commands may become non-robust if an +% AMS package is loaded. +% +% Further potential problems: some math font packages may make +% unfortunate assumptions about some of these definitions that are +% not true of the robust versions we need. +% \changes{v2.3}{2004/02/02} +% {Many things from here on made robust} +% \begin{macrocode} +\DeclareRobustCommand + \cong{\mathrel{\mathpalette\@vereq\sim}} % congruence sign +\def\@vereq#1#2{\lower.5\p@\vbox{\lineskiplimit\maxdimen\lineskip-.5\p@ + \ialign{$\m@th#1\hfil##\hfil$\crcr#2\crcr=\crcr}}} +\DeclareRobustCommand + \notin{\mathrel{\m@th\mathpalette\c@ncel\in}} +\def\c@ncel#1#2{\m@th\ooalign{$\hfil#1\mkern1mu/\hfil$\crcr$#1#2$}} +\DeclareRobustCommand + \rightleftharpoons{\mathrel{\mathpalette\rlh@{}}} +\def\rlh@#1{\vcenter{\m@th\hbox{\ooalign{\raise2pt + \hbox{$#1\rightharpoonup$}\crcr + $#1\leftharpoondown$}}}} +\DeclareRobustCommand + \doteq{\buildrel\textstyle.\over=} +% \end{macrocode} +% +% \subsubsection{Arrows} +% +% \begin{macrocode} +\DeclareRobustCommand + \joinrel{\mathrel{\mkern-3mu}} +\DeclareRobustCommand + \relbar{\mathrel{\smash-}} % \smash, because - + % has the same height as + +% \end{macrocode} +% In contrast to \texttt{plain.tex} |\Relbar| got braces around the +% equal sign to guard against it being ``math active'' expanding to +% |\futurelet...|. This might be the case when packages are +% implementing shorthands for math, e.g. |=>| meaning |\Rightarrow| +% etc. It would actually be better not to use |=| in such +% definitions but instead define something like |\mathequalsign| +% and use this. However we can't do this now as it would break +% other math layouts where characters are in different places +% (since those wouldn't know about the need for a new command name). +% \changes{v2.2z}{2001/06/04}{Guard against math active equal sign in +% \cs{Relbar} (pr/3333)} +% \begin{macrocode} +\DeclareRobustCommand + \Relbar{\mathrel{=}} +\DeclareMathSymbol{\lhook}{\mathrel}{letters}{"2C} + \def\hookrightarrow{\lhook\joinrel\rightarrow} +\DeclareMathSymbol{\rhook}{\mathrel}{letters}{"2D} + \def\hookleftarrow{\leftarrow\joinrel\rhook} +\DeclareRobustCommand + \bowtie{\mathrel\triangleright\joinrel\mathrel\triangleleft} +% \end{macrocode} +% +% \changes{v2.2z}{2001/06/04}{Guard against math active equal and pipe +% sign in \cs{models} (pr/3333)} +% \begin{macrocode} +\DeclareRobustCommand + \models{\mathrel{|}\joinrel\Relbar} +\DeclareRobustCommand + \Longrightarrow{\Relbar\joinrel\Rightarrow} +% \end{macrocode} +% +% LaTeX Change: |\longrightarrow| and |\longleftarrow| redefined to make +% then robust. +% \begin{macrocode} +\DeclareRobustCommand\longrightarrow + {\relbar\joinrel\rightarrow} +\DeclareRobustCommand\longleftarrow + {\leftarrow\joinrel\relbar} +% \end{macrocode} +% +% \begin{macrocode} +\DeclareRobustCommand + \Longleftarrow{\Leftarrow\joinrel\Relbar} +\DeclareRobustCommand + \longmapsto{\mapstochar\longrightarrow} +\DeclareRobustCommand + \longleftrightarrow{\leftarrow\joinrel\rightarrow} +\DeclareRobustCommand + \Longleftrightarrow{\Leftarrow\joinrel\Rightarrow} +\DeclareRobustCommand + \iff{\;\Longleftrightarrow\;} +% \end{macrocode} +% +% +% \subsubsection{Punctuation symbols} +% +% \begin{macrocode} +\DeclareMathSymbol{\ldotp}{\mathpunct}{letters}{"3A} +\DeclareMathSymbol{\cdotp}{\mathpunct}{symbols}{"01} +\DeclareMathSymbol{\colon}{\mathpunct}{operators}{"3A} +% \end{macrocode} +% +% +% This is commented out, since |\ldots| is now defined in ltoutenc.dtx. +% \begin{macrocode} +%\def\@ldots{\mathinner{\ldotp\ldotp\ldotp}} +%\DeclareRobustCommand\ldots +% {\relax\ifmmode\@ldots\else\mbox{$\m@th\@ldots\,$}\fi} +% \end{macrocode} +% +% \begin{macrocode} +\DeclareRobustCommand + \cdots{\mathinner{\cdotp\cdotp\cdotp}} +\DeclareRobustCommand + \vdots{\vbox{\baselineskip4\p@ \lineskiplimit\z@ + \kern6\p@\hbox{.}\hbox{.}\hbox{.}}} +\DeclareRobustCommand + \ddots{\mathinner{\mkern1mu\raise7\p@ + \vbox{\kern7\p@\hbox{.}}\mkern2mu + \raise4\p@\hbox{.}\mkern2mu\raise\p@\hbox{.}\mkern1mu}} +% \end{macrocode} +% +% +% \subsubsection{Math accents} +% +% \begin{macrocode} +\DeclareMathAccent{\acute}{\mathalpha}{operators}{"13} +\DeclareMathAccent{\grave}{\mathalpha}{operators}{"12} +\DeclareMathAccent{\ddot}{\mathalpha}{operators}{"7F} +\DeclareMathAccent{\tilde}{\mathalpha}{operators}{"7E} +\DeclareMathAccent{\bar}{\mathalpha}{operators}{"16} +\DeclareMathAccent{\breve}{\mathalpha}{operators}{"15} +\DeclareMathAccent{\check}{\mathalpha}{operators}{"14} +\DeclareMathAccent{\hat}{\mathalpha}{operators}{"5E} +\DeclareMathAccent{\vec}{\mathord}{letters}{"7E} +\DeclareMathAccent{\dot}{\mathalpha}{operators}{"5F} +\DeclareMathAccent{\widetilde}{\mathord}{largesymbols}{"65} +\DeclareMathAccent{\widehat}{\mathord}{largesymbols}{"62} +% \end{macrocode} +% For some reason plain \TeX{} never bothered to provide +% a ring accent in math (although it is available in the fonts), +% but since we got a request for it here we go: +% \changes{v2.2t}{1998/04/11}{Added \cs{mathring} accent (pr2785)} +% \begin{macrocode} +\DeclareMathAccent{\mathring}{\mathalpha}{operators}{"17} +% \end{macrocode} +% +% +% \subsubsection{Radicals} +% +% \changes{v2.2o}{1996/05/17}{\cs{@@sqrt} removed, at last} +% \begin{macrocode} +\DeclareMathRadical{\sqrtsign}{symbols}{"70}{largesymbols}{"70} +% \end{macrocode} +% +% +% \subsubsection{Over and under something, etc} +% +% \begin{macrocode} +\def\overrightarrow#1{\vbox{\m@th\ialign{##\crcr + \rightarrowfill\crcr\noalign{\kern-\p@\nointerlineskip} + $\hfil\displaystyle{#1}\hfil$\crcr}}} +\def\overleftarrow#1{\vbox{\m@th\ialign{##\crcr + \leftarrowfill\crcr\noalign{\kern-\p@\nointerlineskip}% + $\hfil\displaystyle{#1}\hfil$\crcr}}} +\def\overbrace#1{\mathop{\vbox{\m@th\ialign{##\crcr\noalign{\kern3\p@}% + \downbracefill\crcr\noalign{\kern3\p@\nointerlineskip}% + $\hfil\displaystyle{#1}\hfil$\crcr}}}\limits} +\def\underbrace#1{\mathop{\vtop{\m@th\ialign{##\crcr + $\hfil\displaystyle{#1}\hfil$\crcr + \noalign{\kern3\p@\nointerlineskip}% + \upbracefill\crcr\noalign{\kern3\p@}}}}\limits} +% \end{macrocode} +% (quite a waste of tokens, IMHO --- Frank) +% \begin{macrocode} +\def\skew#1#2#3{{\muskip\z@#1mu\divide\muskip\z@\tw@ \mkern\muskip\z@ + #2{\mkern-\muskip\z@{#3}\mkern\muskip\z@}\mkern-\muskip\z@}{}} +% \end{macrocode} +% +% \changes{v2.2n}{1995/11/21}{Incorporate changed figures, +% as in plain.tex} +% \begin{macrocode} +\def\rightarrowfill{$\m@th\smash-\mkern-7mu% + \cleaders\hbox{$\mkern-2mu\smash-\mkern-2mu$}\hfill + \mkern-7mu\mathord\rightarrow$} +\def\leftarrowfill{$\m@th\mathord\leftarrow\mkern-7mu% + \cleaders\hbox{$\mkern-2mu\smash-\mkern-2mu$}\hfill + \mkern-7mu\smash-$} +\DeclareMathSymbol{\braceld}{\mathord}{largesymbols}{"7A} +\DeclareMathSymbol{\bracerd}{\mathord}{largesymbols}{"7B} +\DeclareMathSymbol{\bracelu}{\mathord}{largesymbols}{"7C} +\DeclareMathSymbol{\braceru}{\mathord}{largesymbols}{"7D} +\def\downbracefill{$\m@th \setbox\z@\hbox{$\braceld$}% + \braceld\leaders\vrule \@height\ht\z@ \@depth\z@\hfill\braceru + \bracelu\leaders\vrule \@height\ht\z@ \@depth\z@\hfill\bracerd$} +\def\upbracefill{$\m@th \setbox\z@\hbox{$\braceld$}% + \bracelu\leaders\vrule \@height\ht\z@ \@depth\z@\hfill\bracerd + \braceld\leaders\vrule \@height\ht\z@ \@depth\z@\hfill\braceru$} +% \end{macrocode} +% +% \subsubsection{Delimiters} +% +% \begin{macrocode} +\DeclareMathDelimiter{\lmoustache} % top from (, bottom from ) + {\mathopen}{largesymbols}{"7A}{largesymbols}{"40} +\DeclareMathDelimiter{\rmoustache} % top from ), bottom from ( + {\mathclose}{largesymbols}{"7B}{largesymbols}{"41} +\DeclareMathDelimiter{\arrowvert} % arrow without arrowheads + {\mathord}{symbols}{"6A}{largesymbols}{"3C} +\DeclareMathDelimiter{\Arrowvert} % double arrow without arrowheads + {\mathord}{symbols}{"6B}{largesymbols}{"3D} +\DeclareMathDelimiter{\Vert} + {\mathord}{symbols}{"6B}{largesymbols}{"0D} +\let\|=\Vert +\DeclareMathDelimiter{\vert} + {\mathord}{symbols}{"6A}{largesymbols}{"0C} +\DeclareMathDelimiter{\uparrow} + {\mathrel}{symbols}{"22}{largesymbols}{"78} +\DeclareMathDelimiter{\downarrow} + {\mathrel}{symbols}{"23}{largesymbols}{"79} +\DeclareMathDelimiter{\updownarrow} + {\mathrel}{symbols}{"6C}{largesymbols}{"3F} +\DeclareMathDelimiter{\Uparrow} + {\mathrel}{symbols}{"2A}{largesymbols}{"7E} +\DeclareMathDelimiter{\Downarrow} + {\mathrel}{symbols}{"2B}{largesymbols}{"7F} +\DeclareMathDelimiter{\Updownarrow} + {\mathrel}{symbols}{"6D}{largesymbols}{"77} +\DeclareMathDelimiter{\backslash} % for double coset G\backslash H + {\mathord}{symbols}{"6E}{largesymbols}{"0F} +\DeclareMathDelimiter{\rangle} + {\mathclose}{symbols}{"69}{largesymbols}{"0B} +\DeclareMathDelimiter{\langle} + {\mathopen}{symbols}{"68}{largesymbols}{"0A} +\DeclareMathDelimiter{\rbrace} + {\mathclose}{symbols}{"67}{largesymbols}{"09} +\DeclareMathDelimiter{\lbrace} + {\mathopen}{symbols}{"66}{largesymbols}{"08} +\DeclareMathDelimiter{\rceil} + {\mathclose}{symbols}{"65}{largesymbols}{"07} +\DeclareMathDelimiter{\lceil} + {\mathopen}{symbols}{"64}{largesymbols}{"06} +\DeclareMathDelimiter{\rfloor} + {\mathclose}{symbols}{"63}{largesymbols}{"05} +\DeclareMathDelimiter{\lfloor} + {\mathopen}{symbols}{"62}{largesymbols}{"04} +% \end{macrocode} +% +% \begin{macro}{\lgroup} +% \begin{macro}{\rgroup} +% \begin{macro}{\bracevert} +% There are three plain \TeX{} delimiters which are not fully +% supported by NFSS, since they partly point into a bold cmr font. +% Allocating a full symbol font, just to have three delimiters +% seems a bit too much given the limited space available. For this +% reason only the extensible sizes are supported. If this is not +% desired one can use, without losing portability, define |\mathbf| +% and |\mathtt| as font symbol alphabet (setting up +% \texttt{cmr/bx/n} and \texttt{cmtt/m/n} as symbol fonts first) +% and modify the delimiter declarations to point with their +% small variant to those symbol fonts. (This is done in +% \texttt{oldlfont.dtx} so look there for examples.) +% \begin{macrocode} +\DeclareMathDelimiter{\lgroup} % extensible ( with sharper tips + {\mathopen}{largesymbols}{"3A}{largesymbols}{"3A} +\DeclareMathDelimiter{\rgroup} % extensible ) with sharper tips + {\mathclose}{largesymbols}{"3B}{largesymbols}{"3B} +\DeclareMathDelimiter{\bracevert} % the vertical bar that extends braces + {\mathord}{largesymbols}{"3E}{largesymbols}{"3E} +% \end{macrocode} +% \end{macro} +% \end{macro} +% \end{macro} +% +% \subsection{Math versions of text commands} +% +% \changes{v2.2k}{1995/06/05}{Moved math commands from ltoutenc.dtx.} +% +% The |\mathunderscore| here is really a text definition, so it has +% been put back into |ltoutenc.dtx| (by Chris, 30/04/97) and should +% be removed from here. +% +% These symbols are the math versions of text commands such as |\P|, +% |\$|, etc. +% \begin{macro}{\mathparagraph} +% \changes{v2.2q}{1997/01/08} +% {Define using \cs{DeclareMathSymbol}} +% \begin{macro}{\mathsection} +% \begin{macro}{\mathdollar} +% \begin{macro}{\mathsterling} +% \begin{macro}{\mathunderscore} +% These math symbols are not in plain \TeX. +% \begin{macrocode} +\DeclareMathSymbol{\mathparagraph}{\mathord}{symbols}{"7B} +\DeclareMathSymbol{\mathsection}{\mathord}{symbols}{"78} +\DeclareMathSymbol{\mathdollar}{\mathord}{operators}{"24} +% \end{macrocode} +% +% \begin{macrocode} +\def\mathsterling{\mathit{\mathchar"7024}} +\def\mathunderscore{\kern.06em\vbox{\hrule\@width.3em}} +% \end{macrocode} +% \end{macro} +% \end{macro} +% \end{macro} +% \end{macro} +% \end{macro} +% +% \begin{macro}{\mathellipsis} +% This is plain \TeX's |\ldots|. +% \begin{macrocode} +\def\mathellipsis{\mathinner{\ldotp\ldotp\ldotp}}% +% \end{macrocode} +% \end{macro} +% +% \subsection{Other special functions and parameters} +% +% \subsubsection{Biggggg} +% +% \begin{macrocode} +\def\big#1{{\hbox{$\left#1\vbox to8.5\p@{}\right.\n@space$}}} +\def\Big#1{{\hbox{$\left#1\vbox to11.5\p@{}\right.\n@space$}}} +\def\bigg#1{{\hbox{$\left#1\vbox to14.5\p@{}\right.\n@space$}}} +\def\Bigg#1{{\hbox{$\left#1\vbox to17.5\p@{}\right.\n@space$}}} +\def\n@space{\nulldelimiterspace\z@ \m@th} +% \end{macrocode} +% +% +% +% \subsubsection{The log-like functions} +% +% \begin{macro}{\operator@font} +% The |\operator@font| determines the symbol font used for log-like +% functions. +% \begin{macrocode} +\def\operator@font{\mathgroup\symoperators} +% \end{macrocode} +% \end{macro} +% +% +% \subsubsection{Parameters} +% +% \begin{macrocode} +\thinmuskip=3mu +\medmuskip=4mu plus 2mu minus 4mu +\thickmuskip=5mu plus 5mu +% \end{macrocode} +% +% +% This finishes the low-level setup in \texttt{fontmath.ltx}. +% \begin{macrocode} +% +% \end{macrocode} +% +% +% \section{Default cfg files} +% +% We provide default \texttt{cfg} files here to ensure that +% on installations that search large file trees we do not pick up +% some strange customisation files from somewhere. +% \changes{v2.2y}{2001/06/02}{Provide default cfg files (pr/3264)} +% \begin{macrocode} +%<*cfgtext|cfgmath|cfgprel> +%% +%% +%% +%% Load the standard setup: +%% +%<+cfgtext>\input{fonttext.ltx} +%<+cfgmath>\input{fontmath.ltx} +%<+cfgprel>\input{preload.ltx} +%% +%% Small changes could go here; see documentation in cfgguide.tex for +%% allowed modifications. +%% +%% In particular it is not allowed to misuse this configuration file +%% to modify internal LaTeX commands! +%% +%% If you use this file as the basis for configuration please change +%% the \ProvidesFile lines to clearly identify your modification, e.g., +%% +%<+cfgtext>%% \ProvidesFile{fonttext.cfg}[2001/06/01 +%<+cfgmath>%% \ProvidesFile{fonttext.cfg}[2001/06/01 +%<+cfgprel>%% \ProvidesFile{preload.cfg}[2001/06/01 +%% Customised local font setup] +%% +%% +% +% \end{macrocode} +% +% \Finale +% +\endinput diff --git a/Master/texmf-dist/source/latex/base/format.ins b/Master/texmf-dist/source/latex/base/format.ins new file mode 100644 index 00000000000..8d05e13d3af --- /dev/null +++ b/Master/texmf-dist/source/latex/base/format.ins @@ -0,0 +1,207 @@ +%% +%% This file will generate fast loadable files and documentation +%% driver files from the doc files in this package when run through +%% LaTeX or TeX. +%% +%% Copyright 1993 1994 1995 1996 1997 1998 1999 2000 2001 2002 2003 2004 +%% The LaTeX3 Project and any individual authors listed elsewhere +%% in this file. +%% +%% This file is part of the LaTeX base system. +%% ------------------------------------------- +%% +%% It may be distributed and/or modified under the +%% conditions of the LaTeX Project Public License, either version 1.3 +%% of this license or (at your option) any later version. +%% The latest version of this license is in +%% http://www.latex-project.org/lppl.txt +%% and version 1.3 or later is part of all distributions of LaTeX +%% version 2003/12/01 or later. +%% +%% This file has the LPPL maintenance status "maintained". +%% +%% In particular, NO PERMISSION is granted to modify the contents of this +%% file since it contains the legal notices that are placed in the files +%% it generates. +%% +%% The list of all files belonging to the LaTeX base distribution is +%% given in the file `manifest.txt'. See also `legal.txt' for additional +%% information. +%% +%% +%% +%% +%% --------------- start of docstrip commands ------------------ +%% +\input docstrip +\keepsilent + +\declarepreamble\mainpreamble + +This is a generated file. + +Copyright 1993 1994 1995 1996 1997 1998 1999 2000 2001 2002 2003 2004 +The LaTeX3 Project and any individual authors listed elsewhere +in this file. + +This file was generated from file(s) of the LaTeX base system. +-------------------------------------------------------------- + +It may be distributed and/or modified under the +conditions of the LaTeX Project Public License, either version 1.3 +of this license or (at your option) any later version. +The latest version of this license is in + http://www.latex-project.org/lppl.txt +and version 1.3 or later is part of all distributions of LaTeX +version 2003/12/01 or later. + +This file has the LPPL maintenance status "maintained". + +This file may only be distributed together with a copy of the LaTeX +base system. You may however distribute the LaTeX base system without +such generated files. + +The list of all files belonging to the LaTeX base distribution is +given in the file `manifest.txt'. See also `legal.txt' for additional +information. + +The list of derived (unpacked) files belonging to the distribution +and covered by LPPL is defined by the unpacking scripts (with +extension .ins) which are part of the distribution. +\endpreamble + +\declarepreamble\cfgpreamble + +This is a generated file. + +Copyright 1993 1994 1995 1996 1997 1998 1999 2000 2001 2002 2003 2004 +The LaTeX3 Project and any individual authors listed elsewhere +in this file. + +This file was generated from file(s) of the LaTeX base system. +-------------------------------------------------------------- + +It may be distributed and/or modified under the +conditions of the LaTeX Project Public License, either version 1.3 +of this license or (at your option) any later version. +The latest version of this license is in + http://www.latex-project.org/lppl.txt +and version 1.3 or later is part of all distributions of LaTeX +version 2003/12/01 or later. + +This file may only be distributed together with a copy of the LaTeX +base system. You may however distribute the LaTeX base system without +such generated files. + +The list of all files belonging to the LaTeX base distribution is +given in the file `manifest.txt'. See also `legal.txt' for additional +information. + +Details of how to use a configuration file to modify this part of +the system are in the document `cfgguide.tex'. + + +\endpreamble + + +\usepreamble\mainpreamble +\usedir{tex/latex/base} + +\generate{% + \file{latex.ltx}{% + \from{ltdirchk.dtx}{initex,2ekernel,dircheck} + \from{ltplain.dtx}{2ekernel} + \from{ltvers.dtx}{2ekernel} + \from{ltdefns.dtx}{2ekernel} + \from{ltalloc.dtx}{2ekernel} + \from{ltcntrl.dtx}{2ekernel} + \from{lterror.dtx}{2ekernel} + \from{ltpar.dtx}{2ekernel} + \from{ltspace.dtx}{2ekernel} + \from{ltlogos.dtx}{2ekernel} + \from{ltfiles.dtx}{2ekernel} + \from{ltoutenc.dtx}{2ekernel} + \from{ltcounts.dtx}{2ekernel} + \from{ltlength.dtx}{2ekernel} + \from{ltfssbas.dtx}{2ekernel} + \from{ltfsstrc.dtx}{2ekernel} + \from{ltfsscmp.dtx}{compat,2ekernel} + \from{ltfssdcl.dtx}{compat,2ekernel} + \from{ltfssini.dtx}{compat} + \from{ltfntcmd.dtx}{2ekernel} + \from{ltpageno.dtx}{2ekernel} + \from{ltxref.dtx}{2ekernel} + \from{ltmiscen.dtx}{2ekernel} + \from{ltmath.dtx}{2ekernel} + \from{ltlists.dtx}{2ekernel} + \from{ltboxes.dtx}{2ekernel} + \from{lttab.dtx}{2ekernel} + \from{ltpictur.dtx}{2ekernel} + \from{ltthm.dtx}{2ekernel} + \from{ltsect.dtx}{2ekernel} + \from{ltfloat.dtx}{2ekernel} + \from{ltidxglo.dtx}{2ekernel} + \from{ltbibl.dtx}{2ekernel} + \from{ltpage.dtx}{2ekernel} + \from{ltoutput.dtx}{2ekernel} + \from{ltclass.dtx}{2ekernel} + \from{ltfinal.dtx}{2ekernel}} + \file{tracefnt.sty}{% + \from{ltfsstrc.dtx}{package,trace}} + \file{flafter.sty}{% + \from{ltoutput.dtx}{flafter}} +%%% generate general option files modifying the kernel behavior + \file{fleqn.clo}{% + \from{ltmath.dtx}{fleqn}} + \file{leqno.clo}{% + \from{ltmath.dtx}{leqno}} + } + + + + +% \generateFile{fltrace.sty}{t}{% %%% not yet finished +% \from{ltoutput.dtx}{fltrace,trace} +% } + + +\generateFile{oldlfont.sty}{t}{% + \from{oldlfont.dtx}{package} +} + +\generateFile{newlfont.sty}{t}{% + \from{newlfont.dtx}{package} +} + + +%%%%%%%%%%%%%%%%% CUSTOMISABLE FILES + +\usedir{tex/latex/base} + +\usepreamble\cfgpreamble + +\generateFile{hyphen.ltx}{t}{% + \from{lthyphen.dtx}{default} +} + + +\generate{ + \file{fonttext.ltx}{ + \from{fontdef.dtx}{text}} + \file{fontmath.ltx}{ + \from{fontdef.dtx}{math}} + \file{fonttext.cfg}{ + \from{fontdef.dtx}{cfgtext}} + \file{fontmath.cfg}{ + \from{fontdef.dtx}{cfgmath}} + \file{preload.cfg}{ + \from{fontdef.dtx}{cfgprel}} + } + +\generateFile{preload.ltx}{t}{% + \from{preload.dtx}{preload,cm,xpt,tex}} + +\endbatchfile + + + diff --git a/Master/texmf-dist/source/latex/base/graphpap.dtx b/Master/texmf-dist/source/latex/base/graphpap.dtx new file mode 100644 index 00000000000..e16442017dc --- /dev/null +++ b/Master/texmf-dist/source/latex/base/graphpap.dtx @@ -0,0 +1,189 @@ +% \iffalse meta-comment +% +% Copyright 1993 1994 1995 1996 1997 1998 1999 2000 2001 2002 2003 2004 +% The LaTeX3 Project and any individual authors listed elsewhere +% in this file. +% +% This file is part of the LaTeX base system. +% ------------------------------------------- +% +% It may be distributed and/or modified under the +% conditions of the LaTeX Project Public License, either version 1.3 +% of this license or (at your option) any later version. +% The latest version of this license is in +% http://www.latex-project.org/lppl.txt +% and version 1.3 or later is part of all distributions of LaTeX +% version 2003/12/01 or later. +% +% This file has the LPPL maintenance status "maintained". +% +% The list of all files belonging to the LaTeX base distribution is +% given in the file `manifest.txt'. See also `legal.txt' for additional +% information. +% +% The list of derived (unpacked) files belonging to the distribution +% and covered by LPPL is defined by the unpacking scripts (with +% extension .ins) which are part of the distribution. +% +% \fi +% \iffalse +%% +%% File `graphpap.dtx'. +%% Copyright (C) 1994 by Leslie Lamport +%% all rights reserved. +%% +% +%\NeedsTeXFormat{LaTeX2e} +%\ProvidesPackage{graphpap} +% [1994/08/09 v1.0c Standard LaTeX graphpap package (LL)] +% +%<*driver> +\documentclass{ltxdoc} +\usepackage{graphpap} +\GetFileInfo{graphpap.sty} +\begin{document} +\title{The \textsf{graphpap} package\thanks{This file + has version number \fileversion, last + revised \filedate.}} +\author{Leslie Lamport} +\date{\filedate} + \maketitle + \DocInput{graphpap.dtx} +\end{document} +% +% \fi +% +% \CheckSum{114} +% +% \changes{v1.0b}{1994/04/28}{(DPC) convert to doc format} +% +% +% |\graphpaper|\oarg{N}\parg{X,Y}\parg{DX,DY} +% Makes a grid with left-hand corner at \parg{X,Y}, extending +% \parg{DX,DY} units in the X and Y directions, where the lines are +% \emph{N} units apart. Every fifth line is thick and is numbered. +% The default value of \emph{N} is 10. +% The arguments must all be integers. +% +% \StopEventually +% +% First, we define three counters. The first two are defined +% as raw TeX counters since multiplication and division must be +% performed in them. +% +% \changes{v1.0b}{1994/04/28}{(DPC) Remove allocations.} +% \begin{macrocode} +%<*package> +% \newcount\@gridx% now (\@tempcnta) +% \newcount\@gridy% now (\@tempcntb) +% \newcounter{@grid} +\let\c@@grid\count@ +% \end{macrocode} +% +% Next we define the following commands to draw vertical and horizontal +% grids. The ``nonum'' commands just draw the grids; the other commands +% also print numbers. All the arguments must be integers. +% +% VERTICAL GRIDS +% +% |\@vgrid|\parg{xpos,ypos}\marg{xincrement}^^A +% \marg{number-of-lines}\marg{length-of-lines}\\ +% |\@nonumvgrid|\parg{xpos,ypos}\marg{xincrement}^^A +% \marg{number-of-lines} \marg{length-of-lines} +% +% HORIZONTAL GRIDS +% +% |\@hgrid|\parg{xpos,ypos}\marg{yincrement}^^A +% \marg{number-of-lines}\marg{length-of-lines}\\ +% |\@nonumhgrid| same as |\@hgrid| but no numbers drawn +% +% \begin{macrocode} +\def\@vgrid(#1,#2)#3#4#5{% + \setcounter{@grid}{#1}% + \multiput(#1,#2)(#3,0){#4}{\line(0,1){#5}}% + \multiput(#1,#2)(#3,0){#4}{\@vgridnumber{#3}}} +% \end{macrocode} +% +% \begin{macrocode} +\def\@vgridnumber#1{% + \makebox(0,0)[t]{% + \shortstack{\rule{0pt}{10pt}\\\arabic{@grid}}}% + \addtocounter{@grid}{#1}} +% \end{macrocode} +% +% \begin{macrocode} +\def\@nonumvgrid(#1,#2)#3#4#5{% + \multiput(#1,#2)(#3,0){#4}{\line(0,1){#5}}} +% \end{macrocode} +% +% \begin{macrocode} +\def\@hgrid(#1,#2)#3#4#5{% + \setcounter{@grid}{#2}% + \multiput(#1,#2)(0,#3){#4}{\line(1,0){#5}}% + \multiput(#1,#2)(0,#3){#4}{\@hgridnumber{#3}}} +% \end{macrocode} +% +% \begin{macrocode} +\def\@hgridnumber#1{% + \makebox(0,0)[r]{\arabic{@grid}\hspace{10pt}}% + \addtocounter{@grid}{#1}} +% \end{macrocode} +% +% \begin{macrocode} +\def\@nonumhgrid(#1,#2)#3#4#5{% + \multiput(#1,#2)(0,#3){#4}{\line(1,0){#5}}} +% \end{macrocode} +% +% Finally, |\graphpaper| is defined in a straightforward way in terms of +% the commands above. +% +% \begin{macro}{\graphpaper} +% \changes{v1.0c}{1994/08/09}{(DPC) add \cs{leavevmode}} +% \begin{macrocode} +\newcommand\graphpaper[1][10]{\leavevmode\@grid{#1}} +% \end{macrocode} +% \end{macro} +% +% \begin{macro}{\@grid} +% +% \changes{v1.0b}{1994/04/28} +% {(DPC) convert ignore spaces between arguments} +% \begin{macrocode} +\def\@grid#1(#2,#3)#4{\@grid@i{#1}{#2}{#3}(} +% \end{macrocode} +% \end{macro} +% +% \begin{macro}{\@grid@i} +% +% \changes{v1.0b}{1994/04/28} +% {(DPC) macro introduced} +% \begin{macrocode} +\def\@grid@i#1#2#3(#4,#5){% + \@tempcnta=#4\relax + \divide\@tempcnta#1\relax + \advance\@tempcnta1\relax + {\thinlines\@nonumvgrid(#2,#3){#1}{\@tempcnta}{#5} + \@tempcnta#4\relax + \divide\@tempcnta5\relax + \divide\@tempcnta#1\relax + \advance\@tempcnta1\relax + \@tempcntb5\relax + \multiply\@tempcntb#1\relax + \thicklines\@vgrid(#2,#3){\@tempcntb}{\@tempcnta}{#5} + \@tempcnta#5\relax + \divide\@tempcnta #1\relax + \advance\@tempcnta1\relax + \thinlines\@nonumhgrid(#2,#3){#1}{\@tempcnta}{#4} + \@tempcnta#5\relax + \divide\@tempcnta5\relax + \divide\@tempcnta#1\relax + \advance\@tempcnta1\relax + \thicklines\@hgrid(#2,#3){\@tempcntb}{\@tempcnta}{#4}}% + \ignorespaces} +% +% \end{macrocode} +% \end{macro} +% +% \Finale +% + diff --git a/Master/texmf-dist/source/latex/base/graphpap.ins b/Master/texmf-dist/source/latex/base/graphpap.ins new file mode 100644 index 00000000000..93a347633e8 --- /dev/null +++ b/Master/texmf-dist/source/latex/base/graphpap.ins @@ -0,0 +1,78 @@ +%% +%% This file will generate fast loadable files and documentation +%% driver files from the doc files in this package when run through +%% LaTeX or TeX. +%% +%% Copyright 1993 1994 1995 1996 1997 1998 1999 2000 2001 2002 2003 2004 +%% The LaTeX3 Project and any individual authors listed elsewhere +%% in this file. +%% +%% This file is part of the LaTeX base system. +%% ------------------------------------------- +%% +%% It may be distributed and/or modified under the +%% conditions of the LaTeX Project Public License, either version 1.3 +%% of this license or (at your option) any later version. +%% The latest version of this license is in +%% http://www.latex-project.org/lppl.txt +%% and version 1.3 or later is part of all distributions of LaTeX +%% version 2003/12/01 or later. +%% +%% This file has the LPPL maintenance status "maintained". +%% +%% In particular, NO PERMISSION is granted to modify the contents of this +%% file since it contains the legal notices that are placed in the files +%% it generates. +%% +%% The list of all files belonging to the LaTeX base distribution is +%% given in the file `manifest.txt'. See also `legal.txt' for additional +%% information. +%% +%% +%% +%% +%% --------------- start of docstrip commands ------------------ +%% + +\input docstrip + +\preamble + +This is a generated file. + +Copyright 1993 1994 1995 1996 1997 1998 1999 2000 2001 2002 2003 2004 +The LaTeX3 Project and any individual authors listed elsewhere +in this file. + +This file was generated from file(s) of the LaTeX base system. +-------------------------------------------------------------- + +It may be distributed and/or modified under the +conditions of the LaTeX Project Public License, either version 1.3 +of this license or (at your option) any later version. +The latest version of this license is in + http://www.latex-project.org/lppl.txt +and version 1.3 or later is part of all distributions of LaTeX +version 2003/12/01 or later. + +This file has the LPPL maintenance status "maintained". + +This file may only be distributed together with a copy of the LaTeX +base system. You may however distribute the LaTeX base system without +such generated files. + +The list of all files belonging to the LaTeX base distribution is +given in the file `manifest.txt'. See also `legal.txt' for additional +information. + +The list of derived (unpacked) files belonging to the distribution +and covered by LPPL is defined by the unpacking scripts (with +extension .ins) which are part of the distribution. +\endpreamble + +\keepsilent +\usedir{tex/latex/base} + +\generateFile{graphpap.sty}{t}{\from{graphpap.dtx}{package}} + +\endbatchfile diff --git a/Master/texmf-dist/source/latex/base/ifthen.dtx b/Master/texmf-dist/source/latex/base/ifthen.dtx new file mode 100644 index 00000000000..18c24bd6631 --- /dev/null +++ b/Master/texmf-dist/source/latex/base/ifthen.dtx @@ -0,0 +1,527 @@ +% \iffalse meta-comment +% +% Copyright 1993 1994 1995 1996 1997 1998 1999 2000 2001 2002 2003 2004 +% The LaTeX3 Project and any individual authors listed elsewhere +% in this file. +% +% This file is part of the LaTeX base system. +% ------------------------------------------- +% +% It may be distributed and/or modified under the +% conditions of the LaTeX Project Public License, either version 1.3 +% of this license or (at your option) any later version. +% The latest version of this license is in +% http://www.latex-project.org/lppl.txt +% and version 1.3 or later is part of all distributions of LaTeX +% version 2003/12/01 or later. +% +% This file has the LPPL maintenance status "maintained". +% +% The list of all files belonging to the LaTeX base distribution is +% given in the file `manifest.txt'. See also `legal.txt' for additional +% information. +% +% The list of derived (unpacked) files belonging to the distribution +% and covered by LPPL is defined by the unpacking scripts (with +% extension .ins) which are part of the distribution. +% +% \fi +% \iffalse +%% +%% File `ifthen.dtx'. +%% Copyright (C) 1991 by Leslie Lamport +%% Copyright (C) 1994-2001 LaTeX3 project, David Carlisle +%% all rights reserved. +%% +% +%<*dtx> + \ProvidesFile{ifthen.dtx} +% +%\NeedsTeXFormat{LaTeX2e}[1994/12/01] +%\ProvidesPackage{ifthen} +%\ProvidesFile{ifthen.drv} +% \fi +% \ProvidesFile{ifthen.dtx} + [2001/05/26 v1.1c Standard LaTeX ifthen package (DPC)] +% +% \iffalse +%<*driver> +\documentclass{ltxdoc} +\begin{document} +\DocInput{ifthen.dtx} +\end{document} +% +% \fi +% +% \GetFileInfo{ifthen.dtx} +% +% \title{The \textsf{ifthen} package\thanks{This file +% has version number \fileversion, last +% revised \filedate.}} +% \author{David Carlisle} +% \date{\filedate} +% \author{David Carlisle} +% \maketitle +% +% \CheckSum{306} +% +% +% \begin{abstract} +% This file implements an |\ifthenelse| command for \LaTeXe. +% The algorithm used is compatible with that used in the \LaTeX~2.09 +% |ifthen| style option. It has been recoded, making the resulting +% definitions somewhat more compact and efficient. +% \end{abstract} +% +% \changes{v1.0a}{1993/10/15}{New implementation} +% \changes{v1.0b}{1993/12/17}{Upgrade to LaTeX2e} +% \changes{v1.0e}{1994/02/11}{Improve documentation} +% \changes{v1.0f}{1994/03/02}{Remove need for dtx file} +% \changes{v1.0g}{1994/03/14}{Modify for the new ltxdoc.cls} +% \changes{v1.0k}{1995/04/25}{Fix `driver' docstrip guards.} +% \changes{v1.0n}{1997/11/03}{Documentation fix.} +% \changes{v1.0o}{1998/08/17}{Documentation fix.} +% +% \section{Introduction} +% +% \DescribeMacro{\ifthenelse} +% |\ifthenelse{|^^A +% \meta{test}|}{|\meta{then clause}|}{|\meta{else clause}|}| +% +% Evaluates \meta{test} as a boolean function, and then executes +% either \meta{then clause} or \meta{else clause}. +% +% \meta{test} is a boolean expression using the infix connectives, +% |\and|, |\or|, the unary |\not| and parentheses |\( \)|. +% +% As an alternative notation |\AND|, |\OR| and |\NOT| can be +% used. This is safer since it can't be misinterpreted +% when appearing inside a \TeX-conditional in which |\or| has a +% different meaning. +% +% The atomic propositions are:\\ +% \meta{number} |<| \meta{number} \\ +% \meta{number} |=| \meta{number} \\ +% \meta{number} |>| \meta{number} \\ +% |\isodd{| \meta{number} |}|\\ +% |\isundefined{| \meta{command name} |}|\\ +% |\equal{|\meta{string}|}{|\meta{string}|}|\\ +% |\lengthtest{|\meta{dimen}|<|\meta{dimen}|}|\\ +% |\lengthtest{|\meta{dimen}|=|\meta{dimen}|}|\\ +% |\lengthtest{|\meta{dimen}|>|\meta{dimen}|}|\\ +% |\boolean{|\meta{name}|}| +% +% The \meta{string}s tested by |\equal| may be any sequence of commands +% that expand to a list of tokens. If these expansions are equal, then +% the proposition is true. +% +% |\isodd| is true if the \meta{number} is odd, and false otherwise +% (even if the argument is not a number). +% +% |\isundefined{\cmd}| is true if |\cmd| is not defined. +% +% |\boolean{xyz}| returns the truth value contained in the primitive +% \TeX\ |\if|, |\ifxyz|. This is usually used with boolean flags +% created with |\newboolean| and |\provideboolean| described below. +% It can also be used with the names of |\newif| created tokens, and +% primitive \TeX\ |\if| constructs, for example |\boolean{true}| +% (|\iftrue|), |\boolean{mmode}| (|\ifmmode|) etc. +% +% +% The commands:\\ +% |\newboolean|\marg{name}\DescribeMacro{\newboolean}\ and\ +% |\provideboolean|\marg{name}\DescribeMacro{\provideboolean}\ +% are provided so the user can easily create new boolean flags. +% As for |\newcommand|, |\newboolean| generates an error if the +% command name is not new. |\provideboolean| silently does nothing in +% that case. +% +% The boolean flags may be set with:\\ +% |\setboolean|\marg{name}\marg{value}\DescribeMacro{\setboolean}\\ +% \meta{value} may be either |true| or |false| (any CaSe). +% +% Note that there is no precedence between |\and| and |\or|. +% The proposition is evaluated in a left right manner. |\not| only +% applies to the immediately following proposition. (This is consistent +% with Lamport's |ifthen.sty|.) In this style, though the test is +% `lazily' evaluated, so for instance if the first proposition in an +% |\or| is true, the second one is skipped. (On the second pass---the +% first pass in an |\edef| expands clauses in all propositions.) +% +% Apart from the addition of the extra atomic propositions |\isodd|, +% |\boolean|, |\lengthtest| and |\isundefined|, +% the only known incompatibility is that +% in this package the expression|\not\not|\meta{P} is equivalent to +% \meta{P}. +% However in the original style it was equivalent to |\not|\meta{P}. +% This is intentional (bug fix:-). +% +% \DescribeMacro{\whiledo} +% The command |\whiledo| is also defined (copied directly from +% the \LaTeX2.09 definition). +% +% |\whiledo{|\meta{test}|}{|\meta{while clause}|}| +% +% With \meta{test} as above, repeatedly executes \meta{while clause} +% while the test remains true. +% +% \StopEventually{} +% +% \section{The Implementation} +% +% \begin{macrocode} +%<*package> +% \end{macrocode} +% +% \begin{macro}{\TE@throw} +% In order to support the syntax of |ifthen.sty|, which allows access +% to the primitive \TeX\ syntax for a numeric test, rather than a |{}| +% delimited argument form, it is most convenient to work `within' an +% |\ifnum|. |\ift@throw| `throws' you out of the current |\ifnum| so +% that you can (eg) start an |\ifdim| for the length tests. +% \begin{macrocode} +\def\TE@throw{\@ne=\@ne\noexpand\fi} +% \end{macrocode} +% \end{macro} +% +% \begin{macro}{\boolean} +% A non-standard extension to |ifthen|, supporting boolean was +% previously available, this is a simpler implementation. +% \begin{macrocode} +\def\boolean#1#2{% + \TE@throw\expandafter\noexpand\csname if#1\endcsname#2} +% \end{macrocode} +% \end{macro} +% +% \begin{macro}{\TE@length} +% Testing lengths. |#1| is the test. The extra argument gobbles spaces. +% \begin{macrocode} +\def\TE@length#1#2{\TE@throw\noexpand\ifdim#1#2} +% \end{macrocode} +% \end{macro} +% +% \begin{macro}{\TE@odd} +% \begin{macro}{\TE@@odd} +% Testing odd/even. This is true if |#1| is an odd number, and false +% otherwise (even if |#1| is not a number at all). +% +% It is hard to make this completely reliable. Here I have erred on the +% side of safety. This should not generate a \TeX\ error if given any +% robust commands as its argument. However it returns true on any +% argument that \emph{starts} with an odd number |11xx| which is bad, +% and it can not deal with \TeX's count registers, although \LaTeX\ +% counters work (via |\value|). +% \changes{v1.0b}{1993/12/17}{Improve \cs{isodd}.} +% \changes{v1.0c}{1994/01/20}{Improve \cs{isodd} again.} +% \begin{macrocode} +\def\TE@odd#1#2{% + \TE@throw\noexpand\TE@@odd#1\noexpand\@nil\noexpand\ifodd\count@#2} +% \end{macrocode} +% +% |\TE@@odd| is not expanded on the first pass. +% \begin{macrocode} +\def\TE@@odd#1#2\@nil{% + \@defaultunits + \count@\if-#1-0\else0\expandafter#1\fi#2\relax\@nnil} +% \end{macrocode} +% \end{macro} +% \end{macro} +% +% \begin{macro}{\TE@repl} +% |\TE@repl| replaces the single token |#1| by |#2|. (Not within |{}| +% groups.) It is used to replace |\or| by |\TE@or| without the need to +% redefine |\or|. Earlier versions just |\let\or\TE@or| but this has a +% bad effect on the expansion of commands which use the primitive +% |\or| internally, eg |\alph|, and so caused surprising results if +% these commands were used inside |\equal|. +% \changes{v1.0h}{1994/05/14}{macro added} +% \begin{macrocode} +\def\TE@repl#1#2{% + \long\def\@tempc##1#1##2{% + \def\@tempa{##2}\def\@tempb{\@tempc}% + \ifx\@tempa\@tempb + \toks@\expandafter{\the\toks@##1}% + \expandafter\@gobble + \else + \toks@\expandafter{\the\toks@##1#2}% + \expandafter\@tempc + \fi + ##2}% + \expandafter\toks@\expandafter{\expandafter}% + \expandafter\@tempc\the\toks@#1\@tempc} +% \end{macrocode} +% \end{macro} +% +% +% \begin{macro}{\ifthenelse} +% The remaining macros in this file are derived from the ones in +% |ifthen.sty| but recoded and simplified. The main simplification is +% that the original style (and the |\boolean| extensions) expressed +% logical values always in terms of |\ifnum|. As |\fi| is `untyped' this +% is not necessary, so for example the length tests can return values +% via |\ifdim|, the trailing |\fi| will not complain, even though it was +% `expecting' an |\ifnum|. Also the system of passing information via +% macros expanding to |T| or |F| has been completely replaced by a +% simpler system using |\iftrue|, which furthermore allows lazy +% evaluation on the second pass. +% \begin{macrocode} +\long\def\ifthenelse#1{% +% \end{macrocode} +% \changes{v1.0h}{1994/05/14}{Use \cs{TE@repl}} +% \begin{macrocode} + \toks@{#1}% + \TE@repl\or\TE@or + \TE@repl\and\TE@and + \TE@repl\not\TE@neg +% \end{macrocode} +% +% \changes{v1.1c}{2001/05/25}{Added \cs{AND}, \cs{OR} and \cs{NOT} as +% boolean operators as alternative to the lower case versions +% (pr/3297)} +% Support alternate names for the boolean operators (strictly +% speaking only |\OR| would be necessary). +% \begin{macrocode} + \TE@repl\OR\TE@or + \TE@repl\AND\TE@and + \TE@repl\NOT\TE@neg +% \end{macrocode} +% The original |ifthen.sty| processed everything inside a box +% assignment, to catch any extra spaces before they appeared in the +% output. Instead I have added extra arguments to the commands so they +% each remove any following space. +% +% Set up the user level names |\not| etc. +% \changes{v1.0c}{1994/01/20}{Modify \cs{protect} and \cs{value}} +% \changes{v1.0j}{1994/11/15}{Modify \cs{protect} add \cs{@setref}} +% \changes{v1.0l}{1996/03/22} +% {Use \cs{begingroup} not \cs{bgroup} for latex/2105} +% \changes{v1.1a}{1999/01/07}{\cs{isundefined} added for /2824} +% \begin{macrocode} + \begingroup + \let\protect\@unexpandable@protect + \def\@setref##1##2##3{% + \ifx##1\relax\z@\else\expandafter##2##1\fi}% + \def\value##1{\the\csname c@##1\endcsname}% + \let\equal\TE@equal \let\(\TE@lparen \let\)\TE@rparen + \let\isodd\TE@odd \let\lengthtest\TE@length + \let\isundefined\TE@undef +% \end{macrocode} +% For the first pass, in a group, make various tokens non-expandable. +% +% It is unfortunate that in order to remain compatible with |ifthen| +% syntax, it is necessary to have a two pass system. The first pass +% inside an |\edef| `exposes' the |\if|\ldots\ |\fi| tokens, so the +% corect clauses may be skipped on the second pass. This means that the +% whole |\ifthenelse| command does not work by expansion, and so +% possibly has only limited usefulness for macro code writers. +% The main problem with the |ifthen:| syntax is that (unique for \LaTeX) +% it does not uses a brace delimited argument form, and exposes the +% primitive \TeX\ syntax for \meta{number}. Pretty much the only way of +% parsing |1 > 2 \or 2 < 1| is to actually evaluate the primitive +% |\ifnum|s. A syntax such as:\\% +% |\or{\numtest{1<2}}{\lengthtest{1pt<1in}}|\\ +% could easily be evaluated in a one pass way, operating directly via +% expansion, and leaving no extra tokens in the token stream. +% +% Still, on with the code\ldots\ make |\@tempa| and |\@tempb| tokens +% non-expandable on the first pass. +% \changes{v1.0l}{1996/03/22} +% {Use \cs{begingroup} not \{ for latex/2105} +% \begin{macrocode} + \begingroup + \let\@tempa\relax\let\@tempb\relax + \xdef\@gtempa{\expandafter\TE@eval\the\toks@\TE@endeval}% + \endgroup +% \end{macrocode} +% Now outside the group, execute |\@gtempa| which causes all the +% |\if|s etc., to be evaluated, the final truth value is contained in +% the |\newif| token |\ifTE@val|. Finally this is tested and either the +% first or second following argument is chosen accordingly. +% \changes{v1.0d}{1994/01/24} +% {Use \cs{@firstoftwo} not \cs{@leftmark}.} +% \begin{macrocode} + \@gtempa + \expandafter\endgroup\ifTE@val + \expandafter\@firstoftwo + \else + \expandafter\@secondoftwo + \fi} +% \end{macrocode} +% \end{macro} +% +% \begin{macro}{\TE@eval} +% Initialise a term. (Expanded on the first pass). +% \begin{macrocode} +\def\TE@eval{\noexpand\TE@negatefalse\noexpand\iftrue\noexpand\ifnum} +% \end{macrocode} +% \end{macro} +% +% \begin{macro}{\ifTE@val} +% \begin{macro}{\ifTE@negate} +% Two |\newif|s the first holds the current truth value of the +% expression. The second is a temporary flag which is true if we need to +% negate the current proposition. +% \begin{macrocode} +\newif\ifTE@val +\newif\ifTE@negate +% \end{macrocode} +% \end{macro} +% \end{macro} +% +% \begin{macro}{\TE@endeval} +% Finalise a term. (Expanded on the first pass). +% \begin{macrocode} +\def\TE@endeval{\relax + \noexpand\TE@setvaltrue\noexpand + \else + \noexpand\TE@setvalfalse\noexpand + \fi + \noexpand\TE@negatefalse\noexpand + \fi} +% \end{macrocode} +% \end{macro} +% +% \begin{macro}{\TE@setvaltrue} +% \begin{macro}{\TE@setvalfalse} +% Set the |\ifTE@val| to true or false depending on the value of the +% current proposition, and the negate flag. (Not expanded on the first +% pass.) +% \begin{macrocode} +\def\TE@setvaltrue{% + \ifTE@negate\TE@valfalse\else\TE@valtrue\fi} +\def\TE@setvalfalse{\let\ifTE@val\ifTE@negate} +% \end{macrocode} +% \end{macro} +% \end{macro} +% +% \begin{macro}{\TE@or} +% The internal version of |\or|. Ends the current term. +% If true skip the remaining terms. +% \begin{macrocode} +\def\TE@or{\TE@endeval\noexpand\ifTE@val\noexpand\else\noexpand\ifnum} +% \end{macrocode} +% \end{macro} +% +% \begin{macro}{\TE@and} +% The internal version of |\and|. If false skip the remaining terms. +% \begin{macrocode} +\def\TE@and{\TE@endeval\noexpand\ifTE@val\noexpand\ifnum} +% \end{macrocode} +% \end{macro} +% +% \begin{macro}{\TE@neg} +% \begin{macro}{\TE@negswitch} +% |\not|. Throw the current context, set a negate flag, then restart +% the |\ifnum|. |\TE@negswitch| is not expanded on the first pass. +% \begin{macrocode} +\def\TE@neg{\TE@throw\noexpand\TE@negswitch\noexpand\ifnum} +\def\TE@negswitch{\ifTE@negate\TE@negatefalse\else\TE@negatetrue\fi} +% \end{macrocode} +% \end{macro} +% \end{macro} +% +% \begin{macro}{\TE@lparen} +% |\(|. Throw the current context, then restart a term inside a group. +% \begin{macrocode} +\def\TE@lparen#1{\TE@throw\begingroup\TE@eval#1} +% \end{macrocode} +% \end{macro} +% +% \begin{macro}{\TE@rparen} +% |\)| end the current term, and the local group started by |\(|, but +% pass on the boolean value in |\if\@val T|. The |\noexpand| stops the +% |\expandafter| from expanding on the first pass. +% \begin{macrocode} +\def\TE@rparen#1{% + \TE@endeval + \noexpand\expandafter\endgroup\noexpand\ifTE@val#1} +% \end{macrocode} +% \end{macro} +% +% \begin{macro}{\TE@equal} +% |\equal| greatly simplified from the original. |\def| may be used +% rather than |\edef| as the whole thing is expanded anyway in the +% first pass. The boolean can be directly encoded with the |\ifx|, +% there is no need to start an equivalent |\ifnum|. +% \changes{v1.0h}{1994/05/14}{make long} +% \begin{macrocode} +\long\def\TE@equal#1#2#3{\TE@throw + \def\@tempa{#1}\def\@tempb{#2}% + \noexpand\ifx\@tempa\@tempb#3} +% \end{macrocode} +% \end{macro} +% +% \begin{macro}{\setboolean} +% |\setboolean| takes |true| or |false|, as |#2|, and sets |#1| +% accordingly. +% \changes{v1.0i}{1994/05/27}{New style error commands} +% \begin{macrocode} +\def\setboolean#1#2{% + \lowercase{\def\@tempa{#2}}% + \@ifundefined{@tempswa\@tempa}% + {\PackageError{ifthen}% + {You can only set a boolean to `true' or `false'}\@ehc}% + {\@ifundefined{#1\@tempa}% + {\PackageError{ifthen}{Boolean #1 undefined}\@ehc}% + {\csname#1\@tempa\endcsname}}} +% \end{macrocode} +% \end{macro} +% +% \begin{macro}{\newboolean} +% \changes{v1.0m}{1996/08/02}{Add \cs{@ifdefinable} test for latex/2220} +% Define a new `boolean'. +% \begin{macrocode} +\def\newboolean#1{% + \expandafter\@ifdefinable\csname if#1\endcsname{% + \expandafter\newif\csname if#1\endcsname}} +% \end{macrocode} +% \end{macro} +% +% \begin{macro}{\provideboolean} +% \changes{v1.0m}{1996/08/02}{Macro added for latex/2220} +% Define a new `boolean' if it is not already defined. +% \begin{macrocode} +\def\provideboolean#1{% + \@ifundefined{if#1}{% + \expandafter\newif\csname if#1\endcsname}\relax} +% \end{macrocode} +% \end{macro} +% +% \begin{macro}{\whiledo} +% |\whiledo| copied directly from the original.\\ +% |\whiledo{|\meta{test}|}{|\meta{body}|}|\\ +% repeatedly evaluates \meta{body} until \meta{test} is true. +% \begin{macrocode} +\long\def\whiledo#1#2{% + \ifthenelse{#1}% + {\@whiledotrue + \@whilesw\if@whiledo\fi + {#2% + \ifthenelse{#1}\@whiledotrue\@whiledofalse}}% + {}% + } +% \end{macrocode} +% \end{macro} +% +% \begin{macro}{\TE@undef} +% \changes{v1.1a}{1999/01/07}{Macro added for /2824} +% test if csname is defined. |\ifx| test. +% \begin{macrocode} +\def\TE@undef#1#2{% + \TE@throw\noexpand\ifx\noexpand\@undefined\noexpand#1#2} +% \end{macrocode} +% \end{macro} +% +% \begin{macro}{\if@whiledo} +% Internal switch for |\whiledo|. +% \begin{macrocode} +\newif\if@whiledo +% \end{macrocode} +% \end{macro} +% +% \begin{macrocode} +% +% \end{macrocode} +% +% \Finale +\endinput diff --git a/Master/texmf-dist/source/latex/base/ifthen.ins b/Master/texmf-dist/source/latex/base/ifthen.ins new file mode 100644 index 00000000000..22d40efbb6c --- /dev/null +++ b/Master/texmf-dist/source/latex/base/ifthen.ins @@ -0,0 +1,78 @@ +%% +%% This file will generate fast loadable files and documentation +%% driver files from the doc files in this package when run through +%% LaTeX or TeX. +%% +%% Copyright 1993 1994 1995 1996 1997 1998 1999 2000 2001 2002 2003 2004 +%% The LaTeX3 Project and any individual authors listed elsewhere +%% in this file. +%% +%% This file is part of the LaTeX base system. +%% ------------------------------------------- +%% +%% It may be distributed and/or modified under the +%% conditions of the LaTeX Project Public License, either version 1.3 +%% of this license or (at your option) any later version. +%% The latest version of this license is in +%% http://www.latex-project.org/lppl.txt +%% and version 1.3 or later is part of all distributions of LaTeX +%% version 2003/12/01 or later. +%% +%% This file has the LPPL maintenance status "maintained". +%% +%% In particular, NO PERMISSION is granted to modify the contents of this +%% file since it contains the legal notices that are placed in the files +%% it generates. +%% +%% The list of all files belonging to the LaTeX base distribution is +%% given in the file `manifest.txt'. See also `legal.txt' for additional +%% information. +%% +%% +%% +%% +%% --------------- start of docstrip commands ------------------ +%% + +\input docstrip + +\preamble + +This is a generated file. + +Copyright 1993 1994 1995 1996 1997 1998 1999 2000 2001 2002 2003 2004 +The LaTeX3 Project and any individual authors listed elsewhere +in this file. + +This file was generated from file(s) of the LaTeX base system. +-------------------------------------------------------------- + +It may be distributed and/or modified under the +conditions of the LaTeX Project Public License, either version 1.3 +of this license or (at your option) any later version. +The latest version of this license is in + http://www.latex-project.org/lppl.txt +and version 1.3 or later is part of all distributions of LaTeX +version 2003/12/01 or later. + +This file has the LPPL maintenance status "maintained". + +This file may only be distributed together with a copy of the LaTeX +base system. You may however distribute the LaTeX base system without +such generated files. + +The list of all files belonging to the LaTeX base distribution is +given in the file `manifest.txt'. See also `legal.txt' for additional +information. + +The list of derived (unpacked) files belonging to the distribution +and covered by LPPL is defined by the unpacking scripts (with +extension .ins) which are part of the distribution. +\endpreamble + +\keepsilent +\usedir{tex/latex/base} + +\generateFile{ifthen.sty}{t}{\from{ifthen.dtx}{package}} + +\endbatchfile diff --git a/Master/texmf-dist/source/latex/base/inputenc.dtx b/Master/texmf-dist/source/latex/base/inputenc.dtx new file mode 100644 index 00000000000..2ebd81f6288 --- /dev/null +++ b/Master/texmf-dist/source/latex/base/inputenc.dtx @@ -0,0 +1,2745 @@ +% \iffalse meta-comment +% +% Copyright 1993 1994 1995 1996 1997 1998 1999 2000 2001 2002 2003 2004 +% The LaTeX3 Project and any individual authors listed elsewhere +% in this file. +% +% This file is part of the LaTeX base system. +% ------------------------------------------- +% +% It may be distributed and/or modified under the +% conditions of the LaTeX Project Public License, either version 1.3 +% of this license or (at your option) any later version. +% The latest version of this license is in +% http://www.latex-project.org/lppl.txt +% and version 1.3 or later is part of all distributions of LaTeX +% version 2003/12/01 or later. +% +% This file has the LPPL maintenance status "maintained". +% +% The list of all files belonging to the LaTeX base distribution is +% given in the file `manifest.txt'. See also `legal.txt' for additional +% information. +% +% The list of derived (unpacked) files belonging to the distribution +% and covered by LPPL is defined by the unpacking scripts (with +% extension .ins) which are part of the distribution. +% +% \fi +% +% \iffalse +%<*driver> +\documentclass{ltxdoc} +\usepackage[ascii]{inputenc} +\GetFileInfo{inputenc.sty} +\title{\filename} +\date{\fileversion\space\filedate} + \author{% + Alan Jeffrey\and + Frank Mittelbach} + +\begin{document} +\maketitle + \setlength\hfuzz{20pt} + \DocInput{inputenc.dtx} +\end{document} +% +% \fi +% +% \CheckSum{3415} +% +%% \CharacterTable +%% {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 +%% 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 +%% Digits \0\1\2\3\4\5\6\7\8\9 +%% Exclamation \! Double quote \" Hash (number) \# +%% Dollar \$ Percent \% Ampersand \& +%% Acute accent \' Left paren \( Right paren \) +%% Asterisk \* Plus \+ Comma \, +%% Minus \- Point \. Solidus \/ +%% Colon \: Semicolon \; Less than \< +%% Equals \= Greater than \> Question mark \? +%% Commercial at \@ Left bracket \[ Backslash \\ +%% Right bracket \] Circumflex \^ Underscore \_ +%% Grave accent \` Left brace \{ Vertical bar \| +%% Right brace \} Tilde \~} +% +% \changes{v0.01}{1994/03/09}{Created file.} +% \changes{v0.02}{1994/07/14}{Replaced \cs{Dh} by \cs{DH} and \cs{Th} +% by \cs{TH}.} +% \changes{v0.02}{1994/07/14}{Added \cs{ensuremath} to some math +% commands.} +% \changes{v0.02}{1994/07/14}{Added \cs{inputencoding}.} +% \changes{v0.03}{1994/09/04}{Added \cs{DeclareInputComposite} and the +% \cs{ProvidesCommand}s to the encoding files.} +% \changes{v0.03}{1994/09/04}{Removed the definition of the accent slots +% in Latin-1.} +% \changes{v0.04}{1994/10/20}{Replaced \cs{DeclareInputCharacter} by +% \cs{DeclareInputText} and \cs{DeclareInputMath}.} +% \changes{v0.04}{1994/10/20}{Removed \cs{DeclareInputComposite}.} +% \changes{v0.04}{1994/10/20}{Made many Latin-1 characters math-only.} +% \changes{v0.05}{1994/10/27}{Updated for the new version of ltoutenc.} +% \changes{v0.06}{1994/11/21}{Added \cs{textregistered}.} +% \changes{v0.06}{1994/11/21}{Added slot hex A0 to Latin-1.} +% \changes{v0.07}{1994/11/22}{Fixed typo A1 rather than A0.} +% \changes{v0.07}{1994/11/28}{Fixed where docstrip option had moved a +% line.} +% \changes{v0.09}{1994/12/10}{Added `beta test' message.} +% \changes{v0.09}{1994/12/10}{Made letters active and undefined by +% default, rather than illegal.} +% +% \changes{v0.9b}{1995/05/23}{Added Mac encoding, applemac.def} +% \changes{v0.9d}{1995/06/06}{Added cp437} +% \changes{v0.9f}{1995/09/21}{Added Next encoding, next.def} +% \changes{v0.9h}{1995/10/22}{Added Windows 3.1 ANSI encoding, +% ansinew.def} +% \changes{v0.9i}{1995/11/02}{Wrapped long lines} +% \changes{v0.9i}{1995/11/02}{Changed internal name \cs{a} to +% \cs{@tabacckludge} to protect against redefinition by malicious +% users.} +% \changes{v0.9j}{1995/11/14}{Remove \cs{endinput} so docstrip reaches +% ansinew encoding} +% \changes{v0.9k}{1995/11/29}{Replaced uses of \cs{textsterling} with +% \cs{pounds}.} +% \changes{v0.9m}{1995/12/04}{Added German version} +% \changes{v0.9m}{1995/12/04}{Replaced \cs{textasciitilde} by +% \cs{nobreakspace}.} +% \changes{v0.9m}{1995/12/04}{Made bullet and periodcentered text +% glyphs rather than math glyphs.} +% \changes{v0.9m}{1995/12/04}{Added \cs{@tabacckludge} hacks.} +% \changes{v0.9o}{1996/02/14} +% {Cedilla (\cs{c}\cs{ }) rather than (\cs{c}\{\}) latex/2077, +% finished on 1996/10/28} +% \changes{v0.9o}{1996/02/14} +% {0F0 corrected in cp850 latex/2080} +% \changes{v0.9o}{1996/02/14} +% {0B2 corrected in latin2 latex/2079} +% \changes{v0.9r}{1996/05/10}{Added cp852.def} +% \changes{v0.9t}{1996/10/28}{Added cp865.def} +% \changes{v0.9t}{1996/10/28} +% {Changed \cs{aa} and \cs{AA} to \cs{r} a and \cs{r} A} +% \changes{v0.9u}{1996/10/29}{Added more to cp865.def} +% \changes{v0.9y}{1997/04/30}{Added latin5.def (provided by +% H. Turgut Uyar: uyar@cs.itu.edu.tr)} +% \changes{v0.9z}{1997/05/10}{Added latin3.def (provided by +% J\"org Knappen and modified by Chris Rowley)} +% \changes{v0.91}{1997/08/19}{Put +% \cs{makeatletter}\ldots\cs{makeatother} around all .def files.} +% \changes{v0.92}{1997/09/08}{Added decmulti.def +% provided by M.Y. Chartoire. pr/2599} +% \changes{v0.93}{1997/11/23}{\cs{textperthousand} not +% \cs{textpermill}. pr/2673} +% \changes{v0.94}{1997/12/17}{Made degree a text glyph} +% \changes{v0.94}{1997/12/17}{Added to and tidied documentation} +% \changes{v0.94}{1997/12/17}{Ogonek: changed +% \cs{k}\{\} to \cs{k}\cs{ }} +% \changes{v0.94}{1997/12/17}{NOTE: for consistency, when available +% the robust text-or-math internal form is always used -- +% THIS MAY CHANGE} +% \changes{v0.95}{1997/12/20}{Updated documentation} +% \changes{v0.97}{1998/03/05}{Spanish ords changed to text chars, pr/2579} +% +% +% \section{Introduction} +% +% This package allows the user to specify an input encoding (for +% example, ASCII, ISO Latin-1 or Macintosh) by saying: +% \begin{quote} +% |\usepackage[|\emph{encoding name}|]{inputenc}| +% \end{quote} +% The encoding can also be selected in the document with: +% \begin{quote} +% |\inputencoding{|\emph{encoding name}|}| +% \end{quote} +% Originally this command was only to be used in vertical mode (with +% the idea that it should be only within a document when +% using text from several documents to build up a composite work such +% as a volume of journal articles. However, usages in certain +% languages suggested that it might be preferable to allow changing +% the input encoding at any time, which is what is possible now +% (though that is quite computing resource intensive). +% +% The encodings provided by this package are: +% \begin{itemize} +% \item |ascii| ASCII encoding for the range 32--127. +% \item |latin1| ISO Latin-1 encoding. +% \item |latin2| ISO Latin-2 encoding. +% \item |latin3| ISO Latin-3 encoding. +% \item |latin4| ISO Latin-4 encoding. +% \item |latin5| ISO Latin-5 encoding. +% \item |latin9| ISO Latin-9 encoding. +% \item |latin10| ISO Latin-10 encoding. +% \item |decmulti| DEC Multinational Character Set encoding. +% \item |cp850| IBM 850 code page. +% \item |cp852| IBM 852 code page. +% \item |cp858| IBM 858 code page (this is 850 with euro symbol). +% \item |cp437| IBM 437 code page. +% \item |cp437de| IBM 437 code page (German version). +% \item |cp865| IBM 865 code page. +% \item |applemac| Macintosh encoding. +% \item |macce| Macintosh Central European codepage. +% \item |next| Next encoding. +% \item |cp1250| Windows 1250 (central and eastern Europe) code page. +% \item |cp1252| Windows 1252 (Western Europe) code page. +% \item |cp1257| Windows 1257 (Baltic) code page. +% \item |ansinew| Windows 3.1 ANSI encoding, extension of Latin-1 +% (synonym\footnote{It is now generated using the guards +% \texttt{cp1252,ansinew} the latter only used for the provides +% file line.} for |cp1252|). +% \end{itemize} +% Each encoding has an associated |.def| file, for example +% |latin1.def| which defines the behaviour of each input character, +% using the commands: +% \begin{quote} +% |\DeclareInputText{|\emph{slot}|}{|\emph{text}|}| \\ +% |\DeclareInputMath{|\emph{slot}|}{|\emph{math}|}| +% \end{quote} +% This defines the input character \emph{slot} to be the +% \emph{text} material or \emph{math} material respectively. +% For example, |latin1.def| defines slots |"D6| (\AE) +% and |"B5| ($\mu$) by saying: +%\begin{verbatim} +% \DeclareInputText{214}{\AE} +% \DeclareInputMath{181}{\mu} +%\end{verbatim} +% Note that the \emph{commands} should be robust, and should not be +% dependent on the output encoding. The same \emph{slot} should not +% have both a text and a math declaration for it. (This restriction +% may be removed in future releases of inputenc). +% +% The |.def| file may also define +% commands using the declarations:\\ +% |\providecommand| or |\ProvideTextCommandDefault|. +% For example: +%\begin{verbatim} +% \ProvideTextCommandDefault{\textonequarter}{\ensuremath{\frac14}} +% \DeclareInputText{188}{\textonequarter} +%\end{verbatim} +% The use of the `provide' forms here will ensure that a +% better definition will not be over-written; their use is +% recommended since, in general, the best definition depends on the +% fonts available. +% +% See the documentation in |fntguide.tex| and |ltoutenc.dtx| for +% details of how to declare text commands. +% +% \StopEventually{} +% +% \section{Announcing the files} +% +% We announce the files: +% \begin{macrocode} +%\NeedsTeXFormat{LaTeX2e}[1995/12/01] +%\ProvidesPackage{inputenc} +% \ProvidesFile{ascii.def} +% \ProvidesFile{latin1.def} +% \ProvidesFile{latin2.def} +% \ProvidesFile{latin3.def} +% \ProvidesFile{latin4.def} +% \ProvidesFile{latin5.def} +% \ProvidesFile{latin9.def} +% \ProvidesFile{latin10.def} +% \ProvidesFile{decmulti.def} +% \ProvidesFile{cp850.def} +% \ProvidesFile{cp852.def} +% \ProvidesFile{cp858.def} +% \ProvidesFile{cp437.def} +% \ProvidesFile{cp437de.def} +% \ProvidesFile{cp865.def} +% \ProvidesFile{applemac.def} +% \ProvidesFile{macce.def} +% \ProvidesFile{next.def} +% \ProvidesFile{ansinew.def} +% \ProvidesFile{cp1252.def} +% \ProvidesFile{cp1250.def} + [2004/02/05 v1.0d Input encoding file] +%%% +%%% If you need a euro symbol, try cp858 instead. +%%% +% \end{macrocode} +% +% Now we insert a |\makeatletter| at the beginning of all .def files. +% \begin{macrocode} +%<-package>\makeatletter +% \end{macrocode} +% +% \section{The package} +% +% \changes{v0.99c}{2002/11/11}{Added cp858 (pr/3464)} +% +% \changes{v0.04}{1994/10/20}{Improved coding of \cs{DeclareInputText} +% and changed name from \cs{DeclareInputCharacter}.} +% +% \changes{v0.9g}{1995/10/19}{Replaced \cs{'} \cs{`} \cs{!=} by +% \cs{a'} \cs{a`} \cs{a!=} in order to get correct accents in +% a tabbing environment.} +% +% \changes{v0.9w}{1996/11/23}{Correct documentation +% of \cs{@tabacckludge}} +% +% \changes{v0.9x}{1997/03/21}{Use decimal rather than hex +% to avoid active character problems. latex/2451.} +% +% Before we start with the code, an important comment is in order: +% as you may or may not know, the |tabbing| environment changes the +% definition of the commands |\'|, |\`|, and |\=|. Outside such an +% environment these commands produce the corresponding accents, inside +% they are used for special text positioning, and the accents can be +% accessed using |\a'|, |\a`|, and |\a=|. Therefore we \emph{must} use +% the latter instead of the former in the second argument to +% |\DeclareInputText|, e.g. (from |latin1.def|): +% \begin{verbatim} +% \DeclareInputText{224}{\@tabacckludge`a} +%\end{verbatim} +% The command |\@tabacckludge| is defined (in |ltoutenc.dtx|) in such +% a way that |\@tabacckludge'| will expand to the internal form of |\'|. +% Thus it is |\'| that is carried around \emph{internally} (the +% same applies to the other two accent commands). +% +% \begin{macro}{\DeclareInputText} +% \begin{macro}{\DeclareInputMath} +% \begin{macro}{\IeC} +% These commands declare the expansion of an active character. The +% math declaration is the usual trick with |\uppercase|. +% The text declaration is sneakier, since in text space matters. +% We look to see if the definition ends in a macro, by checking +% whether it's |\meaning| ends in a space. If it does, then we +% add an irrelevant |\IeC| and braces around the definition, in +% order to avoid any space after the active char being gobbled up +% once the text is written out to an auxiliary file. +% +% The definition should contain only robust commands (and, for +% correct ligatures and kerning, they must be defined via the +% interfaces in the fontenc package). +% +% \changes{v0.9b}{1995/05/23}{Added hackery with \cs{IeC} in order to +% avoid space being gobbled.} +% +% \begin{macrocode} +%<*package> +\def\DeclareInputMath#1{% + \@inpenc@test + \bgroup + \uccode`\~#1% + \uppercase{% + \egroup + \def~% + }% +} +% \end{macrocode} +% \changes{v1.0a}{2003/01/17}{Now coding according to suggestion by David (pr/2004)} +% \changes{v1.0b}{2003/12/29}{but better do it properly} +% \changes{v1.0?}{2004/01/19}{or even correctly} +% \begin{macrocode} +\def\DeclareInputText#1#2{% + \def\reserved@a##1 ${}% + \def\reserved@b{#2}% + \ifcat_\expandafter\reserved@a\meaning\reserved@b$ $_% + \DeclareInputMath{#1}{#2}% + \else + \DeclareInputMath{#1}{\IeC{#2}}% + \fi +} +% \end{macrocode} +% The definition of |\IeC| was modified not to insert a |\protect| +% unless it is needed, this means it works in |\hyphenation| +% commands, and other such delicate places. It was then further +% changed to never insert a |\protect| as one is never needed; this +% makes it work in even more places. +% +% This still needs some attention. +% +% \changes{v0.9m}{1995/12/12}{Modified \cs{IeC} in order to +% work in \cs{hyphenation} latex/2004.} +% +% \changes{v0.94}{1997/12/17}{Changed non-typeset case from +% \cs{protect} to \cs{noexpand}: temporary fix.} +% +% \begin{macrocode} +\def\IeC{% + \ifx\protect\@typeset@protect + \expandafter\@firstofone + \else + \noexpand\IeC + \fi +} +% \end{macrocode} +% \end{macro} +% \end{macro} +% \end{macro} +% +% \begin{macro}{\inputencoding} +% \changes{v0.9q}{1996/05/09} +% {Allow characters below 32 for latex/2071} +% \changes{v0.9q}{1996/05/09} +% {Check the def file was reasonable for latex/2136} +% \changes{v0.94}{1997/12/17}{Changed to work only in outer vmode, see +% latex/2608} +% \changes{v0.94}{1997/12/17}{Warning message reworded and line +% number added, also for latex/2608} +% \changes{v0.95}{1997/12/20}{Changed to work in any vmode, for David} +% +% This sets the encoding to be |#1|. It first sets all the +% characters 128--255 to be active (and sets their initial +% definition to be |\@inpenc@undefined|). +% It now also does this for some `low' codes below 32, but +% misses out Null, control-I, control-J, control-L and control-M. +% +% It then inputs |#1.def|. But it first sets up a test that +% produces a warning message if no suitable definitions get read. +% +% \begin{macrocode} +\def\inputencoding#1{% + \gdef\@inpenc@test{\global\let\@inpenc@test\relax}% +% \end{macrocode} +% Keyboard characters which don't get a definition will be mapped to +% |\@inpenc@undefined| which gets a definition producing an error +% message indicating in which input encoding the current keyboard +% character is undefined: +% \changes{v0.98}{1998/07/04}{Give better error message if key used +% is undefined (pr/2845)} +% \changes{v0.993}{2000/01/24}{Fix error message for undefined chars +% (pr/3158)} +% \begin{macrocode} + \edef\@inpenc@undefined{\noexpand\@inpenc@undefined@{#1}}% +% \end{macrocode} +% The |\edef| in the above definition is essential as |#1| may be +% |\CurrentOption| in which case a later use would return incorrect +% information (at best nothing). +% +% Now we make all potential input characters active. +% \changes{v0.994}{2000/01/27}{Allow change also in horizontal mode +% (pr/2888)} +% \begin{macrocode} + \@inpenc@loop\^^A\^^H% + \@inpenc@loop\^^K\^^K% + \@inpenc@loop\^^N\^^_% + \@inpenc@loop\^^?\^^ff% +% \end{macrocode} +% +% To be able to process the input encoding file in horizontal mode +% we need to ensure that we don't get any stray spaces into the +% horizontal mode or else we end up with extra space in the +% paragraph. +% \changes{v0.998}{2001/05/25}{suppress all spaces for horizontal mode +% (pr/3273)} +% \begin{macrocode} + \advance\endlinechar\@M + \xdef\saved@space@catcode{\the\catcode`\ }% + \input{#1.def}% + \advance\endlinechar-\@M + \catcode`\ \saved@space@catcode\relax +% \end{macrocode} +% +% If there have been no |\DeclareInputText| or |\DeclareInputMath| +% commands read then something is amiss. +% \begin{macrocode} + \ifx\@inpenc@test\relax\else + \PackageWarning{inputenc}% + {No characters defined\MessageBreak + by input encoding change to `#1'\MessageBreak}% + \fi +} +% \end{macrocode} +% \end{macro} +% +% +% \begin{macro}{\@inpenc@undefined@} +% This command will assigned to any active character unless it +% get a proper definition by the encoding. The argument is the +% current encoding name. +% \changes{v0.993}{2000/01/24}{Fix error message for undefined chars +% (pr/3158)} +% \begin{macrocode} +\def\@inpenc@undefined@#1{\PackageError{inputenc}% + {Keyboard character used is undefined\MessageBreak + in inputencoding `#1'}% + {You need to provide a definition with + \noexpand\DeclareInputText\MessageBreak or + \noexpand\DeclareInputMath before using this key.}}% +% \end{macrocode} +% \end{macro} +% +% \begin{macro}{\@inpenc@loop} +% \changes{v0.9q}{1996/05/09} +% {Macro added} +% \changes{v0.9v}{1996/11/07} +% {Exit from the top of loop fixed for latex/2257} +% Make characters |#1| to |#2| inclusive active and undefined. +% \begin{macrocode} +\def\@inpenc@loop#1#2{% + \@tempcnta`#1\relax + \loop + \catcode\@tempcnta\active + \bgroup + \uccode`\~\@tempcnta + \uppercase{% + \egroup + \let~\@inpenc@undefined + }% + \ifnum\@tempcnta<`#2\relax + \advance\@tempcnta\@ne + \repeat} +% \end{macrocode} +% \end{macro} +% +% +% Then for each option, we input that encoding file. +% \begin{macrocode} +\DeclareOption*{\inputencoding{\CurrentOption}} +\ProcessOptions +% +% \end{macrocode} +% +% +% \section{Default definitions for characters} +% +% Some input characters map to internal functions which are not in +% either the |T1| or |OT1| font encoding. For this reason default +% definitions are provided in the encoding file: these will be +% used unless some other output encoding is used which supports +% those glyphs. In some cases this default definition has to be +% simply an error message. +% +% Note that this works reasonably well only because the encoding +% files for both |OT1| and |T1| are loaded in the standard LaTeX +% format. +% +% \changes{v0.9a}{1995/04/23}{Default settings moved to own section} +% +% \changes{v0.9b}{1995/05/23}{Corrected ordmasc and ordfem which had +% been switched by mistake.} +% +% \changes{v0.9k}{1995/11/29}{Moved \cs{textregistered} and +% \cs{texttrademark} to the kernel.} +% \changes{v0.9k}{1995/11/29}{Added default commands for Next input +% encoding.} +% +% \changes{v0.9m}{1995/12/04}{Added \cs{ensuremath} to definitions of +% the fraction glyphs.} +% +% \changes{v0.9t}{1996/10/28} +% {Added \cs{textblacksquare}} +% \changes{v0.9u}{1996/10/29} +% {Corrected code for \cs{textblacksquare}} +% +% \changes{v0.9u}{1996/10/29} +% {Added cp865 and corrected cp850, cp852 and cp437 guards} +% \changes{v0.94}{1997/12/17}{Removed entries that were solely in +% next.def} +% \changes{v0.995}{2000/05/22}{Added latin2 option for textdegree +% (pr/3207) CAR} +% +% The name |\textblacksquare| is derived from the AMS symbol name since +% Adobe seem not to want this symbol. The default definition, as a +% rule, makes no claim to being a good design. +% +% Some entries are repeated in case guards must all be on one line. +% \begin{macrocode} +%<*latin1|decmulti|latin2|latin3|latin4|latin5|latin9|applemacce|latin10> +\ProvideTextCommandDefault{\textdegree}{\ensuremath{{^\circ}}} +% +%<*cp850|cp858|cp852|cp865|cp437|cp437de|applemac|cp1252|cp1250|cp1257|next> +\ProvideTextCommandDefault{\textdegree}{\ensuremath{{^\circ}}} +% +%<*latin1|decmulti|latin3|latin5|cp850|cp858|cp852|cp1252|next> +\ProvideTextCommandDefault{\textonehalf}{\ensuremath{\frac12}} +% +%<*latin1|decmulti|latin5|cp850|cp858|cp852|cp1252|next> +\ProvideTextCommandDefault{\textonequarter}{\ensuremath{\frac14}} +% +%<*latin1|latin5|cp850|cp858|cp852|cp1252|next> +\ProvideTextCommandDefault{\textthreequarters}{\ensuremath{\frac34}} +% +%<*applemac|cp850|cp858|cp865|cp437|cp437de|cp1252|next> +\ProvideTextCommandDefault{\textflorin}{\textit{f}} +% +%<*cp865|cp437|cp437de> +\ProvideTextCommandDefault{\textpeseta}{Pt} +% +%<*cp850|cp858|cp852|cp865|cp437|cp437de> +\ProvideTextCommandDefault{\textblacksquare} +{\vrule \@width .3em \@height .4em \@depth -.1em\relax} +% +% \end{macrocode} +% +% \changes{v0.9k}{1995/11/29}{Added error messages for unavailable +% characters.} +% +% Some commands can't be faked, so we have them generate an error +% message. +% \begin{macrocode} +%<*latin1|decmulti|latin5|latin9|cp850|cp858|cp865|cp437|cp437de> +\ProvideTextCommandDefault{\textcent} + {\TextSymbolUnavailable\textcent} +\ProvideTextCommandDefault{\textyen} + {\TextSymbolUnavailable\textyen} +% +%<*applemac|cp1252|next> +\ProvideTextCommandDefault{\textcent} + {\TextSymbolUnavailable\textcent} +\ProvideTextCommandDefault{\textyen} + {\TextSymbolUnavailable\textyen} +% +%<*latin9|cp1252|latin10> +\ProvideTextCommandDefault{\texteuro} + {\TextSymbolUnavailable\texteuro} +% +%<*latin1|decmulti|latin2|latin3|latin4|latin5|cp850|cp858|cp852|cp865> +\ProvideTextCommandDefault{\textcurrency} + {\TextSymbolUnavailable\textcurrency} +% +%<*applemac|cp1252|cp1250|cp1257|next> +\ProvideTextCommandDefault{\textcurrency} + {\TextSymbolUnavailable\textcurrency} +% +%<*latin1|latin5|cp850|cp858|cp852|cp1252|cp1250> +\ProvideTextCommandDefault{\textbrokenbar} + {\TextSymbolUnavailable\textbrokenbar} +% +%<*latin3> +\ProvideTextCommandDefault{\textmalteseH} + {\TextSymbolUnavailable\textmalteseH} +\ProvideTextCommandDefault{\textmalteseh} + {\TextSymbolUnavailable\textmalteseh} +% +%<*latin4> +\ProvideTextCommandDefault{\textkra} + {\TextSymbolUnavailable\textkra} +\ProvideTextCommandDefault{\textTstroke} + {\TextSymbolUnavailable\textTstroke} +\ProvideTextCommandDefault{\texttstroke} + {\TextSymbolUnavailable\texttstroke} +% +%<*next> +\ProvideTextCommandDefault{\textquotesingle} + {\TextSymbolUnavailable\textquotesingle} +\ProvideTextCommandDefault{\capitalogonek} + {\TextSymbolUnavailable\capitalogonek} +% +%<*cp1250|cp1252|applemac|next> +\ProvideTextCommandDefault{\textperthousand} + {\TextSymbolUnavailable\textperthousand} +% +%<*applemacce> +\ProvideTextCommandDefault{\textdiv} + {\TextSymbolUnavailable\textdiv} +% +% \end{macrocode} +% +% \changes{v0.9l}{1995/12/01}{Removed extraneous braces from the +% `superior' glyphs.} +% \changes{v0.97}{1998/03/05}{Removed ords: +% changed to text chars, pr/2579} +% +% Characters that are supposed to be used only in math will be defined +% by |\providecommand| because \LaTeXe{} assumes that the font +% encoding for math fonts is static. +% +% \begin{macrocode} +%<*latin1|decmulti|latin5|latin9|cp850|cp858|cp1252|next> +\providecommand{\mathonesuperior}{{^1}} +% +%<*latin1|decmulti|latin3|latin5|latin9|cp850|cp858|cp1252|next> +\providecommand{\maththreesuperior}{{^3}} +% +%<*latin1|decmulti|latin3|latin5|latin9|cp850|cp858|cp865|cp437|cp437de> +\providecommand{\mathtwosuperior}{{^2}} +% +%<*cp1252|next> +\providecommand{\mathtwosuperior}{{^2}} +% +%<*cp865|cp437|cp437de> +\providecommand{\mathnsuperior}{{^n}} +% +% \end{macrocode} +% +% \section{The ASCII encoding} +% +% The ASCII encoding only allows characters in the range 32--127, so +% we only need to provide an empty |.def| file. +% +% \changes{v0.94}{1997/12/17}{Merged latin1 with ansinew/cp1252} +% +% \section{The ISO Latin-2 encoding} +% +% The ISO Latin-2 encoding file defines the characters +% in the ISO 8859-2 encoding. It was contributed by +% Petr Sojka (\texttt{sojka@muni.cz}) with small technical +% updates by Frank Mittelbach. +% +% \changes{v0.9e}{1995/08/31}{Redeclared "AD to be soft hyphen.} +% \changes{v0.91}{1997/08/19}{Replaced \cs{dh}/\cs{DH} by +% \cs{dj}/\cs{DJ}.} +% \changes{v0.94}{1997/12/17}{Changed 176 to \cs{textdegree}} +% +% \begin{macrocode} +%<*latin2> +\DeclareInputText{160}{\nobreakspace} +\DeclareInputText{176}{\textdegree} +\DeclareInputText{161}{\k A} +\DeclareInputText{177}{\k a} +\DeclareInputText{162}{\u{}} +\DeclareInputText{178}{\k\ } +\DeclareInputText{163}{\L} +\DeclareInputText{179}{\l} +\DeclareInputText{164}{\textcurrency} +\DeclareInputText{180}{\@tabacckludge'{}} +\DeclareInputText{165}{\v L} +\DeclareInputText{181}{\v l} +\DeclareInputText{166}{\@tabacckludge'S} +\DeclareInputText{182}{\@tabacckludge's} +\DeclareInputText{167}{\S} +\DeclareInputText{183}{\v{}} +\DeclareInputText{168}{\"{}} +\DeclareInputText{184}{\c\ } +\DeclareInputText{169}{\v S} +\DeclareInputText{185}{\v s} +\DeclareInputText{170}{\c S} +\DeclareInputText{186}{\c s} +\DeclareInputText{171}{\v T} +\DeclareInputText{187}{\v t} +\DeclareInputText{172}{\@tabacckludge'Z} +\DeclareInputText{188}{\@tabacckludge'z} +\DeclareInputText{173}{\-} +\DeclareInputText{189}{\H{}} +\DeclareInputText{174}{\v Z} +\DeclareInputText{190}{\v z} +\DeclareInputText{175}{\.Z} +\DeclareInputText{191}{\.z} +% \end{macrocode} +% +% \begin{macrocode} +\DeclareInputText{192}{\@tabacckludge'R} +\DeclareInputText{208}{\DJ} +\DeclareInputText{193}{\@tabacckludge'A} +\DeclareInputText{209}{\@tabacckludge'N} +\DeclareInputText{194}{\^A} +\DeclareInputText{210}{\v N} +\DeclareInputText{195}{\u A} +\DeclareInputText{211}{\@tabacckludge'O} +\DeclareInputText{196}{\"A} +\DeclareInputText{212}{\^O} +\DeclareInputText{197}{\@tabacckludge'L} +\DeclareInputText{213}{\H O} +\DeclareInputText{198}{\@tabacckludge'C} +\DeclareInputText{214}{\"O} +\DeclareInputText{199}{\c C} +\DeclareInputMath{215}{\times} +\DeclareInputText{200}{\v C} +\DeclareInputText{216}{\v R} +\DeclareInputText{201}{\@tabacckludge'E} +\DeclareInputText{217}{\r U} +\DeclareInputText{202}{\k E} +\DeclareInputText{218}{\@tabacckludge'U} +\DeclareInputText{203}{\"E} +\DeclareInputText{219}{\H U} +\DeclareInputText{204}{\v E} +\DeclareInputText{220}{\"U} +\DeclareInputText{205}{\@tabacckludge'I} +\DeclareInputText{221}{\@tabacckludge'Y} +\DeclareInputText{206}{\^I} +\DeclareInputText{222}{\c T} +\DeclareInputText{207}{\v D} +\DeclareInputText{223}{\ss} +% \end{macrocode} +% +% \begin{macrocode} +\DeclareInputText{224}{\@tabacckludge'r} +\DeclareInputText{240}{\dj} +\DeclareInputText{225}{\@tabacckludge'a} +\DeclareInputText{241}{\@tabacckludge'n} +\DeclareInputText{226}{\^a} +\DeclareInputText{242}{\v n} +\DeclareInputText{227}{\u a} +\DeclareInputText{243}{\@tabacckludge'o} +\DeclareInputText{228}{\"a} +\DeclareInputText{244}{\^o} +\DeclareInputText{229}{\@tabacckludge'l} +\DeclareInputText{245}{\H o} +\DeclareInputText{230}{\@tabacckludge'c} +\DeclareInputText{246}{\"o} +\DeclareInputText{231}{\c c} +\DeclareInputMath{247}{\div} +\DeclareInputText{232}{\v c} +\DeclareInputText{248}{\v r} +\DeclareInputText{233}{\@tabacckludge'e} +\DeclareInputText{249}{\r u} +\DeclareInputText{234}{\k e} +\DeclareInputText{250}{\@tabacckludge'u} +\DeclareInputText{235}{\"e} +\DeclareInputText{251}{\H u} +\DeclareInputText{236}{\v e} +\DeclareInputText{252}{\"u} +\DeclareInputText{237}{\@tabacckludge'\i} +\DeclareInputText{253}{\@tabacckludge'y} +\DeclareInputText{238}{\^\i} +\DeclareInputText{254}{\c t} +\DeclareInputText{239}{\v d} +\DeclareInputText{255}{\.{}} +% +% \end{macrocode} +% +% \section{The ISO Latin-3 encoding} +% +% The ISO Latin-3 encoding file defines the characters +% in the ISO 8859-3 encoding. It was contributed by +% by J\"org Knappen (\texttt{joerg.knappen@uni-mainz.de}) and +% adapted by Chris Rowley. +% +% It can be used for general purpose applications in +% typical office environments in the following languages: +% Afrikaans, Catalan, English, Esperanto, French, Gallician, German, +% Italian, Maltese, and Turkish. +% +% \begin{macrocode} +%<*latin3> +\DeclareInputText{160}{\nobreakspace} +\DeclareInputText{176}{\textdegree} +\DeclareInputText{161}{\textmalteseH} +\DeclareInputText{177}{\textmalteseh} +\DeclareInputText{162}{\u{}} +\DeclareInputMath{178}{\mathtwosuperior} +\DeclareInputText{163}{\pounds} +\DeclareInputMath{179}{\maththreesuperior} +\DeclareInputText{164}{\textcurrency} +\DeclareInputText{180}{\@tabacckludge'{}} +% \DeclareInputText{165}{\notdef} +\DeclareInputMath{181}{\mu} +\DeclareInputText{166}{\^H} +% NOT: \DeclareInputText{182}{h\llap{\^{}}} % \^h would be too tall +\DeclareInputText{182}{\^h} +\DeclareInputText{167}{\S} +\DeclareInputText{183}{\textperiodcentered} +\DeclareInputText{168}{\"{}} +\DeclareInputText{184}{\c\ } +\DeclareInputText{169}{\.I} +\DeclareInputText{185}{\i} +\DeclareInputText{170}{\c S} +\DeclareInputText{186}{\c s} +\DeclareInputText{171}{\u G} +\DeclareInputText{187}{\u g} +\DeclareInputText{172}{\^J} +\DeclareInputText{188}{\^\j} +\DeclareInputText{173}{\-} +\DeclareInputText{189}{\textonehalf} +% \DeclareInputText{174}{\notdef} +% \DeclareInputText{190}{\notdef} +\DeclareInputText{175}{\.Z} +\DeclareInputText{191}{\.z} +% \end{macrocode} +% +% \begin{macrocode} +\DeclareInputText{192}{\@tabacckludge`A} +% \DeclareInputText{208}{\notdef} +\DeclareInputText{193}{\@tabacckludge'A} +\DeclareInputText{209}{\~N} +\DeclareInputText{194}{\^A} +\DeclareInputText{210}{\@tabacckludge`O} +% \DeclareInputText{195}{\notdef} +\DeclareInputText{211}{\@tabacckludge'O} +\DeclareInputText{196}{\"A} +\DeclareInputText{212}{\^O} +\DeclareInputText{197}{\.C} +\DeclareInputText{213}{\.G} +\DeclareInputText{198}{\^C} +\DeclareInputText{214}{\"O} +\DeclareInputText{199}{\c C} +\DeclareInputMath{215}{\times} +\DeclareInputText{200}{\@tabacckludge`E} +\DeclareInputText{216}{\^G} +\DeclareInputText{201}{\@tabacckludge'E} +\DeclareInputText{217}{\@tabacckludge`U} +\DeclareInputText{202}{\^E} +\DeclareInputText{218}{\@tabacckludge'U} +\DeclareInputText{203}{\"E} +\DeclareInputText{219}{\^U} +\DeclareInputText{204}{\@tabacckludge`I} +\DeclareInputText{220}{\"U} +\DeclareInputText{205}{\@tabacckludge'I} +\DeclareInputText{221}{\u U} +\DeclareInputText{206}{\^I} +\DeclareInputText{222}{\^S} +\DeclareInputText{207}{\"I} +\DeclareInputText{223}{\ss} +% \end{macrocode} +% +% \begin{macrocode} +\DeclareInputText{224}{\@tabacckludge`a} +% \DeclareInputText{240}{\notdef} +\DeclareInputText{225}{\@tabacckludge'a} +\DeclareInputText{241}{\~n} +\DeclareInputText{226}{\^a} +\DeclareInputText{242}{\@tabacckludge`o} +% \DeclareInputText{227}{\notdef} +\DeclareInputText{243}{\@tabacckludge'o} +\DeclareInputText{228}{\"a} +\DeclareInputText{244}{\^o} +\DeclareInputText{229}{\.c} +\DeclareInputText{245}{\.g} +\DeclareInputText{230}{\^c} +\DeclareInputText{246}{\"o} +\DeclareInputText{231}{\c c} +\DeclareInputMath{247}{\div} +\DeclareInputText{232}{\@tabacckludge`e} +\DeclareInputText{248}{\^g} +\DeclareInputText{233}{\@tabacckludge'e} +\DeclareInputText{249}{\@tabacckludge`u} +\DeclareInputText{234}{\^e} +\DeclareInputText{250}{\@tabacckludge'u} +\DeclareInputText{235}{\"e} +\DeclareInputText{251}{\^u} +\DeclareInputText{236}{\@tabacckludge`\i} +\DeclareInputText{252}{\"u} +\DeclareInputText{237}{\@tabacckludge'\i} +\DeclareInputText{253}{\u u} +\DeclareInputText{238}{\^\i} +\DeclareInputText{254}{\^s} +\DeclareInputText{239}{\"\i} +\DeclareInputText{255}{\.{}} +% +% \end{macrocode} +% +% \section{The ISO Latin-4 encoding} +% +% The ISO Latin-4 encoding file defines the characters in the ISO +% 8859-4 encoding. It was contributed by Hana Skoumalov\'a +% (\texttt{hana.skoumalova@ff.cuni.cz}). +% +% It was created for Estonian, Latvian, Lithuanian, Finnish, Lappish, +% Swedish, Norvegian, Danish, Icelandic and Greenlandic Inuit. Some +% alphabets, however, are incomplete (Greenlandic, Icelandic and Lappish). +% Some glyphs are not available in the fonts. For example, the +% Greenlandic character `kra' is not available at all; +% the Latvian and Lithuanian characters not +% contained in other encodings are constructed from components and +% they do not look good. +% +% \changes{v0.999}{2001/06/04}{Added \cs{textkra}, \cs{texttstroke} and +% \cs{textTstroke} (pr/3336)} +% \begin{macrocode} +%<*latin4> +\DeclareInputText{160}{\nobreakspace} +\DeclareInputText{161}{\k A} +\DeclareInputText{162}{\textkra}%% Greenlandic Inuit +\DeclareInputText{163}{\c R} +\DeclareInputText{164}{\textcurrency} +\DeclareInputText{165}{\~I} +\DeclareInputText{166}{\c L} +\DeclareInputText{167}{\S} +\DeclareInputText{168}{\"\ } +\DeclareInputText{169}{\v S} +\DeclareInputText{170}{\@tabacckludge=E} +\DeclareInputText{171}{\c G} +\DeclareInputText{172}{\textTstroke}%% Northern Sami +\DeclareInputText{173}{\-} +\DeclareInputText{174}{\v Z} +\DeclareInputText{175}{\@tabacckludge={}} +\DeclareInputText{176}{\textdegree} +\DeclareInputText{177}{\k a} +\DeclareInputText{178}{\k\ } +\DeclareInputText{179}{\c r} +\DeclareInputText{180}{\@tabacckludge'{}} +\DeclareInputText{181}{\~\i} +\DeclareInputText{182}{\c l} +\DeclareInputText{183}{\v\ } +\DeclareInputText{184}{\c\ } +\DeclareInputText{185}{\v s} +\DeclareInputText{186}{\@tabacckludge=e} +\DeclareInputText{187}{\c g} +\DeclareInputText{188}{\texttstroke}%% Northern Sami +\DeclareInputText{189}{\NG} +\DeclareInputText{190}{\v z} +\DeclareInputText{191}{\ng} +% \end{macrocode} +% +% \begin{macrocode} +\DeclareInputText{192}{\@tabacckludge=A} +\DeclareInputText{193}{\@tabacckludge'A} +\DeclareInputText{194}{\^A} +\DeclareInputText{195}{\~A} +\DeclareInputText{196}{\"A} +\DeclareInputText{197}{\r A} +\DeclareInputText{198}{\AE} +\DeclareInputText{199}{\k I} +\DeclareInputText{200}{\v C} +\DeclareInputText{201}{\@tabacckludge'E} +\DeclareInputText{202}{\k E} +\DeclareInputText{203}{\"E} +\DeclareInputText{204}{\.{E}} +\DeclareInputText{205}{\@tabacckludge'I} +\DeclareInputText{206}{\^I} +\DeclareInputText{207}{\@tabacckludge=I} +\DeclareInputText{208}{\DJ} +\DeclareInputText{209}{\c N} +\DeclareInputText{210}{\@tabacckludge=O} +\DeclareInputText{211}{\c K} +\DeclareInputText{212}{\^O} +\DeclareInputText{213}{\~O} +\DeclareInputText{214}{\"O} +\DeclareInputMath{215}{\times} +\DeclareInputText{216}{\O} +\DeclareInputText{217}{\k U} +\DeclareInputText{218}{\@tabacckludge'U} +\DeclareInputText{219}{\^U} +\DeclareInputText{220}{\"U} +\DeclareInputText{221}{\~U} +\DeclareInputText{222}{\@tabacckludge=U} +\DeclareInputText{223}{\ss} +% \end{macrocode} +% +% \begin{macrocode} +\DeclareInputText{224}{\@tabacckludge=a} +\DeclareInputText{225}{\@tabacckludge'a} +\DeclareInputText{226}{\^a} +\DeclareInputText{227}{\~a} +\DeclareInputText{228}{\"a} +\DeclareInputText{229}{\r a} +\DeclareInputText{230}{\ae} +\DeclareInputText{231}{\k i} +\DeclareInputText{232}{\v c} +\DeclareInputText{233}{\@tabacckludge'e} +\DeclareInputText{234}{\k e} +\DeclareInputText{235}{\"e} +\DeclareInputText{236}{\.{e}} +\DeclareInputText{237}{\@tabacckludge'\i} +\DeclareInputText{238}{\^\i} +\DeclareInputText{239}{\@tabacckludge=\i} +\DeclareInputText{240}{\dj} +\DeclareInputText{241}{\c n} +\DeclareInputText{242}{\@tabacckludge=o} +\DeclareInputText{243}{\c k} +\DeclareInputText{244}{\^o} +\DeclareInputText{245}{\~o} +\DeclareInputText{246}{\"o} +\DeclareInputMath{247}{\div} +\DeclareInputText{248}{\o} +\DeclareInputText{249}{\k u} +\DeclareInputText{250}{\@tabacckludge'u} +\DeclareInputText{251}{\^u} +\DeclareInputText{252}{\"u} +\DeclareInputText{253}{\~u} +\DeclareInputText{254}{\@tabacckludge=u} +\DeclareInputText{255}{\.\ } +% +% \end{macrocode} +% +% \section{The ISO Latin-5 encoding} +% +% \changes{v0.991}{1999/08/23}{Corrected description for Latin-5.} +% The ISO Latin-5 encoding file defines the characters +% in the ISO 8859-9 encoding, which describes Latin Alphabet No. 5. +% It was contributed by H.~Turgut Uyar (\texttt{uyar@cs.itu.edu.tr}); +% it is used for Turkish. +% +% \begin{macrocode} +%<*latin5> +\DeclareInputText{160}{\nobreakspace} +\DeclareInputText{176}{\textdegree} +\DeclareInputText{161}{\textexclamdown} +\DeclareInputMath{177}{\pm} +\DeclareInputText{162}{\textcent} +\DeclareInputMath{178}{\mathtwosuperior} +\DeclareInputText{163}{\pounds} +\DeclareInputMath{179}{\maththreesuperior} +\DeclareInputText{164}{\textcurrency} +\DeclareInputText{180}{\@tabacckludge'{}} +\DeclareInputText{165}{\textyen} +\DeclareInputMath{181}{\mu} +\DeclareInputText{166}{\textbrokenbar} +\DeclareInputText{182}{\P} +\DeclareInputText{167}{\S} +\DeclareInputText{183}{\textperiodcentered} +\DeclareInputText{168}{\"{}} +\DeclareInputText{184}{\c\ } +\DeclareInputText{169}{\copyright} +\DeclareInputMath{185}{\mathonesuperior} +\DeclareInputText{170}{\textordfeminine} +\DeclareInputText{186}{\textordmasculine} +\DeclareInputText{171}{\guillemotleft} +\DeclareInputText{187}{\guillemotright} +\DeclareInputMath{172}{\lnot} +\DeclareInputText{188}{\textonequarter} +\DeclareInputText{173}{\-} +\DeclareInputText{189}{\textonehalf} +\DeclareInputText{174}{\textregistered} +\DeclareInputText{190}{\textthreequarters} +\DeclareInputText{175}{\@tabacckludge={}} +\DeclareInputText{191}{\textquestiondown} +% \end{macrocode} +% +% \begin{macrocode} +\DeclareInputText{192}{\@tabacckludge`A} +\DeclareInputText{208}{\u G} +\DeclareInputText{193}{\@tabacckludge'A} +\DeclareInputText{209}{\~N} +\DeclareInputText{194}{\^A} +\DeclareInputText{210}{\@tabacckludge`O} +\DeclareInputText{195}{\~A} +\DeclareInputText{211}{\@tabacckludge'O} +\DeclareInputText{196}{\"A} +\DeclareInputText{212}{\^O} +\DeclareInputText{197}{\r A} +\DeclareInputText{213}{\~O} +\DeclareInputText{198}{\AE} +\DeclareInputText{214}{\"O} +\DeclareInputText{199}{\c C} +\DeclareInputMath{215}{\times} +\DeclareInputText{200}{\@tabacckludge`E} +\DeclareInputText{216}{\O} +\DeclareInputText{201}{\@tabacckludge'E} +\DeclareInputText{217}{\@tabacckludge`U} +\DeclareInputText{202}{\^E} +\DeclareInputText{218}{\@tabacckludge'U} +\DeclareInputText{203}{\"E} +\DeclareInputText{219}{\^U} +\DeclareInputText{204}{\@tabacckludge`I} +\DeclareInputText{220}{\"U} +\DeclareInputText{205}{\@tabacckludge'I} +\DeclareInputText{221}{\.I} +\DeclareInputText{206}{\^I} +\DeclareInputText{222}{\c S} +\DeclareInputText{207}{\"I} +\DeclareInputText{223}{\ss} +% \end{macrocode} +% +% \begin{macrocode} +\DeclareInputText{224}{\@tabacckludge`a} +\DeclareInputText{240}{\u g} +\DeclareInputText{225}{\@tabacckludge'a} +\DeclareInputText{241}{\~n} +\DeclareInputText{226}{\^a} +\DeclareInputText{242}{\@tabacckludge`o} +\DeclareInputText{227}{\~a} +\DeclareInputText{243}{\@tabacckludge'o} +\DeclareInputText{228}{\"a} +\DeclareInputText{244}{\^o} +\DeclareInputText{229}{\r a} +\DeclareInputText{245}{\~o} +\DeclareInputText{230}{\ae} +\DeclareInputText{246}{\"o} +\DeclareInputText{231}{\c c} +\DeclareInputMath{247}{\div} +\DeclareInputText{232}{\@tabacckludge`e} +\DeclareInputText{248}{\o} +\DeclareInputText{233}{\@tabacckludge'e} +\DeclareInputText{249}{\@tabacckludge`u} +\DeclareInputText{234}{\^e} +\DeclareInputText{250}{\@tabacckludge'u} +\DeclareInputText{235}{\"e} +\DeclareInputText{251}{\^u} +\DeclareInputText{236}{\@tabacckludge`\i} +\DeclareInputText{252}{\"u} +\DeclareInputText{237}{\@tabacckludge'\i} +\DeclareInputText{253}{\i } +\DeclareInputText{238}{\^\i} +\DeclareInputText{254}{\c s} +\DeclareInputText{239}{\"\i} +\DeclareInputText{255}{\"y} +% +% \end{macrocode} +% +% \section{DEC Multinational Character Set} +% +% The DECMultinational character set, used by the OpenVMS operating +% system, is slightly different from the ISO Latin 1 character set. +% +% Reference: Digital Equipment Corporation VT330/VT340 Programmer +% Reference Manual, Volume 1: Text Programming, page 22. +% +% This encoding was provided by M.Y. Chartoire IPNL-IN2P3 \\ +% \texttt{m.chartoire@ipnl.in2p3.fr} +% +% \begin{macrocode} +%<*decmulti> +\DeclareInputText{176}{\textdegree} +\DeclareInputText{161}{\textexclamdown} +\DeclareInputMath{177}{\pm} +\DeclareInputText{162}{\textcent} +\DeclareInputMath{178}{\mathtwosuperior} +\DeclareInputText{163}{\pounds} +\DeclareInputMath{179}{\maththreesuperior} +\DeclareInputText{165}{\textyen} +\DeclareInputMath{181}{\mu} +\DeclareInputText{182}{\P} +\DeclareInputText{167}{\S} +\DeclareInputText{183}{\textperiodcentered} +\DeclareInputText{168}{\textcurrency} +\DeclareInputText{169}{\copyright} +\DeclareInputMath{185}{\mathonesuperior} +\DeclareInputText{170}{\textordfeminine} +\DeclareInputText{186}{\textordmasculine} +\DeclareInputText{171}{\guillemotleft} +\DeclareInputText{187}{\guillemotright} +\DeclareInputText{188}{\textonequarter} +\DeclareInputText{189}{\textonehalf} +\DeclareInputText{191}{\textquestiondown} +% \end{macrocode} +% +% \begin{macrocode} +\DeclareInputText{192}{\@tabacckludge`A} +\DeclareInputText{193}{\@tabacckludge'A} +\DeclareInputText{209}{\~N} +\DeclareInputText{194}{\^A} +\DeclareInputText{210}{\@tabacckludge`O} +\DeclareInputText{195}{\~A} +\DeclareInputText{211}{\@tabacckludge'O} +\DeclareInputText{196}{\"A} +\DeclareInputText{212}{\^O} +\DeclareInputText{197}{\r A} +\DeclareInputText{213}{\~O} +\DeclareInputText{198}{\AE} +\DeclareInputText{214}{\"O} +\DeclareInputText{199}{\c C} +\DeclareInputText{215}{\OE} +\DeclareInputText{200}{\@tabacckludge`E} +\DeclareInputText{216}{\O} +\DeclareInputText{201}{\@tabacckludge'E} +\DeclareInputText{217}{\@tabacckludge`U} +\DeclareInputText{202}{\^E} +\DeclareInputText{218}{\@tabacckludge'U} +\DeclareInputText{203}{\"E} +\DeclareInputText{219}{\^U} +\DeclareInputText{204}{\@tabacckludge`I} +\DeclareInputText{220}{\"U} +\DeclareInputText{205}{\@tabacckludge'I} +\DeclareInputText{221}{\"Y} +\DeclareInputText{206}{\^I} +\DeclareInputText{207}{\"I} +\DeclareInputText{223}{\ss} +% \end{macrocode} +% +% \begin{macrocode} +\DeclareInputText{224}{\@tabacckludge`a} +\DeclareInputText{225}{\@tabacckludge'a} +\DeclareInputText{241}{\~n} +\DeclareInputText{226}{\^a} +\DeclareInputText{242}{\@tabacckludge`o} +\DeclareInputText{227}{\~a} +\DeclareInputText{243}{\@tabacckludge'o} +\DeclareInputText{228}{\"a} +\DeclareInputText{244}{\^o} +\DeclareInputText{229}{\r a} +\DeclareInputText{245}{\~o} +\DeclareInputText{230}{\ae} +\DeclareInputText{246}{\"o} +\DeclareInputText{231}{\c c} +\DeclareInputText{247}{\oe} +\DeclareInputText{232}{\@tabacckludge`e} +\DeclareInputText{248}{\o} +\DeclareInputText{233}{\@tabacckludge'e} +\DeclareInputText{249}{\@tabacckludge`u} +\DeclareInputText{234}{\^e} +\DeclareInputText{250}{\@tabacckludge'u} +\DeclareInputText{235}{\"e} +\DeclareInputText{251}{\^u} +\DeclareInputText{236}{\@tabacckludge`\i} +\DeclareInputText{252}{\"u} +\DeclareInputText{237}{\@tabacckludge'\i} +\DeclareInputText{253}{\"y} +\DeclareInputText{238}{\^\i} +\DeclareInputText{239}{\"\i} +% +% \end{macrocode} +% +% +% \section{The IBM code pages 850 and 858} +% +% This input encoding was contributed by +% Timo Knuutila (\texttt{knuutila@\linebreak[0]cs.utu.fi}), +% and edited by Christian Bartels +% (\texttt{ii140ba@\linebreak[0]vm1.rz.rwth-aachen.de}). +% +% The DOS graphics `letters' and a few +% other positions are ignored (left undefined). +% +% The 858 code page is identical to the 850 except that +% +% \changes{v0.9d}{1995/06/06}{Made changes to cp850 suggested by +% Christian Bartels} +% \changes{v0.9s}{1995/08/31} +% {Swapped ordfeminine and masculine. /2203} +% +% \begin{macrocode} +%<*cp850|cp858> +\DeclareInputText{128}{\c C} +\DeclareInputText{144}{\@tabacckludge'E} +\DeclareInputText{129}{\"u} +\DeclareInputText{145}{\ae} +\DeclareInputText{130}{\@tabacckludge'e} +\DeclareInputText{146}{\AE} +\DeclareInputText{131}{\^a} +\DeclareInputText{147}{\^o} +\DeclareInputText{132}{\"a} +\DeclareInputText{148}{\"o} +\DeclareInputText{133}{\@tabacckludge`a} +\DeclareInputText{149}{\@tabacckludge`o} +\DeclareInputText{134}{\r a} +\DeclareInputText{150}{\^u} +\DeclareInputText{135}{\c c} +\DeclareInputText{151}{\@tabacckludge`u} +\DeclareInputText{136}{\^e} +\DeclareInputText{152}{\"y} +\DeclareInputText{137}{\"e} +\DeclareInputText{153}{\"O} +\DeclareInputText{138}{\@tabacckludge`e} +\DeclareInputText{154}{\"U} +\DeclareInputText{139}{\"\i} +\DeclareInputText{155}{\o} +\DeclareInputText{140}{\^\i} +\DeclareInputText{156}{\pounds} +\DeclareInputText{141}{\@tabacckludge`\i} +\DeclareInputText{157}{\O} +\DeclareInputText{142}{\"A} +\DeclareInputMath{158}{\times} +\DeclareInputText{143}{\r A} +\DeclareInputText{159}{\textflorin} +% \end{macrocode} +% +% \begin{macrocode} +\DeclareInputText{160}{\@tabacckludge'a} +\DeclareInputText{161}{\@tabacckludge'\i} +\DeclareInputText{162}{\@tabacckludge'o} +\DeclareInputText{163}{\@tabacckludge'u} +\DeclareInputText{164}{\~n} %% "B0-"B4: DG +\DeclareInputText{165}{\~N} +\DeclareInputText{181}{\@tabacckludge'A} +\DeclareInputText{166}{\textordfeminine} +\DeclareInputText{182}{\^A} +\DeclareInputText{167}{\textordmasculine} +\DeclareInputText{183}{\@tabacckludge`A} +\DeclareInputText{168}{\textquestiondown} +\DeclareInputText{184}{\copyright} +\DeclareInputText{169}{\textregistered} +\DeclareInputMath{170}{\lnot} +\DeclareInputText{171}{\textonehalf} +\DeclareInputText{172}{\textonequarter} %% "B9-"BC: DG +\DeclareInputText{173}{\textexclamdown} +\DeclareInputText{189}{\textcent} +\DeclareInputText{174}{\guillemotleft} +\DeclareInputText{190}{\textyen} +\DeclareInputText{175}{\guillemotright} +% \end{macrocode} +% +% \begin{macrocode} +% "BF-"C5: DG +\DeclareInputText{208}{\dh} +\DeclareInputText{209}{\DH} +\DeclareInputText{210}{\^E} +\DeclareInputText{211}{\"E} +\DeclareInputText{212}{\@tabacckludge`E} +% \end{macrocode} +% Here is the only point in which the two code pages differ! +% \begin{macrocode} +%<-cp858>\DeclareInputText{213}{\i} +%<-cp850>\DeclareInputText{213}{\texteuro} +% \end{macrocode} +% +% \begin{macrocode} +\DeclareInputText{198}{\~a} +\DeclareInputText{214}{\@tabacckludge'I} +\DeclareInputText{199}{\~A} +\DeclareInputText{215}{\^I} +\DeclareInputText{216}{\"I} +% "C8-"CE: DG +% "D9-"DC: DG +\DeclareInputText{221}{\textbrokenbar} +\DeclareInputText{222}{\@tabacckludge`I} +\DeclareInputText{207}{\textcurrency} %% "DF: DG +% \end{macrocode} +% +% \begin{macrocode} +\DeclareInputText{224}{\@tabacckludge'O} +\DeclareInputText{240}{\textendash} +\DeclareInputText{225}{\ss} +\DeclareInputMath{241}{\pm} +\DeclareInputText{226}{\^O} +% "F2: DG (not double underline, or equals?) +\DeclareInputText{227}{\@tabacckludge`O} +\DeclareInputText{243}{\textthreequarters} +\DeclareInputText{228}{\~o} +\DeclareInputText{244}{\P} +\DeclareInputText{229}{\~O} +\DeclareInputText{245}{\S} +\DeclareInputMath{230}{\mu} +\DeclareInputMath{246}{\div} +\DeclareInputText{231}{\th} +\DeclareInputText{247}{\c\ } +\DeclareInputText{232}{\TH} +\DeclareInputText{248}{\textdegree} +\DeclareInputText{233}{\@tabacckludge'U} +\DeclareInputText{249}{\"{}} +\DeclareInputText{234}{\^U} +\DeclareInputText{250}{\textperiodcentered} +\DeclareInputText{235}{\@tabacckludge`U} +\DeclareInputMath{251}{\mathonesuperior} +\DeclareInputText{236}{\@tabacckludge'y} +\DeclareInputMath{252}{\maththreesuperior} +\DeclareInputText{237}{\@tabacckludge'Y} +\DeclareInputMath{253}{\mathtwosuperior} +\DeclareInputText{238}{\@tabacckludge={}} +\DeclareInputText{254}{\textblacksquare} % right name? +\DeclareInputText{239}{\@tabacckludge'{}} +\DeclareInputText{255}{\nobreakspace} +% +% \end{macrocode} +% +% \section{The IBM code page 852} +% +% This input encoding was contributed by +% Petr Sojka (\texttt{sojka@\linebreak[0]Muni.cz}). +% +% \changes{v0.9t}{1996/10/28}{Added extra \cs{nobreakspace}: OK?} +% \changes{v0.9z}{1997/05/10}{Corrected typo in slot 213} +% \changes{v0.91}{1997/08/19}{Replaced \cs{dh}/\cs{DH} by +% \cs{dj}/\cs{DJ}.} +% \changes{v0.99}{1999/04/14}{Changed 212, see pr/2992} +% +% \begin{macrocode} +%<*cp852> +\DeclareInputText{128}{\c C} +\DeclareInputText{144}{\@tabacckludge'E} +\DeclareInputText{129}{\"u} +\DeclareInputText{145}{\@tabacckludge'L} +\DeclareInputText{130}{\@tabacckludge'e} +\DeclareInputText{146}{\@tabacckludge'l} +\DeclareInputText{131}{\^a} +\DeclareInputText{147}{\^o} +\DeclareInputText{132}{\"a} +\DeclareInputText{148}{\"o} +\DeclareInputText{133}{\r u} +\DeclareInputText{149}{\v L} +\DeclareInputText{134}{\@tabacckludge'c} +\DeclareInputText{150}{\v l} +\DeclareInputText{135}{\c c} +\DeclareInputText{151}{\@tabacckludge'S} +\DeclareInputText{136}{\l} +\DeclareInputText{152}{\@tabacckludge's} +\DeclareInputText{137}{\"e} +\DeclareInputText{153}{\"O} +\DeclareInputText{138}{\H O} +\DeclareInputText{154}{\"U} +\DeclareInputText{139}{\H o} +\DeclareInputText{155}{\v T} +\DeclareInputText{140}{\^\i} +\DeclareInputText{156}{\v t} +\DeclareInputText{141}{\@tabacckludge'Z} +\DeclareInputText{157}{\L} +\DeclareInputText{142}{\"A} +\DeclareInputMath{158}{\times} +\DeclareInputText{143}{\@tabacckludge'C} +\DeclareInputText{159}{\v c} +% \end{macrocode} +% +% \begin{macrocode} +\DeclareInputText{160}{\@tabacckludge'a} +\DeclareInputText{161}{\@tabacckludge'\i} +\DeclareInputText{162}{\@tabacckludge'o} +\DeclareInputText{163}{\@tabacckludge'u} +\DeclareInputText{164}{\k A} +\DeclareInputText{165}{\k a} +\DeclareInputText{166}{\v Z} +\DeclareInputText{167}{\v z} +\DeclareInputText{168}{\k E} +\DeclareInputText{169}{\k e} +\DeclareInputText{170}{\nobreakspace} % or empty?? +\DeclareInputText{171}{\@tabacckludge'z} +\DeclareInputText{172}{\v C} +\DeclareInputText{173}{\c s} +\DeclareInputText{174}{\guillemotleft} +\DeclareInputText{175}{\guillemotright} +\DeclareInputText{181}{\@tabacckludge'A} +\DeclareInputText{182}{\^A} +\DeclareInputText{183}{\v E} +\DeclareInputText{184}{\c S} +\DeclareInputText{189}{\.Z} +\DeclareInputText{190}{\.z} +% \end{macrocode} +% +% \begin{macrocode} +\DeclareInputText{198}{\u A} +\DeclareInputText{199}{\u a} +\DeclareInputText{207}{\textcurrency} +\DeclareInputText{208}{\dj} +\DeclareInputText{209}{\DJ} +\DeclareInputText{210}{\v D} +\DeclareInputText{211}{\"E} +\DeclareInputText{212}{\v d} % d caron +\DeclareInputText{213}{\v N} +\DeclareInputText{214}{\@tabacckludge'I} +\DeclareInputText{215}{\^I} +\DeclareInputText{216}{\v e} +\DeclareInputText{221}{\c T} +\DeclareInputText{222}{\r U} +% \end{macrocode} +% +% \begin{macrocode} +\DeclareInputText{224}{\@tabacckludge'O} +\DeclareInputText{240}{\textendash} +\DeclareInputText{225}{\ss} +\DeclareInputText{241}{\H{}} +\DeclareInputText{226}{\^O} +\DeclareInputText{242}{\k\ } +\DeclareInputText{227}{\@tabacckludge'N} +\DeclareInputText{243}{\v{}} +\DeclareInputText{228}{\@tabacckludge'n} +\DeclareInputText{244}{\u{}} +\DeclareInputText{229}{\v n} +\DeclareInputText{245}{\S} +\DeclareInputText{230}{\v S} +\DeclareInputMath{246}{\div} +\DeclareInputText{231}{\v s} +\DeclareInputText{247}{\c\ } +\DeclareInputText{232}{\@tabacckludge'R} +\DeclareInputText{248}{\textdegree} +\DeclareInputText{233}{\@tabacckludge'U} +\DeclareInputText{249}{\"{}} +\DeclareInputText{234}{\@tabacckludge'r} +\DeclareInputText{250}{\.{}} +\DeclareInputText{235}{\H U} +\DeclareInputText{251}{\H u} +\DeclareInputText{236}{\@tabacckludge'y} +\DeclareInputText{252}{\v R} +\DeclareInputText{237}{\@tabacckludge'Y} +\DeclareInputText{253}{\v r} +\DeclareInputText{238}{\c t} +\DeclareInputText{254}{\textblacksquare} % right name? +\DeclareInputText{239}{\@tabacckludge'{}} +\DeclareInputText{255}{\nobreakspace} +% +% \end{macrocode} +% +% \section{The IBM code pages 437 and 865} +% +% This input encoding is based on work by\\ +% Volker Kunert +% (\texttt{volker@\linebreak[0]numsun1.mathematik.uni-halle.de})\\ +% and \texttt{bontus@\linebreak[0]al6000.physik.uni-siegen.de}.\\ +% The changes for cp865 are based on work by S\o ren Sandmann +% (\texttt{sandmann@\linebreak[0]daimi.aau.dk}), with thanks to +% them all. +% +% The DOS graphics `letters' and a few +% other positions are ignored (left undefined). +% +% Unfortunately, in cp437 there is no agreement as to whether slot E1 +% should be `$\beta$' or `\ss', so we provide two variants, +% one (cp437) with `$\beta$' and one (cp437de) with `\ss'. +% +% \changes{v0.9e}{1995/08/31}{Added a 0 to all character codes} +% +% \changes{v0.9m}{1995/12/04}{Made uumlaut and pounds text characters} +% \changes{v0.9t}{1996/10/28}{Added \cs{textflorin} and \cs{textpeseta}} +% \changes{v0.9t}{1996/10/28}{Removed \cs{textbrokenbar}} +% \changes{v0.9t}{1996/10/28}{Removed \cs{textendash}} +% \changes{v0.9t}{1996/10/28}{Changed \cs{Theta} to \cs{Phi}} +% \changes{v0.9t}{1996/10/28}{Changed \cs{Pi} to \cs{pi}, perhaps} +% \changes{v0.9t}{1996/10/28}{Changed \cs{emptyset} to \cs{phi}} +% \changes{v0.9t}{1996/10/28}{Changed \cs{maththreesuperior} to +% \cs{mathnsuperior}} +% \changes{v0.94}{1997/12/17}{Changed 158 to \cs{DeclareInputText}} +% +% \begin{macrocode} +%<*cp437|cp437de|cp865> +\DeclareInputText{128}{{\c C}} +\DeclareInputText{129}{\"u} +\DeclareInputText{130}{\@tabacckludge'e} +\DeclareInputText{131}{\^a} +\DeclareInputText{132}{\"a} +\DeclareInputText{133}{\@tabacckludge`a} +\DeclareInputText{134}{\r a} +\DeclareInputText{135}{{\c c}} +\DeclareInputText{136}{\^e} +\DeclareInputText{137}{\"e} +\DeclareInputText{138}{\@tabacckludge`e} +\DeclareInputText{139}{\"\i} +\DeclareInputText{140}{\^\i} +\DeclareInputText{141}{\@tabacckludge`\i} +\DeclareInputText{142}{\"A} +\DeclareInputText{143}{\r A} +\DeclareInputText{144}{\@tabacckludge'E} +\DeclareInputText{145}{\ae} +\DeclareInputText{146}{\AE} +\DeclareInputText{147}{\^o} +\DeclareInputText{148}{\"o} +\DeclareInputText{149}{\@tabacckludge`o} +\DeclareInputText{150}{\^u} +\DeclareInputText{151}{\@tabacckludge`u} +\DeclareInputText{152}{\"y} +\DeclareInputText{153}{\"O} +\DeclareInputText{154}{\"U} +% +%<*cp437|cp437de> +\DeclareInputText{155}{\textcent} +\DeclareInputText{156}{\pounds} +\DeclareInputText{157}{\textyen} +% +%<*cp865> +\DeclareInputText{155}{\o} +\DeclareInputText{156}{\pounds} +\DeclareInputText{157}{\O} +% +%<*cp437|cp437de|cp865> +\DeclareInputText{158}{\textpeseta} % Pt +\DeclareInputText{159}{\textflorin} +% \end{macrocode} +% +% \begin{macrocode} +\DeclareInputText{160}{\@tabacckludge'a} % 160 +\DeclareInputText{161}{\@tabacckludge'\i} +\DeclareInputText{162}{\@tabacckludge'o} +\DeclareInputText{163}{\@tabacckludge'u} +\DeclareInputText{164}{\~n} +\DeclareInputText{165}{\~N} +\DeclareInputText{166}{\textordfeminine} +\DeclareInputText{167}{\textordmasculine} +\DeclareInputText{168}{\textquestiondown} +%\DeclareInputText{169}{} % left upper corner +\DeclareInputMath{170}{\lnot} +\DeclareInputText{171}{\textonehalf} +\DeclareInputText{172}{\textonequarter} +\DeclareInputText{173}{\textexclamdown} +\DeclareInputText{174}{\guillemotleft} +%\DeclareInputText{175}{\guillemotright} +%\DeclareInputText{175}{\textcurrency} +%\DeclareInputText{176}{\textlightgraybox} +%\DeclareInputText{177}{\textgraybox} +%\DeclareInputText{178}{\textdarkgraybox} +%\DeclareInputMath{179}{} % vertical bar +%\DeclareInputText{180}{} % vertical bar with branch to left +%\DeclareInputText{181}{} % vertical bar with double branch to left +%\DeclareInputText{182}{} % double bar with single branch to left +%\DeclareInputText{183}{} % graphic +%\DeclareInputText{184}{} % graphic +%\DeclareInputMath{185}{} % vertical double bar with branch to left +%\DeclareInputMath{186}{} % vertical double bar +%\DeclareInputText{187}{} % double upper right corner +%\DeclareInputMath{188}{} % double lower right corner +%\DeclareInputText{189}{} % graphic +%\DeclareInputText{190}{} % graphic +%\DeclareInputMath{191}{\ensuremath{\rceil}} +% \end{macrocode} +% +% \begin{macrocode} +%\DeclareInputMath{192}{\ensuremath{\lfloor}} +%\DeclareInputText{193}{} % dash with branch up +%\DeclareInputText{194}{} % dash with branch down +%\DeclareInputText{195}{} % vertical bar with branch to right +%\DeclareInputText{196}{} % horizontal bar, not endash +%\DeclareInputText{197}{} % vertical bar crossed with dash +%\DeclareInputText{198}{} % graphic +%\DeclareInputText{199}{} % graphic +%\DeclareInputText{200}{} % double lower left corner +%\DeclareInputText{201}{} % double upper left corner +%\DeclareInputText{202}{} % double dash with branch up +%\DeclareInputText{203}{} % double dash with branch down +%\DeclareInputText{204}{} % double bar with branch right +%\DeclareInputText{205}{=} % double dash +%\DeclareInputText{206}{} % double bar crossing double dash +%\DeclareInputText{207}{} % graphic +%\DeclareInputMath{208}{} +%\DeclareInputText{209}{} +%\DeclareInputText{210}{} +%\DeclareInputText{211}{} +%\DeclareInputText{212}{} +%\DeclareInputText{213}{} +%\DeclareInputText{214}{} +%\DeclareInputText{215}{} +%\DeclareInputText{216}{} +%\DeclareInputMath{217}{\ensuremath{\rfloor}} % lower right corner +%\DeclareInputMath{218}{\ensuremath{\lceil}} % upper left corner +%\DeclareInputText{219}{} % black box +%\DeclareInputText{220}{} % lower half of black box +%\DeclareInputText{221}{} % left bar +%\DeclareInputText{222}{} % right bar +%\DeclareInputText{223}{} % upper half of black box +% \end{macrocode} +% +% \begin{macrocode} +\DeclareInputMath{224}{\alpha} +% +%\DeclareInputMath{225}{\beta} +%\DeclareInputText{225}{\ss} +%<*cp437|cp437de|cp865> +\DeclareInputMath{226}{\Gamma} +\DeclareInputMath{227}{\pi} +\DeclareInputMath{228}{\Sigma} +\DeclareInputMath{229}{\sigma} +\DeclareInputMath{230}{\mu} +\DeclareInputMath{231}{\gamma} +\DeclareInputMath{232}{\Phi} +\DeclareInputMath{233}{\theta} +\DeclareInputMath{234}{\Omega} +\DeclareInputMath{235}{\delta} +\DeclareInputMath{236}{\infty} +\DeclareInputMath{237}{\phi} +\DeclareInputMath{238}{\varepsilon} +\DeclareInputMath{239}{\cap} +\DeclareInputMath{240}{\equiv} +\DeclareInputMath{241}{\pm} +\DeclareInputMath{242}{\ge} +\DeclareInputMath{243}{\le} +%\DeclareInputMath{244}{} % upper part of integral sign +%\DeclareInputMath{245}{} % lower part of integral sign +\DeclareInputMath{246}{\div} +\DeclareInputMath{247}{\approx} +\DeclareInputText{248}{\textdegree} +\DeclareInputText{249}{\textperiodcentered} +\DeclareInputText{250}{\textbullet} +\DeclareInputMath{251}{\surd} +\DeclareInputMath{252}{\mathnsuperior} +\DeclareInputMath{253}{\mathtwosuperior} +\DeclareInputText{254}{\textblacksquare} % right name? +\DeclareInputText{255}{\nobreakspace} +% +% \end{macrocode} +% +% \section{The Macintosh encodings} +% +% This input encoding was contributed by +% Constantin Kahn (\texttt{kahn@\linebreak[0]math.toronto.edu}), +% with minor modifications by Alan Jeffrey. +% +% \changes{v0.09c}{1995/05/30}{Made mac encoding `active german quote +% safe', and added the correct docstrip magic.} +% +% \begin{macrocode} +%<*applemac> +\DeclareInputText{128}{\"A} +\DeclareInputText{129}{\r A} +\DeclareInputText{130}{\c C} +\DeclareInputText{131}{\@tabacckludge'E} +\DeclareInputText{132}{\~N} +\DeclareInputText{133}{\"O} +\DeclareInputText{134}{\"U} +\DeclareInputText{135}{\@tabacckludge'a} +\DeclareInputText{136}{\@tabacckludge`a} +\DeclareInputText{137}{\^a} +\DeclareInputText{138}{\"a} +\DeclareInputText{139}{\~a} +\DeclareInputText{140}{\r a} +\DeclareInputText{141}{\c c} +\DeclareInputText{142}{\@tabacckludge'e} +\DeclareInputText{143}{\@tabacckludge`e} +\DeclareInputText{144}{\^e} +\DeclareInputText{145}{\"e} +\DeclareInputText{146}{\@tabacckludge'\i} +\DeclareInputText{147}{\@tabacckludge`\i} +\DeclareInputText{148}{\^\i} +\DeclareInputText{149}{\"\i} +\DeclareInputText{150}{\~n} +\DeclareInputText{151}{\@tabacckludge'o} +\DeclareInputText{152}{\@tabacckludge`o} +\DeclareInputText{153}{\^o} +\DeclareInputText{154}{\"o} +\DeclareInputText{155}{\~o} +\DeclareInputText{156}{\@tabacckludge'u} +\DeclareInputText{157}{\@tabacckludge`u} +\DeclareInputText{158}{\^u} +\DeclareInputText{159}{\"u} +% \end{macrocode} +% +% \begin{macrocode} +\DeclareInputText{160}{\dag} +\DeclareInputText{161}{\textdegree} +\DeclareInputText{162}{\textcent} +\DeclareInputText{163}{\pounds} +\DeclareInputText{164}{\S} +\DeclareInputText{165}{\textbullet} +\DeclareInputText{166}{\P} +\DeclareInputText{167}{\ss} +\DeclareInputText{168}{\textregistered} +\DeclareInputText{169}{\copyright} +\DeclareInputText{170}{\texttrademark} +\DeclareInputText{171}{\@tabacckludge'{}} +\DeclareInputText{172}{\"{}} +\DeclareInputMath{173}{\neq} +\DeclareInputText{174}{\AE} +\DeclareInputText{175}{\O} +\DeclareInputMath{176}{\infty} +\DeclareInputMath{177}{\pm} +\DeclareInputMath{178}{\leq} +\DeclareInputMath{179}{\geq} +\DeclareInputText{180}{\textyen} +\DeclareInputMath{181}{\mu} +\DeclareInputMath{182}{\partial} +\DeclareInputMath{183}{\Sigma} +\DeclareInputMath{184}{\Pi} +\DeclareInputMath{185}{\pi} +\DeclareInputMath{186}{\int} +\DeclareInputText{187}{\textordfeminine} +\DeclareInputText{188}{\textordmasculine} +\DeclareInputMath{189}{\Omega} +\DeclareInputText{190}{\ae} +\DeclareInputText{191}{\o} +% \end{macrocode} +% +% \begin{macrocode} +\DeclareInputText{192}{\textquestiondown} +\DeclareInputText{193}{\textexclamdown} +\DeclareInputMath{194}{\lnot} +\DeclareInputMath{195}{\surd} +\DeclareInputText{196}{\textflorin} +\DeclareInputMath{197}{\approx} +\DeclareInputMath{198}{\Delta} +\DeclareInputText{199}{\guillemotleft} +\DeclareInputText{200}{\guillemotright} +\DeclareInputText{201}{\dots} +\DeclareInputText{202}{\nobreakspace} +\DeclareInputText{203}{\@tabacckludge`A} +\DeclareInputText{204}{\~A} +\DeclareInputText{205}{\~O} +\DeclareInputText{206}{\OE} +\DeclareInputText{207}{\oe} +\DeclareInputText{208}{\textendash} +\DeclareInputText{209}{\textemdash} +\DeclareInputText{210}{\textquotedblleft} +\DeclareInputText{211}{\textquotedblright} +\DeclareInputText{212}{\textquoteleft} +\DeclareInputText{213}{\textquoteright} +\DeclareInputMath{214}{\div} +\DeclareInputMath{215}{\diamond} +\DeclareInputText{216}{\"y} +\DeclareInputText{217}{\"Y} +\DeclareInputMath{218}{/} +\DeclareInputText{219}{\textcurrency} +\DeclareInputText{220}{\guilsinglleft} +\DeclareInputText{221}{\guilsinglright} +\DeclareInputText{222}{fi} +\DeclareInputText{223}{fl} +% \end{macrocode} +% +% \begin{macrocode} +\DeclareInputText{224}{\ddag} +\DeclareInputText{225}{\textperiodcentered} +\DeclareInputText{226}{\quotesinglbase} +\DeclareInputText{227}{\quotedblbase} +\DeclareInputText{228}{\textperthousand} +\DeclareInputText{229}{\^A} +\DeclareInputText{230}{\^E} +\DeclareInputText{231}{\@tabacckludge'A} +\DeclareInputText{232}{\"E} +\DeclareInputText{233}{\@tabacckludge`E} +\DeclareInputText{234}{\@tabacckludge'I} +\DeclareInputText{235}{\^I} +\DeclareInputText{236}{\"I} +\DeclareInputText{237}{\@tabacckludge`I} +\DeclareInputText{238}{\@tabacckludge'O} +\DeclareInputText{239}{\^O} +\DeclareInputText{240}{\textapplelogo} +\DeclareInputText{241}{\@tabacckludge`O} +\DeclareInputText{242}{\@tabacckludge'U} +\DeclareInputText{243}{\^U} +\DeclareInputText{244}{\@tabacckludge`U} +\DeclareInputText{245}{\i} +\DeclareInputText{246}{\^{}} +\DeclareInputText{247}{\~{}} +\DeclareInputText{248}{\@tabacckludge={}} +\DeclareInputText{249}{\u{}} +\DeclareInputText{250}{\.{}} +\DeclareInputText{251}{\r{}} +\DeclareInputText{252}{\c\ } +\DeclareInputText{253}{\H{}} +\DeclareInputText{254}{\k\ } +\DeclareInputText{255}{\v{}} +% +% \end{macrocode} +% +% This input encoding for the Apple Central European Codepage was +% contributed by Radek Tryc and Marcin Wolinski +% \verb==. +% +% \changes{v0.99b}{2002/06/16}{Added macce encoding (pr/3433)} +% \changes{v1.0d}{2004/02/05}{Reordered code} +% \begin{macrocode} +%<*applemacce> +\DeclareInputText{128}{\"A} +\DeclareInputText{131}{\@tabacckludge'E} +\DeclareInputText{132}{\k A} +\DeclareInputText{133}{\"O} +\DeclareInputText{134}{\"U} +\DeclareInputText{136}{\k a} +\DeclareInputText{137}{\v C} +\DeclareInputText{138}{\" a} +\DeclareInputText{139}{\v c} +\DeclareInputText{140}{\@tabacckludge'C} +\DeclareInputText{141}{\@tabacckludge'c} +\DeclareInputText{143}{\@tabacckludge'Z} +\DeclareInputText{144}{\@tabacckludge'z} +\DeclareInputText{151}{\@tabacckludge'o} +\DeclareInputText{159}{\"u} +\DeclareInputText{154}{\"o} +\DeclareInputText{133}{\"O} +\DeclareInputText{134}{\"U} +\DeclareInputText{153}{\^o} +% \end{macrocode} +% +% \begin{macrocode} +\DeclareInputText{160}{\textdagger} +\DeclareInputText{161}{\textdegree} +\DeclareInputText{162}{\k E} +\DeclareInputText{163}{\pounds} +\DeclareInputText{164}{\textsection} +\DeclareInputText{165}{\textbullet} +\DeclareInputText{166}{\textparagraph} +\DeclareInputText{167}{\SS} +\DeclareInputText{168}{\textregistered} +\DeclareInputText{171}{\k e} +\DeclareInputText{193}{\@tabacckludge'N} +\DeclareInputText{169}{\textcopyright} +\DeclareInputText{184}{\l} +\DeclareInputText{196}{\@tabacckludge'n} +\DeclareInputText{199}{\guillemotleft} +\DeclareInputText{200}{\guillemotright} +\DeclareInputText{201}{\textellipsis} +\DeclareInputText{202}{\nobreakspace} +\DeclareInputText{208}{\textendash} +\DeclareInputText{209}{\textemdash} +\DeclareInputText{210}{\textquotedbleft} +\DeclareInputText{211}{\textquotedblright} +\DeclareInputText{212}{\textquoteleft} +\DeclareInputText{213}{\textquoteright} +\DeclareInputText{214}{\textdiv} +\DeclareInputText{220}{\guilsinglleft} +\DeclareInputText{221}{\guilsinglright} +\DeclareInputText{222}{\v r} +% \end{macrocode} +% +% \begin{macrocode} +\DeclareInputText{226}{\quotesinglbase} +\DeclareInputText{227}{\quotedblbase} +\DeclareInputText{229}{\@tabacckludge'S} +\DeclareInputText{230}{\@tabacckludge's} +\DeclareInputText{238}{\@tabacckludge'O} +\DeclareInputText{239}{\^O} +\DeclareInputText{251}{\.Z} +\DeclareInputText{252}{\L} +\DeclareInputText{253}{\.z} +% +% \end{macrocode} +% +% \section{The Next encoding} +% +% This input encoding is based on work by Stefan Ried +% (\texttt{stef@\linebreak[0]theo-phys.uni-essen.de} and Holger Uhr +% (\texttt{huhr@\linebreak[0]uni-paderborn.de}). +% +% Further extended by +% Jens Heise (\texttt{heisbeee@calvados.zrz.TU-Berlin.DE}). +% +% \changes{v0.9k}{1995/11/29}{Tidied up this encoding.} +% +% \changes{v0.9m}{1995/12/04}{Made fraction a math character.} +% \changes{v0.9n}{1995/12/10}{Made fraction a text character.} +% +% \changes{v0.94}{1997/12/17}{Changed \cs{textellipsis} to \cs{dots} +% for consistency.} +% \changes{v0.94}{1997/12/17}{Changed \cs{textquotesinglbase} to +% \cs{quotesinglbase}: this may be temporary.} +% \changes{v0.94}{1997/12/17}{Changed \cs{textquotedblbase} to +% \cs{quotedblbase}: this may be temporary.} +% \changes{v0.96}{1998/03/02}{Fixed typo in slot 159.} +% \changes{v0.997}{2000/12/02}{Added all missing chars. (pr/3281)} +% +% \begin{macrocode} +%<*next> +\DeclareInputText{128}{\nobreakspace} +\DeclareInputText{129}{\@tabacckludge`A} +\DeclareInputText{130}{\@tabacckludge'A} +\DeclareInputText{131}{\^A} +\DeclareInputText{132}{\~A} +\DeclareInputText{133}{\"A} +\DeclareInputText{134}{\r A} +\DeclareInputText{135}{\c C} +\DeclareInputText{136}{\@tabacckludge`E} +\DeclareInputText{137}{\@tabacckludge'E} +\DeclareInputText{138}{\^E} +\DeclareInputText{139}{\"E} +\DeclareInputText{140}{\@tabacckludge`I} +\DeclareInputText{141}{\@tabacckludge'I} +\DeclareInputText{142}{\^I} +\DeclareInputText{143}{\"I} +\DeclareInputText{144}{\DH} +\DeclareInputText{145}{\~N} +\DeclareInputText{146}{\@tabacckludge`O} +\DeclareInputText{147}{\@tabacckludge'O} +\DeclareInputText{148}{\^O} +\DeclareInputText{149}{\~O} +\DeclareInputText{150}{\"O} +\DeclareInputText{151}{\@tabacckludge`U} +\DeclareInputText{152}{\@tabacckludge'U} +\DeclareInputText{153}{\^U} +\DeclareInputText{154}{\"U} +\DeclareInputText{155}{\@tabacckludge'Y} +\DeclareInputText{156}{\TH} +\DeclareInputMath{157}{\mu} +\DeclareInputMath{158}{\times} +\DeclareInputMath{159}{\div} +% \end{macrocode} +% +% \begin{macrocode} +\DeclareInputText{160}{\copyright} +\DeclareInputText{161}{\textexclamdown} +\DeclareInputText{162}{\textcent} +\DeclareInputText{163}{\pounds} +\DeclareInputMath{164}{/} +\DeclareInputText{165}{\textyen} +\DeclareInputText{166}{\textflorin} +\DeclareInputText{167}{\S} +\DeclareInputText{168}{\textcurrency} +\DeclareInputText{169}{\textquotesingle} +\DeclareInputText{170}{\textquotedblleft} +\DeclareInputText{171}{\guillemotleft} +\DeclareInputText{172}{\guilsinglleft} +\DeclareInputText{173}{\guilsinglright} +\DeclareInputText{174}{fi} +\DeclareInputText{175}{fl} +\DeclareInputText{176}{\textregistered} +\DeclareInputText{177}{\textendash} +\DeclareInputText{178}{\dag} +\DeclareInputText{179}{\ddag} +\DeclareInputText{180}{\textperiodcentered} +\DeclareInputText{181}{\textbar} +\DeclareInputText{182}{\P} +\DeclareInputText{183}{\textbullet} +\DeclareInputText{184}{\quotesinglbase} +\DeclareInputText{185}{\quotedblbase} +\DeclareInputText{186}{\textquotedblright} +\DeclareInputText{187}{\guillemotright} +\DeclareInputText{188}{\dots} +\DeclareInputText{189}{\textperthousand} +\DeclareInputMath{190}{\lnot} +\DeclareInputText{191}{\textquestiondown} +% \end{macrocode} +% +% \begin{macrocode} +\DeclareInputMath{192}{\mathonesuperior} +\DeclareInputText{193}{\@tabacckludge`{}} +\DeclareInputText{194}{\@tabacckludge'{}} +\DeclareInputText{195}{\^{}} +\DeclareInputText{196}{\~{}} +\DeclareInputText{197}{\@tabacckludge={}} +\DeclareInputText{198}{\u{}} +\DeclareInputText{199}{\.{}} +\DeclareInputText{200}{\"{}} +\DeclareInputMath{201}{\mathtwosuperior} +\DeclareInputText{202}{\textdegree} +\DeclareInputText{203}{\c\ } +\DeclareInputMath{204}{\maththreesuperior} +\DeclareInputText{205}{\H{}} +\DeclareInputText{206}{\capitalogonek{}} +\DeclareInputText{207}{\v{}} +\DeclareInputText{208}{\textemdash} +\DeclareInputMath{209}{\pm} +\DeclareInputText{210}{\textonequarter} +\DeclareInputText{211}{\textonehalf} +\DeclareInputText{212}{\textthreequarters} +\DeclareInputText{213}{\@tabacckludge`a} +\DeclareInputText{214}{\@tabacckludge'a} +\DeclareInputText{215}{\^a} +\DeclareInputText{216}{\~a} +\DeclareInputText{217}{\"a} +\DeclareInputText{218}{\r a} +\DeclareInputText{219}{\c c} +\DeclareInputText{220}{\@tabacckludge`e} +\DeclareInputText{221}{\@tabacckludge'e} +\DeclareInputText{222}{\^e} +\DeclareInputText{223}{\"e} +% \end{macrocode} +% +% \begin{macrocode} +\DeclareInputText{224}{\@tabacckludge`\i} +\DeclareInputText{225}{\AE} +\DeclareInputText{226}{\@tabacckludge'\i} +\DeclareInputText{227}{\textordfeminine} +\DeclareInputText{228}{\^\i} +\DeclareInputText{229}{\"\i} +\DeclareInputMath{230}{\eth} +\DeclareInputText{231}{\~n} +\DeclareInputText{232}{\L} +\DeclareInputText{233}{\O} +\DeclareInputText{234}{\OE} +\DeclareInputText{235}{\textordmasculine} +\DeclareInputText{236}{\@tabacckludge`o} +\DeclareInputText{237}{\@tabacckludge'o} +\DeclareInputText{238}{\^o} +\DeclareInputText{239}{\~o} +\DeclareInputText{240}{\"o} +\DeclareInputText{241}{\ae} +\DeclareInputText{242}{\@tabacckludge`u} +\DeclareInputText{243}{\@tabacckludge'u} +\DeclareInputText{244}{\^u} +\DeclareInputText{245}{\i} +\DeclareInputText{246}{\"u} +\DeclareInputText{247}{\@tabacckludge'y} +\DeclareInputText{248}{\l} +\DeclareInputText{249}{\o} +\DeclareInputText{250}{\oe} +\DeclareInputText{251}{\ss} +\DeclareInputText{252}{\th} +\DeclareInputText{253}{\"y} +\DeclareInputText{254}{} +\DeclareInputText{255}{} +% +% \end{macrocode} +% +% +% +% \changes{v0.9a}{1995/04/23}{\cs{textonequarter} and friends should +% be declared with \cs{DeclareInputText}} +% \section{The MS Windows ANSI encoding cp1252,\\ +% and the ISO Latin-1 and Latin-9 encodings} +% +% The MS Windows ANSI, cp 1252, input encoding was contributed by +% Berthold K.P. Horn (\texttt{bkph@\linebreak[0]ai.mit.edu}). +% +% It has two very different names so the same code produces two files. +% These encoding files both define the characters in the +% MS Windows 3.1 ANSI encoding (Western Europe), also known as code +% page 1252, which is based on ISO Latin-1 but has important additions +% in the 128--159 range. +% +% Designed for: +% Danish, Dutch, English, Finnish, French, German, Icelandic, +% Italian, Norwegian, Portuguese, Spanish, and Swedish. +% +% Note: Windows ANSI --- like Macintosh standard roman encoding --- +% has quotesingle at 39, and grave at 96 --- which is here +% ignored. +% +% The ISO Latin-1 encoding file defines only the restricted range of +% characters available in the ISO~8859-1 encoding. +% +% The ISO~Latin-9 encoding file defines the characters in the +% ISO~8859-15 encoding. It was contributed by Karsten Tinnefeld +% (\texttt{karsten@tinnefeld.com}). +% It differs only a small amount from ISO~Latin-1 and is a +% replacement for it that contains a few characters that are needed for +% French and Finnish. Further, a slot for the Euro currency sign has +% been added and this could be the killer argument for many 8-bit +% texts to be written in Latin-9 in the future. +% +% According to a Linux manpage, ISO~Latin-9 supports Albanian, Basque, +% Breton, Catalan, Danish, Dutch, +% English, Estonian, Faroese, Finnish, French, Frisian, Galician, German, +% Greenlandic, Icelandic, Irish Gaelic, Italian, Latin, Luxemburgish, +% Norwegian, Portuguese, Rhaeto-Romanic, Scottish Gaelic, Spanish and +% Swedish. +% +% The characters added in |latin9.def| are (in \LaTeX{} notation): +% \begin{verbatim} +% \texteuro, \v S \v s \v Z \v z \OE \oe \" Y +% \end{verbatim} +% They displace the following characters from |latin1.def|: +% \begin{verbatim} +% \textcurrency \textbrokenbar \"{} \'{} \c{} +% \textonequarter \textonehalf \textthreequarters +% \end{verbatim} +% +% \changes{v0.9e}{1995/08/31}{Redeclared "AD to be soft hyphen.} +% \changes{v0.9e}{1995/08/31}{Swapped ordfeminine and ordmasculine.} +% +% \changes{v0.9p}{1996/04/11}{ansinew 09f is \"Y not \"y, latex/2119} +% +% \changes{v0.91}{1997/08/19}{Exchanged codes for +% \cs{textendash} and \cs{textemdash}.} +% +% \changes{v0.94}{1997/12/17}{Added cp1252 and merged latin1} +% \changes{v0.94}{1997/12/17}{Changed \cs{ldots} to \cs{dots}, this +% should be undetectable since \cs{ldots} is not robust.} +% +% \changes{v0.99a}{2001/07/10}{Added latin9 (from Karsten Tinnefeld)} +% \changes{v0.99b}{2002/06/16}{Added code points 142,158 for cp1252 (pr/3441)} +% \changes{v0.99b}{2002/07/08}{Added code 128 (texteuro) for cp1252 (pr/3423)} +% +% \begin{macrocode} +%<*cp1252> +\DeclareInputText{128}{\texteuro} +\DeclareInputText{130}{\quotesinglbase} +\DeclareInputText{131}{\textflorin} +\DeclareInputText{132}{\quotedblbase} +\DeclareInputText{133}{\dots} +\DeclareInputText{134}{\dag} +\DeclareInputText{135}{\ddag} +\DeclareInputText{136}{\^{}} +\DeclareInputText{137}{\textperthousand} +\DeclareInputText{138}{\v S} +\DeclareInputText{139}{\guilsinglleft} +\DeclareInputText{140}{\OE} +\DeclareInputText{142}{\v Z} +\DeclareInputText{145}{\textquoteleft} +\DeclareInputText{146}{\textquoteright} +\DeclareInputText{147}{\textquotedblleft} +\DeclareInputText{148}{\textquotedblright} +\DeclareInputText{149}{\textbullet} +\DeclareInputText{150}{\textendash} +\DeclareInputText{151}{\textemdash} +\DeclareInputText{152}{\~{}} +\DeclareInputText{153}{\texttrademark} +\DeclareInputText{154}{\v s} +\DeclareInputText{155}{\guilsinglright} +\DeclareInputText{156}{\oe} +\DeclareInputText{158}{\v z} +\DeclareInputText{159}{\"Y} +% +% \end{macrocode} +% +% This (somewhat confused) table is now even more disordered: first +% we deal with those few characters that are different in latin9, +% then with the rest. +% +% \begin{macrocode} +%<*cp1252|latin1> +\DeclareInputText{164}{\textcurrency} +\DeclareInputText{166}{\textbrokenbar} +\DeclareInputText{168}{\"{}} +\DeclareInputText{180}{\@tabacckludge'{}} +\DeclareInputText{184}{\c\ } +\DeclareInputText{188}{\textonequarter} +\DeclareInputText{189}{\textonehalf} +\DeclareInputText{190}{\textthreequarters} +% +% \end{macrocode} +% +% \begin{macrocode} +%<*latin9> +\DeclareInputText{164}{\texteuro} +\DeclareInputText{166}{\v S} +\DeclareInputText{168}{\v s} +\DeclareInputText{180}{\v Z} +\DeclareInputText{184}{\v z} +\DeclareInputText{188}{\OE} +\DeclareInputText{189}{\oe} +\DeclareInputText{190}{\"Y} +% +% \end{macrocode} +% +% \begin{macrocode} +%<*cp1252|latin1|latin9> +\DeclareInputText{160}{\nobreakspace} +\DeclareInputText{176}{\textdegree} +\DeclareInputText{161}{\textexclamdown} +\DeclareInputMath{177}{\pm} +\DeclareInputText{162}{\textcent} +\DeclareInputMath{178}{\mathtwosuperior} +\DeclareInputText{163}{\pounds} +\DeclareInputMath{179}{\maththreesuperior} +\DeclareInputText{165}{\textyen} +\DeclareInputMath{181}{\mu} +\DeclareInputText{182}{\P} +\DeclareInputText{167}{\S} +\DeclareInputText{183}{\textperiodcentered} +\DeclareInputText{169}{\copyright} +\DeclareInputMath{185}{\mathonesuperior} +\DeclareInputText{170}{\textordfeminine} +\DeclareInputText{186}{\textordmasculine} +\DeclareInputText{171}{\guillemotleft} +\DeclareInputText{187}{\guillemotright} +\DeclareInputMath{172}{\lnot} +\DeclareInputText{173}{\-} +\DeclareInputText{174}{\textregistered} +\DeclareInputText{175}{\@tabacckludge={}} +\DeclareInputText{191}{\textquestiondown} +% \end{macrocode} +% +% \begin{macrocode} +\DeclareInputText{192}{\@tabacckludge`A} +\DeclareInputText{208}{\DH} +\DeclareInputText{193}{\@tabacckludge'A} +\DeclareInputText{209}{\~N} +\DeclareInputText{194}{\^A} +\DeclareInputText{210}{\@tabacckludge`O} +\DeclareInputText{195}{\~A} +\DeclareInputText{211}{\@tabacckludge'O} +\DeclareInputText{196}{\"A} +\DeclareInputText{212}{\^O} +\DeclareInputText{197}{\r A} +\DeclareInputText{213}{\~O} +\DeclareInputText{198}{\AE} +\DeclareInputText{214}{\"O} +\DeclareInputText{199}{\c C} +\DeclareInputMath{215}{\times} +\DeclareInputText{200}{\@tabacckludge`E} +\DeclareInputText{216}{\O} +\DeclareInputText{201}{\@tabacckludge'E} +\DeclareInputText{217}{\@tabacckludge`U} +\DeclareInputText{202}{\^E} +\DeclareInputText{218}{\@tabacckludge'U} +\DeclareInputText{203}{\"E} +\DeclareInputText{219}{\^U} +\DeclareInputText{204}{\@tabacckludge`I} +\DeclareInputText{220}{\"U} +\DeclareInputText{205}{\@tabacckludge'I} +\DeclareInputText{221}{\@tabacckludge'Y} +\DeclareInputText{206}{\^I} +\DeclareInputText{222}{\TH} +\DeclareInputText{207}{\"I} +\DeclareInputText{223}{\ss} +% \end{macrocode} +% +% \begin{macrocode} +\DeclareInputText{224}{\@tabacckludge`a} +\DeclareInputText{240}{\dh} +\DeclareInputText{225}{\@tabacckludge'a} +\DeclareInputText{241}{\~n} +\DeclareInputText{226}{\^a} +\DeclareInputText{242}{\@tabacckludge`o} +\DeclareInputText{227}{\~a} +\DeclareInputText{243}{\@tabacckludge'o} +\DeclareInputText{228}{\"a} +\DeclareInputText{244}{\^o} +\DeclareInputText{229}{\r a} +\DeclareInputText{245}{\~o} +\DeclareInputText{230}{\ae} +\DeclareInputText{246}{\"o} +\DeclareInputText{231}{\c c} +\DeclareInputMath{247}{\div} +\DeclareInputText{232}{\@tabacckludge`e} +\DeclareInputText{248}{\o} +\DeclareInputText{233}{\@tabacckludge'e} +\DeclareInputText{249}{\@tabacckludge`u} +\DeclareInputText{234}{\^e} +\DeclareInputText{250}{\@tabacckludge'u} +\DeclareInputText{235}{\"e} +\DeclareInputText{251}{\^u} +\DeclareInputText{236}{\@tabacckludge`\i} +\DeclareInputText{252}{\"u} +\DeclareInputText{237}{\@tabacckludge'\i} +\DeclareInputText{253}{\@tabacckludge'y} +\DeclareInputText{238}{\^\i} +\DeclareInputText{254}{\th} +\DeclareInputText{239}{\"\i} +\DeclareInputText{255}{\"y} +% +% \end{macrocode} +% +% +%\section{The ISO 8859-16 (Latin10) encoding} +% +% \changes{v1.0c}{2004/02/04}{Added ISO 8859-16 Latin10 (pr/3568)} +% +% This set of coded graphic characters is intended for use in data and +% text processing applications and also for information interchange. The +% set contains graphic characters used for general purpose applications in +% typical office environments in at least the following languages: +% Albanian, Croatian, English, Finnish, French, German, Hungarian, Irish +% Gaelic (new orthography), Italian, Latin, Polish, Romanian, and +% Slovenian. This set of coded graphic characters may be regarded as a +% version of an 8-bit code according to ISO/IEC 2022 or ISO/IEC 4873 at +% level 1. [ISO 8859-16:2001(E), p. 1] +% +% ISO 8859-16 was primarily designed for single-byte encoding the Romanian +% language. The UTF-8 charset is the preferred and in today's MIME software +% more widely implemented encoding suitable for Romanian. +% +% Data for the \LaTeX{} support was mainly provided by Ionel Ciob\^{i}c\u{a} +% with additions and corrections taken from\\ +% \texttt{http://www.unicode.org/Public/MAPPINGS/ISO8859/8859-16.TXT}. +% \begin{macrocode} +%<*latin10> +% \end{macrocode} +% The ``comma below'' accent is provided here in a crude (better +% than nothing) version. +% \begin{macrocode} +\ProvideTextCommandDefault\textcommabelow[1] + {\hmode@bgroup\ooalign{\null#1\crcr\hidewidth + \raise-.31ex\hbox{\check@mathfonts +% \end{macrocode} +% Use |\sf@size| instead of |\ssf@size| if the comma looks too small: +% \begin{macrocode} + \fontsize\ssf@size\z@ + \math@fontsfalse\selectfont,}\hidewidth}\egroup} +% \end{macrocode} +% +% \begin{macrocode} +\ProvideTextCommandDefault\textpm{\ensuremath\pm} +% \end{macrocode} +% +% \begin{macrocode} +\DeclareInputText{160}{\nobreakspace} +\DeclareInputText{161}{\k A} +\DeclareInputText{162}{\k a} +\DeclareInputText{163}{\L} +\DeclareInputText{164}{\texteuro} +\DeclareInputText{165}{\quotedblbase} +\DeclareInputText{166}{\v S} +\DeclareInputText{167}{\S} +\DeclareInputText{168}{\v s} +\DeclareInputText{169}{\textcopyright} +\DeclareInputText{170}{\textcommabelow S} +\DeclareInputText{171}{\guillemotleft} +\DeclareInputText{172}{\@tabacckludge'Z} +\DeclareInputText{173}{\-} +\DeclareInputText{174}{\@tabacckludge'z} +\DeclareInputText{175}{\.Z} +\DeclareInputText{176}{\textdegree} +\DeclareInputText{177}{\textpm} +\DeclareInputText{178}{\v C} +\DeclareInputText{179}{\l} +\DeclareInputText{180}{\v Z} +\DeclareInputText{181}{\textquotedblright} +\DeclareInputText{182}{\P} +\DeclareInputText{183}{\textperiodcentered} +\DeclareInputText{184}{\v z} +\DeclareInputText{185}{\v c} +\DeclareInputText{186}{\textcommabelow s} +\DeclareInputText{187}{\guillemotright} +\DeclareInputText{188}{\OE} +\DeclareInputText{189}{\oe} +\DeclareInputText{190}{\"Y} +\DeclareInputText{191}{\.z} +% \end{macrocode} +% +% \begin{macrocode} +\DeclareInputText{192}{\@tabacckludge`A} +\DeclareInputText{193}{\@tabacckludge'A} +\DeclareInputText{194}{\^A} +\DeclareInputText{195}{\u A} +\DeclareInputText{196}{\"A} +\DeclareInputText{197}{\@tabacckludge'C} +\DeclareInputText{198}{\AE} +\DeclareInputText{199}{\c C} +\DeclareInputText{200}{\@tabacckludge`E} +\DeclareInputText{201}{\@tabacckludge'E} +\DeclareInputText{202}{\^E} +\DeclareInputText{203}{\"E} +\DeclareInputText{204}{\@tabacckludge`I} +\DeclareInputText{205}{\@tabacckludge'I} +\DeclareInputText{206}{\^I} +\DeclareInputText{207}{\"I} +\DeclareInputText{208}{\DJ} +\DeclareInputText{209}{\@tabacckludge'N} +\DeclareInputText{210}{\@tabacckludge`O} +\DeclareInputText{211}{\@tabacckludge'O} +\DeclareInputText{212}{\^O} +\DeclareInputText{213}{\H O} +\DeclareInputText{214}{\"O} +\DeclareInputText{215}{\@tabacckludge'S} +\DeclareInputText{216}{\H U} +\DeclareInputText{217}{\@tabacckludge`U} +\DeclareInputText{218}{\@tabacckludge'U} +\DeclareInputText{219}{\^U} +\DeclareInputText{220}{\"U} +\DeclareInputText{221}{\k E} +\DeclareInputText{222}{\textcommabelow T} +% \end{macrocode} +% +% \begin{macrocode} +\DeclareInputText{223}{\ss} +\DeclareInputText{224}{\@tabacckludge`a} +\DeclareInputText{225}{\@tabacckludge'a} +\DeclareInputText{226}{\^a} +\DeclareInputText{227}{\u a} +\DeclareInputText{228}{\"a} +\DeclareInputText{229}{\@tabacckludge'c} +\DeclareInputText{230}{\ae} +\DeclareInputText{231}{\c c} +\DeclareInputText{232}{\@tabacckludge`e} +\DeclareInputText{233}{\@tabacckludge'e} +\DeclareInputText{234}{\^e} +\DeclareInputText{235}{\"e} +\DeclareInputText{236}{\@tabacckludge`\i} +\DeclareInputText{237}{\@tabacckludge'\i} +\DeclareInputText{238}{\^\i} +\DeclareInputText{239}{\"\i} +\DeclareInputText{240}{\dj} +\DeclareInputText{241}{\@tabacckludge'n} +\DeclareInputText{242}{\@tabacckludge`o} +\DeclareInputText{243}{\@tabacckludge'o} +\DeclareInputText{244}{\^o} +\DeclareInputText{245}{\H o} +\DeclareInputText{246}{\"o} +\DeclareInputText{247}{\@tabacckludge's} +\DeclareInputText{248}{\H u} +\DeclareInputText{249}{\@tabacckludge`u} +\DeclareInputText{250}{\@tabacckludge'u} +\DeclareInputText{251}{\^u} +\DeclareInputText{252}{\"u} +\DeclareInputText{253}{\k e} +\DeclareInputText{254}{\textcommabelow t} +\DeclareInputText{255}{\"y} +% +% \end{macrocode} +% +%\section{The MS Windows encoding cp1250} +% +% This is an MS Windows encoding for Central and Eastern Europe, +% known as Code Page 1250; it was provided by Marcin Woli\'nski +% \texttt{wolinski@melkor.mimuw.edu.pl} and edited by Chris Rowley +% (see v0.94 below) to make it consistent with other files. +% +% \changes{v0.94}{1997/12/17}{Changed \cs{textellipsis} to \cs{dots} +% for consistency.} +% \changes{v0.94}{1997/12/17}{Changed \cs{textdagger} to \cs{dag} +% for consistency.} +% \changes{v0.94}{1997/12/17}{Changed \cs{textdagger} to \cs{dag} +% for consistency.} +% \changes{v0.94}{1997/12/17}{Changed \cs{textparagraph} to \cs{P} +% for consistency.} +% \changes{v0.94}{1997/12/17}{Changed \cs{textsection} to \cs{S} +% for consistency.} +% \changes{v0.99b}{2002/07/28}{Added code 128 (texteuro) for cp1250} +% \begin{macrocode} +%<*cp1250> +\DeclareInputText{128}{\texteuro} +%\DeclareInputText{129}{} % n/u +\DeclareInputText{130}{\quotesinglbase} +%\DeclareInputText{131}{} % n/u +\DeclareInputText{132}{\quotedblbase} +\DeclareInputText{133}{\dots} +\DeclareInputText{134}{\dag} +\DeclareInputText{135}{\ddag} +%\DeclareInputText{136}{} % n/u +\DeclareInputText{137}{\textperthousand} +\DeclareInputText{138}{\v S} +\DeclareInputText{139}{\guilsinglleft} +\DeclareInputText{140}{\@tabacckludge'S} +\DeclareInputText{141}{\v T} +\DeclareInputText{142}{\v Z} +\DeclareInputText{143}{\@tabacckludge'Z} +%\DeclareInputText{144}{} % n/u +\DeclareInputText{145}{\textquoteleft} +\DeclareInputText{146}{\textquoteright} +\DeclareInputText{147}{\textquotedblleft} +\DeclareInputText{148}{\textquotedblright} +\DeclareInputText{149}{\textbullet} +\DeclareInputText{150}{\textendash} +\DeclareInputText{151}{\textemdash} +%\DeclareInputText{152}{} % n/u +\DeclareInputText{153}{\texttrademark} +\DeclareInputText{154}{\v s} +\DeclareInputText{155}{\guilsinglright} +\DeclareInputText{156}{\@tabacckludge's} +\DeclareInputText{157}{\v t} % t caron (t') ? +\DeclareInputText{158}{\v z} +\DeclareInputText{159}{\@tabacckludge'z} +% \end{macrocode} +% +% \begin{macrocode} +\DeclareInputText{160}{\nobreakspace} +\DeclareInputText{161}{\v{}} +\DeclareInputText{162}{\u{}} +\DeclareInputText{163}{\L} +\DeclareInputText{164}{\textcurrency} +\DeclareInputText{165}{\k A} +\DeclareInputText{166}{\textbrokenbar} +\DeclareInputText{167}{\S} +\DeclareInputText{168}{\"{}} +\DeclareInputText{169}{\copyright} +\DeclareInputText{170}{\c S} +\DeclareInputText{171}{\guillemotleft} +\DeclareInputMath{172}{\lnot} +\DeclareInputText{173}{\-}% soft hyphen +\DeclareInputText{174}{\textregistered} +\DeclareInputText{175}{\.Z} +\DeclareInputText{176}{\textdegree} +\DeclareInputMath{177}{\pm}% plus-minus +\DeclareInputText{178}{\k\ } +\DeclareInputText{179}{\l} +\DeclareInputText{180}{\@tabacckludge'{}} +\DeclareInputMath{181}{\mu}% micro sign +\DeclareInputText{182}{\P} +\DeclareInputText{183}{\textperiodcentered} +\DeclareInputText{184}{\c\ } +\DeclareInputText{185}{\k a} +\DeclareInputText{186}{\c s} +\DeclareInputText{187}{\guillemotright} +\DeclareInputText{188}{\v L}% L caron (L') ? +\DeclareInputText{189}{\H{}} +\DeclareInputText{190}{\v l}% l caron (l') ? +\DeclareInputText{191}{\. z} +% \end{macrocode} +% +% \begin{macrocode} +\DeclareInputText{192}{\@tabacckludge'R} +\DeclareInputText{193}{\@tabacckludge'A} +\DeclareInputText{194}{\^A} +\DeclareInputText{195}{\u A} +\DeclareInputText{196}{\"A} +\DeclareInputText{197}{\@tabacckludge'L} +\DeclareInputText{198}{\@tabacckludge'C} +\DeclareInputText{199}{\c C} +\DeclareInputText{200}{\v C} +\DeclareInputText{201}{\@tabacckludge'E} +\DeclareInputText{202}{\k E} +\DeclareInputText{203}{\"E} +\DeclareInputText{204}{\v E} +\DeclareInputText{205}{\@tabacckludge'I} +\DeclareInputText{206}{\^I} +\DeclareInputText{207}{\v D} +\DeclareInputText{208}{\DJ} % D stroke +\DeclareInputText{209}{\@tabacckludge'N} +\DeclareInputText{210}{\v N} +\DeclareInputText{211}{\@tabacckludge'O} +\DeclareInputText{212}{\^O} +\DeclareInputText{213}{\H O} +\DeclareInputText{214}{\"O} +\DeclareInputMath{215}{\times} +\DeclareInputText{216}{\v R} +\DeclareInputText{217}{\r U} +\DeclareInputText{218}{\@tabacckludge'U} +\DeclareInputText{219}{\H U} +\DeclareInputText{220}{\" U} +\DeclareInputText{221}{\@tabacckludge'Y} +\DeclareInputText{222}{\c T} +\DeclareInputText{223}{\ss} +% \end{macrocode} +% +% \begin{macrocode} +\DeclareInputText{224}{\@tabacckludge'r} +\DeclareInputText{225}{\@tabacckludge'a} +\DeclareInputText{226}{\^a} +\DeclareInputText{227}{\u a} +\DeclareInputText{228}{\" a} +\DeclareInputText{229}{\@tabacckludge'l} +\DeclareInputText{230}{\@tabacckludge'c} +\DeclareInputText{231}{\c c} +\DeclareInputText{232}{\v c} +\DeclareInputText{233}{\@tabacckludge'e} +\DeclareInputText{234}{\k e} +\DeclareInputText{235}{\"e} +\DeclareInputText{236}{\v e} +\DeclareInputText{237}{\@tabacckludge'\i} +\DeclareInputText{238}{\^\i} +\DeclareInputText{239}{\v d} % d caron (d') ? +\DeclareInputText{240}{\dj} % d stroke +\DeclareInputText{241}{\@tabacckludge'n} +\DeclareInputText{242}{\v n} +\DeclareInputText{243}{\@tabacckludge'o} +\DeclareInputText{244}{\^o} +\DeclareInputText{245}{\H o} +\DeclareInputText{246}{\"o} +\DeclareInputMath{247}{\div} +\DeclareInputText{248}{\v r} +\DeclareInputText{249}{\r u} +\DeclareInputText{250}{\@tabacckludge'u} +\DeclareInputText{251}{\H u} +\DeclareInputText{252}{\"u} +\DeclareInputText{253}{\@tabacckludge'y} +\DeclareInputText{254}{\c t} +\DeclareInputText{255}{\.{}} +% +% \end{macrocode} +% +% +%\section{The MS Windows encoding cp1257} +% +% This is an MS Windows encoding for Baltic languages, +% known as Code Page 1257; it was provided on the web at +% \texttt{http://nad.datapro.lv/LaTeX} and edited by Frank +% to make it consistent with other files. +% +% \begin{macrocode} +%<*cp1257> +\DeclareInputText{160}{\nobreakspace} +\DeclareInputText{161}{\k A} +\DeclareInputText{163}{\c R} +\DeclareInputText{164}{\textcurrency} +\DeclareInputText{165}{\~I} +\DeclareInputText{166}{\c L} +\DeclareInputText{167}{\S} +\DeclareInputText{168}{\"\ } +\DeclareInputText{169}{\v S} +\DeclareInputText{170}{\@tabacckludge=E} +\DeclareInputText{171}{\c G} +\DeclareInputText{173}{\-} +\DeclareInputText{174}{\v Z} +\DeclareInputText{175}{\@tabacckludge={}} +\DeclareInputText{176}{\textdegree} +\DeclareInputText{177}{\k a} +\DeclareInputText{178}{\k\ } +\DeclareInputText{179}{\c r} +\DeclareInputText{180}{\@tabacckludge'{}} +\DeclareInputText{181}{\~\i} +\DeclareInputText{182}{\c l} +\DeclareInputText{183}{\v\ } +\DeclareInputText{184}{\c\ } +\DeclareInputText{185}{\v s} +\DeclareInputText{186}{\@tabacckludge=e} +\DeclareInputText{187}{\c g} +\DeclareInputText{189}{\NG} +\DeclareInputText{190}{\v z} +\DeclareInputText{191}{\ng} +% \end{macrocode} +% +% \begin{macrocode} +\DeclareInputText{192}{\@tabacckludge=A} +\DeclareInputText{193}{\@tabacckludge'A} +\DeclareInputText{194}{\=A} +\DeclareInputText{195}{\~A} +\DeclareInputText{196}{\"A} +\DeclareInputText{197}{\r A} +\DeclareInputText{198}{\AE} +\DeclareInputText{199}{\=E} +\DeclareInputText{200}{\v C} +\DeclareInputText{201}{\@tabacckludge'E} +\DeclareInputText{202}{\k E} +\DeclareInputText{203}{\"E} +\DeclareInputText{204}{\c G} +\DeclareInputText{205}{\c K} +\DeclareInputText{206}{\@tabacckludge=I} +\DeclareInputText{207}{\c L} +\DeclareInputText{208}{\v S} +\DeclareInputText{209}{\c N} +\DeclareInputText{210}{\c N} +\DeclareInputText{211}{\c N} +\DeclareInputText{212}{\^O} +\DeclareInputText{213}{\~O} +\DeclareInputText{214}{\"O} +\DeclareInputMath{215}{\times} +\DeclareInputText{216}{\O} +\DeclareInputText{217}{\k U} +\DeclareInputText{218}{\@tabacckludge'U} +\DeclareInputText{219}{\@tabacckludge=U} +\DeclareInputText{220}{\"U} +\DeclareInputText{221}{\~U} +\DeclareInputText{222}{\v Z} +\DeclareInputText{223}{\ss} +% \end{macrocode} +% +% \begin{macrocode} +\DeclareInputText{224}{\@tabacckludge=a} +\DeclareInputText{225}{\@tabacckludge'a} +\DeclareInputText{226}{\@tabacckludge=a} +\DeclareInputText{227}{\~a} +\DeclareInputText{228}{\"a} +\DeclareInputText{229}{\r a} +\DeclareInputText{230}{\ae} +\DeclareInputText{231}{\@tabacckludge=e} +\DeclareInputText{232}{\v c} +\DeclareInputText{233}{\@tabacckludge'e} +\DeclareInputText{234}{\k e} +\DeclareInputText{235}{\"e} +\DeclareInputText{236}{\k g} +\DeclareInputText{237}{\c k} +\DeclareInputText{238}{\@tabacckludge=\i} +\DeclareInputText{239}{\k l} +\DeclareInputText{240}{\v s} +\DeclareInputText{241}{\c n} +\DeclareInputText{242}{\k n} +\DeclareInputText{243}{\c k} +\DeclareInputText{244}{\^o} +\DeclareInputText{245}{\~o} +\DeclareInputText{246}{\"o} +\DeclareInputMath{247}{\div} +\DeclareInputText{248}{\o} +\DeclareInputText{249}{\k u} +\DeclareInputText{250}{\@tabacckludge'u} +\DeclareInputText{251}{\@tabacckludge=u} +\DeclareInputText{252}{\"u} +\DeclareInputText{253}{\~u} +\DeclareInputText{254}{\v z} +\DeclareInputText{255}{\.\ } +% +% \end{macrocode} +% +% +% Finally, we reset the category code of the at sign at the end of all +% .def files. +% \begin{macrocode} +%<-package>\makeatother +% \end{macrocode} +% +% \DeleteShortVerb{\|} +% \Finale +\endinput diff --git a/Master/texmf-dist/source/latex/base/inputenc.ins b/Master/texmf-dist/source/latex/base/inputenc.ins new file mode 100644 index 00000000000..245b96995f4 --- /dev/null +++ b/Master/texmf-dist/source/latex/base/inputenc.ins @@ -0,0 +1,169 @@ +%% +%% This file will generate fast loadable files and documentation +%% driver files from the doc files in this package when run through +%% LaTeX or TeX. +%% +%% Copyright 1993 1994 1995 1996 1997 1998 1999 2000 2001 2002 2003 2004 +%% The LaTeX3 Project and any individual authors listed elsewhere +%% in this file. +%% +%% This file is part of the LaTeX base system. +%% ------------------------------------------- +%% +%% It may be distributed and/or modified under the +%% conditions of the LaTeX Project Public License, either version 1.3 +%% of this license or (at your option) any later version. +%% The latest version of this license is in +%% http://www.latex-project.org/lppl.txt +%% and version 1.3 or later is part of all distributions of LaTeX +%% version 2003/12/01 or later. +%% +%% This file has the LPPL maintenance status "maintained". +%% +%% In particular, NO PERMISSION is granted to modify the contents of this +%% file since it contains the legal notices that are placed in the files +%% it generates. +%% +%% The list of all files belonging to the LaTeX base distribution is +%% given in the file `manifest.txt'. See also `legal.txt' for additional +%% information. +%% +%% +%% +%% +%% --------------- start of docstrip commands ------------------ +%% + +\input docstrip + +\preamble + +This is a generated file. + +Copyright 1993 1994 1995 1996 1997 1998 1999 2000 2001 2002 2003 2004 +The LaTeX3 Project and any individual authors listed elsewhere +in this file. + +This file was generated from file(s) of the LaTeX base system. +-------------------------------------------------------------- + +It may be distributed and/or modified under the +conditions of the LaTeX Project Public License, either version 1.3 +of this license or (at your option) any later version. +The latest version of this license is in + http://www.latex-project.org/lppl.txt +and version 1.3 or later is part of all distributions of LaTeX +version 2003/12/01 or later. + +This file has the LPPL maintenance status "maintained". + +This file may only be distributed together with a copy of the LaTeX +base system. You may however distribute the LaTeX base system without +such generated files. + +The list of all files belonging to the LaTeX base distribution is +given in the file `manifest.txt'. See also `legal.txt' for additional +information. + +The list of derived (unpacked) files belonging to the distribution +and covered by LPPL is defined by the unpacking scripts (with +extension .ins) which are part of the distribution. +\endpreamble + +\keepsilent +\usedir{tex/latex/base} + +\Msg{*** Generating input encoding files ***} + +\generate{ + \file{inputenc.sty}{ + \from{inputenc.dtx}{package}} + \file{latin1.def}{ + \from{inputenc.dtx}{latin1}} + \file{latin2.def}{ + \from{inputenc.dtx}{latin2}} + \file{latin3.def}{ + \from{inputenc.dtx}{latin3}} + \file{latin4.def}{ + \from{inputenc.dtx}{latin4}} + \file{latin5.def}{ + \from{inputenc.dtx}{latin5}} + \file{latin9.def}{ + \from{inputenc.dtx}{latin9}} + \file{latin10.def}{ + \from{inputenc.dtx}{latin10}} + } + + + + \generate{ + \file{cp850.def}{ + \from{inputenc.dtx}{cp850}} + \file{cp852.def}{ + \from{inputenc.dtx}{cp852}} + \file{cp858.def}{ + \from{inputenc.dtx}{cp858}} + \file{cp865.def}{ + \from{inputenc.dtx}{cp865}} + \file{cp437.def}{ + \from{inputenc.dtx}{cp437}} + \file{cp437de.def}{ + \from{inputenc.dtx}{cp437de}} + \file{decmulti.def}{ + \from{inputenc.dtx}{decmulti}} + } + + \generate{ + \file{ascii.def}{ + \from{inputenc.dtx}{ascii}} + \file{applemac.def}{ + \from{inputenc.dtx}{applemac}} + \file{macce.def}{ + \from{inputenc.dtx}{applemacce}} + \file{next.def}{ + \from{inputenc.dtx}{next}} + \file{ansinew.def}{% synonym for cp1252 + \from{inputenc.dtx}{cp1252,ansinew}} + \file{cp1250.def}{ + \from{inputenc.dtx}{cp1250}} + \file{cp1252.def}{ + \from{inputenc.dtx}{cp1252}} + \file{cp1257.def}{ + \from{inputenc.dtx}{cp1257}} + } + +\Msg{*** Generating utf8 input encoding files ***} + +\generate{\file{utf8.def}{\from{utf8ienc.dtx}{utf8}} + \file{utf8-test.tex}{\from{utf8ienc.dtx}{test}} + \file{lcyenc.dfu}{\from{utf8ienc.dtx}{lcy}} + \file{ly1enc.dfu}{\from{utf8ienc.dtx}{ly1}} + \file{omsenc.dfu}{\from{utf8ienc.dtx}{oms}} + \file{ot1enc.dfu}{\from{utf8ienc.dtx}{ot1}} + \file{ot2enc.dfu}{\from{utf8ienc.dtx}{ot2}} + \file{t1enc.dfu}{\from{utf8ienc.dtx}{t1}} + \file{t2aenc.dfu}{\from{utf8ienc.dtx}{t2a}} + \file{t2benc.dfu}{\from{utf8ienc.dtx}{t2b}} + \file{t2cenc.dfu}{\from{utf8ienc.dtx}{t2c}} + \file{ts1enc.dfu}{\from{utf8ienc.dtx}{ts1}} + \file{x2enc.dfu}{\from{utf8ienc.dtx}{x2}} + \file{utf8enc.dfu}{\from{utf8ienc.dtx}{all}} + \file{utf8test.tex}{\from{utf8ienc.dtx}{test}} + } + +\ifToplevel{ +\Msg{***********************************************************} +\Msg{*} +\Msg{* To finish the installation you have to move the following} +\Msg{* files into a directory searched by TeX:} +\Msg{*} +\Msg{* \space\space *.def *.dfu *.sty } +\Msg{*} +\Msg{* To produce the documentation run inputenc.dtx and } +\Msg{* through LaTeX.} +\Msg{*} +\Msg{* Happy TeXing} +\Msg{***********************************************************} +} + +\endbatchfile diff --git a/Master/texmf-dist/source/latex/base/latex209.dtx b/Master/texmf-dist/source/latex/base/latex209.dtx new file mode 100644 index 00000000000..323a275dfa3 --- /dev/null +++ b/Master/texmf-dist/source/latex/base/latex209.dtx @@ -0,0 +1,1147 @@ +% \iffalse meta-comment +% +% Copyright 1993 1994 1995 1996 1997 1998 1999 2000 2001 2002 2003 2004 +% The LaTeX3 Project and any individual authors listed elsewhere +% in this file. +% +% This file is part of the LaTeX base system. +% ------------------------------------------- +% +% It may be distributed and/or modified under the +% conditions of the LaTeX Project Public License, either version 1.3 +% of this license or (at your option) any later version. +% The latest version of this license is in +% http://www.latex-project.org/lppl.txt +% and version 1.3 or later is part of all distributions of LaTeX +% version 2003/12/01 or later. +% +% This file has the LPPL maintenance status "maintained". +% +% The list of all files belonging to the LaTeX base distribution is +% given in the file `manifest.txt'. See also `legal.txt' for additional +% information. +% +% The list of derived (unpacked) files belonging to the distribution +% and covered by LPPL is defined by the unpacking scripts (with +% extension .ins) which are part of the distribution. +% +% \fi +% +% \title{Compatibility mode for \LaTeXe{} emulating \LaTeX~2.09} +% \author{Alan Jeffrey and Frank Mittelbach} +% \date{1995/12/27} +% +% \CheckSum{717} +% +%% \CharacterTable +%% {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 +%% 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 +%% Digits \0\1\2\3\4\5\6\7\8\9 +%% Exclamation \! Double quote \" Hash (number) \# +%% Dollar \$ Percent \% Ampersand \& +%% Acute accent \' Left paren \( Right paren \) +%% Asterisk \* Plus \+ Comma \, +%% Minus \- Point \. Solidus \/ +%% Colon \: Semicolon \; Less than \< +%% Equals \= Greater than \> Question mark \? +%% Commercial at \@ Left bracket \[ Backslash \\ +%% Right bracket \] Circumflex \^ Underscore \_ +%% Grave accent \` Left brace \{ Vertical bar \| +%% Right brace \} Tilde \~} +% +% \changes{v0.01}{1993/12/11}{Created the file, including: +% setting the compatibility flag, +% inputting oldlfont.sty, +% setting the default encoding to be OT1, and +% inputting the latex209.rc file} +% \changes{v0.02}{1993/12/12}{Changed the package filename to +% latex209.sty, and added the provides-package command.} +% \changes{v0.03}{1993/12/16}{Added an empty mark, replaced +% provides-package with provides-file, added the compatibility hook.} +% \changes{v0.04}{1993/12/16}{Moved oldlfont.sty out of the +% compatibility hook and back into latex209.cmp. Redefined +% newfontswitch to ignore redefinitions. Set the LaTeX 2e commands +% to be errors.} +% \changes{v0.05}{1993/12/17} +% {Removed the \cs{mark}, since it is now in the kernel.} +% \changes{v0.06}{1993/12/18}{Replaced the redefinition of +% \cs{@newfontswitch} to a redefinition of \cs{@renewfontswitch}. +% Added \cs{sloppy.}} +% \changes{v0.07}{1993/12/18}{Fixed a bug with \cs{@missingfileerror}.} +% \changes{v0.08}{1993/12/18}{Added the obsolete .sty files.} +% \changes{v0.09}{1993/12/20}{Removed art10.sty and friends.} +% \changes{v0.10}{1994/01/14}{Replaced latex209.rc by latex209.cfg.} +% \changes{v0.11}{1994/01/21}{Replaced latex209.cmp by latex209.def. +% Moved half of oldlfont.dtx to here. Split the package dst option +% into head and tail.} +% \changes{v0.12}{1994/01/24} +% {Added \cs{normalshape} and \cs{mediumseries}, and +% declared the `oldlfont' option to stop oldlfont.sty from being +% loaded.} +% \changes{v0.13}{1994/01/31}{removed setting of \cs{normalsize}. FMi} +% \changes{v0.14}{1994/02/07}{Added it back again.} +% \changes{v0.15}{1994/02/10}{Renamed \cs{@compatibility} to +% \cs{@documentclasshook}. Added the check for whether +% \cs{normalsize} or \cs{@normalsize} needs defined.} +% \changes{v0.16}{1994/02/11}{Replaced the allocation of temporary +% dimens for \cs{footheight}, \cs{@maxsep} and \cs{@dblmaxsep} +% by real dimen variables.} +% \changes{v0.17}{1994/03/02}{Moved the documentation to the front, so +% this file can be processed directly without a driver file. +% Added \cs{@ptscale}, \cs{@halfmag}, \cs{@magscale}, and set the +% default font to be CMR at 10pt.} +% \changes{v0.18}{1994/03/11}{Restored the old definition of \cs{verb}. +% Set the catcodes of the non-alphanumerics.} +% \changes{v0.19}{1994/04/05}{Switched off more 2e features: \cs{lrbox}, +% \cs{width}, \cs{height}, \cs{depth} in box dimensions, and the new +% optional arguments to \cs{parbox}, \cs{minipage} and +% \cs{newcommand}. The code was provided by DPC. Fixed a misplaced +% . Made the \cs{ProvidesPackage} and \cs{ProvidesClass} +% warnings log messages. Removed \cs{filedate}.} +% \changes{v0.20}{1994/04/20} +% {Restored the 2.09 definition of \cs{@noligs}.} +% \changes{v0.21}{1994/04/24} +% {Restored the 2.09 definition of \cs{@lquote}.} +% \changes{v0.22}{1994/05/02}{Added \cs{@latex@e@command}.} +% \changes{v0.23}{1994/05/11}{Added bezier.sty.} +% \changes{v0.24}{1994/05/14}{Removed \cs{@@@} and switched the box +% commands back on, for use in packages.} +% \changes{v0.24}{1994/05/14}{Changed the 2e command error help.} +% \changes{v0.24}{1994/05/14}{Removed date from announcement of +% 2.09 mode.} +% \changes{v0.25}{1994/05/14}{Added the newlfont option, and rewrote the +% oldlfont option.} +% \changes{v0.26}{1994/05/15}{Added the margid and nomargid options.} +% \changes{v0.27}{1994/05/16}{Fixed a bug with the margid option.} +% \changes{v0.28}{1994/05/16}{Fixed a bug with \cs{mediumseries}.} +% \changes{v0.29}{1994/05/17}{Fixed a bug with \cs{newlfont}.} +% \changes{v0.29}{1994/05/17}{Removed extra spaces from the missing +% file error.} +% \changes{v0.29}{1994/05/17}{Made the bezier package use \cs{iffalse} +% to comment itself out, rather than \%\%, which caused it to +% appear in every 2.09 file.} +% \changes{v0.30}{1994/05/18}{Added \cs{@finalstrut}.} +% \changes{v0.31}{1994/05/20}{New definition of \cs{@finalstrut}.} +% \changes{v0.31}{1994/05/20}{Added the t1enc package.} +% \changes{v0.32}{1994/05/20}{Added SLiTeX.} +% \changes{v0.33}{1994/06/01}{Fixed bug with SLiTeX.} +% \changes{v0.34}{1994/08/22}{Replaced l2euser by usrguide.} +% \changes{v0.34}{1994/08/22}{Added a default definition for \cs{+}.} +% \changes{v0.35}{1994/09/23} +% {Added spaces to the old font scale commands.} +% \changes{v0.36}{1994/10/17}{Added an empty \cs{mark} back again.} +% \changes{v0.37}{1994/10/20}{Corrected a typo.} +% \changes{v0.38}{1994/11/16}{Removed \cs{LaTeXe} from this list} +% \changes{v0.39}{1994/11/28}{Added old behaviour of floats and space.} +% \changes{v0.40}{1995/05/05}{Make \cs{verb} use \cs{tt} font in +% math mode.} +% \changes{v0.49}{1995/10/26}{Added code for fleqn.sty, leqno.sty, +% openbib.sty.} +% \changes{v0.50}{1995/12/08}{Switched of \cs{@inmathwarn}.} +% +% \maketitle +% +% \section{Introduction} +% +% The file |latex209.def| is read in by \LaTeXe{} whenever it finds a +% |\documentstyle| rather than |\documentclass| command at the +% beginning of the file. This indicates a \LaTeX~2.09 document, which +% should be processed in {\em compatibility mode}. +% +% Any document which compiled under \LaTeX~2.09 should compile under +% compatibility mode, unless it uses low-level commands such as +% |\tenrm|. +% +% \section{The docstrip modules} +% +% The following modules are used in the implementation to direct +% docstrip in generating the external files: +% \begin{center} +% \begin{tabular}{ll} +% driver & produce a documentation driver file \\ +% head & produce the beginning of |latex209.def| \\ +% tail & produce the end of |latex209.def| \\ +% article & produce |article.sty| \\ +% book & produce |book.sty| \\ +% report & produce |report.sty| \\ +% slides & produce |slides.sty| \\ +% letter & produce |letter.sty| \\ +% bezier & produce |bezier.sty| \\ +% fleqn & produce |fleqn.sty| \\ +% leqno & produce |leqno.sty| \\ +% openbib & produce |openbib.sty| +% \end{tabular} +% \end{center} +% Between the |head| and |tail| of |latex209.def|, the code for +% |oldlfont.sty| is included, so \LaTeX~2.09 documents will +% automatically be run simulating the OFSS. +% \changes{v0.09}{1993/12/20}{Removed artN.sty, bkN.sty and repN.sty.} +% \changes{v0.11}{1994/01/21}{Split package into head and tail.} +% \changes{v0.23}{1994/05/11}{Added bezier option.} +% +% \StopEventually{} +% +% \section{Driver} +% +% This section contains the driver for this documentation. +% \begin{macrocode} +%<*driver> +\documentclass{ltxdoc} +\DisableCrossrefs +% \OnlyDescription +\begin{document} + \DocInput{latex209.dtx} +\end{document} +% +% \end{macrocode} +% +% \section{Beginning of latex209.def} +% +% \changes{v0.11}{1994/01/21}{oldlfont.dtx is now also used to generate +% latex209.dtx.} +% +% This section describes the beginning of the file |latex209.def|. +% \begin{macrocode} +%<*head> +% \end{macrocode} +% +% \subsection{Identification} +% +% This file needs to be run with \LaTeXe. +% \begin{macrocode} +\NeedsTeXFormat{LaTeX2e} +% \end{macrocode} +% Describe the file. +% \begin{macrocode} +\ProvidesFile{latex209.def}[1998/05/13 v0.52 Standard LaTeX file] +% \end{macrocode} +% \changes{v0.24}{1994/05/14}{Removed date.} +% \changes{v0.40}{1995/03/21} +% {(DPC) Do not execute this file twice latex/1460} +% Announce compatibility mode to the user. +% \changes{v0.52}{1998/05/13}{Added experimental +% long typeout to possibly avoid prs like 2807} +% \begin{macrocode} +\if@compatibility + \expandafter\endinput +\else + \typeout{^^J\space +\@spaces\@spaces\space Entering LaTeX 2.09 COMPATIBILITY MODE^^J\space + *************************************************************^^J\space + \space\space\space!!WARNING!!\space + \space\space\space!!WARNING!!\space + \space\space\space!!WARNING!!\space + \space\space\space!!WARNING!!\space\space\space ^^J\space + ^^J\space + This mode attempts to provide an emulation of the LaTeX 2.09^^J\space + author environment so that OLD documents can be successfully^^J\space + processed. It should NOT be used for NEW documents!^^J\space + ^^J\space + New documents should use Standard LaTeX conventions and start^^J\space + with the \string\documentclass\space command.^^J\space + ^^J\space + Compatibility mode is UNLIKELY TO WORK with LaTeX 2.09 style^^J\space + files that change any internal macros, especially not with^^J\space + those that change the FONT SELECTION or OUTPUT ROUTINES.^^J\space +^^J\space + Therefore such style files MUST BE UPDATED to use^^J\space +\@spaces\@spaces\space Current Standard LaTeX: LaTeX2e.^^J\space + If you suspect that you may be using such a style file, which^^J\space + is probably very, very old by now, then you should attempt to^^J\space + get it updated by sending a copy of this error message to the^^J\space + author of that file.^^J\space + *************************************************************^^J} + \fi +% \end{macrocode} +% +% \subsection{Compatibility flag} +% +% \begin{macro}{\@compatibilitytrue} +% \LaTeXe{} has a flag |\if@compatibility| which can be used by +% document classes or packages to determine whether they are running +% in compatibility mode or not. This flag is set true by this file. +% \begin{macrocode} +\@compatibilitytrue +% \end{macrocode} +% \end{macro} +% +% \subsection{Removing features} +% +% \changes{v0.22}{1994/05/02}{Added \cs{latex@e@command}.} +% \changes{v0.36}{1994/10/17}{Redid switching off commands.} +% \changes{v0.38}{1994/11/16}{Removed \cs{LaTeXe} from this list} +% +% \begin{macro}{\usepackage} +% \begin{macro}{\listfiles} +% \begin{macro}{\ensuremath} +% \begin{macro}{\lrbox} +% \begin{macro}{\newcommand} +% These \LaTeXe{} commands are switched off in compatibility mode. +% This is done by saving the old definition, and redefining the +% command to call |\@latex@e@error| before executing the old version. +% \begin{macrocode} +\def\@tempa#1#2{% + \expandafter\let\csname @@\string#1\endcsname#1% + \edef#1{% + \noexpand\@latex@e@error{\noexpand#2}% + \expandafter\noexpand\csname @@\string#1\endcsname + }% +} +\@tempa\usepackage\usepackage +\@tempa\listfiles\listfiles +\@tempa\ensuremath\ensuremath +\@tempa\lrbox{\begin{lrbox}}% +\@tempa\@xargdef{\newcommand{cmd}[args][def]}% +% \end{macrocode} +% \end{macro} +% \end{macro} +% \end{macro} +% \end{macro} +% \end{macro} +% +% \changes{v0.22}{1994/05/02} +% {Added \cs{if@latex@e@errors} and \cs{@@@}.} +% \changes{v0.24} +% {1994/05/14}{Removed \cs{if@latex@e@errors} and \cs{@@@}.} +% \changes{v0.24}{1994/05/14}{Changed the error help.} +% \changes{v0.36}{1994/10/17}{Initialized \cs{@latex@e@error} to do +% nothing, and switched it on at the begin document.} +% +% \begin{macro}{\@latex@e@error} +% \begin{macro}{\@latex@e@error@} +% This error is produced if a user uses a \LaTeXe{} command in +% compatibility mode. This is to encourage users to move over to +% using |\documentclass| as quickly as possible. During the preamble +% the error does nothing (so that packages can use \LaTeXe{} commands) +% but it is redefined to be an error message at |\begin{document}|. +% \begin{macrocode} +\let\@latex@e@error\@gobble +\def\@latex@e@error@#1{% + \@latexerr{% + LaTeX2e command \string#1\space in LaTeX 2.09 document% + }{% + This is a LaTeX 2.09 document, but it contains + \string#1.^^J% + If you want to use the new features of LaTeX2e, + your document^^J% + should begin with \string\documentclass\space + rather than \string\documentstyle + }% +} +% \end{macrocode} +% \end{macro} +% \end{macro} +% +% \changes{v0.36}{1994/10/17} +% {Allow 2e commands to be redefined once with \cs{newcommand}.} +% \changes{v0.40}{1995/03/21}{ +% (DPC) Add \cs{r} to the list of 2e commands latex/1424} +% +% \begin{macro}{\@ifdefinable} +% \begin{macro}{\@old@ifdefinable} +% \begin{macro}{\@@ifdefinable} +% \begin{macro}{\@latex@e@commands} +% We trap the |\@notdefinable| error message to check to see if the +% command is a \LaTeXe{} command, in which case we allow the +% definition to happen. We keep a list of commands which are +% allowed to be redefined this way in |\@latex@e@commands|, and +% remove an entry each time it is defined. +% \begin{macrocode} +\let\@old@ifdefinable\@ifdefinable +\long\def\@ifdefinable#1{% + \def\@tempa##1#1##2#1##3#1##4\@tempa{% + \def\@latex@e@commands{##1##2}% + ##3% ##3 will either be \iftrue or \iffalse + \expandafter\@firstofone + \else + \expandafter\@old@ifdefinable\expandafter#1% + \fi + }% + \expandafter\@tempa\@latex@e@commands#1\iftrue#1\iffalse#1\@tempa% +} +\let\@@ifdefinable\@ifdefinable +\def\@latex@e@commands{% + \usepackage\listfiles\ensuremath\LaTeXe\lrbox + \th\dh\ng\dj\TH\DH\NG\DJ\k\r\SS + \guillemotleft\guillemotright\guilsinglleft + \guilsinglright\quotedblbase\quotesinglbase +} +% \end{macrocode} +% \end{macro} +% \end{macro} +% \end{macro} +% \end{macro} +% +% \begin{macro}{\@begin@tempboxa} +% \changes{v0.22}{1994/05/02}{Commented out the redefinition of +% \cs{@begin@tempboxa}.} +% If we were to switch off the new |\width|, |\height| and |\depth| +% commands, this is how to do it. This isn't done, since these +% commands may be used in packages. +% \begin{verbatim} +%\long\def\@begin@tempboxa#1#2{% +% \begingroup +% \setbox\@tempboxa#1{{#2}}} +% \end{verbatim} +% \end{macro} +% +% \subsection{Document class hook} +% +% \begin{macro}{\@documentclasshook} +% \changes{v0.15}{1994/02/10}{Renamed from \cs{@compatibility} to +% \cs{@documentclasshook}. Added the check for \cs{@normalsize} and +% \cs{normalsize} being defined.} +% \changes{v0.22}{1994/05/02}{Moved switching off commands into the +% document class hook.} +% \changes{v0.24}{1994/05/14}{Switched the box commands back on, for use +% in packages.} +% \changes{v0.36}{1994/10/17}{Changed the way the 2e command error is +% activated.} +% \changes{v0.51}{1996/05/24}{(DPC) Reimplemented for /2153.} +% This macro is called by each use of |\documentclass|. We define +% it to define |\@normalsize| and |\normalsize| if necessary, +% to input each unused option as a package, and to switch off the new +% \LaTeXe{} commands. However, we leave on the commands +% |\settoheight|, |\settowidth| and the new options to |\parbox| and +% |\minipage|, since these are likely to be used in packages. +% +% The intention of the strange |\normalsize| tests below is that after +% the |\documentstyle| command has completed, if neither |\normalsize| +% nor |\@normalsize| was defined by the main style or one of its +% `substyles' or `options', then |\@normalsize| will be undefined and +% |\normalsize| will generate an error saying it hasn't been defined. +% +% If the style defined either |\normalsize| or \@|normalsize| then +% these two commands will be |\let| equal to each other, with the +% definition given by the style file. +% +% If the style defines both |\normalsize| and |\@normalsize| then +% those two definitions are kept. +% \begin{macrocode} +\def\@documentclasshook{% + \RequirePackage\@unusedoptionlist + \let\@unusedoptionlist\@empty + \def\@tempa{\@normalsize}% + \ifx\normalsize\@tempa + \let\normalsize\@normalsize + \fi + \ifx\@normalsize\@undefined + \let\@normalsize\normalsize + \fi + \ifx\normalsize\@undefined + \let\normalsize\original@normalsize + \fi + \let\@latex@e@error\@latex@e@error@} +% \end{macrocode} +% \end{macro} +% +% \begin{macro}{\original@normalsize} +% \changes{v0.51}{1996/05/24}{(DPC) Macro added /2153.} +% Save the original definition of |\normalsize| (which generates an +% error) +% \begin{macrocode} +\let\original@normalsize\normalsize +% \end{macrocode} +% \end{macro} +% +% \begin{macro}{\normalsize} +% \changes{v0.14}{1994/02/07}{Added \cs{normalsize}.} +% Some styles don't define |\normalsize|, just |\@normalsize|. +% \begin{macrocode} +\def\normalsize{\@normalsize} +% \end{macrocode} +% \end{macro} +% +% \subsection{Compatibility with \LaTeX~2.09 document styles} +% +% \begin{macro}{\@missingfileerror} +% If a |.cls| file is missing, we look to see if there is +% a file of the same name with a |.sty| extension. +% \changes{v0.06}{1993/12/18}{Corrected a typo +% \cs{@saved@missingfileerror} +% should have been \cs{saved@missingfileerror}.} +% \changes{v0.07}{1993/12/18}{Corrected a typo, I'd forgotten to pass +% the arguments of \cs{@missingfileerror} on to +% \cs{saved@missingfileerror}.} +% \changes{v0.29}{1994/05/17}{Removed extraneous spaces.} +% \begin{macrocode} +\@ifundefined{saved@missingfileerror}{ + \let\saved@missingfileerror=\@missingfileerror +}{} +\def\@missingfileerror#1#2{% + \ifx#2\@clsextension + \InputIfFileExists{#1.\@pkgextension}{% + \wlog{Compatibility mode: loading #1.\@pkgextension + \space rather than #1.#2.}% + }{% + \saved@missingfileerror{#1}{#2}% + }% + \else + \saved@missingfileerror{#1}{#2}% + \fi +} +% \end{macrocode} +% \end{macro} +% +% \begin{macro}{\@obsoletefile} +% For compatibility with the document styles which |\input| the +% standard \LaTeX~2.09 document styles, we distribute +% files called |article.sty|, |book.sty|, |report.sty|, +% |slides.sty| and |letter.sty|. These use the command +% |\@obsoletefile|, which the \LaTeXe{} kernel defines to produce a +% warning message. We redefine it to just produce a message in the +% log file, and to pass any options from the old filename to the +% new filename. +% \changes{v0.08}{1993/12/19}{Added this command.} +% \changes{v0.10}{1994/01/14}{Added the option-passing.} +% \begin{macrocode} +\def\@obsoletefile#1#2{% + \expandafter\let\csname opt@#1\expandafter\endcsname + \csname opt@\@currname.\@currext\endcsname + \wlog{Compatibility mode: inputting `#1' + instead of obsolete `#2'.}} +% \end{macrocode} +% \end{macro} +% +% \begin{macro}{\footheight} +% \begin{macro}{\@maxsep} +% \begin{macro}{\@dblmaxsep} +% \LaTeX~2.09 supported these parameters, so for compatibility with +% old document styles we allocate them. +% \changes{v0.16}{1994/02/11}{Replaced the allocation of temporary +% dimens for \cs{footheight}, \cs{@maxsep} and \cs{@dblmaxsep} by +% real dimen variables.} +% \begin{macrocode} +\newdimen\footheight +\newdimen\@maxsep +\newdimen\@dblmaxsep +% \end{macrocode} +% \end{macro} +% \end{macro} +% \end{macro} +% +% \changes{v0.36}{1994/10/17}{Added an empty \cs{mark}.} +% \changes{v0.37} +% {1994/10/20}{Corrected a type with the empty \cs{mark}.} +% +% \begin{macro}{\mark} +% \LaTeX~2.09 initialized an empty mark. Who knows, someone may have +% relied on it: +% \begin{macrocode} +\mark{{}{}} +% \end{macrocode} +% \end{macro} +% +% \subsection{Layout} +% +% \begin{macro}{\sloppy} +% \changes{v0.06}{1993/12/18}{Added \cs{sloppy}} +% There is a new version of |\sloppy| in \LaTeXe, so we restore the +% old one. +% \begin{macrocode} +\def\sloppy{\tolerance \@M \hfuzz .5\p@ \vfuzz .5\p@} +% \end{macrocode} +% \end{macro} +% +% \begin{macro}{\@finalstrut} +% \changes{v0.30}{1994/05/18}{Added \cs{@finalstrut}.} +% \changes{v0.31}{1994/05/20}{New definition of \cs{@finalstrut}.} +% The strut which is used in a footnote has changed. This restores +% the old definition. +% \begin{macrocode} +\def\@finalstrut#1{\unskip\strut} +% \end{macrocode} +% \end{macro} +% +% \begin{macro}{\@marginparreset} +% \begin{macro}{\@floatboxreset} +% \changes{v0.39}{1994/11/28}{Added old behaviour of floats and space.} +% \changes{v0.45}{1995/05/25}{(CAR) Changed method of restoring +% old behaviour of floats and space.} +% Restore the old spacing around floats. +% \begin{macrocode} +\let \@marginparreset \@empty +\let \@floatboxreset \@empty +% \end{macrocode} +% \end{macro} +% \end{macro} +% +% \begin{macro}{\proclaim} +% \changes{v0.41}{1995/04/24} +% {Move here from ltplain.dtx} +% From plain \TeX. +% \begin{macrocode} +\outer\def\proclaim #1. #2\par{% + \medbreak + \noindent{\bfseries#1.\enspace}{\slshape#2\par}% + \ifdim\lastskip<\medskipamount + \removelastskip\penalty55\medskip + \fi} +% \end{macrocode} +% \end{macro} +% +% \begin{macro}{\hang} +% \begin{macro}{\textindent} +% \changes{v0.42}{1995/04/27} +% {Move here from ltplain.dtx} +% From plain \TeX. +% \begin{macrocode} +\def\hang{\hangindent\parindent} +\def\textindent#1{\indent\llap{#1\enspace}\ignorespaces} +% \end{macrocode} +% \end{macro} +% \end{macro} +% \begin{macro}{\ttraggedright} +% \changes{v0.41}{1995/04/24} +% {Move here from ltplain.dtx} +% \begin{macrocode} +\def\ttraggedright{\reset@font\ttfamily\rightskip\z@ plus2em\relax} +% \end{macrocode} +% \end{macro} +% +% +% \begin{macro}{\@footnotemark} +% \changes{v0.43}{1995/05/12} +% {macro added} +% \LaTeXe\ version has |\nobreak| to allow hyphenation. +% \begin{macrocode} +\def\@footnotemark{% + \leavevmode + \ifhmode\edef\@x@sf{\the\spacefactor}\fi + \@makefnmark + \ifhmode\spacefactor\@x@sf\fi + \relax} +% \end{macrocode} +% \end{macro} +% +% \begin{macro}{\@textsuperscript} +% \changes{v0.48}{1995/07/07} +% {macro added for latex/1722} +% Fudge this command to remove the text font command which +% is always the first thing in the argument. This is needed +% as in compatibility mode footnotes are processed in math mode, +% but the standard classes call |\@textsuperscript| in the definition +% of |\thanks|. +% \begin{macrocode} +\def\@textsuperscript#1{$\m@th^{\@gobble#1}$} +% \end{macrocode} +% \end{macro} +% +% +% +% \begin{macro}{\@makefnmark} +% \changes{v0.44}{1995/05/20}{macro added} +% \LaTeXe\ version uses |\textsuperscript| rather than +% math mode. +% \begin{macrocode} +\def\@makefnmark{\hbox{$^{\@thefnmark}\m@th$}} +% \end{macrocode} +% \end{macro} +% +% \begin{macro}{\thempfootnote} +% \changes{v0.44}{1995/05/20}{macro added} +% \LaTeXe\ version has an additional |\itshape| which would not +% work (and would not make sense) in math mode. +% \begin{macrocode} +\def\thempfootnote{\@alph\c@mpfootnote} +% \end{macrocode} +% \end{macro} +% +% \begin{macro}{\@fnsymbol} +% \changes{v0.46}{1995/06/30}{macro added} +% \LaTeX\ version uses |\ensuremath| which does not work in +% compatibility mode. +% \begin{macrocode} +\def\@fnsymbol#1{\ifcase#1\or *\or \dagger\or \ddagger\or + \mathchar "278\or \mathchar "27B\or \|\or **\or \dagger\dagger + \or \ddagger\ddagger \else\@ctrerr\fi} +% \end{macrocode} +% \end{macro} +% +% \begin{macro}{\@inmathwarn} +% \changes{v0.50}{1995/12/08}{Switched off \cs{@inmathwarn}} +% \LaTeX\ (1995/12/01) checks for text commands being used in math +% mode. We switch this off in compatibility mode. +% \begin{macrocode} +\let\@inmathwarn\@gobble +% \end{macrocode} +% \end{macro} +% +% \subsection{Verbatim} +% +% \changes{v0.18}{1994/03/11}{Added the changes to \cs{verb}} +% \changes{v0.40}{1995/05/05}{Make \cs{verb} use \cs{tt} font in +% math mode.} +% \begin{macro}{\verb} +% \begin{macro}{\@sverb} +% We restore the old definition of |\verb|, but using +% |\verbatim@font| rather than |\tt|. The use of |\bgroup| and +% |\egroup| allows us to prefix it with |\hbox| in math mode. +% \begin{macrocode} +\def\verb{% + \relax\ifmmode\hbox\fi\bgroup + \@noligs + \verbatim@font + \let\do\@makeother \dospecials + \@ifstar{\@sverb}{\@verb}% +} +\def\@sverb#1{% + \def\@tempa ##1#1{\leavevmode\null##1\egroup}% + \@tempa +} +% \end{macrocode} +% \end{macro} +% \end{macro} +% +% \begin{macro}{\verbatim@nolig@list} +% \changes{v0.20}{1994/04/20}{Added the redefinition of +% \cs{verbatim@nolig@list}.} +% The only ligatures which should be switched off in 2.09 mode are +% the Spanish punctuation. +% \begin{macrocode} +\def\verbatim@nolig@list{\do\`} +% \end{macrocode} +% \end{macro} +% +% \begin{macro}{\@lquote} +% \changes{v0.21}{1994/04/24}{Added the definition of \cs{@lquote}.} +% We restore the old definition of |\@lquote| in case any packages +% use it. +% \begin{macrocode} +\def\@lquote{\leavevmode{\kern\z@}`} +% \end{macrocode} +% \end{macro} +% +% +% \subsection{Character codes} +% +% \changes{v0.18}{1994/03/11}{Added the catcode changes} +% +% By default, \LaTeXe{} makes the input charactes 0--8, 11, 14--31 and +% 128--255 illegal. In compatibility mode, we restore their old +% meanings. +% \begin{macrocode} +\catcode0=9 +\@tempcnta=1 +\loop\ifnum\@tempcnta<32 + \catcode\@tempcnta=12 + \advance\@tempcnta by 1 +\repeat% +\catcode`\^^I=10\relax% +\catcode`\^^L=13\relax% +\catcode`\^^M=5\relax% +\catcode127=15 +\@tempcnta=128 +\loop\ifnum\@tempcnta<256 + \catcode\@tempcnta=12 + \advance\@tempcnta by 1 +\repeat +% \end{macrocode} +% +% \subsection{Miscellaneous commands} +% +% \begin{macro}{\SLiTeX} +% The \textsc{Sli\TeX} logo. +% \begin{macrocode} +\DeclareRobustCommand{\SLiTeX}{{% + \normalfont S\kern -.06em + {\scshape l\kern -.035emi}\kern -.06em + \TeX}} +% \end{macrocode} +% \end{macro} +% +% \begin{macro}{\+} +% The |\+| command should be defined, so that it can be used in +% |\renewcommand|. +% \begin{macrocode} +\let\+\@empty +% \end{macrocode} +% \end{macro} +% +% \begin{macro}{\@cla} +% \begin{macro}{\@clb} +% \changes{v0.47}{1995/09/25} +% {(DPC) Declare old \cs{cline} registers} +% \begin{macro}{\mscount} +% \LaTeX2.09 (and early versions of \LaTeXe) used these count registers +% in the definition of |\cline| and |\multispan|. +% Declare them here in case they were used for any other purposes. +% \begin{macrocode} +\newcount\@cla +\newcount\@clb +\newcount\mscount +% \end{macrocode} +% \end{macro} +% \end{macro} +% \end{macro} +% +% \begin{macro}{\@imakepicbox} +% \changes{v0.48}{1995/10/16} +% {(DPC) emulate old behaviour of picture mode makebox} +% picture mode version +% \begin{macrocode} +\long\def\@imakepicbox(#1,#2)[#3]#4{% + \vbox to#2\unitlength + {\let\mb@b\vss \let\mb@l\hss\let\mb@r\hss + \let\mb@t\vss + \@tfor\reserved@a :=#3\do{% + \if s\reserved@a + \let\mb@l\relax\let\mb@r\relax + \else + \expandafter\let\csname mb@\reserved@a\endcsname\relax + \fi}% + \mb@t + \hb@xt@ #1\unitlength{\mb@l #4\mb@r}% + \mb@b +% \end{macrocode} +% This kern ensures that a |b| option aligns on the bottom of the +% text rather than the baseline. this is the documented behaviour in +% the \LaTeX Book. The kern is removed in compatibility mode. +% +% Remove kern for bug compatibility with 2.09. +% \begin{macrocode} +% \kern\z@ + }} +% \end{macrocode} +% \end{macro} +% +% \begin{macro}{\supereject} +% \begin{macrocode} +\def\supereject{\par\penalty-\@MM} +% \end{macrocode} +% \end{macro} +% +% \begin{macro}{\nofiles} +% \changes{v0.51}{1996/05/24}{(DPC) Old definition, without \cs{write} +% added to \cs{protected@write}, for latex/2146} +% This old version might change the vertical spacing when it is used. +% Some old document might depend on that changed spacing so\ldots +% \begin{macrocode} +\def\nofiles{% + \@fileswfalse + \typeout{No auxiliary output files.^^J}% + \long\def\protected@write##1##2##3{}% + \let\makeindex\relax + \let\makeglossary\relax} +% \end{macrocode} +% \end{macro} +% +% \subsection{Packages and classes} +% +% \begin{macro}{\ProvidesPackage} +% \begin{macro}{\ProvidesClass} +% We redefine |\ProvidesPackage| and |\ProvidesClass| to produce a +% log message rather than a warning if they find an unexpected +% file. +% \begin{macrocode} +\def\ProvidesPackage#1{% + \xdef\@gtempa{#1}% + \ifx\@gtempa\@currname\else + \wlog{Compatibility mode: \@cls@pkg\space`\@currname' requested, + but `#1' provided.}% + \fi + \@ifnextchar[\@pr@videpackage{\@pr@videpackage[]}}%] +\let\ProvidesClass=\ProvidesPackage +% \end{macrocode} +% \end{macro} +% \end{macro} +% That ends the head of |latex209.def|. +% \begin{macrocode} +% +% \end{macrocode} +% +% \section{Middle of latex209.def} +% +% At this point, the code for |oldlfont.sty| is read in by the +% installation script. +% +% \section{End of latex209.def} +% +% This section describes the end of |latex209.def|. +% \begin{macrocode} +%<*tail> +% \end{macrocode} +% +% \subsection{Font commands} +% +% \changes{v0.12}{1994/01/24}{Added the oldlfont option.} +% \changes{v0.25}{1994/05/14}{Added the newlfont option, rewrote the +% oldlfont option to change math grouping.} +% \changes{v0.26}{1994/05/15}{Added the margid and nomargid options.} +% \changes{v0.27}{1994/05/16}{Replaced \# by \#\# in margid.} +% \changes{v0.28}{1994/05/17}{Replaced \cs{input} newlfont.sty by +% \cs{OptionNotUsed} in \cs{ds@newlfont}.} +% +% \begin{macro}{\ds@oldlfont} +% \begin{macro}{\ds@newlfont} +% \begin{macro}{\ds@margid} +% \begin{macro}{\ds@nomargid} +% We declare |oldlfont|, |newlfont|, |margid| and |nomargid| +% options to mimic the \LaTeX~2.09 NFSS1 options. +% \begin{macrocode} +\def\ds@oldlfont{% + \@no@font@optfalse + \let\math@bgroup\@empty + \let\math@egroup\@empty + \let\@@math@bgroup\math@bgroup + \let\@@math@egroup\math@egroup +} +\def\ds@newlfont{% + \@no@font@optfalse + \OptionNotUsed +} +\def\ds@margid{% + \@no@font@optfalse + \let\math@bgroup\bgroup + \def\math@egroup##1{##1\egroup}% + \let \@@math@bgroup \math@bgroup + \let \@@math@egroup \math@egroup +} +\let\ds@nomargid\ds@oldlfont +\@onlypreamble\ds@oldfont +\@onlypreamble\ds@newfont +\@onlypreamble\ds@margid +\@onlypreamble\ds@nomargid +% \end{macrocode} +% \end{macro} +% \end{macro} +% \end{macro} +% \end{macro} +% +% \begin{macro}{\encodingdefault} +% The default encoding for old documents is OT1 rather than T1. +% \begin{macrocode} +\renewcommand{\encodingdefault}{OT1} +% \end{macrocode} +% \end{macro} +% +% \begin{macro}{\cmex/m/n/10} +% Just in case a document style relies on |\cmex/m/n/10| to exist +% (which may have been hard-wired to |\fam3|) we load the font. +% \begin{macrocode} +\expandafter\font\csname cmex/m/n/10\endcsname=cmex10 +% \end{macrocode} +% \end{macro} +% +% +% \changes{v0.12}{1994/01/24} +% {Added \cs{normalshape} and \cs{mediumseries}.} +% \changes{v0.28}{1994/05/16}{\cs{mediumseries} was using +% \cs{fontshape} rather than \cs{fontseries}.} +% +% \begin{macro}{\normalshape} +% \begin{macro}{\mediumseries} +% These commands were used in older versions of NFSS. +% \begin{macrocode} +\def\normalshape{\fontshape\shapedefault\selectfont} +\def\mediumseries{\fontseries\seriesdefault\selectfont} +% \end{macrocode} +% \end{macro} +% \end{macro} +% \begin{macro}{\DeclareOldFontCommand} +% We redefine |\DeclareOldFontCommand| to do nothing. This means +% that any new document classes will have their redefinitions of +% |\rm|, |\bf| etc.~ignored. +% \changes{v0.06}{1993/12/18}{Replaced \cs{@newfontswitch} by +% \cs{@renewfontswitch}.} +% \changes{v0.11}{1994/01/21}{Removed \cs{RequirePackage}{oldlfont}.} +% \changes{v0.19}{1994/04/05}{Replaced \cs{@renewfontswitch} by +% \cs{DeclareOldFontCommand}.} +% \begin{macrocode} +\def \DeclareOldFontCommand #1#2#3{% + \wlog{Compatibility mode: definition + of \string#1\space ignored.}% +} +% \end{macrocode} +% \end{macro} +% +% \changes{v0.17} +% {1994/03/02}{Added \cs{@halfmag}, \cs{@magscale} and \cs{@ptscale}} +% \changes{v0.35} +% {1994/09/23}{Added spaces to the old font scale commands.} +% +% \begin{macro}{\@halfmag} +% \begin{macro}{\@magscale} +% \begin{macro}{\@ptscale} +% Some font-specifying commands from \LaTeX~2.09. +% \begin{macrocode} +\def\@halfmag{ scaled \magstephalf} +\def\@magscale#1{ scaled \magstep#1 } +\def\@ptscale#1{ scaled #100 } +% \end{macrocode} +% \end{macro} +% \end{macro} +% \end{macro} +% +% \begin{macro}{\font} +% The current font is set to be CMR 10pt, to match \LaTeX~2.09. +% \begin{macrocode} +\fontencoding{OT1} \fontfamily{cmr} +\fontsize{10}{12} \fontseries{m} \fontshape{n} +\selectfont +% \end{macrocode} +% \end{macro} +% +% \changes{v0.11}{1994/01/21}{Added the rest of this subsection, which +% used to be in oldlfont.dtx.} +% +% \begin{macro}{\load} +% The |\load| command is no longer needed, it is therefore +% defined to do nothing. +% \begin{macrocode} +\let\load\@gobbletwo +% \end{macrocode} +% \end{macro} +% +% Here are three delimiters which have be partly disabled by +% NFSS2 (the small variants) since the corresponding fonts are +% normally not preloaded as math symbol fonts. +% \begin{macrocode} +\DeclareMathDelimiter{\lgroup} % extensible ( with sharper tips + {\mathopen}{bold}{"28}{largesymbols}{"3A} +\DeclareMathDelimiter{\rgroup} % extensible ) with sharper tips + {\mathclose}{bold}{"29}{largesymbols}{"3B} +\DeclareMathDelimiter{\bracevert} % the vertical bar that extends braces + {\mathord}{typewriter}{"7C}{largesymbols}{"3E} +% \end{macrocode} +% +% In old documents we might find some usages of |\bffam| etc. Thus +% we add the following code: +% \begin{macrocode} +\let\bffam\symbold +\let\sffam\symsans +\let\itfam\symitalic +\let\ttfam\symtypewriter +\let\scfam\symsmallcaps +\let\slfam\symslanted +\let\rmfam\symoperators +% \end{macrocode} +% +% Below are the |\..pt| commands with hopefully the same +% functionality as in the old \texttt{lfonts.tex}. Notice that the +% |\baselineskip| parameter wasn't set by these commands so that +% using them now shouldn't set this either. Thus we go low-level. +% This means that the commands are now fragile but I think they +% have been fragile before. +% \begin{macrocode} +\newcommand\vpt {\edef\f@size{\@vpt}\rm} +\newcommand\vipt {\edef\f@size{\@vipt}\rm} +\newcommand\viipt {\edef\f@size{\@viipt}\rm} +\newcommand\viiipt{\edef\f@size{\@viiipt}\rm} +\newcommand\ixpt {\edef\f@size{\@ixpt}\rm} +\newcommand\xpt {\edef\f@size{\@xpt}\rm} +\newcommand\xipt {\edef\f@size{\@xipt}\rm} +\newcommand\xiipt {\edef\f@size{\@xiipt}\rm} +\newcommand\xivpt {\edef\f@size{\@xivpt}\rm} +\newcommand\xviipt{\edef\f@size{\@xviipt}\rm} +\newcommand\xxpt {\edef\f@size{\@xxpt}\rm} +\newcommand\xxvpt {\edef\f@size{\@xxvpt}\rm} +% \end{macrocode} +% +% \subsection{User customization} +% +% For sites which customized their version of \LaTeX~2.09, we provide +% a file |latex209.cfg|, which is loaded every time we enter +% compatibility mode. If the file doesn't exist, we don't do +% anything. +% \begin{macrocode} +\InputIfFileExists{latex209.cfg}{}{} +% \end{macrocode} +% That ends the file |latex209.def|. +% \begin{macrocode} +% +% \end{macrocode} +% +% \section{Obsolete style files} +% +% \changes{v0.08}{1993/12/19}{Added this section.} +% \changes{v0.09}{1993/12/20}{Removed artN.sty, bkN.sty and repN.sty.} +% \changes{v0.23}{1994/05/11}{Added bezier.sty.} +% \changes{v0.31}{1994/05/20}{Added t1enc.sty.} +% +% For each of the standard \LaTeX~2.09 document styles, we produce a +% file which points to the appropriate \LaTeXe{} document class file. +% This means that any styles which say |\input article.sty| should +% still work. +% +% \begin{macrocode} +%<*article|book|report|letter|slides> +\NeedsTeXFormat{LaTeX2e} +% +%<*article> +\@obsoletefile{article.cls}{article.sty} +\LoadClass{article} +%
+%<*book> +\@obsoletefile{book.cls}{book.sty} +\LoadClass{book} +% +%<*report> +\@obsoletefile{report.cls}{report.sty} +\LoadClass{report} +% +%<*letter> +\@obsoletefile{letter.cls}{letter.sty} +\LoadClass{letter} +% +%<*slides> +\@obsoletefile{slides.cls}{slides.sty} +\LoadClass{slides} +% +% \end{macrocode} +% We also produce empty |fleqn.sty| and |leqno.sty| files in case +% anyone has |\input| one of them. +% \begin{macrocode} +%<*fleqn> +\@obsoletefile{fleqn.clo}{fleqn.sty} +\input{fleqn.clo} +% +%<*leqno> +\@obsoletefile{leqno.clo}{leqno.sty} +\input{leqno.clo} +% +% \end{macrocode} +% We also produce an empty |openbib.sty| in case anyone has |\input| +% |openbib.sty|. The |openbib| class option is now part of the kernel. +% \begin{macrocode} +%<*openbib> +\iffalse + +The openbib option is now part of LaTeX thus this package is no +longer necessary. It is only retained for upward compatibility. +See the 2nd edition of the LaTeX book, or the file usrguide.tex +which comes with the LaTeX distribution, for more details. + +\fi +% +% \end{macrocode} +% We also produce an empty |bezier.sty| in case anyone has |\input| +% |bezier.sty|. The |\bezier| command is now part of the kernel. +% \begin{macrocode} +%<*bezier> +\iffalse + +The \bezier command is now part of LaTeX thus this package is no +longer necessary. It is only retained for upward compatibility. +Also, please note that LaTeX now offers an extended bezier command +which automatically calculates the number of points needed for the +plot. See the 2nd edition of the LaTeX book, or the file +usrguide.tex which comes with the LaTeX distribution, for more +details. + +\fi +% +% \end{macrocode} +% We also produce a |t1enc| package, for compatibility with the +% Companion. This has been replaced by the |fontenc| package. +% \begin{macrocode} +%<*t1enc> +\NeedsTeXFormat{LaTeX2e} +\ProvidesPackage{t1enc}[1994/06/01 Standard LaTeX package] +\renewcommand{\encodingdefault}{T1} +\fontencoding{T1}\selectfont +% +% \end{macrocode} +% \DeleteShortVerb{\|} +% \Finale +\endinput diff --git a/Master/texmf-dist/source/latex/base/latex209.ins b/Master/texmf-dist/source/latex/base/latex209.ins new file mode 100644 index 00000000000..74801ea7029 --- /dev/null +++ b/Master/texmf-dist/source/latex/base/latex209.ins @@ -0,0 +1,121 @@ +%% +%% This file will generate fast loadable files and documentation +%% driver files from the doc files in this package when run through +%% LaTeX or TeX. +%% +%% Copyright 1993 1994 1995 1996 1997 1998 1999 2000 2001 2002 2003 2004 +%% The LaTeX3 Project and any individual authors listed elsewhere +%% in this file. +%% +%% This file is part of the LaTeX base system. +%% ------------------------------------------- +%% +%% It may be distributed and/or modified under the +%% conditions of the LaTeX Project Public License, either version 1.3 +%% of this license or (at your option) any later version. +%% The latest version of this license is in +%% http://www.latex-project.org/lppl.txt +%% and version 1.3 or later is part of all distributions of LaTeX +%% version 2003/12/01 or later. +%% +%% This file has the LPPL maintenance status "maintained". +%% +%% In particular, NO PERMISSION is granted to modify the contents of this +%% file since it contains the legal notices that are placed in the files +%% it generates. +%% +%% The list of all files belonging to the LaTeX base distribution is +%% given in the file `manifest.txt'. See also `legal.txt' for additional +%% information. +%% +%% +%% +%% +%% --------------- start of docstrip commands ------------------ +%% + +\input docstrip + +\preamble + +This is a generated file. + +Copyright 1993 1994 1995 1996 1997 1998 1999 2000 2001 2002 2003 2004 +The LaTeX3 Project and any individual authors listed elsewhere +in this file. + +This file was generated from file(s) of the LaTeX base system. +-------------------------------------------------------------- + +It may be distributed and/or modified under the +conditions of the LaTeX Project Public License, either version 1.3 +of this license or (at your option) any later version. +The latest version of this license is in + http://www.latex-project.org/lppl.txt +and version 1.3 or later is part of all distributions of LaTeX +version 2003/12/01 or later. + +This file has the LPPL maintenance status "maintained". + +This file may only be distributed together with a copy of the LaTeX +base system. You may however distribute the LaTeX base system without +such generated files. + +The list of all files belonging to the LaTeX base distribution is +given in the file `manifest.txt'. See also `legal.txt' for additional +information. + +The list of derived (unpacked) files belonging to the distribution +and covered by LPPL is defined by the unpacking scripts (with +extension .ins) which are part of the distribution. +\endpreamble + +\keepsilent +\usedir{tex/latex/base} + +\Msg{*** Generating compatibility mode files ***} + +\generate{ + \usedir{tex/latex/base} + \file{latex209.def}{ + \from{latex209.dtx}{head} + \from{oldlfont.dtx}{latex209} + \from{latex209.dtx}{tail}} + \file{article.sty}{ + \from{latex209.dtx}{article}} + \file{book.sty}{ + \from{latex209.dtx}{book}} + \file{report.sty}{ + \from{latex209.dtx}{report}} + \file{letter.sty}{ + \from{latex209.dtx}{letter}} + \file{slides.sty}{ + \from{latex209.dtx}{slides}} + \file{fleqn.sty}{ + \from{latex209.dtx}{fleqn}} + \file{leqno.sty}{ + \from{latex209.dtx}{leqno}} + \file{openbib.sty}{ + \from{latex209.dtx}{openbib}} + \file{bezier.sty}{ + \from{latex209.dtx}{bezier}} + \file{t1enc.sty}{ + \from{latex209.dtx}{t1enc}} + } + +\ifToplevel{ +\Msg{***********************************************************} +\Msg{*} +\Msg{* To finish the installation you have to move the following} +\Msg{* files into a directory searched by TeX:} +\Msg{*} +\Msg{* \space\space latex209.def *.sty } +\Msg{*} +\Msg{* To produce the documentation run the files ending with} +\Msg{* `.drv' through LaTeX.} +\Msg{*} +\Msg{* Happy TeXing} +\Msg{***********************************************************} +} + +\endbatchfile diff --git a/Master/texmf-dist/source/latex/base/latexbug.el b/Master/texmf-dist/source/latex/base/latexbug.el new file mode 100644 index 00000000000..492f0d18f67 --- /dev/null +++ b/Master/texmf-dist/source/latex/base/latexbug.el @@ -0,0 +1,502 @@ +;;; latexbug.el +;;; +;;; Version 0: `test of concept' +;;; Don't look to closely at my lisp coding style... +;;; +;;; David Carlisle +;;; Version 0.1 1994/11/23 +;;; Version 0.2 1994/12/12 +;;; Version 0.3 1995/03/17 +;;; Version 0.4 1995/09/21 +;;; Version 0.5 1995/10/17 +;;; Version 0.6 1997/07/16 +;;; Version 0.7 1997/12/17 +;;; Version 0.8 1999/01/07 +;;; +;;; +;;; LOADING +;;;;;;;;;;; +;;; +;;; To use this code, place the file in a directory searched by lisp +;;; Add +;;; +;;; (autoload 'report-latex-bug "latexbug" +;;; "LaTeX bug report generator" t) +;;; +;;; to your .emacs file (without the ;;;). +;;; +;;; Then if the impossible happens and you discover a bug in LaTeX, +;;; or wish to suggest a change to LaTeX, type +;;; M-x report-latex-bug +;;; +;;; and follow the instructions. +;;; +;;; A file latexbug.cfg can be used to customise +;;; latexbug.tex as described in the comments in latexbug.tex. +;;; or you can customise in your .emacs, as shown below. +;;; +;;; CUSTOMISATION +;;;;;;;;;;;;;;;;;; +;;; +;;; The following variables may be set in your .emacs to customise this +;;; file. +;;; +;;; (setq ltxbug-name "David Carlisle") ; your name +;;; (setq ltxbug-address "dpc@,,,") ; your email address +;;; If these two are not set here, or in the latexbug.cfg +;;; file. emacs will prompt for the values. The prompt +;;; will suggest default values based on standard emacs variables +;;; user-full-name and user-mail-address. +;;; +;;; (setq ltxbug-mail-headers "...") ; additional mail headers. +;;; For example (setq ltxbug-mail-headers "FCC: ~/Mail/sent") +;;; To log outgoing mail in a `sent' file. +;;; +;;; (setq ltxbug-latex-command "...") ; latex command +;;; Set this if LaTeX is not called latex, eg it may be latex2e. +;;; +;;; +;;; Perhaps I should have based this on gnat's send-pr.el but it seemed +;;; easier to write it from scratch to work in latexbug.tex at the +;;; required points. +;;; +;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;; + +(require 'sendmail) + +(defvar ltxbug-latex-command "latex" + "Command name for Standard LaTeX (LaTeX2e)") + +(defvar ltxbug-directory nil +"Directory in which to run LaTeX, should end with slash. +Default, nil, means inherit directory from current buffer.") + +(defvar user-full-name nil); just needed on ancient emacs +(defvar ltxbug-name nil +"Your name. +If this is nil, will be prompted if not set in latexbug.cfg.") + +(defvar user-mail-address nil); just needed on ancient emacs +(defvar ltxbug-address nil +"Your email-address. +If this is nil, will be prompted if not set in latexbug.cfg.") + +(defvar ltxbug-mail-headers "" +"Extra mail headers that will be added to the mail message. +This is in addition to `To' and `Subject'.") + +;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;; + +(defvar ltxbug-categories +'(("latex") ("tools") ("graphics") + ("mfnfss") ("psnfss") ("amslatex") ("babel") ("expl3") ("cyrillic")) +"Valid GNATS categories") + + +(defun report-latex-bug () +"LaTeX bug report generator" + (interactive) +;; +;; Locally turn off transient mark mode. + (let ((transient-mark-mode nil) + (current-default-directory default-directory)) +;; +;; First produce one large window for the main message +;; and a smaller help window below. + (delete-other-windows) +;; (setq ltxbug-msg (switch-to-buffer "*latex-bugs*")); not emacs18 + (switch-to-buffer + (setq ltxbug-msg (get-buffer-create "*latex-bugs*"))) + (erase-buffer) + (setq default-directory + (or ltxbug-directory current-default-directory)) + (setq major-mode 'ltxbug) + (setq mode-name "LaTeX Bug Report") + (use-local-map ltxbug-map) + (message "Running latex on latexbug.tex ....") + (split-window-vertically +;; -13 ;; old emacs's can't do this + (- (window-height) 13)) + (switch-to-buffer-other-window + (setq ltxbug-help (get-buffer-create "latexbugs help"))) +;; +;; Initially fill the message buffer with the output from running +;; latexbug.tex. + (erase-buffer) +;; +;; Use shell-command not start-process here so shell variables are +;; initialised before calling LaTeX. +;; Hope that is enough \\ to keep all the different shells happy... +;; {} replaced by \\{\\} in version 0.4 (fix for latex/1675) +;; Use \@@input (v0.5) + (shell-command (concat + ltxbug-latex-command + " \\\\nonstopmode\\\\makeatletter\ + \\\\def\\\\batch\\{\\}\\\\@@input latexbug ") t) + (switch-to-buffer-other-window ltxbug-msg) + (goto-char (point-min)) +;; +;; Change header to mention this latexbug.el file. + (if (re-search-forward "!" (point-max) t) + (ltxbug-error) +;; else + (ltxbug-do-report)))) + + + +(defun ltxbug-do-report () + (erase-buffer) +;; +;; Grab the template produced by latexbug.tex + (insert-file "latexbug.msg") +;; +;; Change header to mention this latexbug.el file. + (goto-char (point-min)) + (re-search-forward "\\(by latexbug.\\)\\(tex\\)" (point-max) t) + (replace-match "\\1el") +;; +;; Grab email address into mail field. + (re-search-forward "Re.*email to \\(.*\\)[^Z]*=$" (point-max) t) +;; +;; Put the synopsis template into the Subject field. +;; Add the delimiter used by the mail-send function. + (goto-char (point-min)) + (let ((temp + (concat "To: " + (buffer-substring (match-beginning 1) (match-end 1)) " +Subject: < SYNOPSIS > +" + ltxbug-mail-headers + (if (not (equal "" ltxbug-mail-headers)) " +") + "--text follows this line-- +" ))) +;; +;; Remove the rest of the banner from latexbug.tex + (goto-char (point-min)) + (delete-region (match-beginning 0) (match-end 0)) +;; +;; insert the mail headers + (insert temp)) +;; +;; +;; Get the required category using minibuffer completion. + (set-buffer ltxbug-help) + (erase-buffer) + (insert " +Several categories of files are supported, +corresponding to directories in the standard LaTeX distribution: + + latex: The `base' format, and standard classes only (base). + tools: Packages supported by the LaTeX3 project team (tools). + graphics: The color and graphics packages (graphics). + mfnfss: Packages for using some MetaFont fonts (mfnfss). + psnfss: Packages for using PostScript fonts LaTeX (psnfss). + amslatex: AMS supported Classes and Packages (amsfonts and amslatex). + babel: Packages supporting many different languages (babel). + expl3: Experimental packages for TeX programmers (expl3). + cyrillic: Packages for using Cyrillic fonts (cyrillic). +") + (let* ((completion-ignore-case t) + (cat (completing-read "Which Category ? " + ltxbug-categories nil t ))) + (set-buffer "*latex-bugs*") + (ltxbug-replace "< CATEGORY >" (if (equal cat "") "latex" cat))) +;; +;; Get the synopsis, make sure it is non empty, and not too long. + (set-buffer ltxbug-help) + (erase-buffer) + (insert " + Please enter a One line Synopsis of the report. + This should be < 50 characters. + + This text will be used as the mail header on all + subsequent correspondence. Please use informative strings. + For example: \\mathit generates error in foobar environmenent + rather than just `LaTeX Bug' or similar strings. +") + (set-buffer ltxbug-msg) + (let ((syn (read-from-minibuffer "Synopsis ? " ))) + (while (or (equal syn "") (> (length syn) 50)) + (setq syn + (read-from-minibuffer "Synopsis (0 < length < 50) ? " syn))) + (set-buffer "*latex-bugs*") + (ltxbug-replace "< SYNOPSIS >" syn)) +;; +;; If latexbug.cfg has not already defined the name +;; grab it from minibuffer + (goto-char (point-min)) + (if (re-search-forward "< ENTER YOUR NAME >" (point-max) t) + (if ltxbug-name + (ltxbug-replace "< ENTER YOUR NAME >" ltxbug-name) +;; else + (set-buffer ltxbug-help) + (erase-buffer) + (insert " + Please enter Your Name +") + (set-buffer ltxbug-msg) + (let ((temp (read-from-minibuffer "Your Name ? " user-full-name))) + (set-buffer "*latex-bugs*") + (ltxbug-replace "< ENTER YOUR NAME >" temp)))) +;; +;; If latexbug.cfg has not already defined the email address +;; grab it from minibuffer + (goto-char (point-min)) + (if (re-search-forward "< ENTER YOUR EMAIL ADDRESS >" (point-max) t) + (if ltxbug-address + (ltxbug-replace "< ENTER YOUR EMAIL ADDRESS >" ltxbug-address) +;; else + (set-buffer ltxbug-help) + (erase-buffer) + (insert " + Please enter Your email address. +") + (set-buffer ltxbug-msg) + (let ((temp (read-from-minibuffer "Your email address ? " + user-mail-address))) + (set-buffer "*latex-bugs*") + (ltxbug-replace "< ENTER YOUR EMAIL ADDRESS >" temp)))) +;; +;; Grab file name. +;; If this is empty, suggest changing the >Class + (set-buffer ltxbug-help) + (erase-buffer) + (insert " +A bug report should be accompanied by a test file +and a the log that the test generates. + +If a test file is not appropriate for this report +Just hit + +Otherwise please specify the file to include. +") + (set-buffer ltxbug-msg) + (let ((temp (read-file-name "Test file ? " nil "" t))) + (if (equal temp "") + (progn + (ltxbug-update-field + "Class" + '(("sw-bug")("doc-bug")("change-request")) + " +You have not offered a test file. + +Perhaps that this is not a bug report. +The default class for messages is sw-bug. + +Possible classes of messages are: + sw-bug: Message reporting a Bug in the software. + doc-bug: Message reporting an error in the documentation. + change-request: Message requesting a change to some LaTeX feature.") + (re-search-forward ">How-to-repeat") + (delete-region (match-beginning 0) (point-max))) +;; else + (set-buffer ltxbug-msg) + (ltxbug-replace " < TEST FILE HERE " "") + (insert-file temp) + (let ((lines 0)) + (while (re-search-forward "\n" (mark) t) + (setq lines (+ lines 1))) + (if (> lines 60) + (progn + (set-buffer ltxbug-help) + (erase-buffer) + (insert +(format "%s%d%s" " +!!!! +Your test file is " lines " lines long!!! + +Test files should be as short as possible, while still showing +the behaviour. Please try to keep the file below 60 lines. +")) + (set-buffer ltxbug-msg)))) + (let* ((log1 + (concat + (substring temp 0 (string-match "\\.[^\\.]*$" temp)) + ".log")) + (log (read-file-name "Log file ? " "" log1 t log1))) + (if (equal log "") + (message "WHY NO LOG ???") + (ltxbug-replace " < LOG FROM TEST FILE HERE >" "") + (insert-file log))))) +;; +;; Prompt for the message text. + (set-buffer ltxbug-help) + (erase-buffer) + (insert " +Complete your bug report by giving the full descripition +below the `Description of bug:' header. + +There are other database fields you may wish to add, +type C-c C-f to change or add an additional field. + +Once the report is complete, type C-c C-c to send the message. + +A saved copy of the report will be in the file +latexbug.msg. +") + (switch-to-buffer ltxbug-msg) + (ltxbug-replace " < ENTER BUG REPORT HERE >" "") + (auto-fill-mode 1) + (setq fill-column 72)) + + +(defun ltxbug-error () + (set-buffer ltxbug-help) + (erase-buffer) + (insert " +LaTeX did not succesfully produce a bug report template.")) + +(defun ltxbug-save-and-send () + (interactive) + (write-file "latexbug.msg") + (mail-send-and-exit nil)) + + +(defun ltxbug-replace (a b) + "Replace the regexp a by the string b everywhere in the current buffer" + (goto-char (point-min)) + (while (re-search-forward a (point-max) t) + (replace-match b t t))) + +(defvar ltxbug-map (make-sparse-keymap) + "Local keymap used in LaTeX bug buffer.") + +(define-key ltxbug-map "\C-c\C-c" 'ltxbug-save-and-send) +(define-key ltxbug-map "\C-c\C-f" 'ltxbug-oneline-field) + + +(defun ltxbug-update-field (field values help) +"Update FIELD using completion list VALUES and help text HELP. + First entry in VALUES is the default." + (interactive) + (set-buffer ltxbug-help) + (erase-buffer) + (insert help) + (goto-char (point-min)) + (set-buffer ltxbug-msg) + (goto-char (point-min)) + (let ((temp "")) + (if (re-search-forward + (concat"\n>" field ":\\( *\\)\\(.*\\)$") (point-max) t) +;; if field already there + (progn + (setq temp (buffer-substring (match-beginning 2) (match-end 2))) + (delete-region (match-beginning 1) (match-end 2))) +;; else + (re-search-forward ">Category:.*$") + (insert (concat "\n>" field ":"))) + (insert " ") + (let ((temp2 + (completing-read (concat field " ? ") values nil t temp))) + (insert (if (equal temp2 "") + (car(car values)) temp2))))) + + +(defun ltxbug-responsible () + (interactive) + (ltxbug-update-field + "Responsible" +;; Alphabetical order, which makes Alan the default... + '(("alan")("chris")("david")("frank")("johannes") + ("michael")("rainer")) +" + You may set the >Responsible field to a particular person. + **Do not do this unless you have very good reason.** + We may not appreciate having jobs allocated to us in this way:-) + The possible values are: + alan (Alan Jeffrey) + chris (Chris Rowley) + david (David Carlisle) + frank (Frank Mittelbach) + johannes (Johannes Braams) + michael (Michael Downes) + rainer (Rainer Schoepf) +")) + +(defun ltxbug-confidential () + (interactive) + (ltxbug-update-field + "Confidential" + '(("no")("yes")) +" + You may set the >Confidential field to yes. + + The report database is publicly searchable. + See bugs.txt for details. + Reports marked Confidential will not be made public. + Possible values: + no The default. Report may be made public. + yes Report should only be seen by LaTeX maintainers. +")) + + +(defun ltxbug-priority () + (interactive) + (ltxbug-update-field + "Priority" + '(("low")("medium")("high")) +" + Change the priority of the report from `high' + Possible values: + low + medium + high +")) + +(defun ltxbug-severity () + (interactive) + (ltxbug-update-field + "Severity" + '(("non-critical")("serious")("critical")) +" + Classify the severity of the problem.' + Possible values: + non-critical + serious + critical +")) + +(defun ltxbug-class () + (interactive) + (ltxbug-update-field + "Class" + '(("sw-bug")("doc-bug")("change-request")) +" + Classify the type of report. + Possible values: + sw-bug: Message reporting a bug in the software. + doc-bug: Message reporting an error in the documentation. + change-request: Message requesting a change to some LaTeX feature. +")) + +(defun ltxbug-window-setup () + (interactive) + (delete-other-windows) + (split-window-vertically -13) + (switch-to-buffer-other-window ltxbug-help)) + +(defun ltxbug-oneline-field () + (interactive) + (ltxbug-window-setup) + (erase-buffer) + (insert " + You may wish to add or alter the following fields: + Class Class of this report. + Confidential Confidential (or not). + Responsible Assign to a member of the LaTeX maintenance team + Severity Severity of the bug. + Priority Priority of the report. +") + (set-buffer ltxbug-msg) + (let* ((completion-ignore-case t) + (field (completing-read "Which field ? " + '(("Class")("Confidential")("Priority")("Severity") + ("Responsible")) + nil t))) + (cond + ((equal field "Class") (ltxbug-class)) + ((equal field "Confidential") (ltxbug-confidential)) + ((equal field "Responsible") (ltxbug-responsible)) + ((equal field "Severity") (ltxbug-severity)) + ((equal field "Priority") (ltxbug-priority))))) diff --git a/Master/texmf-dist/source/latex/base/latexsym.dtx b/Master/texmf-dist/source/latex/base/latexsym.dtx new file mode 100644 index 00000000000..4072447c3b4 --- /dev/null +++ b/Master/texmf-dist/source/latex/base/latexsym.dtx @@ -0,0 +1,218 @@ +% \iffalse meta-comment +% +% Copyright 1993 1994 1995 1996 1997 1998 1999 2000 2001 2002 2003 2004 +% The LaTeX3 Project and any individual authors listed elsewhere +% in this file. +% +% This file is part of the LaTeX base system. +% ------------------------------------------- +% +% It may be distributed and/or modified under the +% conditions of the LaTeX Project Public License, either version 1.3 +% of this license or (at your option) any later version. +% The latest version of this license is in +% http://www.latex-project.org/lppl.txt +% and version 1.3 or later is part of all distributions of LaTeX +% version 2003/12/01 or later. +% +% This file has the LPPL maintenance status "maintained". +% +% The list of all files belonging to the LaTeX base distribution is +% given in the file `manifest.txt'. See also `legal.txt' for additional +% information. +% +% The list of derived (unpacked) files belonging to the distribution +% and covered by LPPL is defined by the unpacking scripts (with +% extension .ins) which are part of the distribution. +% +% \fi +% +% \CheckSum{82} +% +% \iffalse % this is a METACOMMENT ! +% +% File `latexsym.dtx'. +% Copyright 1994-1998 by Frank Mittelbach. All rights reserved. +% +%\NeedsTeXFormat{LaTeX2e} +%\ProvidesPackage{latexsym} +%\ProvidesFile{ulasy.fd} +%<-driver> [1998/08/17 v2.2e +% Standard LaTeX package (lasy symbols)] +% LaTeX symbol font definitions] +% +%<*driver> +\documentclass{ltxdoc} +\usepackage{latexsym} +\GetFileInfo{latexsym.sty} +\providecommand\dst{\expandafter{\normalfont\scshape docstrip}} +\title{The \LaTeX{} symbol fonts for use with + \LaTeXe.\thanks{This file has version + number \fileversion, dated \filedate.}} +\date{\filedate} +\author{Frank Mittelbach} +\begin{document} +\maketitle + \DocInput{latexsym.dtx} +\end{document} +% +% \fi +% +% \changes{v2.2e}{1998/08/17}{Documentation fixes.} +% +% \section{Introduction} +% +% This file defines the package |latexsym| which makes the few +% additional characters available that come from the |lasy| fonts +% (\LaTeX's symbol fonts). These fonts are not automatically +% included in the NFSS2/\LaTeXe{} since they take up important +% space and aren't necessary if one makes use of the packages +% \texttt{amsfonts} or \texttt{amssymb}. +% +% The commands defined by the \texttt{latexsym} package are: +% \begin{quote}\raggedright +% |\mho|~$\mho$ \quad +% |\Join|~$\Join$ \quad +% |\Box|~$\Box$ \quad +% |\Diamond|~$\Diamond$ \quad +% |\leadsto|~$\leadsto$ \quad +% |\sqsubset|~$\sqsubset$ \quad +% |\sqsupset|~$\sqsupset$ \quad +% |\lhd|~$\lhd$ \quad +% |\unlhd|~$\unlhd$ \quad +% |\rhd|~$\rhd$ \quad +% |\unrhd|~$\unrhd$ +% \end{quote} +% +% \StopEventually{} +% +% \section{The \dst{} modules} +% +% The following modules are used in the implementation to direct +% \dst{} in generating the external files: +% \begin{center} +% \begin{tabular}{ll} +% driver & produce a documentation driver file \\ +% package & produce a package file \\ +% fd & produce a font definition file +% \end{tabular} +% \end{center} +% +% +% \section{The Implementation} +% +% The individual files generated from this code are identified at the +% very top of this file by a couple of lines looking like this: +% \begin{verbatim} +% %\ProvidesFile{Ulasy.fd} +% %<-driver> [????/??/?? v2.2? +% % Standard LaTeX package (lasy symbols)] +% % LaTeX symbol font definitions] +%\end{verbatim} +% +% \begin{macrocode} +%<*package> +% \end{macrocode} +% +% \begin{macro}{\symlasy} +% +% It is possible to detect whether or not the \LaTeX{} symbols are +% already defined by checking for the math group number with the +% name |\symlasy|. +% +% In that case we exit but write a message to the transcript file. +% \begin{macrocode} +\ifx\symlasy\undefined \else + \wlog{Package latexsym: nothing to set up^^J}% + \endinput \fi +% \end{macrocode} +% Otherwise we define the new symbol font. +% \begin{macrocode} + \DeclareSymbolFont{lasy}{U}{lasy}{m}{n} + \SetSymbolFont{lasy}{bold}{U}{lasy}{b}{n} +% \end{macrocode} +% \end{macro} +% +% +% Because the lasy symbols are made an error in the format we have +% to undefine them before we can set them anew with +% |\DeclareMathSymbol|. +% \begin{macrocode} + \let\mho\undefined \let\sqsupset\undefined + \let\Join\undefined \let\lhd\undefined + \let\Box\undefined \let\unlhd\undefined + \let\Diamond\undefined \let\rhd\undefined + \let\leadsto\undefined \let\unrhd\undefined + \let\sqsubset\undefined +% \end{macrocode} +% \changes{v2.2a}{1995/03/18}{\cs{lhd} and friends should be bin ops.} +% \begin{macrocode} + \DeclareMathSymbol\mho {\mathord}{lasy}{"30} + \DeclareMathSymbol\Join {\mathrel}{lasy}{"31} + \DeclareMathSymbol\Box {\mathord}{lasy}{"32} + \DeclareMathSymbol\Diamond {\mathord}{lasy}{"33} + \DeclareMathSymbol\leadsto {\mathrel}{lasy}{"3B} + \DeclareMathSymbol\sqsubset{\mathrel}{lasy}{"3C} + \DeclareMathSymbol\sqsupset{\mathrel}{lasy}{"3D} + \DeclareMathSymbol\lhd {\mathbin}{lasy}{"01} + \DeclareMathSymbol\unlhd {\mathbin}{lasy}{"02} + \DeclareMathSymbol\rhd {\mathbin}{lasy}{"03} + \DeclareMathSymbol\unrhd {\mathbin}{lasy}{"04} +% \end{macrocode} +% To save some space we can remove the definition of |\not@base| +% since it isn't any longer needed. (We use |\@undefined| so that +% gives an error and not a recursive definition +% if it is still used somewhere.) +% \changes{v2.2b}{1995/07/03}{Free space for \cs{not@base}} +% \begin{macrocode} + \let\not@base\@undefined +% +% \end{macrocode} +% +% \subsection{\LaTeX{} symbols fonts} +% +% \changes{v2.2d}{1996/11/20}{lowercase ulasy.fd /1044} +% The rest of this file defines the the font shape declarations +% that have to go into the corresponding |.fd| file. +% +% \begin{macrocode} +%<*fd> +\DeclareFontFamily{U}{lasy}{} +\DeclareFontShape{U}{lasy}{m}{n}{ <5> <6> <7> <8> <9> gen * lasy + <10> <10.95> <12> <14.4> <17.28> <20.74> <24.88>lasy10 }{} +% \end{macrocode} +% Since there are no bold lasy symbols below 10pt we silently +% substitute them by the medium ones to avoid terminal warnings if +% |\boldmath| is selected. +% \begin{macrocode} +\DeclareFontShape{U}{lasy}{b}{n}{ <-10> ssub * lasy/m/n + <10> <10.95> <12> <14.4> <17.28> <20.74> <24.88>lasyb10 }{} +% +% \end{macrocode} +% +% The next line goes into all files and in addition prevents \dst{} +% from adding any further code from the main source file (such as a +% character table). +% \begin{macrocode} +\endinput +% \end{macrocode} +% +% \DeleteShortVerb{\|} +% \Finale +% +% +%% \CharacterTable +%% {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 +%% 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 +%% Digits \0\1\2\3\4\5\6\7\8\9 +%% Exclamation \! Double quote \" Hash (number) \# +%% Dollar \$ Percent \% Ampersand \& +%% Acute accent \' Left paren \( Right paren \) +%% Asterisk \* Plus \+ Comma \, +%% Minus \- Point \. Solidus \/ +%% Colon \: Semicolon \; Less than \< +%% Equals \= Greater than \> Question mark \? +%% Commercial at \@ Left bracket \[ Backslash \\ +%% Right bracket \] Circumflex \^ Underscore \_ +%% Grave accent \` Left brace \{ Vertical bar \| +%% Right brace \} Tilde \~} diff --git a/Master/texmf-dist/source/latex/base/latexsym.ins b/Master/texmf-dist/source/latex/base/latexsym.ins new file mode 100644 index 00000000000..671202d7a7e --- /dev/null +++ b/Master/texmf-dist/source/latex/base/latexsym.ins @@ -0,0 +1,141 @@ +%% +%% This file will generate fast loadable files and documentation +%% driver files from the doc files in this package when run through +%% LaTeX or TeX. +%% +%% Copyright 1993 1994 1995 1996 1997 1998 1999 2000 2001 2002 2003 2004 +%% The LaTeX3 Project and any individual authors listed elsewhere +%% in this file. +%% +%% This file is part of the LaTeX base system. +%% ------------------------------------------- +%% +%% It may be distributed and/or modified under the +%% conditions of the LaTeX Project Public License, either version 1.3 +%% of this license or (at your option) any later version. +%% The latest version of this license is in +%% http://www.latex-project.org/lppl.txt +%% and version 1.3 or later is part of all distributions of LaTeX +%% version 2003/12/01 or later. +%% +%% This file has the LPPL maintenance status "maintained". +%% +%% In particular, NO PERMISSION is granted to modify the contents of this +%% file since it contains the legal notices that are placed in the files +%% it generates. +%% +%% The list of all files belonging to the LaTeX base distribution is +%% given in the file `manifest.txt'. See also `legal.txt' for additional +%% information. +%% +%% +%% +%% +%% --------------- start of docstrip commands ------------------ +%% + +\input docstrip + +\preamble + +This is a generated file. + +Copyright 1993 1994 1995 1996 1997 1998 1999 2000 2001 2002 2003 2004 +The LaTeX3 Project and any individual authors listed elsewhere +in this file. + +This file was generated from file(s) of the LaTeX base system. +-------------------------------------------------------------- + +It may be distributed and/or modified under the +conditions of the LaTeX Project Public License, either version 1.3 +of this license or (at your option) any later version. +The latest version of this license is in + http://www.latex-project.org/lppl.txt +and version 1.3 or later is part of all distributions of LaTeX +version 2003/12/01 or later. + +This file has the LPPL maintenance status "maintained". + +This file may only be distributed together with a copy of the LaTeX +base system. You may however distribute the LaTeX base system without +such generated files. + +The list of all files belonging to the LaTeX base distribution is +given in the file `manifest.txt'. See also `legal.txt' for additional +information. + +The list of derived (unpacked) files belonging to the distribution +and covered by LPPL is defined by the unpacking scripts (with +extension .ins) which are part of the distribution. +\endpreamble + +\declarepreamble\fdpreamble + +This is a generated file. + +Copyright 1993 1994 1995 1996 1997 1998 1999 2000 2001 2002 2003 2004 +The LaTeX3 Project and any individual authors listed elsewhere +in this file. + +This file was generated from file(s) of the LaTeX base system. +-------------------------------------------------------------- + +It may be distributed and/or modified under the +conditions of the LaTeX Project Public License, either version 1.3 +of this license or (at your option) any later version. +The latest version of this license is in + http://www.latex-project.org/lppl.txt +and version 1.3 or later is part of all distributions of LaTeX +version 2003/12/01 or later. + +This file may only be distributed together with a copy of the LaTeX +base system. You may however distribute the LaTeX base system without +such generated files. + +The list of all files belonging to the LaTeX base distribution is +given in the file `manifest.txt'. See also `legal.txt' for additional +information. + +In particular, permission is granted to customize the declarations in +this file to serve the needs of your installation. + +However, NO PERMISSION is granted to distribute a modified version +of this file under its original name. + +\endpreamble + +\keepsilent +\usedir{tex/latex/base} + +\generate{ + \file{latexsym.sty}{% + \from{latexsym.dtx}{package}} + \usepreamble\fdpreamble + \file{ulasy.fd}{ + \from{latexsym.dtx}{fd}} + } + + +\ifToplevel{ +\Msg{***********************************************************} +\Msg{*} +\Msg{* To finish the installation you have to move the following} +\Msg{* files into a directory searched by TeX:} +\Msg{*} +\Msg{* \space\space latexsym.sty} +\Msg{* \space\space *.fd} +\Msg{*} +\Msg{* To produce the documentation run the files ending with} +\Msg{* `.dtx' through LaTeX.} +\Msg{*} +\Msg{* Happy TeXing} +\Msg{***********************************************************} +} + +\endbatchfile + + + + + diff --git a/Master/texmf-dist/source/latex/base/letter.dtx b/Master/texmf-dist/source/latex/base/letter.dtx new file mode 100644 index 00000000000..89e8579ecb3 --- /dev/null +++ b/Master/texmf-dist/source/latex/base/letter.dtx @@ -0,0 +1,1918 @@ +% \iffalse meta-comment +% +% Copyright 1993 1994 1995 1996 1997 1998 1999 2000 2001 2002 2003 2004 +% The LaTeX3 Project and any individual authors listed elsewhere +% in this file. +% +% This file is part of the LaTeX base system. +% ------------------------------------------- +% +% It may be distributed and/or modified under the +% conditions of the LaTeX Project Public License, either version 1.3 +% of this license or (at your option) any later version. +% The latest version of this license is in +% http://www.latex-project.org/lppl.txt +% and version 1.3 or later is part of all distributions of LaTeX +% version 2003/12/01 or later. +% +% This file has the LPPL maintenance status "maintained". +% +% The list of all files belonging to the LaTeX base distribution is +% given in the file `manifest.txt'. See also `legal.txt' for additional +% information. +% +% The list of derived (unpacked) files belonging to the distribution +% and covered by LPPL is defined by the unpacking scripts (with +% extension .ins) which are part of the distribution. +% +% \fi +% +% \CheckSum{980} +%% \CharacterTable +%% {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 +%% 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 +%% Digits \0\1\2\3\4\5\6\7\8\9 +%% Exclamation \! Double quote \" Hash (number) \# +%% Dollar \$ Percent \% Ampersand \& +%% Acute accent \' Left paren \( Right paren \) +%% Asterisk \* Plus \+ Comma \, +%% Minus \- Point \. Solidus \/ +%% Colon \: Semicolon \; Less than \< +%% Equals \= Greater than \> Question mark \? +%% Commercial at \@ Left bracket \[ Backslash \\ +%% Right bracket \] Circumflex \^ Underscore \_ +%% Grave accent \` Left brace \{ Vertical bar \| +%% Right brace \} Tilde \~} +% +% \iffalse +% \section{Identification} +% +% +% This document class can only be used with \LaTeXe, so we make +% sure that an appropriate message is displayed when another \TeX{} +% format is used. +% \begin{macrocode} +%<+letter>\NeedsTeXFormat{LaTeX2e}[1996/06/01] +% \end{macrocode} +% +% Announce the Class name and its version. +% \begin{macrocode} +%<+letter>\ProvidesClass{letter} +%<*driver> + \ProvidesFile{letter.drv} +% + [1999/04/29 v1.2z +%<+letter> Standard LaTeX document class] +% \end{macrocode} +% +% \section{The documentation driver file} +% +% We have our own document class to format the \LaTeXe{} +% documentation. +% \fi +% \changes{v1.0}{1993/12/07}{Use class ltxdoc document class} +% \iffalse +% \begin{macrocode} +%<*driver> +] +\documentclass{ltxdoc} +% \end{macrocode} +% +% We don't want everything to appear in the index. +% \begin{macrocode} +\DoNotIndex{\@Alph,\@alph,\@arabic,\@badmath} +\DoNotIndex{\@centercr} +\DoNotIndex{\@empty,\@ignoretrue} +\DoNotIndex{\@ixpt} +\DoNotIndex{\@M,\@minus,\@ne,\@plus} +\DoNotIndex{\\,\addtolength} +\DoNotIndex{\advance} +\DoNotIndex{\ast,\begin,\begingroup,\bfseries,\bgroup,\box} +\DoNotIndex{\bullet} +\DoNotIndex{\cdot,\cr,\day,\DeclareOption} +\DoNotIndex{\def,\DocInput,\documentclass} +\DoNotIndex{\DoNotIndex,\egroup,\ifx,\else,\fi,\endtrivlist} +\DoNotIndex{\EnableCrossrefs,\end,\end@dblfloat,\end@float,\endgroup} +\DoNotIndex{\endlist,\everycr,\ExecuteOptions} +\DoNotIndex{\filedate,\filename,\fileversion} +\DoNotIndex{\global,\halign,\hangindent,\hbox,\hfil,\hfill,\hrule} +\DoNotIndex{\hsize,\hskip,\hspace,\hss,\ifcase,\or,\fi} +\DoNotIndex{\ifvmode,\fi,\ifnum,\fi,\input} +\DoNotIndex{\kern,\leavevmode,\let,\leftmark} +\DoNotIndex{\list,\llap,\long,\m@ne,\m@th,\mark} +\DoNotIndex{\month,\newcommand,\newcounter,\newenvironment} +\DoNotIndex{\NeedsTeXFormat,\newdimen} +\DoNotIndex{\newpage,\nobreak,\noindent,\number} +\DoNotIndex{\p@} +\DoNotIndex{\pagestyle,\par} +\DoNotIndex{\penalty,\PrintChanges,\PrintIndex,\ProcessOptions} +\DoNotIndex{\protect,\ProvidesClass,\raggedbottom,\raggedright} +\DoNotIndex{\refstepcounter,\relax,\renewcommand,\reset@font} +\DoNotIndex{\rightmargin,\rlap,\rmfamily} +\DoNotIndex{\setbox,\setcounter,\setlength} +\DoNotIndex{\skip,\slshape,\space} +\DoNotIndex{\trivlist,\typeout,\tw@} +\DoNotIndex{\vskip,\vspace,\year,\z@} +% +\CodelineNumbered +\CodelineIndex +\EnableCrossrefs +\RecordChanges +% \end{macrocode} +% We use so many \file{docstrip} modules that we set the +% \texttt{StandardModuleDepth} counter to 1. +% \begin{macrocode} +\setcounter{StandardModuleDepth}{1} +% \end{macrocode} +% The following command retrieves the date and version information +% from the file. +% \begin{macrocode} +\GetFileInfo{letter.drv} +% \end{macrocode} +% Some commonly used abbreviations +% \begin{macrocode} +\newcommand*{\Lopt}[1]{\textsf {#1}} +\newcommand*{\file}[1]{\texttt {#1}} +\newcommand*{\Lcount}[1]{\textsl {\small#1}} +\newcommand*{\pstyle}[1]{\textsl {#1}} +% \end{macrocode} +% We also want the full details. +% \begin{macrocode} +\begin{document} +\DocInput{letter.dtx} +\PrintIndex +% ^^A\PrintChanges +\end{document} +% +% \end{macrocode} +% \fi +% +% \changes{v1.1}{1993/12/18}{Changes to make it work with +% compatibility mode.} +% \changes{v1.1a}{1993/12/19}{Removed float parms} +% +% \changes{v1.1c}{1994/01/17}{Moved definition of \cs{@textop} to +% initialization section, to counteract setting of \cs{@texttop} in +% \cs{raggedbottom}.} +% +% \changes{v1.1d}{1994/01/20}{Corrected margins: Now computed from +% \cs{paperwidth} and \cs{textwidth}, so that the text is +% horizontally centered.} +% \changes{v1.1e}{1994/02/03}{Corrected checksum} +% +% \changes{v1.2a}{1994/02/12}{Removed onecolumn and twocolumn options.} +% \changes{v1.2a}{1994/02/12}{Changed label producing commands in .aux +% file.} +% +% \changes{v1.2b}{1994/02/28}{Moved driver further up.} +% +% \changes{v1.2c}{1994/03/08}{Always write .aux file.} +% \changes{v1.2f}{1994/04/29}{Use LaTeX instead of LaTeX2e in messages} +% \changes{v1.2f}{1994/04/29}{Removed \cs{typeout} message} +% \changes{v1.2g}{1994/05/01}{Removed the use of \cs{fileversion} +% c.s.} +% \changes{v1.2j}{1994/06/01}{Corrected driver code.} +% \changes{v1.2k}{1994/06/17}{Various documentation enhancements} +% \changes{v1.2p}{1994/12/11}{Use \cs{newcommand*} to define +% user-level commands that take an argument} +% \changes{v1.2q}{1995/05/17}{cleaned up \cs{changes entries}} +% \changes{v1.2q}{1995/05/18}{replaced \cs{hbox to} by \cs{hb@xt@}} +% \changes{v1.2r}{1995/05/23}{removed a superfluous brace} +% +% \iffalse +% Copyright (C) 1994 LaTeX3 project, Frank Mittelbach +% and Rainer Sch\"opf, all rights reserved. +% \fi +% +% \author{Leslie Lamport and Frank Mittelbach and Rainer Sch\"opf} +% +% \title{Standard Letter Document Class for \LaTeX{} version 2e} +% +% +% \maketitle +% \tableofcontents +% +% \StopEventually +% +% +% \section{Initial Code} +% +% In this part we define a few commands that are used later on. +% +% \begin{macro}{\@ptsize} +% This control sequence is used to store the second digit of the +% pointsize we are typesetting in. So, normally, it's value is one +% of 0, 1 or 2. +% \begin{macrocode} +%<*letter> +\newcommand\@ptsize{} +% \end{macrocode} +% \end{macro} +% +% +% +% \subsection{Setting Paper Sizes} +% +% The variables |\paperwidth| and |\paperheight| should reflect the +% physical paper size after trimming. For desk printer output this +% is usually the real paper size since there is no post-processing. +% \changes{v1.0a}{1993/12/14}{Corrected typo, A4 is not 279 mm high} +% \begin{macrocode} +\DeclareOption{a4paper} + {\setlength\paperheight {297mm}% + \setlength\paperwidth {210mm}} +\DeclareOption{a5paper} + {\setlength\paperheight {210mm}% + \setlength\paperwidth {148mm}} +\DeclareOption{b5paper} + {\setlength\paperheight {250mm}% + \setlength\paperwidth {176mm}} +\DeclareOption{letterpaper} + {\setlength\paperheight {11in}% + \setlength\paperwidth {8.5in}} +\DeclareOption{legalpaper} + {\setlength\paperheight {14in}% + \setlength\paperwidth {8.5in}} +\DeclareOption{executivepaper} + {\setlength\paperheight {10.5in}% + \setlength\paperwidth {7.25in}} +% \end{macrocode} +% +% \changes{v1.2o}{1994/08/26}{Added the option \textsf{landscape}} +% The option \Lopt{landscape} switches the values of |\paperheight| +% and |\paperwidth|, assuming the dimensions were given for portrait +% paper. +% \begin{macrocode} +\DeclareOption{landscape} + {\setlength\@tempdima {\paperheight}% + \setlength\paperheight {\paperwidth}% + \setlength\paperwidth {\@tempdima}} +% \end{macrocode} +% +% \subsection{Choosing the type size} +% +% The type size options are handled by defining |\@ptsize| to +% contain the last digit of the size in question and branching on +% |\ifcase| statements. This is done for historical reasons to stay +% compatible with other packages that use the |\@ptsize| variable +% to select special actions. It makes the declarations of size +% options less than 10pt difficult, although one can probably use +% \texttt{9} and \texttt{8} assuming that a class wont define both +% \Lopt{8pt} and \Lopt{18pt} options. +% +% \begin{macrocode} +\DeclareOption{10pt}{\renewcommand\@ptsize{0}} +\DeclareOption{11pt}{\renewcommand\@ptsize{1}} +\DeclareOption{12pt}{\renewcommand\@ptsize{2}} +% \end{macrocode} +% +% +% \subsection{Two-side or one-side printing} +% +% Two-sided printing was not supported in the \LaTeX~2.09 version +% of this document class. +% \changes{v1.2e}{1994/04/28}{Added oneside option and twoside option +% in native mode} +% \begin{macrocode} +\if@compatibility + \DeclareOption{twoside}{\@latexerr{No `twoside' layout for letters}% + \@eha} +\else + \DeclareOption{twoside}{\@twosidetrue \@mparswitchtrue} +\fi +% \end{macrocode} +% +% +% \begin{macrocode} +\DeclareOption{oneside}{\@twosidefalse \@mparswitchfalse} +% \end{macrocode} +% +% \subsection{Draft option} +% +% If the user requests \Lopt{draft} we show any overfull boxes. +% We could probably add some more interesting stuff to this option. +% \begin{macrocode} +\DeclareOption{draft}{\setlength\overfullrule{5pt}} +\DeclareOption{final}{\setlength\overfullrule{0pt}} +% \end{macrocode} +% +% +% \subsection{Equation numbering on the left} +% +% The option \Lopt{leqno} can be used to get the equation numbers +% on the left side of the equation. +% \changes{v1.1c}{1994/01/17}{Option leqno now read from +% \file{leqno.clo}.} +% \begin{macrocode} +\DeclareOption{leqno}{\input{leqno.clo}} +% \end{macrocode} +% +% \subsection{Flush left displays} +% +% The option \Lopt{fleqn} redefines the displayed math environments +% in such a way that they come out flush left, with an indentation +% of |\mathindent| from the prevailing left margin. +% \changes{v1.1}{1993/12/18}{Corrected typo in \cs{renewcommand}, +% doubled hash marks.} +% \changes{v1.1c}{1994/01/17}{Option fleqn now read from +% \file{fleqn.clo}.} +% \begin{macrocode} +\DeclareOption{fleqn}{\input{fleqn.clo}} +% \end{macrocode} +% +% +% \section{Executing Options} +% +% Here we execute the default options to initialize certain +% variables. +% \changes{v1.2e}{1994/04/28}{Added execution of `oneside' option} +% \begin{macrocode} +\ExecuteOptions{letterpaper,10pt,oneside,onecolumn,final} +% \end{macrocode} +% +% The |\ProcessOptions| command causes the execution of the code +% for every option \Lopt{foo} which is declared and for which the +% user typed the \Lopt{foo} option in his |\documentclass| command. +% For every option \Lopt{bar} he typed, which is not declared, the +% option is assumed to be a global option. All options will be +% passed as document options to any |\usepackage| command in the +% document preamble. +% \begin{macrocode} +\ProcessOptions +% \end{macrocode} +% Now that all the options have been executed we can load the +% chosen class option file that contains all size dependant code. +% \begin{macrocode} +\input{size1\@ptsize.clo} +% \end{macrocode} +% +% +% \section{Loading Packages} +% +% The standard class files do not load additional packages. +% +% +% \section{Document Layout} +% \label{sec:maincode} +% +% In this section we are finally dealing with the nasty typographical +% details. +% +% \subsection{Paragraphing} +% +% \begin{macro}{\lineskip} +% \begin{macro}{\normallineskip} +% These parameters control \TeX's behavior when two lines tend to +% come too close together. +% \begin{macrocode} +\setlength\lineskip{1\p@} +\setlength\normallineskip{1\p@} +% \end{macrocode} +% \end{macro} +% \end{macro} +% +% \begin{macro}{\baselinestretch} +% This is used as a multiplier for |\baselineskip|. The default is +% to {\em not\/} stretch the baselines. +% \begin{macrocode} +\renewcommand\baselinestretch{} +% \end{macrocode} +% \end{macro} +% +% \begin{macro}{\parskip} +% \begin{macro}{\parindent} +% |\parskip| gives extra vertical space between paragraphs and +% |\parindent| is the width of the paragraph indentation. +% Letters are typeset without paragraph indentation. +% \begin{macrocode} +\setlength\parskip{0.7em} +\setlength\parindent{0\p@} +% \end{macrocode} +% \end{macro} +% \end{macro} +% +% \begin{macro}{\@lowpenalty} +% \begin{macro}{\@medpenalty} +% \begin{macro}{\@highpenalty} +% The commands |\nopagebreak| and |\nolinebreak| put in penalties +% to discourage these breaks at the point they are put in. +% They use |\@lowpenalty|, |\@medpenalty| or |\@highpenalty|, +% dependant on their argument. +% \begin{macrocode} +\@lowpenalty 51 +\@medpenalty 151 +\@highpenalty 301 +% \end{macrocode} +% \end{macro} +% \end{macro} +% \end{macro} +% +% \begin{macro}{\clubpenalty} +% \begin{macro}{\widowpenalty} +% These penalties are used to discourage club and widow lines. +% Because we use their default values we only show them here, +% commented out. +% \begin{macrocode} +% \clubpenalty 150 +% \widowpenalty 150 +% \end{macrocode} +% \end{macro} +% \end{macro} +% +% \begin{macro}{\displaywidowpenalty} +% \begin{macro}{\predisplaypenalty} +% \begin{macro}{\postdisplaypenalty} +% Discourage (but not so much) widows in front of a math display +% and forbid breaking directly in front of a display. Allow break +% after a display without a penalty. Again the default values are +% used, therefore we only show them here. +% \begin{macrocode} +% \displaywidowpenalty 50 +% \predisplaypenalty 10000 +% \postdisplaypenalty 0 +% \end{macrocode} +% \end{macro} +% \end{macro} +% \end{macro} +% +% \begin{macro}{\interlinepenalty} +% Allow the breaking of a page in the middle of a paragraph. +% \begin{macrocode} +% \interlinepenalty 0 +% \end{macrocode} +% \end{macro} +% +% +% \begin{macro}{\brokenpenalty} +% We allow the breaking of a page after a hyphenated line. +% \begin{macrocode} +% \brokenpenalty 0 +% \end{macrocode} +% \end{macro} +% +% +% \subsection{Page Layout} +% +% All margin dimensions are measured from a point one inch from the +% top and lefthand side of the page. +% +% \subsubsection{Vertical spacing} +% +% \begin{macro}{\headheight} +% \begin{macro}{\headsep} +% The |\headheight| is the height of the box that will contain the +% running head. The |\headsep| is the distance between the bottom +% of the running head and the top of the text. |\topskip| is the +% |\baselineskip| for the first line on a page, its value depends +% on the size option that was specified. Therefore it is +% initialized in one of the \file{size1x.clo} files. +% \begin{macrocode} +\setlength\headheight{12\p@} +\setlength\headsep {45\p@} +% \end{macrocode} +% \end{macro} +% \end{macro} +% +% \begin{macro}{\footskip} +% The distance from the baseline of the box which contains the +% running footer to the baseline of last line of text is controlled +% by the |\footskip|. +% Bottom of page: +% \begin{macrocode} +\setlength\footskip{25\p@} +% \end{macrocode} +% \end{macro} +% +% \changes{v1.2n}{1994/07/13}{Setting of \cs{maxdepth} and +% \cs{@maxdepth} already happens in the size.. files, removed +% here} +% +% \subsubsection{The dimension of text} +% +% \begin{macro}{\textwidth} +% When we are in compatibility mode we have to make sure that the +% dimensions of the printed area are not different from what the +% user was used to see. +% +% \changes{v1.2n}{1994/07/13}{Setting \cs{textwidth} to a fixed value +% should only happen in compatibility mode} +% \begin{macrocode} +\if@compatibility + \setlength\textwidth{365\p@} +% \end{macrocode} +% \end{macro} +% +% \begin{macro}{\textheight} +% Now that we have computed the width of the text, we have to take +% care of the height. The |\textheight| is the height of text +% (including footnotes and figures, excluding running head and +% foot). +% \changes{v1.2n}{1994/07/13}{Setting \cs{textheight} to a fixed value +% should only happen in compatibility mode} +% \begin{macrocode} + \setlength\textheight{505\p@} +\fi +% \end{macrocode} +% In native mode we use the dimensions as they were computed by one +% of the \Lopt{xxpt} options, together with one of the +% \Lopt{..paper} options. +% \end{macro} +% +% \subsubsection{Margins} +% +% \begin{macro}{\oddsidemargin} +% \begin{macro}{\evensidemargin} +% \begin{macro}{\marginparwidth} +% \changes{v1.1d}{1994/01/20}{Corrected margins: Now computed from +% \cs{paperwidth} and \cs{textwidth}.} The values of +% |\oddsidemargin| and |\evensidemargin| are computed from those of +% |\paperwidth| and |\textwidth|. +% \changes{v1.2n}{1994/07/13}{Added fixed values for these parameters +% in compatibillity mode} +% \begin{macrocode} +\if@compatibility + \setlength\oddsidemargin{53pt} + \setlength\evensidemargin{53pt} + \setlength\marginparwidth{90pt} +\else + \setlength\@tempdima{\paperwidth} + \addtolength\@tempdima{-2in} + \addtolength\@tempdima{-\textwidth} + \setlength\oddsidemargin {.5\@tempdima} + \setlength\evensidemargin {\oddsidemargin} + \setlength\marginparwidth {90\p@} +\fi +% \end{macrocode} +% \end{macro} +% \end{macro} +% \end{macro} +% +% \begin{macro}{\marginparsep} +% \begin{macro}{\marginparpush} +% The horizontal space between the main text and marginal notes is +% determined by |\marginparsep|, the minimum vertical separation +% between two marginal notes is controlled by |\marginparpush|. +% \begin{macrocode} +\setlength\marginparsep {11\p@} +\setlength\marginparpush{5\p@} +% \end{macrocode} +% \end{macro} +% \end{macro} +% +% \begin{macro}{\topmargin} +% The |\topmargin| is the distance between the top of `the +% printable area' --which is 1 inch below the top of the paper-- +% and the top of the box which contains the running head. +% +% It can now be computed from the values set above. +% \begin{macrocode} +\setlength\topmargin{27pt} +% \end{macrocode} +% \end{macro} +% +% +% \subsubsection{Footnotes} +% +% \begin{macro}{\footnotesep} +% |\footnotesep| is the height of the strut placed at the beginning +% of every footnote. It equals the height of a normal +% |\footnotesize| strut in this +% class, thus no extra space occurs between footnotes. +% \begin{macrocode} +\setlength\footnotesep{12\p@} +% \end{macrocode} +% \end{macro} +% +% \begin{macro}{\footins} +% |\skip\footins| is the space between the last line of the main +% text and the top of the first footnote. +% \begin{macrocode} +\setlength{\skip\footins}{10\p@ \@plus 2\p@ \@minus 4\p@} +% \end{macrocode} +% \end{macro} +% +% +% \subsection{Page Styles} +% +% The page style \pstyle{foo} is defined by defining the command +% |\ps@foo|. This command should make only local definitions. +% There should be no stray spaces in the definition, since they +% could lead to mysterious extra spaces in the output (well, that's +% something that should be always avoided). +% +% \begin{macro}{\@evenhead} +% \begin{macro}{\@oddhead} +% \begin{macro}{\@evenfoot} +% \begin{macro}{\@oddfoot} +% The |\ps@...| command defines the macros |\@oddhead|, +% |\@oddfoot|, |\@evenhead|, and |\@evenfoot| to define the running +% heads and feet---e.g., |\@oddhead| is the macro to produce the +% contents of the heading box for odd-numbered pages. It is called +% inside an |\hbox| of width |\textwidth|. +% \end{macro} +% \end{macro} +% \end{macro} +% \end{macro} +% +% \subsubsection{Marking conventions} +% +% To make headings determined by the sectioning commands, the page +% style defines the commands |\chaptermark|, |\sectionmark|, +% \ldots, where |\chaptermark{|\meta{text}|}| is called by +% |\chapter| to set a mark, and so on. +% +% The |\...mark| commands and the |\...head| macros are defined +% with the help of the following macros. (All the |\...mark| +% commands should be initialized to no-ops.) +% +% \LaTeX{} extends \TeX's |\mark| facility by producing two kinds +% of marks, a `left' and a `right' mark, using the following +% commands: +% \begin{flushleft} +% |\markboth{|\meta{left}|}{|\meta{right}|}|: Adds both marks. +% +% |\markright{|\meta{right}|}|: Adds a `right' mark. +% +% |\leftmark|: Used in the |\@oddhead|, |\@oddfoot|, |\@evenhead| +% or |\@evenfoot| macros, it gets the current `left' +% mark. |\leftmark| works like \TeX's |\botmark| +% command. +% +% |\rightmark|: Used in the |\@oddhead|, |\@oddfoot|, |\@evenhead| +% or |\@evenfoot| macros, it gets the current +% `right' mark. |\rightmark| works like \TeX's +% |\firstmark| command. +% \end{flushleft} +% +% The marking commands work reasonably well for right marks +% `numbered within' left marks--e.g., the left mark is changed by a +% |\chapter| command and the right mark is changed by a |\section| +% command. However, it does produce somewhat anomalous results if +% two |\markboth|'s occur on the same page. +% +% +% Commands like |\tableofcontents| that should set the marks in some +% page styles use a |\@mkboth| command, which is |\let| by the +% pagestyle command (|\ps@...|) to |\markboth| for setting the +% heading or to |\@gobbletwo| to do nothing. +% +% +% \subsubsection{Defining the page styles} +% \label{sec:pagestyle} +% +% The pagestyles \pstyle{empty} and \pstyle{plain} are defined in +% the \LaTeX{} kernel (\file{ltpage.dtx}), but these definitions +% are changed to a simpler version for this document class. +% +% \begin{macro}{\ps@headings} +% The definition of the page style \pstyle{headings} has to be +% different for two sided printing than it is for one sided +% printing. +% +% \changes{v1.2e}{1994/04/28}{Added twoside support} +% \begin{macrocode} +\if@twoside + \def\ps@headings{% +% \end{macrocode} +% The running feet are empty in this page style. +% \begin{macrocode} + \let\@oddfoot\@empty\let\@evenfoot\@empty +% \end{macrocode} +% The running head contains some information about this letter. The +% head is the same for even and odd pages. +% \changes{v1.2i}{1994/05/12}{Made running heads the same on odd and +% even pages} +% \changes{v1.2k}{1994/06/17}{Added a missing brace} +% \begin{macrocode} + \def\@oddhead{\slshape\headtoname{} \ignorespaces\toname + \hfil \@date + \hfil \pagename{} \thepage}% + \let\@evenhead\@oddhead} +% \end{macrocode} +% For one sided printing we don't need to define |\@evenhead| so +% the definition is somewhat simpler. +% \begin{macrocode} +\else + \def\ps@headings{% + \let\@oddfoot\@empty + \def\@oddhead{\slshape\headtoname{} \ignorespaces\toname + \hfil \@date + \hfil \pagename{} \thepage}} +\fi +% \end{macrocode} +% \end{macro} +% +% +% \begin{macro}{\ps@empty} +% The definition of the page style \pstyle{empty} is simple: +% No running head or foot at all. +% \changes{v1.2e}{1994/04/28}{Also make even feet and head empty} +% \begin{macrocode} +\def\ps@empty{% + \let\@oddfoot\@empty\let\@oddhead\@empty + \let\@evenfoot\@empty\let\@evenhead\@empty} +% \end{macrocode} +% \end{macro} +% +% \begin{macro}{\ps@firstpage} +% The page style \pstyle{firstpage} puts the telephone number +% in the proper place for the letterhead. It should be adapted +% to site conventions. The size of the number is determined +% depending on the main size. +% \begin{macrocode} +\def\ps@firstpage{% + \let\@oddhead\@empty + \def\@oddfoot{\raisebox{-45\p@}[\z@]{% + \hb@xt@\textwidth{\hspace*{100\p@}% + \ifcase \@ptsize\relax + \normalsize + \or + \small + \or + \footnotesize + \fi + \fromlocation \hfill \telephonenum}}\hss}} +% \end{macrocode} +% \end{macro} +% +% \begin{macro}{\ps@plain} +% The definition of the page style \pstyle{plain} is again simple. +% \changes{v1.2e}{1994/04/28}{Added definition of \cs{@evenfoot} +% because of twoside option} +% \changes{v1.2s}{1995/05/25}{replace \cs{rmfamily} with +% \cs{normalfont} (PR 1578)} +% \begin{macrocode} +\def\ps@plain{% + \let\@oddhead\@empty + \def\@oddfoot{\normalfont\hfil\thepage\hfil}% + \def\@evenfoot{\normalfont\hfil\thepage\hfil}} +% \end{macrocode} +% \end{macro} +% +% +% +% \section{Document Markup} +% +% \subsection{Global Declarations} +% +% \begin{macro}{\name} +% \begin{macro}{\signature} +% \begin{macro}{\address} +% \begin{macro}{\location} +% \begin{macro}{\telephone} +% The following declarations, shown with examples, give information +% about the sender: +% \begin{itemize} +% \item |\name{Dr. L. User}| : to be used for the return address on +% the envelope. +% \begin{macrocode} +\newcommand*{\name}[1]{\def\fromname{#1}} +% \end{macrocode} +% \item |\signature{Larry User}| : goes after the closing. +% \begin{macrocode} +\newcommand*{\signature}[1]{\def\fromsig{#1}} +% \end{macrocode} +% \item |\address{3245 Foo St.\\Gnu York}| : used as the return +% address in the +% letter and on the envelope. If not declared, then an +% institutional standard address is used. +% \begin{macrocode} +\newcommand*{\address}[1]{\def\fromaddress{#1}} +% \end{macrocode} +% \item |\location{Room 374}| : Acts as modifier to the standard +% institutional address. +% \begin{macrocode} +\newcommand*{\location}[1]{\def\fromlocation{#1}} +% \end{macrocode} +% \item |\telephone{(415)123-4567}| : Just in case some style puts it +% on the letter. +% \changes{v1.2m}{1994/06/23}{Removed typo (\#[] instead of [1])} +% \begin{macrocode} +\newcommand*{\telephone}[1]{\def\telephonenum{#1}} +% \end{macrocode} +% \end{itemize} +% \end{macro} +% \end{macro} +% \end{macro} +% \end{macro} +% \end{macro} +% +% \begin{macro}{\fromname} +% \begin{macro}{\fromsig} +% \begin{macro}{\fromaddress} +% \begin{macro}{\fromlocation} +% \begin{macro}{\telephonenum} +% We make sure that the internal control sequences that are used to +% store the information exist and are empty. +% \begin{macrocode} +\name{} +\signature{} +\address{} +\location{} +\telephone{} +% \end{macrocode} +% \end{macro} +% \end{macro} +% \end{macro} +% \end{macro} +% \end{macro} +% +% \begin{macro}{\makelabels} +% The |\makelabels| declaration causes mailing labels to be made. +% \begin{macrocode} +\newcommand*{\makelabels}{% +% \end{macrocode} +% At the beginning of the document, we need to activate the +% |\@mlabel| and |\@startlabels| commands, as well as write +% |\@startlabels| to the |.aux| file. +% \begin{macrocode} + \AtBeginDocument{% + \let\@startlabels\startlabels + \let\@mlabel\mlabel + \if@filesw + \immediate\write\@mainaux{\string\@startlabels}\fi}% +% \end{macrocode} +% At the end of the document we need to write |\clearpage| to the +% |.aux| file. +% \begin{macrocode} + \AtEndDocument{% + \if@filesw\immediate\write\@mainaux{\string\clearpage}\fi}} +% \end{macrocode} +% |\makelabels| is allowed only before the |\begin{document}| +% command. +% \begin{macrocode} +\@onlypreamble\makelabels +% \end{macrocode} +% \end{macro} +% +% \subsection{The generic letter commands} +% +% \begin{environment}{letter} +% The letter environment creates a new letter, starting from page +% $1$, with footnotes starting from $1$ as well. +% (The first page is unnumbered.) It has a single argument, which +% is the addressee and his address, as in +%\begin{verbatim} +% \begin{letter}{Sam Jones \\ +% Institute for Retarded Study\\ +% Princeton, N.J.} +%\end{verbatim} +% Local declarations, such as |\address|, can follow the +% |\begin{letter}|. +% \changes{v1.2e}{1994/04/28}{When printing twosided a new letter +% shouldn't start on the back of the previous one. Added insertion +% of a blank page when necessary.} +% \changes{v1.2z}{1999/04/29}{Reset footnote counter to 0, (PR 2957).} +% \begin{macrocode} +\newenvironment{letter}[1] + {\newpage + \if@twoside \ifodd\c@page + \else\thispagestyle{empty}\null\newpage\fi + \fi + \c@page \@ne + \c@footnote \z@ + \interlinepenalty=200 % smaller than the TeXbook value +% \end{macrocode} +% The |\leavevmode| and |\ignorespaces| commands are there for +% protecting against an empty argument. +% \begin{macrocode} + \@processto{\leavevmode\ignorespaces #1}} +% \end{macrocode} +% The end of the environment possibly writes the address +% information on the \file{.aux} file. +% \changes{v1.2p}{1994/12/11}{No longer redefine \cs{protect} but use +% one of the available settings} +% \begin{macrocode} + {\stopletter\@@par\pagebreak\@@par + \if@filesw + \begingroup + \let\\=\relax + \let\protect\@unexpandable@protect + \immediate\write\@auxout{% + \string\@mlabel{\returnaddress}{\toname\\\toaddress}}% + \endgroup + \fi} +% \end{macrocode} +% \end{environment} +% +% +% \begin{macro}{\@processto} +% \begin{macro}{\@xproc} +% \begin{macro}{\@yproc} +% |\@processto| gets the |\toname| and |\toaddress| from the letter +% environment's macro argument. |\@xproc| and |\@yproc| are auxiliary +% macros. +% \begin{macrocode} +\long\def\@processto#1{% + \@xproc #1\\@@@% + \ifx\toaddress\@empty + \else + \@yproc #1@@@% + \fi} +% \end{macrocode} +% +% \begin{macrocode} +\long\def\@xproc #1\\#2@@@{\def\toname{#1}\def\toaddress{#2}} +% \end{macrocode} +% +% \begin{macrocode} +\long\def\@yproc #1\\#2@@@{\def\toaddress{#2}} +% \end{macrocode} +% \end{macro} +% \end{macro} +% \end{macro} +% +% +% \subsubsection{Page breaking control} +% +% \begin{macro}{\stopbreaks} +% When the command |\stopbreaks| is issued no page breaks should +% occur until |\startbreaks| is called. +% \begin{macrocode} +\newcommand*{\stopbreaks}{% + \interlinepenalty\@M + \def\par{\@@par\nobreak}% + \let\\\@nobreakcr + \let\vspace\@nobreakvspace} +% \end{macrocode} +% \end{macro} +% +% \begin{macro}{\nobreakvspace} +% \changes{v1.2t}{1996/01/20}{Made robust pr/2049} +% \begin{macro}{\@nobreakvspacex} +% \begin{macro}{\@nobreakcr} +% These are needed by |\stopbreaks| +% \begin{macrocode} +\DeclareRobustCommand\@nobreakvspace + {\@ifstar\@nobreakvspacex\@nobreakvspacex} +% \end{macrocode} +% +% \begin{macrocode} +\def\@nobreakvspacex#1{% + \ifvmode + \nobreak\vskip #1\relax + \else + \@bsphack\vadjust{\nobreak\vskip #1}\@esphack + \fi} +% \end{macrocode} +% +% \changes{v1.2w}{1997/01/07} +% {Simplify definition, for ltspace 1.2u. /2341} +% \begin{macrocode} +\def\@nobreakcr{\@ifstar{\@normalcr*}{\@normalcr*}} +% \end{macrocode} +% \end{macro} +% \end{macro} +% \end{macro} +% +% \begin{macro}{\startbreaks} +% This cancels the effect of |\stopbreaks|. +% \begin{macrocode} +\newcommand*{\startbreaks}{% + \let\\\@normalcr + \interlinepenalty 200% + \def\par{\@@par\penalty 200\relax}} +% \end{macrocode} +% \end{macro} +% +% +% \begin{macro}{\longindentation} +% The size of the indent to use before the closing of the letter. +% \begin{macrocode} +\newdimen\longindentation +\longindentation=.5\textwidth +% \end{macrocode} +% \end{macro} +% +% \begin{macro}{\indentedwidth} +% The width of the closing of the letter. +% \begin{macrocode} +\newdimen\indentedwidth +\indentedwidth=\textwidth +\advance\indentedwidth -\longindentation +% \end{macrocode} +% \end{macro} +% +% \begin{macro}{\opening} +% Text is begun with the |\opening| command, whose argument +% generates the salutation, as in +%\begin{verbatim} +% \opening{Dear Henry,} +%\end{verbatim} +% This should produce everything up to and including the +% `Dear Henry,' and a |\par| command that follows. +% Since there's a |\vfil| at the bottom of every page, +% it can add vertical fill to position a short letter. +% It should use the following commands: +% \begin{itemize} +% \item |\toname| : name part of `to' address. +% Will be one line long. +% \item |\toaddress| : address part of `to' address. +% The lines separated by |\\|. +% \item |\fromname| : name of sender. +% \item |\fromaddress| : argument of current |\address| +% declaration-- null if none. Should use standard institutional +% address if null. +% \item |\fromlocation| : argument of current |\location| +% declaration--null if none. +% \item |\telephonenum| : argument of current |\telephone| +% declaration--null if none. +% \end{itemize} +% \begin{macrocode} +\newcommand*{\opening}[1]{\ifx\@empty\fromaddress + \thispagestyle{firstpage}% + {\raggedleft\@date\par}% + \else % home address + \thispagestyle{empty}% +% \end{macrocode} +% \changes{v1.2y}{1998/05/10}{Avoid space at right of tabular +% (pr2794)} +% \begin{macrocode} + {\raggedleft\begin{tabular}{l@{}}\ignorespaces + \fromaddress \\*[2\parskip]% + \@date \end{tabular}\par}% + \fi + \vspace{2\parskip}% + {\raggedright \toname \\ \toaddress \par}% + \vspace{2\parskip}% + #1\par\nobreak} +% \end{macrocode} +% \end{macro} +% +% \begin{macro}{\closing} +% The body of the letter follows, ended by a |\closing| command, +% as in +%\begin{verbatim} +% \closing{Yours truly,} +%\end{verbatim} +% This command generates the closing matter, and the signature. +% An obvious thing to do is to use a |\parbox| for the closing +% and the signature. Should use the following: +% \begin{itemize} +% \item |\fromsig| : argument of current |\signature| declaration +% or, if null, the |\fromname|. +% \item |\stopbreaks| : a macro that inhibits page breaking. +% \end{itemize} +% \begin{macrocode} +\newcommand{\closing}[1]{\par\nobreak\vspace{\parskip}% + \stopbreaks + \noindent + \ifx\@empty\fromaddress\else + \hspace*{\longindentation}\fi + \parbox{\indentedwidth}{\raggedright + \ignorespaces #1\\[6\medskipamount]% + \ifx\@empty\fromsig + \fromname + \else \fromsig \fi\strut}% + \par} +% \end{macrocode} +% \end{macro} +% +% \begin{macro}{\smallskipamount} +% \begin{macro}{\mdeskipamount} +% \begin{macro}{\bigskipamount} +% Of these three, only |\medskipmount| is actually used above. +% \begin{macrocode} +%\smallskipamount=.5\parskip +\medskipamount=\parskip +%\bigskipamount=2\parskip +% \end{macrocode} +% \end{macro} +% \end{macro} +% \end{macro} +% +% \begin{macro}{\cc} +% \begin{macro}{\encl} +% \begin{macro}{\ps} +% After the |\closing| you can put arbitrary stuff, which is typeset +% with zero |\parindent| and no page breaking. Commands designed +% for use after the closing are: +% \begin{verbatim} +% \cc{Tinker\\Evers\\Chance} +%\end{verbatim} +% which produces:\\ +% \begin{tabular}{ll} +% cc: & Tinker\\ +% & Evers\\ +% & Chance +% \end{tabular}\\ +% Note the obvious use of |\parbox|. +% \changes{v1.2s}{1995/05/25}{replace \cs{reset@font} with +% \cs{normalfont}; remove \cs{rm}} +% \begin{macrocode} +\newcommand*{\cc}[1]{% + \par\noindent + \parbox[t]{\textwidth}{% + \@hangfrom{\normalfont\ccname: }% + \ignorespaces #1\strut}\par} +% \end{macrocode} +%\begin{verbatim} +% \encl{Foo(2)\\Bar} +%\end{verbatim} +% which produces:\\ +% \begin{tabular}{ll} +% encl: & Foo(2)\\ +% & Bar +% \end{tabular} +% \begin{macrocode} +\newcommand*{\encl}[1]{% + \par\noindent + \parbox[t]{\textwidth}{% + \@hangfrom{\normalfont\enclname: }% + \ignorespaces #1\strut}\par} +% \end{macrocode} +% +% The only thing |\ps| needs to do is call |\startbreaks|, +% which allows page breaking again. +% \begin{macrocode} +\newcommand*{\ps}{\par\startbreaks} +% \end{macrocode} +% \end{macro} +% \end{macro} +% \end{macro} +% +% +% \begin{macro}{\stopletter} +% The |\stopletter| command is called by |\endletter| to do the +% following: +% \begin{itemize} +% \item Add any desired fill or other material at the end of the +% letter. +% \item Define |\returnaddress| to be the return address for the +% mailing label. +% More precisely, it is the first argument of the |\mlabel| +% command described below. It should be defined to null if the +% return address doesn't appear on the labels. Any command, +% other than |\\|, that should not be expanded until the |\mlabel| +% command is actually executed must be preceded by |\protect|. +% Whenever possible, |\protect| commands in the definition of +% |\returnaddress|---it's much more efficient that way. In +% particular, when the standard return address is used, you +% should define |\returnaddress| to something like +% |\protect\standardreturnaddress|. +% \end{itemize} +% \begin{macrocode} +\newcommand*{\stopletter}{} +% \end{macrocode} +% \end{macro} +% +% \subsection{Customizing the labels} +% +% Commands for generating the labels are put on the \file{.aux} file, +% which is read in and processed by the |\end{document}| command. +% You have to define the following two commands: +% \begin{itemize} +% \item |\startlabels| : Should reset the page layout parameters if +% necessary. +% \item |\mlabel|\marg{return address}\marg{to adress} : Command to +% generate a single label. +% \end{itemize} +% +% +% +% \begin{macro}{\returnaddress} +% The return address for the mailing labels can be stored in this +% macro. +% \begin{macrocode} +\newcommand*{\returnaddress}{} +% \end{macrocode} +% \end{macro} +% +% \begin{macro}{\labelcount} +% A register to count the labels +% \begin{macrocode} +\newcount\labelcount +% \end{macrocode} +% \end{macro} +% +% \begin{macro}{\startlabels} +% The following |\startlabels| command sets things up for +% producing labels in two columns of five 2" $\times$ 4-1/4" +% labels each, suitable for reproducing onto Avery brand number +% 5352 address labels. +% \changes{v1.2q}{1995/03/14}{changed value of \cs{columnsep} by 1pt} +% \begin{macrocode} +\newcommand*{\startlabels}{\labelcount\z@ + \pagestyle{empty}% + \let\@texttop\relax + \topmargin -50\p@ + \headsep \z@ + \oddsidemargin -35\p@ + \evensidemargin -35\p@ + \textheight 10in + \@colht\textheight \@colroom\textheight \vsize\textheight + \textwidth 550\p@ + \columnsep 26\p@ + \ifcase \@ptsize\relax + \normalsize + \or + \small + \or + \footnotesize + \fi + \baselineskip \z@ + \lineskip \z@ + \boxmaxdepth \z@ + \parindent \z@ + \twocolumn\relax} +% \end{macrocode} +% \end{macro} +% +% \begin{macro}{\@startlabels} +% |\@startlabels| is the command name that is written to the |.aux| +% file. It is a no-op at first, and defined to be the same as +% |\startlabels| in the |\begin{document}| hook. +% \begin{macrocode} +\let\@startlabels=\relax +% \end{macrocode} +% \end{macro} +% +% \begin{macro}{\mlabel} +% This command prints an address label; it is used when the user +% specified |\makelabels| in the preamble of his document. The +% command |\mlabel| takes two arguments; the second argument is +% supposed to be the address; the first argument can be used to +% print a return address. In this document class we ignore the +% first argument. Also the labels are supposed to be 2~inch high +% and 3.6~inch wide. When your address labels have a different you +% will have to define your own |\mlabel| command. +% \changes{v1.2p}{1994/12/11}{Redefined \cs{mlabel} to not use the +% \cs{setbox} primitive} +% \changes{v1.2q}{1995/03/14}{changed width of the labels slightly to +% prevent \LaTeX\ stuffing two on each line} +% \begin{macrocode} +\newcommand*{\mlabel}[2]{% + \parbox[b][2in][c]{262\p@}{\strut\ignorespaces #2}% + } +% \end{macrocode} +% \end{macro} +% +% \begin{macro}{\@mlabel} +% The macro |\@mlabel| is written to the \file{.aux} file instead +% of |\mlabel|. This allows us to make it a no-op by default, +% and then activate it in the |\begin{document}| hook. +% \begin{macrocode} +\let\@mlabel=\@gobbletwo +% \end{macrocode} +% \end{macro} +% +% +% \subsection{Lists} +% +% \subsubsection{General List Parameters} +% +% The following commands are used to set the default values for the +% list environment's parameters. See the \LaTeX{} manual for an +% explanation of the meanings of the parameters. Defaults for the +% list environment are set as follows. First, |\rightmargin|, +% |\listparindent| and |\itemindent| are set to 0pt. Then, for a +% \texttt{K}th level list, the command |\@listK| is called, where +% `\texttt{K}' denotes `\texttt{i}', `\texttt{ii}', ... , +% `\texttt{vi}'. (I.e., |\@listiii| is called for a third-level +% list.) By convention, |\@listK| should set |\leftmargin| to +% |\leftmarginK|. +% +% \begin{macro}{\leftmargin} +% \begin{macro}{\leftmargini} +% \begin{macro}{\leftmarginii} +% \begin{macro}{\leftmarginiii} +% \begin{macro}{\leftmarginiv} +% \begin{macro}{\leftmarginv} +% \begin{macro}{\leftmarginvi} +% For efficiency, level-one list's values are defined at top level, and +% |\@listi| is defined to set only |\leftmargin|. +% \begin{macrocode} +\setlength\leftmargini {2.5em} +% \end{macrocode} +% The following three are calculated so that they are larger than +% the sum of |\labelsep| and the width of the default labels (which +% are `(m)', `vii.' and `M.'). +% \begin{macrocode} +\setlength\leftmarginii {2.2em} +\setlength\leftmarginiii {1.87em} +\setlength\leftmarginiv {1.7em} +\setlength\leftmarginv {1em} +\setlength\leftmarginvi {1em} +% \end{macrocode} +% Here we set the top level leftmargin. +% \begin{macrocode} +\setlength\leftmargin {\leftmargini} +% \end{macrocode} +% \end{macro} +% \end{macro} +% \end{macro} +% \end{macro} +% \end{macro} +% \end{macro} +% \end{macro} +% +% \begin{macro}{\labelsep} +% \begin{macro}{\labelwidth} +% |\labelsep| is the distance between the label and the text of an +% item; |\labelwidth| is the width of the label. +% \begin{macrocode} +\setlength \labelsep {5\p@} +\setlength \labelwidth{\leftmargini} +\addtolength\labelwidth{-\labelsep} +% \end{macrocode} +% \end{macro} +% \end{macro} +% +% \begin{macro}{\partopsep} +% When the user leaves a blank line before the environment an extra +% vertical space of |\partopsep| is inserted, in addition to +% |\parskip| and |\topsep|. +% \begin{macrocode} +\setlength\partopsep{0\p@} +% \end{macrocode} +% \end{macro} +% +% \begin{macro}{\@beginparpenalty} +% \begin{macro}{\@endparpenalty} +% These penalties are inserted before and after a list or paragraph +% environment. They are set to a bonus value to encourage page +% breaking at these points. +% \begin{macro}{\@itempenalty} +% This penalty is inserted between list items. +% \begin{macrocode} +\@beginparpenalty -\@lowpenalty +\@endparpenalty -\@lowpenalty +\@itempenalty -\@lowpenalty +% \end{macrocode} +% \end{macro} +% \end{macro} +% \end{macro} +% +% \begin{macro}{\@listI} +% \begin{macro}{\@listi} +% |\@listI| defines top level and |\@listi| values of +% |\leftmargin|, |\parsep|, |\topsep|, and |\itemsep| +% +% \begin{macrocode} +\def\@listI{\setlength\leftmargin{\leftmargini}% + \setlength\parsep {0\p@}% + \setlength\topsep {.4em}% + \setlength\itemsep{.4em}} +\let\@listi\@listI +% \end{macrocode} +% We have to initialize these parameters. +% \begin{macrocode} +\@listi +% \end{macrocode} +% \end{macro} +% \end{macro} +% +% \begin{macro}{\@listii} +% \begin{macro}{\@listiii} +% \begin{macro}{\@listiv} +% \begin{macro}{\@listv} +% \begin{macro}{\@listvi} +% Here are the same macros for the higher level lists. +% \begin{macrocode} +\def\@listii {\setlength \leftmargin{\leftmarginii}% + \setlength \labelwidth{\leftmarginii}% + \addtolength\labelwidth{-\labelsep}} +\def\@listiii{\setlength \leftmargin{\leftmarginiii}% + \setlength \labelwidth{\leftmarginiii}% + \addtolength\labelwidth{-\labelsep}% + \setlength \topsep {.2em}% + \setlength \itemsep {\topsep}} +\def\@listiv {\setlength \leftmargin{\leftmarginiv}% + \setlength \labelwidth{\leftmarginiv}% + \addtolength\labelwidth{-\labelsep}} +\def\@listv {\setlength \leftmargin{\leftmarginv}% + \setlength \labelwidth{\leftmarginv}% + \addtolength\labelwidth{-\labelsep}} +\def\@listvi {\setlength \leftmargin{\leftmarginvi}% + \setlength \labelwidth{\leftmarginvi}% + \addtolength\labelwidth{-\labelsep}} +% \end{macrocode} +% \end{macro} +% \end{macro} +% \end{macro} +% \end{macro} +% \end{macro} +% +% \subsubsection{Enumerate} +% +% The enumerate environment uses four counters: \Lcount{enumi}, +% \Lcount{enumii}, \Lcount{enumiii} and \Lcount{enumiv}, where +% \Lcount{enumN} controls the numbering of the Nth level +% enumeration. +% +% \begin{macro}{\theenumi} +% \begin{macro}{\theenumii} +% \begin{macro}{\theenumiii} +% \begin{macro}{\theenumiv} +% The counters are already defined in the \LaTeX{} kernel +% (\file{ltlists.dtx}), but their representation is changed here. +% +% \begin{macrocode} +\renewcommand\theenumi{\@arabic\c@enumi} +\renewcommand\theenumii{\@alph\c@enumii} +\renewcommand\theenumiii{\@roman\c@enumiii} +\renewcommand\theenumiv{\@Alph\c@enumiv} +% \end{macrocode} +% \end{macro} +% \end{macro} +% \end{macro} +% \end{macro} +% +% \begin{macro}{\labelenumi} +% \begin{macro}{\labelenumii} +% \begin{macro}{\labelenumiii} +% \begin{macro}{\labelenumiv} +% The commands |\labelenumi| ... |\labelenumiv| generate the label +% for each item. +% \begin{macrocode} +\newcommand\labelenumi{\theenumi.} +\newcommand\labelenumii{(\theenumii)} +\newcommand\labelenumiii{\theenumiii.} +\newcommand\labelenumiv{\theenumiv.} +% \end{macrocode} +% \end{macro} +% \end{macro} +% \end{macro} +% \end{macro} +% +% \begin{macro}{\p@enumii} +% \begin{macro}{\p@enumiii} +% \begin{macro}{\p@enumiv} +% The expansion of |\p@enumN||\theenumN| defines the output of a +% |\ref| command when referencing an item of the Nth level of an +% enumerated list. +% \begin{macrocode} +\renewcommand\p@enumii{\theenumi} +\renewcommand\p@enumiii{\theenumi(\theenumii)} +\renewcommand\p@enumiv{\p@enumiii\theenumiii} +% \end{macrocode} +% \end{macro} +% \end{macro} +% \end{macro} +% +% \subsubsection{Itemize} +% +% \begin{macro}{\labelitemi} +% \begin{macro}{\labelitemii} +% \changes{v1.2h}{1994/05/06}{Inserted \cs{normalfont}} +% \changes{v1.2u}{1996/08/25}{replaced -{}- with \cs{textendash}} +% \begin{macro}{\labelitemiii} +% \begin{macro}{\labelitemiv} +% Itemization is controlled by |\labelitemi|, +% |\labelitemii|, |\labelitemiii|, and |\labelitemiv|, which define +% the labels of the various itemization levels: the symbols used are +% bullet, bold en-dash, asterisk and centered dot. +% +% \changes{v1.2n}{1994/07/11}{renamed \cs{labelitemiiii} to +% \cs{labelitemiii}} +% \changes{v1.2x}{1997/04/16}{Changed to \cs{textbullet}, +% \cs{textasteriskcentered} and \cs{textperiodcentered}} +% \begin{macrocode} +\newcommand\labelitemi{\textbullet} +\newcommand\labelitemii{\normalfont\bfseries \textendash} +\newcommand\labelitemiii{\textasteriskcentered} +\newcommand\labelitemiv{\textperiodcentered} +% \end{macrocode} +% \end{macro} +% \end{macro} +% \end{macro} +% \end{macro} +% +% \subsubsection{Description} +% +% \begin{environment}{description} +% The description environment is defined here -- while the itemize +% and enumerate environments are defined in the \LaTeX{} kernel +% (\file{ltlists.dtx}). +% +% \begin{macrocode} +\newenvironment{description} + {\list{}{\labelwidth\z@ \itemindent-\leftmargin + \let\makelabel\descriptionlabel}} + {\endlist} +% \end{macrocode} +% \end{environment} +% +% \begin{macro}{\descriptionlabel} +% To change the formatting of the label, you must redefine +% |\descriptionlabel|. +% +% \changes{v1.2q}{1995/03/14}{made command short} +% \begin{macrocode} +\newcommand*{\descriptionlabel}[1]{\hspace\labelsep + \normalfont\bfseries #1} +% \end{macrocode} +% \end{macro} +% +% \subsection{Defining new environments} +% +% \subsubsection{Verse} +% +% \begin{environment}{verse} +% The verse environment is defined by making clever use of the +% list environment's parameters. The user types |\\| to end a line. +% This is implemented by |\let|'ing |\\| equal |\@centercr|. +% +% \begin{macrocode} +\newenvironment{verse} + {\let\\=\@centercr + \list{}{\setlength\itemsep{\z@}% + \setlength\itemindent{-15\p@}% + \setlength\listparindent{\itemindent}% + \setlength\rightmargin{\leftmargin}% + \addtolength\leftmargin{15\p@}}% + \item[]} + {\endlist} +% \end{macrocode} +% \end{environment} +% +% \subsubsection{Quotation} +% +% \begin{environment}{quotation} +% The quotation environment is also defined by making clever use of +% the list environment's parameters. The lines in the environment +% are set smaller than |\textwidth|. The first line of a paragraph +% inside this environment is indented. +% +% \begin{macrocode} +\newenvironment{quotation} + {\list{}{\setlength\listparindent{1.5em}% + \setlength\itemindent{\listparindent}% + \setlength\rightmargin{\leftmargin}}% + \item[]} + {\endlist} +% \end{macrocode} +% \end{environment} +% +% \subsubsection{Quote} +% +% \begin{environment}{quote} +% The quote environment is like the quotation environment except +% that paragraphs are not indented. +% +% \begin{macrocode} +\newenvironment{quote} + {\list{}{\setlength\rightmargin{\leftmargin}}% + \item[]} + {\endlist} +% \end{macrocode} +% \end{environment} +% +% \subsubsection{Theorem} +% +% This document class does not define it's own theorem environments, +% the defaults, supplied by the \LaTeX{} kernel (\file{ltthm.dtx}) +% are available. +% +% +% \subsection{Setting parameters for existing environments} +% +% \subsubsection{Array and tabular} +% +% \begin{macro}{\arraycolsep} +% The columns in an array environment are separated by +% 2|\arraycolsep|. +% \begin{macrocode} +\setlength\arraycolsep{5\p@} +% \end{macrocode} +% \end{macro} +% +% \begin{macro}{\tabcolsep} +% The columns in an tabular environment are separated by +% 2|\tabcolsep|. +% \begin{macrocode} +\setlength\tabcolsep{6\p@} +% \end{macrocode} +% \end{macro} +% +% \begin{macro}{\arrayrulewidth} +% The width of vertical rules in the array and tabular environments +% is given by |\arrayrulewidth|. +% \begin{macrocode} +\setlength\arrayrulewidth{.4\p@} +% \end{macrocode} +% \end{macro} +% +% \begin{macro}{\doublerulesep} +% The space between adjacent rules in the array and tabular +% environments is given by |\doublerulesep|. +% \begin{macrocode} +\setlength\doublerulesep{2\p@} +% \end{macrocode} +% \end{macro} +% +% \subsubsection{Tabbing} +% +% \begin{macro}{\tabbingsep} +% This controls the space that the |\'| command puts in. (See +% \LaTeX{} manual for an explanation.) +% \begin{macrocode} +\setlength\tabbingsep{\labelsep} +% \end{macrocode} +% \end{macro} +% +% \subsubsection{Minipage} +% +% \begin{macro}{\@minipagerestore} +% The macro |\@minipagerestore| is called upon entry to a minipage +% environment to set up things that are to be handled differently +% inside a minipage environment. In the current styles, it does +% nothing. +% \end{macro} +% +% \begin{macro}{\@mpfootins} +% Minipages have their own footnotes; |\skip||\@mpfootins| plays +% same r\^ole for footnotes in a minipage as |\skip||\footins| does +% for ordinary footnotes. +% +% \begin{macrocode} +\skip\@mpfootins = \skip\footins +% \end{macrocode} +% \end{macro} +% +% \subsubsection{Framed boxes} +% +% \begin{macro}{\fboxsep} +% The space left by |\fbox| and |\framebox| between the box and the +% text in it. +% \begin{macro}{\fboxrule} +% The width of the rules in the box made by |\fbox| and |\framebox|. +% \begin{macrocode} +\setlength\fboxsep{3\p@} +\setlength\fboxrule{.4\p@} +% \end{macrocode} +% \end{macro} +% \end{macro} +% +% \subsubsection{Equation and eqnarray} +% +% \begin{macro}{\theequation} +% The equation counter will be typeset using arabic numbers. +% \begin{macrocode} +\renewcommand\theequation{\@arabic\c@equation} +% \end{macrocode} +% \end{macro} +% +% \begin{macro}{\jot} +% |\jot| is the extra space added between lines of an eqnarray +% environment. The default value is used. +% \begin{macrocode} +% \setlength\jot{3pt} +% \end{macrocode} +% \end{macro} +% +% \begin{macro}{\@eqnnum} +% The macro |\@eqnnum| defines how equation numbers are to appear in +% equations. Again the default is used. +% +% \begin{macrocode} +% \def\@eqnnum{(\theequation)} +% \end{macrocode} +% \end{macro} +% +% \subsection{Font changing} +% +% Here we supply the declarative font changing commands that were +% common in \LaTeX\ version 2.09 and earlier. These commands work +% in text mode \emph{and} in math mode. They are provided for +% compatibility, but one should start using the |\text...| and +% |\math...| commands instead. These commands are redefined using +% |\@renewfontswitch|, a command with three arguments: the user +% command to be defined; \LaTeX\ commands to execute in text mode +% and \LaTeX\ commands to execute in math mode. +% +% \begin{macro}{\rm} +% \begin{macro}{\tt} +% \begin{macro}{\sf} +% The commands to change the family. +% \changes{v1.0a}{1993/12/14}{Added compatibility mode support.} +% \changes{v1.1}{1993/12/18}{Changed \cs{@newfontswitch} to +% \cs{@renewfontswitch}, removed switch.} +% \changes{v1.2d}{1994/04/14}{\cs{@renewfontswitch} has become +% \cs{DeclareOldFontCommand}} +% \begin{macrocode} +\DeclareOldFontCommand{\rm}{\normalfont\rmfamily}{\mathrm} +\DeclareOldFontCommand{\sf}{\normalfont\sffamily}{\mathsf} +\DeclareOldFontCommand{\tt}{\normalfont\ttfamily}{\mathtt} +% \end{macrocode} +% \end{macro} +% \end{macro} +% \end{macro} +% +% \begin{macro}{\bf} +% The command to change to the bold series. One should use +% |\mdseries| to explicitly switch back to medium series. +% \changes{v1.0a}{1993/12/14}{Added compatibility mode support.} +% \changes{v1.1}{1993/12/18}{Changed \cs{@newfontswitch} to +% \cs{@renewfontswitch}, removed switch.} +% \begin{macrocode} +\DeclareOldFontCommand{\bf}{\normalfont\bfseries}{\mathbf} +% \end{macrocode} +% \end{macro} +% +% \begin{macro}{\sl} +% \begin{macro}{\it} +% \begin{macro}{\sc} +% +% And the commands to change the shape of the font. The slanted and +% small caps shapes are not available by default as math alphabets, +% so those changes do nothing in math mode. One should use +% |\upshape| to explicitly change back to the upright shape. +% \changes{v1.0a}{1993/12/14}{Added compatibility mode support.} +% \changes{v1.1}{1993/12/18}{Changed \cs{@newfontswitch} to +% \cs{@renewfontswitch}, removed switch.} +% \changes{v1.1b}{1993/12/20}{Added forgotten re.} +% \begin{macrocode} +\DeclareOldFontCommand{\it}{\normalfont\itshape}{\mathit} +\DeclareOldFontCommand{\sl}{\normalfont\slshape}{\relax} +\DeclareOldFontCommand{\sc}{\normalfont\scshape}{\relax} +% \end{macrocode} +% \end{macro} +% \end{macro} +% \end{macro} +% +% \begin{macro}{\cal} +% \changes{v1.0a}{1993/12/14}{Macro added} +% \begin{macro}{\mit} +% \changes{v1.0a}{1993/12/14}{Macro added} +% +% The commands |\cal| and |\mit| should only be used in math mode, +% outside math mode they have no effect. Currently the New Font +% Selection Scheme defines these commands to generate warning +% messages. Therefore we have to define them `by hand'. +% \changes{v1.2p}{1994/12/11}{Now define \cs{cal} and \cs{mit} using +% \cs{DeclareRobustCommand*}} +% \begin{macrocode} +\DeclareRobustCommand*{\cal}{\@fontswitch{\relax}{\mathcal}} +\DeclareRobustCommand*{\mit}{\@fontswitch{\relax}{\mathnormal}} +% \end{macrocode} +% \end{macro} +% \end{macro} +% +% \subsection{Footnotes} +% +% \begin{macro}{\footnoterule} +% Usually, footnotes are separated from the main body of the text +% by a small rule. This rule is drawn by the macro |\footnoterule|. +% We have to make sure that the rule takes no vertical space (see +% \file{plain.tex}) so we compensate for the natural height of the +% rule of 0.4pt by adding the right amount of vertical skip. +% +% To prevent the rule from colliding with the footnote we first add +% a little negative vertical skip, then we put the rule and make +% sure we end up at the same point where we begun this operation. +% \begin{macrocode} +\renewcommand\footnoterule{% + \kern-\p@ + \hrule \@width .4\columnwidth + \kern .6\p@} +% \end{macrocode} +% \end{macro} +% +% \begin{macro}{\c@footnote} +% A counter for footnotes. +% \begin{macrocode} +% \newcounter{footnote} +% \end{macrocode} +% \end{macro} +% +% \begin{macro}{\@makefntext} +% \changes{v1.2c}{1994/03/08}{Always call \cs{@makefnmark}.} +% The footnote mechanism of \LaTeX{} calls the macro |\@makefntext| +% to produce the actual footnote. The macro gets the text of the +% footnote as its argument and should use |\@makefnmark| to produce +% the mark of the footnote. The macro |\@makefntext| is called when +% effectively inside a |\parbox| of width |\columnwidth| (i.e., +% with |\hsize| = |\columnwidth|). +% +% An example of what can be achieved is given by the following piece +% of \TeX\ code. +% \begin{verbatim} +% \long\def\@makefntext#1{% +% \@setpar{\@@par +% \@tempdima = \hsize +% \advance\@tempdima-10pt +% \parshape \@ne 10pt \@tempdima}% +% \par +% \parindent 1em\noindent +% \hb@xt@\z@{\hss\@makefnmark}#1} +% \end{verbatim} +% The effect of this definition is that all lines of the footnote +% are indented by 10pt, while the first line of a new paragraph is +% indented by 1em. To change these dimensions, just substitute the +% desired value for `10pt' (in both places) or `1em'. The mark is +% flush right against the footnote. +% +% In this document class we use a simpler macro, in which the +% footnote text is set like an ordinary text paragraph, with no +% indentation except on the first line of a paragraph, and the +% first line of the footnote. Thus, all the macro must do is set +% |\parindent| to the appropriate value for succeeding paragraphs +% and put the proper indentation before the mark. +% +% \begin{macrocode} +\long\def\@makefntext#1{% + \noindent + \hangindent 5\p@ + \hb@xt@5\p@{\hss\@makefnmark}#1} +% \end{macrocode} +% \end{macro} +% +% \begin{macro}{\@makefnmark} +% The footnote markers that are printed in the text to point to the +% footnotes should be produced by the macro |\@makefnmark|. We use +% the default definition for it. +% \begin{macrocode} +%\def\@makefnmark{\hbox{$^{\@thefnmark}\m@th$}} +% \end{macrocode} +% \end{macro} +% +% \subsection{Words} +% +% \begin{macro}{\ccname} +% \begin{macro}{\enclname} +% \begin{macro}{\pagename} +% \begin{macro}{\headtoname} +% This document class is for documents prepared in the English +% language. To prepare a version for another language, various +% English words must be replaced. All the English words that +% require replacement are defined below in command names. +% \begin{macrocode} +\newcommand*{\ccname}{cc} +\newcommand*{\enclname}{encl} +\newcommand*{\pagename}{Page} +\newcommand*{\headtoname}{To} +% \end{macrocode} +% \end{macro} +% \end{macro} +% \end{macro} +% \end{macro} +% +% \subsection{Date} +% +% \begin{macro}{\today} +% This macro uses the \TeX\ primitives |\month|, |\day| and |\year| +% to provide the date of the \LaTeX-run. +% \begin{macrocode} +\newcommand*{\today}{\ifcase\month\or + January\or February\or March\or April\or May\or June\or + July\or August\or September\or October\or November\or December\fi + \space\number\day, \number\year} +% \end{macrocode} +% \end{macro} +% +% \subsection{Two column mode} +% +% \begin{macro}{\columnsep} +% This gives the distance between two columns in two column mode. +% \begin{macrocode} +\setlength\columnsep{10\p@} +% \end{macrocode} +% \end{macro} +% +% \begin{macro}{\columnseprule} +% This gives the width of the rule between two columns in two +% column mode. We have no visible rule. +% \begin{macrocode} +\setlength\columnseprule{0\p@} +% \end{macrocode} +% \end{macro} +% +% \subsection{The page style} +% We have \pstyle{plain} pages in this document class by +% default. We use arabic page numbers. +% \begin{macrocode} +\pagestyle{plain} +\pagenumbering{arabic} +% \end{macrocode} +% +% \subsection{Single or double sided printing} +% +% We don't try to make each page as long as all the others. +% \begin{macrocode} +\raggedbottom +% \end{macrocode} +% +% \begin{macro}{\@texttop} +% The document class letter sets |\@texttop| to |\vskip| 0pt +% \texttt{plus} .00006fil on the first page of a letter, which +% centers a short letter on the page. This fil value may have to be +% changed for other letterheads. This setting has to be done after +% |\raggedbottom| is executed, since the latter sets |\@texttop| to +% |\relax|. +% \begin{macrocode} +\def\@texttop{\ifnum\c@page=1\vskip \z@ plus.00006fil\relax\fi} +% \end{macrocode} +% \end{macro} +% +% We always start in one column mode. +% \begin{macrocode} +\onecolumn +% +% \end{macrocode} +% +% +% +% \Finale +% +\endinput diff --git a/Master/texmf-dist/source/latex/base/letter.ins b/Master/texmf-dist/source/latex/base/letter.ins new file mode 100644 index 00000000000..c85d5ebdf77 --- /dev/null +++ b/Master/texmf-dist/source/latex/base/letter.ins @@ -0,0 +1,101 @@ +%% +%% This file will generate fast loadable files and documentation +%% driver files from the doc files in this package when run through +%% LaTeX or TeX. +%% +%% Copyright 1993 1994 1995 1996 1997 1998 1999 2000 2001 2002 2003 2004 +%% The LaTeX3 Project and any individual authors listed elsewhere +%% in this file. +%% +%% This file is part of the LaTeX base system. +%% ------------------------------------------- +%% +%% It may be distributed and/or modified under the +%% conditions of the LaTeX Project Public License, either version 1.3 +%% of this license or (at your option) any later version. +%% The latest version of this license is in +%% http://www.latex-project.org/lppl.txt +%% and version 1.3 or later is part of all distributions of LaTeX +%% version 2003/12/01 or later. +%% +%% This file has the LPPL maintenance status "maintained". +%% +%% In particular, NO PERMISSION is granted to modify the contents of this +%% file since it contains the legal notices that are placed in the files +%% it generates. +%% +%% The list of all files belonging to the LaTeX base distribution is +%% given in the file `manifest.txt'. See also `legal.txt' for additional +%% information. +%% +%% +%% +%% +%% --------------- start of docstrip commands ------------------ +%% + +\input docstrip + +\preamble + +This is a generated file. + +Copyright 1993 1994 1995 1996 1997 1998 1999 2000 2001 2002 2003 2004 +The LaTeX3 Project and any individual authors listed elsewhere +in this file. + +This file was generated from file(s) of the LaTeX base system. +-------------------------------------------------------------- + +It may be distributed and/or modified under the +conditions of the LaTeX Project Public License, either version 1.3 +of this license or (at your option) any later version. +The latest version of this license is in + http://www.latex-project.org/lppl.txt +and version 1.3 or later is part of all distributions of LaTeX +version 2003/12/01 or later. + +This file has the LPPL maintenance status "maintained". + +This file may only be distributed together with a copy of the LaTeX +base system. You may however distribute the LaTeX base system without +such generated files. + +The list of all files belonging to the LaTeX base distribution is +given in the file `manifest.txt'. See also `legal.txt' for additional +information. + +The list of derived (unpacked) files belonging to the distribution +and covered by LPPL is defined by the unpacking scripts (with +extension .ins) which are part of the distribution. +\endpreamble + +\keepsilent +\usedir{tex/latex/base} + +\Msg{*** Generating letter class file ***} + +\generateFile{letter.cls}{t}{ + \from{letter.dtx}{letter}} + + + +\ifToplevel{ +\Msg{***********************************************************} +\Msg{*} +\Msg{* To finish the installation you have to move the following} +\Msg{* files into a directory searched by TeX:} +\Msg{*} +\Msg{* \space\space letter.cls} +\Msg{*} +\Msg{* To produce the documentation run the file `letter.dtx'} +\Msg{* through LaTeX.} +\Msg{*} +\Msg{* Happy TeXing} +\Msg{***********************************************************} +} + +\endbatchfile + + + diff --git a/Master/texmf-dist/source/latex/base/ltalloc.dtx b/Master/texmf-dist/source/latex/base/ltalloc.dtx new file mode 100644 index 00000000000..62082152aa8 --- /dev/null +++ b/Master/texmf-dist/source/latex/base/ltalloc.dtx @@ -0,0 +1,176 @@ +% \iffalse meta-comment +% +% Copyright 1993 1994 1995 1996 1997 1998 1999 2000 2001 2002 2003 2004 +% The LaTeX3 Project and any individual authors listed elsewhere +% in this file. +% +% This file is part of the LaTeX base system. +% ------------------------------------------- +% +% It may be distributed and/or modified under the +% conditions of the LaTeX Project Public License, either version 1.3 +% of this license or (at your option) any later version. +% The latest version of this license is in +% http://www.latex-project.org/lppl.txt +% and version 1.3 or later is part of all distributions of LaTeX +% version 2003/12/01 or later. +% +% This file has the LPPL maintenance status "maintained". +% +% The list of all files belonging to the LaTeX base distribution is +% given in the file `manifest.txt'. See also `legal.txt' for additional +% information. +% +% The list of derived (unpacked) files belonging to the distribution +% and covered by LPPL is defined by the unpacking scripts (with +% extension .ins) which are part of the distribution. +% +% \fi +% +% \iffalse +%%% From File: ltalloc.dtx +%<*driver> +% \fi +\ProvidesFile{ltalloc.dtx} + [1996/07/26 v1.1c LaTeX Kernel (allocation)] +% \iffalse +\documentclass{ltxdoc} +\GetFileInfo{ltalloc.dtx} +\title{\filename} +\date{\filedate} + \author{% + Johannes Braams\and + David Carlisle\and + Alan Jeffrey\and + Leslie Lamport\and + Frank Mittelbach\and + Chris Rowley\and + Rainer Sch\"opf} +\begin{document} +\maketitle + \DocInput{\filename} +\end{document} +% +% \fi +% +% \CheckSum{33} +% +% \changes{v1.1a}{1994/05/16}{(ASAJ) Split from ltinit.dtx.} +% \changes{v1.1b}{1995/10/25}{General doc improvements} +% +% \section{Counters} +% +% This section deals with counter and other variable allocation. +% +% \StopEventually{} +% +% \begin{macrocode} +%<*2ekernel> +% \end{macrocode} +% +% The following are from plain \TeX: +% \begin{description} +% \item[\cs{z@}] A zero dimen or number. It's more efficient to write +% |\parindent\z@| than |\parindent 0pt|. +% \item[\cs{@ne}] The number 1. +% \item[\cs{m@ne}] The number $-1$. +% \item[\cs{tw@}] The number 2. +% \item[\cs{sixt@@n }] The number 16. +% \item[\cs{@m}] The number 1000. +% \item[\cs{@MM}] The number 20000. +% \end{description} +% +% \begin{macro}{\@xxxii} +% The constant $32$. +% \begin{macrocode} +\chardef\@xxxii=32 +% \end{macrocode} +% \end{macro} +% +% \begin{macro}{\@Mi} +% \begin{macro}{\@Mii} +% \begin{macro}{\@Miii} +% \begin{macro}{\@miv} +% Constants $1001$--$1004$. +% \begin{macrocode} +\mathchardef\@Mi=10001 +\mathchardef\@Mii=10002 +\mathchardef\@Miii=10003 +\mathchardef\@Miv=10004 +% \end{macrocode} +% \end{macro} +% \end{macro} +% \end{macro} +% \end{macro} +% +% \changes{v1.0d}{1994/03/28} +% {Redefinition of `new' allocations removed.} +% +% \begin{macro}{\@tempcnta} +% \begin{macro}{\@tempcntb} +% Scratch count registers used by \LaTeX\ kernel commands. +% \begin{macrocode} +\newcount\@tempcnta +\newcount\@tempcntb +% \end{macrocode} +% \end{macro} +% \end{macro} +% +% \begin{macro}{\if@tempswa} +% General boolean switch used by \LaTeX\ kernel commands. +% \begin{macrocode} +\newif\if@tempswa +% \end{macrocode} +% \end{macro} +% +% \begin{macro}{\@tempdima} +% \begin{macro}{\@tempdimb} +% \begin{macro}{\@tempdimc} +% Scratch dimen registers used by \LaTeX\ kernel commands. +% \begin{macrocode} +\newdimen\@tempdima +\newdimen\@tempdimb +\newdimen\@tempdimc +% \end{macrocode} +% \end{macro} +% \end{macro} +% \end{macro} +% +% \begin{macro}{\@tempboxa} +% Scratch box register used by \LaTeX\ kernel commands. +% \begin{macrocode} +\newbox\@tempboxa +% \end{macrocode} +% \end{macro} +% +% \begin{macro}{\@tempskipa} +% \begin{macro}{\@tempskipb} +% Scratch skip registers used by \LaTeX\ kernel commands. +% \begin{macrocode} +\newskip\@tempskipa +\newskip\@tempskipb +% \end{macrocode} +% \end{macro} +% \end{macro} +% +% \begin{macro}{\@temptokena} +% Scratch token register used by \LaTeX\ kernel commands. +% \begin{macrocode} +\newtoks\@temptokena +% \end{macrocode} +% \end{macro} +% +% +% \begin{macro}{\@flushglue} +% Glue used for |\right|- \& |\leftskip| = 0pt plus 1fil +% \begin{macrocode} +\newskip\@flushglue \@flushglue = 0pt plus 1fil +% \end{macrocode} +% \end{macro} +% +% \begin{macrocode} +% +% \end{macrocode} +% +% \Finale +\endinput diff --git a/Master/texmf-dist/source/latex/base/ltbibl.dtx b/Master/texmf-dist/source/latex/base/ltbibl.dtx new file mode 100644 index 00000000000..d4957026a72 --- /dev/null +++ b/Master/texmf-dist/source/latex/base/ltbibl.dtx @@ -0,0 +1,407 @@ +% \iffalse meta-comment +% +% Copyright 1993 1994 1995 1996 1997 1998 1999 2000 2001 2002 2003 2004 +% The LaTeX3 Project and any individual authors listed elsewhere +% in this file. +% +% This file is part of the LaTeX base system. +% ------------------------------------------- +% +% It may be distributed and/or modified under the +% conditions of the LaTeX Project Public License, either version 1.3 +% of this license or (at your option) any later version. +% The latest version of this license is in +% http://www.latex-project.org/lppl.txt +% and version 1.3 or later is part of all distributions of LaTeX +% version 2003/12/01 or later. +% +% This file has the LPPL maintenance status "maintained". +% +% The list of all files belonging to the LaTeX base distribution is +% given in the file `manifest.txt'. See also `legal.txt' for additional +% information. +% +% The list of derived (unpacked) files belonging to the distribution +% and covered by LPPL is defined by the unpacking scripts (with +% extension .ins) which are part of the distribution. +% +% \fi +% \iffalse +%%% From File: ltbibl.dtx +% +%<*driver> +% \fi +\ProvidesFile{ltbibl.dtx} + [2004/02/15 v1.1q LaTeX Kernel (Bibliography)] +% \iffalse +\documentclass{ltxdoc} +\GetFileInfo{ltbibl.dtx} +\title{\filename} +\date{\filedate} + \author{% + Johannes Braams\and + David Carlisle\and + Alan Jeffrey\and + Leslie Lamport\and + Frank Mittelbach\and + Chris Rowley\and + Rainer Sch\"opf} + +\begin{document} +\maketitle + \DocInput{\filename} +\end{document} +% +% \fi +% +% \CheckSum{174} +% +% \section{Bibliography Generation} +% +% A bibliography is created by the |thebibliography| environment, which +% generates a title such as ``References'', and a list of entries. +% The BIB\TeX{} program will create a file containing such an +% environment, which will be read in by the |\bibliography| command. +% With BIB\TeX, the following commands will be used. +% +% \DescribeMacro{\bibliography} +% |\bibliography|\marg{file1,file2, \ldots ,filen} : specifies +% the bibdata files. Writes a |\bibdata| entry on the |.aux| file +% and tries to read in |mainfile.bbl|. +% +% \DescribeMacro{\bibliographystyle} +% |\bibliographystyle|\marg{style} : +% Writes a |\bibstyle| entry on the |.aux| file. +% +% \DescribeEnv{thebibliography} +% The |thebibliography| environment is a list environment. To save the +% use of an extra counter, it should use |enumiv| as the item +% counter. +% Instead of using |\item|, items in the bibliography are produced by +% the following commands:\\ +% |\bibitem|\marg{name} : Produces a numbered entry cited as +% \meta{name}.\\ +% |\bibitem|\oarg{label}\marg{name} : Produces an entry labeled by +% \meta{Label} and cited by \meta{name}. +% +% The former is used for bibliographies with citations like [1], [2], +% etc.; +% the latter is used for citations like [Knuth82]. +% +% The document class must define the thebibliography environment. This +% environment has a single argument, which is the widest bibliography +% label-- e.g., if the [Knuth67] is the widest entry, then this +% argument will be Knuth67. The |\thebibliography| command must begin +% a list environment, which the |\endthebibliography| command ends. +% +% \DescribeMacro{\cite} +% Entries are cited by the command |\cite|\marg{name}. +% +% \DescribeMacro{\nocite} +% |\nocite|\marg{citations} +% puts information on the |.aux| file that causes +% \BibTeX{} to include the \marg{citations} list in the bibliography, +% but puts nothing in the text. +% +% |\nocite{*}| is special: it tells \BibTeX{} to put the whole of a +% collection of references into the bibiography. +% +% \StopEventually{} +% +% +% \changes{v1.0a}{1994/03/31}{Initial version of ltidxbib.dtx, +% split from ltherest.dtx} +% \changes{v1.1a}{1994/05/19}{Initial version of ltbibl.dtx, +% split from ltidxbib.dtx} +% \changes{v1.1b}{1994/05/21}{Use new warning commands} +% \changes{v1.1c}{1994/11/10}{Fix \cs{nocite\{*\}}} +% +% \begin{macrocode} +%<*2ekernel> +\message{bibliography,} +% \end{macrocode} +% +% +% \begin{oldcomments} +% PARAMETERS +% +% \@cite : A macro such that \@cite{LABEL1,LABEL2}{NOTE} +% produces the output for a \cite[NOTE]{FOO1,FOO2} command, +% where entry FOOi is defined by \bibitem[LABELi]{FOOi}. +% The switch @tempswa is true if the optional NOTE argument +% is present. +% The default definition is : +% \@cite{LABELS}{NOTE} == +% BEGIN [LABELS +% IF @tempswa = T THEN , NOTE FI +% ] +% END +% +% \@biblabel : A macro to produce the label in the bibliography +% entry. For \bibitem[LABEL]{NAME}, the label is +% generated by \@biblabel{LABEL}. It has the default +% definition \@biblabel{LABEL} -> [LABEL]. +% CONVENTION +% +% \b@FOO : The name or number of the reference created by \cite{FOO} +% E.g., if \cite{FOO} -> [17] , then \b@FOO -> 17. +% +% \end{oldcomments} +% +% \begin{macro}{\bibitem} +% \changes{v1.1g}{1995/05/08}{Removed unnecessary braces} +% \begin{macrocode} +\def\bibitem{\@ifnextchar[\@lbibitem\@bibitem} +% \end{macrocode} +% \end{macro} +% +% \begin{macro}{\@lbibitem} +% \changes{LaTeX2.09}{1992/02/26}{Added \cs{hfill} to restore +% left-alignment of bibliography labels in alpha style} +% \begin{macrocode} +\def\@lbibitem[#1]#2{\item[\@biblabel{#1}\hfill]\if@filesw + {\let\protect\noexpand + \immediate + \write\@auxout{\string\bibcite{#2}{#1}}}\fi\ignorespaces} +% \end{macrocode} +% \end{macro} +% +% +% \begin{macro}{\@bibitem} +% \changes{LaTeX2.09}{1991/11/13}{Changed counter enumi to enumiv, +% as it says in the comment above} +% \changes{LaTeX2.09}{1992/01/10}{Changed \cs{c@enumiv} to \cs{value} +% of \cs{@listctr}} +% \begin{macrocode} +\def\@bibitem#1{\item\if@filesw \immediate\write\@auxout + {\string\bibcite{#1}{\the\value{\@listctr}}}\fi\ignorespaces} +% \end{macrocode} +% \end{macro} +% +% \begin{macro}{\bibcite} +% \changes{v1.1f}{1995/04/24} +% {Make \cs{@onlypreamble} /1388.} +% \changes{v1.1h}{1995/06/19} +% {Call \cs{@newl@bel} so repeated keys produce better warning.} +% \changes{v1.1i}{1995/07/14} +% {Remove \cs{@onlypreamble} so still defined in new \cs{enddocument}} +% \begin{macrocode} +\def\bibcite{\@newl@bel b} +% \end{macrocode} +% \end{macro} +% +% \begin{macro}{\citation} +% \begin{macrocode} +\let\citation\@gobble +% \end{macrocode} +% \end{macro} +% +% \begin{macro}{\cite} +% \changes{v1.1j}{1995/10/16}{(DPC) Make robust} +% \begin{macrocode} +\DeclareRobustCommand\cite{% + \@ifnextchar [{\@tempswatrue\@citex}{\@tempswafalse\@citex[]}} +% \end{macrocode} +% \end{macro} +% +% \begin{macro}{\@citex} +% |\penalty\@m| added to definition of |\@citex| to allow a line +% break after the `,' in citations like [Jones80,Smith77] +% (Added 23 Oct 86) +% +% space added after the `,' (21 Nov 87) +% +% \changes{LaTeX2.09}{1991/10/25} +% {added \cs{reset@font}, suggested by Bernd Raichle.} +% \changes{LaTeX2.09}{1991/11/06} +% {added code to remove a leading blank} +% \changes{LaTeX2.09}{1992/08/14} +% {added missing argument braces around \cs{hbox}, +% found by Ed Sznyter} +% \changes{LaTeX2.09}{1992/08/17} +% {simplified code for removing leading blanks in +% citation key (proposed by Frank Jensen and +% Kresten Krab Thorup)} +% \changes{LaTeX2.09}{1993/08/06} +% {Moved writing to .aux file in loop over citation keys +% so that leading blanks are removed there as well.} +% \changes{v1.0c}{1994/05/05}{Set switch for warning and end of run.} +% \changes{v1.1e}{1995/04/24} +% {Add \cs{mbox} to undefined case: latex/1239.} +% \changes{v1.1g}{1995/05/08}{Use \cs{@firstofone}} +% \changes{v1.1k}{1995/10/20}{Removed refundefined flag} +% \changes{v1.1l}{1995/12/07}{Restored name of \cs{G@refundefinedtrue}} +% \changes{v1.1m}{1997/04/24}{\cs{\@empty} to avoid primitive +% error on empty cite keys. latex/2432} +% \changes{v1.1n}{2002/12/13}{Added \cs{leavevmode} in case citation +% is at start of paragraph (pr/3486)} +% \begin{macrocode} +\def\@citex[#1]#2{\leavevmode + \let\@citea\@empty + \@cite{\@for\@citeb:=#2\do + {\@citea\def\@citea{,\penalty\@m\ }% + \edef\@citeb{\expandafter\@firstofone\@citeb\@empty}% + \if@filesw\immediate\write\@auxout{\string\citation{\@citeb}}\fi +% \end{macrocode} +% Using |\hbox| instead of |\mbox| is fine because of the +% |\leavevmode| above. In fact the use of a box around the citation +% contents is more than questionable in my view (FMi), but within +% 2e I have to keep that for compatibility reasons as it would +% probably change too many existing documents. Its main reason is +% to avoid hyphenation of labels such as [FOOB89] into [FOO- B89] +% so in certain styles it makes sense; but, for example, in author +% year citations it becomes more than questionable. +% +% So Chris added yet another hook here, as suggested by, at least, +% Donald Arsenau. Note that this one is inside the first argument +% of the |\@cite| hook. +% This decouples the top-level typesetting of the citation from +% the details of the other business conducted here. All this really +% needs a complete rethink to get the right modularity. +% +% \changes{v1.1q}{2004/02/15}{Changed to use a hook with default +% value \cs{hbox}} +% \begin{macrocode} + \@ifundefined{b@\@citeb}{\hbox{\reset@font\bfseries ?}% + \G@refundefinedtrue + \@latex@warning + {Citation `\@citeb' on page \thepage \space undefined}}% + {\@cite@ofmt{\csname b@\@citeb\endcsname}}}}{#1}} +% \end{macrocode} +% \end{macro} +% +% +% \begin{macro}{\bibdata} +% \begin{macro}{\bibstyle} +% \begin{macrocode} +\let\bibdata=\@gobble +\let\bibstyle=\@gobble +% \end{macrocode} +% \end{macro} +% \end{macro} +% +% +% \begin{macro}{\bibliography} +% \changes{LaTeX2e}{1994/01/18} +% {Use \cs{@input@} so include files are listed.} +% \begin{macrocode} +\def\bibliography#1{% + \if@filesw + \immediate\write\@auxout{\string\bibdata{#1}}% + \fi + \@input@{\jobname.bbl}} +% \end{macrocode} +% \end{macro} +% +% \begin{macro}{\bibliographystyle} +% \changes{v1.1d}{1994/12/09}{(DPC) Allow use in preamble.} +% \begin{macrocode} +\def\bibliographystyle#1{% + \ifx\@begindocumenthook\@undefined\else + \expandafter\AtBeginDocument + \fi + {\if@filesw + \immediate\write\@auxout{\string\bibstyle{#1}}% + \fi}} +% \end{macrocode} +% \end{macro} +% +% +% \begin{macro}{\nocite} +% (Added 14 Jun 85) +% \changes{v1.1c}{1994/11/10}{Fix \cs{nocite\{*\}}} +% +% This puts information on the |.aux| file that causes +% \BibTeX{} to include the citation list in the bibliography, +% but puts nothing in the text. +% +% RmS 93/08/06: Made loop for |\nocite| like that for |\@citex|, +% to get rid of leading spaces. +% \changes{v1.0b}{1994/05/03}{Make \cs{nocite} issue a warning +% for an undefined citation key.} +% \changes{v1.0c}{1994/05/05}{Do not write page number in +% \cs{nocite} warning message.} +% \changes{v1.0c}{1994/05/05}{Set switch for warning and end of run.} +% \changes{v1.1g}{1995/05/08}{Use \cs{@firstofone}} +% \changes{v1.1k}{1995/10/20}{Removed refundefined flag} +% \begin{macrocode} +\def\nocite#1{\@bsphack +% \end{macrocode} +% With the implementation designed already in \LaTeX\,2.09 the +% |\nocite| command will not work before |\begin{document}| since +% it tries to write to the |.aux| file which is not open before +% that point. As a result the ``reference'' will appear on the +% terminal and nothing else will happen. +% +% This would be easy to fix, but then a document using the fix will +% silently fail on an older release of \LaTeX{}, missing all +% citations done with |\nocite|. Thus we do only generate an error +% message and leave the fix for a \LaTeXe{} successor. +% +% \changes{v1.1o}{2003/05/18}{Check if we are after \cs{document}} +% \changes{v1.1p}{2004/01/04}{Changed error message} +% \begin{macrocode} + \ifx\@onlypreamble\document +% \end{macrocode} +% Since we are after |\begin{document}| we can do the citations: +% \begin{macrocode} + \@for\@citeb:=#1\do{% + \edef\@citeb{\expandafter\@firstofone\@citeb}% + \if@filesw\immediate\write\@auxout{\string\citation{\@citeb}}\fi + \@ifundefined{b@\@citeb}{\G@refundefinedtrue + \@latex@warning{Citation `\@citeb' undefined}}{}}% + \else +% \end{macrocode} +% But before |\begin{document}| we raise an error message: +% \begin{macrocode} + \@latex@error{Cannot be used in preamble}\@eha +% \end{macrocode} +% Without the compatibility problems we could fix the problem as follows: +% \begin{macrocode} + % \AtBeginDocument{\nocite{#1}} + \fi + \@esphack} +% \end{macrocode} +% Since |\nocite{*}| should not produce a warning about undefined +% citation keys (seee PR 557), we need to set the control sequence +% `|\b@*|' to something other than |\relax|. As a result |\cite{*}| +% will not warn either (but that never worked with \BibTeX{} in the +% first place). +% \begin{macrocode} +\expandafter\let\csname b@*\endcsname\@empty +% \end{macrocode} +% \end{macro} +% +% +% \subsection{Default definitions} +% +% This hook determines the `relative formatting' of the two logical +% parts of a citation with comment. +% \begin{macro}{\@cite} +% \begin{macrocode} +\def\@cite#1#2{[{#1\if@tempswa , #2\fi}]} +% \end{macrocode} +% \end{macro} +% +% \begin{macro}{\@cite@ofmt} +% \changes{v1.1q}{2004/02/15}{Added hook with default value \cs{hbox}} +% This is, in general, a command that appears to have one argument +% whose value is, in the kernel, a single cs whose name is the +% expansion of |b@\@citeb|; the expansion of this cs will +% typically be some hmode material that produces the detailed +% typeset form of just the citations themselves. +% \begin{macrocode} +\let\@cite@ofmt\hbox +% \end{macrocode} +% \end{macro} +% +% \begin{macro}{\@biblabel} +% \changes{LaTeX2.09}{1992/01/14}{removed \cs{hfill}} +% \begin{macrocode} +\def\@biblabel#1{[#1]} +% +% \end{macrocode} +% \end{macro} +% +% \Finale +% diff --git a/Master/texmf-dist/source/latex/base/ltboxes.dtx b/Master/texmf-dist/source/latex/base/ltboxes.dtx new file mode 100644 index 00000000000..b838ef47684 --- /dev/null +++ b/Master/texmf-dist/source/latex/base/ltboxes.dtx @@ -0,0 +1,1174 @@ +% \iffalse meta-comment +% +% Copyright 1993 1994 1995 1996 1997 1998 1999 2000 2001 2002 2003 2004 +% The LaTeX3 Project and any individual authors listed elsewhere +% in this file. +% +% This file is part of the LaTeX base system. +% ------------------------------------------- +% +% It may be distributed and/or modified under the +% conditions of the LaTeX Project Public License, either version 1.3 +% of this license or (at your option) any later version. +% The latest version of this license is in +% http://www.latex-project.org/lppl.txt +% and version 1.3 or later is part of all distributions of LaTeX +% version 2003/12/01 or later. +% +% This file has the LPPL maintenance status "maintained". +% +% The list of all files belonging to the LaTeX base distribution is +% given in the file `manifest.txt'. See also `legal.txt' for additional +% information. +% +% The list of derived (unpacked) files belonging to the distribution +% and covered by LPPL is defined by the unpacking scripts (with +% extension .ins) which are part of the distribution. +% +% \fi +% +% \iffalse +%%% From File: ltboxes.dtx +% +%<*driver> +% \fi +\ProvidesFile{ltboxes.dtx} + [1999/04/27 v1.1f LaTeX Kernel (Box Commands)] +% \iffalse +\documentclass{ltxdoc} +\GetFileInfo{ltboxes.dtx} +\title{\filename} +\date{\filedate} +\author{David Carlisle\and + Leslie Lamport\and + Frank Mittelbach\and + Chris Rowley} +\begin{document} +\maketitle + \DocInput{\filename} +\end{document} +% +% \fi +% +% \CheckSum{757} +% +% \changes{v1.1e}{1998/08/17}{(RmS) Minor Documentation fixes.} +% \section{\LaTeX\ Box commands} +% +% +% \DescribeMacro\makebox +% |\makebox[|\meta{wid}|][|\meta{pos}|]{|\meta{obj}|}|\\ +% Puts \meta{obj} in an |\hbox| of width \meta{wid}, positioned by +% \meta{pos}. +% +% The possible \meta{pos} are:\\ +% \begin{tabular}{ll} +% |s| stretched,\\ +% |l| flushleft,\\ +% |r| flushright,\\ +% |c| (default) centred. +% \end{tabular} +% +% If \meta{wid} is missing, then \meta{pos} is also missing and +% \meta{obj} is put in an |\hbox| of its natural width. +% +% |\makebox(|\meta{x}|,|\meta{y}|)[|\meta{pos}|]{|\meta{obj}|}|\\ +% Puts \meta{obj} in an |\hbox| of width $x * |\unitlength|$ +% and height $y * |\unitlength|$. +% \meta{pos} arguments are +% |s|, |l|, |r| or |c| (default) for stretched, flushleft, flushright +% or centred, and |t| or |b| +% for top, bottom -- or combinations like |tr| or |rb|. +% Default for horizontal and vertical are centered. +% Note that in this picture mode version of |\makebox| a [b] aligns on +% the \emph{bottom} of the text as documented. If you want to align on +% the \emph{baseline} use +% |\makebox( , )[b]{\raisebox{0pt}[\height][0pt]{xyz}}}| +% or |\makebox( , )[b]{\smash{xyz}}| +% +% \DescribeMacro\mbox +% |\mbox{|\meta{obj}|}| The same as |\makebox{|\meta{obj}|}|, but is +% more efficient as no checking for optional arguments is done. +% +% \DescribeMacro\newsavebox +% |\newsavebox{\cmd}| : If |\cmd| is undefined, then defines it +% to be a \TeX\ box register. +% +% \DescribeMacro\savebox +% |\savebox{\cmd}| ... : |\cmd| is defined to be a \TeX\ box register, +% and the '...' are any |\makebox| arguments. It is +% like |\makebox|, except it doesn't produce text but +% saves the value in |\box| |\cmd|. +% +% \DescribeMacro\sbox +% |\sbox{|\meta{cmd}|}{|\meta{obj}|}| is an efficient abbreviation for\\ +% |\savebox{|\meta{cmd}|}{|\meta{obj}|}|. +% +% \DescribeEnv{lrbox} +% |\begin{lrbox}{|\meta{cmd}|}|\meta{text}|\end{lrbox}| is equivalent +% to\\ +% |\sbox{|\meta{cmd}|}{|\meta{text}|}|\\ +% except that any white space at the beginning and end of \meta{text} +% is ignored. +% +% \DescribeMacro\framebox +% |\framebox| ... : like |\makebox|, except it puts a `frame' around +% the box. The frame is made of lines of thickness +% |\fboxrule|, separated by space |\fboxsep| from the +% text -- except for |\framebox(X,Y)| ... , where the +% thickness of the lines is as for the picture environment, +% and there is no separation added. +% +% \DescribeMacro\fbox +% |\fbox{|\meta{obj}|}| is an abbreviation for +% |\framebox{|\meta{obj}|}|. +% +% \DescribeMacro\parbox +% |\parbox[|\meta{pos}|][|\meta{height}|][|\meta{inner-pos}|]{|^^A +% \meta{width}|}{|\meta{text}|}| : +% Makes a box with |\hsize| \meta{width}, positioned by \meta{pos} as +% follows: +% c : |\vcenter| (placed in |$...$| if not in math mode) +% b : |\vbox| +% t : |\vtop| +% default value is c. +% Sets |\hsize| := \meta{width} and calls |\@parboxrestore|, which +% does the following: +% Restores the original definitions of: +% +% \begin{tabular}{l} +% |\par|\\ +% |\\|\\ +% |\-|\\ +% |\'|\\ +% | \`|\\ +% |\=| +% \end{tabular} +% +% Resets the following parameters: +% +% \begin{tabular}{l@{\quad=\quad}ll} +% |\parindent| & 0pt \\ +% |\parskip| & 0pt & added 20 Jan 87\\ +% |\linewidth| & |\hsize|\\ +% |\@totalleftmargin| & 0pt\\ +% |\leftskip| & 0pt\\ +% |\rightskip| & 0pt\\ +% |\@rightskip| & 0pt\\ +% |\parfillskip| & 0pt plus 1fil\\ +% |\lineskip| & |\normallineskip|\\ +% |\baselineskip| & |\normalbaselineskip| +% \end{tabular} +% +% Calls |\sloppy| +% +% Note: |\@arrayparboxrestore| same as |\@parboxrestore| +% but it doesn't restore |\\|. +% +% \DescribeEnv{minipage} +% |minipage| : Similar to |\parbox|, except it also +% makes this look like a page by setting +% +% |\textwidth| == |\columnwidth| == box width +% +% changes footnotes by redefining:\\% +% |\@mpfn| == mpfootnote \\ +% |\thempfn| == |\thempfootnote|\\ +% |\@footnotetext| == |\@mpfootnotetext| +% +% resets the following list environment parameters:\\ +% |\@listdepth| == |\@mplistdepth|\\ +% where |\@mplistdepth| is initialized to zero, +% +% and executes |\@minipagerestore| to allow the document +% style to reset any other parameters it desires. +% It sets |@minipage| true, and resets |\everypar| to set +% it false. This switch keeps |\addvspace| from putting space +% at the top of a minipage. +% +% Change added 24 May 89: |\minipage| sets |@minipage| globally; +% |\endminipage| resets it false. +% +% +% \DescribeMacro\rule +% |\rule[|\meta{raised}|]{|\meta{width}|}{|\meta{height}|}| : +% Makes a $\meta{width}*\meta{height}$ rule, raised \meta{raised}. +% +% \DescribeMacro\underline +% |\underline{|\meta{text}|}| : Makes an underlined hbox with +% \meta{text} in it. +% +% \DescribeMacro\raisebox +% |\raisebox{|\meta{distance}|}[|\meta{height}|][|\meta{depth}^^A +% |]{|\meta{box}|}| :\\ +% Raises \meta{box} up by \meta{distance} length (down if +% \meta{distance} negative). Makes \TeX\ think that the new box extends +% \meta{height} above the line and \meta{depth} below, for a total +% vertical length of \meta{height}+\meta{depth}. Default values of +% \meta{height} \& \meta{depth} = actual height and depth of box in new +% position. +% +% \StopEventually{} +% +% \changes{v0.1e}{1994/03/02}{Remove need for drv file} +% \changes{v0.1e}{1994/03/02}{Add 2ekernel module} +% \changes{v1.0a}{1994/03/07}{Unify format with other Kernel files} +% \changes{v1.0f}{1994/05/11} +% {Superfluous braces removed from several commands} +% \changes{v1.0j}{1994/10/18} +% {stuff from ltpatch done} +% \changes{v1.0p}{1994/11/09} +% {more colour changes\ldots} +% \changes{v1.0q}{1994/11/17} +% {\cs{@tempa} to \cs{reserved@a}} +% \changes{v1.0t}{1995/05/07}{Use \cs{hb@xt@}} +% \changes{v1.0w}{1995/10/16}{Clarify makebox description} +% \begin{macrocode} +%<*2ekernel> +\message{boxes,} +% \end{macrocode} +% +% \begin{macro}{\makebox} +% \changes{v0.1a}{1993/12/03} +% {modified} +% |\makebox| User level command just looks for optional |[| or |(|. +% \begin{macrocode} +\def\makebox{% + \leavevmode + \@ifnextchar(%) + \@makepicbox + {\@ifnextchar[\@makebox\mbox}} +% \end{macrocode} +% \end{macro} +% +% \begin{macro}{\mbox} +% \changes{v0.1a}{1993/12/03} +% {extra group} +% \changes{v1.0j}{1994/10/18} +% {\cs{long} added} +% The basic horizontal box command for \LaTeX. +% \begin{macrocode} +\long\def\mbox#1{\leavevmode\hbox{#1}} +% \end{macrocode} +% \end{macro} +% +% \begin{macro}{\@makebox} +% \changes{v0.1a}{1993/12/03} +% {default changed from x to c} +% Look for a possible second optional argument (defaults to |c|). +% \begin{macrocode} +\def\@makebox[#1]{% + \@ifnextchar [{\@imakebox[#1]}{\@imakebox[#1][c]}} +% \end{macrocode} +% \end{macro} +% +% +% \begin{macro}{\@begin@tempboxa} +% \changes{v0.1a}{1993/12/03} +% {macro added} +% \changes{v0.1b}{1993/12/08} +% {Extra braces for color support +% (braces removed from other macros)} +% \changes{v1.0f}{1994/05/11} +% {Use new \cs{color@setgroup} concept.} +% Helper macro for supporting |\height|, |\width| etc. Grab |#1| into +% |\@tempboxa| and measure it. +% \begin{macrocode} +\long\def\@begin@tempboxa#1#2{% + \begingroup + \setbox\@tempboxa#1{\color@begingroup#2\color@endgroup}% + \def\width{\wd\@tempboxa}% + \def\height{\ht\@tempboxa}% + \def\depth{\dp\@tempboxa}% + \let\totalheight\@ovri + \totalheight\height + \advance\totalheight\depth} +% \end{macrocode} +% \end{macro} +% +% \begin{macro}{\@end@tempboxa} +% \changes{v0.1a}{1993/12/03} +% {macro added} +% End the group started by |\@begin@tempboxa|, so that the scope of +% |\height| only includes the `length' argument to the user-command. +% \begin{macrocode} +\let\@end@tempboxa\endgroup +% \end{macrocode} +% \end{macro} +% +% \begin{macro}{\bm@c} +% \begin{macro}{\bm@l} +% \begin{macro}{\bm@r} +% \begin{macro}{\bm@s} +% \begin{macro}{\bm@t} +% \begin{macro}{\bm@b} +% \changes{v0.1a}{1993/12/03} +% {macros added} +% Set up spacing. +% \begin{macrocode} +\def\bm@c{\hss\unhbox\@tempboxa\hss} +\def\bm@l{\unhbox\@tempboxa\hss}\let\bm@t\bm@l +\def\bm@r{\hss\unhbox\@tempboxa}\let\bm@b\bm@r +\def\bm@s{\unhbox\@tempboxa} +% \end{macrocode} +% \end{macro} +% \end{macro} +% \end{macro} +% \end{macro} +% \end{macro} +% \end{macro} +% +% \begin{macro}{\@imakebox} +% \changes{v0.1a}{1993/12/03} +% {macro modified} +% Internal form of |\makebox|. +% \begin{macrocode} +\long\def\@imakebox[#1][#2]#3{% + \@begin@tempboxa\hbox{#3}% + \setlength\@tempdima{#1}% support calc + \hb@xt@\@tempdima{\csname bm@#2\endcsname}% + \@end@tempboxa} +% \end{macrocode} +% \end{macro} +% +% \begin{macro}{\@makepicbox} +% \changes{v0.1a}{1993/12/03} +% {macro modified} +% Picture mode form of |\makebox|. +% \begin{macrocode} +\def\@makepicbox(#1,#2){% + \@ifnextchar[{\@imakepicbox(#1,#2)}{\@imakepicbox(#1,#2)[]}} +% \end{macrocode} +% \end{macro} +% +% \begin{macro}{\@imakepicbox} +% picture mode version +% \begin{macrocode} +\long\def\@imakepicbox(#1,#2)[#3]#4{% + \vbox to#2\unitlength + {\let\mb@b\vss \let\mb@l\hss\let\mb@r\hss + \let\mb@t\vss + \@tfor\reserved@a :=#3\do{% + \if s\reserved@a + \let\mb@l\relax\let\mb@r\relax + \else + \expandafter\let\csname mb@\reserved@a\endcsname\relax + \fi}% + \mb@t + \hb@xt@ #1\unitlength{\mb@l #4\mb@r}% + \mb@b +% \end{macrocode} +% This kern ensures that a |b| option aligns on the bottom of the +% text rather than the baseline. this is the documented behaviour in +% the \LaTeX Book. The kern is removed in compatibility mode. +% \begin{macrocode} + \kern\z@}} +% \end{macrocode} +% \end{macro} +% +% +% \begin{macro}{\set@color} +% \changes{v0.1a}{1993/12/03} +% {macro added} +% \changes{v0.1a}{1993/12/03} +% {color support} +% This macro is initialy a no-op, but the colour package will redefine +% it to insert a |\special|. +% \begin{macrocode} +\let\set@color\relax +% \end{macrocode} +% \end{macro} +% +% \begin{macro}{\color@begingroup} +% \changes{v1.0b}{1994/03/14} +% {macro added for colour support} +% \begin{macro}{\color@endgroup} +% \changes{v1.0b}{1994/03/14} +% {macro added for colour support} +% \begin{macro}{\color@setgroup} +% \changes{v1.0f}{1994/05/11} +% {macro added for colour support} +% \begin{macro}{\normalcolor} +% \changes{v1.0g}{1994/05/12} +% {macro added for colour support} +% \begin{macro}{\color@hbox} +% \changes{v1.0n}{1994/11/05} +% {macro added for colour support} +% \begin{macro}{\color@vbox} +% \changes{v1.0r}{1994/11/18} +% {macro added for colour support} +% \begin{macro}{\color@endbox} +% \changes{v1.0n}{1994/11/05} +% {macro added for colour support} +% These macros are initialy a no-op, but the colour package will +% redefine them to be |\begingroup|, |\endgroup|, +% |\begingroup\set@color|,\\ |\hbox\bgroup\color@begingroup|, +% |\color@endgroup\egroup|. +% and \meta{set to main document colour} respectively. +% \begin{macrocode} +\let\color@begingroup\relax +\let\color@endgroup\relax +\let\color@setgroup\relax +\let\normalcolor\relax +\let\color@hbox\relax +\let\color@vbox\relax +\let\color@endbox\relax +% \end{macrocode} +% \end{macro} +% \end{macro} +% \end{macro} +% \end{macro} +% \end{macro} +% \end{macro} +% \end{macro} +% +% \begin{macro}{\newsavebox} +% \changes{v0.1a}{1993/12/03} +% {Pass the whole of arg 1 to \cs{@ifdefinable}} +% Allocate a new `savebox'. +% \begin{macrocode} +\def\newsavebox#1{\@ifdefinable{#1}{\newbox#1}} +% \end{macrocode} +% \end{macro} +% +% \begin{macro}{\savebox} +% Save |#1| in a box register. +% \begin{macrocode} +\def\savebox#1{% + \@ifnextchar(%) + {\@savepicbox#1}{\@ifnextchar[{\@savebox#1}{\sbox#1}}} +% \end{macrocode} +% \end{macro} +% +% \begin{macro}{\sbox} +% \changes{v0.1a}{1993/12/03} +% {extra group} +% \changes{v0.1a}{1993/12/03} +% {color support} +% \changes{v1.0b}{1994/03/14} +% {Use \cs{color@setgroup}} +% \changes{v1.0j}{1994/10/18} +% {\cs{long} added} +% Save |#1| in a box register. +% \begin{macrocode} +\long\def\sbox#1#2{\setbox#1\hbox{% + \color@setgroup#2\color@endgroup}} +% \end{macrocode} +% \end{macro} +% +% \begin{macro}{\@savebox} +% \changes{v0.1a}{1993/12/03} +% {default c not x} +% Look for second optional argument. +% \begin{macrocode} +\def\@savebox#1[#2]{% + \@ifnextchar [{\@isavebox#1[#2]}{\@isavebox#1[#2][c]}} +% \end{macrocode} +% \end{macro} +% +% \begin{macro}{\@isavebox} +% \changes{v0.1a}{1993/12/03} +% {extra group} +% \changes{v0.1a}{1993/12/03} +% {color support} +% \changes{v1.0b}{1994/03/14} +% {Use \cs{color@setgroup}} +% \changes{v1.0d}{1994/04/15} +% {Added missing precent character.} +% \changes{v1.0v}{1995/07/20} +% {Use \cs{sbox}} +% \begin{macrocode} +\long\def\@isavebox#1[#2][#3]#4{% + \sbox#1{\@imakebox[#2][#3]{#4}}} +% \end{macrocode} +% \end{macro} +% +% \begin{macro}{\@savepicbox} +% Picture mode version of |\savebox|. +% \begin{macrocode} +\def\@savepicbox#1(#2,#3){% + \@ifnextchar[%] + {\@isavepicbox#1(#2,#3)}{\@isavepicbox#1(#2,#3)[]}} +% \end{macrocode} +% \end{macro} +% +% \begin{macro}{\@isavepicbox} +% \changes{v0.1a}{1993/12/03} +% {extra group} +% \changes{v1.0b}{1994/03/14} +% {Use \cs{color@setgroup}} +% \changes{v1.0l}{1994/10/25} +% {missing percent (moved from ltpatch)} +% \changes{v1.0v}{1995/07/20} +% {Use \cs{sbox}} +% Picture mode version of |\savebox|. +% \begin{macrocode} +\long\def\@isavepicbox#1(#2,#3)[#4]#5{% + \sbox#1{\@imakepicbox(#2,#3)[#4]{#5}}} +% \end{macrocode} +% \end{macro} +% +% \begin{macro}{\lrbox} +% \changes{v0.1a}{1993/12/03} +% {macro added} +% \changes{v0.1a}{1993/12/03} +% {color support} +% \changes{v0.1b}{1993/12/08} +% {move \cs{@endpefalse} out of the inner group} +% \changes{v1.0b}{1994/03/14} +% {Use \cs{color@setgroup}} +% |lrbox|: the new environment form of |\sbox|. Use |\aftergroup| tricks +% to enable a \emph{local} assignment to be made to the box, in a way +% that it still has an effect \emph{outside} the |lrbox| environment. +% \begin{macrocode} +\def\lrbox#1{% + \edef\reserved@a{% + \endgroup + \setbox#1\hbox{% + \begingroup\aftergroup}% + \def\noexpand\@currenvir{\@currenvir}% + \def\noexpand\@currenvline{\on@line}}% + \reserved@a + \@endpefalse + \color@setgroup + \ignorespaces} +% \end{macrocode} +% \end{macro} +% +% \begin{macro}{\endlrbox} +% \changes{v0.1a}{1993/12/03} +% {macro added} +% End the |lrbox| environment. +% \begin{macrocode} +\def\endlrbox{\unskip\color@endgroup} +% \end{macrocode} +% \end{macro} +% +% \begin{macro}{\usebox} +% unchanged +% \begin{macrocode} +\def\usebox#1{\leavevmode\copy #1\relax} +% \end{macrocode} +% \end{macro} +% +% \begin{macro}{\frame} +% +% The following definition of |\frame| was written by Pavel Curtis +% (Extra space removed 14 Jan 88) +% RmS 92/08/24: Replaced occurence of |\@halfwidth| by |\@wholewidth| +% \begin{macrocode} +\long\def\frame#1{% + \leavevmode + \hbox{% + \hskip-\@wholewidth + \vbox{% + \vskip-\@wholewidth + \hrule \@height\@wholewidth + \hbox{% + \vrule\@width\@wholewidth + #1% + \vrule\@width\@wholewidth}% + \hrule\@height\@wholewidth + \vskip-\@wholewidth}% + \hskip-\@wholewidth}} +% \end{macrocode} +% \end{macro} +% +% \begin{macro}{\fboxrule} +% \begin{macro}{\fboxsep} +% user level parameters, +% \begin{macrocode} +\newdimen\fboxrule +\newdimen\fboxsep +% \end{macrocode} +% \end{macro} +% \end{macro} +% +% \begin{macro}{\fbox} +% Abbreviated framed box command. +% \changes{v0.1a}{1993/12/03} +% {extra group} +% \changes{v1.0g}{1994/05/12} +% {New definition, merged with \cs{framebox}} +% \changes{v1.0i}{1994/06/01} +% {New version, using \cs{@frameb@x}} +% \changes{v1.0j}{1994/10/18} +% {\cs{long} added} +% \changes{v1.0k}{1994/10/24} +% {Inner braces added (to fix latex/1061)} +% \changes{v1.0s}{1995/04/27} +% {Move \cs{leavevmode} for graphics/1512} +% \begin{macrocode} +\long\def\fbox#1{% + \leavevmode + \setbox\@tempboxa\hbox{% + \color@begingroup + \kern\fboxsep{#1}\kern\fboxsep + \color@endgroup}% + \@frameb@x\relax} +% \end{macrocode} +% \end{macro} +% +% \begin{macro}{\framebox} +% Framed version of |\makebox|. +% \changes{v1.0g}{1994/05/12} +% {Merged \cs{fbox} and \cs{framebox}} +% \changes{v1.0i}{1994/06/01} +% {New version, so \cs{width} is correct in \cs{framebox}} +% \begin{macrocode} +\def\framebox{% + \@ifnextchar(%) + \@framepicbox{\@ifnextchar[\@framebox\fbox}} +% \end{macrocode} +% \end{macro} +% +% \begin{macro}{\@framebox} +% Deal with optional arguments. +% \begin{macrocode} +\def\@framebox[#1]{% + \@ifnextchar[%] + {\@iframebox[#1]}% + {\@iframebox[#1][c]}} +% \end{macrocode} +% \end{macro} +% +% \begin{macro}{\@iframebox} +% The handling the optional arguments. +% \changes{v1.0i}{1994/06/01} +% {New version, so \cs{width} is correct in \cs{framebox}} +% \changes{v1.0j}{1994/10/18} +% {\cs{leavevmode} moved to \cs{@frameb@x}} +% \changes{v1.0s}{1995/04/27} +% {Move \cs{leavevmode} for graphics/1512} +% In order to set the whole box, including the frame to the +% specified dimension, we first determine that dimension +% from the natural size of the text, |#3|. +% calculated width. +% \begin{macrocode} +\long\def\@iframebox[#1][#2]#3{% + \leavevmode + \@begin@tempboxa\hbox{#3}% + \setlength\@tempdima{#1}% + \setbox\@tempboxa\hb@xt@\@tempdima + {\kern\fboxsep\csname bm@#2\endcsname\kern\fboxsep}% + \@frameb@x{\kern-\fboxrule}% + \@end@tempboxa} +% \end{macrocode} +% \end{macro} +% +% \begin{macro}{\@frameb@x} +% Common part of |\framebox| and |\fbox|. |#1| is a negative kern +% in the |\framebox| case so that the vertical rules do not add to the +% width of the box. +% \changes{v1.0i}{1994/06/01} +% {Macro added.} +% \changes{v1.0j}{1994/10/18} +% {\cs{leavevmode} added} +% \changes{v1.0s}{1995/04/27} +% {Move \cs{leavevmode} for graphics/1512} +% \begin{macrocode} +\def\@frameb@x#1{% + \@tempdima\fboxrule + \advance\@tempdima\fboxsep + \advance\@tempdima\dp\@tempboxa + \hbox{% + \lower\@tempdima\hbox{% + \vbox{% + \hrule\@height\fboxrule + \hbox{% + \vrule\@width\fboxrule + #1% + \vbox{% + \vskip\fboxsep + \box\@tempboxa + \vskip\fboxsep}% + #1% + \vrule\@width\fboxrule}% + \hrule\@height\fboxrule}% + }% + }% +} +% \end{macrocode} +% \end{macro} +% +% \begin{macro}{\@framepicbox} +% Picture mode version. +% \begin{macrocode} +\def\@framepicbox(#1,#2){% + \@ifnextchar[{\@iframepicbox(#1,#2)}{\@iframepicbox(#1,#2)[]}} +% \end{macrocode} +% \end{macro} +% +% \begin{macro}{\@iframepicbox} +% Picture mode version. +% \begin{macrocode} +\long\def\@iframepicbox(#1,#2)[#3]#4{% + \frame{\@imakepicbox(#1,#2)[#3]{#4}}} +% \end{macrocode} +% \end{macro} +% +% \begin{macro}{\parbox} +% \changes{v0.1a}{1993/12/03} +% {Redefined to support extra optional arguments} +% \changes{v0.1d}{1993/12/15} +% {Changed default from `c' to `s'} +% The main vertical-box command for \LaTeX. +% \begin{macrocode} +\def\parbox{% + \@ifnextchar[%] + \@iparbox + {\@iiiparbox c\relax[s]}} +% \end{macrocode} +% \end{macro} +% +% \begin{macro}{\@iparbox} +% \changes{v0.1d}{1993/12/15} +% {Changed default from `c' to `s'} +% Optional argument handling. +% \begin{macrocode} +\def\@iparbox[#1]{% + \@ifnextchar[%] + {\@iiparbox{#1}}% + {\@iiiparbox{#1}\relax[s]}} +% \end{macrocode} +% \end{macro} +% +% \begin{macro}{\@iiparbox} +% Optional argument handling. +% \begin{macrocode} +\def\@iiparbox#1[#2]{% + \@ifnextchar[%] + {\@iiiparbox{#1}{#2}}% + {\@iiiparbox{#1}{#2}[#1]}} +% \end{macrocode} +% \end{macro} +% +% \begin{macro}{\@iiiparbox} +% \begin{macro}{\@parboxto} +% \changes{v1.0j}{1994/10/18} +% {Macro added to remove misuse of \cs{@empty}} +% \changes{v0.1b}{1993/12/08} +% {\cs{endgraf} added due to extra group in \cs{@begin@tempboxa}} +% \changes{v1.0y}{1996/06/10} +% {(DPC) Changed \cs{endgraf} to \cs{@@par}} +% \changes{v1.1f}{1999/04/27} +% {(CAR) Changed \cs{@empty} to \cs{relax} as flag for natural +% width: pr/2975} +% The internal version of |\parbox|. +% \begin{macrocode} +\let\@parboxto\@empty +\long\def\@iiiparbox#1#2[#3]#4#5{% + \leavevmode + \@pboxswfalse + \setlength\@tempdima{#4}% + \@begin@tempboxa\vbox{\hsize\@tempdima\@parboxrestore#5\@@par}% + \ifx\relax#2\else + \setlength\@tempdimb{#2}% + \def\@parboxto{to\@tempdimb}% + \fi + \if#1b\vbox + \else\if #1t\vtop + \else\ifmmode\vcenter + \else\@pboxswtrue $\vcenter + \fi\fi\fi + \@parboxto{\let\hss\vss\let\unhbox\unvbox + \csname bm@#3\endcsname}% + \if@pboxsw \m@th$\fi + \@end@tempboxa} +% \end{macrocode} +% \end{macro} +% \end{macro} +% +% \changes{v1.0c}{1994/04/12} +% {Remove \cs{@acci}, now defined in ltplain.dtx} +% \changes{v1.0c}{1994/04/12} +% {Remove \cs{@dischyph}, now defined in ltinit.dtx} +% +% \begin{macro}{\@arrayparboxrestore} +% Restore various paragraph parameters. +% +% The rational for allowing two normally global flags to be set +% locally here was stated originally by +% Donald Arsenau and extended by Chris Rowley. +% It is because these flags are only set globally to +% true by section commands, and these should never appear within +% boxes or, indeed, in any group; and they are only ever +% set globally to false when they are definitely true. +% +% If anyone is unhappy with this argument then both flags should be +% treated as in |\set@nobreak|; otherwise this command will be +% redundant. +% \changes{v1.1a}{1996/10/24}{Added local settings of flags: dangerous!!} +% \begin{macrocode} +\def\@arrayparboxrestore{% + \let\if@nobreak\iffalse + \let\if@noskipsec\iffalse + \let\par\@@par + \let\-\@dischyph +% \end{macrocode} +% Redefined accents to allow changes in font encoding +% \changes{v1.0h}{1994/05/13} +% {New accent system, use \cs{let} not \cs{def}} +% \begin{macrocode} + \let\'\@acci\let\`\@accii\let\=\@acciii + \parindent\z@ \parskip\z@skip + \everypar{}% + \linewidth\hsize + \@totalleftmargin\z@ + \leftskip\z@skip \rightskip\z@skip \@rightskip\z@skip + \parfillskip\@flushglue \lineskip\normallineskip + \baselineskip\normalbaselineskip + \sloppy} +% \end{macrocode} +% \end{macro} +% +% \begin{macro}{\parboxrestore} +% Restore various paragraph parameters, and also |\\|. +% \begin{macrocode} +\def\@parboxrestore{\@arrayparboxrestore\let\\\@normalcr} +% \end{macrocode} +% \end{macro} +% +% \begin{macro}{\if@minipage} +% Switch that is true at the start of a minipage. +% \changes{v1.0z}{1996/07/26}{put \cs{global} into definition} +% \begin{macrocode} +\def\@minipagefalse{\global\let\if@minipage\iffalse} +\def\@minipagetrue {\global\let\if@minipage\iftrue} +\@minipagefalse +% \end{macrocode} +% \end{macro} +% +% \begin{macro}{\minipage} +% \changes{v0.1a}{1993/12/03} +% {Redefined to support extra optional arguments} +% \changes{v0.1d}{1993/12/15} +% {extra space removed.} +% \changes{v0.1d}{1993/12/15} +% {Changed default from `c' to `s'} +% Essentially an environment form of |\parbox|. +% \begin{macrocode} +\def\minipage{% + \@ifnextchar[%] + \@iminipage + {\@iiiminipage c\relax[s]}} +% \end{macrocode} +% \end{macro} +% +% \begin{macro}{\@iminipage} +% \changes{v0.1d}{1993/12/15} +% {Changed default from `c' to `s'} +% Optional argument handling. +% \begin{macrocode} +\def\@iminipage[#1]{% + \@ifnextchar[%] + {\@iiminipage{#1}}% + {\@iiiminipage{#1}\relax[s]}} +% \end{macrocode} +% \end{macro} +% +% \begin{macro}{\@iiminipage} +% Optional argument handling. +% \begin{macrocode} +\def\@iiminipage#1[#2]{% + \@ifnextchar[%] + {\@iiiminipage{#1}{#2}}% + {\@iiiminipage{#1}{#2}[#1]}} +% \end{macrocode} +% \end{macro} +% +% \begin{macro}{\@iiiminipage} +% \changes{v1.0e}{1994/04/21} +% {Extra \cs{bgroup} for colour} +% \changes{v1.0f}{1994/05/11} +% {Use new \cs{color@setgroup} concept.} +% Internal form of |minipage|. +% \changes{v1.1a}{1996/10/24}{Use it or lose it (@setminpage): Frank +% will want to lose it} +% \begin{macrocode} +\def\@iiiminipage#1#2[#3]#4{% + \leavevmode + \@pboxswfalse + \setlength\@tempdima{#4}% + \def\@mpargs{{#1}{#2}[#3]{#4}}% + \setbox\@tempboxa\vbox\bgroup + \color@begingroup + \hsize\@tempdima + \textwidth\hsize \columnwidth\hsize + \@parboxrestore + \def\@mpfn{mpfootnote}\def\thempfn{\thempfootnote}\c@mpfootnote\z@ + \let\@footnotetext\@mpfootnotetext + \let\@listdepth\@mplistdepth \@mplistdepth\z@ + \@minipagerestore + \@setminipage} +% \end{macrocode} +% \end{macro} +% +% \begin{macro}{\@minipagerestore} +% Hook so that other styles can reset other commands in a minipage. +% \begin{macrocode} + \let\@minipagerestore=\relax +% \end{macrocode} +% \end{macro} +% +% +% \begin{macro}{\endminipage} +% \changes{LaTeX209}{1992/08/14} +% {(RmS) replaced \cs{vskip}-\cs{lastskip} by \cs{unskip} +% (proposed by FMi)} +% \changes{v1.0e}{1994/04/21} +% {Extra \cs{egroup} for colour} +% \changes{v1.0f}{1994/05/11} +% {Use new \cs{color@setgroup} concept.} +% \changes{v1.0n}{1994/11/05} +% {Colour resetting for footnotes moved to here: as for main +% page.} +% \begin{macrocode} +\def\endminipage{% + \par + \unskip + \ifvoid\@mpfootins\else + \vskip\skip\@mpfootins + \normalcolor + \footnoterule + \unvbox\@mpfootins + \fi + \@minipagefalse %% added 24 May 89 + \color@endgroup + \egroup + \expandafter\@iiiparbox\@mpargs{\unvbox\@tempboxa}} +% \end{macrocode} +% \end{macro} +% +% \begin{macro}{\@mplistdepth} +% \begin{macro}{\@mpfootins} +% Versions of |\@listdepth| and |\footins| local to minipage. +% \begin{macrocode} +\newcount\@mplistdepth +\newinsert\@mpfootins +% \end{macrocode} +% \end{macro} +% \end{macro} +% +% \begin{macro}{\@mpfootnotetext} +% Minipage version of |\@footnotetext|. +% +% Final |\strut| added 27 Mar 89, on suggestion by Don Hosek +% \changes{LaTeX2.09}{1991/09/29}{(RmS) added \cs{reset@font}} +% \changes{LaTeX2.09}{1992/11/26}{(RmS) added protection for \cs{edef}} +% \changes{v0.1a}{1994/03/07}{Extra group for colour} +% \changes{v1.0e}{1994/04/21} +% {Extra \cs{endgraf} for colour} +% \changes{v1.0f}{1994/05/11} +% {Use new \cs{color@setgroup} concept.} +% \changes{v1.0f}{1994/05/11} +% {Use new \cs{normalcolor} and \cs{@finalstrut}.} +% \changes{v1.0m}{1994/11/04} +% {Added \cs{protected@edef}. ASAJ.} +% \changes{v1.0n}{1994/11/05} +% {Colour resetting for footnotes moved to endminipage: as for main +% page.} +% \changes{v1.0o}{1994/11/05} +% {Colour groups restored here.} +% \begin{macrocode} +\long\def\@mpfootnotetext#1{% + \global\setbox\@mpfootins\vbox{% + \unvbox\@mpfootins + \reset@font\footnotesize + \hsize\columnwidth + \@parboxrestore + \protected@edef\@currentlabel + {\csname p@mpfootnote\endcsname\@thefnmark}% + \color@begingroup + \@makefntext{% + \rule\z@\footnotesep\ignorespaces#1\@finalstrut\strutbox}% + \color@endgroup}} +% \end{macrocode} +% \end{macro} +% +% \begin{macrocode} +\newif\if@pboxsw +% \end{macrocode} +% +% \begin{macro}{\rule} +% Draw a rule of the specified size. +% \begin{macrocode} +\def\rule{\@ifnextchar[\@rule{\@rule[\z@]}} +% \end{macrocode} +% \end{macro} +% +% \begin{macro}{\@rule} +% Internal form of |\rule|. +% \changes{v1.1c}{1998/06/04}{Support calc-expressions} +% \begin{macrocode} + \def\@rule[#1]#2#3{% + \leavevmode + \hbox{% + \setlength\@tempdima{#1}% + \setlength\@tempdimb{#2}% + \setlength\@tempdimc{#3}% + \advance\@tempdimc\@tempdima + \vrule\@width\@tempdimb\@height\@tempdimc\@depth-\@tempdima}} +% \end{macrocode} +% \end{macro} +% +% \begin{macro}{\@@underline} +% Saved primitive |\underline|. +% \begin{macrocode} +\let\@@underline\underline +% \end{macrocode} +% \end{macro} +% +% \begin{macro}{\underline} +% \LaTeX\ version works outside math. +% \task{???}{why the second `relax in `underline ?} +% \begin{macrocode} +\def\underline#1{% + \relax + \ifmmode\@@underline{#1}% + \else $\@@underline{\hbox{#1}}\m@th$\relax\fi} +% \end{macrocode} +% \end{macro} +% +% \begin{macro}{\raisebox} +% \changes{v0.1a}{1993/12/03} +% {redefined to support \cs{height}} +% \changes{v1.0s}{1995/04/27} +% {Move \cs{leavevmode} for graphics/1512} +% Raise a box, and change its vertical dimensions. +% \begin{macrocode} +\def\raisebox#1{% + \leavevmode + \@ifnextchar[{\@rsbox{#1}}{\@irsbox{#1}[]}} +% \end{macrocode} +% \end{macro} +% +% \begin{macro}{\@rsbox} +% Optional argument handling. +% \begin{macrocode} +\def\@rsbox#1[#2]{% + \@ifnextchar[{\@iirsbox{#1}[#2]}{\@irsbox{#1}[#2]}} +% \end{macrocode} +% \end{macro} +% +% \begin{macro}{\@argrsbox} +% \changes{v0.1a}{1993/12/03} +% {macro removed} +% ... +% \end{macro} +% +% \begin{macro}{\@irsbox} +% \changes{v0.1a}{1993/12/03} +% {redefined to support \cs{height}} +% \changes{v0.1b}{1993/12/08} +% {fix typo} +% \changes{v0.1c}{1993/12/09} +% {fix another typo} +% \changes{v0.1f}{1994/03/03} +% {Replaced a missing \cs{else}} +% \changes{v1.0s}{1995/04/27} +% {Move \cs{leavevmode} for graphics/1512} +% \changes{v1.0u}{1995/05/17} +% {Removed surplus braces} +% Internal version of |\raisebox| (less than two optional args). +% \begin{macrocode} +\long\def\@irsbox#1[#2]#3{% + \@begin@tempboxa\hbox{#3}% + \setlength\@tempdima{#1}% + \ifx\\#2\\\else\setlength\@tempdimb{#2}\fi + \setbox\@tempboxa\hbox{\raise\@tempdima\box\@tempboxa}% + \ifx\\#2\\\else\ht\@tempboxa\@tempdimb\fi + \box\@tempboxa + \@end@tempboxa} +% \end{macrocode} +% \end{macro} +% +% \begin{macro}{\@iirsbox} +% \changes{v0.1a}{1993/12/03} +% {redefined to support \cs{height}} +% \changes{v1.0s}{1995/04/27} +% {Move \cs{leavevmode} for graphics/1512} +% Internal version of |\raisebox| (two optional args). +% \begin{macrocode} +\long\def\@iirsbox#1[#2][#3]#4{% + \@begin@tempboxa\hbox{#4}% + \setlength\@tempdima{#1}% + \setlength\@tempdimb{#2}% + \setlength\dimen@{#3}% + \setbox\@tempboxa\hbox{\raise\@tempdima\box\@tempboxa}% + \ht\@tempboxa\@tempdimb + \dp\@tempboxa\dimen@ + \box\@tempboxa + \@end@tempboxa} +% \end{macrocode} +% \end{macro} +% +% \begin{macro}{\@finalstrut} +% This macro adds a special strut the \emph{depth} of the box given as +% |#1|, and height and width 0pt. It is used for ensuring that the +% last line of a paragraph has the correct depth in `p' columns of +% tables and in footnotes. In vertical mode nothing is done, as adding +% the strut (as done in 2.09) would start a new paragraph. It would be +% possible to inspect |\prevdepth| to check the depth of the +% just-completed paragraph, but we do not do that here. +% \changes{v1.0g}{1994/05/12} +% {macro added} +% Actually we do even less now, skip the vmode test as it broke tabular +% `p' columns. +% \changes{v1.0p}{1994/11/09} +% {Revert \cs{finalstrut} to 2.09 equivalent (from ltpatch)}. +% \changes{v1.0x}{1995/10/31} +% {Add \cs{nobreak} in horiz mode to allow hyphenation. +% internal/1931} +% +% The |\nobreak| was added (1995/10/31) to allow hyphenation of the +% final word of the paragraph. +% \begin{macrocode} +\def\@finalstrut#1{% + \unskip\ifhmode\nobreak\fi\vrule\@width\z@\@height\z@\@depth\dp#1} +% \end{macrocode} +% \end{macro} +% +% +% \subsection{Some low-level constructs} +% +% The following commands are basically inherited from plain \TeX. +% +% \begin{macro}{\leftline} +% \begin{macro}{\rightline} +% \begin{macro}{\centerline} +% \begin{macro}{\@@line} +% These macros place text on a full line either centred or left or +% right adjusted. +% \begin{macrocode} +\def\@@line{\hb@xt@\hsize} +\def\leftline#1{\@@line{#1\hss}} +\def\rightline#1{\@@line{\hss#1}} +\def\centerline#1{\@@line{\hss#1\hss}} +% \end{macrocode} +% \end{macro} +% \end{macro} +% \end{macro} +% \end{macro} +% +% +% \begin{macro}{\rlap} +% \begin{macro}{\llap} +% These macros place text to the left or right of the current +% reference point without taking up space. +% \end{macro} +% \begin{macrocode} +\def\rlap#1{\hb@xt@\z@{#1\hss}} +\def\llap#1{\hb@xt@\z@{\hss#1}} +% \end{macrocode} +% \end{macro} +% +% \begin{macrocode} +% +% \end{macrocode} +% +% \Finale +\endinput +% +% \Finale +% diff --git a/Master/texmf-dist/source/latex/base/ltclass.dtx b/Master/texmf-dist/source/latex/base/ltclass.dtx new file mode 100644 index 00000000000..6b4c5a20626 --- /dev/null +++ b/Master/texmf-dist/source/latex/base/ltclass.dtx @@ -0,0 +1,1694 @@ +% \iffalse meta-comment +% +% Copyright 1993 1994 1995 1996 1997 1998 1999 2000 2001 2002 2003 2004 +% The LaTeX3 Project and any individual authors listed elsewhere +% in this file. +% +% This file is part of the LaTeX base system. +% ------------------------------------------- +% +% It may be distributed and/or modified under the +% conditions of the LaTeX Project Public License, either version 1.3 +% of this license or (at your option) any later version. +% The latest version of this license is in +% http://www.latex-project.org/lppl.txt +% and version 1.3 or later is part of all distributions of LaTeX +% version 2003/12/01 or later. +% +% This file has the LPPL maintenance status "maintained". +% +% The list of all files belonging to the LaTeX base distribution is +% given in the file `manifest.txt'. See also `legal.txt' for additional +% information. +% +% The list of derived (unpacked) files belonging to the distribution +% and covered by LPPL is defined by the unpacking scripts (with +% extension .ins) which are part of the distribution. +% +% \fi +% +% \iffalse +%%% From File: ltclass.dtx +% +%<*driver> +% \fi +\ProvidesFile{ltclass.dtx} + [2004/01/28 v1.1g LaTeX Kernel (Class & Package Interface)] +% \iffalse +\documentclass{ltxdoc} +\GetFileInfo{ltclass.dtx} +\begin{document} +\title{The main structure of documents} +\author{Frank Mittelbach\and Chris Rowley\and Alan Jeffrey\and + David Carlisle} +\date{\filedate} +\maketitle + \DocInput{\filename} +\end{document} +% +% \fi +% +% \iffalse +% (C) Copyright Frank Mittelbach, Chris Rowley, +% Alan Jeffrey and David Carlisle 1993-1998. +% All rights reserved. +% \fi +% +% \CheckSum{1194} +% +% \changes{v1.0f}{1994/05/22}{Use new warning and error commands} +% \changes{v1.0l}{1994/11/17}{\cs{@tempa} to \cs{reserved@a}} +% \changes{v1.0z}{1998/03/21}{Added to documentation of filecontents} +% \changes{v1.1c}{1998/08/17}{(RmS) Minor documentation fixes.} +% +% \section{Introduction} +% +% This file implements the following declarations, which replace +% |\documentstyle| in \LaTeXe\ documents. +% +% Note that old documents containing |\documentstyle| will be run using +% a compatibility option---thus keeping everyone happy, we hope! +% +% The overall idea is that there are two types of `style files': +% `class files' which define elements and provide a default formatting +% for them; and `packages' which provide extra functionality. One +% difference between \LaTeXe\ and \LaTeX2.09 is that \LaTeXe\ packages +% may have options. Note that options to classes packages may be +% implemented such that they input files, but these file names are not +% necessarily directly related to the option name. +% +% \section{User interface} +% +% |\documentclass[|\meta{main-option-list}|]{|^^A +% \meta{class}|}[|\meta{version}|]| +% +% There must be exactly one such declaration, and it must come first. +% The \meta{main-option-list} is a list of options which can modify the +% formatting of elements which are defined in the \meta{class} file +% as well as in all following |\usepackage| declarations (see below). +% The \meta{version} is a version number, beginning with a date in the +% format |YYYY/MM/DD|. If an older version of the class is found, a +% warning is issued. +% +% \bigskip +% +% |\documentstyle[|\meta{main-option-list}|]{|^^A +% \meta{class}|}[|\meta{version}|]| +% +% The |\documentstyle| declaration is kept in order to maintain upward +% compatibility with \LaTeX2.09 documents. It is similar to +% |\documentclass|, but it causes all options in +% \meta{main-option-list} that the \meta{class} does not use to be +% passed to |\RequirePackage| after the options have been processed. +% This maintains compatibility with the 2.09 behaviour. Also a flag is +% set to indicate that the document is to be processed in \LaTeX2.09 +% compatibility mode. As far as most packages are concerned, this +% only affects the warnings and errors \LaTeX\ generates. This flag +% does affect the definition of font commands, and |\sloppy|. +% +% \bigskip +% +% |\usepackage[|\meta{package-option-list}|]{|^^A +% \meta{package-list}|}[|\meta{version}|]| +% +% There can be any number of these declarations. All packages in +% \meta{package-list} are called with the same options. +% +% Each \meta{package} file defines new elements (or modifies those +% defined in the \meta{class}), and thus extends the range of documents +% which can be processed. +% The \meta{package-option-list} is a list of options which can modify +% the formatting of elements defined in the \meta{package} file. +% The \meta{version} is a version number, beginning with a date in the +% format |YYYY/MM/DD|. If an older version of the package is found, a +% warning is issued. +% +% Each package is loaded only once. If the same package is requested +% more than once, nothing happens, unless the package has been requested +% with options that were not given the first time it was loaded, in +% which case an error is produced. +% +% As well as processing the options given in the +% \meta{package-option-list}, each package processes the +% \meta{main-option-list}. This means that options that affect all +% of the packages can be given globally, rather than repeated for every +% package. +% +% Note that class files have the extension |.cls|, packages have the +% extension |.sty|. +% +% \DescribeEnv{filecontents} +% The environment |filecontents| is intended for passing the contents +% of packages, options, or other files along with a document in a +% single file. +% It has one argument, which is the name of the file to create. If that +% file already exists (maybe only in the current directory if the OS +% supports a notion of a `current directory' or `default directory') +% then nothing happens +% (except for an information message) and the body of the environment +% is bypassed. Otherwise, the body of the environment is written +% verbatim to the file name given as the first argument, together with +% some comments about how it was produced. +% +% The environment is allowed only before |\documentclass| to ensure +% that all packages or options necessary for this particular run are +% present when needed. The begin and end tags should each be on a +% line by itself. There is also a star-form; this does not write +% extra comments into the file. +% +% \subsection{Option processing} +% +% When the options are processed, they are divided into two types: {\em +% local\/} and {\em global}: +% \begin{itemize} +% +% \item For a class, the options in the |\documentclass| command are +% local. +% +% \item For a package, the options in the |\usepackage| command are +% local, and the options in the |\documentclass| command are global. +% +% \end{itemize} +% The options for |\documentclass| and |\usepackage| +% are processed in the following way: +% \begin{enumerate} +% +% \item The local and global options that have been declared +% (using |\DeclareOption| as described below) are processed +% first. +% +% In the case of |\ProcessOptions|, they are processed in the order +% that they were declared in the class or package. +% +% In the case of |\ProcessOptions*|, they are processed in the order +% that they appear in the option-lists. First the global options, and +% then the local ones. +% +% \item Any remaining local options are dealt with using the default +% option (declared using the |\DeclareOption*| declaration described +% below). For document classes, this usually does nothing, but +% records the option on a list of unused options. +% For packages, this usually produces an error. +% +% \end{enumerate} +% Finally, when |\begin{document}| is reached, if there are any global +% options which have not been used by either the class or any package, +% the system will produce a warning. +% +% +% \section{Class and Package interface} +% +% \subsection{Class name and version} +% +% \DescribeMacro\ProvidesClass +% A class can identify itself with the +% |\ProvidesClass{|\meta{name}|}[|\meta{version}|]| command. The +% \meta{version} should begin with a date in the format |YYYY/MM/DD|. +% +% \subsection{Package name and version} +% +% \DescribeMacro\ProvidesPackage +% A package can identify itself with the +% |\ProvidesPackage|\marg{name}\oarg{version} command. The +% \meta{version} should begin with a date in the format |YYYY/MM/DD|. +% +% \subsection{Requiring other packages} +% +% \DescribeMacro\RequirePackage +% Packages or classes can load other packages using\\ +% |\RequirePackage|\oarg{options}\marg{name}\oarg{version}.\\ +% If the package has already been loaded, then nothing happens unless +% the requested options are not a subset of the options with which it +% was loaded, in which case an error is called. +% +% \DescribeMacro\LoadClass +% Similar to |\RequirePackage|, but for classes, may not be used in +% package files. +% +% \DescribeMacro\PassOptionsToPackage +% Packages can pass options to other packages using:\\ +% |\PassOptionsToPackage{|\meta{options}|}{|\meta{package}|}|.\\ +% \DescribeMacro\PassOptionsToClass +% This adds the \meta{options} to the options list of any future +% |\RequirePackage| or |\usepackage| command. For example: +% \begin{verbatim} +% \PassOptionsToPackage{foo,bar}{fred} +% \RequirePackage[baz]{fred}\end{verbatim} +% is the same as: +% \begin{verbatim} +% \RequirePackage[foo,bar,baz]{fred}\end{verbatim} +% +% \DescribeMacro\LoadClassWithOptions +% |\LoadClassWithOptions|\marg{name}\oarg{version}:\\ +% This is similar to +% |\LoadClass|, but it always calls class \meta{name} with +% exactly the same option list that is being used by the current class, +% rather than an option explicitly supplied or passed on by +% |\PassOptionsToClass|. +% \DescribeMacro\RequirePackageWithOptions +% |\RequirePackageWithOptions| is the analogous command for packages. +% +% This is mainly intended to allow one class to simply build on another, +% for example: +%\begin{verbatim} +% \LoadClassWithOptions{article} +%\end{verbatim} +% +% This should be contrasted with the slightly different construction +%\begin{verbatim} +% \DeclareOption*{\PassOptionsToClass{\CurrentOption}{article}} +% \ProcessOptions +% \LoadClass{article} +%\end{verbatim} +% +% As used here, the effects are more or less the same, but the +% version using |\LoadClassWithOptions| is slightly quicker +% (and less to type). +% If, however, the class declares options of its own then +% the two constructions are different; compare, for example: +%\begin{verbatim} +% \DeclareOption{landscape}{...} +% \ProcessOptions +% \LoadClassWithOptions{article} +%\end{verbatim} +% with: +%\begin{verbatim} +% \DeclareOption{landscape}{...} +% \DeclareOption*{\PassOptionsToClass{\CurrentOption}{article}} +% \ProcessOptions +% \LoadClass{article} +%\end{verbatim} +% In the first case, the \textsf{article} class will be called with +% option |landscape| precisely when the current class is called with +% this option; but in the second example it will +% not as in that case \textsf{article} is only passed options by the +% default option handler, which is not used for |landscape| as that +% option is explicitly declared. +% +% \DescribeMacro\@ifpackageloaded +% To find out if a package has already been loaded, use\\ +% \DescribeMacro\@ifclassloaded +% |\@ifpackageloaded{|\meta{package}|}{|\meta{true}|}{|\meta{false}|}|. +% +% \DescribeMacro\@ifpackagelater +% To find out if a package has already been loaded with a version more +% recent than \meta{version}, use +% \DescribeMacro\@ifclasslater +% |\@ifpackagelater{|\meta{package}|}{|\meta{version}|}{|^^A +% \meta{true}|}{|\meta{false}|}|. +% +% \DescribeMacro\@ifpackagewith +% To find out if a package has already been loaded with at least the +% options \meta{options}, use +% \DescribeMacro\@ifclasswith +% |\@ifpackagewith{|\meta{package}|}{|\meta{options}|}{|^^A +% \meta{true}|}{|\meta{false}|}|. +% +% There exists one package that can't be tested with the above +% commands: the \texttt{fontenc} package pretends that it was never +% loaded to allow for repeated reloading with different options (see +% \texttt{ltoutenc.dtx} for details). +% +% +% \subsection{Declaring new options} +% +% Options for classes and packages are built using the same macros. +% +% \DescribeMacro\DeclareOption To define a builtin option, use +% |\DeclareOption{|\meta{name}|}{|\meta{code}|}|. +% +% \DescribeMacro{\DeclareOption*} To define the default action to +% perform for local options which have not been declared, use +% |\DeclareOption*{|\meta{code}|}|. +% +% {\em Note\/}: there should be no use of\\ +% |\RequirePackage|, |\DeclareOption|, |\DeclareOption*| or +% |\ProcessOptions|\\ +% inside |\DeclareOption| or |\DeclareOption*|. +% +% Possible uses for |\DeclareOption*| include: +% +% |\DeclareOption*{}|\\ +% Do nothing. Silently accept unknown options. (This suppresses the +% usual warnings.) +% +% |\DeclareOption*{\@unkownoptionerror}|\\ +% Complain about unknown local options. (The initial setting for +% package files.) +% +% |\DeclareOption*{\PassOptionsToPackage{\CurrentOption}|^^A +% |{|\meta{pkg-name}|}|\\ +% Handle the the current option by passing it on to the package +% \meta{pkg-name}, which will presumably be loaded via +% |\RequirePackage| later in the file. This is useful for building +% `extension' packages, that perhaps handle a couple of new options, +% but then pass everything else on to an existing package. +% +% |\DeclareOption*{\InputIfFileExists{xx-\CurrentOption.yyy}%|\\ +% | {}%|\\ +% | {\OptionNotUsed}}|\\ +% Handle the option foo by loading the file |xx-foo.yyy| if it +% exists, otherwise do nothing, but declare that the option was not +% used. +% Actually the |\OptionNotUsed| declaration is only needed if this is +% being used in class files, but does no harm in package files. +% +% +% \subsection{Safe Input Macros} +% \DescribeMacro{\InputIfFileExists} +% |\InputIfFileExists{|\meta{file}|}{|\meta{then}|}{|\meta{else}|}|\\ +% Inputs \meta{file} if it exists. Immediately before the input, +% \meta{then} is executed. Otherwise \meta{else} is executed. +% +% \DescribeMacro{\IfFileExists} +% As above, but does not input the file. +% +% One thing you might like to put in the \meta{else} clause is +% +% \DescribeMacro{\@missingfileerror} +% This starts an interactive request for a filename, supplying default +% extensions. Just hitting return causes the whole input to be skipped +% and entering |x| quits the current run, +% +% \DescribeMacro{\input} +% This has been redefined from the \LaTeX2.09 definition, in terms of +% the new commands |\InputIfFileExists| and |\@missingfileerror|. +% +% +% \DescribeMacro{\listfiles} Giving this declaration in the preamble +% causes a list of all files input via the `safe input' commands to be +% listed at the end. Any strings specified in the optional argument to +% |\ProvidesPackage| are listed alongside the file name. So files in +% standard (and other non-standard) distributions can put informative +% strings in this argument. +% +% \StopEventually{} +% +% \section{Implementation} +% +% \begin{macrocode} +%<*2ekernel> +% \end{macrocode} +% +% +% \changes{v0.2g}{1993/11/23} +% {Various macros now moved to latex.tex.} +% \changes{v0.2g}{1993/11/23} +% {Warnings and errors now directly coded.} +% \changes{v0.2h}{1993/11/28} +% {Primitive filenames now terminated by space not \cs{relax}.} +% \changes{v0.2h}{1993/11/28} +% {Directory syntax checing moved to dircheck.dtx} +% \changes{v0.2h}{1993/11/28} +% {Assorted commands now in the kernel removed.} +% \changes{v0.2i}{1993/12/03} +% {\cs{@onlypreamble}: Many commands declared.} +% \changes{v0.2i}{1993/12/03} +% {Removed obsolete \cs{@documentclass}} +% \changes{v0.2o}{1993/12/13} +% {Removed setting \cs{errorcontextlines}\ (now in latex.tex)} +% \changes{v0.2p}{1993/12/15} +% {Removed extra `.'s from \cs{@@warning}s} +% \changes{v0.2s}{1994/01/17} +% {Added many more \cs{@onlypreamble} commands} +% \changes{v0.2s}{1994/01/17} +% {Wrapped long lines to column 72} +% \changes{v0.3a}{1994/03/02} +% {Remove need for driver file} +% \changes{v0.3b}{1994/03/08} +% {Modify driver code into `new style'} +% \changes{v0.3c}{1994/03/12} +% {Change name from docclass to ltclass} +% \changes{v0.3h}{1994/04/25} +% {Removed spurious extra `.'s at the end of error messages} +% \changes{v1.0a}{1994/04/29} +% {Change version number to 1 (no other change)} +% \changes{v1.0k}{1994/11/03} +% {Move \cs{@missingfileerror} to ltfiles} +% +% \begin{macro}{\if@compatibility} +% The flag for compatibilty mode. +% \begin{macrocode} +\newif\if@compatibility +% \end{macrocode} +% \end{macro} +% +% \begin{macro}{\@documentclasshook} +% The hook called after the first |\documentclass| command. By +% default this checks to see if |\@normalsize| is undefined, and if +% so, sets it to |\normalsize|. +% \changes{v0.2q}{1993/12/17} +% {Macro added} +% \changes{v0.2z}{1994/02/10} +% {Changed the name from \cs{@compatibility} to +% \cs{@documentclasshook}, and added the check for whether +% \cs{@normalsize} has been defined. ASAJ.} +% \begin{macrocode} +\def\@documentclasshook{% + \ifx\@normalsize\@undefined + \let\@normalsize\normalsize + \fi +} +% \end{macrocode} +% \end{macro} +% +% \begin{macro}{\@declaredoptions} +% This list is automatically built by |\DeclareOption|. +% It is the list of options (separated by commas) declared in +% the class or package file and it defines the order in which the +% the corresponding |\ds@|\meta{option} commands are executed. +% All local \meta{option}s which are not declared will be processed +% in the order defined by the optional argument of |\documentclass| +% or |\usepackage|. +% \begin{macrocode} +\let\@declaredoptions\@empty +% \end{macrocode} +% \end{macro} +% +% \begin{macro}{\@classoptionslist} +% List of options of the main class. +% \changes{v1.0u}{1996/07/26}{made only preamble} +% \begin{macrocode} +\let\@classoptionslist\relax +\@onlypreamble\@classoptionslist +% \end{macrocode} +% \end{macro} +% +% \begin{macro}{\@unusedoptionlist} +% \changes{v1.0u}{1996/07/26}{made only preamble} +% List of options of the main class that haven't been declared or +% loaded as class option files. +% \begin{macrocode} +\let\@unusedoptionlist\@empty +\@onlypreamble\@unusedoptionlist +% \end{macrocode} +% \end{macro} +% +% \begin{macro}{\CurrentOption} +% Name of current package or option. +% \changes{v0.2c}{1993/11/17} +% {Name changed from \cs{@curroption}} +% \begin{macrocode} +\let\CurrentOption\@empty +% \end{macrocode} +% \end{macro} +% +% \begin{macro}{\@currname} +% Name of current package or option. +% \begin{macrocode} +\let\@currname\@empty +% \end{macrocode} +% \end{macro} +% +% \begin{macro}{\@currext} +% The current file extension. +% \changes{v0.2a}{1993/11/14}{Name changed from \cs{@currextension}} +% \begin{macrocode} +\global\let\@currext=\@empty +% \end{macrocode} +% \end{macro} +% +% \begin{macro}{\@clsextension} +% \begin{macro}{\@pkgextension} +% The two possible values of |\@currext|. +% \begin{macrocode} +\def\@clsextension{cls} +\def\@pkgextension{sty} +\@onlypreamble\@clsextension +\@onlypreamble\@pkgextension +% \end{macrocode} +% \end{macro} +% \end{macro} +% +% \begin{macro}{\@pushfilename} +% \begin{macro}{\@popfilename} +% \begin{macro}{\@currnamestack} +% Commands to push and pop the file name and extension. \\ +% |#1| current name. \\ +% |#2| current extension. \\ +% |#3| current catcode of |@|. \\ +% |#4| Rest of the stack. +% \begin{macrocode} +\def\@pushfilename{% + \xdef\@currnamestack{% + {\@currname}% + {\@currext}% + {\the\catcode`\@}% + \@currnamestack}} +\@onlypreamble\@pushfilename +% \end{macrocode} +% +% \begin{macrocode} +\def\@popfilename{\expandafter\@p@pfilename\@currnamestack\@nil} +\@onlypreamble\@popfilename +% \end{macrocode} +% +% \begin{macrocode} +\def\@p@pfilename#1#2#3#4\@nil{% + \gdef\@currname{#1}% + \gdef\@currext{#2}% + \catcode`\@#3\relax + \gdef\@currnamestack{#4}} +\@onlypreamble\@p@pfilename +% \end{macrocode} +% +% \begin{macrocode} +\gdef\@currnamestack{} +\@onlypreamble\@currnamestack +% \end{macrocode} +% \end{macro} +% \end{macro} +% \end{macro} +% +% \begin{macro}{\@ptionlist} +% Returns the option list of the file. +% \begin{macrocode} +\def\@ptionlist#1{% + \@ifundefined{opt@#1}\@empty{\csname opt@#1\endcsname}} +\@onlypreamble\@ptionlist +% \end{macrocode} +% \end{macro} +% +% \begin{macro}{\@ifpackageloaded} +% \begin{macro}{\@ifclassloaded} +% |\@ifpackageloaded{|\meta{name}|}| +% Checks to see whether a file has been loaded. +% \changes{v0.2t}{1994/01/18} +% {Fix typo \cs{@pkgetension}} +% \begin{macrocode} +\def\@ifpackageloaded{\@ifl@aded\@pkgextension} +\def\@ifclassloaded{\@ifl@aded\@clsextension} +\@onlypreamble\@ifpackageloaded +\@onlypreamble\@ifclassloaded +% \end{macrocode} +% +% \begin{macrocode} +\def\@ifl@aded#1#2{% + \expandafter\ifx\csname ver@#2.#1\endcsname\relax + \expandafter\@secondoftwo + \else + \expandafter\@firstoftwo + \fi} +\@onlypreamble\@ifl@aded +% \end{macrocode} +% \end{macro} +% \end{macro} +% +% \begin{macro}{\@ifpackagelater} +% \begin{macro}{\@ifclasslater} +% |\@ifpackagelater{|\meta{name}|}{YYYY/MM/DD}| +% Checks that the package loaded is more recent than the given date. +% \begin{macrocode} +\def\@ifpackagelater{\@ifl@ter\@pkgextension} +\def\@ifclasslater{\@ifl@ter\@clsextension} +\@onlypreamble\@ifpackagelater +\@onlypreamble\@ifclasslater +% \end{macrocode} +% +% \begin{macrocode} +\def\@ifl@ter#1#2{% + \expandafter\@ifl@t@r + \csname ver@#2.#1\endcsname} +\@onlypreamble\@ifl@ter +% \end{macrocode} +% +% This internal macro is also used in |\NeedsTeXFormat|. +% \changes{v0.2f}{1993/11/22} +% {Added //00 so parsing never produces a runaway argument.} +% \begin{macrocode} +\def\@ifl@t@r#1#2{% + \ifnum\expandafter\@parse@version#1//00\@nil<% + \expandafter\@parse@version#2//00\@nil + \expandafter\@secondoftwo + \else + \expandafter\@firstoftwo + \fi} +\@onlypreamble\@ifl@t@r +% \end{macrocode} +% +% \begin{macrocode} +\def\@parse@version#1/#2/#3#4#5\@nil{#1#2#3#4 } +\@onlypreamble\@parse@version +% \end{macrocode} +% \end{macro} +% \end{macro} +% +% \begin{macro}{\@ifpackagewith} +% \begin{macro}{\@ifclasswith} +% |\@ifpackagewith{|\meta{name}|}{|\meta{option-list}|}| +% Checks that \meta{option-list} is a subset of the options +% \textbf{with} which \meta{name} was loaded. +% \begin{macrocode} +\def\@ifpackagewith{\@if@ptions\@pkgextension} +\def\@ifclasswith{\@if@ptions\@clsextension} +\@onlypreamble\@ifpackagewith +\@onlypreamble\@ifclasswith +% \end{macrocode} +% +% \begin{macrocode} +\def\@if@ptions#1#2{% + \@expandtwoargs\@if@pti@ns{\@ptionlist{#2.#1}}} +\@onlypreamble\@if@ptions +% \end{macrocode} +% +% Probably shouldnt use |\CurrentOption| here\ldots (changed to +% |\reserved@b|.) +% \changes{v0.2y}{1994/02/07} +% {Add extra ,s so `two' is not matched with `twocolumn'} +% \begin{macrocode} +\def\@if@pti@ns#1#2{% + \let\reserved@a\@firstoftwo + \@for\reserved@b:=#2\do{% + \expandafter\in@\expandafter{\expandafter,\reserved@b,}{,#1,}% + \ifin@\else\let\reserved@a\@secondoftwo\fi}% + \reserved@a} +\@onlypreamble\@if@pti@ns +% \end{macrocode} +% \end{macro} +% \end{macro} +% +% \begin{macro}{\ProvidesPackage} +% Checks that the current filename is correct, and defines +% |\ver@filename|. +% \changes{v0.3c}{1994/03/12} +% {Add \cs{wlog}} +% \changes{v0.3c}{1994/03/12} +% {use \cs{@gtempa}} +% \begin{macrocode} +\def\ProvidesPackage#1{% + \xdef\@gtempa{#1}% + \ifx\@gtempa\@currname\else + \@latex@warning@no@line{You have requested + \@cls@pkg\space`\@currname',\MessageBreak + but the \@cls@pkg\space provides `#1'}% + \fi + \@ifnextchar[\@pr@videpackage{\@pr@videpackage[]}}%] +\@onlypreamble\ProvidesPackage +% \end{macrocode} +% +% \begin{macrocode} +\def\@pr@videpackage[#1]{% + \expandafter\xdef\csname ver@\@currname.\@currext\endcsname{#1}% + \ifx\@currext\@clsextension + \typeout{Document Class: \@gtempa\space#1}% + \else + \wlog{Package: \@gtempa\space#1}% + \fi} +\@onlypreamble\@pr@videpackage +% \end{macrocode} +% \end{macro} +% +% \begin{macro}{\ProvidesClass} +% Like |\ProvidesPackage|, but for classes. +% \begin{macrocode} +\let\ProvidesClass\ProvidesPackage +\@onlypreamble\ProvidesClass +% \end{macrocode} +% \end{macro} +% +% \begin{macro}{\ProvidesFile} +% Like |\ProvidesPackage|, but for arbitrary files. Do not apply +% |\@onlypreamble| to these, as we may want to label files input +% during the document. +% \changes{v0.2l}{1993/12/07} +% {Macro added} +% \changes{v0.3c}{1994/03/12} +% {Add \cs{wlog}} +% \changes{v0.3g}{1994/04/11} +% {Protect against weird catcodes.} +% \begin{macro}{\@providesfile} +% \changes{v1.0r}{1995/10/17} +% {Delay definition of \cs{ProvidesFile} till ltfinal} +% \changes{v1.1a}{1998/03/21} +% {Allow \&. Internal/2702} +% \changes{v1.1d}{2001/05/25}{Explicitly set catcode of +% \cs{endlinechar} to 10 (pr/3334)} +% \changes{v1.1e}{2001/06/04}{But only if it is a char (pr/3334)} +% \changes{v1.1f}{2001/08/26}{Readded setting of space char (pr/3353)} +% \begin{macrocode} +\def\ProvidesFile#1{% + \begingroup + \catcode`\ 10 % + \ifnum \endlinechar<256 % + \ifnum \endlinechar>\m@ne + \catcode\endlinechar 10 % + \fi + \fi + \@makeother\/% + \@makeother\&% +% \end{macrocode} +% \changes{v1.1g}{2004/01/28}{Use kernel version of +% \cs{@ifnextchar} (pr/3501)} +% \begin{macrocode} + \kernel@ifnextchar[{\@providesfile{#1}}{\@providesfile{#1}[]}} +% \end{macrocode} +% +% During initex a special version of |\@providesfile| is used. +% The real definition is installed right at the end, in |ltfinal.dtx|. +%\begin{verbatim} +%\def\@providesfile#1[#2]{% +% \wlog{File: #1 #2}% +% \expandafter\xdef\csname ver@#1\endcsname{#2}% +% \endgroup} +% \end{macrocode} +%\end{verbatim} +% \end{macro} +% \end{macro} +% +% \begin{macro}{\PassOptionsToPackage} +% \begin{macro}{\PassOptionsToClass} +% If the package has been loaded, we check that it was first loaded with +% the options. Otherwise we add the option list to that of the package. +% \begin{macrocode} +\def\@pass@ptions#1#2#3{% + \expandafter\xdef\csname opt@#3.#1\endcsname{% + \@ifundefined{opt@#3.#1}\@empty + {\csname opt@#3.#1\endcsname,}% + \zap@space#2 \@empty}} +\@onlypreamble\@pass@ptions +% \end{macrocode} +% +% \begin{macrocode} +\def\PassOptionsToPackage{\@pass@ptions\@pkgextension} +\def\PassOptionsToClass{\@pass@ptions\@clsextension} +\@onlypreamble\PassOptionsToPackage +\@onlypreamble\PassOptionsToClass +% \end{macrocode} +% \end{macro} +% \end{macro} +% +% \begin{macro}{\DeclareOption} +% \begin{macro}{\DeclareOption*} +% Adds an option as a |\ds@| command, or the default |\default@ds| +% command. +% \changes{v0.2c}{1993/11/17} +% {Error checking added} +% \changes{v1.0m}{1995/04/21} +% {Made long /1498} +% \changes{v1.0n}{1995/05/12} +% {Use \cs{toks@} to remove need to double hash /1557} +% \begin{macrocode} +\def\DeclareOption{% + \let\@fileswith@pti@ns\@badrequireerror + \@ifstar\@defdefault@ds\@declareoption} +\long\def\@declareoption#1#2{% + \xdef\@declaredoptions{\@declaredoptions,#1}% + \toks@{#2}% + \expandafter\edef\csname ds@#1\endcsname{\the\toks@}} +\long\def\@defdefault@ds#1{% + \toks@{#1}% + \edef\default@ds{\the\toks@}} +\@onlypreamble\DeclareOption +\@onlypreamble\@declareoption +\@onlypreamble\@defdefault@ds +% \end{macrocode} +% \end{macro} +% \end{macro} +% +% \begin{macro}{\OptionNotUsed} +% If we are in a class file, add |\CurrentOption| to the list of +% unused options. Otherwise, in a package file do nothing. +% \begin{macrocode} +\def\OptionNotUsed{% + \ifx\@currext\@clsextension + \xdef\@unusedoptionlist{% + \ifx\@unusedoptionlist\@empty\else\@unusedoptionlist,\fi + \CurrentOption}% + \fi} +\@onlypreamble\OptionNotUsed +% \end{macrocode} +% \end{macro} +% +% \begin{macro}{\default@ds} +% The default default option code. +% Set by |\@onefilewithoptions| to either |\OptionNotUsed| for +% classes, or |\@unknownoptionerror| for packages. This may be reset +% in either case with |\DeclareOption*|. +% \begin{macrocode} +% \let\default@ds\OptionNotUsed +% \end{macrocode} +% \end{macro} +% +% \begin{macro}{\ProcessOptions} +% \begin{macro}{\ProcessOptions*} +% |\ProcessOptions| calls |\ds@option| for each known package option, +% then calls |\default@ds| for each option on the local options list. +% Finally resets all the declared options to |\relax|. The empty option +% does nothing, this has to be reset on the off chance it's set to +% |\relax| if an empty element gets into the |\@declaredoptions| list. +% +% The star form is similar but executes options given in the order +% specified in the document, not the order they are declared in the +% file. In the case of packages, global options are executed before +% local ones. +% \changes{v0.2a}{1993/11/14} +% {Stop adding the global option list inside class files.} +% \changes{v0.2a}{1993/11/14} +% {Optimise `empty option' code.} +% \changes{v0.2b}{1993/11/15} +% {Star form added.} +% \changes{v0.2c}{1993/11/17} +% {restoring \cs{@fileswith@pti@ns} added.} +% \begin{macrocode} +\def\ProcessOptions{% + \let\ds@\@empty + \edef\@curroptions{\@ptionlist{\@currname.\@currext}}% + \@ifstar\@xprocess@ptions\@process@ptions} +\@onlypreamble\ProcessOptions +% \end{macrocode} +% +% \changes{v0.2y}{1994/02/07} +% {Add extra ,s so `two' is not matched with `twocolumn'} +% \begin{macrocode} +\def\@process@ptions{% + \@for\CurrentOption:=\@declaredoptions\do{% + \ifx\CurrentOption\@empty\else + \@expandtwoargs\in@{,\CurrentOption,}{% + ,\ifx\@currext\@clsextension\else\@classoptionslist,\fi + \@curroptions,}% + \ifin@ + \@use@ption + \expandafter\let\csname ds@\CurrentOption\endcsname\@empty + \fi + \fi}% + \@process@pti@ns} +\@onlypreamble\@process@ptions +% \end{macrocode} +% +% \changes{v0.2y}{1994/02/07} +% {Add extra ,s so `two' is not matched with `twocolumn'} +% \begin{macrocode} +\def\@xprocess@ptions{% + \ifx\@currext\@clsextension\else + \@for\CurrentOption:=\@classoptionslist\do{% + \ifx\CurrentOption\@empty\else + \@expandtwoargs\in@{,\CurrentOption,}{,\@declaredoptions,}% + \ifin@ + \@use@ption + \expandafter\let\csname ds@\CurrentOption\endcsname\@empty + \fi + \fi}% + \fi + \@process@pti@ns} +\@onlypreamble\@xprocess@ptions +% \end{macrocode} +% +% The common part of |\ProcessOptions| and |\ProcessOptions*|. +% \begin{macrocode} +\def\@process@pti@ns{% + \@for\CurrentOption:=\@curroptions\do{% + \@ifundefined{ds@\CurrentOption}% + {\@use@ption + \default@ds}% +% \end{macrocode} +% There should not be any non-empty definition of |\CurrentOption| at +% this point, as all the declared options were executed earlier. This is +% for compatibility with 2.09 styles which use |\def\ds@|\ldots\ +% directly, and so have options which do not appear in +% |\@declaredoptions|. +% \begin{macrocode} + \@use@ption}% +% \end{macrocode} +% Clear all the definitions for option code. First set all the declared +% options to |\relax|, then reset the `default' and `empty' options. and +% the lst of declared options. +% \begin{macrocode} + \@for\CurrentOption:=\@declaredoptions\do{% + \expandafter\let\csname ds@\CurrentOption\endcsname\relax}% +% \end{macrocode} +% \changes{v1.0r}{1995/10/17} +% {Reset \cs{CurrentOption} for graphics/1873} +% \begin{macrocode} + \let\CurrentOption\@empty + \let\@fileswith@pti@ns\@@fileswith@pti@ns + \AtEndOfPackage{\let\@unprocessedoptions\relax}} +\@onlypreamble\@process@pti@ns +% \end{macrocode} +% \end{macro} +% \end{macro} +% +% \begin{macro}{\@options} +% |\@options| is a synonym for |\ProcessOptions*| for upward +% compatibility with \LaTeX2.09 style files. +% \begin{macrocode} +\def\@options{\ProcessOptions*} +\@onlypreamble\@options +% \end{macrocode} +% \end{macro} +% +% \begin{macro}{\@use@ption} +% Execute the code for the current option. +% \changes{v0.2g}{1993/11/23} +% {Name changed from \cs{@executeoption}} +% \changes{v1.0e}{1994/05/17} +% {Execute option after removing from list, not before} +% \begin{macrocode} +\def\@use@ption{% + \@expandtwoargs\@removeelement\CurrentOption + \@unusedoptionlist\@unusedoptionlist + \csname ds@\CurrentOption\endcsname} +\@onlypreamble\@use@ption +% \end{macrocode} +% \end{macro} +% +% \begin{macro}{\ExecuteOptions} +% |\ExecuteOptions{|\meta{option-list}|}| executes the code declared +% for each option. +% \changes{v0.2d}{1993/11/18} +% {Use \cs{CurrentOption} not \cs{reserved@a}} +% \changes{v0.2k}{1993/12/06} +% {Preserve \cs{CurrentOption}.} +% \begin{macrocode} +\def\ExecuteOptions#1{% + \def\reserved@a##1\@nil{% + \@for\CurrentOption:=#1\do{\csname ds@\CurrentOption\endcsname}% + \edef\CurrentOption{##1}}% + \expandafter\reserved@a\CurrentOption\@nil} +\@onlypreamble\ExecuteOptions +% \end{macrocode} +% \end{macro} +% +% The top-level commands, which just set some parameters then call +% the internal command, |\@fileswithoptions|. +% \begin{macro}{\documentclass} +% \changes{v1.0q}{1995/06/19} +% {Dont redefine \cs{usepackage} in compat mode for /1634} +% The main new-style class declaration. +% \begin{macrocode} +\def\documentclass{% + \let\documentclass\@twoclasseserror + \if@compatibility\else\let\usepackage\RequirePackage\fi + \@fileswithoptions\@clsextension} +\@onlypreamble\documentclass +% \end{macrocode} +% \end{macro} +% +% \begin{macro}{\documentstyle} +% 2.09 style class `style' declaration. +% \changes{v0.2a}{1993/11/14} +% {Added \cs{RequirePackage} \cs{@unusedoptionlist} stuff.} +% \changes{v0.2b}{1993/11/15} +% {Modified to match \cs{ProcessOption*}} +% \changes{v0.2d}{1993/11/18} +% {Modified \cs{RequirePackage} stuff.} +% \changes{v0.2n}{1993/12/09} +% {input 209 compatibility file.} +% \changes{v0.2o}{1993/12/13} +% {compatibility file now latex209.sty.} +% \changes{v0.2q}{1993/12/17} +% {Match Alan's new code.} +% \changes{v0.2u}{1994/01/21} +% {compatibility file now latex209.def.} +% \begin{macrocode} +\def\documentstyle{% + \makeatletter\input{latex209.def}\makeatother + \documentclass} +\@onlypreamble\documentstyle +% \end{macrocode} +% \end{macro} +% +% \begin{macro}{\RequirePackage} +% Load package if not already loaded. +% \begin{macrocode} +\def\RequirePackage{% + \@fileswithoptions\@pkgextension} +\@onlypreamble\RequirePackage +% \end{macrocode} +% \end{macro} +% +% \begin{macro}{\LoadClass} +% Load class. +% \begin{macrocode} +\def\LoadClass{% + \ifx\@currext\@pkgextension + \@latex@error + {\noexpand\LoadClass in package file}% + {You may only use \noexpand\LoadClass in a class file.}% + \fi + \@fileswithoptions\@clsextension} +\@onlypreamble\LoadClass +% \end{macrocode} +% \end{macro} +% +% \begin{macro}{\@loadwithoptions} +% \changes{v1.0t}{1995/11/14}{macro added} +% Pass the current option list on to a class or package. +% |#1| is |\@|\emph{cls-or-pkg}|extension|, +% |#2| is |\RequirePackage| or |\LoadClass|, +% |#3| is the class or package to be loaded. +% \begin{macrocode} +\def\@loadwithoptions#1#2#3{% + \expandafter\let\csname opt@#3.#1\expandafter\endcsname + \csname opt@\@currname.\@currext\endcsname + #2{#3}} +\@onlypreamble\@loadwithoptions +% \end{macrocode} +% \end{macro} +% +% +% \begin{macro}{\LoadClassWithOptions} +% \changes{v1.0t}{1995/11/14}{macro added} +% Load class `|#1|' with the current option list. +% \begin{macrocode} +\def\LoadClassWithOptions{% + \@loadwithoptions\@clsextension\LoadClass} +\@onlypreamble\LoadClassWithOptions +% \end{macrocode} +% \end{macro} +% +% \begin{macro}{\RequirePackageWithOptions} +% \changes{v1.0t}{1995/11/14}{macro added} +% \changes{v1.0v}{1996/10/04}{Reset \cs{@unprocessedoptions} for /2269} +% Load package `|#1|' with the current option list. +% \begin{macrocode} +\def\RequirePackageWithOptions{% + \AtEndOfPackage{\let\@unprocessedoptions\relax}% + \@loadwithoptions\@pkgextension\RequirePackage} +\@onlypreamble\RequirePackageWithOptions +% \end{macrocode} +% \end{macro} +% +% \begin{macro}{\usepackage} +% To begin with, |\usepackage| produces an error. This is reset by +% |\documentclass|. +% \changes{v0.2o}{1993/12/13} +% {Fixed error handling} +% \changes{v1.0h}{1994/05/23}{Remove argument if possible} +% \begin{macrocode} +\def\usepackage#1#{% + \@latex@error + {\noexpand \usepackage before \string\documentclass}% + {\noexpand \usepackage may only appear in the document + preamble, i.e.,\MessageBreak + between \noexpand\documentclass and + \string\begin{document}.}% + \@gobble} +\@onlypreamble\usepackage +% \end{macrocode} +% \end{macro} +% +% \begin{macro}{\NeedsTeXFormat} +% Check that the document is running on the correct system. +% \changes{v0.2a}{1993/11/14} +% {made more robust for alternative syntax for other formats.} +% \changes{v0.2c}{1993/11/17} +% {Name changed from \cs{NeedsFormat}} +% \changes{v0.2d}{1993/11/18} +% {\cs{fmtname} \cs{fmtversion} not \cs{@}\ldots} +% \begin{macrocode} +\def\NeedsTeXFormat#1{% + \def\reserved@a{#1}% + \ifx\reserved@a\fmtname + \expandafter\@needsformat + \else + \@latex@error{This file needs format `\reserved@a'% + \MessageBreak but this is `\fmtname'}{% + The current input file will not be processed + further,\MessageBreak + because it was written for some other flavor of + TeX.\MessageBreak\@ehd}% +% \end{macrocode} +% If the file is not meant to be processed by \LaTeXe{} we stop +% inputting it, but we do not end the run. We just end inputting +% the current file. +% \changes{v1.0h}{1994/05/23} +% {Don't stop completely when format is wrong} +% \begin{macrocode} + \endinput \fi} +\@onlypreamble\NeedsTeXFormat +% \end{macrocode} +% +% \begin{macrocode} +\def\@needsformat{% + \@ifnextchar[%] + \@needsf@rmat + {}} +\@onlypreamble\@needsformat +% \end{macrocode} +% +% \changes{v1.0b}{1994/05/04} +% {Changed wording of the warning} +% \begin{macrocode} +\def\@needsf@rmat[#1]{% + \@ifl@t@r\fmtversion{#1}{}% + {\@latex@warning@no@line + {You have requested release `#1' of LaTeX,\MessageBreak + but only release `\fmtversion' is available}}} +\@onlypreamble\@needsf@rmat +% \end{macrocode} +% \end{macro} +% +% \begin{macro}{\zap@space} +% |\zap@space foo|\meta{space}|\@empty| removes all spaces from |foo| +% that are not protected by |{ }| groups. +% \begin{macrocode} +\def\zap@space#1 #2{% + #1% + \ifx#2\@empty\else\expandafter\zap@space\fi + #2} +% \end{macrocode} +% \end{macro} +% +% \begin{macro}{\@fileswithoptions} +% The common part of |\documentclass| and |\usepackage|. +% \begin{macrocode} +\def\@fileswithoptions#1{% + \@ifnextchar[%] + {\@fileswith@ptions#1}% + {\@fileswith@ptions#1[]}} +\@onlypreamble\@fileswithoptions +% \end{macrocode} +% +% \changes{v0.2f}{1993/11/22} +% {Made the default [] not [\cs{@unknownversion}]} +% \begin{macrocode} +\def\@fileswith@ptions#1[#2]#3{% + \@ifnextchar[%] + {\@fileswith@pti@ns#1[#2]#3}% + {\@fileswith@pti@ns#1[#2]#3[]}} +\@onlypreamble\@fileswith@ptions +% \end{macrocode} +% Then we do some work. +% +% First of all, we define the global variables. +% Then we look to see if the file has already been loaded. +% If it has, we check that it was first loaded with at least the current +% options. +% If it has not, we add the current options to the package options, +% set the default version to be |0000/00/00|, and load the file if we +% can find it. +% Then we check the version number. +% +% Finally, we restore the old file name, reset the default option, +% and we set the catcode of |@|. +% +% For classes, we can immediately process the file. For other types, +% |#2| could be a comma separated list, so loop through, processing +% each one separately. +% \changes{v0.2q}{1993/12/17} +% {Add \cs{@compatibility} hook} +% \changes{v0.2s}{1994/01/17} +% {Modify to reduce parameter stack usage} +% \changes{v0.2y}{1994/02/07} +% {Run \cs{@compatibility} on the first class to start +% (not the first to finish) } +% \changes{v0.2z}{1994/02/10} +% {Renamed \cs{@compatibility} to \cs{@documentclasshook}. +% ASAJ.} +% \begin{macrocode} +\def\@fileswith@pti@ns#1[#2]#3[#4]{% + \ifx#1\@clsextension + \ifx\@classoptionslist\relax + \xdef\@classoptionslist{\zap@space#2 \@empty}% + \def\reserved@a{% + \@onefilewithoptions#3[#2][#4]#1% + \@documentclasshook}% + \else + \def\reserved@a{% + \@onefilewithoptions#3[#2][#4]#1}% + \fi + \else +% \end{macrocode} +% build up a list of calls to |\@onefilewithoptions| +% (one for each package) without thrashing the parameter stack. +% \begin{macrocode} + \def\reserved@b##1,{% + \ifx\@nil##1\relax\else + \ifx\relax##1\relax\else + \noexpand\@onefilewithoptions##1[#2][#4]\noexpand\@pkgextension + \fi + \expandafter\reserved@b + \fi}% + \edef\reserved@a{\zap@space#3 \@empty}% + \edef\reserved@a{\expandafter\reserved@b\reserved@a,\@nil,}% + \fi + \reserved@a} +\@onlypreamble\@fileswith@pti@ns +% \end{macrocode} +% +% Have the main argument as |#1|, so we only need one |\expandafter| +% above. +% \changes{v0.2a}{1993/11/14} +% {Moved reseting of \cs{default@ds}, \cs{ds@} and +% \cs{@declaredoptions} here, from the end of +% \cs{ProcessOptions}.} +% \changes{v0.2f}{1993/11/22} +% {Made the initial version [] not [\cs{@unknownversion}]} +% \changes{v0.2m}{1993/12/07} +% {Reset \cs{CurrentOption}} +% \begin{macrocode} +\def\@onefilewithoptions#1[#2][#3]#4{% + \@pushfilename + \xdef\@currname{#1}% + \global\let\@currext#4% + \expandafter\let\csname\@currname.\@currext-h@@k\endcsname\@empty + \let\CurrentOption\@empty + \@reset@ptions + \makeatletter +% \end{macrocode} +% Grab everything in a macro, so the parameter stack is popped before +% any processing begins. +% \changes{v0.2s}{1994/01/17} +% {Modify to reduce parameter stack usage} +% \changes{v1.1b}{1998/05/07} +% {Modify help message for latex/2805} +% \begin{macrocode} + \def\reserved@a{% + \@ifl@aded\@currext{#1}% + {\@if@ptions\@currext{#1}{#2}{}% + {\@latex@error + {Option clash for \@cls@pkg\space #1}% + {The package #1 has already been loaded + with options:\MessageBreak + \space\space[\@ptionlist{#1.\@currext}]\MessageBreak + There has now been an attempt to load it + with options\MessageBreak + \space\space[#2]\MessageBreak + Adding the global options:\MessageBreak + \space\space + \@ptionlist{#1.\@currext},#2\MessageBreak + to your \noexpand\documentclass declaration may fix this.% + \MessageBreak + Try typing \space \space to proceed.}}}% + {\@pass@ptions\@currext{#2}{#1}% +% \end{macrocode} +% \changes{v0.3c}{1994/03/12} +% {Do not use \cs{@pr@videpackage} to avoid typeout} +% \begin{macrocode} + \global\expandafter + \let\csname ver@\@currname.\@currext\endcsname\@empty + \InputIfFileExists + {\@currname.\@currext}% + {}% + {\@missingfileerror\@currname\@currext}% +% \end{macrocode} +% |\@unprocessedoptions| will generate an error for each specified +% option in a package unless a |\ProcessOptions| has appeared in the +% package file. +% \changes{v0.2v}{1994/01/29} +% {All options raise error if no \cs{ProcessOptions} appears} +% \changes{v0.2x}{1994/02/02} +% {Only run the hook and options check if the file was loaded.} +% \begin{macrocode} + \let\@unprocessedoptions\@@unprocessedoptions + \csname\@currname.\@currext-h@@k\endcsname + \expandafter\let\csname\@currname.\@currext-h@@k\endcsname + \@undefined + \@unprocessedoptions} +% \end{macrocode} +% +% \begin{macrocode} + \@ifl@ter\@currext{#1}{#3}{}% + {\@latex@warning@no@line + {You have requested,\on@line, + version\MessageBreak + `#3' of \@cls@pkg\space #1,\MessageBreak + but only version\MessageBreak + `\csname ver@#1.\@currext\endcsname'\MessageBreak + is available}}% +% \end{macrocode} +% \changes{v0.2c}{1993/11/17} +% {Added trap for two \cs{LoadClass} commands.} +% \begin{macrocode} + \ifx\@currext\@clsextension\let\LoadClass\@twoloadclasserror\fi + \@popfilename + \@reset@ptions}% + \reserved@a} +\@onlypreamble\@onefilewithoptions +% \end{macrocode} +% \end{macro} +% +% \begin{macro}{\@@fileswith@pti@ns} +% Save the definition (for error checking). +% \changes{v0.2c}{1993/11/17} +% {Macro added} +% \begin{macrocode} +\let\@@fileswith@pti@ns\@fileswith@pti@ns +\@onlypreamble\@@fileswith@pti@ns +% \end{macrocode} +% \end{macro} +% +% \begin{macro}{\@reset@ptions} +% Reset the default option, and clear lists of declared options. +% \changes{v0.2a}{1993/11/14}{macro added} +% \begin{macrocode} +\def\@reset@ptions{% + \global\ifx\@currext\@clsextension + \let\default@ds\OptionNotUsed + \else + \let\default@ds\@unknownoptionerror + \fi + \global\let\ds@\@empty + \global\let\@declaredoptions\@empty} +\@onlypreamble\@reset@ptions +% \end{macrocode} +% \end{macro} +% +% \subsection{Hooks} +% +% Allow code do be saved to be executed at specific later times. +% +% Save things in macros, I considered using toks registers, (and +% |\addto@hook| from the NFSS code, that would require stacking the +% contents in the case of required packages, so just generate a new +% macro for each package. +% \begin{macro}{\@begindocumenthook} +% \changes{v1.0s}{1995/10/20} +% {Make setting conditional, for autoload version} +% \begin{macro}{\@enddocumenthook} +% Stuff to appear at the begining or end of the document. +% \begin{macrocode} +\ifx\@begindocumenthook\@undefined + \let\@begindocumenthook\@empty +\fi +\let\@enddocumenthook\@empty +% \end{macrocode} +% \end{macro} +% \end{macro} +% +% \begin{macro}{\g@addto@macro} +% Globally add to the end of a macro. +% \changes{v0.2a}{1993/11/14}{Made global} +% \changes{v0.2w}{1994/01/31} +% {Use toks register to avoid `hash' problems} +% \changes{v1.0o}{1995/05/17} +% {Make long for latex/1522} +% \changes{v1.0w}{1996/12/17} +% {Use \cs{begingroup} to save making a mathord} +% \changes{v1.0x}{1997/02/05} +% {missing percent /2402} +% \begin{macrocode} +\long\def\g@addto@macro#1#2{% + \begingroup + \toks@\expandafter{#1#2}% + \xdef#1{\the\toks@}% + \endgroup} +% \end{macrocode} +% \end{macro} +% +% \begin{macro}{\AtEndOfPackage} +% \begin{macro}{\AtEndOfClass} +% \begin{macro}{\AtBeginDocument} +% \begin{macro}{\AtEndDocument} +% The access functions. +% \changes{v0.2a}{1993/11/14} +% {Included extension in the generated macro name for package +% and class hooks.} +% \begin{macrocode} +\def\AtEndOfPackage{% + \expandafter\g@addto@macro\csname\@currname.\@currext-h@@k\endcsname} +\let\AtEndOfClass\AtEndOfPackage +\@onlypreamble\AtEndOfPackage +\@onlypreamble\AtEndOfClass +% \end{macrocode} +% +% \begin{macrocode} +\def\AtBeginDocument{\g@addto@macro\@begindocumenthook} +\def\AtEndDocument{\g@addto@macro\@enddocumenthook} +\@onlypreamble\AtBeginDocument +% \end{macrocode} +% \end{macro} +% \end{macro} +% \end{macro} +% \end{macro} +% +% +% \begin{macro}{\@cls@pkg} +% The current file type. +% \changes{v0.2i}{1993/12/03} +% {Name changed to avoid clash with output routine.} +% \begin{macrocode} +\def\@cls@pkg{% + \ifx\@currext\@clsextension + document class% + \else + package% + \fi} +\@onlypreamble\@cls@pkg +% \end{macrocode} +% \end{macro} +% +% \begin{macro}{\@unknownoptionerror} +% Bad option. +% \begin{macrocode} +\def\@unknownoptionerror{% + \@latex@error + {Unknown option `\CurrentOption' for \@cls@pkg\space`\@currname'}% + {The option `\CurrentOption' was not declared in + \@cls@pkg\space`\@currname', perhaps you\MessageBreak + misspelled its name. + Try typing \space + \space to proceed.}} +\@onlypreamble\@unknownoptionerror +% \end{macrocode} +% \end{macro} +% +% \begin{macro}{\@@unprocessedoptions} +% Declare an error for each option, unless a |\ProcessOptions| occured. +% \changes{v0.2v}{1994/01/29} +% {Macro added.} +% \changes{v1.0t}{1995/11/14}{Allow empty option} +% \begin{macrocode} +\def\@@unprocessedoptions{% + \ifx\@currext\@pkgextension + \edef\@curroptions{\@ptionlist{\@currname.\@currext}}% + \@for\CurrentOption:=\@curroptions\do{% + \ifx\CurrentOption\@empty\else\@unknownoptionerror\fi}% + \fi} +\@onlypreamble\@unprocessedoptions +\@onlypreamble\@@unprocessedoptions +% \end{macrocode} +% \end{macro} +% +% \begin{macro}{\@badrequireerror} +% |\RequirePackage| or |\LoadClass| occurs in the options section. +% \changes{v0.2c}{1993/11/17} +% {Macro added} +% \begin{macrocode} +\def\@badrequireerror#1[#2]#3[#4]{% + \@latex@error + {\noexpand\RequirePackage or \noexpand\LoadClass + in Options Section}% + {The \@cls@pkg\space `\@currname' is defective.\MessageBreak + It attempts to load `#3' in the options section, i.e.,\MessageBreak + between \noexpand\DeclareOption and \string\ProcessOptions.}} +\@onlypreamble\@badrequireerror +% \end{macrocode} +% \end{macro} +% +% \begin{macro}{\@twoloadclasserror} +% Two |\LoadClass| in a class. +% \changes{v0.2c}{1993/11/17} +% {Macro added} +% \begin{macrocode} +\def\@twoloadclasserror{% + \@latex@error + {Two \noexpand\LoadClass commands}% + {You may only use one \noexpand\LoadClass in a class file}} +\@onlypreamble\@twoloadclasserror +% \end{macrocode} +% \end{macro} +% +% \begin{macro}{\@twoclasseserror} +% Two |\documentclass| or |\documentstyle|. +% \changes{v0.2h}{1993/11/28} +% {Macro added} +% \begin{macrocode} +\def\@twoclasseserror#1#{% + \@latex@error + {Two \noexpand\documentclass or \noexpand\documentstyle commands}% + {The document may only declare one class.}\@gobble} +\@onlypreamble\@twoclasseserror +% \end{macrocode} +% \end{macro} +% +% \subsection{Providing shipment} +% +% \begin{macro}{\two@digits} +% Prefix a number less than 10 with `0'. +% \begin{macrocode} +\def\two@digits#1{\ifnum#1<10 0\fi\number#1} +% \end{macrocode} +% \end{macro} +% +% \begin{macro}{\filecontents} +% \begin{macro}{\endfilecontents} +% This environment implements inline files. +% The star-form does not write extra comments into the file. +% +% \changes{v0.2h}{1993/11/28} +% {Don't globally allocate a write stream (always use 15)} +% \changes{v0.2r}{1993/12/19}{Different message when ignoring a file} +% \changes{v0.3g}{1994/04/11} +% {Add star form, +% dont write \cs{endinput} at the end of the file.} +% \changes{v1.0c}{1994/05/11} +% {Add checks for form feed and tab} +% \changes{v1.0m}{1995/04/21} +% {Close input check stream: latex/1487} +% \changes{v1.0p}{1995/05/25}{Delete \cs{filec@ntents} after preamble} +% \begin{macrocode} +\begingroup% +\catcode`\*=11 % +\catcode`\^^M\active% +\catcode`\^^L\active\let^^L\relax% +\catcode`\^^I\active% +% \end{macrocode} +% +% \begin{macrocode} +\gdef\filecontents{\@tempswatrue\filec@ntents}% +\gdef\filecontents*{\@tempswafalse\filec@ntents}% +% \end{macrocode} +% +% \begin{macrocode} +\gdef\filec@ntents#1{% + \openin\@inputcheck#1 % + \ifeof\@inputcheck% + \@latex@warning@no@line% + {Writing file `\@currdir#1'}% +% \end{macrocode} +% +% \changes{v1.0y}{1997/10/10} +% {\cs{reserved@c} not \cs{verbatim@out} to save a csname} +% \begin{macrocode} + \chardef\reserved@c15 % + \ch@ck7\reserved@c\write% + \immediate\openout\reserved@c#1\relax% + \else% +% \end{macrocode} +% +% \changes{v1.0y}{1997/10/10} +% {Use \cs{@gobbletwo}} +% \begin{macrocode} + \closein\@inputcheck% + \@latex@warning@no@line% + {File `#1' already exists on the system.\MessageBreak% + Not generating it from this source}% + \let\write\@gobbletwo% + \let\closeout\@gobble% + \fi% + \if@tempswa% +% \end{macrocode} +% +% \changes{v1.0y}{1997/10/10} +% {\cs{@currenvir} in banner} +% \begin{macrocode} + \immediate\write\reserved@c{% + \@percentchar\@percentchar\space% + \expandafter\@gobble\string\LaTeX2e file `#1'^^J% + \@percentchar\@percentchar\space generated by the % + `\@currenvir' \expandafter\@gobblefour\string\newenvironment^^J% + \@percentchar\@percentchar\space from source `\jobname' on % + \number\year/\two@digits\month/\two@digits\day.^^J% + \@percentchar\@percentchar}% + \fi% + \let\do\@makeother\dospecials% +% \end{macrocode} +% +% \changes{v1.0y}{1997/10/10} +% {Check for text before or after \cs{end} environment. latex/2636} +% \begin{macrocode} + \edef\E{\@backslashchar end\string{\@currenvir\string}}% + \edef\reserved@b{% + \def\noexpand\reserved@b% + ####1\E####2\E####3\relax}% + \reserved@b{% + \ifx\relax##3\relax% +% \end{macrocode} +% There was no |\end{filecontents}| +% \begin{macrocode} + \immediate\write\reserved@c{##1}% + \else% +% \end{macrocode} +% There was a |\end{filecontents}|, so stop this time. +% \begin{macrocode} + \edef^^M{\noexpand\end{\@currenvir}}% + \ifx\relax##1\relax% + \else% +% \end{macrocode} +% Text before the |\end|, write it with a warning. +% \begin{macrocode} + \@latex@warning{Writing text `##1' before % + \string\end{\@currenvir}\MessageBreak as last line of #1}% + \immediate\write\reserved@c{##1}% + \fi% + \ifx\relax##2\relax% + \else% +% \end{macrocode} +% Text after the |\end|, ignore it with a warning. +% \begin{macrocode} + \@latex@warning{% + Ignoring text `##2' after \string\end{\@currenvir}}% + \fi% + \fi% + ^^M}% +% \end{macrocode} +% +% \begin{macrocode} + \catcode`\^^L\active% + \let\L\@undefined% + \def^^L{\@ifundefined L^^J^^J^^J}% + \catcode`\^^I\active% + \let\I\@undefined% + \def^^I{\@ifundefined I\space\space}% + \catcode`\^^M\active% + \edef^^M##1^^M{% + \noexpand\reserved@b##1\E\E\relax}}% +\endgroup% +% \end{macrocode} +% +% \begin{macrocode} +\begingroup +\catcode`|=\catcode`\% +\catcode`\%=12 +\catcode`\*=11 +\gdef\@percentchar{%} +\gdef\endfilecontents{| + \immediate\closeout\reserved@c + \def\T##1##2##3{| + \ifx##1\@undefined\else + \@latex@warning@no@line{##2 has been converted to Blank ##3e}| + \fi}| + \T\L{Form Feed}{Lin}| + \T\I{Tab}{Spac}| + \immediate\write\@unused{}} +\global\let\endfilecontents*\endfilecontents +\@onlypreamble\filecontents +\@onlypreamble\endfilecontents +\@onlypreamble\filecontents* +\@onlypreamble\endfilecontents* +\endgroup +\@onlypreamble\filec@ntents +% \end{macrocode} +% \end{macro} +% \end{macro} +% +% +% \changes{v0.2f}{1993/11/22} +% {\cs{@unknownversion} removed} +% \changes{v1.0j}{1994/10/18} +% {Move \cs{listfiles} to ltfiles.dtx} +% +% \begin{macrocode} +% +% \end{macrocode} +% +% \section{After Preamble} +% Finally we declare a package that allows all the commands declared +% above to be |\@onlypreamble| to be used after |\begin{document}|. +% \changes{v0.3f}{1994/03/16} +% {Add pkgindoc package} +% \changes{v1.1a}{1998/03/21} +% {Correct to new onlypreamble command list} +% \begin{macrocode} +%<*afterpreamble> +\NeedsTeXFormat{LaTeX2e} +\ProvidesPackage{pkgindoc} + [1994/10/20 v1.1 Package Interface in Document (DPC)] +\def\reserved@a#1\do\@classoptionslist#2\do\filec@ntents#3\relax{% + \gdef\@preamblecmds{#1#3}} +\expandafter\reserved@a\@preamblecmds\relax +% +% \end{macrocode} +% +% \Finale diff --git a/Master/texmf-dist/source/latex/base/ltcntrl.dtx b/Master/texmf-dist/source/latex/base/ltcntrl.dtx new file mode 100644 index 00000000000..304609d4523 --- /dev/null +++ b/Master/texmf-dist/source/latex/base/ltcntrl.dtx @@ -0,0 +1,323 @@ +% \iffalse meta-comment +% +% Copyright 1993 1994 1995 1996 1997 1998 1999 2000 2001 2002 2003 2004 +% The LaTeX3 Project and any individual authors listed elsewhere +% in this file. +% +% This file is part of the LaTeX base system. +% ------------------------------------------- +% +% It may be distributed and/or modified under the +% conditions of the LaTeX Project Public License, either version 1.3 +% of this license or (at your option) any later version. +% The latest version of this license is in +% http://www.latex-project.org/lppl.txt +% and version 1.3 or later is part of all distributions of LaTeX +% version 2003/12/01 or later. +% +% This file has the LPPL maintenance status "maintained". +% +% The list of all files belonging to the LaTeX base distribution is +% given in the file `manifest.txt'. See also `legal.txt' for additional +% information. +% +% The list of derived (unpacked) files belonging to the distribution +% and covered by LPPL is defined by the unpacking scripts (with +% extension .ins) which are part of the distribution. +% +% \fi +% +% \iffalse +%%% From File: ltcntrl.dtx +%<*driver> +% \fi +\ProvidesFile{ltcntrl.dtx} + [1995/08/16 v1.0g LaTeX Kernel (program control)] +% \iffalse +\documentclass{ltxdoc} +\GetFileInfo{ltcntrl.dtx} +\title{\filename} +\date{\filedate} + \author{% + Johannes Braams\and + David Carlisle\and + Alan Jeffrey\and + Leslie Lamport\and + Frank Mittelbach\and + Chris Rowley\and + Rainer Sch\"opf} +\begin{document} +\maketitle + \DocInput{\filename} +\end{document} +% +% \fi +% +% \CheckSum{175} +% +% \changes{v1.0a}{1994/05/16}{(ASAJ) Split from ltinit.dtx.} +% \changes{v1.0b}{1994/11/17} +% {\cs{@tempa} to \cs{reserved@a}} +% \changes{v1.0c}{1994/11/28} +% {Documentation improvements} +% +% \section{Program control structure} +% +% This section defines a number of control structure macros, such as +% while-loops and for-loops. +% +% \StopEventually{} +% +% \begin{oldcomments} +% \begin{macrocode} +%<*2ekernel> +\message{control,} +% \end{macrocode} +% +% \@whilenum TEST \do {BODY} +% \@whiledim TEST \do {BODY} : These implement the loop +% while TEST do BODY od +% where TEST is a TeX \ifnum or \ifdim test, respectively. +% They are optimized for the normal case of TEST initially false. +% +% \@whilesw SWITCH \fi {BODY} : Implements the loop +% while SWITCH do BODY od +% Optimized for normal case of SWITCH initially false. +% +% \@for NAME := LIST \do {BODY} : Assumes that LIST expands to A1,A2, +% ... ,An . +% Executes BODY n times, with NAME = Ai on the i-th iteration. +% Optimized for the normal case of n = 1. Works for n=0. +% +% \@tfor NAME := LIST \do {BODY} +% if, before expansion, LIST = T1 ... Tn where each Ti is a +% token or {...}, then executes BODY n times, with NAME = Ti +% on the i-th iteration. Works for n=0. +% +% NOTES: 1. These macros use no \@temp sequences. +% 2. These macros do not work if the body contains anything that +% looks syntactically to TeX like an improperly balanced \if +% \else \fi. +% +% \@whilenum TEST \do {BODY} == +% BEGIN +% if TEST +% then BODY +% \@iwhilenum{TEST \relax BODY} +% END +% +% \@iwhilenum {TEST BODY} == +% BEGIN +% if TEST +% then BODY +% \@nextwhile = def(\@iwhilenum) +% else \@nextwhile = def(\@whilenoop) +% fi +% \@nextwhile {TEST BODY} +% END +% +% \@whilesw SWITCH \fi {BODY} == +% BEGIN +% if SWITCH +% then BODY +% \@iwhilesw {SWITCH BODY}\fi +% fi +% END +% +% \@iwhilesw {SWITCH BODY} \fi == +% BEGIN +% if SWITCH +% then BODY +% \@nextwhile = def(\@iwhilesw) +% else \@nextwhile = def(\@whileswnoop) +% fi +% \@nextwhile {SWITCH BODY} \fi +% END +% +% \end{oldcomments} +% +% \begin{macro}{\@whilenoop} +% \begin{macro}{\@whilenum} +% \begin{macro}{\@iwhilenum} +% \changes{v1.0f}{1995/07/09}{Reimplemented using Kabelschacht method} +% \changes{v1.0g}{1995/08/16}{Removed \cs{@whilenoop}} +% \changes{v1.0g}{1995/08/16}{Made defs long} +% \begin{macrocode} +\long\def\@whilenum#1\do #2{\ifnum #1\relax #2\relax\@iwhilenum{#1\relax + #2\relax}\fi} +\long\def\@iwhilenum#1{\ifnum #1\expandafter\@iwhilenum + \else\expandafter\@gobble\fi{#1}} +% \end{macrocode} +% \end{macro} +% \end{macro} +% \end{macro} +% +% \begin{macro}{\@whiledim} +% \begin{macro}{\@iwhiledim} +% \changes{v1.0f}{1995/07/09}{Reimplemented using Kabelschacht method} +% \changes{v1.0g}{1995/08/16}{Removed \cs{@whilenoop}} +% \changes{v1.0g}{1995/08/16}{Made defs long} +% \begin{macrocode} +\long\def\@whiledim#1\do #2{\ifdim #1\relax#2\@iwhiledim{#1\relax#2}\fi} +\long\def\@iwhiledim#1{\ifdim #1\expandafter\@iwhiledim + \else\expandafter\@gobble\fi{#1}} +% \end{macrocode} +% \end{macro} +% \end{macro} +% +% \begin{macro}{\@whileswnoop} +% \begin{macro}{\@whilesw} +% \begin{macro}{\@iwhilesw} +% \changes{v1.0f}{1995/07/09}{Reimplemented using Kabelschacht method} +% \changes{v1.0g}{1995/08/16}{Removed \cs{@whileswnoop}} +% \begin{macrocode} +\long\def\@whilesw#1\fi#2{#1#2\@iwhilesw{#1#2}\fi\fi} +\long\def\@iwhilesw#1\fi{#1\expandafter\@iwhilesw + \else\@gobbletwo\fi{#1}\fi} +% \end{macrocode} +% \end{macro} +% \end{macro} +% \end{macro} +% +% \begin{oldcomments} +% +% \@for NAME := LIST \do {BODY} == +% BEGIN \@forloop expand(LIST),\@nil,\@nil \@@ NAME {BODY} END +% +% \@forloop CAR, CARCDR, CDRCDR \@@ NAME {BODY} == +% BEGIN +% NAME = CAR +% if def(NAME) = def(\@nnil) +% else BODY; +% NAME = CARCDR +% if def(NAME) = def(\@nnil) +% else BODY +% \@iforloop CDRCDR \@@ NAME \do {BODY} +% fi +% fi +% END +% +% \@iforloop CAR, CDR \@@ NAME {BODY} = +% NAME = CAR +% if def(NAME) = def(\@nnil) +% then \@nextwhile = def(\@fornoop) +% else BODY ; +% \@nextwhile = def(\@iforloop) +% fi +% \@nextwhile name cdr {body} +% +% \@tfor NAME := LIST \do {BODY} +% = \@tforloop LIST \@nil \@@ NAME {BODY} +% +% \@tforloop car cdr \@@ name {body} = +% name = car +% if def(name) = def(\@nnil) +% then \@nextwhile == \@fornoop +% else body ; +% \@nextwhile == \@forloop +% fi +% \@nextwhile name cdr {body} +% \end{oldcomments} +% +% \begin{macro}{\@nnil} +% \begin{macrocode} +\def\@nnil{\@nil} +% \end{macrocode} +% \end{macro} +% +% \begin{macro}{\@empty} +% \begin{macrocode} +\def\@empty{} +% \end{macrocode} +% \end{macro} +% +% \begin{macro}{\@fornoop} +% \changes{v1.0g}{1995/08/16}{Made defs long} +% \begin{macrocode} +\def\@fornoop#1\@@#2#3{} +% \end{macrocode} +% \end{macro} +% +% \begin{macro}{\@for} +% \changes{v1.0d}{1995/04/24} +% {Dont expand second argument with \cs{edef}: /1317 (DPC)} +% \begin{macrocode} +\long\def\@for#1:=#2\do#3{% + \expandafter\def\expandafter\@fortmp\expandafter{#2}% + \ifx\@fortmp\@empty \else + \expandafter\@forloop#2,\@nil,\@nil\@@#1{#3}\fi} +% \end{macrocode} +% \end{macro} +% +% \begin{macro}{\@forloop} +% \changes{v1.0g}{1995/08/16}{Made defs long} +% \begin{macrocode} +\long\def\@forloop#1,#2,#3\@@#4#5{\def#4{#1}\ifx #4\@nnil \else + #5\def#4{#2}\ifx #4\@nnil \else#5\@iforloop #3\@@#4{#5}\fi\fi} +% \end{macrocode} +% \end{macro} +% +% \begin{macro}{\@iforloop} +% \changes{v1.0f}{1995/07/09}{Reimplemented using Kabelschacht method} +% \changes{v1.0g}{1995/08/16}{Made defs long} +% \begin{macrocode} +\long\def\@iforloop#1,#2\@@#3#4{\def#3{#1}\ifx #3\@nnil + \expandafter\@fornoop \else + #4\relax\expandafter\@iforloop\fi#2\@@#3{#4}} +% \end{macrocode} +% \end{macro} +% +% \begin{macro}{\@tfor} +% \changes{LaTeX209}{1991/10/17} +% {(Rms) \cs{xdef} replaced by \cs{def} +% (See FMi's array.doc)} +% \changes{v1.0c}{1994/03/13} +% {(DPC) Add \cs{@tf@r} so a single group is +% correctly treated.} +% \changes{v1.0f}{1995/07/09}{Reimplemented using Kabelschacht method} +% \changes{v1.0g}{1995/08/16}{Made defs long} +% \begin{macrocode} +\def\@tfor#1:={\@tf@r#1 } +\long\def\@tf@r#1#2\do#3{\def\@fortmp{#2}\ifx\@fortmp\space\else + \@tforloop#2\@nil\@nil\@@#1{#3}\fi} +\long\def\@tforloop#1#2\@@#3#4{\def#3{#1}\ifx #3\@nnil + \expandafter\@fornoop \else + #4\relax\expandafter\@tforloop\fi#2\@@#3{#4}} +% \end{macrocode} +% \end{macro} +% +% \begin{macro}{\@break@tfor} +% Break out of a |\@tfor| loop. This should be called \emph{inside} +% the scope of an |\if|. See |\@iffileonpath| for an example. +% \changes{v1.0l}{1994/05/02}{Macro added (from ltfiles.dtx)} +% \changes{v1.0g}{1995/08/16}{Made long} +% \begin{macrocode} +\long\def\@break@tfor#1\@@#2#3{\fi\fi} +% \end{macrocode} +% \end{macro} +% +% \begin{macro}{\@removeelement} +% Removes an element from a comma-separated list and puts it into +% a control sequence, called as +% |\@removeelement{|\meta{element}|}{|\meta{list}|}{|\meta{cs}|}|. +% \begin{macrocode} +\def\@removeelement#1#2#3{% + \def\reserved@a##1,#1,##2\reserved@a{##1,##2\reserved@b}% + \def\reserved@b##1,\reserved@b##2\reserved@b{% + \ifx,##1\@empty\else##1\fi}% + \edef#3{% + \expandafter\reserved@b\reserved@a,#2,\reserved@b,#1,\reserved@a}} +% \end{macrocode} +% \end{macro} +% +% +% \changes{v1.0e}{1995/04/29}{Removed unused defs for +% \cs{@setprotect} and \cs{@resetprotect}} +% \changes{v1.0e}{1995/04/29}{Moved init of \cs{protect} +% to ltdefns.dtx} +% \begin{macrocode} +% +% \end{macrocode} +% +%\Finale +\endinput diff --git a/Master/texmf-dist/source/latex/base/ltcounts.dtx b/Master/texmf-dist/source/latex/base/ltcounts.dtx new file mode 100644 index 00000000000..23acbc10dee --- /dev/null +++ b/Master/texmf-dist/source/latex/base/ltcounts.dtx @@ -0,0 +1,434 @@ +% \iffalse meta-comment +% +% Copyright 1993 1994 1995 1996 1997 1998 1999 2000 2001 2002 2003 2004 +% The LaTeX3 Project and any individual authors listed elsewhere +% in this file. +% +% This file is part of the LaTeX base system. +% ------------------------------------------- +% +% It may be distributed and/or modified under the +% conditions of the LaTeX Project Public License, either version 1.3 +% of this license or (at your option) any later version. +% The latest version of this license is in +% http://www.latex-project.org/lppl.txt +% and version 1.3 or later is part of all distributions of LaTeX +% version 2003/12/01 or later. +% +% This file has the LPPL maintenance status "maintained". +% +% The list of all files belonging to the LaTeX base distribution is +% given in the file `manifest.txt'. See also `legal.txt' for additional +% information. +% +% The list of derived (unpacked) files belonging to the distribution +% and covered by LPPL is defined by the unpacking scripts (with +% extension .ins) which are part of the distribution. +% +% \fi +% +% \iffalse +%%% From File: ltcounts.dtx +% +%<*driver> +% \fi +\ProvidesFile{ltcounts.dtx} + [1998/05/16 v1.1g LaTeX Kernel (Counters)] +% \iffalse +\documentclass{ltxdoc} +\GetFileInfo{ltcounts.dtx} +\title{\filename} +\date{\filedate} + \author{% + Johannes Braams\and + David Carlisle\and + Alan Jeffrey\and + Leslie Lamport\and + Frank Mittelbach\and + Chris Rowley\and + Rainer Sch\"opf} + +\begin{document} +\maketitle + \DocInput{\filename} +\end{document} +% +% \fi +% +% \CheckSum{256} +% +% \changes{v1.0c}{1994/03/29} +% {Create file from parts of ltmiscen and ltherest.} +% \changes{v1.1a}{1994/05/19}{Extracted file from ltcntlen.} +% \changes{v1.1d}{1996/04/23}{Documentation improvements} +% +% \section{Counters and Lengths} +% Commands for defining and using counters. This file defines: +% +% \DescribeMacro{\newcounter} +% To define a new counter. +% +% \DescribeMacro{\setcounter} +% To set the value of counters. +% +% \DescribeMacro{\addtocounter} +% Increase the counter |#1| by the number |#2|. +% +% \DescribeMacro{\stepcounter} +% Increase a counter by one. +% +% \DescribeMacro{\refstepcounter} +% Increase a counter by one, also setting the value used by |\label|. +% +% +% \DescribeMacro{\value} +% For accessing the value of the counter as a \TeX\ number (as opposed +% to |\the|\meta{counter} which expands to the \emph{printed} +% representation of \meta{counter}) +% +% \DescribeMacro\arabic +% |\arabic|\marg{counter}: 1, 2, 3, \ldots +% +% \DescribeMacro\roman +% |\roman|\marg{counter}: i, ii, iii, \ldots +% +% \DescribeMacro\Roman +% |\Roman|\marg{counter}: I, II, III, \ldots +% +% \DescribeMacro\alph +% |\alph|\marg{counter}: a, b, c, \ldots +% +% \DescribeMacro\Alph +% |\Alph|\marg{counter}: A, B, C, \ldots +% +% \DescribeMacro\fnsymbol +% |\fnsymbol|\marg{counter}: $*$, $\dagger$, $\ddagger$, \ldots +% +% +% \StopEventually{} +% +% \begin{macrocode} +%<*2ekernel> +% \end{macrocode} +% +% \subsection{Environment Counter Macros} +% +% An environment foo has an associated counter defined by the +% following control sequences: +% +% \begin{tabular}{lp{.75\textwidth}} +% |\c@foo| & Contains the counter's numerical value. +% It is defined by |\newcount\foocounter|.\\ +% |\thefoo| & Macro that expands to the printed value of |\foocounter|. +% For example, if sections are numbered within chapters, +% and section headings look like +% +% Section II-3. The Nature of Counters +% +% then |\thesection| might be defined by:\newline +% |\def\thesection|\newline\hspace*{2em} +% |{\@Roman{\c@chapter}-\@arabic{\c@section}}|\\ +% +% |\p@foo| & Macro that expands to a printed `reference prefix' of +% counter foo. Any |\ref| to a value created by counter +% foo will produce the expansion of |\p@foo\thefoo| when +% the |\label| command is executed. See file \texttt{ltxref.dtx} +% for an extension of this mechanism.\\ +% |\cl@foo| & List of counters to be reset when foo stepped. +% Has format +% |\@elt{countera}\@elt{counterb}\@elt{counterc}|. +% \end{tabular} +% +% \textbf{NOTE:}\\ +% |\thefoo| and |\p@foo| \emph{must} be defined in such a way that +% |\edef\bar{\thefoo}| or |\edef\bar{\p@foo}| +% defines |\bar| so that it will evaluate to the counter value at the +% time of the |\edef|, even after |\foocounter| and any other counters +% have been changed. This will happen if you use the standard commands +% |\@arabic|, |\@Roman|, etc. +% +% +% The following commands are used to define and modify counters. +% +% |\refstepcounter|\marg{foo}\\ +% Same as |\stepcounter|, but it also defines +% |\@currentreference| so that a subsequent +% |\label|\marg{bar} command causes |\ref|\marg{bar} to +% generate the current value of counter \meta{foo}. +% +% |\@definecounter|\marg{foo}\\ +% Initializes counter \marg{foo} (with empty reset list), defines +% |\p@foo| and |\thefoo| to be null. Also adds \meta{foo} +% to |\cl@@ckpt| -- +% the reset list of a dummy counter |@ckpt| used for taking +% checkpoints for the |\include| system. +% +% |\@addtoreset|\marg{foo}\marg{bar} : +% Adds counter \meta{foo} to the list of counters +% |\cl@bar| to be reset when counter \meta{bar} is stepped. +% +% +% \begin{macro}{\setcounter} +% \changes{v1.0d}{1994/04/09} +% {\cs{@nocnterr} now has counter name argument} +% \changes{v1.0e}{1994/04/17} +% {Use \cs{@nocounterr} instead of \cs{@nocnterr}} +% |\setcounter|\marg{foo}\marg{val} : +% Globally sets |\foocounter| equal to \meta{val}. +% \begin{macrocode} +\def\setcounter#1#2{% + \@ifundefined{c@#1}% + {\@nocounterr{#1}}% + {\global\csname c@#1\endcsname#2\relax}} +% \end{macrocode} +% \end{macro} +% +% \begin{macro}{\addtocounter} +% \changes{v1.0d}{1994/04/09} +% {\cs{@nocnterr} now has counter name argument} +% \changes{v1.0e}{1994/04/17} +% {Use \cs{@nocounterr} instead of \cs{@nocnterr}} +% |\addtocounter|\marg{foo}\marg{val} +% Globally increments |\foocounter| by \meta{val}. +% \begin{macrocode} +\def\addtocounter#1#2{% + \@ifundefined{c@#1}% + {\@nocounterr{#1}}% + {\global\advance\csname c@#1\endcsname #2\relax}} +% \end{macrocode} +% \end{macro} +% +% \begin{macro}{\newcounter} +% |\newcounter|\marg{newctr}\oarg{oldctr} +% Defines \meta{newctr} to be a counter, which is reset when counter +% \meta{oldctr} is stepped. If \meta{newctr} already defined +% produces +% `|c@newctr already defined|' error. +% \begin{macrocode} +\def\newcounter#1{% + \expandafter\@ifdefinable \csname c@#1\endcsname + {\@definecounter{#1}}% + \@ifnextchar[{\@newctr{#1}}{}} +% \end{macrocode} +% \end{macro} +% +% \begin{macro}{\value} +% |\value|\marg{ctr} +% produces the value of counter \meta{ctr}, for use with +% a |\setcounter| or |\addtocounter| command. +% \begin{macrocode} +\def\value#1{\csname c@#1\endcsname} +% \end{macrocode} +% \end{macro} +% +% \begin{macro}{\@newctr} +% \changes{v1.0d}{1994/04/09} +% {\cs{@nocnterr} now has counter name argument} +% \changes{v1.0e}{1994/04/17} +% {Use \cs{@nocounterr} instead of \cs{@nocnterr}} +% \begin{macrocode} +\def\@newctr#1[#2]{% + \@ifundefined{c@#2}{\@nocounterr{#2}}{\@addtoreset{#1}{#2}}} +% \end{macrocode} +% \end{macro} +% +% \begin{macro}{\stepcounter} +% \changes{LaTeX209}{1992/11/23}{Replaced \{\} in \cs{stepcounter} by +% \cs{begingroup} \cs{endgroup} to avoid adding an empty ord in +% math mode} +% \changes{v1.0d}{1994/04/09} +% {Use \cs{addtocounter} to have name checked} +% |\stepcounter|{foo} +% Globally increments counter |\c@FOO| +% and resets all subsidiary counters. +% \begin{macrocode} +\def\stepcounter#1{% + \addtocounter{#1}\@ne + \begingroup + \let\@elt\@stpelt + \csname cl@#1\endcsname + \endgroup} +% \end{macrocode} +% \end{macro} +% +% \begin{macro}{\@stpelt} +% \begin{macrocode} +\def\@stpelt#1{\global\csname c@#1\endcsname \z@} +% \end{macrocode} +% \end{macro} +% +% \begin{macro}{\cl@@ckpt} +% \begin{macrocode} +\def\cl@@ckpt{\@elt{page}} +% \end{macrocode} +% \end{macro} +% +% \begin{macro}{\@definecounter} +% \changes{v1.1b}{1995/05/20}{Streamlined code} +% \changes{v1.1c}{1995/05/20}{And do it right} +% +% \begin{macrocode} +\def\@definecounter#1{\expandafter\newcount\csname c@#1\endcsname + \setcounter{#1}\z@ + \global\expandafter\let\csname cl@#1\endcsname\@empty + \@addtoreset{#1}{@ckpt}% + \global\expandafter\let\csname p@#1\endcsname\@empty + \expandafter + \gdef\csname the#1\expandafter\endcsname\expandafter + {\expandafter\@arabic\csname c@#1\endcsname}} +% \end{macrocode} +% \end{macro} +% +% \begin{macro}{\@addtoreset} +% \begin{macrocode} +\def\@addtoreset#1#2{\expandafter\@cons\csname cl@#2\endcsname {{#1}}} +% \end{macrocode} +% \end{macro} +% +% +% Numbering commands for definitions of |\theCOUNTER| and |\list| +% arguments. +% +% All commands can now be used in text and math mode. +% +% \begin{macro}{\arabic} +% Representation of\meta{counter} as arabic numerals. +% Changed 29 Apr 86 to make it print the obvious thing +% it COUNTER not positive. +% \begin{macrocode} +\def\arabic#1{\expandafter\@arabic\csname c@#1\endcsname} +% \end{macrocode} +% \end{macro} +% +% \begin{macro}{\roman} +% Representation of \meta{counter} as lower-case +% Roman numerals. +% \begin{macrocode} +\def\roman#1{\expandafter\@roman\csname c@#1\endcsname} +% \end{macrocode} +% \end{macro} +% +% \begin{macro}{\Roman} +% Representation of \meta{counter} as upper-case +% Roman numerals. +% \begin{macrocode} +\def\Roman#1{\expandafter\@Roman\csname c@#1\endcsname} +% \end{macrocode} +% \end{macro} +% +% \begin{macro}{\alph} +% Representation of \meta{counter} as a lower-case +% letter: 1 = a, 2 = b, etc. +% \begin{macrocode} +\def\alph#1{\expandafter\@alph\csname c@#1\endcsname} +% \end{macrocode} +% \end{macro} +% +% \begin{macro}{\Alph} +% Representation of \meta{counter} as an upper-case +% letter: 1 = A, 2 = B, etc. +% \begin{macrocode} +\def\Alph#1{\expandafter\@Alph\csname c@#1\endcsname} +% \end{macrocode} +% \end{macro} +% +% \begin{macro}{\fnsymbol} +% \changes{v1.1b}{1995/05/20}{Streamlined code} +% \changes{v1.1e}{1997/03/21} +% {Use \cs{mathsection} and \cs{mathparagraph}. latex/2445} +% +% Representation of \meta{COUNTER} as a footnote +% symbol: 1 = $*$, 2 = $\dagger$, etc. +% \begin{macrocode} +\def\fnsymbol#1{\expandafter\@fnsymbol\csname c@#1\endcsname} +% \end{macrocode} +% \end{macro} +% +% \changes{v1.0f}{1994/05/13}{Removed \cs{@ialph}} +% \changes{v1.0f}{1994/05/13}{Removed \cs{@Ialph}} +% +% \begin{macro}{\@arabic} +% |\@arabic\FOOcounter| +% Representation of |\FOOcounter| as arabic numerals. +% \begin{macrocode} +\def\@arabic#1{\number #1} %% changed 29 Apr 86 +% \end{macrocode} +% \end{macro} +% +% \begin{macro}{\@roman} +% |\@roman\FOOcounter| +% Representation of |\FOOcounter| as lower-case +% Roman numerals. +% \begin{macrocode} +\def\@roman#1{\romannumeral #1} +% \end{macrocode} +% \end{macro} +% +% \begin{macro}{\@Roman} +% |\@Roman\FOOcounter| +% Representation of |\FOOcounter| as upper-case +% Roman numerals. + +% \changes{v1.1f}{1997/10/06}{Change \cs{@Roman} to be fully +% expandable, so that the result is written properly to files.} +% \begin{macrocode} +\def\@Roman#1{\expandafter\@slowromancap\romannumeral #1@} +% \end{macrocode} +% \end{macro} +% +% \begin{macro}{\@slowromancap} +% \changes{v1.1f}{1997/10/06}{Macro added.} +% Fully expandable macro to change a roman number to uppercase. +% \begin{macrocode} +\def\@slowromancap#1{\ifx @#1% then terminate + \else + \if i#1I\else\if v#1V\else\if x#1X\else\if l#1L\else\if + c#1C\else\if d#1D\else \if m#1M\else#1\fi\fi\fi\fi\fi\fi\fi + \expandafter\@slowromancap + \fi +} +% \end{macrocode} +% \end{macro} +% +% \begin{macro}{\@alph} +% |\@alph\FOOcounter| +% Representation of |\FOOcounter| as a lower-case +% letter: 1 = a, 2 = b, etc. +% \begin{macrocode} +\def\@alph#1{% + \ifcase#1\or a\or b\or c\or d\or e\or f\or g\or h\or i\or j\or + k\or l\or m\or n\or o\or p\or q\or r\or s\or t\or u\or v\or w\or x\or + y\or z\else\@ctrerr\fi} +% \end{macrocode} +% \end{macro} +% +% \begin{macro}{\@Alph} +% |\@Alph\FOOcounter| +% Representation of |\FOOcounter| as an upper-case +% letter: 1 = A, 2 = B, etc. +% \begin{macrocode} +\def\@Alph#1{% + \ifcase#1\or A\or B\or C\or D\or E\or F\or G\or H\or I\or J\or + K\or L\or M\or N\or O\or P\or Q\or R\or S\or T\or U\or V\or W\or X\or + Y\or Z\else\@ctrerr\fi} +% \end{macrocode} +% \end{macro} +% +% \begin{macro}{\@fnsymbol} +% \changes{v1.1b}{1995/05/20}{Allowing both text and math} +% Typesetting old fashioned footnote symbols. +% This can be done both in text or math mode now. +% \begin{macrocode} +\def\@fnsymbol#1{\ensuremath{\ifcase#1\or *\or \dagger\or \ddagger\or + \mathsection\or \mathparagraph\or \|\or **\or \dagger\dagger + \or \ddagger\ddagger \else\@ctrerr\fi}} +% \end{macrocode} +% \end{macro} +% +% +% \begin{macrocode} +% +% \end{macrocode} +% +% \Finale +% diff --git a/Master/texmf-dist/source/latex/base/ltdefns.dtx b/Master/texmf-dist/source/latex/base/ltdefns.dtx new file mode 100644 index 00000000000..f3ef0b05149 --- /dev/null +++ b/Master/texmf-dist/source/latex/base/ltdefns.dtx @@ -0,0 +1,1455 @@ +% \iffalse meta-comment +% +% Copyright 1993 1994 1995 1996 1997 1998 1999 2000 2001 2002 2003 2004 +% The LaTeX3 Project and any individual authors listed elsewhere +% in this file. +% +% This file is part of the LaTeX base system. +% ------------------------------------------- +% +% It may be distributed and/or modified under the +% conditions of the LaTeX Project Public License, either version 1.3 +% of this license or (at your option) any later version. +% The latest version of this license is in +% http://www.latex-project.org/lppl.txt +% and version 1.3 or later is part of all distributions of LaTeX +% version 2003/12/01 or later. +% +% This file has the LPPL maintenance status "maintained". +% +% The list of all files belonging to the LaTeX base distribution is +% given in the file `manifest.txt'. See also `legal.txt' for additional +% information. +% +% The list of derived (unpacked) files belonging to the distribution +% and covered by LPPL is defined by the unpacking scripts (with +% extension .ins) which are part of the distribution. +% +% \fi +% +% \iffalse +%%% From File: ltdefns.dtx +%<*driver> +% \fi +\ProvidesFile{ltdefns.dtx} + [2004/02/20 v1.3g LaTeX Kernel (definition commands)] +% \iffalse +\documentclass{ltxdoc} +\GetFileInfo{ltdefns.dtx} +\title{\filename} +\date{\filedate} + \author{% + Johannes Braams\and + David Carlisle\and + Alan Jeffrey\and + Leslie Lamport\and + Frank Mittelbach\and + Chris Rowley\and + Rainer Sch\"opf} +\begin{document} +\maketitle + \DocInput{\filename} +\end{document} +% +% \fi +% +% \CheckSum{746} +% +% \changes{v1.0n}{1994/05/10}{(ASAJ) Added +% \cs{DeclareProtectedCommand}.} +% \changes{v1.0p}{1994/05/12}{(ASAJ) Fixed a bug with \cs{relax} +% which was +% using \cs{@gobble} before defining it.} +% \changes{v1.0q}{1994/05/13}{(ASAJ) Renamed +% \cs{DeclareProtectedCommand} to +% \cs{DeclareRobustCommand}. Removed \cs{@if@short@command}.} +% \changes{v1.0q}{1994/05/13}{(ASAJ) Replaces \cs{space} by `~' in +% \cs{csname}.} +% \changes{v1.0r}{1994/05/13}{(ASAJ) Added logging message to +% \cs{DeclareProtectedCommand}.} +% \changes{v1.0s}{1994/05/13}{(ASAJ) Added \cs{@backslashchar}.} +% \changes{v1.0s}{1994/05/13}{(ASAJ) Coded \cs{@ifdefinable} more +% efficiently.} +% \changes{v1.1a}{1994/05/16}{(ASAJ) Split from ltinit.dtx.} +% \changes{v1.1b}{1994/05/17}{(ASAJ) Removed warnings and logging to +% lterror.dtx.} +% \changes{v1.1b}{1994/05/17}{(ASAJ) Added definitions for protect.} +% \changes{v1.1c}{1994/05/17}{(ASAJ) Redid definitions for protect.} +% \changes{v1.1d}{1994/05/19}{(RmS) Added definitions for +% \cs{@namedef} and \cs{@nameuse} again.} +% \changes{v1.1e}{1994/05/20}{Changed command name from +% \cs{@checkcommand} to \cs{CheckCommand}.} +% \changes{v1.1f}{1994/05/22}{Use new warning and error cmds} +% \changes{v1.2a}{1994/10/18}{Add star-forms for all commands} +% \changes{v1.2a}{1994/10/18}{Add extra test for \cs{endgraf}} +% \changes{v1.2b}{1994/10/25}{Documentation improvements} +% \changes{v1.2c}{1994/10/30}{(CAR)\cs{@onelevel@sanitize} added} +% \changes{v1.2f}{1994/10/30}{(DPC)\cs{newwrite}'s moved to ltfiles} +% \changes{v1.0g}{1994/11/17} +% {\cs{@tempa} to \cs{reserved@a}} +% \changes{v1.0p}{1995/07/13}{Updates to documentation} +% +% \section{Definitions} +% +% This section contains commands used in defining other macros. +% +% \StopEventually{} +% +% \begin{macrocode} +%<*2ekernel> +% \end{macrocode} +% +% \subsection{Initex initialisations} +% +% \task{???}{This section needs extension} +% +% \begin{macro}{\two@digits} +% \changes{LaTeX2e}{1993/11/23}{Macro added} +% Prefix a number less than 10 with `0'. +% \begin{macrocode} +\def\two@digits#1{\ifnum#1<10 0\fi\number#1} +% \end{macrocode} +% \end{macro} +% +% \changes{v1.2e}{1994/11/04}{Added \cs{set@display@protect} to +% \cs{typeout}. ASAJ.} +% +% \begin{macro}{\typeout} +% Display something on the terminal. +% \begin{macrocode} +\def\typeout#1{\begingroup\set@display@protect + \immediate\write\@unused{#1}\endgroup} +% \end{macrocode} +% \end{macro} +% +% \begin{macro}{\newlinechar} +% A char to be used as new-line in output to files. +% \begin{macrocode} +\newlinechar`\^^J +% \end{macrocode} +% \end{macro} +% +% \subsection{Saved versions of \TeX{} primitives} +% +% The TeX primitive |\foo| is saved as |\@@foo|. +% The following primitives are handled in this way: +% \begin{macro}{\@@par} +% \begin{macrocode} +\let\@@par=\par +%\let\@@input=\input %%% moved earlier +%\let\@@end=\end %%% +% \end{macrocode} +% \end{macro} +% +% \begin{macro}{\@@hyph} +% \begin{macro}{\-} +% \changes{1.2x}{1995/12/13}{Documentation changed.} +% The following comment was added when these commands were first set +% up, 19 April 1986: +% the |\-| command is redefined to allow it to work in the |\ttfamily| +% type style, where automatic hyphenation is suppressed by setting +% |\hyphenchar| to~$-1$. The original primitive \TeX{} definition is +% saved as |\@@hyph| just in case anyone needs it. +% +% There is a need for a robust command for a discretionary hyphen +% since its exact representation depends on the glyphs available in +% the current font. For example, with suitable fonts and the +% \texttt{T1} font encoding it is possible to use hanging hyphens. +% +% A suitable robust definition that allows for many possible types of +% font and encoding may be as follows: +% \begin{verbatim} +% \DeclareRobustCommand {\-}{% +% \discretionary {% +% \char \ifnum\hyphenchar\font<\z@ +% \defaulthyphenchar +% \else +% \hyphenchar\font +% \fi +% }{}{}% +% } +% \end{verbatim} +% +% The redefinition (via |\let|) of |\-| within tabbing also makes the +% use of a robust command advisable since then any redefinition +% of |\-| via |\DeclareRobustCommand| will not cause a conflict. +% +% Therefore, macro writers should be hereby warned that +% these internals will probably change! It is likely that a future +% release of \LaTeX{} will make |\-| effectively an encoding specific +% text command. +% +% \begin{macrocode} +\let\@@hyph=\- % Save original primitive definition +\def\-{\discretionary{-}{}{}} +% \end{macrocode} +% \end{macro} +% \end{macro} +% +% \begin{macro}{\@dischyph} +% \changes{v1.0g}{1994/04/12} +% {Define \cs{@dischyph}, was previously in ltboxes.dtx} +% \begin{macrocode} +\let\@dischyph=\- +% \end{macrocode} +% \end{macro} +% +% \begin{macro}{\@@italiccorr} +% Save the original italic correction. +% \changes{v1.0a}{1994/03/07}{Macro added} +% \begin{macrocode} +\let\@@italiccorr=\/ +% \end{macrocode} +% \end{macro} +% +% \begin{macro}{\@height} +% \begin{macro}{\@depth} +% \begin{macro}{\@width} +% \begin{macro}{\@minus} +% \changes{LaTeX2e}{1993/11/22}{Macro added} +% \begin{macro}{\@plus} +% \changes{LaTeX2e}{1993/11/22}{Macro added} +% +% The following definitions save token space. E.g., using +% |\@height| instead of height saves 5 tokens at the cost in time +% of one macro expansion. +% \begin{macrocode} +\def\@height{height} \def\@depth{depth} \def\@width{width} +\def\@minus{minus} +\def\@plus{plus} +% \end{macrocode} +% \begin{macro}{\hb@xt@} +% \changes{v1.2k}{1995/05/07}{Macro added} +% The next one is another 100 tokens worth. +% \begin{macrocode} +\def\hb@xt@{\hbox to} +% \end{macrocode} +% \end{macro} +% \end{macro} +% \end{macro} +% \end{macro} +% \end{macro} +% \end{macro} +% +% \begin{macrocode} +\message{hacks,} +% \end{macrocode} +% +% \subsection{Command definitions} +% +% This section defines the following commands: +% +% \DescribeMacro +% {\@namedef}\marg{NAME}\\ Expands to |\def\|\marg{NAME}, +% except name can contain any characters. +% +% \DescribeMacro +% {\@nameuse}\marg{NAME}\\ +% Expands to |\|\marg{NAME}. +% +% \DescribeMacro +% {\@ifnextchar} X\marg{YES}\marg{NO}\\ +% Expands to \meta{YES} if next character is an `X', +% and to \meta{NO} otherwise. +% (Uses |\reserved@a|--|\reserved@c|.) +% NOTE: GOBBLES ANY SPACE FOLLOWING IT. +% +% \DescribeMacro +% {\@ifstar}\marg{YES}\marg{NO}\\ +% Gobbles following spaces and then tests if next the +% character is a '*'. If it is, then it gobbles the +% `*' and expands to \meta{YES}, otherwise it expands to \meta{NO}. +% +% \DescribeMacro +% {\@dblarg}\marg{CMD}\marg{ARG}\\ +% Expands to |\|\marg{CMD}\oarg{ARG}\marg{ARG}. Use +% |\@dblarg\CS| when |\CS| takes arguments |[ARG1]{ARG2}|, +% where default is| ARG1| = |ARG2|. +% +% \DescribeMacro +% {\@ifundefined}\marg{NAME}\marg{YES}\marg{NO}\\ +% : If \cs{NAME} is undefined then it executes \meta{YES}, +% otherwise it executes \meta{NO}. More precisely, +% true if \cs{NAME} either undefined or = |\relax|. +% +% \DescribeMacro +% {\@ifdefinable}|\NAME|\marg{YES} +% Executes \meta{YES} if the user is allowed to define |\NAME|, +% otherwise it gives an error. The user can define |\NAME| +% if |\@ifundefined{NAME}| is true, '|NAME|' $\neq$ '|relax|' +% and the first three letters of '|NAME|' are not +% '|end|', and if |\endNAME| is not defined. +% +% \DescribeMacro +% \newcommand|*|\marg{\cs{FOO}}\oarg{i}\marg{TEXT}\\ +% User command to define |\FOO| to be a macro with +% i arguments (i = 0 if missing) having the definition +% \meta{TEXT}. Produces an error if |\FOO| already +% defined. +% +% Normally the command is defined to be |\long| (ie it may +% take multiple paragraphs in its argument). In the +% star-form, the command is not defined as |\long| and a +% blank line in any argument to the command would generate +% an error. +% +% \DescribeMacro +% \renewcommand|*|\marg{\cs{FOO}}\oarg{i}\marg{TEXT}\\ +% Same as |\newcommand|, except it checks if |\FOO| already defined. +% +% \DescribeMacro +% \newenvironment|*|\marg{FOO}\oarg{i}\marg{DEF1}\marg{DEF2}\\ +% equivalent to:\\ +% |\newcommand{\FOO}[i]{DEF1}| |\def{\endFOO}{DEF2}|\\ +% (or the appropriate star forms). +% +% \DescribeMacro +% \renewenvironment\\ Obvious companion to |\newenvironment|. +% +% \DescribeMacro +% \@cons : See description of |\output| routine. +% +% \DescribeMacro{\@car} +% |\@car T1 T2 ... Tn\@nil| == |T1| (unexpanded) +% +% \DescribeMacro{\@cdr} +% |\@cdr T1 T2 ... Tn\@ni|l == |T2 ... Tn| (unexpanded) +% +% \DescribeMacro +% \typeout\marg{message}\\ Produces a warning message on the terminal. +% +% \DescribeMacro +% \typein\marg{message}\\ +% Types message, asks the user to type in a command, then +% executes it +% +% \DescribeMacro +% \typein\oarg{\cs{CS}}\marg{MSG}\\ +% Same as above, except defines |\CS| to be the input +% instead of executing it. +% +% \changes{LaTeX209}{1992/03/18} +% {(RMS) changed input channel from 0 to \cs{@inputcheck} to avoid +% conflicts with other channels allocated by \cs{newread}} +% +% \begin{macro}{\typein} +% +% \changes{v1.2k}{1995/05/08}{Use \cs{@firstofone}} +% \changes{v1.2l}{1995/05/08}{Remove unnecessary braces} +% \changes{v1.2l}{1995/05/08}{Replace \cs{def} by \cs{let}} +% \changes{v1.2m}{1995/05/24}{(DPC) New implementation} +% \changes{v1.2u}{1995/10/16}{(DPC) Use \cs{@testopt} /1911} +% \begin{macrocode} +\def\typein{% + \let\@typein\relax + \@testopt\@xtypein\@typein} +% \end{macrocode} +% +% \changes{v1.2r}{1995/10/03} +% {Add missing \cs{@typein} for /1710 (from patch file)} +% \begin{macrocode} +\def\@xtypein[#1]#2{% + \typeout{#2}% + \advance\endlinechar\@M + \read\@inputcheck to#1% + \advance\endlinechar-\@M + \@typein} +% \end{macrocode} +% \end{macro} +% +% \begin{macro}{\@namedef} +% \begin{macrocode} +\def\@namedef#1{\expandafter\def\csname #1\endcsname} +% \end{macrocode} +% \end{macro} +% +% \begin{macro}{\@nameuse} +% \begin{macrocode} +\def\@nameuse#1{\csname #1\endcsname} +% \end{macrocode} +% \end{macro} +% +% \begin{macro}{\@cons} +% \begin{macrocode} +\def\@cons#1#2{\begingroup\let\@elt\relax\xdef#1{#1\@elt #2}\endgroup} +% \end{macrocode} +% \end{macro} +% +% \begin{macro}{\@car} +% \begin{macro}{\@cdr} +% \begin{macrocode} +\def\@car#1#2\@nil{#1} +\def\@cdr#1#2\@nil{#2} +% \end{macrocode} +% \end{macro} +% \end{macro} +% +% \begin{macro}{\@carcube} +% |\@carcube T1 ... Tn\@nil| = |T1| |T2| |T3| , $n > 3$ +% \begin{macrocode} +\def\@carcube#1#2#3#4\@nil{#1#2#3} +% \end{macrocode} +% \end{macro} +% +% +% +% \begin{macro}{\@onlypreamble} +% \begin{macro}{\@preamblecmds} +% This macro adds its argument to the list of commands stored in +% |\@preamblecmds| to be +% disabled after |\begin{document}|. These commands are redefined +% to generate |\@notprerr| at this point. +% \begin{macrocode} +\def\@preamblecmds{} +\def\@onlypreamble#1{% + \expandafter\gdef\expandafter\@preamblecmds\expandafter{% + \@preamblecmds\do#1}} +\@onlypreamble\@onlypreamble +\@onlypreamble\@preamblecmds +% \end{macrocode} +% \end{macro} +% \end{macro} +% +% +% \begin{macro}{\@star@or@long} +% \changes{v1.2a}{1994/10/18}{macro added} +% Look ahead for a |*|. If present reset |\l@ngrel@x| so that +% the next definition, |#1|, will be non-long. +% \begin{macrocode} +\def\@star@or@long#1{% + \@ifstar + {\let\l@ngrel@x\relax#1}% + {\let\l@ngrel@x\long#1}} +% \end{macrocode} +% \end{macro} +% + +% \begin{macro}{\l@ngrel@x} +% This is either |\relax| or |\long| depending on whether the |*|-form +% of a definition command is being executed. +% \begin{macrocode} +\let\l@ngrel@x\relax +% \end{macrocode} +% \end{macro} +% +% \begin{macro}{\newcommand} +% \changes{LaTeX2e}{1993/11/23}{Macro reimplemented and extended} +% User level |\newcommand|.% +% \begin{macrocode} +\def\newcommand{\@star@or@long\new@command} +% \end{macrocode} +% +% \begin{macro}{\new@command} +% \changes{v1.2u}{1995/10/16}{(DPC) Use \cs{@testopt} /1911} +% \begin{macrocode} +\def\new@command#1{% + \@testopt{\@newcommand#1}0} +% \end{macrocode} +% \end{macro} +% \end{macro} +% +% +% \begin{macro}{\@newcommand} +% \changes{LaTeX2e}{1993/11/23}{Macro added} +% \begin{macro}{\@argdef} +% \changes{LaTeX2e}{1993/11/23}{Macro added} +% \begin{macro}{\@xargdef} +% \changes{LaTeX2e}{1993/11/23}{Macro interface changed} +% \changes{v1.1g}{2004/01/23}{Use kernel version of +% \cs{@ifnextchar} (pr/3501)} +% Handling arguments for |\newcommand|. +% \begin{macrocode} +\def\@newcommand#1[#2]{% + \kernel@ifnextchar [{\@xargdef#1[#2]}% + {\@argdef#1[#2]}} +% \end{macrocode} +% Define |#1| if it is definable. +% +% Both here and in |\@xargdef| the replacement text is absorbed as +% an argument because this removes any space-token that may appear +% after the optional argument(s). +% \begin{macrocode} +\long\def\@argdef#1[#2]#3{% + \@ifdefinable #1{\@yargdef#1\@ne{#2}{#3}}} +% \end{macrocode} +% +% \changes{v1.2q}{1995/10/02} +% {New implementation, using \cs{@test@opt}} +% Handle the second optional argument. +% \begin{macrocode} +\long\def\@xargdef#1[#2][#3]#4{% + \@ifdefinable#1{% +% \end{macrocode} +% Define the actual command to be:\\ +% |\def\foo{\@protected@testopt\foo\\foo{default}}|\\ +% where |\\foo| is a csname generated from applying |\csname| and +% |\string| to |\foo|, ie the actual name contains a backslash and +% therefore can't clash easily with exisiting command names. +% ``Default'' is the contents of the second optional argument of +% |(re)newcommand|. +% +% The |\aut@global| command below is only used in the autoload +% format. If it is |\global| then a global definition will be made. +% \changes{v1.2q}{1995/10/02} +% {Add \cs{aut@global} in autoload version} +% \changes{v1.2z2}{1998/03/04} +% {Unnecessary \cs{expandafter} removed: pr/2758} +% \begin{macrocode} +%\aut@global + \expandafter\def\expandafter#1\expandafter{% + \expandafter + \@protected@testopt + \expandafter + #1% + \csname\string#1\endcsname + {#3}}% +% \end{macrocode} +% Now we define the internal macro ie |\\foo| which is supposed to +% pick up all arguments (optional and mandatory). +% \begin{macrocode} + \expandafter\@yargdef + \csname\string#1\endcsname + \tw@ + {#2}% + {#4}}} +% \end{macrocode} +% \end{macro} +% \end{macro} +% \end{macro} +% +% \begin{macro}{\@testopt} +% \changes{v1.2q}{1995/10/02} +% {Macro added} +% \changes{v1.3a}{1999/01/07} +% {made long and brace optional arg. latex/2896} +% This macro encapsulates the most common call to |\@ifnextchar|, saving +% several tokens each time it is used in the definition of a command +% with an optional argument. +% |#1| The code to execute in the case that there is a |[| need not be +% a single token but can be any sequence of commands that `expects' to +% be followed by |[|. If this command were only used in |\newcommand| +% definitions then |#1| would be a single token and the braces could +% be omitted from |{#1}| in the definition below, saving a bit of +% memory. +% \changes{v1.1g}{2004/01/23}{Use kernel version of +% \cs{@ifnextchar} (pr/3501)} +% \begin{macrocode} +\long\def\@testopt#1#2{% + \kernel@ifnextchar[{#1}{#1[{#2}]}} +% \end{macrocode} +% \end{macro} +% +% \begin{macro}{\@protected@testopt} +% \changes{v1.2q}{1995/10/02} +% {Macro added} +% Robust version of |\@testopt|. The extra argument (|#1|) must be a +% single token. If protection is needed the call expands to |\protect| +% applied to this token, and the 2nd and 3rd arguments are +% discarded (by |\@x@protect|). Otherwise |\@testopt| is called on +% the 2nd and 3rd arguments. +% +% This method of making commands robust avoids the need for using up +% two csnames per command, the price is the extra expansion time +% for the |\ifx| test. +% \begin{macrocode} +\def\@protected@testopt#1{%% + \ifx\protect\@typeset@protect + \expandafter\@testopt + \else + \@x@protect#1% + \fi} +% \end{macrocode} +% \end{macro} +% +% \begin{macro}{\@yargdef} +% \begin{macro}{\@yargd@f} +% \changes{v1.3f}{1999/04/29}{New macro added} +% +% \changes{LaTeX2e}{1993/11/23}{Macro interface changed} +% \changes{LaTeX2e}{1993/11/23}{Avoid \cs{@?@?} token} +% \changes{v1.0b}{1994/03/12}{Name changed from \cs{XXX@argdef}} +% \changes{v1.3c}{1999/01/18}{New implementation DPC /2942} +% \changes{v1.3d}{1999/02/09}{catch bad argument forms by re-inserting \#3} +% \changes{v1.3f}{1999/04/29}{Full expansion and conversion needed +% for digit in new version, see pr/3013} +% +% These generate a primitive argument specification, from a +% \LaTeX\ |[|\meta{digit}|]| form; in fact \meta{digit} can be +% anything such that |\number|~\meta{digit} is single digit. +% +% Reorganised slightly so that |\renewcommand{\reserved@a}[1]{foo}| +% works. I am not sure this is worth it, as a following +% |\newcommand| would over-write the definition of |\reserved@a|. +% +% Recall that \LaTeX2.09 goes into an infinite loop with +% |\renewcommand[1]{\@tempa}{foo}| (DPC 6 October 93). +% +% Reorganised again (DPC 1999). Rather than make a loop to +% construct the argument spec by counting, just extract the +% required argument spec by using a delimited argument (delimited +% by the digit). This is faster and uses less tokens. The coding +% is slightly odd to preserve the old interface (using |#2| = +% |\tw@| as the flag to surround the first argument with |[]|. But +% the new method did not allow for the number of arguments |#3| not +% being given as an explicit digit; hence (further expansion of +% this argument and use of) |\number| was added later in 1999. +% +% It is not clear why these are still |\long|. +% +% \begin{macrocode} +\long \def \@yargdef #1#2#3{% + \ifx#2\tw@ + \def\reserved@b##11{[####1]}% + \else + \let\reserved@b\@gobble + \fi + \expandafter + \@yargd@f \expandafter{\number #3}#1% +} +% \end{macrocode} +% +% The |\aut@global| command below is only used in the autoload +% format. If it is |\global| then a global definition will be made. +% \changes{v1.2q}{1995/10/02} +% {Add \cs{aut@global} in autoload version} +% \begin{macrocode} +\long \def \@yargd@f#1#2{% + \def \reserved@a ##1#1##2##{% +%\aut@global + \expandafter\def\expandafter#2\reserved@b ##1#1% + }% + \l@ngrel@x \reserved@a 0##1##2##3##4##5##6##7##8##9###1% +} +% \end{macrocode} +% +% \end{macro} +% \end{macro} +% +% \begin{macro}{\@reargdef} +% \changes{LaTeX2e}{1993/12/20} +% {Kept old version of \cs{@reargdef}, for array.sty} +% \changes{v1.0b}{1994/03/12}{New defn, in terms of \cs{@yargdef}} +% \changes{v1.2y}{1996/07/26}{third arg picked up by \cs{@yargdef}} +% \begin{macrocode} +\long\def\@reargdef#1[#2]{% + \@yargdef#1\@ne{#2}} +% \end{macrocode} +% \end{macro} +% +% \begin{macro}{\renewcommand} +% Check the command name is already used. If not give an error +% message. Then temporarily +% disable |\@ifdefinable| then call |\newcommand|. (Previous +% version |\let#1=\relax| but this does not work too well if |#1| +% is |\@temp|\emph{a--e}.) +% \changes{LaTeX2e}{1993/11/23}{Macro reimplemented and extended} +% \changes{v1.1f}{1994/05/2}{Removed surplus \cs{space} in error} +% \begin{macrocode} +\def\renewcommand{\@star@or@long\renew@command} +% \end{macrocode} +% +% \begin{macro}{\renew@command} +% \changes{v1.2y}{1996/07/26}{use \cs{relax} in place of empty arg} +% \changes{v1.2y}{1996/07/26}{use \cs{noexpand} instead of \cs{string}} +% \changes{v1.2z1}{1997/10/21}{Use \cs{begingroup}/\cs{endgroup} rather +% than braces for grouping, to avoid generating empty math atom.} +% \begin{macrocode} +\def\renew@command#1{% + \begingroup \escapechar\m@ne\xdef\@gtempa{{\string#1}}\endgroup + \expandafter\@ifundefined\@gtempa + {\@latex@error{\noexpand#1undefined}\@ehc}% + \relax + \let\@ifdefinable\@rc@ifdefinable + \new@command#1} +% \end{macrocode} +% \end{macro} +% \end{macro} +% +% \changes{v1.0n}{1994/05/10}{Removed braces around \cs{@ifundefined} +% argument. ASAJ.} +% \changes{v1.0s}{1994/05/13}{Coded more efficiently, thanks to FMi.} +% +% \begin{macro}{\@ifdefinable} +% \begin{macro}{\@@ifdefinable} +% \begin{macro}{\@rc@ifdefinable} +% Test is user is allowed to define a command. +% \begin{macrocode} +\long\def\@ifdefinable #1#2{% + \edef\reserved@a{\expandafter\@gobble\string #1}% + \@ifundefined\reserved@a + {\edef\reserved@b{\expandafter\@carcube \reserved@a xxx\@nil}% + \ifx \reserved@b\@qend \@notdefinable\else + \ifx \reserved@a\@qrelax \@notdefinable\else + #2% + \fi + \fi}% + \@notdefinable} +% \end{macrocode} +% Saved definition of |\@ifdefinable|. +% \begin{macrocode} +\let\@@ifdefinable\@ifdefinable +% \end{macrocode} +% Version of |\@ifdefinable| for use with |\renewcommand|. Does +% not do the check this time, but restores the normal definition. +% \begin{macrocode} +\long\def\@rc@ifdefinable#1#2{% + \let\@ifdefinable\@@ifdefinable + #2} +% \end{macrocode} +% \end{macro} +% \end{macro} +% \end{macro} +% +% \begin{macro}{\newenvironment} +% Define a new user environment. +% |#1| is the environment name. |#2#| Grabs all the tokens up to +% the first |{|. These will be any optional arguments. They are not +% parsed at this point, but are just passed to |\@newenv| which +% will eventually call |\newcommand|. Any optional arguments will +% then be parsed by |\newcommand| as it defines the command that +% executes the `begin code' of the environment. +% +% This |#2#| trick removed with version 1.2i as it fails if a |{| +% occurs in the optional argument. Now use |\@ifnextchar| directly. +% \begin{macrocode} +\def\newenvironment{\@star@or@long\new@environment} +% \end{macrocode} +% +% \begin{macro}{\new@environment} +% \changes{v1.2i}{1995/04/25}{Parse arguments slowly but safely /1507} +% \changes{v1.2u}{1995/10/16}{(DPC) Use \cs{@testopt} /1911} +% \begin{macrocode} +\def\new@environment#1{% + \@testopt{\@newenva#1}0} +% \end{macrocode} +% +% \begin{macro}{\@newenva} +% \changes{v1.1g}{2004/01/23}{Use kernel version of +% \cs{@ifnextchar} (pr/3501)} +% \begin{macrocode} +\def\@newenva#1[#2]{% + \kernel@ifnextchar [{\@newenvb#1[#2]}{\@newenv{#1}{[#2]}}} +% \end{macrocode} +% \end{macro} +% +% \begin{macro}{\@newenvb} +% \changes{v1.3a}{1999/01/07} +% {made long and brace optional arg. latex/2896} +% \begin{macrocode} +\def\@newenvb#1[#2][#3]{\@newenv{#1}{[#2][{#3}]}} +% \end{macrocode} +% \end{macro} +% +% \end{macro} +% \end{macro} +% +% +% \begin{macro}{\renewenvironment} +% Redefine an environment. +% For |\renewenvironment| disable |\@ifdefinable| and then call +% |\newenvironment|. It is OK to |\let| the argument to |\relax| +% here as there should not be a |@temp|\ldots\ environment. +% \changes{LaTeX2e}{1993/11/23}{Macro reimplemented and extended} +% \changes{v1.1f}{1994/05/2}{Removed surplus \cs{space} in error} +% \begin{macrocode} +\def\renewenvironment{\@star@or@long\renew@environment} +% \end{macrocode} +% +% \begin{macro}{\renew@environment} +% \changes{v1.2a}{1994/10/18}{reset end command} +% \changes{v1.2y}{1996/07/26}{use \cs{relax} in place of empty arg} +% \begin{macrocode} +\def\renew@environment#1{% + \@ifundefined{#1}% + {\@latex@error{Environment #1 undefined}\@ehc + }\relax + \expandafter\let\csname#1\endcsname\relax +% \end{macrocode} +% \changes{v1.2q}{1995/10/02} +% {Add \cs{aut@global} in autoload version} +% \begin{macrocode} +%\aut@global + \expandafter\let\csname end#1\endcsname\relax + \new@environment{#1}} +% \end{macrocode} +% \end{macro} +% \end{macro} +% +% +% \begin{macro}{\@newenv} +% \changes{LaTeX2e}{1993/11/23}{Macro interface changed} +% \changes{v1.2h}{1994/11/24}{Added test for \cs{endgraf}} +% The internal version of |\newenvironment|. +% +% Call |\newcommand| to define the \meta{begin-code} for the +% environment. |\def| is used for the \meta{end-code} as it does +% not take arguments. (but may contain |\par|s) +% +% Make sure that an attempt to define a `graf' or `group' environment +% fails. +% \begin{macrocode} +\long\def\@newenv#1#2#3#4{% + \@ifundefined{#1}% + {\expandafter\let\csname#1\expandafter\endcsname + \csname end#1\endcsname}% + \relax + \expandafter\new@command + \csname #1\endcsname#2{#3}% +% \end{macrocode} +% \changes{v1.2q}{1995/10/02} +% {Add \cs{aut@global} in autoload version} +% \begin{macrocode} +%\aut@global + \l@ngrel@x\expandafter\def\csname end#1\endcsname{#4}} +% \end{macrocode} +% \end{macro} +% +% \begin{macro}{\newif} +% \changes{v1.1l}{1995/05/24}{(DPC) New implementation} +% \changes{v1.2q}{1995/10/02} +% {Add \cs{aut@global} in autoload version} +% And here's a different sort of allocation: +% For example, +% |\newif\iffoo| creates |\footrue|, |\foofalse| to go with |\iffoo|. +% \begin{macrocode} +\def\newif#1{% + \count@\escapechar \escapechar\m@ne +%\aut@global + \let#1\iffalse + \@if#1\iftrue + \@if#1\iffalse + \escapechar\count@} +% \end{macrocode} +% +% \begin{macro}{\@if} +% \changes{v1.2q}{1995/10/02} +% {Add \cs{aut@global} in autoload version} +% \begin{macrocode} +\def\@if#1#2{% +%\aut@global + \expandafter\def\csname\expandafter\@gobbletwo\string#1% + \expandafter\@gobbletwo\string#2\endcsname + {\let#1#2}} +% \end{macrocode} +% \end{macro} +% \end{macro} +% +% +% \begin{macro}{\providecommand} +% |\providecommand| takes the same arguments as |\newcommand|, but +% discards them if |#1| is already defined, Otherwise it just acts like +% |\newcommand|. This implementation currently leaves any discarded +% definition in |\reserved@a| (and possibly |\\reserved@a|) this +% wastes a bit of space, but it will be reclaimed as soon as these +% scratch macros are redefined. +% +% \changes{LaTeX2e}{1993/11/22}{Macro added} +% \begin{macrocode} +\def\providecommand{\@star@or@long\provide@command} +% \end{macrocode} +% +% \begin{macro}{\provide@command} +% \changes{v1.2z}{1997/09/09}{Use \cs{begingroup} to avoid generating +% math ords if used in math mode. pr/2573} +% \begin{macrocode} +\def\provide@command#1{% + \begingroup + \escapechar\m@ne\xdef\@gtempa{{\string#1}}% + \endgroup + \expandafter\@ifundefined\@gtempa + {\def\reserved@a{\new@command#1}}% + {\def\reserved@a{\renew@command\reserved@a}}% + \reserved@a}% +% \end{macrocode} +% \end{macro} +% \end{macro} +% +% \begin{macro}{\CheckCommand} +% \changes{LaTeX2e}{1993/11/22}{Macro added} +% \changes{v1.1e}{1994/05/20}{Changed name from \cs{@checkcommand} to +% \cs{CheckCommand}.} +% |\CheckCommand| takes the same arguments as |\newcommand|. If +% the command already exists, with the same definition, then +% nothing happens, otherwise a warning is issued. Useful for +% checking the current state befor a macro package starts +% redefining things. Currently two macros are considered to have +% the same definition if they are the same except for different +% default arguments. That is, if the old definition was: +% |\newcommand\xxx[2][a]{(#1)(#2)}| then +% |\CheckCommand\xxx[2][b]{(#1)(#2)}| would \emph{not} generate a +% warning, but, for instance |\CheckCommand\xxx[2]{(#1)(#2)}| +% would. +% \begin{macrocode} +\def\CheckCommand{\@star@or@long\check@command} +% \end{macrocode} +% |\CheckCommand| is only available in the preamble part of the +% document. +% \begin{macrocode} +\@onlypreamble\CheckCommand +% \end{macrocode} +% +% \begin{macro}{\check@command} +% \begin{macrocode} +\def\check@command#1#2#{\@check@c#1{#2}} +\@onlypreamble\check@command +% \end{macrocode} +% \end{macro} +% \end{macro} +% +% \begin{macro}{\@check@c} +% \changes{v1.2i}{1995/04/25}{Make \cs{long} for latex/1346} +% |\CheckCommand| itself just grabs all the arguments we need, +% without actually looking for |[| optional argument forms. Now +% define |\reserved@a|. If |\\reserved@a| is then defined, compare it +% with the ``|\#1|' otherwise compare |\reserved@a| with |#1|. +% \begin{macrocode} +\long\def\@check@c#1#2#3{% + \expandafter\let\csname\string\reserved@a\endcsname\relax + \renew@command\reserved@a#2{#3}% + \@ifundefined{\string\reserved@a}% + {\@check@eq#1\reserved@a}% + {\expandafter\@check@eq + \csname\string#1\expandafter\endcsname + \csname\string\reserved@a\endcsname}} +\@onlypreamble\@check@c +% \end{macrocode} +% \end{macro} +% +% \begin{macro}{\@check@eq} +% Complain if |#1| and |#2| are not |\ifx| equal. +% \begin{macrocode} +\def\@check@eq#1#2{% + \ifx#1#2\else + \@latex@warning@no@line + {Command \noexpand#1 has + changed.\MessageBreak + Check if current package is valid}% + \fi} +\@onlypreamble\@check@eq +% \end{macrocode} +% \end{macro} +% +% \begin{macro}{\@gobble} +% \begin{macro}{\@gobbletwo} +% \begin{macro}{\@gobblefour} +% \changes{v1.2n}{1995/05/26}{(CAR) Added \cs{long}s} +% The |\@gobble| macro is used to get rid of its argument. +% \begin{macrocode} +\long\def \@gobble #1{} +\long\def \@gobbletwo #1#2{} +\long\def \@gobblefour #1#2#3#4{} +% \end{macrocode} +% \end{macro} +% \end{macro} +% \end{macro} +% +% \begin{macro}{\@firstofone} +% \begin{macro}{\@firstoftwo} +% \begin{macro}{\@secondoftwo} +% Some argument-grabbers. +% \begin{macrocode} +\long\def\@firstofone#1{#1} +\long\def\@firstoftwo#1#2{#1} +\long\def\@secondoftwo#1#2{#2} +% \end{macrocode} +% \begin{macro}{\@iden} +% |\@iden| is another name for |\@firstofone| for +% compatibility reasons. +% \begin{macrocode} +\let\@iden\@firstofone +% \end{macrocode} +% \end{macro} +% \end{macro} +% \end{macro} +% \end{macro} +% +% \begin{macro}{\@thirdofthree} +% Another grabber now used in the encoding specific +% section. +% \changes{v1.2z3}{1998/03/20}{Macro added} +% \begin{macrocode} +\long\def\@thirdofthree#1#2#3{#3} +% \end{macrocode} +% \end{macro} +% +% +% \begin{macro}{\@expandtwoargs} +% A macro to totally expand two arguments to another macro +% \begin{macrocode} +\def\@expandtwoargs#1#2#3{% +\edef\reserved@a{\noexpand#1{#2}{#3}}\reserved@a} +% \end{macrocode} +% \end{macro} +% +% \begin{macro}{\@backslashchar} +% A category code 12 backslash. +% \begin{macrocode} +\edef\@backslashchar{\expandafter\@gobble\string\\} +% \end{macrocode} +% \end{macro} +% +% \changes{v1.0n}{1994/05/10}{Added \cs{DeclareProtectedCommand}} +% \changes{v1.0p}{1994/05/12}{Fixed a bug with \cs{relax } which was +% using \cs{@gobble} before defining it.} +% \changes{v1.0q}{1994/05/13}{Renamed \cs{DeclareProtectedCommand} to +% \cs{DeclareRobustCommand}. Removed \cs{@if@short@command}. +% Moved to after the definition of \cs{@gobble}.} +% \changes{v1.0r}{1994/05/13}{Added logging message to +% \cs{DeclareProtectedCommand}.} +% +% \subsection{Robust commands and protect} +% +% \changes{v1.1b}{1994/05/17}{Added the discussion of protected +% commands, defined the values that \cs{protect} should have.} +% \changes{v1.1c}{1994/05/18}{Redid the discussion and definitions, in +% line with the proposed new setting of \cs{protect} in the output +% routine.} +% +% Fragile and robust commands are one of the thornier issues in +% \LaTeX's commands. Whilst typesetting documents, \LaTeX{} makes use +% of many of \TeX's features, such as arithmetic, defining macros, and +% setting variables. However, there are (at least) three different +% ocassions when these commands are not safe. These are called +% `moving arguments' by \LaTeX, and consist of: +% \begin{itemize} +% \item writing information to a file, such as indexes or tables of +% contents. +% \item writing information to the screen. +% \item inside an |\edef|, |\message|, |\mark|, or other command which +% evaluates its argument fully. +% \end{itemize} +% The method \LaTeX{} uses for making fragile commands robust is to +% precede them with |\protect|. This can have one of five possible +% values: +% \begin{itemize} +% \item |\relax|, for normal typesetting. So |\protect\foo| will +% execute |\foo|. +% \item |\string|, for writing to the screen. So |\protect\foo| will +% write |\foo|. +% \item |\noexpand|, for writing to a file. So |\protect\foo| will +% write |\foo| followed by a space. +% \item |\@unexpandable@protect|, for writing a moving argument to a +% file. So |\protect\foo| will write |\protect\foo| followed by a +% space. This value is also used inside |\edef|s, |\mark|s and +% other commands which evaluate their arguments fully. +% \item |\@unexpandable@noexpand|, for performing a deferred write +% inside an |\edef|. So |\protect\foo| will write |\foo| followed +% by a space. If you want |\protect\foo| to be written, you should +% use |\@unexpandable@protect|. (Removed as never used). +% \end{itemize} +% +% \changes{1.1b}{1994/05/17} +% {(ASAJ) Added the \cs{@protect@...} commands.} +% \changes{1.1c}{1994/05/18} +% {(ASAJ) Renamed the commands, and removed +% one which is no longer needed.} +% +% \begin{macro}{\@unexpandable@protect} +% \begin{macro}{\@unexpandable@noexpand} +% \changes{1.2w}{1995/12/05}{Removed as never used. internal/1733} +% These commands are used for setting |\protect| inside |\edef|s. +% \begin{macrocode} +\def\@unexpandable@protect{\noexpand\protect\noexpand} +%\def\@unexpandable@noexpand{\noexpand\noexpand\noexpand} +% \end{macrocode} +% \end{macro} +% \end{macro} +% +% \changes{v1.2e}{1994/11/04}{Rewrote protected short commands +% using \cs{x@protect}. ASAJ.} +% +% \begin{macro}{\DeclareRobustCommand} +% \begin{macro}{\declare@robustcommand} +% This is a package-writers command, which has the same syntax as +% |\newcommand|, but which declares a protected command. It does +% this by having\\ +% |\DeclareRobustCommand\foo|\\ +% define |\foo| to be +% |\protect\foo|,\\ +% and then use |\newcommand\foo|.\\ +% Since the internal command is |\foo|, when it is written +% to an auxiliary file, it will appear as |\foo|. +% +% We have to be a +% bit cleverer if we're defining a short command, such as |\_|, in +% order to make sure that the auxiliary file does not include a +% space after the command, since |\_ a| and |\_a| aren't the same. +% In this case we define |\_| to be: +%\begin{verbatim} +% \x@protect\_\protect\_ +%\end{verbatim} +% which expands to: +%\begin{verbatim} +% \ifx\protect\@typeset@protect\else +% \@x@protect@\_ +% \fi +% \protect\_ +%\end{verbatim} +% Then if |\protect| is |\@typeset@protect| (normally |\relax|) +% then we just perform |\_|, and otherwise +% |\@x@protect@| gobbles everything up and expands to +% |\protect\_|. +% +% \emph{Note}: setting |\protect| to any value other than |\relax| +% whilst in `typesetting' mode will cause commands to go into an +% infinite loop! In particular, setting |\relax| to |\@empty| will +% cause |\_| to loop forever. It will also break lots of other +% things, such as protected |\ifmmode|s inside |\halign|s. If you +% really really have to do such a thing, then please set +% |\@typeset@protect| to be |\@empty| as well. (This is what the +% code for |\patterns| does, for example.) +% +% More fun with |\expandafter| and |\csname|. +% \begin{macrocode} +\def\DeclareRobustCommand{\@star@or@long\declare@robustcommand} +% \end{macrocode} +% +% \begin{macrocode} +\def\declare@robustcommand#1{% + \ifx#1\@undefined\else\ifx#1\relax\else + \@latex@info{Redefining \string#1}% + \fi\fi + \edef\reserved@a{\string#1}% + \def\reserved@b{#1}% + \edef\reserved@b{\expandafter\strip@prefix\meaning\reserved@b}% +% \end{macrocode} +% \changes{v1.2s}{1995/10/06} +% {Add \cs{aut@global} in autoload version} +% \begin{macrocode} +%\aut@global + \edef#1{% + \ifx\reserved@a\reserved@b + \noexpand\x@protect + \noexpand#1% + \fi + \noexpand\protect + \expandafter\noexpand\csname + \expandafter\@gobble\string#1 \endcsname + }% + \let\@ifdefinable\@rc@ifdefinable + \expandafter\new@command\csname + \expandafter\@gobble\string#1 \endcsname +} +% \end{macrocode} +% \end{macro} +% \end{macro} +% +% +% \begin{macro}{\@x@protect} +% \begin{macro}{\x@protect} +% +% \begin{macrocode} +\def\x@protect#1{% + \ifx\protect\@typeset@protect\else + \@x@protect#1% + \fi +} +\def\@x@protect#1\fi#2#3{% + \fi\protect#1% +} +% \end{macrocode} +% \end{macro} +% \end{macro} +% +% \begin{macro}{\@typeset@protect} +% +% \begin{macrocode} +\let\@typeset@protect\relax +% \end{macrocode} +% \end{macro} +% +% \changes{v1.2e}{1994/11/04}{Added commands for setting and restoring +% \cs{protect}. ASAJ.} +% +% \begin{macro}{\set@display@protect} +% \begin{macro}{\set@typeset@protect} +% These macros set |\protect| appropriately for typesetting or +% displaying. +% \changes{v1.2o}{1995/07/03}{Use \cs{@typeset@protect} for init} +% \begin{macrocode} +\def\set@display@protect{\let\protect\string} +\def\set@typeset@protect{\let\protect\@typeset@protect} +% \end{macrocode} +% \end{macro} +% \end{macro} +% +% \begin{macro}{\protected@edef} +% \begin{macro}{\protected@xdef} +% \begin{macro}{\unrestored@protected@xdef} +% \begin{macro}{\restore@protect} +% The commands |\protected@edef| and |\protected@xdef| perform +% `safe' |\edef|s and |\xdef|s, saving and restoring |\protect| +% appropriately. For cases where restoring |\protect| doesn't +% matter, there's an `unsafe' |\unrestored@protected@xdef|, useful +% if you know what you're doing! +% \begin{macrocode} +\def\protected@edef{% + \let\@@protect\protect + \let\protect\@unexpandable@protect + \afterassignment\restore@protect + \edef +} +\def\protected@xdef{% + \let\@@protect\protect + \let\protect\@unexpandable@protect + \afterassignment\restore@protect + \xdef +} +\def\unrestored@protected@xdef{% + \let\protect\@unexpandable@protect + \xdef +} +\def\restore@protect{\let\protect\@@protect} +% \end{macrocode} +% \end{macro} +% \end{macro} +% \end{macro} +% \end{macro} +% +% +% \begin{macro}{\protect} +% The normal meaning of |\protect| +% \changes{v1.2j}{1995/04/29}{Init \cs{protect} here} +% \begin{macrocode} +\set@typeset@protect +% \end{macrocode} +% \end{macro} +% +% \subsection{Internal defining commands} +% +% These commands are used internally to define other \LaTeX{} +% commands. +% \begin{macro}{\@ifundefined} +% \changes{LaTeX2e}{1993/11/23}{Redefined to remove a trailing \cs{fi}} +% Check if first arg is undefined or \cs{relax} and execute second or +% third arg depending, +% \begin{macrocode} +\def\@ifundefined#1{% + \expandafter\ifx\csname#1\endcsname\relax + \expandafter\@firstoftwo + \else + \expandafter\@secondoftwo + \fi} +% \end{macrocode} +% \end{macro} +% +% +% \begin{macro}{\@qend} +% \begin{macro}{\@qrelax} +% The following define |\@qend| and |\@qrelax| to be the strings +% `|end|' and `|relax|' with the characters |\catcode|d 12. +% \begin{macrocode} +\edef\@qend{\expandafter\@cdr\string\end\@nil} +\edef\@qrelax{\expandafter\@cdr\string\relax\@nil} +% \end{macrocode} +% \end{macro} +% \end{macro} +% +% +% \begin{macro}{\@ifnextchar} +% \changes{LaTeX209}{1992/08/24} +% {(Rms) \cs{@ifnextchar} didn't work if its +% first argument was an equal sign.} +% \changes{v1.2q}{1995/10/02} +% {Use \cs{@let@token} } +% \changes{v1.3a}{1999/01/07} +% {made long} +% \changes{v1.3b}{1999/01/07} +% {extra \cs{long}. latex/2902} +% \changes{v1.3e}{1999/03/01} +% {remove extra \cs{long}. internal/2967} +% |\@ifnextchar| peeks at the following character and compares it +% with its first argument. If both are the same it executes its +% second argument, otherwise its third. +% \begin{macrocode} +\long\def\@ifnextchar#1#2#3{% + \let\reserved@d=#1% + \def\reserved@a{#2}% + \def\reserved@b{#3}% + \futurelet\@let@token\@ifnch} +% \end{macrocode} +% \end{macro} +% +% \begin{macro}{\kernel@ifnextchar} +% \changes{v1.3g}{2004/01/23}{Added macro (pr/3501)} +% This macro is the kernel version of |\@ifnextchar| which is used +% in a couple of places to prevent the AMS variant from being used +% since in some places this produced chaos (for example +% if an \texttt{fd} file +% is loaded in a random place then the optional argument to +% |\ProvidesFile| could get printed there instead of being written +% only in the log file. This happened +% when there was a space or a newline between the mandatory and +% optional arguments! It should really be fixed in the +% \texttt{amsmath} package one day, but\ldots +% +% Note that there may be other places in the kernel where this version +% should be used rather than the original, but variable, version. +% +% \begin{macrocode} +\let\kernel@ifnextchar\@ifnextchar +% \end{macrocode} +% \end{macro} +% +% +% \begin{macro}{\@ifnch} +% |\@ifnch| is a tricky macro to skip any space tokens that may +% appear before the character in question. If it encounters a space +% token, it calls \@xifnch. +% \changes{v1.2q}{1995/10/02} +% {Use \cs{@let@token} for internal/924, save \cs{reserved@e}} +% \begin{macrocode} +\def\@ifnch{% + \ifx\@let@token\@sptoken + \let\reserved@c\@xifnch + \else + \ifx\@let@token\reserved@d + \let\reserved@c\reserved@a + \else + \let\reserved@c\reserved@b + \fi + \fi + \reserved@c} +% \end{macrocode} +% \end{macro} +% +% \begin{macro}{\@sptoken} +% The following code makes |\@sptoken| a space token. It is +% important here that the control sequence |\:| consists of +% a non-letter only, so that the following whitespace is +% significant. Together with the fact that the equal sign +% in a |\let| may be followed by only one optional space +% the desired effect is achieved. +% NOTE: the following hacking must precede the definition of |\:| +% as math medium space. +% \begin{macrocode} +\def\:{\let\@sptoken= } \: % this makes \@sptoken a space token +% \end{macrocode} +% \end{macro} +% +% \begin{macro}{\@xifnch} +% In the following definition of |\@xifnch|, |\:| is again used +% to get a space token as delimiter into the definition. +% \begin{macrocode} +\def\:{\@xifnch} \expandafter\def\: {\futurelet\@let@token\@ifnch} +% \end{macrocode} +% \end{macro} + +% \changes{v1.0n}{1994/05/10}{Added \cs{makeatletter} and +% \cs{makeatother} ASAJ.} +% +% \begin{macro}{\makeatletter} +% \begin{macro}{\makeatother} +% Make internal control sequences accessible or inaccessible. +% \begin{macrocode} +\def\makeatletter{\catcode`\@11\relax} +\def\makeatother{\catcode`\@12\relax} +% \end{macrocode} +% \end{macro} +% \end{macro} +% +% +% \begin{macro}{\@ifstar} +% \changes{v1.2u}{1995/10/16}{(DPC) New implementation, for /1910} +% The new implementation below avoids passing the \meta{true code} +% Through one more |\def| than the \meta{false code}, which previously +% meant that |#| had to be written as |####| in one argument, but |##| +% in the other. The |*| is gobbled by |\@firstoftwo|. +% \begin{macrocode} +\def\@ifstar#1{\@ifnextchar *{\@firstoftwo{#1}}} +% \end{macrocode} +% \end{macro} +% +% \begin{macro}{\@dblarg} +% \begin{macro}{\@xdblarg} +% \changes{v1.1g}{2004/01/23}{Use kernel version of +% \cs{@ifnextchar} (pr/3501)} +% \begin{macrocode} +\long\def\@dblarg#1{\kernel@ifnextchar[{#1}{\@xdblarg{#1}}} +\long\def\@xdblarg#1#2{#1[{#2}]{#2}} +% \end{macrocode} +% \end{macro} +% \end{macro} +% +% \begin{macro}{\@sanitize} +% The command |\@sanitize| changes the catcode of all special characters +% except for braces to `other'. It can be used for commands like +% |\index| that want to write their arguments verbatim. Needless to +% say, this command should only be executed within a group, or chaos +% will ensue. +% +% \begin{macrocode} +\def\@sanitize{\@makeother\ \@makeother\\\@makeother\$\@makeother\&% +\@makeother\#\@makeother\^\@makeother\_\@makeother\%\@makeother\~} +% \end{macrocode} +% \end{macro} +% +% \begin{macro}{\@onelevel@sanitize} +% \changes{v1.2c}{1994/10/30}{Macro added} +% +% This makes the whole ``meaning'' of |#1| (its one-level +% expansion) into catcode 12 tokens: it could be used in +% |\DeclareRobustCommand|. +% +% If it is to be used on default float specifiers, this should be +% done when they are defined. +% \begin{macrocode} +\def \@onelevel@sanitize #1{% + \edef #1{\expandafter\strip@prefix + \meaning #1}% +} +% \end{macrocode} +% \end{macro} +% +% \begin{macrocode} +% +% \end{macrocode} +% +% \subsection{Commands for Autoloading} +% +% \begin{macrocode} +%<*autoload> +% \end{macrocode} +% +% \begin{macro}{\aut@global} +% \changes{v1.2q}{1995/10/02} +% {Macro added} +% This command is only defined in the `autoload' format. It is +% normally |\relax| but may be set to |\global|, in which case +% |\newif| and the commands based on |\newcommand| will all make +% global definitions. +% \begin{macrocode} +\let\aut@global\relax +% \end{macrocode} +% \end{macro} +% +% \begin{macro}{\@autoload} +% \changes{v1.2q}{1995/10/02} +% {Macro added} +% \changes{v1.2t}{1995/10/09} +% {Use \cs{@@input} not \cs{input} to save string space and +% stops autoload files appearing in \cs{listfiles}} +% \changes{v1.2v}{1995/10/24}{ignore end-of-line} +% This macro is only defined in the `autoload' format. It inputs a +% package `|auto#1.sty|' within a local group, and with normalised +% catcodes. |\aut@global| is set to |\global| so that |\newif| +% |\newcommand| and related commands make global definitions. +% \begin{macrocode} +\def\@autoload#1{% + \begingroup + \makeatletter + \let\aut@global\global + \nfss@catcodes + \catcode`\ =10 + \let\@latex@e@error\@gobble + \@@input auto#1.sty\relax + \endgroup} +% \end{macrocode} +% \end{macro} +% +% \begin{macrocode} +% +% \end{macrocode} +% +% \Finale +% diff --git a/Master/texmf-dist/source/latex/base/ltdirchk.dtx b/Master/texmf-dist/source/latex/base/ltdirchk.dtx new file mode 100644 index 00000000000..ce899b0d361 --- /dev/null +++ b/Master/texmf-dist/source/latex/base/ltdirchk.dtx @@ -0,0 +1,911 @@ +% \iffalse meta-comment +% +% Copyright 1993 1994 1995 1996 1997 1998 1999 2000 2001 2002 2003 2004 +% The LaTeX3 Project and any individual authors listed elsewhere +% in this file. +% +% This file is part of the LaTeX base system. +% ------------------------------------------- +% +% It may be distributed and/or modified under the +% conditions of the LaTeX Project Public License, either version 1.3 +% of this license or (at your option) any later version. +% The latest version of this license is in +% http://www.latex-project.org/lppl.txt +% and version 1.3 or later is part of all distributions of LaTeX +% version 2003/12/01 or later. +% +% This file has the LPPL maintenance status "maintained". +% +% The list of all files belonging to the LaTeX base distribution is +% given in the file `manifest.txt'. See also `legal.txt' for additional +% information. +% +% The list of derived (unpacked) files belonging to the distribution +% and covered by LPPL is defined by the unpacking scripts (with +% extension .ins) which are part of the distribution. +% +% \fi +% +% \ProvidesFile{ltdirchk.dtx} +% [2001/06/04 v1.0y LaTeX Kernel (System Dependent Parts)] +% +% \iffalse +%%% From File: ltdirchk.dtx +% +%<*unstripped> +\ifx\documentclass\undefined\let\next\relax\else\def\next{% +% +%<*driver> +% \fi +\ProvidesFile{ltdirchk.dtx} + [2001/06/04 v1.0y LaTeX Kernel (System Dependent Parts)] +% \iffalse +\documentclass{ltxdoc} +\GetFileInfo{ltdirchk.dtx} +\title{\filename\thanks{% + this document also includes the source for + texsys.cfg and ltxcheck.tex}} +\author{David Carlisle} +\date{\filedate} +\begin{document} + \maketitle + \DocInput{\filename} +\end{document} +% +%<*unstripped> +}\fi\next +% +% \fi +% +% \changes{v0.2j}{1994/02/25} +% {Remove need for drv file} +% \changes{v0.2k}{1994/03/01} +% {Add unstripped module, +% so that dircheck.dtx may be used with initex} +% \changes{v1.0a}{1994/03/08} +% {Reorganise driver module into `new style'} +% \changes{v1.0b}{1994/03/12} +% {Change name from dircheck.dtx} +% \changes{v1.0b}{1994/03/12} +% {Minor edits to the typeouts in ltxcheck} +% \changes{v1.0d}{1994/03/28} +% {Improve documentation} +% \changes{v1.0i}{1994/11/03} +% {Generate an error if latex.ltx not used with clean initex} +% \changes{v1.0j}{1994/11/17} +% {\cs{@tempa} to \cs{reserved@a}} +% \changes{v1.0r}{1996/06/13} +% {documentation improvements mainly from internal/2174} +% \changes{v1.0v}{1997/06/16} +% {documentation improvements mainly from internal/2520} +% \changes{v1.0w}{1998/08/17}{(RmS) Documentation improvements.} +% +% \CheckSum{595} +% +% \section{\LaTeX\ System Dependent Initialisations} +% +% \changes{v0.2g}{1994/01/21} +% {Improve documentation, reorganise docstrip module} +% +% This file implements the semi-automatic determination of various +% system dependent parts of the initialisation. The actual definitions +% may be placed in a file |texsys.cfg|. Thus for operating systems for +% which the tests here do not result in acceptable settings, a `hand +% written' |texsys.cfg| may be produced. +% +% The macros that must be defined are: +% +% \DescribeMacro{\@currdir} +% |\@currdir|\meta{filename}\meta{space} should expand to a form of the +% filename that uniquely refers to the `current directory' if this is +% possible. (The expansion should also end with a space.) on UNIX, +% this is |\def\@currdir{./}|. For more exotic operating systems you may +% want to make |\@currdir| a macro with arguments delimited by |.| +% and/or \meta{space}. If the operating system has no concept of +% directory structure, this macro should be defined to be empty. +% +% +% \DescribeMacro{\input@path} +% If the primitive |\openin| searches the same directories as the +% primitive |\input|, then it is possible to tell (using |\ifeof|) +% whether a file exists before trying to input it. For systems like +% this, |\input@path| should be left undefined. +% +% If |\openin| does not `follow' |\input| then |\input@path| must be +% defined to be a list of directories to search for input files. The +% format for each directory is as for |\@currdir|, normally just a +% prefix is required, but it may be a macro with space-delimited +% argument. That is, if \meta{dir} is an entry in the input path, +% \TeX\ will try to load the expansion of +% \meta{dir}\meta{filename}\meta{space} +% +% So either \meta{dir} should be defined as a macro with argument +% delimited by space, or it should just expand to a directory name, +% including the final directory separator, so that it may be +% concatenated with the \meta{filename}. This means that for UNIX-like +% syntax, each \meta{dir} should end with a slash, |/|. +% +% |\input@path| should expand to a list of such directories, each in a +% |{}| group. +% +% \DescribeMacro{\filename@parse} +% After a call of the form: |\filename@parse{|\meta{filename}|}|, the +% three macros |\filename@area|,|\filename@base|,|\filename@ext| should +% be defined to be the `area' (or directory), basename and +% extension respectively. If there was no extension specified in +% \meta{filename}, |\filename@ext| should be |\let| to |\relax| (so this +% case may be tested with |\@ifundefined{filename@ext}| and, perhaps a +% default extension substituted). +% +% Normally one would not need to define this macro in |texsys.cfg| as +% the automatic tests can supply parsers that work with UNIX and VMS and +% Macintosh syntax, as well as a basic parser that will cover many other +% cases. However some operating systems may need a `hand produced' +% parser in which case it should be defined in this file. +% +% The UNIX parser also works for most MSDOS \TeX\ versions. +% Currently if the UNIX, VMS or Macintosh parser is not used, +% |\filename@parse| is defined to always return an empty area, and to +% split the argument into basename and extension at the first `|.|' +% that occurs in the name. +% Parsers for other formats may be defined in |texsys.cfg|, +% in which case they will be used in preference to the default +% definitions. +% +% \DescribeMacro{\@TeXversion} +% \changes{v1.0f}{1994/05/23}{Document \cs{@TeXversion}} +% |\@TeXversion| is now set automatically by the initialisation tests +% in this file. You should not need to set it in |texsys.cfg|, however +% the following documentation is left for information. \LaTeX\ does +% not set this variable exactly, the automatic tests set it to:\\ +% |2| for any version, $v$, $v < 3.0$\\ +% |3| for any version, $v$, $3.0 \leq v \leq 3.14$\\ +% \meta{undefined} otherwise.\\ +% However these values are accurate enough for \LaTeX\ to take +% appropriate action for these old \TeX{}s. +% +% If your \TeX\ is older than version 3.141, then you should define +% |\@TeXversion| (using |\def|) to be the version number. If you do not +% do this\footnote +% {Actually if your \TeX\ is really old, version~2, \LaTeX\ can +% detect this, and sets \cs{@TeXversion} to~2 if it is not set in +% the \texttt{cfg} file.} +%, \LaTeX\ will not work around a bug in old \TeX\ versions, and +% so error messages will appear in a very strange format, with |^^J| +% appearing instead of line breaks: +% \begingroup\catcode`\==\active \def=#1#2{}\hfuzz\maxdimen +%\begin{verbatim} +%! LaTeX Error: \rubbish undefined.^^J^^JSee the LaTeX manual or LaTeX= +% Companion +% for explanation.^^JType H for immediate help. +% ... +% +%l.3 \renewcommand{\rubbish} +% {} +%? +%\end{verbatim} +% \endgroup\noindent +% However if you put |\def\@TeXversion{3.14}| in \texttt{texsys.cfg} +% the following format will be used: +%\begin{verbatim} +%! LaTeX Error: \rubbish undefined. +% +%See the LaTeX manual or LaTeX Companion for explanation. +%Type H for immediate help. +%! . +% ... +% +%l.3 \renewcommand{\rubbish} +% {} +%? +%\end{verbatim} +% Note that this has an extra line |! .| which does not appear in +% error messages that use the default settings with a current version of +% \TeX, but this should not cause any confusion we hope. +% +% \StopEventually{} +% +% \section{Initialisation} +% As this file is read at a very early stage, some definitions that +% are normally considered to be part of the format must be made here. +% +% \subsection{INITEX} +% \changes{v0.2i}{1994/01/25} +% {Protect against looping on \cs{@@input} and \cs{@@end}.} +% \begin{macrocode} +%<*dircheck> +%<*initex> +%\ifnum\catcode`\{=1 +% \errmessage +% {LaTeX must be made using an initex with no format preloaded} +%\fi +\catcode`\{=1 +\catcode`\}=2 +\catcode`\#=6 +\catcode`\^=7 +\chardef\active=13 +\catcode`\@=11 +\countdef\count@=255 +\let\bgroup={ \let\egroup=} +\ifx\@@input\@undefined\let\@@input\input\fi +\ifx\@@end\@undefined\let\@@end\end\fi +\chardef\@inputcheck0 +\chardef\sixt@@n=16 +\newlinechar`\^^J +\def\typeout{\immediate\write17} +\def\dospecials{\do\ \do\\\do\{\do\}\do\$\do\&% + \do\#\do\^\do\_\do\%\do\~} +\def\@makeother#1{\catcode`#1=12\relax} +\def\space{ } +\def\@tempswafalse{\let\if@tempswa\iffalse} +\def\@tempswatrue{\let\if@tempswa\iftrue} +\let\if@tempswa\iffalse +\def\loop#1\repeat{\def\iterate{#1\relax\expandafter\iterate\fi}% + \iterate \let\iterate\relax} +\let\repeat\fi +% +% \end{macrocode} +% +% \subsection{Some bits of 2e} +% \begin{macrocode} +%<*2ekernel> +\def\two@digits#1{\ifnum#1<10 0\fi\number#1} +\long\def\@firstoftwo#1#2{#1} +\long\def\@secondoftwo#1#2{#2} +% \end{macrocode} +% \changes{v1.0e}{1994/05/11} +% {Add \cs{ProvidesFile} as used in fd files.} +% \changes{v1.0l}{1995/10/17} +% {Modify initex version of \cs{ProvidesFile}} +% \changes{v1.0n}{1995/11/01} +% {Initialise \cs{@addtofilelist} to \cs{@gobble}} +% This is a special version of |\ProvidesFile| for initex use. +% \changes{v1.0x}{2001/05/25}{Explicitly set catcode of +% \cs{endlinechar} to 10 (pr/3334)} +% \changes{v1.0y}{2001/06/04}{But only if it is a char (pr/3334)} +% \begin{macrocode} +\def\ProvidesFile#1{% + \begingroup + \catcode`\ 10 % + \ifnum \endlinechar<256 % + \ifnum \endlinechar>\m@ne + \catcode\endlinechar 10 % + \fi + \fi + \@makeother\/% + \@ifnextchar[{\@providesfile{#1}}{\@providesfile{#1}[]}} +\def\@providesfile#1[#2]{% + \wlog{File: #1 #2}% + \@addtofilelist{ #2}% + \endgroup} +\long\def\@addtofilelist#1{} +% \end{macrocode} +% +% \begin{macrocode} +\def\@empty{} +\catcode`\%=12 +\def\@percentchar{%} +\catcode`\%=14 +\let\@currdir\@undefined +\let\input@path\@undefined +\let\filename@parse\@undefined +% \end{macrocode} +% \begin{macro}{\strip@prefix} +% \changes{v0.2a}{1993/12/13} +% {modified, name changed from \cs{stripmeaning}.} +% \changes{v0.2e}{1994/01/19} +% {name changed from \cs{strip@meaning}, to match NFSS.} +% \begin{macrocode} +\def\strip@prefix#1>{} +% +% \end{macrocode} +% \end{macro} +% +% \section{texsys.cfg} +% As mentioned above, any site specific definitions required to describe +% the filename handling must be entered into a file |texsys.cfg|. If +% |texsys.cfg| can not be located by |\openin|, we write a default +% version out. The default version only contains comments, so we do not +% actually input the file in that case. The automatic tests later will, +% hopefully, correctly define the required macros. +% +% The tricky code below checks to see if |texsys.cfg| exists. If it does +% not, all the text in this file between START and END is copied +% verbatim to a new file |texsys,cfg|. If |texsys.cfg| is found, then it +% is simply input. This is only done when this file is being used +% unstripped. +% \begin{macrocode} +%<*docstrip> +\openin15=texsys.cfg +\ifeof15 +\typeout{** Writing a default texsys.cfg} +\immediate\openout15=texsys.cfg +\begingroup +\catcode`\^^M\active% +\let^^M\par% +\def\reserved@a#1^^M{% + \def\reserved@b{#1}% + \ifx\reserved@b\reserved@c\endgroup\else% + \immediate\write15{#1}% + \expandafter\reserved@a\fi}% +\def\reserved@d#1START^^M{\let\do\@makeother\dospecials\reserved@a}% +\catcode`\%=12 +\def\reserved@c{%END} +\reserved@d +% \end{macrocode} +%START +% \subsection{texsys.cfg} +% +% This file contains the site specific definitions of the four macros\\ +% |\@currdir|, |\input@path|, |\filename@parse| and |\@TeXversion|. +% +% As distributed it only contains comments, however this `empty' +% file will work on many systems because of the automatic tests built +% into |ltdirchk.dtx|. You \emph{are} allowed to edit this file to add +% definitions of these macros appropriate to your system. +% +% +% The macros that must be defined are: +% +% \DescribeMacro{\@currdir} +% |\@currdir|\meta{filename}\meta{space} should expand to a form of the +% filename that uniquely refers to the `current directory' if this is +% possible. (The expansion should also end with a space.) on UNIX, +% this is |\def\@currdir{./}|. For more exotic operating systems you may +% want to make |\@currdir| a macro with arguments delimited by |.| +% and/or \meta{space}. If the operating system has no concept of +% directory structure, this macro should be defined to be empty. +% +% +% \DescribeMacro{\input@path} +% If the primitive |\openin| searches the same directories as the +% primitive |\input|, then it is possible to tell (using |\ifeof|) +% whether a file exists before trying to input it. For systems like +% this, |\input@path| should be left undefined. +% +% If |\openin| does not `follow' |\input| then |\input@path| must be +% defined to be a list of directories to search for input files. The +% format for each directory is as for |\@currdir|, normally just a +% prefix is required, but it may be a macro with space-delimited +% argument. That is, if \meta{dir} is an entry in the input path, +% \TeX will try to load the expansion of +% +% \meta{dir}\meta{filename}\meta{space} +% +% So either \meta{dir} should be defined as a macro with argument +% delimited by space, or it should just expand to a directory name, +% including the final directory separator, so that it may be +% concatenated with the \meta{filename}. This means that for UNIX-like +% syntax, each \meta{dir} should end with a slash, |/|. One exception to +% this rule is that the input path should \emph{always} contain the +% empty directory |{}| as this will allow `full pathnames' to be used, +% and the `current directory' to be searched. +% +% |\input@path| should expand to a list of such directories, each in a +% |{}| group. +% +% +% \DescribeMacro{\filename@parse} +% After a call of the form: |\filename@parse{|\meta{filename}|}|, the +% three macros |\filename@area|,|\filename@base|,|\filename@ext| should +% be defined to be the `area' (or directory), basename and +% extension respectively. If there was no extension specified in +% \meta{filename}, |\filename@ext| should be |\let| to |\relax| (so this +% case may be tested with |\@ifundefined{filename@ext}| and, perhaps a +% default extension substituted). +% +% Normally one would not need to define this macro in |texsys.cfg| as +% the automatic tests can supply parsers that work with UNIX and VMS +% syntax, as well as a basic parser that willcover many other cases. +% However some operating systems may need a `hand produced' parser +% in which case it should be defined in this file. +% +% The UNIX parser also works for most MSDOS \TeX\ versions. +% Currently if the UNIX or VMS parser is not used, |\filename@parse| is +% defined to always return an empty area, and to split the argument into +% basename and extension at the first `|.|' that occurs in the name. +% Parsers for other formats may be defined in |texsys.cfg|, +% in which case they will be used in preference to the default +% definitions. +% +% +% \DescribeMacro{\@TeXversion} +% You should not need to set this macro in |texsys.cfg|. \LaTeX\ +% tests to set this automatically. See the comments in the opening +% section of \texttt{ltdirchk.dtx}. +% +% +% The following sections give examples of definitions which might +% work on various systems. These are currently mainly untested as I only +% have access to a few systems, all of which do not need this file as +% the automatic tests work. All the code is commented out. +% +% \subsection{UNIX (web2c)} +% This implementation does make |\openin| and |\input| look in the same +% places. Acceptable settings are made by |ltdirchk.dtx|, and so this +% file may be empty. The definitions below are therefore just for +% information. +% \begin{macrocode} +%\def\@currdir{./} +%\let\input@path\@undefined +% \end{macrocode} +% +% \subsection{UNIX (other)} +% Apparently some commercial UNIX implementations have different paths +% for |\openin| and |\input|. For these one could use definitions like +% the following (with whatever directories are used at your site): +% note that the directory names should end with |/|. +% \begin{macrocode} +% \def\@currdir{./} +% \def\input@path{% +% {/usr/local/lib/tex/inputs/distrib/}% +% {/usr/local/lib/tex/inputs/contrib/}% +% {/usr/local/lib/tex/inputs/local/}% +% } +% \end{macrocode} +% +% \subsection{MSDOS (emtex)} +% This implementation does make |\openin| and |\input| look in the same +% places. Acceptable settings are made by |ltdirchk.dtx|, and so this +% file may be empty. The definitions below are therefore just for +% information. +% \begin{macrocode} +% \def\@currdir{./} +% \let\input@path\@undefined +% \end{macrocode} +% +% \subsection{MSDOS (other)} +% Some PC implementations have different paths +% for |\openin| and |\input|. For these one could use definitions like +% the following (with whatever directories are used at your site): +% note that the directory names should end with |/|. +% This assumes the implementation uses UNIX style |/| as the directory +% separator. +% \begin{macrocode} +% \def\@currdir{./} +% \def\input@path{% +% {c:/tex/inputs/distrib/}% +% {c:/tex/inputs/contrib/}% +% {c:/tex/inputs/local/}% +% } +% \end{macrocode} +% +% \subsection{VMS (DECUS \TeX, PD VMS 3.6)} +% This implementation does make |\openin| and |\input| look in the same +% places. Acceptable settings are made by |ltdirchk.dtx|, and so this +% file may be empty. The definitions below are therefore just for +% information. +% \begin{macrocode} +% \def\@currdir{[]} +% \let\input@path\@undefined +% \end{macrocode} +% +% \subsection{VMS (???)} +% Some VMS implementations have different paths +% for |\openin| and |\input|. For these one could use definitions like +% the following: +% \begin{macrocode} +% \def\@currdir{[]} +% \def\input@path{% +% {tex_inputs:}% +% {SOMEDISK:[SOME.TEX.DIRECTORY]}% +% } +% \end{macrocode} +% +% \subsection{MACINTOSH (OzTeX 1.6)} +% This implementation does make |\openin| and |\input| look in the same +% places. Acceptable settings are made by |ltdirchk.dtx|, and so this +% file may be empty. The definitions below are therefore just for +% information. +% \begin{macrocode} +% \def\@currdir{:} +% \let\input@path\@undefined +% \end{macrocode} +% +% \subsection{MACINTOSH (other)} +% Some Macintosh implementations have different paths +% for |\openin| and |\input|. For these one could use definitions like +% the following (with whatever folders are used on your machine): +% note that the directory names should end with |:|, and they should +% contain {\em no\/} spaces. +% \begin{macrocode} +% \def\@currdir{:} +% \def\input@path{% +% {Hard-Disk:Applications:TeX:TeX-inputs:}% +% {Hard-Disk:Applications:TeX:My-inputs:}% +% } +% \end{macrocode} +% +% \subsection{FAKE EXAMPLE} +% This example is for an operating system that has filenames of the +% form |name| For maximum compatability with macro sets, +% you want |name.ext| to be mapped to |name|. +% and |name.ext| to be mapped to |name|. +% |\input| does this mapping automatically, but |\openin| does not, and +% does not look in the same places as |\input|. +% |<>name| is the desired `current directory' syntax. +% +% the following code would possibly work: +% \begin{macrocode} +% \def\@dir#1#2 {% +% \@d@r{#1}#2..\@nil} +% \def\@d@r#1#2.#3.#4\@nil{% +% <\ifx\@dir#1\@dir\else#1\ifx\@dir#3\@dir\else.\fi\fi#3>#2 } +% +% \def\@currdir{\@dir{}} +% \def\input@path{% +% {\@dir{area.one}}% +% {\@dir{area.two}}% +% } +% \end{macrocode} +%END +% \begin{macrocode} +\immediate\closeout15 +% \end{macrocode} +% If |texsys.cfg| did exist, then input it. +% \begin{macrocode} +\else +\typeout{** Using the existing texsys.cfg} +\closein15 +\input texsys.cfg +\fi +% +% \end{macrocode} +% +% If the stripped version of this file is being used (in latex2e.ltx) +% then texsys.cfg should be there, so just input it. +% \begin{macrocode} +%\input texsys.cfg +% \end{macrocode} +% +% \changes{v0.2f}{1994/01/20} +% {\cs{@copytexsys} and the texsys.new file removed} +% +% \section{Setting \texttt{\cs{@currdir}}} +% +% \begin{macro}{\@currdir} +% \begin{macro}{\IfFileExists} +% \changes{v0.2e}{1994/01/19} +% {name changed from \cs{test}} +% This is a local definition of |\IfFileExists|. It tries to relocate +% |texsxys.aux|. If it succeeds, then the |\@currdir| syntax has been +% determined. If all the tests fail then |\@currdir| will be set to +% |\@empty|, and |ltxcheck| will warn of this when it checks the format. +% \begin{macrocode} +\begingroup +\count@\time +\divide\count@ 60 +\count2=-\count@ +\multiply\count2 60 +\advance\count2 \time +% \end{macrocode} +% +% \begin{macro}{\today} +% The current date and time stamp. +% \changes{v0.2g}{1994/01/21} +% {Name changed from \cs{stamp}, to save memory} +% \begin{macrocode} +\edef\today{% + \the\year/\two@digits{\the\month}/\two@digits{\the\day}:% + \two@digits{\the\count@}:\two@digits{\the\count2}} +% \end{macrocode} +% \end{macro} +% +% Create a file |texsys.aux| (hopefully in the current directory), +% then try to locate it again. +% \begin{macrocode} +\immediate\openout15=texsys.aux +\immediate\write15{\today^^J} +\immediate\closeout15 % +% \end{macrocode} +% +% |#1| is the file to try, |#2| is what to do on success, |#3| on +% failure. +% \begin{macrocode} +\def\IfFileExists#1#2#3{% + \openin\@inputcheck#1 % + \ifeof\@inputcheck + #3\relax + \else + \read\@inputcheck to \reserved@a + \ifx\reserved@a\today + \typeout{#1 found}#2\relax + \else + \typeout{BAD: old file \reserved@a (should be \today)}% + #3\relax + \fi + \fi + \closein\@inputcheck} +% \end{macrocode} +% +% \begin{macrocode} +\endlinechar=-1 +% \end{macrocode} +% +% If |\@currdir| has not been pre-defined in |texsys.cfg| then test for +% UNIX, VMS and Oz-\TeX-Mac. syntax. +% \changes{v0.2h}{1994/01/24} +% {Stop testing once texsys.aux has been found} +% \begin{macrocode} +\ifx\@currdir\@undefined + \IfFileExists{./texsys.aux}{\gdef\@currdir{./}}% + {\IfFileExists{[]texsys.aux}{\gdef\@currdir{[]}}% + {\IfFileExists{:texsys.aux}{\gdef\@currdir{:}}{}}} +% \end{macrocode} +% If it is still undefined at this point, all the above tests failed. +% Earlier versions interactively prompted for a definition at this +% point, but it seems impossible to reliably obtain information from +% users at this point in the installation. This version of the file +% produces a format with no user-interaction. Later if the format is not +% suitable for the system, |texsys.cfg| may be edited and the format +% re-made. +% \changes{v0.2a}{1993/12/13} +% {Removed interactive prompting for current directory syntax} +% \changes{v0.2f}{1994/01/20} +% {\cs{@copytexsys} removed} +% \changes{v1.0u}{1996/12/06} +% {*** removed from various messages for GNU Make. +% internal/2338} +% \begin{macrocode} + \ifx\@currdir\@undefined + \global\let\@currdir\@empty + \typeout{^^J^^J% + !! No syntax for the current directory could be found^^J% + }% + \fi +% \end{macrocode} +% Otherwise |\@currdir| was defined in |texsys.cfg|. In this case check +% that the syntax specified works on this system. (In case a complete +% \LaTeX\ system has been copied from one system to another.) If the +% test fails, give up. The installer should remove or correct the +% offending |texsys.cfg| and try again. +% \begin{macrocode} +\else + \IfFileExists{\@currdir texsys.aux}{}{% + \edef\reserved@a{\errhelp{% + texsys.cfg specifies the current directory syntax to be^^J% + \meaning\@currdir^^J% + but this does not work on this system.^^J% + Remove texsys.cfg and restart.}}\reserved@a + \errmessage{Bad texsys.cfg file: \noexpand\@currdir}\@@end} +% \end{macrocode} +% The version of |\@currdir| in |texsys.cfg| looks OK. +% \begin{macrocode} +\fi +% \end{macrocode} +% \changes{v0.2d}{1994/01/14} +% {Close the texsys.aux output stream} +% \begin{macrocode} +\immediate\closeout15 % +\endgroup +% \end{macrocode} +% +% \begin{macrocode} +\typeout{^^J^^J% + \noexpand\@currdir set to: + \expandafter\strip@prefix\meaning\@currdir.^^J% + } +% \end{macrocode} +% \end{macro} +% \end{macro} +% +% +% \changes{v0.2a}{1993/12/13} +% {on the `docstrip' pass, do not check openin path} +% +% Stop here if the file is being used unstripped. +% \begin{macrocode} +%<*docstrip> +\relax\endinput +% +% \end{macrocode} +% +% \section{Setting \texttt{\cs{input@path}}} +% +% Earlier versions of this file attempted to automatically test whether +% |\input@path| was required, and interactively prompt for a path if +% necessary. This was not found to be very reliable The first-time +% installer of \LaTeXe\ can not be expected to have enough information +% to supply the correct information to the prompts. Now the interaction +% is omitted. After the format is made the installer can attempt to run +% the test document |ltxcheck.tex| through \LaTeXe. This will check, +% amongst other things, whether |texsys.cfg| will need to be edited and +% the format remade. +% +% \begin{macro}{\input@path} +% Now set up the |\input@path|. +% +% |\input@path| should either be undefined, or a list of directories as +% described in the introduction. +% \changes{v0.2e}{1994/01/19} +% {No longer check that an empty group is in the path} +% \begin{macrocode} + \typeout{^^J% + Assuming \noexpand\openin and \noexpand\input^^J% + \ifx\input@path\@undefined +% \end{macrocode} +% |\input@path| has not been pre-defined. +% \begin{macrocode} + have the same search path.^^J% + \else +% \end{macrocode} +% |\input@path| has been defined in |texsys.cfg|. +% \begin{macrocode} + have different search paths.^^J% + LaTeX will use the path specified by \noexpand\input@path:^^J% + \fi + } +% \end{macrocode} +% \end{macro} +% +% \section{Filename Parsing} +% +% \begin{macro}{\filename@parse} +% Split a filename into its components. +% \changes{v0.2g}{1994/01/21} +% {Minor changes, and add Mac version (:)} +% \begin{macrocode} +\ifx\filename@parse\@undefined + \def\reserved@a{./}\ifx\@currdir\reserved@a +% \end{macrocode} +% |\filename@parse| was not specified in |texsys.cfg|, but |\@currdir| +% looks like UNIX\ldots +% \begin{macrocode} + \typeout{^^JDefining UNIX/DOS style filename parser.^^J} + \def\filename@parse#1{% + \let\filename@area\@empty + \expandafter\filename@path#1/\\} +% \end{macrocode} +% +% Search for the last |/|. +% \begin{macrocode} + \def\filename@path#1/#2\\{% + \ifx\\#2\\% + \def\reserved@a{\filename@simple#1.\\}% + \else + \edef\filename@area{\filename@area#1/}% + \def\reserved@a{\filename@path#2\\}% + \fi + \reserved@a} +% \end{macrocode} +% +% \begin{macrocode} + \else\def\reserved@a{[]}\ifx\@currdir\reserved@a +% \end{macrocode} +% |\filename@parse| was not specified in |texsys.cfg|, but |\@currdir| +% looks like VMS\ldots +% \begin{macrocode} + \typeout{^^JDefining VMS style filename parser.^^J} + \def\filename@parse#1{% + \let\filename@area\@empty + \expandafter\filename@path#1]\\} +% \end{macrocode} +% +% Search for the last |]|. +% \begin{macrocode} + \def\filename@path#1]#2\\{% + \ifx\\#2\\% + \def\reserved@a{\filename@simple#1.\\}% + \else + \edef\filename@area{\filename@area#1]}% + \def\reserved@a{\filename@path#2\\}% + \fi + \reserved@a} +% \end{macrocode} +% +% \begin{macrocode} + \else\def\reserved@a{:}\ifx\@currdir\reserved@a +% \end{macrocode} +% |\filename@parse| was not specified in |texsys.cfg|, but |\@currdir| +% looks like Macintosh\ldots +% \begin{macrocode} + \typeout{^^JDefining Mac style filename parser.^^J} + \def\filename@parse#1{% + \let\filename@area\@empty + \expandafter\filename@path#1:\\} +% \end{macrocode} +% +% Search for the last |:|. +% \changes{v1.0g}{1994/05/25} +% {Mac parser had " typo for :} +% \begin{macrocode} + \def\filename@path#1:#2\\{% + \ifx\\#2\\% + \def\reserved@a{\filename@simple#1.\\}% + \else + \edef\filename@area{\filename@area#1:}% + \def\reserved@a{\filename@path#2\\}% + \fi + \reserved@a} +% \end{macrocode} +% +% \begin{macrocode} + \else +% \end{macrocode} +% |\filename@parse| was not specified in |texsys.cfg|. +% So just make a simple parser that always sets |\filename@area| to +% empty. +% \begin{macrocode} + \typeout{^^JDefining generic filename parser.^^J} + \def\filename@parse#1{% + \let\filename@area\@empty + \expandafter\filename@simple#1.\\} + \fi\fi\fi +% \end{macrocode} +% +% |\filename@simple| is used by all three versions. +% Finally we can split off the extension. +% \begin{macrocode} + \def\filename@simple#1.#2\\{% + \ifx\\#2\\% + \let\filename@ext\relax + \else + \edef\filename@ext{\filename@dot#2\\}% + \fi + \edef\filename@base{#1}} +% \end{macrocode} +% +% Remove a final dot, added earlier. +% \begin{macrocode} + \def\filename@dot#1.\\{#1} +% \end{macrocode} +% +% \begin{macrocode} +\else +% \end{macrocode} +% Otherwise, |\filename@parse| was specified in |texsys.cfg|. +% \begin{macrocode} + \typeout{^^J^^J% + \noexpand\filename@parse was defined in texsys.cfg:^^J% + \expandafter\strip@prefix\meaning\filename@parse.^^J% + } +\fi +% \end{macrocode} +% \end{macro} +% +% \section{\TeX\ Versions} +% +% \begin{macro}{\@TeXversion} +% \TeX\ versions older than than 3.141 require |\@TeXversion| to be +% set. This can be determined automatically due to a trick suggested +% by Bernd Raichle. (Actually this will not always get the correct +% version number, eg \TeX3.14 would be detected as \TeX3, but \LaTeX\ +% only needs to take account of \TeX's older than 3, or between 3 and +% 3.14. +% \changes{v1.0h}{1994/10/11} +% {Check for TeX3.14} +% \begin{macrocode} +\ifx\@TeXversion\@undefined + \ifx\@undefined\inputlineno + \def\@TeXversion{2} + \else + {\catcode`\^^J=\active + \def\reserved@a#1#2\@@{\if#1\string^3\fi} + \edef\reserved@a{\expandafter\reserved@a\string^^J\@@} + \ifx\reserved@a\@empty\else\gdef\@TeXversion{3}\fi} + \fi +\fi +% \end{macrocode} +% \end{macro} +% +% \begin{macrocode} +% +% \end{macrocode} +% +% \section{ltxcheck.tex} +% After the format has been made, and article.cls moved with the +% other files to the `standard input directory' as specified in +% |install.txt|, the format may be checked by running the file +% |ltxcheck.tex|. +% \changes{v0.2f}{1994/01/20} +% {Modify all of ltxcheck} +% \changes{v1.0h}{1994/10/11} +% {Modify all of ltxcheck again} +% \changes{v1.0t}{1996/09/25} +% {Move ltxcheck to separate file} +% +% +% +% \Finale +% diff --git a/Master/texmf-dist/source/latex/base/lterror.dtx b/Master/texmf-dist/source/latex/base/lterror.dtx new file mode 100644 index 00000000000..98d3304df45 --- /dev/null +++ b/Master/texmf-dist/source/latex/base/lterror.dtx @@ -0,0 +1,821 @@ +% \iffalse meta-comment +% +% Copyright 1993 1994 1995 1996 1997 1998 1999 2000 2001 2002 2003 2004 +% The LaTeX3 Project and any individual authors listed elsewhere +% in this file. +% +% This file is part of the LaTeX base system. +% ------------------------------------------- +% +% It may be distributed and/or modified under the +% conditions of the LaTeX Project Public License, either version 1.3 +% of this license or (at your option) any later version. +% The latest version of this license is in +% http://www.latex-project.org/lppl.txt +% and version 1.3 or later is part of all distributions of LaTeX +% version 2003/12/01 or later. +% +% This file has the LPPL maintenance status "maintained". +% +% The list of all files belonging to the LaTeX base distribution is +% given in the file `manifest.txt'. See also `legal.txt' for additional +% information. +% +% The list of derived (unpacked) files belonging to the distribution +% and covered by LPPL is defined by the unpacking scripts (with +% extension .ins) which are part of the distribution. +% +% \fi +% +% \iffalse +%%% From File: lterror.dtx +%\ProvidesFile{autoerr.sty} +% [1995/11/28 v1.2l LaTeX error autoload file] +%<*driver> +% \fi +\ProvidesFile{lterror.dtx} + [1998/05/28 v1.2n LaTeX Kernel (errors)] +% \iffalse +\documentclass{ltxdoc} +\GetFileInfo{lterror.dtx} +\title{\filename} +\date{\filedate} + \author{% + Johannes Braams\and + David Carlisle\and + Alan Jeffrey\and + Leslie Lamport\and + Frank Mittelbach\and + Chris Rowley\and + Rainer Sch\"opf} +\begin{document} +\maketitle + \DocInput{\filename} +\end{document} +% +% \fi +% +% \CheckSum{442} +% +% \changes{v1.1a}{1994/05/16}{(ASAJ) Split from ltinit.dtx.} +% \changes{v1.1a}{1994/05/16}{(ASAJ) Completely new error interface.} +% \changes{v1.1b}{1994/05/17}{(ASAJ) Moved error stuff from +% ltdefns.dtx.} +% \changes{v1.1c}{1994/05/20}{(ASAJ) Added \cs{@latex@info@no@line}.} +% \changes{v1.1c}{1994/05/20}{(ASAJ) Added missing full stops.} +% \changes{v1.1c}{1994/05/20}{(ASAJ) Fixed a bug with +% \cs{@inmatherr}.} +% \changes{v1.1d}{1994/05/21}{(ASAJ) Made the error commands robust.} +% \changes{v1.1e}{1994/05/22}{(ASAJ) Replaced bgroup by begingroup in +% error messages, to stop extra mathords creeping into math mode.} +% \changes{v1.2a}{1994/05/22}{(ASAJ) Replaced \cs{@generic@message} and +% \cs{@generic@error} by \cs{GenericError}, \cs{GenericWarning} and +% \cs{GenericInfo}.} +% \changes{v1.2a}{1994/05/22}{(ASAJ) Made \cs{GenericError}, +% \cs{GenericWarning} and \cs{GenericInfo} robust.} +% \changes{v1.2a}{1994/05/22}{(ASAJ) Replaced \cmd\\ and tilde by +% \cs{MessageBreak} and \cs{space}.} +% \changes{v1.2a}{1994/05/22}{(ASAJ) Replaces \cs{string} by +% \cs{protect} in some messages.} +% \changes{v1.2f}{1994/05/24}{(DPC) wrap long lines} +% \changes{v1.2h}{1994/11/17} +% {\cs{@tempa} to \cs{reserved@a}} +% \changes{v1.2i}{1995/09/01} +% {Add autoload support} +% \changes{v1.2j}{1995/10/09} +% {Modify autoload support} +% +% \section{Error handling} +% +% This section defines \LaTeX's error commands. +% +% \StopEventually{} +% +% +% The `2ekernel' code ensures that a |\usepackage{autoerr}| is +% essentially ignored if a `full' format is being used that has +% the error messages already in the format. +% \begin{macrocode} +%<2ekernel>\expandafter\let\csname ver@autoerr.sty\endcsname\fmtversion +% \end{macrocode} +% +% \begin{macrocode} +%<*2ekernel|autoload> +% \end{macrocode} +% +% \subsection{General commands} +% +% \begin{macro}{\MessageBreak} +% This command prints a new-line inside a message, followed by a +% continuation line begun with |\@msg@continuation|. Normally it is +% defined to be |\relax|, but inside messages, it is let to +% |\@message@break|. +% \begin{macrocode} +\let\MessageBreak\relax +% \end{macrocode} +% \end{macro} +% +% \changes{v1.2g}{1994/11/04}{Added \cs{set@display@protect} to +% \cs{Generic*} commands. ASAJ.} +% +% \begin{macro}{\GenericInfo} +% This takes two arguments: a continuation and a message, and sends +% the result to the log file. +% \begin{macrocode} +\DeclareRobustCommand{\GenericInfo}[2]{% + \begingroup + \def\MessageBreak{^^J#1}% + \set@display@protect + \immediate\write\m@ne{#2\on@line.}% + \endgroup +} +% \end{macrocode} +% \end{macro} +% +% \begin{macro}{\GenericWarning} +% This takes two arguments: a continuation and a message, and sends +% the result to the screen. +% \begin{macrocode} +\DeclareRobustCommand{\GenericWarning}[2]{% + \begingroup + \def\MessageBreak{^^J#1}% + \set@display@protect + \immediate\write\@unused{^^J#2\on@line.^^J}% + \endgroup +} +% +% \end{macrocode} +% \end{macro} +% +% \begin{macro}{\GenericError} +% This macro takes four arguments: a continuation, +% an error message, where to go for further information, and the help +% information. It displays the error message, and sets the error help +% (the result of typing |h| to the prompt), and does a horrible hack +% to turn the last context line (which by default is the only context +% line) into just three dots. This could be made more efficient. +% \changes{v1.2d}{1994/05/22} +% {(DPC) New version using long command name.} +% \changes{v1.2d}{1994/05/22} +% {(DPC) Alternative version added for old TeXs} +% \begin{macrocode} +%\def\GenericError{\@autoerr\GenericError} +%<*2ekernel|def> +\bgroup +\lccode`\@=`\ % +\lccode`\~=`\ % +\lccode`\}=`\ % +\lccode`\{=`\ % +\lccode`\T=`\T% +\lccode`\H=`\H% +\catcode`\ =11\relax% +\lowercase{% +\egroup% +% \end{macrocode} +% +% Unfortunately \TeX\ versions older than 3.141 have a bug which means +% that |^^J| does not force a linebreak in |\message| and |\errmessage| +% commands. So for these old \TeX's we use |\typeout| to produce the +% message, and then have an empty |\errmessage| command. This causes an +% extra line of the form +%\begin{verbatim} +%! . +%\end{verbatim} +% To appear on the terminal, but if you do not like it, you can always +% upgrade your \TeX! In order for your format to use this version, you +% must define the macro |\@TeXversion| to be the version number, e.g., +% 3.14 of the underlying \TeX. See the comments in +% \texttt{ltdircheck.dtx}. +% \begin{macrocode} +\dimen@\ifx\@TeXversion\@undefined4\else\@TeXversion\fi\p@% +\ifdim\dimen@>3.14\p@% +% \end{macrocode} +% +% First the `standard case'. +% \begin{macrocode} +\DeclareRobustCommand{\GenericError}[4]{% +\begingroup% +\immediate\write\@unused{}% +\def\MessageBreak{^^J}% +\set@display@protect% +\edef% +% %<-------------------do not delete this space!------------------->% +\@err@ % +{{#4}}% +\errhelp +% %<-------------------do not delete this space!------------------->% +\@err@ % +\let +% %<-------------------do not delete this space!------------------->% +\@err@ % +\@empty +\def\MessageBreak{^^J#1}% +\def~{\errmessage{% +#2.^^J^^J% +#3^^J% +Type H for immediate help% +% %<-------------------do not delete this space!------------------->% +\@err@ % +}}% +~% +\endgroup}% +% \end{macrocode} +% +% \begin{macrocode} +\else% +% \end{macrocode} +% +% Secondly the version for old \TeX's. +% \begin{macrocode} +\DeclareRobustCommand{\GenericError}[4]{% +\begingroup% +\immediate\write\@unused{}% +\def\MessageBreak{^^J}% +\set@display@protect% +\edef% +% %<-------------------do not delete this space!------------------->% +\@err@ % +{{#4}}% +\errhelp +% %<-------------------do not delete this space!------------------->% +\@err@ % +\let +% %<-------------------do not delete this space!------------------->% +\@err@ % +\errmessage +\def\MessageBreak{^^J#1}% +\def~{\typeout{! % +#2.^^J^^J% +#3^^J% +Type H for immediate help.}% +% %<-------------------do not delete this space!------------------->% +\@err@ % +{}}% +~% +\endgroup}% +% \end{macrocode} +% +% \begin{macrocode} +\fi}% +% +% \end{macrocode} +% \end{macro} +% +% \begin{macro}{\PackageError} +% \begin{macro}{\PackageWarning} +% \begin{macro}{\PackageWarningNoLine} +% \begin{macro}{\PackageInfo} +% \begin{macro}{\ClassError} +% \begin{macro}{\ClassWarning} +% \begin{macro}{\ClassWarningNoLine} +% \begin{macro}{\ClassInfo} +% These commands are intended for use by package and class writers, to +% give information to authors. The syntax is: +% \begin{quote} +% |\PackageError{|\meta{package}|}{|^^A +% \meta{error}|}{|\meta{help}|}| \\ +% |\PackageWarning{|\meta{package}|}{|\meta{warning}|}| \\ +% |\PackageWarningNoLine{|\meta{package}|}{|\meta{warning}|}| \\ +% |\PackageInfo{|\meta{package}|}{|\meta{info}|}| +% \end{quote} +% and similarly for classes. The |Error| commands print the +% \meta{error} message, and present the interactive prompt; if the +% author types |h|, then the \meta{help} information is displayed. +% The |Warning| commands produce a warning but do not present the +% interactive prompt. The |WarningNoLine| commands do the same, +% but don't print the input line number. The |Info| commands write +% the message to the +% |log| file. Within the messages, the command +% |\MessageBreak| can be used to +% break a line, |\protect| can be used to protect command names, +% and |\space| is a space, for example: +% \begin{verbatim} +% \newcommand{\foo}{FOO} +% \PackageWarning{ethel}{% +% Your hovercraft is full of eels,\MessageBreak +% and \protect\foo\space is \foo} +% \end{verbatim} +% produces: +% \begin{verbatim} +% Package ethel warning: Your hovercraft is full of eels, +% (ethel) and \foo is FOO on input line 54. +% \end{verbatim} +% +% \begin{macrocode} +%\def\PackageError{\@autoerr\PackageError} +%<*2ekernel|def> +\gdef\PackageError#1#2#3{% + \GenericError{% + (#1)\@spaces\@spaces\@spaces\@spaces + }{% + Package #1 Error: #2% + }{% + See the #1 package documentation for explanation.% + }{#3}% +} +% +% \end{macrocode} +% +% \begin{macrocode} +%<*2ekernel|autoload> +\def\PackageWarning#1#2{% + \GenericWarning{% + (#1)\@spaces\@spaces\@spaces\@spaces + }{% + Package #1 Warning: #2% + }% +} +\def\PackageWarningNoLine#1#2{% + \PackageWarning{#1}{#2\@gobble}% +} +\def\PackageInfo#1#2{% + \GenericInfo{% + (#1) \@spaces\@spaces\@spaces + }{% + Package #1 Info: #2% + }% +} +% +% \end{macrocode} +% +% \changes{v1.2l}{1995/11/28} +% {Typo in autoload code /1985} +% \begin{macrocode} +%\def\ClassError{\@autoerr\ClassError} +%<*2ekernel|def> +\gdef\ClassError#1#2#3{% + \GenericError{% + (#1) \space\@spaces\@spaces\@spaces + }{% + Class #1 Error: #2% + }{% + See the #1 class documentation for explanation.% + }{#3}% +} +% +% \end{macrocode} +% +% \begin{macrocode} +%<*2ekernel|autoload> +\def\ClassWarning#1#2{% + \GenericWarning{% + (#1) \space\@spaces\@spaces\@spaces + }{% + Class #1 Warning: #2% + }% +} +\def\ClassWarningNoLine#1#2{% + \ClassWarning{#1}{#2\@gobble}% +} +\def\ClassInfo#1#2{% + \GenericInfo{% + (#1) \space\space\@spaces\@spaces + }{% + Class #1 Info: #2% + }% +} +% +% \end{macrocode} +% \end{macro} +% \end{macro} +% \end{macro} +% \end{macro} +% \end{macro} +% \end{macro} +% \end{macro} +% \end{macro} +% +% \begin{macro}{\@latex@error} +% \begin{macro}{\@latex@warning} +% \begin{macro}{\@latex@warning@no@line} +% \begin{macro}{\@latex@info} +% \begin{macro}{\@latex@info@no@line} +% \changes{v1.2e}{1994/05/24}{Macro added} +% Errors and other info, for use in the \LaTeX{} core. +% \begin{macrocode} +%\def\@latex@error{\@autoerr\@latex@error} +%<*2ekernel|def> +\gdef\@latex@error#1#2{% + \GenericError{% + \space\space\space\@spaces\@spaces\@spaces + }{% + LaTeX Error: #1% + }{% + See the LaTeX manual or LaTeX Companion for explanation.% + }{#2}% +} +% +% \end{macrocode} +% +% \begin{macrocode} +%<*2ekernel|autoload> +\def\@latex@warning#1{% + \GenericWarning{% + \space\space\space\@spaces\@spaces\@spaces + }{% + LaTeX Warning: #1% + }% +} +% \end{macrocode} +% +% \begin{macrocode} +\def\@latex@warning@no@line#1{% + \@latex@warning{#1\@gobble}} +% \end{macrocode} +% +% \begin{macrocode} +\def\@latex@info#1{% + \GenericInfo{% + \@spaces\@spaces\@spaces + }{% + LaTeX Info: #1% + }% +} +% \end{macrocode} +% +% \begin{macrocode} +\def\@latex@info@no@line#1{% + \@latex@info{#1\@gobble}} +% \end{macrocode} +% +% |\@font@warning| and |\@font@info| are defined later since they +% have to be redefined by the \texttt{tracefnt} package. +%\begin{verbatim} +%\def\@font@warning#1{% +% \GenericWarning{% +% {(font)\@spaces\@spaces}% +% {Font Warning: #1}% +% } +%\def\@font@info#1{% +% \GenericInfo{% +% (font)\space\@spaces +% }{% +% Font Info: #1% +% }% +% } +%\end{verbatim} +% \end{macro} +% \end{macro} +% \end{macro} +% \end{macro} +% \end{macro} +% +% \begin{macro}{\c@errorcontextlines} +% \changes{LaTeX2e}{1993/11/22}{Macro added} +% |\errorcontextlines| as a \LaTeX\ counter, so that it may be be +% manipulated with |\setcounter| (once it is defined :-) +% \begin{macrocode} +\let\c@errorcontextlines\errorcontextlines +\c@errorcontextlines=-1 +% \end{macrocode} +% \end{macro} +% +% \changes{v1.0d}{1994/03/28} +% {Remove test for \cs{inputlineno} undefined.} +% \begin{macro}{\on@line} +% The message ` on input line~$n$', if possible. +% \begin{macrocode} +\ifnum\inputlineno=\m@ne + \let\on@line\@empty +\else + \def\on@line{ on input line \the\inputlineno} +\fi +% \end{macrocode} +% \end{macro} +% +% \begin{macro}{\@warning} +% \begin{macro}{\@@warning} +% \begin{macro}{\@latexerr} +% Older \LaTeX{} messages. For the moment, these +% |\let| to the new message commands. They may be changed later, +% once only obsolete packages and classes contain them. +% \changes{v1.0b}{1993/12/03}{Set \cs{c@errorcontextlines} to -1} +% \changes{v1.0e}{1993/04/09}{Mention The Companion} +% \changes{v1.0f}{1993/04/11}{Remove setting of errorcontextlines} +% \changes{v1.0k}{1994/05/01}{(CAR) Added draft \cs{@latexinfo}.} +% \changes{v1.0n}{1994/05/10}{(ASAJ) Added extra blank lines to +% \cs{@latexerr}.} +% \changes{v1.0o}{1994/05/11} +% {(ASAJ) Removed one of the extra blank lines to \cs{@latexerr}.} +% \begin{macrocode} +\let\@warning\@latex@warning +\let\@@warning\@latex@warning@no@line +% +\global\let\@latexerr\@latex@error +% \end{macrocode} +% \end{macro} +% \end{macro} +% \end{macro} +% +% \begin{macro}{\@spaces} +% Four spaces. +% \begin{macrocode} +%<*2ekernel|autoload> +\def\@spaces{\space\space\space\space} +% +% \end{macrocode} +% \end{macro} +% +% \subsection{Specific errors} +% +% \begin{macro}{\@eha} +% \begin{macro}{\@ehb} +% \begin{macro}{\@ehc} +% \begin{macro}{\@ehd} +% The more common error help messages. +% \begin{macrocode} +%<*2ekernel|def> +\gdef\@eha{% + Your command was ignored.\MessageBreak + Type \space I \space to replace it % + with another command,\MessageBreak + or \space \space to continue without it.} +\gdef\@ehb{% + You've lost some text. \space \@ehc} +\gdef\@ehc{% + Try typing \space % + \space to proceed.\MessageBreak + If that doesn't work, type \space X \space to quit.} +\gdef\@ehd{% + You're in trouble here. \space\@ehc} +% +% \end{macrocode} +% As |\latex@error| triggers the autoload, these definitions +% should not be needed in the autoload format, but just to be safe\ldots +% \begin{macrocode} +%<*autoload> +\let\@eha\@empty\let\@ehb\@empty\let\@ehc\@empty\let\@ehd\@empty +% +% \end{macrocode} +% \end{macro} +% \end{macro} +% \end{macro} +% \end{macro} +% +% Here are most of the error message-generating commands of \LaTeX. +% \begin{macro}{\@autoerr} +% Make this autoload command robust, as it may be read in at +% unpredicatble times. +% \begin{macrocode} +%\def\@autoerr{\protect\@autoload{err}\protect} +% \end{macrocode} +% \end{macro} +% +% \begin{macro}{\@notdefinable} +% Error message generated in |\@ifdefinable| from calls +% to one of the commands |\newcommand|, |\newlength| or |\newtheorem| +% specifying an already-defined command name or one that begins +% |\end...|. +% \changes{v1.2n}{1998/05/28}{Added message re `end...' pr/1555} +% \begin{macrocode} +\gdef\@notdefinable{% +% \@latex@error{% +% Command \@backslashchar\reserved@a\space +% already defined.\MessageBreak +% Or name \@backslashchar\@qend... illegal, +% see p.192 of the manual}\@eha} +% \@autoerr\@notdefinable} +% \end{macrocode} +% \end{macro} +% +% \begin{macro}{\@nolnerr} +% Generated by |\newline| and |\\| when called in vertical mode. +% \begin{macrocode} +\gdef\@nolnerr{% +% \@latex@error{There's no line here to end}\@eha} +% \@autoerr\@nolnerr} +% \end{macrocode} +% \end{macro} +% +% \begin{macro}{\@nocounterr} +% \changes{v1.0h}{1994/04/17}{New name for error message, +% old error message (without arg) kept} +% Generated by |\setcounter|, |\addtocounter| or +% |\newcounter| if applied to an undefined counter \meta{cnt}. +% +% \begin{macro}{\@nocnterr} +% Obsolete error message generated in \LaTeX2.09 by +% |\setcounter|, |\addtocounter| or |\newcounter| +% for undefined counter. +% DO NOT use for \LaTeXe\ it MIGHT vanish! +% Use |\@nocounterr|\marg{cnt} instead. +% \begin{macrocode} +\gdef\@nocounterr#1{% +% \@latex@error{No counter '#1' defined}\@eha} +% \@autoerr\@nocounterr} +\gdef\@nocnterr{\@nocounterr?} +% \end{macrocode} +% \end{macro} +% \end{macro} +% +% \begin{macro}{\@ctrerr} +% Called when trying to print the value of a counter +% numbered by letters that's greater than 26. +% \begin{macrocode} +\gdef\@ctrerr{% +% \@latex@error{Counter too large}\@ehb} +% \@autoerr\@ctrerr} +% \end{macrocode} +% \end{macro} +% +% \begin{macro}{\@nodocument} +% Error produced if paragraphs are typeset in the preamble. +% \changes{v1.2m}{1996/11/04}{Always define \cs{@nodocument} +% in kernel, so that it can be cleared by \cs{document}.} +% \begin{macrocode} +%\gdef\@nodocument{% +% \@latex@error{Missing \protect\begin{document}}\@ehd} +% \end{macrocode} +% \end{macro} +% +% \begin{macro}{\@badend} +% Called by |\end| that doesn't match its |\begin|. +% RmS 1992/08/24: added code to |\@badend| to display position of +% non-matching |\begin|. +% FMi 1993/01/14: missing space added. +% \begin{macrocode} +\gdef\@badend#1{% +% \@latex@error{\protect\begin{\@currenvir}\@currenvline +% \space ended by \protect\end{#1}}\@eha} +% \@autoerr\@badend} +% \end{macrocode} +% \end{macro} +% +% \begin{macro}{\@badmath} +% Called by |\[|, |\]|, |\(| or |\)| when used in wrong mode. +% \begin{macrocode} +\gdef\@badmath{% +% \@latex@error{Bad math environment delimiter}\@eha} +% \@autoerr\@badmath} +% \end{macrocode} +% \end{macro} +% +% \begin{macro}{\@toodeep} +% Called by a list environment nested more than six levels +% deep, or an enumerate or itemize nested more than four levels. +% \begin{macrocode} +\gdef\@toodeep{% +% \@latex@error{Too deeply nested}\@ehd} +% \@autoerr\@toodeep} +% \end{macrocode} +% \end{macro} +% +% \begin{macro}{\@badpoptabs} +% Called by |\endtabbing| when not enough |\poptabs| have +% occurred, or by |\poptabs| when too many have occurred. +% \begin{macrocode} +\gdef\@badpoptabs{% +% \@latex@error{\protect\pushtabs\space and \protect\poptabs +% \space don't match}\@ehd} +% \@autoerr\@badpoptabs} +% \end{macrocode} +% \end{macro} +% +% \begin{macro}{\@badtab} +% Called by |\>|, |\+| , |\-| or |\<| when stepping to an undefined tab. +% \begin{macrocode} +\gdef\@badtab{% +% \@latex@error{Undefined tab position}\@ehd} +% \@autoerr\@badtab} +% \end{macrocode} +% \end{macro} +% +% \begin{macro}{\@preamerr} +% \changes{v1.2k}{1995/10/24} +% {Modify autoload support} +% This error is special: it appears in places where we normally have +% to |\protect| expansions. However, to prevent a protection of +% the error message itself (which would result in the message +% getting printed not issued on the terminal) we need to locally +% reset |\protect| to |\relax|. +% \begin{macrocode} +\gdef\@preamerr#1{% + \begingroup + \let\protect\relax +%<*!autoload> + \@latex@error{\ifcase #1 Illegal character\or + Missing @-exp\or Missing p-arg\fi\space + in array arg}\@ehd +% +% \@autoerr\@preamerr{#1}% + \endgroup} +% \end{macrocode} +% \end{macro} +% +% \begin{macro}{\@badlinearg} +% Occurs in |\line| and |\vector| command when a bad slope +% argument is encountered. +% \begin{macrocode} +\gdef\@badlinearg{% +% \@latex@error{% +% Bad \protect\line\space or \protect\vector +% \space argument}\@ehb} +% \@autoerr\@badlinearg} +% \end{macrocode} +% \end{macro} +% +% \begin{macro}{\@parmoderr} +% Occurs in a float environment or a |\marginpar| when +% encountered in inner vertical mode. +% \begin{macrocode} +\gdef\@parmoderr{% +% \@latex@error{Not in outer par mode}\@ehb} +% \@autoerr\@parmoderr} +% \end{macrocode} +% \end{macro} +% +% \begin{macro}{\@fltovf} +% Occurs in float environment or |\marginpar| when there +% are no more free boxes for storing floats. +% \begin{macrocode} +\gdef\@fltovf{% +% \@latex@error{Too many unprocessed floats}\@ehb} +% \@autoerr\@fltovf} +% \end{macrocode} +% \end{macro} +% +% \begin{macro}{\@latexbug} +% Occurs in output routine. This is bad news. +% \begin{macrocode} +\gdef\@latexbug{% +% \@latex@error{This may be a LaTeX bug}{Call for help}} +% \@autoerr\@latexbug} +% \end{macrocode} +% \end{macro} +% +% \begin{macro}{\@badcrerr} +% This error was removed and replaced by |\@nolnerr|. +% \changes{v1.0m}{1994/05/04}{Error message removed} +% \begin{macrocode} +%\def\@badcrerr {\@latex@error{Bad use of \protect\\}\@ehc} +% \end{macrocode} +% \end{macro} +% +% \begin{macro}{\@noitemerr} +% |\addvspace| or |\addpenalty| was called when not in +% vmode. Probably caused by a missing |\item|. +% \begin{macrocode} +\gdef\@noitemerr{% +% \@latex@error{Something's wrong--perhaps a missing % +% \protect\item}\@ehc} +% \@autoerr\@noitemerr} +% \end{macrocode} +% \end{macro} +% +% \begin{macro}{\@notprerr} +% A command that can be used only in the preamble +% appears after the command |\begin{document}|. +% \begin{macrocode} +\gdef\@notprerr{% +% \@latex@error{Can be used only in preamble}\@eha} +% \@autoerr\@notprerr} +% \end{macrocode} +% \end{macro} +% +% \begin{macro}{\@inmatherr} +% \changes{v1.0j}{1994/04/28}{Macro added} +% \changes{v1.1c}{1994/04/28}{Replaced \cs{noexpand} with \cs{protect}.} +% Issued by commands that don't work correctly within math (like +% |\item|). There is no real error recovery happening, e.g., the +% user might get additional errors afterwards. +% \begin{macrocode} +\gdef\@inmatherr#1{% + \relax + \ifmmode +% \@latex@error{Command \protect#1 invalid in math mode}\@ehc +% \@autoerr\@inmatherr#1% + \fi} +% \end{macrocode} +% \end{macro} +% +% \begin{macro}{\@invalidchar} +% \changes{LaTeX2.09}{1993/09/19} +% {(RmS) Error message for invalid input characters.} +% \changes{v1.0d}{1994/03/28} +% {(DPC) Comment out (use catcode15 instead)} +% An error for use with invalid characters. This is commented +% out, since we decided to use chatcode 15 instead. +% \begin{macrocode} +%\def\@invalidchar{\@latex@error{Invalid character in input}\@ehc} +% \end{macrocode} +% \end{macro} +% +% As well as the above error commands some error messages are directly +% coded to save space. The Messages alrerady present in \LaTeX2.09 +% included: +% +% |Environment --- undefined|\\ +% Issued by |\begin| for undefined environment. +% +% |tab overflow|\\ +% Occurs in |\= when| maximum number of tabs exceeded. +% +% |\< in mid line|\\ +% Occurs in |\<| when it appears in middle of line. +% +% |Float(s) lost|\\ +% In output routine, caused by a float environment or +% |\marginpar| occurring in inner vertical mode. +% +%\Finale +\endinput diff --git a/Master/texmf-dist/source/latex/base/ltfiles.dtx b/Master/texmf-dist/source/latex/base/ltfiles.dtx new file mode 100644 index 00000000000..4df0e8dc266 --- /dev/null +++ b/Master/texmf-dist/source/latex/base/ltfiles.dtx @@ -0,0 +1,862 @@ +% \iffalse meta-comment +% +% Copyright 1993 1994 1995 1996 1997 1998 1999 2000 2001 2002 2003 2004 +% The LaTeX3 Project and any individual authors listed elsewhere +% in this file. +% +% This file is part of the LaTeX base system. +% ------------------------------------------- +% +% It may be distributed and/or modified under the +% conditions of the LaTeX Project Public License, either version 1.3 +% of this license or (at your option) any later version. +% The latest version of this license is in +% http://www.latex-project.org/lppl.txt +% and version 1.3 or later is part of all distributions of LaTeX +% version 2003/12/01 or later. +% +% This file has the LPPL maintenance status "maintained". +% +% The list of all files belonging to the LaTeX base distribution is +% given in the file `manifest.txt'. See also `legal.txt' for additional +% information. +% +% The list of derived (unpacked) files belonging to the distribution +% and covered by LPPL is defined by the unpacking scripts (with +% extension .ins) which are part of the distribution. +% +% \fi +% +% \iffalse +%%% From File: ltfiles.dtx +%<*driver> +% \fi +\ProvidesFile{ltfiles.dtx} + [1997/10/06 v1.1l LaTeX Kernel (File Handling)] +% \iffalse +\documentclass{ltxdoc} +\GetFileInfo{ltfiles.dtx} +\title{\filename} +\date{\filedate} + \author{% + Johannes Braams\and + David Carlisle\and + Alan Jeffrey\and + Leslie Lamport\and + Frank Mittelbach\and + Chris Rowley\and + Rainer Sch\"opf} + +\begin{document} +\maketitle + \DocInput{\filename} +\end{document} +% +% \fi +% +% \CheckSum{572} +% +% \changes{v1.0h}{1994/05/21}{Use new error commands} +% \changes{v1.0n}{1994/11/17} +% {\cs{@tempa} to \cs{reserved@a}} +% \changes{v1.0u}{1995/07/13}{Updates to docu} +% +% \section{File Handling} +% +% The following user commands are defined in this part: +% +% \DescribeMacro{\document} (ie |\begin{document}|)\\ +% Reads in the .AUX files and |\catcode|'s |@| to 12. +% +% \DescribeMacro{\nofiles}\\ +% Suppresses all file output by setting |\@filesw| false. +% +% \DescribeMacro{\includeonly}\marg{NAME1, ... ,NAMEn}\\ +% Causes only parts NAME1, ... ,NAMEn to be read by +% their |\include| commands. Works by setting \@partsw true +% and setting |\@partlist| to NAME1, ... ,NAMEn. +% +% \DescribeMacro{\include}\marg{NAME}\\ +% Does an |\input| NAME unless |\@partsw| is true and +% NAME is not in |\@partlist|. If |\@filesw| is true, then +% it directs .AUX output to NAME.AUX, including a +% checkpoint at the end. +% +% \DescribeMacro{\input}\marg{NAME}\\ +% The same as TeX's |\input|, except it allows optional +% braces around the file name. In \LaTeXe, it also avoids +% the primitive `missing file' error, if the file can not be +% found. +% +% \DescribeMacro{\IfFileExists}\marg{NAME}\marg{then}\marg{else}\\ +% If the file exists on the system, execute \emph{then} otherwise +% execute \emph{else}. +% +% \DescribeMacro{\InputIfFileExists}\marg{NAME}\marg{then}\marg{else}\\ +% If the file exists on the system, execute \emph{then} and input +% \emph{NAME} otherwise execute \emph{else}. +% +% \StopEventually{} +% +% \changes{v1.0a}{1994/03/07}{Initial version, split from latex.dtx} +% \changes{v1.0a}{1994/03/07}{Long lines wrapped to 72 columns} +% +% \begin{oldcomments} +% +% \begin{macrocode} +%<*2ekernel|autoload> +\message{files,} +% \end{macrocode} +% +% VARIABLES, SWITCHES AND INTERNAL COMMANDS: +% \@mainaux : Output file number for main .AUX file. +% \@partaux : Output file number for current part's .AUX file. +% \@auxout : Either \@mainout or \@partout, depending on +% which .AUX file output goes to. +% \@input{foo} : If file foo exists, then \input's it, +% otherwise types a warning message. +% @filesw : Switch -- set false if no .AUX, .TOC, .IDX etc +% files are to be written +% @partsw : Set true by a \includeonly command. +% \@partlist : Set to the argument of the \includeonly command. +% +% \cp@FOO : The checkpoint for \include'd file FOO.TEX, written +% by \@writeckpt at the end of file FOO.AUX +% +% +% \includeonly{FILELIST} == +% BEGIN +% \@partsw := T +% \@partlist := FILELIST +% END +% +% \include{FILE} == +% BEGIN +% \clearpage +% if \@filesw = T +% then \immediate\write\@mainaux{\string\@input{FILE.AUX}} +% fi +% if \@partsw = T +% then \@tempswa := F +% \reserved@b == FILE +% for \reserved@a := \@partlist +% do if eval(\reserved@a) = eval(\reserved@b) +% then \@tempswa := T fi +% od +% fi +% +% if \@tempswa = T +% then \@auxout := \@partaux +% if \@filesw = T +% then \immediate\openout\@partaux{FILE.AUX} +% \immediate\write\@partaux{\relax} +% fi +% \@input{FILE.TEX} +% \clearpage +% \@writeckpt{FILE} +% if @filesw then \closeout \@partaux fi +% \@auxout := \@mainaux +% else \cp@FILE +% fi +% END +% +% \@writeckpt{FILE} == +% BEGIN +% if \@filesw = T +% \immediate\write on file \@partaux: +% \@setckpt{FILE}{ %% } +% for \reserved@a := \cl@@ckpt +% do \immediate\write on file \@partaux: +% \global\string\setcounter +% {eval(\reserved@a)}{eval(\c@eval(\reserved@a))} +% od %% { +% \immediate\write on file \@partaux: } +% fi +% END +% +% \@setckpt{FILE}{LIST} == +% BEGIN +% G \cp@FILE := LIST +% END +% +% INITIALIZATION +% \@tempswa := T +% +% \end{oldcomments} +% +% +% \task{???}{Do we use @unused or mainaux?} +% \begin{macro}{\@inputcheck} +% \begin{macro}{\@unused} +% Allocate read stream for testing and output stream. +% \changes{v1.0l}{1994/11/07} +% {move here from ltdefns, remove duplicate \cs{@mainaux}} +% \begin{macrocode} +\newread\@inputcheck +\newwrite\@unused +% \end{macrocode} +% \end{macro} +% \end{macro} +% +% \begin{macro}{\@mainaux} +% \begin{macro}{\@partaux} +% \begin{macrocode} +\newwrite\@mainaux +\newwrite\@partaux +% \end{macrocode} +% \end{macro} +% \end{macro} +% +% \begin{macro}{\if@filesw} +% \begin{macro}{\if@partsw} +% \begin{macrocode} +\newif\if@filesw \@fileswtrue +\newif\if@partsw \@partswfalse +% \end{macrocode} +% \end{macro} +% \end{macro} +% +% \begin{macro}{\@clubpenalty} +% This stores the current normal (non-infinite) value of +% \cs{clubpenalty}; it should therefore be reset whenever the +% normal value is changed (as in the bibliography in the standard +% styles). +% \changes{v1.1h}{1996/10/05}{Added setting its value} +% \begin{macrocode} +\newcount\@clubpenalty +\@clubpenalty \clubpenalty +% \end{macrocode} +% \end{macro} +% +% \begin{macro}{\document} +% \changes{v0.9e}{1993/12/09}{Hook added} +% Cancel the |\begingroup| from |\begin| +% \begin{macrocode} +\def\document{\endgroup +% \end{macrocode} +% If some options on |\documentclass| haven't been used by any +% package we will now give a warning since this is most certainly a +% misspelling. +% \begin{macrocode} + \ifx\@unusedoptionlist\@empty\else + \@latex@warning@no@line{Unused global option(s):^^J% + \@spaces[\@unusedoptionlist]}% + \fi + \@colht\textheight + \@colroom\textheight \vsize\textheight + \columnwidth\textwidth + \@clubpenalty\clubpenalty + \if@twocolumn + \advance\columnwidth -\columnsep + \divide\columnwidth\tw@ \hsize\columnwidth \@firstcolumntrue + \fi + \hsize\columnwidth \linewidth\hsize + \begingroup\@floatplacement\@dblfloatplacement + \makeatletter\let\@writefile\@gobbletwo +% \end{macrocode} +% \changes{v1.1a}{1995/10/24} +% {Removed multiplelabels switch} +% \begin{macrocode} + \global \let \@multiplelabels \relax + \@input{\jobname.aux}% + \endgroup + \if@filesw + \immediate\openout\@mainaux\jobname.aux + \immediate\write\@mainaux{\relax}% + \fi +% \end{macrocode} +% +% Dateline 1991/03/26: FMi added |\process@table| to support NFSS; +% This will also work with old lfonts if no other style defines +% |\process@table|. The following line forces the initialization of +% the math fonts. +% \begin{macrocode} + \process@table + \let\glb@currsize\@empty %% Force math initialization. +% \end{macrocode} +% \changes{v0.9t}{1994/01/31} +% {set \cs{@normalsize} or \cs{normalsize} if necessary} +% \changes{v1.0d}{1994/03/28} +% {(DPC) remove \cs{@normalsize check}} +% \changes{v1.0d}{1994/03/28} +% {(DPC) Use \cs{normalsize} not \cs{@normalsize}} +% \changes{v1.0g}{1994/05/13}{Added execution of \cs{every@size}} +% \changes{v1.0m}{1994/11/07}{Renamed \cs{every@size} to +% \cs{every@math@size}.} +% \changes{v1.0q}{1995/04/25} +% {Removed execution of \cs{every@size} latex/1407} +% \begin{macrocode} + \normalsize + \everypar{}% +% \end{macrocode} +% +% So that punctuation in headings is not disturbed by verbatim +% or other local changes to the space factor codes, save the document +% default here. This will be locally reset by the output routine. +% For special cases a class may want to define |\normalsfcodes| +% directly, in case that definition will be used. +% (This is an old bug, problem existed in \LaTeX2.0x and plain \TeX.) +% \changes{v1.1k}{1997/04/14} +% {Set the document space factor defaults. latex/2404} +% \begin{macrocode} + \ifx\normalsfcodes\@empty + \ifnum\sfcode`\.=\@m + \let\normalsfcodes\frenchspacing + \else + \let\normalsfcodes\nonfrenchspacing + \fi + \fi +% \end{macrocode} +% Way back in 1991 (08/26) FMi \& RmS set the |\@noskipsec| switch +% to true in the preamble and to false here. +% This was done to trap lists and related text in the preamble but it +% does not catch everything; hence Change 1.1g was introduced. +% \begin{macrocode} + \@noskipsecfalse +% \end{macrocode} +% \changes{v1.1a}{1995/10/24} +% {Removed refundefined switch} +% \begin{macrocode} + \let \@refundefined \relax +% \end{macrocode} +% Just before disabling the preamble commands we execute the begin +% document hook which contains any code contributed by +% |\AtBeginDocument|. Also disable the gathering of the file list, +% if no |\listfiles| has been issued. |\AtBeginDocument| is redefined +% at this point so that and such commands that get into the hook do +% not chase their tail\ldots +% \changes{v1.1e}{1996/04/24} +% {(DPC) Reset \cs{AtBeginDocument} eg for latex/1297} +% \begin{macrocode} + \let\AtBeginDocument\@firstofone + \@begindocumenthook +% \end{macrocode} +% Most of the following assignments will be done globally in case +% the user adds something like |\begin{multicols}| to the document +% hook, i.e. starts are group in |\begin{document}|. +% \changes{v1.0r}{1995/04/27} +% {Added \cs{global} to support groups in hook} +% \changes{v1.0c}{1994/03/16} +% {(DPC) directly add file list settings} +% \changes{v1.0v}{1995/08/16}{set \cs{topskip} globally} +% \changes{v1.0v}{1995/08/16}{set \cs{@maxdepth}} +% +% \changes{v1.0s}{1995/05/25} +% {Added check for \cs{topskip} zero} +% \changes{v1.0t}{1995/05/25} +% {Corrected typo} +% Since a value of exactly 0pt for \cs{topskip} causes +% \cs{twocolumn[]} to misbehave, we add this check, hoping +% that it will not cause any problems elsewhere. +% \begin{macrocode} + \ifdim\topskip<1sp\global\topskip 1sp\relax\fi + \global\@maxdepth\maxdepth + \global\let\@begindocumenthook\@undefined + \ifx\@listfiles\@undefined + \global\let\@filelist\relax + \global\let\@addtofilelist\@gobble + \fi +% \end{macrocode} +% At the very end we disable all preamble commands. This has to +% happen after the begin document hooks was executed so that this +% hook can still use such commands. +% \changes{v0.9o}{1994/01/15} +% {move \cs{@preamblecmds} after document hook} +% \changes{v1.0v}{1995/08/16}{set \cs{do} globally} +% \begin{macrocode} + \gdef\do##1{\global\let ##1\@notprerr}% + \@preamblecmds +% \end{macrocode} +% The next line saves tokens and also allows |\@nodocument| to be +% used directly to trap preamble errors. +% \changes{v1.1g}{1996/09/29}{Added disabling of \cs{@nodocument}} +% \begin{macrocode} + \global\let \@nodocument \relax +% \end{macrocode} +% The next line is a pure safety measure in case a do list is ever +% expanded at the wrong place. In addition it will save a few +% tokens to get rid of the above definition. +% \begin{macrocode} + \global\let\do\noexpand +% \end{macrocode} +% \changes{v1.1c}{1995/12/05}{\cs{ignorespaces} added for latex/1933} +% Use of |\AtBeginDocument| hook might mean that we are already in +% horizontal mode, so ignore the space after |\begin{document}|. +% \begin{macrocode} + \ignorespaces} +% \end{macrocode} +% +% \begin{macrocode} +\@onlypreamble\document +% \end{macrocode} +% \end{macro} +% +% \begin{macro}{\normalsfcodes} +% \changes{v1.1k}{1997/04/14} +% {Macro added (from patch file) latex/2404} +% The setting of |\@empty| is just a flag. This command may be defined +% in a class or package file. If it is still |\@empty| at +% |\begin{document}| it will be defined to be |\frenchspacing| or +% |\nonfrenchspacing|, depending on which of those appears to be in +% effect at that point. +% \begin{macrocode} +\let\normalsfcodes\@empty +% \end{macrocode} +% \end{macro} +% +% \begin{macro}{\nofiles} +% \changes{v1.0k}{1994/11/04} +% {Added setting of \cs{protected@write}, +% \cs{makeindex} and \cs{makeglossary} to \cs{nofiles}. ASAJ.} +% \changes{v1.0o}{1994/11/30} +% {There is no \cs{@gobblethree}\ldots} +% \changes{v1.0t}{1995/05/25} +% {(CAR) added \cs{long}} +% \changes{v1.1f}{1996/05/17} +% {added \cs{write} to \cs{protected@write} for latex/2146} +% Set |\@fileswfalse| which suppresses the places where \LaTeX\ makes +% |\immediate| writes. The |\makeindex| and |\makeglossary| are +% disabled. |\protected@write| is redefined not to write to the file +% specified, but rather to write a blank line to the log file. This +% ensures that a \meta{whatsit} node is still created, and so spacing +% is not affected by the |\nofiles| command; to ensure this more +% generally, the |\if@nobreak| test is needed. +% \changes{v1.1i}{1996/11/05} +% {Standard \cs{if@nobreak} test added} +% \begin{macrocode} +\def\nofiles{% + \@fileswfalse + \typeout{No auxiliary output files.^^J}% + \long\def\protected@write##1##2##3% + {\write\m@ne{}\if@nobreak\ifvmode\nobreak\fi\fi}% + \let\makeindex\relax + \let\makeglossary\relax} +\@onlypreamble\nofiles +% \end{macrocode} +% \end{macro} +% +% +% \begin{macro}{\protected@write} +% This takes three arguments: an output stream, some initialization +% code, and some text to write. It then writes this, with +% appropriate handling of |\protect| and |\thepage|. +% \changes{v1.0k}{1994/11/04}{Macro added ASAJ.} +% \changes{v1.0t}{1995/05/25} +% {(CAR) added \cs{long}} +% \begin{macrocode} +\long\def \protected@write#1#2#3{% + \begingroup + \let\thepage\relax + #2% + \let\protect\@unexpandable@protect + \edef\reserved@a{\write#1{#3}}% + \reserved@a + \endgroup + \if@nobreak\ifvmode\nobreak\fi\fi +} +% \end{macrocode} +% \end{macro} +% +% \begin{macrocode} +\let\@auxout=\@mainaux +% \end{macrocode} +% +% +% \begin{macro}{\includeonly} +% \changes{v1.0p}{1995/04/22}{Allow blanks in argument} +% \begin{macrocode} +\def\includeonly#1{% + \@partswtrue + \edef\@partlist{\zap@space#1 \@empty}} +\@onlypreamble\includeonly +% \end{macrocode} +% \end{macro} +% +% \begin{macro}{\include} +% \changes{v0.9p}{1994/01/18} +% {Use \cs{@input@} so include files are listed.} +% In the definition of |\include|, |\def\reserved@b| changed to +% |\edef\reserved@b| to be consistent with the |\edef| in +% |\includeonly|. +% (Suggested by Rainer Sch\"opf \& Frank Mittelbach. +% Change made 20 Jul 88.) +% +% Changed definition of |\include| to allow space at end of file name +% --- otherwise, typing |\include{foo }| would cause \LaTeX\ to +% overwrite |foo.tex|. Change made 24 May 89, suggested by Rainer +% Sch\"opf and Frank Mittelbach +% +% Made |\include| check for being used inside an |\include|'d file, as +% this will not work and cause surprising results. +% \begin{macrocode} +\def\include#1{\relax + \ifnum\@auxout=\@partaux + \@latex@error{\string\include\space cannot be nested}\@eha + \else \@include#1 \fi} +% \end{macrocode} +% \end{macro} +% +% \begin{macro}{\@include} +% \begin{macrocode} +\def\@include#1 {% + \clearpage + \if@filesw + \immediate\write\@mainaux{\string\@input{#1.aux}}% + \fi + \@tempswatrue + \if@partsw + \@tempswafalse + \edef\reserved@b{#1}% + \@for\reserved@a:=\@partlist\do + {\ifx\reserved@a\reserved@b\@tempswatrue\fi}% + \fi + \if@tempswa + \let\@auxout\@partaux + \if@filesw + \immediate\openout\@partaux #1.aux + \immediate\write\@partaux{\relax}% + \fi + \@input@{#1.tex}% + \clearpage + \@writeckpt{#1}% + \if@filesw + \immediate\closeout\@partaux + \fi + \else +% \end{macrocode} +% If the file is not included, reset |\deadcycles|, so that a long +% list of non-included files does not generate an `Output loop' +% error. +% \changes{v1.1j}{1997/01/08}{reset \cs{deadcycles} latex/2365} +% \begin{macrocode} + \deadcycles\z@ + \@nameuse{cp@#1}% + \fi + \let\@auxout\@mainaux} +% \end{macrocode} +% \end{macro} +% +% \begin{macro}{\@writeckpt} +% \begin{macrocode} +\def\@writeckpt#1{% + \if@filesw + \immediate\write\@partaux{\string\@setckpt{#1}\@charlb}% + {\let\@elt\@wckptelt \cl@@ckpt}% + \immediate\write\@partaux{\@charrb}% + \fi} +% \end{macrocode} +% \end{macro} +% +% \begin{macro}{\@wckptelt} +% \begin{macrocode} +\def\@wckptelt#1{% + \immediate\write\@partaux{% + \string\setcounter{#1}{\the\@nameuse{c@#1}}}} +% \end{macrocode} +% \end{macro} +% +% \begin{macro}{\@setckpt} +% RmS 93/08/31: introduced |\@setckpt| +% \begin{macrocode} +\def\@setckpt#1{\global\@namedef{cp@#1}} +% \end{macrocode} +% \end{macro} +% +% \begin{macro}{\@charlb} +% \begin{macro}{\@charrb} +% The following defines |\@charlb| and |\@charrb| to be |{| and |}|, +% respectively with |\catcode| 11. +% \begin{macrocode} +{\catcode`[=1 \catcode`]=2 +\catcode`{=11 \catcode`}=11 +\gdef\@charlb[{] +\gdef\@charrb[}] +]% }brace matching +% \end{macrocode} +% \end{macro} +% \end{macro} +% +% +% \subsection{Safe Input Macros} +% +% \begin{macro}{\IfFileExists} +% \changes{v0.9b}{1993/12/04}{Macro added} +% \changes{v0.9p}{1994/01/18}{New Definition} +% \changes{v1.0t}{1995/05/25} +% {(CAR) added \cs{long}} +% +% \begin{macrocode} +\long\def \IfFileExists#1#2#3{% + \openin\@inputcheck#1 % + \ifeof\@inputcheck + \ifx\input@path\@undefined + \def\reserved@a{#3}% + \else + \def\reserved@a{\@iffileonpath{#1}{#2}{#3}}% + \fi + \else + \closein\@inputcheck + \edef\@filef@und{#1 }% + \def\reserved@a{#2}% + \fi + \reserved@a} +% \end{macrocode} +% +% \begin{macro}{\@iffileonpath} +% If the file is not found by |\openin|, and |\input@path| is defined, +% look in all the directories specified in |\input@path|. +% \changes{v0.9p}{1994/01/18}{Macro added} +% \changes{v1.0f}{1994/05/02} +% {\cs{@break@loop} renamed to \cs{@break@tfor}} +% \changes{v1.0t}{1995/05/25} +% {(CAR) added \cs{long}} +% \changes{v1.1d}{1996/01/10} +% {Change argument handling to not require doubled hash. latex/2024} +% \begin{macrocode} +\long\def\@iffileonpath#1{% + \let\reserved@a\@secondoftwo + \expandafter\@tfor\expandafter\reserved@b\expandafter + :\expandafter=\input@path\do{% + \openin\@inputcheck\reserved@b#1 % + \ifeof\@inputcheck\else + \edef\@filef@und{\reserved@b#1 }% + \let\reserved@a\@firstoftwo% + \closein\@inputcheck + \@break@tfor + \fi}% + \reserved@a} +% \end{macrocode} +% \end{macro} +% \end{macro} +% +% \begin{macro}{\InputIfFileExists} +% \changes{v0.9b} +% {1993/12/04}{Macro added} +% \changes{v0.9p} +% {1994/01/18}{New Definition} +% \changes{v0.3b}{1994/03/13} +% {Use new cmd \cs{@addtofilelist}} +% Now define |\InputIfFileExists| to input |#1| if it seems to exist. +% Immediately prior to the input, |#2| is executed. +% If the file |#1| does not exist, execute `|#3|'. +% \changes{v1.0t}{1995/05/25} +% {(CAR) added \cs{long}} +% \begin{macrocode} +\long\def \InputIfFileExists#1#2{% + \IfFileExists{#1}% + {#2\@addtofilelist{#1}\@@input \@filef@und}} +% \end{macrocode} +% \end{macro} +% +% \begin{macro}{\input} +% Input a file: if the argument is given in braces use safe input +% macros, otherwise use \TeX's primitive |\input| command (which is +% called |\@@input| in \LaTeX). +% \changes{v0.9b}{1993/12/04}{Macro reimplemented} +% \begin{macrocode} +\def\input{\@ifnextchar\bgroup\@iinput\@@input} +% \end{macrocode} +% \end{macro} +% +% \begin{macro}{\@iinput} +% Define |\@iinput| (i.e., |\input|) in terms of +% |\InputIfIfileExists|. +% \changes{v0.9b}{1993/12/04}{Macro reimplemented} +% \begin{macrocode} +\def\@iinput#1{% + \InputIfFileExists{#1}{}% + {\filename@parse{#1}% + \edef\reserved@a{\noexpand\@missingfileerror + {\filename@area\filename@base}% + {\ifx\filename@ext\relax tex\else\filename@ext\fi}}% + \reserved@a}} +% \end{macrocode} +% \end{macro} +% +% \begin{macro}{\@input} +% \changes{v0.9b}{1993/12/04}{Macro reimplemented} +% \changes{v0.9p}{1994/01/18}% +% {do not use a different definition for \cs{input@path}} +% Define |\@input| in terms of |\IfIfileExists|. +% So this is a `safe input' command, but the files input are not +% listed by |\listfiles|. +% +% We don't want |.aux|, |.toc| files etc be listed by |\listfiles|. +% However, something like |.bbl| probably should be listed and thus +% should be implemented not by |\@input|. +% \begin{macrocode} +\def\@input#1{% + \IfFileExists{#1}{\@@input\@filef@und}{\typeout{No file #1.}}} +% \end{macrocode} +% \end{macro} +% +% \begin{macro}{\@input@} +% \changes{v0.9p}{1994/01/18}{Macro added} +% \task{???}{share code with `@input ?} +% Version of |\@input| that does add the file to |\@filelist|. +% \begin{macrocode} +\def\@input@#1{\InputIfFileExists{#1}{}{\typeout{No file #1.}}} +% \end{macrocode} +% \end{macro} +% +% \begin{macro}{\@missingfileerror} +% This `error' command avoids \TeX's primitive missing file loop. +% +% Missing file error. Prompt for a new filename, offering a default +% extension. +% \changes{LaTeX2e}{1993/11/21} +% {Stop infinite looping on \cs{@er@ext}} +% \changes{LaTeX2e}{1993/11/28} +% {Use filename parser from dircheck} +% \changes{LaTeX2e}{1994/03/15} +% {Quit on x or X just like a real error} +% \changes{LaTeX2e}{1994/05/26} +% {Modify message format} +% \changes{v1.0j}{1994/11/03} +% {Move here from ltclass} +% \changes{v1.0w}{1995/10/06} +% {Autoload error} +% \begin{macrocode} +%\def\@missingfileerror{\@autoerr\@missingfileerror} +% +%<*2ekernel|autoerr> +\gdef\@missingfileerror#1#2{% + \typeout{^^J! LaTeX Error: File `#1.#2' not found.^^J^^J% + Type X to quit or to proceed,^^J% + or enter new name. (Default extension: #2)^^J}% + \message{Enter file name: }% + {\endlinechar\m@ne + \global\read\m@ne to\@gtempa}% + \ifx\@gtempa\@empty + \else + \def\reserved@a{x}\ifx\reserved@a\@gtempa\batchmode\@@end\fi + \def\reserved@a{X}\ifx\reserved@a\@gtempa\batchmode\@@end\fi + \filename@parse\@gtempa + \edef\filename@ext{% + \ifx\filename@ext\relax#2\else\filename@ext\fi}% + \edef\reserved@a{% + \noexpand\InputIfFileExists + {\filename@area\filename@base.\filename@ext}% + {}% + {\noexpand\@missingfileerror + {\filename@area\filename@base}{\filename@ext}}}% + \reserved@a + \fi} +% +%<*2ekernel|autoload> +% \end{macrocode} +% \end{macro} +% +% \begin{macro}{\@obsoletefile} +% For compatibility with \LaTeX~2.09 document styles, we distribute +% files called |article.sty|, |book.sty|, |report.sty|, +% |slides.sty| and |letter.sty|. These use the command +% |\@obsoletefile|, which produces a warning message. +% \changes{v0.9m}{1993/12/20}{Added this command, removed +% @oldfilewarning} +% \changes{v1.0f}{1994/05/02}{Make \cs{@onlypreamble}} +% \begin{macrocode} +\def\@obsoletefile#1#2{% + \@latex@warning@no@line{inputting `#1' instead of obsolete `#2'}} +\@onlypreamble\@obsoletefile +% \end{macrocode} +% +% \subsection{Listing files} +% +% \begin{macro}{\@filelist} +% A list of files input so far. The initial value of |\@gobble| eats +% the comma before the first file name. +% \begin{macrocode} +\let\@filelist\@gobble +% \end{macrocode} +% \end{macro} +% +% \begin{macro}{\@addtofilelist} +% Add to the list of files input so far. +% \changes{LaTeX2e}{1994/03/13} +% {Macro added} +% \changes{LaTeX2e}{1995/10/01} +% {Macro added} +% This `real' definition is only used for `cfg' files during initex. +% An initial definition of |\@gobble| has already been set. +% \begin{macrocode} +%\def\@addtofilelist#1{\xdef\@filelist{\@filelist,#1}} +% \end{macrocode} +% \end{macro} +% +% \begin{macro}{\listfiles} +% A preamble command to cause |\end{document}| to list files input +% from the main file. +% \changes{LaTeX2e}{1993/11/22} +% {Removed checking for \cs{@unknownversion}} +% \changes{LaTeX2e}{1994/01/17} +% {New Version, adds `.tex' if needed, and lines up columns} +% \changes{LaTeX2e}{1994/05/13} +% {Stop \cs{listfiles} being run twice} +% \changes{v1.0i}{1994/10/18} +% {code moved here from ltclass} +% \begin{macrocode} +\def\listfiles{% + \let\listfiles\relax + \def\@listfiles##1##2##3##4##5##6##7##8##9\@@{% + \def\reserved@d{\\}% + \@tfor\reserved@c:=##1##2##3##4##5##6##7##8\do{% + \ifx\reserved@c\reserved@d + \edef\filename@area{ \filename@area}% + \fi}}% +% \end{macrocode} +% +% \changes{v1.0o}{1994/11/30} +% {Use \cs{@dofilelist}} +% \begin{macrocode} + \def\@dofilelist{% + \typeout{^^J *File List*}% + \@for\@currname:=\@filelist\do{% + \filename@parse\@currname + \edef\reserved@a{% + \filename@base.% + \ifx\filename@ext\relax tex\else\filename@ext\fi}% + \expandafter\let\expandafter\reserved@b + \csname ver@\reserved@a\endcsname + \expandafter\expandafter\expandafter\@listfiles\expandafter + \filename@area\filename@base\\\\\\\\\\\\\\\\\\\@@ + \typeout{% + \filename@area\reserved@a + \ifx\reserved@b\relax\else\@spaces\reserved@b\fi}}% + \typeout{ ***********^^J}}} +% \end{macrocode} +% +% \changes{LaTeX2e}{1994/03/13} +% {Reset \cs{@addtofilelist} at begin document} +% \changes{LaTeX2e}{1994/03/16} +% {Move this code directly into \cs{document}} +% The |\@filelist| will be de-activated if |\listfiles| does not +% appear in the preamble. |\begin{document}| contains code equivalent +% to the following: +%\begin{verbatim} +% \AtBeginDocument{% +% \ifx\@listfiles\@undefined +% \let\@filelist\relax +% \let\@addtofilelist\@gobble +% \fi} +%\end{verbatim} +% \begin{macrocode} +\@onlypreamble\listfiles +% \end{macrocode} +% \end{macro} +% +% \begin{macro}{\@dofilelist} +% \changes{v1.0o}{1994/11/30} +% {Macro added} +% \begin{macrocode} +\let\@dofilelist\relax +% \end{macrocode} +% \end{macro} +% +% \begin{macrocode} +% +% \end{macrocode} +% \end{macro} +% +% \Finale +% diff --git a/Master/texmf-dist/source/latex/base/ltfinal.dtx b/Master/texmf-dist/source/latex/base/ltfinal.dtx new file mode 100644 index 00000000000..3512b42a309 --- /dev/null +++ b/Master/texmf-dist/source/latex/base/ltfinal.dtx @@ -0,0 +1,631 @@ +% \iffalse meta-comment +% +% Copyright 1993 1994 1995 1996 1997 1998 1999 2000 2001 2002 2003 2004 +% The LaTeX3 Project and any individual authors listed elsewhere +% in this file. +% +% This file is part of the LaTeX base system. +% ------------------------------------------- +% +% It may be distributed and/or modified under the +% conditions of the LaTeX Project Public License, either version 1.3 +% of this license or (at your option) any later version. +% The latest version of this license is in +% http://www.latex-project.org/lppl.txt +% and version 1.3 or later is part of all distributions of LaTeX +% version 2003/12/01 or later. +% +% This file has the LPPL maintenance status "maintained". +% +% The list of all files belonging to the LaTeX base distribution is +% given in the file `manifest.txt'. See also `legal.txt' for additional +% information. +% +% The list of derived (unpacked) files belonging to the distribution +% and covered by LPPL is defined by the unpacking scripts (with +% extension .ins) which are part of the distribution. +% +% \fi +% +% \iffalse +%%% From File: ltfinal.dtx +% +%<*driver> +% \fi +\ProvidesFile{ltfinal.dtx} + [2003/10/13 v1.1e LaTeX Kernel (Final Settings)] +% \iffalse +\documentclass{ltxdoc} +\GetFileInfo{ltfinal.dtx} +\title{\filename} +\date{\filedate} +\author{% + Johannes Braams\and + David Carlisle\and + Alan Jeffrey\and + Leslie Lamport\and + Frank Mittelbach\and + Chris Rowley\and + Rainer Sch\"opf} +\begin{document} +\maketitle + \DocInput{ltfinal.dtx} +\end{document} +% +% \fi +% +% \CheckSum{472} +% +% \section{Final settings} +% This section contains the final settings for \LaTeX. It initialises +% some debugging and typesetting parameters, sets the default +% |\catcode|s and uc/lc codes, and inputs the hyphenation file. +% +% \StopEventually{} +% +% \changes{v0.1a}{1994/03/07}{Initial version, split from latex.dtx} +% \changes{v0.1a}{1994/03/07}{Remove oldcomments environment} +% \changes{v0.1c}{1994/04/21}{Added comments, set the catcodes of +% 128--255.} +% \changes{v0.1d}{1994/04/23}{Check that \cs{font@submax} is still zero} +% \changes{v0.1e}{1994/05/02}{Set all the catcodes} +% \changes{v0.1f}{1994/05/03}{Set the catcode of control-J to be +% `other', for use in messages.} +% \changes{v0.1g}{1994/05/05}{Added empty errhelp.} +% \changes{v0.1h}{1994/05/13}{Added package ot1enc, and defined +% \cs{@acci}, \cs{@accii} and \cs{@acciii}.} +% \changes{v0.1j}{1994/05/18}{Corrected the lccode for d-bar.} +% \changes{v0.1k}{1994/05/19}{Removed \cs{makeat...}} +% \changes{v1.0n}{1994/05/31}{Renamed lthyphen.* to lthyphen.*.} +% \changes{v1.0o}{1994/11/17} +% {\cs{@tempa} to \cs{reserved@a}} +% \changes{v1.0p}{1994/12/01} +% {Renamed lthyphen.* to hyphen.*.} +% \changes{v1.0r}{1995/06/05} +% {Added \cs{MakeUppercase} and \cs{MakeLowercase}.} +% \changes{v1.0s}{1995/06/06} +% {Made \cs{MakeUppercase} and \cs{MakeLowercase} brace their +% argument.} +% +% \subsection{Debugging} +% +% By default, \LaTeX{} shows statistics: +% \begin{macrocode} +%<*2ekernel> +\tracingstats1 +% \end{macrocode} +% +% \subsection{Typesetting parameters} +% +% \begin{macro}{\@lowpenalty} +% \begin{macro}{\@medpenalty} +% \begin{macro}{\@highpenalty} +% These are penalties used internally. +% \begin{macrocode} +\newcount\@lowpenalty +\newcount\@medpenalty +\newcount\@highpenalty +% \end{macrocode} +% \end{macro} +% \end{macro} +% \end{macro} +% The default values of the picture and |\fbox| parameters: +% \begin{macrocode} +\unitlength = 1pt +\fboxsep = 3pt +\fboxrule = .4pt +% \end{macrocode} +% The saved value of \TeX's |\maxdepth|: +% \begin{macrocode} +\@maxdepth = \maxdepth +% \end{macrocode} +% |\vsize| initialized because a |\clearpage| with |\vsize < \topskip| +% causes trouble. +% |\@colroom| and |\@colht| also initialized because |\vsize| may be +% set to them if a |\clearpage| is done before the |\begin{document}| +% +% \begin{macrocode} +\vsize = 1000pt +\@colroom = \vsize +\@colht = \vsize +% \end{macrocode} +% Initialise |\textheight| |\textwidth| and page style, to avoid +% internal errors if they are not set by the class. +% \changes{v0.1b}{1994/04/18} +% {Initialise \cs{textheight}, \cs{textwidth} and page style} +% \begin{macrocode} +\textheight=.5\maxdimen +\textwidth=\textheight +\ps@empty +% \end{macrocode} +% +% \subsection{Lccodes for hyphenation} +% +% \changes{v1.1b}{1998/05/20}{Set up lccodes before loading +% hyphenation files: pr/2639} +% We set things up so that hypehnation files can assume that the +% default (T1) lccodes are in use (at present this also sets up the +% uccodes). +% We temporarily define |\reserved@a| to apply |\reserved@c| to +% all the numbers in the range of its arguments. +% \begin{macrocode} +\def\reserved@a#1#2{% + \@tempcnta#1\relax + \@tempcntb#2\relax + \reserved@b +} +\def\reserved@b{% + \ifnum\@tempcnta>\@tempcntb\else + \reserved@c\@tempcnta + \advance\@tempcnta\@ne + \expandafter\reserved@b + \fi +} +% \end{macrocode} +% Depending on the \TeX{} version, we might not be allowed to do +% this for non-ASCII characters. +% \changes{v1.0n}{1994/06/09}{For \TeX2, do not set codes for higher +% half of character table.} +% \begin{macrocode} +\def\reserved@c#1{% + \count@=#1\advance\count@ by -"20 + \uccode#1=\count@ + \lccode#1=#1 +} +\reserved@a{`\a}{`\z} +\ifnum\inputlineno=\m@ne\else + \reserved@a{"A0}{"BC} + \reserved@a{"E0}{"FF} +\fi +% \end{macrocode} +% The upper case characters need their |\uccode| and |\lccode| values +% set, and their |\sfcode| set to 999. +% \begin{macrocode} +\def\reserved@c#1{% + \count@=#1\advance\count@ by "20 + \uccode#1=#1 + \lccode#1=\count@ + \sfcode#1=999 +} +\reserved@a{`\A}{`\Z} +\ifnum\inputlineno=\m@ne\else + \reserved@a{"80}{"9C} + \reserved@a{"C0}{"DF} +\fi +% \end{macrocode} +% Well, it would be nice if that were correct, but unfortunately, the +% Cork encoding contains some odd slots whose uccode or lccode isn't +% quite what you'd expect. +% \begin{macrocode} +\uccode`\^^Y=`\I % dotless i +\lccode`\^^Y=`\^^Y % dotless i +\uccode`\^^Z=`\J % dotless j, ae in OT1 +\lccode`\^^Z=`\^^Z % dotless j, ae in OT1 +\ifnum\inputlineno=\m@ne\else + \lccode`\^^9d=`\i % dotted I + \uccode`\^^9d=`\^^9d % dotted I + \lccode`\^^9e=`\^^9e % d-bar + \uccode`\^^9e=`\^^d0 % d-bar +\fi +% \end{macrocode} +% Finally here is one that helps hyphenation in the OT1 encoding. +% \changes{v1.0z}{1996/10/31} +% {Added extra \cs{lcode}, hoping it does no harm in T1 (pr/1969)} +% \begin{macrocode} +\lccode`\^^[=`\^^[ % oe in OT1 +% \end{macrocode} +% +% And we also set the |\lccode| of |\-| and |\textcompwordmark| so +% that they do not prevent hyphenation in the remainder of the word +% (as suggested by Lars Helstr\"om). +% \changes{v1.1e}{2003/10/13} +% {Added extra \cs{lccode} for \cs{-} and \cs{textcompwordmark}} +% \begin{macrocode} +\lccode`\- =`\- % default hyphen char +\lccode 127=127 % alternate hyphen char +\lccode 23 =23 % textcompwordmark in T1 +% \end{macrocode} +% +% \subsection{Hyphenation} +% +% \changes{v0.1a}{1994/03/07}{move code here from lhyphen.dtx} +% \changes{v0.1a}{1994/03/07} +% {use \cs{InputIfFileExists} not \cs{IfFileExists}} +% \changes{v1.0x}{1995/11/01} +% {(DPC) Switch meaning of \cs{@addtofilelist} for cfg files}% +% The following code will be compiled into the format file. It checks +% for the existance of \texttt{hyphen.cfg} in inputs that file if +% found. Otherwise it inputs \texttt{hyphen.ltx}. Note that these +% are loaded in \emph{before} the |\catcode|s are set, so local +% hyphenation files can use 8-bit input. +% +% We try to load the customized hyphenation description file. +% \begin{macrocode} +\InputIfFileExists{hyphen.cfg} + {\typeout{===========================================^^J% + Local configuration file hyphen.cfg used^^J% + ===========================================}% + \def\@addtofilelist##1{\xdef\@filelist{\@filelist,##1}}% + } + {\input{hyphen.ltx}} +\let\@addtofilelist\@gobble +% \end{macrocode} +% +% +% +% \subsection{Font loading} +% Fonts loaded during the formatting process might already have +% changed the |\font@submax| from |0pt| to something higher. +% If so, we put out a bold warning. +% \changes{v0.1l}{1994/05/20}{Use new font warning commands} +% \begin{macrocode} +% \changes{v1.1c}{2000/08/23}{Fix typo in warning} +\ifdim \font@submax >\z@ + \@font@warning{Size substitutions with differences\MessageBreak + up to \font@submax\space have occurred.\MessageBreak + \MessageBreak + Please check the transcript file + carefully\MessageBreak + and redo the format generation if necessary! + \@gobbletwo}% + \errhelp{Only stopped, to give you time to + read the above message.} + \errmessage{} +% \end{macrocode} +% We reset the macro. Otherwise every user will get a warning on +% every job. +% \begin{macrocode} +\def\font@submax{0pt} +\fi +% \end{macrocode} +% +% \subsection{Input encoding} +% +% We temporarily define |\reserved@a| to apply |\reserved@c| to all the +% numbers in the range of its arguments. +% \begin{macrocode} +\def\reserved@a#1#2{% + \@tempcnta#1\relax + \@tempcntb#2\relax + \reserved@b +} +\def\reserved@b{% + \ifnum\@tempcnta>\@tempcntb\else + \reserved@c\@tempcnta + \advance\@tempcnta\@ne + \expandafter\reserved@b + \fi +} +% \end{macrocode} +% \changes{v0.1e}{1994/05/02}{Added setting the special catcodes.} +% \changes{v0.1f}{1994/05/02}{Set the catcode of control-J.} +% Set the special catcodes (although some of these are useless, since an +% error will have occurred if the catcodes have changed). Note that +% |^^J| has catcode `other' for use in warning messages. +% \begin{macrocode} +\catcode`\ =10 +\catcode`\#=6 +\catcode`\$=3 +\catcode`\%=14 +\catcode`\&=4 +\catcode`\\=0 +\catcode`\^=7 +\catcode`\_=8 +\catcode`\{=1 +\catcode`\}=2 +\catcode`\~=13 +\catcode`\@=11 +\catcode`\^^I=10 +\catcode`\^^J=12 +\catcode`\^^L=13 +\catcode`\^^M=5 +% \end{macrocode} +% \changes{v0.1e}{1994/05/02}{Added setting the `other' catcodes.} +% Set the `other' catcodes. +% \begin{macrocode} +\def\reserved@c#1{\catcode#1=12\relax} +\reserved@c{`\!} +\reserved@c{`\"} +\reserved@a{`\'}{`\?} +\reserved@c{`\[} +\reserved@c{`\]} +\reserved@c{`\`} +\reserved@c{`\|} +% \end{macrocode} +% \changes{v0.1e}{1994/05/02}{Added setting the `letter' catcodes.} +% Set the `letter' catcodes. +% \begin{macrocode} +\def\reserved@c#1{\catcode#1=11\relax} +\reserved@a{`\A}{`\Z} +\reserved@a{`\a}{`\z} +% \end{macrocode} +% \changes{v0.1e}{1994/05/02}{Made slot 127 illegal} +% \changes{v1.0n}{1994/11/18} +% {re-allow slots 127--255} +% All the characters in the range 0--31 and 127--255 are illegal, +% \emph{except} tab (|^^I|), nl (|^^J|), ff (|^^L|) and cr (|^^M|). +% +% Now allow 8-bit characters, although their use in this way is +% strongly discouraged. See |inputenc.dtx| for a supported mechanism +% for 8-bit input. +% \begin{macrocode} +\def\reserved@c#1{\catcode#1=15\relax} +\reserved@a{0}{`\^^H} +\reserved@c{`\^^K} +\reserved@a{`\^^N}{31} +%\ifnum\inputlineno=\m@ne + \catcode"7F=15 +%\else +% \reserved@a{"7F}{"FF} +%\fi +% \end{macrocode} +% +% \subsection{Lccodes and uccodes} +% +% \changes{v1.1b}{1998/05/20}{Set up uc/lccodes after loading +% hyphenation files: pr/2639} +% We now again set up the default (T1) uc/lccodes. +% The lower case characters need their |\uccode| and |\lccode| values +% set. Some of this is a repeat of the set-up before loading +% hyphenation files. +% Depending on the \TeX{} version, we might not be allowed to do +% this for non-ASCII characters. +% \changes{v1.0n}{1994/06/09}{For \TeX2, do not set codes for higher +% half of character table.} +% \begin{macrocode} +\def\reserved@c#1{% + \count@=#1\advance\count@ by -"20 + \uccode#1=\count@ + \lccode#1=#1 +} +\reserved@a{`\a}{`\z} +\ifnum\inputlineno=\m@ne\else + \reserved@a{"A0}{"BC} + \reserved@a{"E0}{"FF} +\fi +% \end{macrocode} +% The upper case characters need their |\uccode| and |\lccode| values +% set, and their |\sfcode| set to 999. +% \begin{macrocode} +\def\reserved@c#1{% + \count@=#1\advance\count@ by "20 + \uccode#1=#1 + \lccode#1=\count@ + \sfcode#1=999 +} +\reserved@a{`\A}{`\Z} +\ifnum\inputlineno=\m@ne\else + \reserved@a{"80}{"9C} + \reserved@a{"C0}{"DF} +\fi +% \end{macrocode} +% Well, it would be nice if that were correct, but unfortunately, the +% Cork encoding contains some odd slots whose uccode or lccode isn't +% quite what you'd expect. +% \begin{macrocode} +\uccode`\^^Y=`\I % dotless i +\lccode`\^^Y=`\^^Y % dotless i +\uccode`\^^Z=`\J % dotless j, ae in OT1 +\lccode`\^^Z=`\^^Z % dotless j, ae in OT1 +\ifnum\inputlineno=\m@ne\else + \lccode`\^^9d=`\i % dotted I + \uccode`\^^9d=`\^^9d % dotted I + \lccode`\^^9e=`\^^9e % d-bar + \uccode`\^^9e=`\^^d0 % d-bar +\fi +% \end{macrocode} +% Finally here is one that helps hyphenation in the OT1 encoding. +% \changes{v1.0z}{1996/10/31} +% {Added extra \cs{lcode}, hoping it does no harm in T1 (pr/1969)} +% \begin{macrocode} +\lccode`\^^[=`\^^[ % oe in OT1 +% \end{macrocode} +% +% \begin{macro}{\MakeUppercase} +% \begin{macro}{\MakeUppercase} +% \begin{macro}{\@uclclist} +% +% \changes{v1.1a}{1997/10/20}{Removed \cs{aa} and \cs{AA} from +% \cs{@uclclist} as these are macros.} +% +% And whilst we're doing things with uc/lc tables, here are two +% commands to upper- and lower-case a string. +% +% \emph{Note} that this implementation is subject to change! At +% the moment we're not providing any way to extend the list of +% uc/lc commands, since finding a good interface is difficult. +% These commands have some nasty features, such as uppercasing +% mathematics, environment names, labels, etc. A much better +% long-term solution is to use all-caps fonts, but these aren't +% generally available. +% \begin{macrocode} +\DeclareRobustCommand{\MakeUppercase}[1]{{% + \def\i{I}\def\j{J}% + \def\reserved@a##1##2{\let##1##2\reserved@a}% + \expandafter\reserved@a\@uclclist\reserved@b{\reserved@b\@gobble}% + \protected@edef\reserved@a{\uppercase{#1}}% + \reserved@a + }} +\DeclareRobustCommand{\MakeLowercase}[1]{{% + \def\reserved@a##1##2{\let##2##1\reserved@a}% + \expandafter\reserved@a\@uclclist\reserved@b{\reserved@b\@gobble}% + \protected@edef\reserved@a{\lowercase{#1}}% + \reserved@a + }} +\def\@uclclist{\oe\OE\o\O\ae\AE + \dh\DH\dj\DJ\l\L\ng\NG\ss\SS\th\TH} +% \end{macrocode} +% The above code works, but has the nasty side-effect that if you +% say something like: +%\begin{verbatim} +% \markboth{\MakeUppercase\contentsname} +% {\MakeUppercase\contentsname} +%\end{verbatim} +% then the uppercasing is only done to the first letter of the +% contents name, since the mark expands out to: +%\begin{verbatim} +% \mark{\protect\MakeUppercase Table of Contents} +% {\protect\MakeUppercase Table of Contents} +%\end{verbatim} +% In order to get round this, we redefine |\MakeUppercase| and +% |\MakeLowercase| to grab their argument and brace it. This is a +% very low-level hack, and is \emph{not} recommended practice! +% This is an instance of a general problem that makes it unsafe to +% grab arguments unbraced, and probably needs a more general +% solution. For the moment though, this hack will do: +% \begin{macrocode} +\protected@edef\MakeUppercase#1{\MakeUppercase{#1}} +\protected@edef\MakeLowercase#1{\MakeLowercase{#1}} +% \end{macrocode} +% \end{macro} +% \end{macro} +% \end{macro} +% +% \changes{v1.0h}{1994/05/13}{Added output enc stuff} +% \changes{v1.0i}{1994/05/16}{moved output enc stuff to lfonts} +% +% \changes{v0.1a}{1994/03/07}{Add code from the old dump.dtx} +% +% \subsection{Applying Patch files} +% Between major releases, small patches will be distributed in +% files |ltpatch.ltx| which must be added at this point. +% \changes{v1.0m}{1994/06/08}{Add patch file system} +% \begin{macrocode} +\IfFileExists{ltpatch.ltx} + {\typeout{=================================^^J% + Applying patch file ltpatch.ltx^^J% + =================================} + \def\fmtversion@topatch{unknown} + \input{ltpatch.ltx} + \ifx\fmtversion\fmtversion@topatch + \ifx\patch@level\@undefined + \typeout{^^J^^J^^J% + !!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!^^J% + !! Patch file `ltpatch.ltx' not suitable for this^^J% + !! version of LaTeX.^^J^^J% + !! Please check if initex found an old patch file:^^J% + !! --- if so, rename it or delete it, and redo the^^J% + !! initex run.^^J% + !!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!^^J}% + \batchmode \@@end + \else +% \end{macrocode} +% \changes{v1.0q}{1995/04/21} +% {Allow initial patch level 0} +% \changes{v1.0t}{1995/06/13} +% {Add patch level string more carefully} +% The code below adds the `patch level' string to the first |\typeout| +% in the startup banner. +% \begin{macrocode} + \def\fmtversion@topatch{0}% + \ifx\fmtversion@topatch\patch@level\else + \def\reserved@a\typeout##1##2\reserved@a{% + \typeout{##1 patch level \patch@level}##2} + \everyjob\expandafter\expandafter\expandafter{% + \expandafter\reserved@a\the\everyjob\reserved@a} + \let\reserved@a\relax + \the\everyjob + \fi + \fi + \else + \typeout{^^J^^J^^J% + !!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!^^J% + !! Patch file `ltpatch.ltx' (for version <\fmtversion@topatch>)^^J% + !! is not suitable for version <\fmtversion> of LaTeX.^^J^^J% + !! Please check if initex found an old patch file:^^J% + !! --- if so, rename it or delete it, and redo the^^J% + !! initex run.^^J% + !!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!^^J}% + \batchmode \@@end + \fi + \let\fmtversion@topatch\relax + }{} +% \end{macrocode} +% +% \subsection{Freeing Memory} +% +% \begin{macro}{\reserved@a} +% \begin{macro}{\reserved@b} +% \changes{v1.0v}{1995/10/17}{reset here after the \cs{input} above} +% And just to make sure nobody relies on those definitions of +% |\reserved@b| and friends. +% These macros are reserved for use in the kernel. \emph{Do not use +% them as general scratch macros}. +% \begin{macrocode} +\let\reserved@a\@filelist +\let\reserved@b=\@undefined +\let\reserved@c=\@undefined +\let\reserved@d=\@undefined +\let\reserved@e=\@undefined +\let\reserved@f=\@undefined +% \end{macrocode} +% \end{macro} +% \end{macro} +% +% \begin{macro}{\toks} +% \changes{v1.0y}{1996/07/10} +% {Free up memory from scratch registers /2213} +% \begin{macrocode} +\toks0{} +\toks2{} +\toks4{} +\toks6{} +\toks8{} +% \end{macrocode} +% \end{macro} +% +% \begin{macro}{\errhelp} +% \changes{v0.1g}{1994/05/05}{Set error help empty.} +% \changes{v1.1d}{2000/09/01}{Set error help empty at very end +% (pr/449 done correctly).} +% Empty the error help message, which may have some rubbish: +% \begin{macrocode} +\errhelp{} +% \end{macrocode} +% \end{macro} +% +% \subsection{Initialise file list} +% +% \begin{macro}{\@providesfile} +% \changes{v1.0v}{1995/10/17}{reset macro} +% Initialise for use in the document. During initex a modified version +% has been used which leaves debugging information for |latexbug.tex|. +% \begin{macrocode} +\def\@providesfile#1[#2]{% + \wlog{File: #1 #2}% + \expandafter\xdef\csname ver@#1\endcsname{#2}% + \endgroup} +% \end{macrocode} +% \end{macro} +% +% \begin{macro}{\@filelist} +% \changes{v1.0w}{1995/10/19}{Move after \cs{reserved@a} setting:-)} +% \begin{macro}{\@addtofilelist} +% Reset |\@filelist| so files input while making the format are not +% listed. The list built up so far may take up a lot of memory and so +% it is moved to |\reserved@a| where it will be overwritten as soon +% as almost any \LaTeX\ command is issued in a class file. +% However the |latexbug.tex| program will be able to access this +% information and insert it into a bug report. +% \begin{macrocode} +\let\@filelist\@gobble +\def\@addtofilelist#1{\xdef\@filelist{\@filelist,#1}}% +% \end{macrocode} +% \end{macro} +% \end{macro} +% +% \subsection{Dumping the format} +% Finally we make |@| into a letter, ensure the format will +% be in the `normal' error mode, and dump everything into the +% format file. +% \changes{v1.0t}{1995/06/13} +% {Call \cs{errorstopmode}} +% \begin{macrocode} +\makeatother +\errorstopmode +\dump +% +% \end{macrocode} +% +% \Finale +% diff --git a/Master/texmf-dist/source/latex/base/ltfloat.dtx b/Master/texmf-dist/source/latex/base/ltfloat.dtx new file mode 100644 index 00000000000..d10264e56fd --- /dev/null +++ b/Master/texmf-dist/source/latex/base/ltfloat.dtx @@ -0,0 +1,1314 @@ +% \iffalse meta-comment +% +% Copyright 1993 1994 1995 1996 1997 1998 1999 2000 2001 2002 2003 2004 +% The LaTeX3 Project and any individual authors listed elsewhere +% in this file. +% +% This file is part of the LaTeX base system. +% ------------------------------------------- +% +% It may be distributed and/or modified under the +% conditions of the LaTeX Project Public License, either version 1.3 +% of this license or (at your option) any later version. +% The latest version of this license is in +% http://www.latex-project.org/lppl.txt +% and version 1.3 or later is part of all distributions of LaTeX +% version 2003/12/01 or later. +% +% This file has the LPPL maintenance status "maintained". +% +% The list of all files belonging to the LaTeX base distribution is +% given in the file `manifest.txt'. See also `legal.txt' for additional +% information. +% +% The list of derived (unpacked) files belonging to the distribution +% and covered by LPPL is defined by the unpacking scripts (with +% extension .ins) which are part of the distribution. +% +% \fi +% \iffalse +%%% From File: ltfloat.dtx +% +%<*driver> +% \fi +\ProvidesFile{ltfloat.dtx}[2002/10/01 v1.1v LaTeX Kernel (Floats)] +% \iffalse +\documentclass{ltxdoc} +\GetFileInfo{ltfloat.dtx} +\title{\filename} +\date{\filedate} + \author{% + Johannes Braams\and + David Carlisle\and + Alan Jeffrey\and + Leslie Lamport\and + Frank Mittelbach\and + Chris Rowley\and + Rainer Sch\"opf} + +\begin{document} +\maketitle + \DocInput{\filename} +\end{document} +% +% \fi +% +% \CheckSum{636} +% +% \section{Floats} +% +% The different types of floats are identified by a \meta{type} name, +% which is the name of the counter for that kind of float. For +% example, figures are of type `figure' and tables are of type `table'. +% Each \meta{type} has associated a positive \meta{type number}, which +% is a power of two. E.g.,\\ +% figures might be have type number~1, tables type number~2, programs +% type number~4, etc. +% +% The locations where a float can go are specified by a +% \meta{placement specifier}, which is a list of the possible +% locations, each denoted by a letter as follows: +% \begin{center} +% \begin{tabular}{l@{ : }l@{ --- }l} +% h & here & at the current location in the text.\\ +% t & top & at the top of a text page.\\ +% b & bottom & at the bottom of a text page.\\ +% p & page & on a separate float page +% \end{tabular} +% \end{center} +% In addition, in conjunction with these, you can use `!' which means +% that the current values of the float positioning parameters are +% ignored for this float. (Has no effect on `p', float page +% positioning.) +% For example, `pht' specifies that the float can appear in any of +% three locations: page, here or top. +% +% \StopEventually{} +% +% +% \changes{v1.0a}{1994/03/04}{Initial version, split from latex.dtx} +% \changes{v1.0b}{1994/03/28}{Split further from ltherest.dtx} +% \changes{v1.0e}{1994/04/25}{Changed warning messages} +% \changes{v1.0e}{1994/04/25}{Removed obsolete tracing code} +% \changes{v1.0f}{1994/05/03} +% {(CAR) Added \cs{@largefloatcheck}} +% \changes{v1.0f}{1994/05/03}{Removed unnecessary braces from +% arguments of \cs{@ifnextchar}} +% \changes{v1.0i}{1994/05/22}{Use new warning commands} +% \changes{v1.1e}{1994/11/17} +% {\cs{@tempa} to \cs{reserved@a}} +% \changes{v1.1g}{1994/12/10}{Some temps reinserted temporarily} +% \changes{v1.1n}{1995/11/28}{documentation fixes} +% \changes{v1.1s}{1997/06/16}{documentation fixes} +% +% \subsection{Floating Environments} +% \begin{macrocode} +%<*2ekernel> +\message{floats,} +% \end{macrocode} +% \begin{oldcomments} +% +% Where floats may appear on a page, and how many may appear there +% are specified by the following float placement parameters. The +% numbers are named like counters so the user can set them with +% the ordinary counter-setting commands. +% +% \c@topnumber : Number of floats allowed at the top of a column. +% \topfraction : Fraction of column that can be devoted to floats. +% \c@dbltopnumber, \dbltopfraction +% : Same as above, but for double-column floats. +% \c@bottomnumber, \bottomfraction +% : Same as above for bottom of page. +% \c@totalnumber : Number of floats allowed in a single column, +% including in-text floats. +% \textfraction :Minimum fraction of column that must contain text. +% \floatpagefraction: Minimum fraction of page that must be taken +% up by float page. +% \dblfloatpagefraction +% : Same as above, for double-column floats. +% +% The document style must define the following. +% +% \fps@TYPE : The default placement specifier for floats of type +% TYPE. +% +% \ftype@TYPE : The type number for floats of type TYPE. +% +% \ext@TYPE : The file extension indicating the file on which the +% contents list for float type TYPE is stored. +% For example, \ext@figure = 'lof'. +% +% \fnum@TYPE : A macro to generate the figure number for a caption. +% For example, \fnum@TYPE == Figure \thefigure. +% +% \@makecaption{NUM}{TEXT} : +% A macro to make a caption, with NUM the value +% produced by \fnum@... and TEXT the text of the caption. +% It can assume it's in a \parbox of the appropriate width. +% +% \@float{TYPE}[PLACEMENT] : This macro begins a float environment for a +% single-column float of type TYPE with PLACEMENT as the placement +% specifier. The default value of PLACEMENT is defined by +% \fps@TYPE. The environment is ended by \end@float. +% E.g., \figure == \@float{figure}, \endfigure == \end@float. +% +% \@float{TYPE}[PLACEMENT] == +% BEGIN +% if hmode then \@bsphack +% \@floatpenalty := -10002 +% else \@floatpenalty := -10003 +% fi +% \@captype ==L TYPE +% \@dblflset +% \@fps ==L PLACEMENT +% \@onelevel@sanitize \@fps +% add default PLACEMENT if at most ! in PLACEMENT == \@fpsadddefault +% if inner +% then LaTeX Error: 'Not in outer paragraph mode.' +% \@floatpenalty := 0 +% else if \@freelist nonempty +% then \@currbox :=L head of \@freelist +% \@freelist :=G tail of \@freelist +% \count\@currbox :=G 32*\ftype@TYPE + +% bits determined by PLACEMENT +% else \@floatpenalty := 0 +% LaTeX Error: 'Too many unprocessed floats' +% fi +% fi +% \@currbox :=G \color@vbox +% \normalcolor +% \vbox{ +% %% 15 Dec 87 -- +% %% removed \boxmaxdepth :=L 0pt +% %% that made box 0 depth because it screwed +% %% things up. Instead, added \vskip0pt at end +% \hsize = \columnwidth +% \@parboxrestore +% \@floatboxreset +% END +% +% \caption == +% BEGIN +% \refstepcounter{\@captype} +% \@dblarg{\@caption{\@captype}} +% END +% +% In following definition, \par moved from after \addcontentsline to +% before \addcontentsline because the \write could cause +% an extra blank line to be added to the paragraph above the +% caption. (Change made 12 Jun 87) +% +% \@caption{TYPE}[STEXT]{TEXT} == +% BEGIN +% \par +% \addcontentsline{\ext@TYPE}{TYPE}{\numberline{\theTYPE}{STEXT}} +% \begingroup +% \@parboxrestore +% \@normalsize +% \@makecaption{\fnum@TYPE}{TEXT} +% \par +% \endgroup +% END +% +% +% \@dblfloat{TYPE}[PLACEMENT] : Macro to begin a float environment for +% a double-column float of type TYPE with PLACEMENT as the placement +% specifier. The default value of PLACEMENT is 'tp' +% The environment is ended by \end@dblfloat. +% E.g., \figure* == \@dblfloat{figure}, +% \endfigure* == \end@dblfloat. +% +% \@dblfloat{TYPE}[PLACEMENT] == +% Identical to \@float{TYPE}[PLACEMENT] except \hsize and \linewidth +% are set to \textwidth. +% \end{oldcomments} +% +% \begin{macro}{\@floatpenalty} +% \begin{macrocode} +\newcount\@floatpenalty +% \end{macrocode} +% \end{macro} +% +% \begin{macro}{\caption} +% +% This is set to be an error message outside a float since no +% captype is defined there; this may need to be changed by some +% classes. +% \changes{v1.1u}{1999/04/19} +% {Made caption an error oustside a float: latex/2815} +% \begin{macrocode} +\def\caption{% + \ifx\@captype\@undefined + \@latex@error{\noexpand\caption outside float}\@ehd + \expandafter\@gobble + \else + \refstepcounter\@captype + \expandafter\@firstofone + \fi + {\@dblarg{\@caption\@captype}}% +} +% \end{macrocode} +% \end{macro} +% +% \begin{macro}{\@caption} +% \changes{v1.0b}{1994/03/28} +% {Use \cs{normalsize} not \cs{@normalsize}} +% \changes{v1.1r}{1996/12/06} +% {Call \cs{@setminpage} if needed. latex/2318} +% \begin{macrocode} +\long\def\@caption#1[#2]#3{% + \par + \addcontentsline{\csname ext@#1\endcsname}{#1}% + {\protect\numberline{\csname the#1\endcsname}{\ignorespaces #2}}% + \begingroup +% \end{macrocode} +% +% The paragraph setting parameters are normalised at this point, however +% |\@parboxrestore| resets |\everypar| which is not correct in this +% context so |\@setminipage| is called if needed. +% +% The float mechanism, like minipage, sets the flag |@minipage| true +% before executing the user-supplied text. Many \LaTeX\ constructs +% test for this flag and do not add vertical space when it is true. +% The intention is that this emulates \TeX's `top of page' behaviour. +% The flag must be set false at the start of the first paragraph. This +% is achieved by a redefinition of |\everypar|, but the call to +% |\@parboxrestore| removes that redefinition, so it is re-inserted +% if needed. If the flag is already false then the |\caption| was not +% the first entry in the float, and so some other paragraph has already +% activated the special |\everypar|. In this case no further action is +% needed. +% \begin{macrocode} + \@parboxrestore + \if@minipage + \@setminipage + \fi +% \end{macrocode} +% +% \begin{macrocode} + \normalsize + \@makecaption{\csname fnum@#1\endcsname}{\ignorespaces #3}\par + \endgroup} +% \end{macrocode} +% \end{macro} +% +% \begin{macro}{\@float} +% \begin{macro}{\@dblflset} +% \changes{v1.1a}{1994/10/31}{Macro added} +% \changes{v1.1g}{1994/12/10}{Macro removed temporarily} +% \changes{v1.1a}{1994/10/31} +% {Major changes to parameter parsing, setting of local variables, +% etc; two-column and one-column cases merged; space hacks moved} +% \changes{v1.1c}{1994/11/05} +% {Add compatibility with old version of \cs{@xfloat}.} +% \changes{v1.1g}{1994/12/10}{Old version reinstated temporarily} +% +% \begin{macrocode} +\def\@float#1{% + \@ifnextchar[% + {\@xfloat{#1}}% + {\edef\reserved@a{\noexpand\@xfloat{#1}[\csname fps@#1\endcsname]}% + \reserved@a}} +% \end{macrocode} +% +% \end{macro} +% \end{macro} +% +% \begin{macro}{\@dblfloat} +% \changes{v1.1a}{1994/10/31} +% {Major changes since two-column and one-column cases merged} +% \changes{v1.1g}{1994/12/10}{Old version reinstated temporarily} +% +% \begin{macrocode} +\def\@dblfloat{% + \if@twocolumn\let\reserved@a\@dbflt\else\let\reserved@a\@float\fi + \reserved@a} +% \end{macrocode} +% \end{macro} +% +% +% \begin{macro}{\fps@dbl} +% \changes{v1.1a}{1994/10/31}{Macro added} +% \changes{v1.1g}{1994/12/10}{Macro removed temporarily} +% Note that all double floats have default fps `tp'. +% \end{macro} +% +% \begin{macro}{\@setfps} +% \changes{v1.1a}{1994/10/31}{Macro added} +% \changes{v1.1c}{1994/11/05} +% {Add compatibility with old version of \cs{@xfloat}.} +% \changes{v1.1g}{1994/12/10}{Macro removed temporarily} +% This sets the fps, dealing with error conditions by adding +% the default. +% +% \end{macro} +% +% \begin{macro}{\@xfloat} +% \changes{LaTeX2e}{1993/12/05}{Command changed} +% \changes{LaTeX2e}{1994/01/21}{Added missing percent characters.} +% \changes{v1.1a}{1994/10/31} +% {Major changes, removing setting of local variables, space hacks +% etc; two-column and one-column cases merged} +% \changes{v1.1c}{1994/11/05} +% {Add compatibility with old version of \cs{@xfloat}: but the +% arguments, provided at exorbitant cost, are now completely +% ignored} +% \changes{v1.1f}{1994/11/21} +% {Missing percents reinserted after 4, 8: these are not numbers.} +% \changes{v1.1g}{1994/12/10}{Old version reinstated temporarily} +% \changes{v1.1g}{1994/12/10}{Sanitisation added temporarily} +% The first part of this sets the count register that stores all +% the information about the type and fps of the float. +% +% We assume here that the default specifiers already contain no +% active characters. +% +% It may be better to store the defaults as numbers, rather than +% symbol strings. +% +% \changes{v1.1p}{1996/10/24}{Added \cs{@nodocument} to trap +% floats in the preamble} +% \begin{macrocode} +\def\@xfloat #1[#2]{% + \@nodocument + \def \@captype {#1}% + \def \@fps {#2}% + \@onelevel@sanitize \@fps + \def \reserved@b {!}% + \ifx \reserved@b \@fps + \@fpsadddefault + \else + \ifx \@fps \@empty + \@fpsadddefault + \fi + \fi + \ifhmode + \@bsphack + \@floatpenalty -\@Mii + \else + \@floatpenalty-\@Miii + \fi + \ifinner + \@parmoderr\@floatpenalty\z@ + \else + \@next\@currbox\@freelist + {% + \@tempcnta \sixt@@n + \expandafter \@tfor \expandafter \reserved@a + \expandafter :\expandafter =\@fps + \do + {% + \if \reserved@a h% + \ifodd \@tempcnta + \else + \advance \@tempcnta \@ne + \fi + \fi + \if \reserved@a t% + \@setfpsbit \tw@ + \fi + \if \reserved@a b% + \@setfpsbit 4% + \fi + \if \reserved@a p% + \@setfpsbit 8% + \fi + \if \reserved@a !% + \ifnum \@tempcnta>15 + \advance\@tempcnta -\sixt@@n\relax + \fi + \fi + }% + \@tempcntb \csname ftype@\@captype \endcsname + \multiply \@tempcntb \@xxxii + \advance \@tempcnta \@tempcntb + \global \count\@currbox \@tempcnta + }% + \@fltovf + \fi +% \end{macrocode} +% The remainder sets up the box in which the float is typeset, and +% the typesetting environment to be used. It is essential to have +% the extra box to avoid the unwanted space that would otherwise +% often be put at the top of the float. +% +% It ends with a hook; not sure how useful this is but it is needed +% at present to deal with double-column floats. +% \task{CAR?}{Sort out hooks} +% \changes{v1.0a}{1994/03/07} +% {(DPC) Extra group for colour} +% \changes{v1.0c}{1994/03/14} +% {(DPC) Use \cs{color@begingroup}} +% \changes{v1.0g}{1994/05/13} +% {(DPC) Use \cs{normalcolor}} +% \changes{v1.1a}{1994/10/31} +% {(DPC/CAR) Extra box added to remove colour resetting from vmode} +% \changes{v1.1a}{1994/10/31}{Reset hook added} +% \changes{v1.1c}{1994/11/05} +% {Use new \cs{color@hbox} concept.} +% \changes{v1.1f}{1994/11/21} +% {Changed to \cs{color@vbox} so that large floats overflow +% at the bottom} +% \changes{v1.1f}{1994/11/21}{Use \cs{@setnobreak}} +% \changes{v1.1f}{1994/11/21}{Added \cs{@setminipage}} +% \changes{v1.1f}{1994/11/21}{Added resetting of size and font} +% \changes{v1.1m}{1995/05/25}{(CAR) Resettings moved to hook} +% \begin{macrocode} + \global \setbox\@currbox + \color@vbox + \normalcolor + \vbox \bgroup + \hsize\columnwidth + \@parboxrestore + \@floatboxreset +} +% \end{macrocode} +% \end{macro} +% +% \begin{macro}{\@floatboxreset} +% \changes{v1.1a}{1994/10/31}{Macro added} +% +% The rational for allowing these normally global flags to be set +% locally here, via |\@parboxrestore|, was stated originally by +% Donald Arseneau and extended by Chris Rowley. +% It is because these flags are only set globally to +% true by section commands, and these should never appear within +% marginals or floats or, indeed, in any group; and they are only ever +% set globally to false when they are definitely true. +% +% If anyone is unhappy with this argument then both flags should be +% treated as in |\set@nobreak|; otherwise this command will be +% redundant. +% \changes{v1.1p}{1996/10/24} +% {Added local settings of flags: dangerous!!} +% \begin{macrocode} +\def \@floatboxreset {% + \reset@font + \normalsize + \@setminipage +} +% \end{macrocode} +% \end{macro} +% +% \begin{macro}{\@setnobreak} +% \changes{v1.1f}{1994/11/21}{Macro added} +% \changes{v1.1n}{1996/07/26}{remove unecessary \cs{global} before +% \cs{@nobreak...}} +% \begin{macrocode} +\def \@setnobreak{% + \if@nobreak + \let\outer@nobreak\@nobreaktrue + \@nobreakfalse + \fi +} +% \end{macrocode} +% \end{macro} +% +% \begin{macro}{\@setminipage} +% \changes{v1.1f}{1994/11/21}{Macro added} +% \changes{v1.1n}{1996/07/26}{remove unecessary \cs{global} before +% \cs{@minipage...}} +% \begin{macrocode} +\def \@setminipage{% + \@minipagetrue + \everypar{\@minipagefalse\everypar{}}% +} +% \end{macrocode} +% \end{macro} +% +% \begin{macro}{\end@float} +% \changes{v1.0f}{1994/05/03} +% {(CAR) Added \cs{@largefloatcheck}} +% \changes{v1.1n}{1995/10/25}{(CAR) unify code for double and +% single versions} +% \begin{macrocode} +\def\end@float{% + \@endfloatbox + \ifnum\@floatpenalty <\z@ +% \end{macrocode} +% We make sure that we never exceed |\textheight|, otherwise float +% will never get typeset (91/03/15 FMi). +% \begin{macrocode} + \@largefloatcheck + \@cons\@currlist\@currbox + \ifnum\@floatpenalty <-\@Mii + \penalty -\@Miv +% \end{macrocode} +% Saving and restoring |\prevdepth| added 26 May 87 to prevent extra +% vertical space when used in vertical mode. +% \begin{macrocode} + \@tempdima\prevdepth + \vbox{}% + \prevdepth\@tempdima +% \end{macrocode} +% +% \begin{macrocode} + \penalty\@floatpenalty +% \end{macrocode} +% \changes{LaTeX2.09}{1992/03/18} +% {(RmS) changed \cs{@esphack} to \cs{@Esphack}} +% \begin{macrocode} + \else + \vadjust{\penalty -\@Miv \vbox{}\penalty\@floatpenalty}\@Esphack + \fi + \fi +} +% \end{macrocode} +% \end{macro} +% +% \begin{macro}{\end@dblfloat} +% \changes{v1.0f}{1994/05/03}{\cs{@largefloatcheck} added} +% \changes{v1.1n}{1995/10/25}{(CAR) unify code for double and +% single versions} +% \begin{macrocode} +\def\end@dblfloat{% +\if@twocolumn + \@endfloatbox + \ifnum\@floatpenalty <\z@ +% \end{macrocode} +% We make sure that we never exceed |\textheight|, otherwise float +% will never get typeset (91/03/15 FMi). +% \begin{macrocode} + \@largefloatcheck + \@cons\@dbldeferlist\@currbox + \fi +% \end{macrocode} +% RmS 92/03/18 changed |\@esphack| to |\@Esphack|. +% \begin{macrocode} + \ifnum \@floatpenalty =-\@Mii \@Esphack\fi +\else + \end@float +\fi +} +% \end{macrocode} +% \end{macro} +% +% \begin{macro}{\@endfloatbox} +% \changes{v1.1n}{1995/10/25}{(CAR) macro added: to unify code for +% double and single versions} +% This macro is not intended to be a hook; it is designed to help +% maintain the integrity of this code, which is used twice and, as +% can be seen, is subject to frequent changes. +% \begin{macrocode} +\def \@endfloatbox{% + \par\vskip\z@skip %% \par\vskip\z@ added 15 Dec 87 +% \end{macrocode} +% \changes{v1.0a} +% {1994/03/07}{(DPC) Extra group for colour} +% \changes{v1.0c}{1994/03/14} +% {(DPC) Use \cs{color@endgroup}} +% \changes{v1.0h}{1994/05/20}{Restore outer value of @nobreak switch.} +% \changes{v1.1a}{1994/10/31} +% {(DPC/CAR) Extra box added to remove colour resetting from vmode} +% \changes{v1.1c}{1994/11/05} +% {Use new \cs{color@hbox} concept.} +% \changes{v1.1f}{1994/11/21}{Corrected position of \cs{outer@nobreak}} +% \changes{v1.1f}{1994/11/21}{Added reset of minipage flag} +% \changes{v1.1n}{1996/07/26}{remove unecessary \cs{global} before +% \cs{@minipage...}} +% \begin{macrocode} + \@minipagefalse + \outer@nobreak + \egroup %% end of vbox + \color@endbox +} +% +% \begin{macro}{\outer@nobreak} +% \changes{v1.0h}{1994/05/20}{Macro added: default is to do nothing.} +% \begin{macrocode} +\let\outer@nobreak\@empty +% \end{macrocode} +% \end{macro} +% +% +% \begin{macro}{\@largefloatcheck} +% \changes{v1.0e}{1994/04/25}{Command added} +% +% This calculates by how much a float is oversize for the page and +% prints this in a warning message. +% +% \begin{macrocode} +\def \@largefloatcheck{% + \ifdim \ht\@currbox>\textheight + \@tempdima -\textheight + \advance \@tempdima \ht\@currbox +% \end{macrocode} +% \changes{v1.0e}{1994/04/25}{Changed warning message to give more +% info} +% \begin{macrocode} + \@latex@warning {Float too large for page by \the\@tempdima}% + \ht\@currbox \textheight + \fi +} +% \end{macrocode} +% \end{macro} +% +% \begin{macro}{\@dbflt} +% \begin{macro}{\@xdblfloat} +% \changes{v1.1a}{1994/10/31} +% {Macros removed: \cs{@dbflt}, \cs{@xdblfloat}} +% \changes{v1.1g}{1994/12/10}{Macros reinserted temporarily} +% +% +% \begin{macrocode} +\def\@dbflt#1{\@ifnextchar[{\@xdblfloat{#1}}{\@xdblfloat{#1}[tp]}} +\def\@xdblfloat#1[#2]{% + \@xfloat{#1}[#2]\hsize\textwidth\linewidth\textwidth} +% \end{macrocode} +% \end{macro} +% \end{macro} +% +% +% Moved to ltoutput 93/12/16 +% \begin{macrocode} +%\newcount\c@topnumber +%\newcount\c@dbltopnumber +%\newcount\c@bottomnumber +%\newcount\c@totalnumber +% \end{macrocode} +% +% An analysis of |\@floatplacement|: +% +% This should be called whenever |\@colht| has been set. +% \begin{macrocode} +\def\@floatplacement{\global\@topnum\c@topnumber + % Textpage bit, global: + \global\@toproom \topfraction\@colht + \global\@botnum \c@bottomnumber + \global\@botroom \bottomfraction\@colht + \global\@colnum \c@totalnumber + % Floatpage bit, local: + \@fpmin \floatpagefraction\@colht} +% \end{macrocode} +% +% \begin{macro}{\@dblfloatplacement} +% \changes{LaTeX2e}{1993/12/05}{Command changed} +% +% This should be called only within a group. Now changed to +% provide extra checks in |\@addtodblcol|, needed when processing a +% BANG float. +% +% \begin{macrocode} +\def \@dblfloatplacement {% +% \end{macrocode} +% Textpage bit: global, but need not be. +% \begin{macrocode} + \global \@dbltopnum \c@dbltopnumber + \global \@dbltoproom \dbltopfraction\@colht +% \end{macrocode} +% This new bit uses |\@textmin| to locally store the amount of extra +% room in the column. +% \begin{macrocode} + \@textmin \@colht + \advance \@textmin -\@dbltoproom +% \end{macrocode} +% Floatpage bit: must be local. +% \begin{macrocode} + \@fpmin \dblfloatpagefraction\textheight + \@fptop \@dblfptop + \@fpsep \@dblfpsep + \@fpbot \@dblfpbot +} +% \end{macrocode} +% \end{macro} +% +% +% \begin{oldcomments} +% MARGINAL NOTES: +% +% Marginal notes use the same mechanism as floats to communicate +% with the \output routine. Marginal notes are distinguished from +% floats by having a negative placement specification. The command +% \marginpar [LTEXT]{RTEXT} generates a marginal note in a parbox, +% using LTEXT if it's on the left and RTEXT if it's on the right. +% (Default is RTEXT = LTEXT.) It uses the following parameters. +% +% \marginparwidth : Width of marginal notes. +% \marginparsep : Distance between marginal note and text. +% the page layout to determine how to move the marginal +% note into the margin. E.g., \@leftmarginskip == +% \hskip -\marginparwidth \hskip -\marginparsep . +% \marginparpush : Minimum vertical separation between \marginpar's +% +% Marginal notes are normally put on the outside of the page +% if @mparswitch = true, and on the right if @mparswitch = false. +% The command \reversemarginpar reverses the side where they +% are put. \normalmarginpar undoes \reversemarginpar. +% These commands have no effect for two-column output. +% +% SURPRISE: if two marginal notes appear on the same line of +% text, then the second one could appear on the next page, in +% a funny position. +% +% +% \marginpar [LTEXT]{RTEXT} == +% BEGIN +% if hmode then \@bsphack +% \@floatpenalty := -10002 +% else \@floatpenalty := -10003 +% fi +% if inner +% then LaTeX Error: 'Not in outer paragraph mode.' +% \@floatpenalty := 0 +% else if \@freelist has two elements: +% then get \@marbox, \@currbox from \@freelist +% \count\@marbox :=G -1 +% else \@floatpenalty := 0 +% LaTeX Error: 'Too many unprocessed floats' +% \@currbox, \@marbox := \@tempboxa %%use \def +% fi +% fi +% if optional argument +% then %% \@xmpar == +% \@savemarbox\@marbox{LTEXT} +% \@savemarbox\@currbox{RTEXT} +% else %% \@ympar == +% \@savemarbox\@marbox{RTEXT} +% \box\@currbox :=G \box\@marbox +% fi +% \@xympar +% END +% +% \reversemarginpar == BEGIN \@mparbottom :=G 0 +% @reversemargin :=G true +% END +% +% \normalmarginpar == BEGIN \@mparbottom :=G 0 +% @reversemargin :=G false +% END +% +% \end{oldcomments} +% +% \begin{macro}{\marginpar} +% \begin{macrocode} +\def\marginpar{% + \ifhmode + \@bsphack + \@floatpenalty -\@Mii + \else + \@floatpenalty-\@Miii + \fi + \ifinner + \@parmoderr + \@floatpenalty\z@ + \else + \@next\@currbox\@freelist{}{}% + \@next\@marbox\@freelist{\global\count\@marbox\m@ne}% + {\@floatpenalty\z@ + \@fltovf\def\@currbox{\@tempboxa}\def\@marbox{\@tempboxa}}% + \fi + \@ifnextchar [\@xmpar\@ympar} +% \end{macrocode} +% \end{macro} +% +% \begin{macro}{\@xmpar} +% \begin{macrocode} +\long\def\@xmpar[#1]#2{% + \@savemarbox\@marbox{#1}% + \@savemarbox\@currbox{#2}% + \@xympar} +% \end{macrocode} +% \end{macro} +% +% \begin{macro}{\@ympar} +% \begin{macrocode} +\long\def\@ympar#1{% + \@savemarbox\@marbox{#1}% + \global\setbox\@currbox\copy\@marbox + \@xympar} +% \end{macrocode} +% \end{macro} +% +% \begin{macro}{\@savemarbox} +% \changes{v1.0b}{1994/03/12} +% {(DPC) Extra group for colour} +% \changes{v1.0c}{1994/03/14} +% {(DPC) Use \cs{color@begingroup}} +% \changes{v1.0d}{1994/04/18} +% {(DPC) Remove Colour support} +% \changes{v1.1a}{1994/10/31} +% {(DPC/CAR) Extra box added for colour} +% \changes{v1.1c}{1994/11/05} +% {Use new \cs{color@hbox} concept.} +% \changes{v1.1f}{1994/11/21}{Changed to \cs{color@vbox} } +% \changes{v1.1f}{1994/11/21}{Use \cs{@setnobreak} etc} +% \changes{v1.1f}{1994/11/21}{Added \cs{@setminipage} etc} +% \changes{v1.1f}{1994/11/21}{Added resetting of size and font} +% \changes{v1.1m}{1995/05/25}{(CAR) Resettings moved to hook} +% \changes{v1.1n}{1996/07/26}{remove unecessary \cs{global} before +% \cs{@minipage...}} +% \begin{macrocode} +\long\def \@savemarbox #1#2{% + \global\setbox #1% + \color@vbox + \vtop{% + \hsize\marginparwidth + \@parboxrestore + \@marginparreset + #2% + \@minipagefalse + \outer@nobreak + }% + \color@endbox +} +% \end{macrocode} +% \end{macro} +% +% \begin{macro}{\@marginparreset} +% \changes{v1.1f}{1994/11/21}{Macro added} +% +% The rational for allowing these normally global flags to be set +% locally here, via |\@parboxrestore| was stated originally by +% Donald Arsenau and extended by Chris Rowley. +% It is because these flags are only set globally to +% true by section commands, and these should never appear within +% marginals or floats or, indeed, in any group; and they are only ever +% set globally to false when they are definitely true. +% +% If anyone is unhappy with this argument then both flags should be +% treated as in |\set@nobreak|; otherwise this command will be +% redundant. +% \changes{v1.1p}{1996/10/24} +% {Added local settings of flags: dangerous!!} +% \begin{macrocode} +\def \@marginparreset {% + \reset@font + \normalsize +% \let\if@nobreak\iffalse +% \let\if@noskipsec\iffalse +% \@setnobreak + \@setminipage +} +% \end{macrocode} +% \end{macro} +% +% \begin{macro}{\@xympar} +% \begin{macrocode} +% \end{macrocode} +% \changes{LaTeX2.09}{1992/03/18} +% {(RmS) added \cs{global}\cs{@ignorefalse}} +% \changes{v1.0b}{1994/03/12} +% {(DPC) Extra bgroup for colour} +% \changes{1.0c}{1994/03/14} +% {(DPC) Use \cs{color@begingroup}} +% \changes{v1.1a}{1994/10/31} +% {(DPC/CAR) Extra box added since needed for floats} +% \changes{v1.1c}{1994/11/05} +% {Use new \cs{color@hbox} concept.} +% \changes{v1.1f}{1994/11/21}{Changed to \cs{color@vbox} } +% Setting the box here is done only because the code +% uses \cs{end@float}; it will be empty and gets discarded. +% \changes{v1.1o}{1996/08/02}{Remove \cs{global} before \cs{@ignore...}} +% \begin{macrocode} +\def \@xympar{% + \ifnum\@floatpenalty <\z@\@cons\@currlist\@marbox\fi + \setbox\@tempboxa + \color@vbox + \vbox \bgroup + \end@float + \@ignorefalse + \@esphack +} +% \end{macrocode} +% \end{macro} +% +% \begin{macro}{\reversemarginpar} +% \begin{macro}{\normalmarginpar} +% \begin{macrocode} +\def\reversemarginpar{\global\@mparbottom\z@ \@reversemargintrue} +\def\normalmarginpar{\global\@mparbottom\z@ \@reversemarginfalse} +% \end{macrocode} +% \end{macro} +% \end{macro} +% +% \begin{macrocode} +\message{footnotes,} +% \end{macrocode} +% +% \subsection{Footnotes} +% +% \begin{oldcomments} +% +% \footnote{NOTE} : User command to insert a footnote. +% +% \footnote[NUM]{NOTE}: User command to insert a footnote numbered +% NUM, where NUM is a number -- 1, 2, +% etc. For example, if footnotes are numbered +% *, **, etc. within pages, then \footnote[2]{...} +% produces footnote '**'. This command does not +% step the footnote counter. +% +% \footnotemark[NUM] : Command to produce just the footnote mark in +% the text, but no footnote. With no argument, +% it steps the footnote counter before generating +% the mark. +% +% \footnotetext[NUM]{TEXT} : Command to produce the footnote but +% no mark. \footnote is equivalent to +% \footnotemark \footnotetext . +% +% As in PLAIN, footnotes use \insert\footins, and the following +% parameters: +% +% \footnotesize : Size-changing command for footnotes. +% +% \footnotesep : The height of a strut placed at the beginning of +% every footnote. +% \skip\footins : Space between main text and footnotes. The rule +% separating footnotes from text occurs in this +% space. This space lies above the strut of height +% \footnotesep which is at the beginning of the +% first footnote. +% \footnoterule : Macro to draw the rule separating footnotes from +% text. It is executed right after a \vspace of +% \skip\footins. It should take zero vertical +% space--i.e., it should to a negative skip to +% compensate for any positive space it occupies. +% (See PLAIN.TEX.) +% +% \interfootnotelinepenalty : Interline penalty for footnotes. +% +% \thefootnote : In usual LaTeX style, produces the footnote number. +% If footnotes are to be numbered within pages, then +% the document style file must include an \@addtoreset +% command to cause the footnote counter to be reset +% when the page counter is stepped. This is not a good +% idea, though, because the counter will not always be +% reset in time to ensure that the first footnote on a +% page is footnote number one. +% +% \@thefnmark : Holds the current footnote's mark--e.g., \dag or '1' +% or 'a'. +% +% \@mpfnnumber : A macro that generates the numbers for \footnote +% and \footnotemark commands. It == \thefootnote +% outside a minipage environment, but can be +% changed inside to generate numbers for +% \footnote's. +% +% \@makefnmark : A macro to generate the footnote marker from +% \@thefnmark The default definition was +% \hbox{$^\@thefnmark$}. +% +% This is now replaced by +% \textsuperscript{\@thefnmark} +% +% \@makefntext{NOTE} : +% Must produce the actual footnote, using \@thefnmark as the mark +% of the footnote and NOTE as the text. It is called when +% effectively inside a \parbox, with \hsize = \columnwidth. +% For example, it might be as simple as +% $^{\@thefnmark}$ NOTE +% +% In a minipage environment, \footnote and \footnotetext are redefined +% so that +% (a) they use the counter mpfootnote +% (b) the footnotes they produce go at the bottom of the minipage. +% The switch is accomplished by letting \@mpfn == footnote or mpfootnote +% and \thempfn == \thefootnote or \thempfootnote, and by redefining +% \@footnotetext to be \@mpfootnotetext in the minipage. +% +% \footnote{NOTE} == +% BEGIN +% \stepcounter{\@mpfn} +% begingroup +% \protect == \noexpand +% \@thefnmark :=G eval (\thempfn) +% endgroup +% \@footnotemark +% \@footnotetext{NOTE} +% END +% +% \footnote[NUM]{NOTE} == +% BEGIN +% begingroup +% \protect == \noexpand +% counter \@mpfn :=L NUM +% \@thefnmark :=G eval (\thempfn) +% endgroup +% \@footnotemark +% \@footnotetext{NOTE} +% END +% +% \footnotemark == +% BEGIN \stepcounter{footnote} +% begingroup +% \protect == \noexpand +% \@thefnmark :=G eval(\thefootnote) +% endgroup +% \@footnotemark +% END +% +% \footnotemark[NUM] == +% BEGIN +% begingroup +% footnote counter :=L NUM +% \protect == \noexpand +% \@thefnmark :=G eval(\thefootnote) +% endgroup +% \@footnotemark +% END +% +% \@footnotemark == +% BEGIN +% \leavevmode +% IF hmode THEN \@x@sf := \the\spacefactor FI +% \@makefnmark % put number in main text +% IF hmode THEN \spacefactor := \@x@sf FI +% END +% +% \footnotetext == +% BEGIN begingroup \protect == \noexpand +% \@thefnmark :=G eval (\thempfn) +% endgroup +% \@footnotetext +% END +% +% \footnotetext[NUM] == +% BEGIN begingroup counter \@mpfn :=L NUM +% \protect == \noexpand +% \@thefnmark :=G eval (\thempfn) +% endgroup +% \@footnotetext +% END +% +% \end{oldcomments} +% +% +% \changes{v1.1l}{1995/05/24}{Moved definition of \cs{footins} +% and \cs{footnoterule} from ltplain.} +% +% \begin{macro}{\footins} +% \LaTeX\ does use the same insert for footnotes as PLAIN. +% \begin{macrocode} +\newinsert\footins +% \end{macrocode} +% +% \LaTeX\ leaves these initializations for the |\footins| insert. +% +% \begin{macrocode} +\skip\footins=\bigskipamount % space added when footnote is present +\count\footins=1000 % footnote magnification factor (1 to 1) +\dimen\footins=8in % maximum footnotes per page +% \end{macrocode} +% \end{macro} +% +% +% \begin{macro}{\footnoterule} +% \LaTeX\ keeps PLAIN \TeX's |\footnoterule| as the default. +% +% \begin{macrocode} +\def\footnoterule{\kern-3\p@ + \hrule \@width 2in \kern 2.6\p@} % the \hrule is .4pt high +% \end{macrocode} +% \end{macro} +% +% \begin{macro}{\thefootnote} +% \changes{v1.1i}{1995/05/16}{Streamlined parts of code.} +% \begin{macrocode} +\@definecounter{footnote} +\def\thefootnote{\@arabic\c@footnote} +% \end{macrocode} +% \end{macro} +% +% \begin{macro}{\thempfootnote} +% \changes{v1.1j}{1995/05/18}{Added \cs{itshape}.} +% \changes{v1.1v}{2002/10/01}{Use braces around \cs{itshape} +% to keep font change local (pr/3460).} +% The default display for the footnote counter in minipages is to +% use italic letters. We use |\itshape| not |\textit| as the latter +% would add an italic correction. +% \begin{macrocode} +\@definecounter{mpfootnote} +\def\thempfootnote{{\itshape\@alph\c@mpfootnote}} +% \end{macrocode} +% \end{macro} +% +% \begin{macro}{\@makefnmark} +% \changes{v1.1i}{1995/05/16}{Now use \cs{textsuperscript}.} +% \changes{v1.1j}{1995/05/18}{Added \cs{normalfont}.} +% \changes{v1.1k}{1995/05/20}{Moved \cs{normalfont} to +% \cs{textsuperscript}} +% \changes{v1.1k}{1995/05/20}{Moved \cs{normalfont} back +% and use \cs{@textsuperscript}} +% Default definition. +% \begin{macrocode} +%\def\@makefnmark{\hbox{$^{\@thefnmark}\m@th$}} +\def\@makefnmark{\hbox{\@textsuperscript{\normalfont\@thefnmark}}} +% \end{macrocode} +% \end{macro} +% +% \begin{macro}{\textsuperscript} +% \changes{v1.1i}{1995/05/16}{Command added./pr1503} +% \changes{v1.1k}{1995/05/20}{Use \cs{normalfont}.} +% \changes{v1.1l}{1995/05/24}{Use \cs{@textsuperscript}} +% This command provides superscript characters in the current text +% font. It's implementation might change!!! +% \begin{macrocode} +\DeclareRobustCommand*\textsuperscript[1]{% + \@textsuperscript{\selectfont#1}} +% \end{macrocode} +% \end{macro} +% +% \begin{macro}{\@textsuperscript} +% \changes{v1.1l}{1995/05/24}{Command added.} +% \changes{v1.1n}{1995/12/05}{Use \cs{ensuremath} for latex/1984.} +% \changes{v1.1m}{1995/12/07} +% {Move \cs{m@th} out of the \cs{ensuremath} for latex/1984.} +% This command should not be used directly, but may be used to define +% other commands |\textsuperscript|, |\@makefnmark|. |#1| should +% always start with a font selection command, to activate the font +% size switch. +% \begin{macrocode} +\def\@textsuperscript#1{% + {\m@th\ensuremath{^{\mbox{\fontsize\sf@size\z@#1}}}}} +% \end{macrocode} +% \end{macro} +% +% \begin{macro}{\footnotesep} +% \begin{macrocode} +\newdimen\footnotesep +% \end{macrocode} +% \end{macro} +% +% \begin{macro}{\footnote} +% \changes{LaTeX2.09}{1991/11/01} +% {(RmS) Added \cs{let}\cs{protect}\cs{noexpand} in +% \cs{footnote}, \cs{footnotemark}, +% and \cs{footnotetext}, since \cs{xdef} is used} +% \changes{LaTeX2.09}{1991/11/22} +% {(RmS) Added \cs{let}\cs{protect}\cs{noexpand} in +% \cs{@xfootnote}, \cs{@xfootnotemark}, +% and \cs{@xfootnotetext}} +% \changes{LaTeX2.09}{1992/11/26} +% {(RmS) Changed all to +% `def`protect\string{`noexpand`protect`noexpand\string}} +% \changes{v1.1b}{1994/11/26} +% {(ASAJ) Added \cs{protected@xdef}.} +% +% \begin{macrocode} +\def\footnote{\@ifnextchar[\@xfootnote{\stepcounter\@mpfn + \protected@xdef\@thefnmark{\thempfn}% + \@footnotemark\@footnotetext}} +% \end{macrocode} +% \end{macro} +% +% \begin{macro}{\@xfootnote} +% \begin{macrocode} +\def\@xfootnote[#1]{% + \begingroup + \csname c@\@mpfn\endcsname #1\relax + \unrestored@protected@xdef\@thefnmark{\thempfn}% + \endgroup + \@footnotemark\@footnotetext} +% \end{macrocode} +% \end{macro} +% +% \begin{macro}{\@footnotetext} +% \changes{LaTeX2.09}{1991/09/29} +% {(RmS) added \cs{reset@font}} +% \changes{LaTeX2.09}{1992/11/26} +% {(RmS) added protection for \cs{edef}} +% \changes{v1.0a}{1994/03/07} +% {(DPC) Extra group for colour} +% \changes{v1.0c}{1994/03/14} +% {(DPC) Use \cs{color@begingroup}, add \cs{endgraf}} +% \changes{v1.0d}{1994/04/18} +% {(DPC) Remove Colour support} +% \changes{v1.0g}{1994/05/13} +% {(DPC) Add new style colour support: \cs{normalcolor}} +% \changes{v1.0g}{1994/05/13} +% {(DPC) Use \cs{@finalstrut}} +% \changes{v1.1a}{1994/10/31} +% {(DPC/CAR) Move colour setting to output routine} +% \changes{v1.1b}{1994/11/04} +% {(ASAJ) Added \cs{protected@edef}.} +% \changes{v1.1c}{1994/11/05} +% {Removed \cs{normalcolor} (again)} +% \changes{v1.1t}{1997/11/19} +% {Missing percent, again} +% \begin{macrocode} +\long\def\@footnotetext#1{\insert\footins{% + \reset@font\footnotesize + \interlinepenalty\interfootnotelinepenalty + \splittopskip\footnotesep + \splitmaxdepth \dp\strutbox \floatingpenalty \@MM + \hsize\columnwidth \@parboxrestore + \protected@edef\@currentlabel{% + \csname p@footnote\endcsname\@thefnmark + }% + \color@begingroup + \@makefntext{% + \rule\z@\footnotesep\ignorespaces#1\@finalstrut\strutbox}% + \color@endgroup}}% +% \end{macrocode} +% \end{macro} +% +% \begin{macro}{\footnotemark} +% \changes{v1.1b}{1994/11/04}{Added \cs{protected@xdef} to +% \cs{footnotemark}.} +% \begin{macrocode} +\def\footnotemark{% + \@ifnextchar[\@xfootnotemark + {\stepcounter{footnote}% + \protected@xdef\@thefnmark{\thefootnote}% + \@footnotemark}} +% \end{macrocode} +% \end{macro} +% +% \begin{macro}{\@xfootnotemark} +% \begin{macrocode} +\def\@xfootnotemark[#1]{% + \begingroup + \c@footnote #1\relax + \unrestored@protected@xdef\@thefnmark{\thefootnote}% + \endgroup + \@footnotemark} +% \end{macrocode} +% \end{macro} +% +% \begin{macro}{\@footnotemark} +% \changes{v1.1h}{1995/05/12} +% {Add \cs{nobreak} to allow hyphenation. latex/1605} +% \begin{macrocode} +\def\@footnotemark{% + \leavevmode + \ifhmode\edef\@x@sf{\the\spacefactor}\nobreak\fi + \@makefnmark + \ifhmode\spacefactor\@x@sf\fi + \relax} +% \end{macrocode} +% \end{macro} +% +% \begin{macro}{\footnotetext} +% \begin{macrocode} +\def\footnotetext{% + \@ifnextchar [\@xfootnotenext + {\protected@xdef\@thefnmark{\thempfn}% + \@footnotetext}} +% \end{macrocode} +% \end{macro} +% +% \begin{macro}{\@xfootnotenext} +% \begin{macrocode} +\def\@xfootnotenext[#1]{% + \begingroup + \csname c@\@mpfn\endcsname #1\relax + \unrestored@protected@xdef\@thefnmark{\thempfn}% + \endgroup + \@footnotetext} +% \end{macrocode} +% \end{macro} +% +% \begin{macro}{\thempfn} +% \begin{macro}{\@mpfn} +% \begin{macrocode} +\def\@mpfn{footnote} +\def\thempfn{\thefootnote} +% +% \end{macrocode} +% \end{macro} +% \end{macro} +% +% \Finale +% diff --git a/Master/texmf-dist/source/latex/base/ltfntcmd.dtx b/Master/texmf-dist/source/latex/base/ltfntcmd.dtx new file mode 100644 index 00000000000..f6850793662 --- /dev/null +++ b/Master/texmf-dist/source/latex/base/ltfntcmd.dtx @@ -0,0 +1,777 @@ +% \iffalse meta-comment +% +% Copyright 1993 1994 1995 1996 1997 1998 1999 2000 2001 2002 2003 2004 +% The LaTeX3 Project and any individual authors listed elsewhere +% in this file. +% +% This file is part of the LaTeX base system. +% ------------------------------------------- +% +% It may be distributed and/or modified under the +% conditions of the LaTeX Project Public License, either version 1.3 +% of this license or (at your option) any later version. +% The latest version of this license is in +% http://www.latex-project.org/lppl.txt +% and version 1.3 or later is part of all distributions of LaTeX +% version 2003/12/01 or later. +% +% This file has the LPPL maintenance status "maintained". +% +% The list of all files belonging to the LaTeX base distribution is +% given in the file `manifest.txt'. See also `legal.txt' for additional +% information. +% +% The list of derived (unpacked) files belonging to the distribution +% and covered by LPPL is defined by the unpacking scripts (with +% extension .ins) which are part of the distribution. +% +% \fi +% \iffalse +%%% From File: ltfntcmd.dtx +%% +%<*driver> +% \fi +\ProvidesFile{ltfntcmd.dtx} + [2003/01/01 v3.3z LaTeX Kernel (Font commands)] +% \iffalse +\documentclass{ltxdoc} +\GetFileInfo{ltfntcmd.dtx} +\title{\filename} +\date{\filedate} +\author{Frank Mittelbach, Chris Rowley} +\begin{document} +\maketitle + \DocInput{\filename} +\end{document} +% +% \fi +% +% \CheckSum{256} +% +%% \CharacterTable +%% {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 +%% 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 +%% Digits \0\1\2\3\4\5\6\7\8\9 +%% Exclamation \! Double quote \" Hash (number) \# +%% Dollar \$ Percent \% Ampersand \& +%% Acute accent \' Left paren \( Right paren \) +%% Asterisk \* Plus \+ Comma \, +%% Minus \- Point \. Solidus \/ +%% Colon \: Semicolon \; Less than \< +%% Equals \= Greater than \> Question mark \? +%% Commercial at \@ Left bracket \[ Backslash \\ +%% Right bracket \] Circumflex \^ Underscore \_ +%% Grave accent \` Left brace \{ Vertical bar \| +%% Right brace \} Tilde \~} +% +% \iffalse +% Copyright (C) 1994-1995 Frank Mittelbach and Chris Rowley +% all rights reserved. +% \fi +% +% \changes{v2.0b}{1993/05/05}{Removed all LaTeX related cmds} +% \changes{v3.0a}{1993/12/11}{Complete reworking of all text commands, +% using just one creator function} +% \changes{v3.0a}{1993/12/11}{newfontswitch command corrected and +% changed} +% \changes{v3.0a}{1993/12/11}{newcommands replaced by defs} +% \changes{v3.0a}{1993/12/11}{italic correction now put in front of +% penalty before glue} +% \changes{v3.0b}{1993/12/19}{\cs{@pdef} comand added} +% \changes{v3.0b}{1993/12/19}{Other tidying} +% \changes{v3.0b}{1993/12/19}{Made \cs{@newfontswitch} produce an +% error if command already exists, and added \cs{@renewfontswitch}, +% ASAJ} +% \changes{v3.0b}{1993/12/19}{Untidying added, so this is now a +% TEMPORARY version.} +% \changes{v3.0b}{1993/12/19}{Some more tidying done} +% \changes{v3.1b}{1994/01/31}{\cs{@normalsize} no longer defined} +% \changes{v3.2a}{1994/03/15}{Adapted to mass formatting} +% \changes{v3.2a}{1994/03/15}{Removed defs of short-forms and all +% sizes except \cs{normalize}} +% \changes{v3.2a}{1994/03/15}{Removed \cs{@renewfontswitch}} +% \changes{v3.2a}{1994/03/15}{Changed \cs{/} to \cs{@@italiccorr}} +% \changes{v3.2b}{1994/04/14}{Macros renamed to non-private forms, JB} +% \changes{v3.3a}{1994/04/20}{New implementation of \cs{\nocorr}} +% \changes{v3.3a}{1994/04/20}{Documentation up-dated} +% \changes{v3.3b}{1994/04/30}{Documentation up-dated and tidied} +% \changes{v3.3b}{1994/04/30}{Title changed} +% \changes{v3.3b}{1994/04/30}{Prefix frag@ changed to frag in +% \cs{@protecteddef}} +% \changes{v3.3b}{1994/04/30}{Warning changed to info message in +% \cs{@protecteddef}} +% \changes{v3.3c}{1994/05/05}{Corrected \cs{@fontswitch}} +% \changes{v3.3d}{1994/05/08}{Removed \cs{@undefinedfonterror}} +% \changes{v3.3f}{1994/05/09}{Replaced all \cs{next} by +% \cs{@let@token} and undo change 3.3e, +% whatever that was.} +% \changes{v3.3g}{1994/05/13}{Replaced \cs{@protecteddef} by +% \cs{DeclareRobustCommand}} +% \changes{v3.3h}{1994/05/20}{Use new error commands} +% \changes{v3.3i}{1994/05/24}{Tidying and typos fixed} +% \changes{v3.3j}{1994/05/25}{Insertion of \cs{aftergroup}s to +% implement \cs{nocorr} moved to the end of the group} +% \changes{v3.3k}{1994/06/09}{Tidying and typos fixed in documentation} +% \changes{v3.3l}{1994/06/18}{Added check for empty text} +% \changes{v3.3m}{1994/06/22}{Removed space from \cs{nfss@text}} +% \changes{v3.3m}{1994/06/22}{Renamed \cs{check@nocorr}} +% \changes{v3.3p}{1994/11/17} +% {\cs{@tempa} to \cs{reserved@a}} +% \changes{v3.3v}{1997/06/16}{Fix typo in documentation.} +% \changes{v3.3x}{1998/08/17}{(RmS) Minor documentation fixes.} +% +% \def \ie {i.e.~} +% \def \eg {e.g.~} +% +% \def \dst {{\normalfont\scshape docstrip}} +% \def \NFSS {\textsf{NFSS}} +% +% +% \begin{abstract} +% The commands defined in this file \texttt{ltfntcmd} are +% part of the kernel code for \LaTeXe/NFSS2. +% +% It is also meant to serve as documentation for package writers since +% it demonstrates how to define high-level font changing commands +% using a small number of creator functions. +% \end{abstract} +% +% \section{Introduction} +% +% Font changes such as |\bfseries|, |\sffamily|, etc.\ are +% declarations; this means that their scope is delimited by the +% grouping structure, either by the next |\end| of some environment or +% by explicitly using a group, e.g., writing something like +% |{\bfseries...}| in the source. If you make the mistake of writing +% |\bfseries{...}| (thinking of |\bfseries| as a command with one +% argument) then the result is rather striking. +% +% Font declarations are an artifact of the \TeX{} system and for +% several reasons it is better to avoid them on the user level +% whenever possible. In \LaTeX3 they will probably all be +% replaced by environments and by font commands taking one argument. +% +% This file defines a creator function for such declarative font +% switches. This function creates commands which can be used in +% both math and text. +% +% This file also defines a number of high-level commands (all +% starting with |\text..|) that have one argument and typeset this +% argument in the requested way. Thus these commands are for +% typesetting short pieces of text in a specific family, series or +% shape. These are all produced as examples of the use of a creator +% function which is itself also defined in this file. +% +% Table~\ref{tab:fontcmds} shows all these high-level commands in +% action. A further advantage of using these commands is that they +% automatically take care of any necessary italic correction on either +% side of their argument. +% \begin{table}[t] +% \begin{center} +% \begin{tabular}{lll} +% \textit{Command} & \textit{Corresponds to }& \textit{Action} \\[4pt] +% |\textrm{..}| & |\rmfamily| & +% Typeset argument in roman family \\ +% |\textsf{..}| & |\sffamily| & +% Typeset argument in \textsf{sans serif} family \\ +% |\texttt{..}| & |\ttfamily| & +% Typeset argument in \texttt{typewriter} family +% \\[2pt] +% |\textmd{..}| & |\mdseries| & +% Typeset argument in medium series \\ +% |\textbf{..}| & |\bfseries| & +% Typeset argument in \textbf{bold} series \\[2pt] +% |\textup{..}| & |\upshape| & +% Typeset argument in normal shape \\ +% |\textit{..}| & |\itshape| & +% Typeset argument in \textit{italic} shape \\ +% |\textsl{..}| & |\slshape| & +% Typeset argument in \textsl{slanted} shape \\ +% |\textsc{..}| & |\scshape| & +% Typeset argument in \textsc{small caps} shape +% \\[2pt] +% |\emph{..}| & |\em| & +% Typeset argument \emph{emphasized} +% \end{tabular} +% \end{center} +% \caption{Font-change commands with arguments} +% \label{tab:fontcmds} +% \begin{quote} +% The font change commands provided here +% all start with |\text..| to emphasize that they +% are for use in normal text and to be easily memorable. They +% automatically take care of any necessary italic correction on either +% side of the argument. +% \end{quote} +% \end{table} +% +% Thus, when using such commands, one does not have to worry about +% forgetting the italic correction when changing fonts. Only in very +% few situations is this additional space wrong but, for example, most +% typographers recommend omitting the italic correction if a small +% punctuation character, like a comma, directly follows the font +% change. Since the amount of correction required is partly a matter +% of taste, you can define in what situations the italic correction +% should be suppressed. This is done by putting the characters that +% should cancel a preceding italic correction in the list +% |\nocorrlist|.\footnote{Any package that changes the +% \texttt{\string\catcode} of a character inside +% \texttt{\string\nocorrlist} must then explicitly reset the list. +% Otherwise the changed character will no longer be recognized +% by the suppression algorithm.} +% The default definition for this list is produced by the following. +% \begin{verbatim} +% \newcommand \nocorrlist {,.} +% \end{verbatim} +% It is best to declare the most often used characters first, because +% this will make the processing slightly faster. For example, +% \begin{verbatim} +% \emph{When using the \NFSS{} high-level commands, +% the \emph{proper} use of italic corrections is +% automatically taken care of}. Only +% \emph{sometimes} one has to help \LaTeX{} by +% adding a \verb=\nocorr= command. +% \end{verbatim} +% which results in: +% \begin{quote} +% \emph{When using the \NFSS{} high-level commands, +% the \emph{proper} use of italic corrections is +% automatically taken care of}. Only +% \emph{sometimes} one has to help \LaTeX{} by +% adding a \verb=\nocorr= command. +% \end{quote} +% +% In contrast, the use of the declaration forms is often more +% appropriate when you define your own commands or environments. +% \begin{verbatim} +% \newenvironment{bfitemize}{\begin{itemize}\normalfont\bfseries} +% {\end{itemize}} +% \begin{bfitemize} +% \item This environment produces boldface items. +% \item It is defined in terms of \LaTeX's +% \texttt{itemize} environment and NFSS +% declarations. +% \end{bfitemize} +% \end{verbatim} +% This gives: +% \begin{quote} +% \newenvironment{bfitemize} +% {\begin{itemize}\normalfont\bfseries} +% {\end{itemize}} +% \begin{bfitemize} +% \item This environment produces boldface items. +% \item It is defined in terms of \LaTeX's +% \texttt{itemize} environment and NFSS +% declarations. +% \end{bfitemize} +% \end{quote} +% +% In addition to global customization of when to insert the italic +% correction, it is of course sometimes necessary to explicitly insert +% one with |\/|. +% +% It is also possible to suppress the italic correction +% in individual instances. For this, the command |\nocorr| is provided. +% +% The |\nocorr| must appear as the first or last token inside the +% braces of the argument of the |\text...| commands, at that end of +% the text where you wish to suppress the italic correction. +% +% +% It is worth pointing out here that inserting a |\/| in places where +% it can have no function (\ie anywhere except immediately after a +% slanted letter) is not an error---it will just be silently ignored. +% Unfortunately this is not true if the redefinition of |\/| in {\tt +% amstex.sty} is used as this version can cause space to be removed +% immediately before the |\/|. +% +% \StopEventually{} +% +% +% \section{The implementation} +% +% \changes{v3.3z}{2003/01/01}{Code checked and documentation extended +% by Chris} +% +% \begin{macro}{\DeclareTextFontCommand} +% \changes{v3.0a}{1993/12/11}{Macro changed} +% \changes{v3.0a}{1993/12/11}{Macro changed} +% This is the creator function for |\text..| commands. +% It gives a warning if |\foo| or |\fragfoo| is already defined. +% \changes{v3.0b}{1993/12/19}{Corrected and tidied} +% +% In math mode it simply puts the font declaration and text into a +% box (possibly an automagically sized one). +% +% Otherwise it first scans the text to see where |\nocorr| occurs +% within it. This sets the |\check@ic| commands to do what is +% necessary concerning the italic correction at both ends. +% +% The algorithm for deciding whether to put in an italic correction +% is not very subtle: one is added whenever the newly current font +% is not itself positively sloped, unless the next token is a +% character in the `nocorr' list. At the end of the text this +% is done after closing the group so as to check the `outer font'. +% Note that this +% will often result in adding an italic correction token after a +% character in an unsloped font; we believe (in early 2003) that +% this is perhaps inefficient but not dangerous. +% +% It also now checks for empty contents of the text command and optimises +% this case. Some care is also taken to check that doing dangerous +% things in vertical mode is avoided. +% +% The italic correction token is added to the horizontal list +% before (in the list) an immediately prceding non-zero glob of +% glue (skip) and any non-zero penalty preceding that since, in +% the typical case, this puts it immediately +% after the last character in the preceding word. +% +% +% \changes{v3.3j}{1994/05/25}{Insertion of \cs{aftergroup}s moved} +% \changes{v3.3j}{1994/05/25}{\cs{expandafter} inserted} +% \changes{v3.3m}{1994/06/22}{Removed space from \cs{nfss@text}} +% \changes{v3.3u}{1996/10/08}{Removed \cs{check@icr} when in vmode +% since it causes various errors (see pr/2157)} +% \changes{v3.3w}{1997/10/17}{Reinstalled \cs{check@icr} as check is +% now done in \cs{check@nocorr@} (see PR/2646).} +% \changes{v3.3y}{2000/01/30}{Use \cs{hmode@bgroup} now (pr/3160)} +% +% Note that it is necessary to put in the |\aftergroup\maybe@ic| at +% the end of the group so that it comes after any other aftergroup +% tokens and immediately before the following tokens. +% It is also necessary to remove the |\fi| from the token list before +% the group ends; this is done by adding an |\expandafter| just +% before the closing brace. +% +% \begin{macrocode} +%<*2ekernel> +\def \DeclareTextFontCommand #1#2{% + \DeclareRobustCommand#1[1]{% + \ifmmode + \nfss@text{#2##1}% + \else + \hmode@bgroup + \text@command{##1}% + #2\check@icl ##1\check@icr + \expandafter + \egroup + \fi + }% +} +% \end{macrocode} +% \end{macro} +% +% \begin{macro}{\textrm} +% \begin{macro}{\textsf} +% \begin{macro}{\texttt} +% \begin{macro}{\textnormal} +% Now we define the |\text|\meta{family} commands in terms of the +% above; |\texttt| does not look very nice! +% \begin{macrocode} +\DeclareTextFontCommand{\textrm}{\rmfamily} +\DeclareTextFontCommand{\textsf}{\sffamily} +\DeclareTextFontCommand{\texttt}{\ttfamily} +\DeclareTextFontCommand{\textnormal}{\normalfont} +% \end{macrocode} +% \end{macro} +% \end{macro} +% \end{macro} +% \end{macro} +% +% \begin{macro}{\textbf} +% \begin{macro}{\textmd} +% For the series attribute: +% \begin{macrocode} +\DeclareTextFontCommand{\textbf}{\bfseries} +\DeclareTextFontCommand{\textmd}{\mdseries} +% \end{macrocode} +% \end{macro} +% \end{macro} +% +% \begin{macro}{\textit} +% \begin{macro}{\textsl} +% \begin{macro}{\textsc} +% \begin{macro}{\textup} +% \changes{v3.0a}{1993/12/11}{Macros changed} +% And for the shapes: +% \begin{macrocode} +\DeclareTextFontCommand{\textit}{\itshape} +\DeclareTextFontCommand{\textsl}{\slshape} +\DeclareTextFontCommand{\textsc}{\scshape} +\DeclareTextFontCommand{\textup}{\upshape} +% \end{macrocode} +% \end{macro} +% \end{macro} +% \end{macro} +% \end{macro} +% +% \begin{macro}{\emph} +% \changes{v3.0a}{1993/12/11}{Macro changed} +% Finally we have the |\em| font change declaration of \LaTeX. The +% corresponding definition with argument is +% \begin{macrocode} +\DeclareTextFontCommand{\emph}{\em} +% \end{macrocode} +% \end{macro} +% +% \begin{macro}{\nocorr} +% This is just a label, so it does nothing; it should also be +% unexpandable. +% \begin{macrocode} +\let \nocorr \relax +% \end{macrocode} +% \end{macro} +% +% \begin{macro}{\check@icl} +% \begin{macro}{\check@icr} +% \changes{v3.3j}{1994/05/25}{Macros added} +% \changes{v3.3t}{1996/05/09}{Default definitions added} +% We define these defaults in case some error causes them to be +% expanded at the wrong time. +% \begin{macrocode} +\let \check@icl \@empty +\let \check@icr \@empty +% \end{macrocode} +% \end{macro} +% \end{macro} +% +% \begin{macro}{\text@command} +% \begin{macro}{\check@nocorr@} +% \changes{v3.3a}{1994/04/20}{Macros added} +% \changes{v3.3m}{1994/06/22}{Renamed \cs{check@nocorr} to +% \cs{text@command} to improve \cs{long} error message} +% \changes{v3.3j}{1994/05/25}{Insertion of \cs{aftergroup}s moved +% and defaults set up for efficiency} +% This checks for a |\nocorr| as the first token in its argument +% and also for one in any other position not protected within +% braces (the latter is treated as if it were at the end of the +% argument). +% +% Is this the correct action in the `empty' case? It is efficient but +% typographically it is, strictly, incorrect! +% \changes{v3.3l}{1994/06/18}{Added check for empty text} +% \begin{macrocode} +\def \text@command #1{% + \def \reserved@a {#1}% + \ifx \reserved@a \@empty + \let \check@icl \@empty + \let \check@icr \@empty + \else +% \end{macrocode} +% |\space| is a reserved word in \LaTeX{} or actually already in +% plain \TeX. If somebody really redefines it so many things will +% break that I don't see any reason to make this routine here +% slower than necessary. +% \changes{v3.3q}{1994/12/10}{Use \cs{space} command for comparison} +% \begin{macrocode} +% \def \reserved@b { }% +% \ifx \reserved@a \reserved@b + \ifx \reserved@a \space + \let \check@icl \@empty + \let \check@icr \@empty + \else + \check@nocorr@ #1\nocorr\@nil + \fi + \fi +} +\def \check@nocorr@ #1#2\nocorr#3\@nil {% +% \end{macrocode} +% The two checks are initialised here to their values in +% the normal case. +% \changes{v3.3w}{1997/10/17}{Check for vertical mode moved here, from +% \cs{DeclareTextFontCommand} (see PR/2646).} +% \begin{macrocode} + \let \check@icl \maybe@ic + \def \check@icr {\ifvmode \else \aftergroup \maybe@ic \fi}% + \def \reserved@a {\nocorr}% + \def \reserved@b {#1}% + \def \reserved@c {#3}% + \ifx \reserved@a \reserved@b + \ifx \reserved@c \@empty +% \end{macrocode} +% In this case there is a |\nocorr| at the start but not at the +% end, so |\check@icl| should be empty. +% \begin{macrocode} + \let \check@icl \@empty + \else +% \end{macrocode} +% Otherwise there is a |\nocorr| both at the start and +% elsewhere, so no italic corrections should be added. +% \begin{macrocode} + \let \check@icl \@empty + \let \check@icr \@empty + \fi + \else + \ifx \reserved@c \@empty +% \end{macrocode} +% In this case there is no |\nocorr| anywhere, so we need to check +% for an italic correction at both the beginning and the end. This +% has been set up as the default so no code is needed here. +% \begin{macrocode} + \else +% \end{macrocode} +% In this case there is no |\nocorr| at the start but there is one +% elsewhere, so no |\aftergroup| is needed. +% \begin{macrocode} + \let \check@icr \@empty + \fi + \fi +} +% \end{macrocode} +% \end{macro} +% \end{macro} +% +% \begin{macro}{\maybe@ic} +% \changes{v3.0a}{1993/12/11}{Macro name changed} +% \begin{macro}{\maybe@ic@} +% \changes{v3.0a}{1993/12/11}{Macro and name changed} +% \task{CAR}{Make this more efficient by checking for non-characters +% first and using \cs{if} test?} +% These macros implement the italic correction. +% \begin{macrocode} +\def \maybe@ic {\futurelet\@let@token\maybe@ic@} +\def \maybe@ic@ {% +% \end{macrocode} +% We first check to see if the current font is positively sloped. +% (But do not forget the message Rainer sent about an upright font +% with non-zero slope! Or is this an urban myth?) It has been +% suggested that this should test against a small positive value, +% but what? +% \begin{macrocode} + \ifdim \fontdimen\@ne\font>\z@ + \else + \@tempswatrue +% \end{macrocode} +% It would be possible, but probably not worthwhile, to continue the +% forward scan beyond any closing braces. +% +% \changes{v3.3a}{1994/04/20}{\cs{nocorr} etc removed from list of +% tokens to check, leaving only punctuation characters} +% \begin{macrocode} + \expandafter\@tfor\expandafter\reserved@a\expandafter:\expandafter=% + \nocorrlist +% \end{macrocode} +% We have to hide the |\@let@token| in the macro |\t@st@ic| rather +% than testing it directly in the loop since it might be |\let| +% to a |\fi| or |\else|, which would result in chaos. +% \changes{v2.1a}{1993/11/24}{Use \cs{t@st@ic}} +% \begin{macrocode} + \do \t@st@ic +% \end{macrocode} +% Frank thinks that the next bit it is inefficient if done after +% the second change. Chris thinks that most all of this is +% inefficient for the commonest cases: but that is the price of a +% cleverer algorithm. It is certainly needed to deal with the use +% of |\nolinebreak|. +% +% \begin{macrocode} + \if@tempswa \sw@slant \fi + \fi +} +% \end{macrocode} +% \end{macro} +% \end{macro} +% +% \begin{macro}{\t@st@ic} +% \changes{v2.1a}{1993/11/24}{Macro added} +% \changes{v3.3s}{1995/07/05}{Renamed from \cs{test@next}} +% The next token in the input stream is stored in |\@let@token| via a +% |\let|, the current token from |\nocorrlist| is stored via |\def| +% in |\reserved@a|. To compare them we have to fiddle around a bit. +% +% If the only things to check were characters then this could be +% done via an |\if| thus their catcodes would not matter; but this +% will not work whilst |\futurelet| is used above. +% \begin{macrocode} +\def \t@st@ic {% + \expandafter\let\expandafter\reserved@b\expandafter=\reserved@a\relax + \ifx\reserved@b\@let@token +% \end{macrocode} +% If they are the same we record the fact and jump out of the loop. +% \changes{v3.3s}{1995/07/03}{Use clean interface for jump} +% \begin{macrocode} + \@tempswafalse + \@break@tfor + \fi +} +% \end{macrocode} +% \end{macro} +% +% \begin{macro}{\sw@slant} +% \changes{v3.0a}{1993/12/11}{Macro changed} +% \begin{macro}{\fix@penalty} +% \changes{v3.0a}{1993/12/11}{Macro added} +% The definition of the mysterious |\sw@slant| command is as follows. +% \begin{macrocode} +\def \sw@slant {% +% \end{macrocode} +% It is surely correct to put in an italic correction when there +% is no skip. If the last thing on the list is actually a zero +% skip (including things whose dimension part is zero, such as +% |\hfill|), or anything other than a character, then the +% italic correction will have no effect. +% +% In order to work correctly with unbreakable spaces from |~| +% (and other common forms of line-breaking control) we also move +% back across a penalty before the glue. +% \begin{macrocode} + \ifdim \lastskip=\z@ + \fix@penalty + \else + \skip@ \lastskip + \unskip + \fix@penalty + \hskip \skip@ + \fi +} +% \end{macrocode} +% The above code means: ``If there is a non-zero space just before +% the current position (|\ifdim...|) save the amount of that space +% (|\skip@\lastskip|), remove it (|\unskip|), then do a similar +% thing if there is a penalty just before the skip, +% and finally put the space back in.'' +% +% Since zero glue cannot be distinguished in this context from no +% glue, we dare not put in an |\hskip| in this case as this may +% produce an unwanted breakpoint. This is not satisfactory. +% +% The penalty before the glue is handled similarly, with the same +% caveats concerning the zero case. Is this the first recorded +% use of |\unpenalty| in standard \LaTeX{} code? +% \begin{macrocode} +\def \fix@penalty {% + \ifnum \lastpenalty=\z@ + \@@italiccorr + \else + \count@ \lastpenalty + \unpenalty + \@@italiccorr + \penalty \count@ + \fi +} +% \end{macrocode} +% \end{macro} +% \end{macro} +% +% \begin{macro}{\nocorrlist} +% This holds the list of characters that should prevent italic +% correction. They should be ordered by decreasing frequency of +% use. If any such character is made active later on one needs +% to redefine the list so that the active character becomes part +% of it. +% \changes{v3.1a}{1994/01/27}{Only ., used as default for cm fonts} +% \begin{macrocode} +\def \nocorrlist {,.} +% \end{macrocode} +% \end{macro} +% +% +% \begin{macro}{\nfss@text} +% This command will by default behave like a \LaTeX{} |\mbox| but +% may be redefined by packages such as |amstext.sty| to be a bit +% cleverer. +% \begin{macrocode} +\ifx \nfss@text\@undefined + \def \nfss@text {\leavevmode\hbox} +\fi +% \end{macrocode} +% \end{macro} +% +% +% \begin{macro}{\DeclareOldFontCommand} +% \changes{v3.2b}{1994/04/14}{Renamed from \cs{@newfontswitch}} +% This is the function used to create declarative font-changing +% commands that can also be used to change alphabets in math-mode. +% +% Usage: |\DeclareOldFontCommand \fn{|\meta{font-change decls}|}| +% \meta{math-alphabet} +% +% Here |\fn| is the font-declaration command being defined, +% \meta{font-change decls} is the declaration it will expand to in +% text-mode, and \meta{math-alphabet} is the (single) math alphabet +% specifier which is to be used in math-mode. +% +% It does not care whether the command being defined already +% exists but it does give a warning if it redefines anything. +% +% Here are some typical examples of its use in conjunction with +% more basic NFSS2 font commands. +% \begin{verbatim} +% \DeclareOldFontCommand{\rm}{\normalfont\rmfamily}{\mathrm} +% \DeclareOldFontCommand{\sf}{\normalfont\sffamily}{\mathsf} +% \DeclareOldFontCommand{\tt}{\normalfont\ttfamily}{\mathtt} +% \end{verbatim} +% +% \changes{v3.0b}{1993/12/19}{Corrected and tidied} +% \begin{macrocode} +\def \DeclareOldFontCommand #1#2#3{% + \DeclareRobustCommand #1{\@fontswitch {#2}{#3}}% +} +% \end{macrocode} +% \end{macro} +% +% \begin{macro}{\@fontswitch} +% \begin{macro}{\@@math@egroup} +% \begin{macro}{\@@math@egroup} +% These two commands actually do the necessary tests and +% declarative \mbox{font-} or alphabet-changing. +% +% \changes{v3.3c}{1994/05/05}{Corrected \cs{@fontswitch} and added +% saved versions} +% \changes{v3.3q}{1994/12/10}{Don't read arguments} +% \changes{v3.3r}{1995/04/02}{Read them again to be able to add \cs{relax}.} +% \begin{macrocode} +\def \@fontswitch #1#2{% + \ifmmode + \let \math@bgroup \relax + \def \math@egroup {\let \math@bgroup \@@math@bgroup + \let \math@egroup \@@math@egroup}% +% \end{macrocode} +% We need to have a |\relax| in the following line in case the |#2| +% is something like |\mathsf| grabbing the next token as an +% argument. For this reason the code also uses explicit arguments +% again (see pr/1275). +% \begin{macrocode} + #2\relax + \else + #1% + \fi +} +\let \@@math@bgroup \math@bgroup +\let \@@math@egroup \math@egroup +% \end{macrocode} +% \end{macro} +% \end{macro} +% \end{macro} +% +% \changes{v2.1b}{1993/12/08}{Macros \cs{rm}, \cs{bf} and \cs{sf} +% moved to classes.dtx} +% +% These commands are available only in the preamble. +% \begin{macrocode} +\@onlypreamble \DeclareTextFontCommand +\@onlypreamble \DeclareOldFontCommand +% \end{macrocode} +% +% \section{Initialization} +% \changes{v3.0b}{1993/12/19}{Added by ASAJ.} +% \changes{v3.0b}{1993/12/19}{Wording changes by CAR.} +% +% \begin{macro}{\normalsize} +% \changes{v3.3d}{1994/05/08}{Removed \cs{@undefinedfonterror}} +% \changes{v3.3o}{1994/11/12}{Added \cs{MessageBreak}} +% This is defined to produce an error. +% \begin{macrocode} +\def\normalsize{% + \@latex@error {The font size command \protect\normalsize\space + is not defined:\MessageBreak + there is probably something wrong with + the class file}\@eha +} +% +% \end{macrocode} +% \end{macro} +% +% \Finale +\endinput diff --git a/Master/texmf-dist/source/latex/base/ltfssbas.dtx b/Master/texmf-dist/source/latex/base/ltfssbas.dtx new file mode 100644 index 00000000000..4adafd0cea4 --- /dev/null +++ b/Master/texmf-dist/source/latex/base/ltfssbas.dtx @@ -0,0 +1,1910 @@ +% \iffalse meta-comment +% +% Copyright 1993 1994 1995 1996 1997 1998 1999 2000 2001 2002 2003 2004 +% The LaTeX3 Project and any individual authors listed elsewhere +% in this file. +% +% This file is part of the LaTeX base system. +% ------------------------------------------- +% +% It may be distributed and/or modified under the +% conditions of the LaTeX Project Public License, either version 1.3 +% of this license or (at your option) any later version. +% The latest version of this license is in +% http://www.latex-project.org/lppl.txt +% and version 1.3 or later is part of all distributions of LaTeX +% version 2003/12/01 or later. +% +% This file has the LPPL maintenance status "maintained". +% +% The list of all files belonging to the LaTeX base distribution is +% given in the file `manifest.txt'. See also `legal.txt' for additional +% information. +% +% The list of derived (unpacked) files belonging to the distribution +% and covered by LPPL is defined by the unpacking scripts (with +% extension .ins) which are part of the distribution. +% +% \fi +% \iffalse +%%% From File: ltfssbas.dtx +%% Copyright (C) 1989-2002 Frank Mittelbach and Rainer Sch\"opf +% +%\ProvidesFile{autofss1.sty} +% [2002/10/02 v3.0x NFSS autoload file 1] +%\ProvidesFile{autofss2.sty} +% [2002/10/02 v3.0x NFSS autoload file 2] +% +%<*driver> +% \fi +% +% +\ProvidesFile{ltfssbas.dtx} + [2002/10/02 v3.0x LaTeX Kernel (NFSS Basic Macros)] +% \iffalse +\documentclass{ltxdoc} +\begin{document} +\DocInput{ltfssbas.dtx} +\end{document} +% +% \fi +% +% \iffalse +%<+checkmem>\def\CHECKMEM{\tracingstats=2 +%<+checkmem> \newlinechar=`\^^J +%<+checkmem> \message{^^JMemory usage: \filename}\shipout\hbox{}} +%<+checkmem>\CHECKMEM +% \fi +% +% \CheckSum{1089} +% +% +% \GetFileInfo{ltfssbas.dtx} +% \title{A new font selection scheme for \TeX{} macro packages\\ +% (Basic Macros)\thanks +% {This file has version number +% \fileversion\ dated \filedate}} +% +% \author{Frank Mittelbach \and Rainer Sch\"opf} +% +% \maketitle +% +% This file contains the main implementation of the `low level' font +% selection commands. See other parts of the \LaTeX\ +% distribution, or \emph{The \LaTeX\ Companion} for higher level +% documentation of the \LaTeX\ `New' Font Selection Scheme. +% +% \begin{quote} +% \textbf{Warning:} +% The macro documentation is still basically the documentation from the +% first NFSS release and therefore in some cases probably not +% completely accurate. +% \end{quote} +% +% \StopEventually{} +% +% \changes{v3.0v}{1998/08/17}{(RmS) Documentation fixes.} +% \changes{v3.0j}{1995/10/22}{(RmS) New size function macro +% \cs{genb@sfcnt} needs to be disabled at \cs{document}.} +% \changes{v3.0i}{1995/10/20} +% {(DPC) Modify autoload code, change \cs{undefined}} +% \changes{v3.0g}{1995/10/04}{Modify autoload code} +% \changes{v3.0f}{1995/08/24}{Added autoload code} +% \changes{v3.0d}{1995/07/13} +% {minor documentation changes} +% \changes{v3.0c}{1995/06/15} +% {(DPC) minor documentation changes} +% \changes{v3.0a}{1995/05/24} +% {(DPC) Make file from previous file, fam.dtx 1995/05/20 v2.2d} +% +% +% \changes{v2.1x}{1994/11/18}{(DPC) use \cs{reserved@f} not \cs{next}} +% \changes{v2.1q}{1994/05/20}{Use new error commands} +% \changes{v2.1o}{1994/05/15}{encoding cmds changed to {enc}-cmd} +% \changes{v2.1k}{1994/05/13}{Remove File identification `typeout'} +% \changes{v2.1j}{1994/05/12}{New baselinestretch concept} +% \changes{v2.1j}{1994/05/12}{Replaced hand-protected commands by +% \cs{DeclareRobustCommand} defs} +% \changes{v2.1h}{1994/04/11}{Added \cs{defaultscriptratio} and +% \cs{defaultscriptscriptratio}. ASAJ.} +% \changes{v2.1g}{1994/03/13}{add 2ekernel module to omit repeated code} +% \changes{v2.1a}{1994/01/17}{New math font setup} +% \changes{v2.0c}{1993/03/18}{Changed all \cs{@tempdima} in +% \cs{@tempdimb} to avoid killing \cs{numberline}} +% \changes{v1.91a}{1992/09/22}{Introduced \cs{tf@size} for math size.} +% \changes{v1.3a}{1991/11/27}{All \cs{family}, \cs{shape} etc. +% renamed to \cs{fontfamily} etc.} +% \changes{v1.2i}{1990/04/01}{Code added from tracefnt.dtx.} +% \changes{v1.2i}{1990/04/01}{Support for TeX3.} +% \changes{v1.2g}{1990/02/16}{Support for changes of \cs{baselineskip} +% without changing the size.} +% +% \changes{v1.2c}{1990/01/23}{\cs{no@version@warning} renamed to +% \cs{no@alphabet@error}.} +% \changes{v1.0s}{1989/11/25}{All \cs{edef}\cs{font@name} changed to +% \cs{xdef}\cs{font@name}. +% Necessary after introduction of +% \cs{begingroup}/\cs{endgroup} in v1.0q.} +% \changes{v1.0s}{1989/11/25}{extra// $\to$ + in \cs{extra@def}.} +% \changes{v1.0o}{1989/11/08}{First parameter of +% \cs{define@mathalphabet} +% and \cs{define@mathgroup} changed +% from string to control sequence.} +% \changes{v1.0m}{1989/09/14} +% {Global replacement: \cs{group} to \cs{mathgroup}} +% \changes{v1.0k}{1989/05/22}{Lines longer than 72 characters folded.} +% \changes{v1.0j}{1989/05/01}{Default for \cs{baselinestretch} added.} +% \changes{v1.0i}{1989/04/29} +% {Removed the \cs{halign} \cs{noalign} correction +% (wasn't bugfree)} +% \changes{v1.0h}{1989/04/29}{Documented problem with \cs{halign}, and +% \cs{noalign}} +% \changes{v1.0g}{1989/04/27}{Documentation revised.} +% \changes{v1.0f}{1989/04/23}{\% in \cs{getanddefinefonts} added.} +% \changes{v1.0e}{1989/04/21}{Documentation is fun!! +% Parameters of \cs{define@mathalphabet} changed.} +% \changes{v1.0d}{1989/04/19}{Even more doc.} +% \changes{v1.0c}{1989/04/14}{More documentation added.} +% \changes{v1.0b}{1989/04/10}{\cs{preload@sizes} added.} +% \changes{v1.0b}{1989/04/10}{\cs{wrong@fontshape} changed to define +% substitution font/shape macro.} +% \changes{v1.0a}{1989/04/10}{Starting with version numbers!! +% \cs{ifmmode} added in \cs{math@group}} +% \changes{v2.1w}{1994/11/17} +% {\cs{@tempa} to \cs{reserved@a}} +% +% +% \section{Autoloading parts of NFSS} +% +% This code is set up in a way that some parts of it can be kept +% separate and will only be loaded if needed. +% +% If we are producing an autoload version of \LaTeXe{} then all those +% parts with \textsf{def1} or \textsf{def2} docstrip guards will be +% placed into the autoloadable files \texttt{autofss1.sty} and +% \texttt{autofss2.sty}. +% +% The `2ekernel' code ensures that a |\usepackage{autofss1}| is +% essentially ignored if a `full' format is being used that has +% picture mode already in the format. +% +% Note the |autofss2| loading is currently disabled. +% +% \begin{macrocode} +%<2ekernel>\expandafter\let\csname ver@autofss1.sty\endcsname\fmtversion +% \end{macrocode} +% +% The autoload file \texttt{autofss2} is a specialty because it +% contains +% code which will be completely local, ie loaded every time again. +% +% \section{Preliminary macros} +% +% We define a number +% of macros that will be used later. +% +% +% \begin{macro}{\@nomath} +% |\@nomath| is used by most macros that will have no effect +% in math mode. It issues a warning message. +% \begin{macrocode} +%<*2ekernel|autoload> +\def\@nomath#1{\relax\ifmmode + \@font@warning{Command \noexpand#1invalid in math mode}\fi} +% +% \end{macrocode} +% \end{macro} +% +% \changes{v1.2c}{1990/01/23}{Macro \cs{no@alphabet@help} added} +% \changes{v2.1i}{1994/04/18}{Macro \cs{no@alphabet@help} +% removed again} +% +% \begin{macro}{\no@alphabet@error} +% \changes{v1.2c}{1990/01/23}{Changed to error call} +% \changes{v2.1i}{1994/04/18}{Use std LaTeX error macro} +% The macro |\no@alphabet@error| is called whenever +% the user requests a math \emph{alphabet} that is not +% available in the current \emph{version}. +% In math mode an error message is produced otherwise the command +% keeps silent. +% The argument is the name of the control sequence that identifies +% the math \emph{alphabet}. +% The |\relax| at the beginning is necessary to prevent +% \TeX{} from scanning too far in certain situations. +% \begin{macrocode} +%<*2ekernel|def1> +\gdef\no@alphabet@error#1{\relax \ifmmode + \@latex@error{Math\space alphabet\space identifier\space + \noexpand#1is\space undefined\space in\space math\space + version\space `\math@version'}% + {Your\space requested\space math\space alphabet\space + is\space undefined\space in\space the\space current\space + math\space version.^^JCheck\space the\space spelling\space + or\space use\space the\space \noexpand\SetMathAlphabet\space + command.} + \fi} +% +%<*autoload> +\gdef\no@alphabet@error{\relax \ifmmode + \expandafter\try@sizes\expandafter\no@alphabet@error \fi} +% +% \end{macrocode} +% \end{macro} +% +% +% \begin{macro}{\new@mathgroup} +% \begin{macro}{\mathgroup} +% We also give a new name to |\newfam| and |\fam| +% to avoid verbal confusion +% (see the introduction).\footnote{For the same reason +% it seems advisable to +% {\ttfamily\bslash let\bslash fam} and +% {\ttfamily\bslash newfam} +% equal to {\ttfamily\bslash relax}, +% but this is commented out to retain +% compatibility to existing style files.} +% \changes{v1.2e}{1990/01/28}{\cs{newfam} let to \cs{new@mathgroup}.} +% \changes{v3.0a}{1995/05/24} +% {(DPC) No need to redefine \cs{newfam} as not outer} +% \changes{v3.0b}{1995/05/27} +% {(FMi) But a need to define \cs{new@mathgroup}} +% \begin{macrocode} +%<*2ekernel|autoload> +\def\new@mathgroup{\alloc@8\mathgroup\chardef\sixt@@n} +\let\mathgroup\fam +\let\newfam\new@mathgroup +\@onlypreamble\new@mathgroup +% \end{macrocode} +% \end{macro} +% \end{macro} +% +% +% \section{Macros for setting up the tables} +% +% \begin{macro}{\DeclareFontShape} +% +% \changes{v1.9a}{1992/07/26}{Introduced \cs{DeclareFontShape}} +% The macro |\DeclareFontShape| takes $6$ arguments: +% \begin{macrocode} +\def\DeclareFontShape{\begingroup +% \end{macrocode} +% First we restore the catcodes of all characters used in the syntax. +% \changes{v2.1e}{1994/02/24} +% {Separate restoration of catcodes for fd cmds} +% \begin{macrocode} + \nfss@catcodes +% \end{macrocode} +% We use |\expandafter| |\endgroup| to restore catcode in case +% something goes wrong with the argument parsing (suggested by Tim +% Van Zandt) +% \end{macro} +% +% +% +% \begin{macro}{\DeclareFontShape} +% \changes{v2.1c}{1994/02/07}{revert catcode settings earlier} +% \changes{v3.0m}{1995/11/01} +% {(DPC) Test for \cs{relax} not \cs{undefined}, internal/1933} +% \begin{macrocode} + \expandafter\endgroup + \DeclareFontShape@} +\def\DeclareFontShape@#1#2#3#4#5#6{% + \expandafter\ifx\csname #1+#2\endcsname\relax + \@latex@error{Font family `#1+#2' unknown}\@eha + \else + \expandafter + \xdef\csname#1/#2/#3/#4\endcsname{\expandafter\noexpand + \csname #5\endcsname}% + \def\reserved@a{#6}% + \global + \expandafter\let\csname#5\expandafter\endcsname + \ifx\reserved@a\@empty + \@empty + \else + \reserved@a + \fi + \fi + } +% \end{macrocode} +% \end{macro} +% +% +% \begin{macro}{\DeclareFixedFont} +% Define a direct font switch that avoids all overhead. +% \changes{v2.1u}{1994/11/06}{Renamed +% \cs{every@size} to \cs{every@math@size}.} +% \begin{macrocode} +\def\DeclareFixedFont#1#2#3#4#5#6{% + \begingroup + \math@fontsfalse + \every@math@size{}% + \fontsize{#6}\z@ + \usefont{#2}{#3}{#4}{#5}% + \global\expandafter\let\expandafter#1\the\font + \endgroup + } +% +% \end{macrocode} +% \end{macro} +% +% +% +% +% \begin{macro}{\do@subst@correction} +% +% \begin{macrocode} +%<*2ekernel|autoload> +\def\do@subst@correction{% + \xdef\subst@correction{% + \font@name + \global\expandafter\font + \csname \curr@fontshape/\f@size\endcsname + \noexpand\fontname\font + \relax}% +% \end{macrocode} +% Calling |\subst@correction| after the current group means calling +% it after we have loaded the substitution font which is done +% inside a group. +% \begin{macrocode} + \aftergroup\subst@correction +} +% \end{macrocode} +% \end{macro} +% +% \begin{macro}{\DeclareFontFamily} +% \begin{macrocode} +\def\DeclareFontFamily#1#2#3{% +% \end{macrocode} +% If we want fast checking for the encoding scheme we can just +% check for |\T@..| being defined. +% \begin{macrocode} +% \@tempswafalse +% \def\reserved@b{#1}% +% \def\cdp@elt##1##2##3##4{\def\reserved@c{##1}% +% \ifx\reserved@b\reserved@c \@tempswatrue\fi}% +% \cdp@list +% \if@tempswa + \@ifundefined{T@#1}% + {% + \@latex@error{Encoding scheme `#1' unknown}\@eha + }% + {% +% \end{macrocode} +% Now we have to define the macro |\|\meta{\#1}|+|\meta{\#2} +% to contain |#3|. But since most of the time |#3| will be empty +% we use |\let| in a tricky way rather than a simple |\def| since +% this will save internal memory. +% We store the argument |#3| in a temporary macro +% |\reserved@a|. +% \begin{macrocode} + \def\reserved@a{#3}% +% \end{macrocode} +% We compare |\reserved@a| with |\@empty| +% If these two are the same we |\let| the `extra' +% macro equal to |\@empty| which is not the same a doing a |\let| +% to |\reserved@a| --- the latter would blow one extra memory +% location rather then reusing the one from |\@empty|. +% \begin{macrocode} + \global + \expandafter\let\csname #1+#2\expandafter\endcsname + \ifx \reserved@a\@empty + \@empty + \else \reserved@a + \fi + }% +} +% \end{macrocode} +% \end{macro} +% +% +% \begin{macro}{\cdp@list} +% We initialize the code page list to be empty. +% \begin{macrocode} +\let\cdp@list\@empty +\@onlypreamble\cdp@list +% \end{macrocode} +% \end{macro} +% +% \begin{macro}{\cdp@elt} +% \begin{macrocode} +\let\cdp@elt\relax +\@onlypreamble\cdp@elt +% \end{macrocode} +% \end{macro} +% +% +% +% +% \begin{macro}{\DeclareFontEncoding} +% \begin{macrocode} +\def\DeclareFontEncoding{% +% \end{macrocode} +% First we start with ignoring all blanks and newlines since every +% surplus space in the second or third argument will come out in +% a weird place in the document. +% \changes{v2.1c}{1994/02/07}{revert catcode settings earlier} +% \changes{v2.1t}{1994/10/19}{Add missing \cs{relax}.} +% \changes{v2.1z}{1994/12/06}{use \cs{nfss@catcodes}} +% \begin{macrocode} + \begingroup + \nfss@catcodes + \expandafter\endgroup + \DeclareFontEncoding@} +\@onlypreamble\DeclareFontEncoding +% \end{macrocode} +% \changes{v2.0g}{1993/09/15} +% {Corrected: \cs{default@T} to \cs{default@M}.} +% \begin{macrocode} +\def\DeclareFontEncoding@#1#2#3{% + \expandafter + \ifx\csname T@#1\endcsname\relax + \def\cdp@elt{\noexpand\cdp@elt}% + \xdef\cdp@list{\cdp@list\cdp@elt{#1}% + {\default@family}{\default@series}% + {\default@shape}}% +% \end{macrocode} +% To support encoding dependent commands (like accents) we +% initialise the command +% |\|\meta{encoding}|-cmd| to be |\@changed@cmd|. +% (See \texttt{ltoutenc.dtx} for details.) +% \changes{v2.1l}{1994/05/13}{Init encoding change command} +% \changes{v2.1n}{1994/05/14}{Only init enc change cmd when +% new encoding} +% \changes{v2.1n}{1994/05/14}{Log if encoding is redeclared} +% \begin{macrocode} + \expandafter\let\csname#1-cmd\endcsname\@changed@cmd + \else + \@font@info{Redeclaring font encoding #1}% + \fi +% \end{macrocode} +% +% \begin{macrocode} + \global\@namedef{T@#1}{#2}% + \global\@namedef{M@#1}{\default@M#3}% +% \end{macrocode} +% Keep a record of the last encoding being declared: +% \changes{v3.0w}{1999/01/06}{Added \cs{LastDeclaredEncoding} to +% support cyrillic integration (pr/2988)} +% \begin{macrocode} + \xdef\LastDeclaredEncoding{#1}% + } +\@onlypreamble\DeclareFontEncoding@ +% \end{macrocode} +% \end{macro} +% +% +% \begin{macro}{\LastDeclaredEncoding} +% \changes{v3.0w}{1999/01/06}{Added \cs{LastDeclaredEncoding} to +% support cyrillic integration (pr/2988)} +% The last encoding being declared by |\DeclareFontEncoding|. +% \begin{macrocode} +\def\LastDeclaredEncoding{} +% \end{macrocode} +% \end{macro} +% +% \begin{macro}{\DeclareFontSubstitution} +% \begin{macrocode} +\def\DeclareFontSubstitution#1#2#3#4{% + \expandafter + \ifx\csname T@#1\endcsname\relax + \@latex@error{Encoding scheme `#1' unknown}\@eha + \else + \begingroup +% \end{macrocode} +% \changes{v3.0x}{2002/10/02}{Adding \cs{LastDeclaredEncoding} +% introduced a bug as on some occasions that macro name was stored +% in the internal lists instead of the actual encoding. (pr/3459)} +% We loop through the |\cdp@list| and rebuild it anew in |\toks@| +% thereby replacing the defaults for the encoding in question with +% the new defaults. It is important to store the encoding to test +% against expanded in |\reserved@a| since it might just be +% |\LastDeclaredEncoding| that is passed as |#1|. +% \begin{macrocode} + \edef\reserved@a{#1}% + \toks@{}% + \def\cdp@elt##1##2##3##4{% + \def\reserved@b{##1}% + \ifx\reserved@a\reserved@b +% \end{macrocode} +% Here we use the new defaults but we use |##1| (i.e., the encoding +% name already stored previously) since we know that it is expanded. +% \begin{macrocode} + \addto@hook\toks@{\cdp@elt{##1}{#2}{#3}{#4}}% + \else +% \end{macrocode} +% If |\reserved@a| and |\reserved@b| differ then we simply copy +% from the old list to the new. +% \begin{macrocode} + \addto@hook\toks@{\cdp@elt{##1}{##2}{##3}{##4}}% + \fi}% + \cdp@list + \xdef\cdp@list{\the\toks@}% + \endgroup + \global + \@namedef{D@#1}{% + \def\default@family{#2}% + \def\default@series{#3}% + \def\default@shape{#4}% + }% + \fi + } +\@onlypreamble\DeclareFontSubstitution +% \end{macrocode} +% \end{macro} +% +% +% \begin{macro}{\DeclareFontEncodingDefaults} +% \begin{macrocode} +\def\DeclareFontEncodingDefaults#1#2{% + \ifx\relax#1\else + \ifx\default@T\@empty\else + \@font@info{Overwriting encoding scheme text defaults}% + \fi + \gdef\default@T{#1}% + \fi + \ifx\relax#2\else + \ifx\default@M\@empty\else + \@font@info{Overwriting encoding scheme math defaults}% + \fi + \gdef\default@M{#2}% + \fi +} +\@onlypreamble\DeclareFontEncodingDefaults +% \end{macrocode} +% \end{macro} +% +% +% \begin{macro}{\default@T} +% \begin{macro}{\default@M} +% \begin{macrocode} +\let\default@T\@empty +\let\default@M\@empty +% \end{macrocode} +% \end{macro} +% \end{macro} +% +% +% \begin{macro}{\DeclarePreloadSizes} +% \begin{macrocode} +\def\DeclarePreloadSizes#1#2#3#4#5{% + \@ifundefined{T@#1}% + {\@latex@error{Encoding scheme `#1' unknown}\@eha}% + {% +% \end{macrocode} +% Don't know at the moment what this group here does! +% \begin{macrocode} + \begingroup +% \end{macrocode} +% We define a macro |\reserved@f|\footnote{We cannot use +% {\ttfamily\bslash @tempa} +% since it is needed in +% {\ttfamily\bslash pickup@font}.} +% that grabs the next \emph{size} and loads the corresponding +% font. +% This is done by delimiting |\reserved@f|'s only argument by the +% \textsf{token} |,| (comma). +% \begin{macrocode} + \def\reserved@f##1,{% +% \end{macrocode} +% The end of the list will be detected when there are no more +% elements, i.e.\ when |\reserved@f|'s argument is empty. +% The trick used here is explained in Appendix~D of the +% \TeX{}book: if the argument is empty the |\if| +% will select the first clause and |\let| |\reserved@f| +% equal to |\relax|. +% (We use the |>| character here since it cannot appear +% in font file names.) +% \changes{v1.2j}{1990/06/24}{Missing percent added.} +% \begin{macrocode} + \if>##1>% + \let\reserved@f\relax + \else +% \end{macrocode} +% Otherwise, we define |\font@name| appropriately and +% call |\pickup@font| to do the work. +% Note that the requested |\curr@fontshape| +% combination must have been defined, or you will get an error. +% The definition of |\font@name| is carried out globally +% to be consistent with the rest of the code in this file. +% \begin{macrocode} + \xdef\font@name{\csname#1/#2/#3/#4/##1\endcsname}% + \pickup@font +% \end{macrocode} +% Now we forget the name of the font just loaded. +% More precisely, we set the corresponding control sequence +% to |\relax|. This means that later on, when the font +% is first used, the macro |\define@newfont| is called +% again to execute the `extra' macro for this font. +% \changes{v1.2d}{1990/01/27}{Font identifier set to \cs{relax}.} +% \begin{macrocode} + \global\expandafter\let\font@name\relax + \fi +% \end{macrocode} +% Finally we call |\reserved@f| again to process the next +% \emph{size}. If |\reserved@f| was |\let| equal to |\relax| +% this will end the macro. +% \begin{macrocode} + \reserved@f}% +% \end{macrocode} +% We finish with reinserting the list of sizes after the +% |\reserved@f| +% macro and appending an empty element so that the end of the list +% is recognized properly. +% \begin{macrocode} + \reserved@f#5,,% + \endgroup + }% +} +\@onlypreamble\DeclarePreloadSizes +% \end{macrocode} +% \end{macro} +% +% +% +% \begin{macro}{\ifmath@fonts} +% We need a switch to decide if we have to switch math fonts. +% For this purpose we provide |\ifmath@fonts| +% that can be set to true or false by the |\S@...| macros +% depending on if math fonts +% are provided for this size or not. +% The default is of course to switch all fonts. +% \begin{macrocode} +\newif\ifmath@fonts \math@fontstrue +% \end{macrocode} +% \end{macro} +% +% +% +% \begin{macro}{\DeclareMathSizes} +% \begin{macro}{\DeclareMathSizes*} +% |\DeclareMathSizes| takes the text size, math text size, math +% script size, and math scriptscript size as arguments and defines +% the right |\S@|\dots{} macro. +% +% \begin{macrocode} +\def\DeclareMathSizes{% + \@ifstar{\@DeclareMathSizes\math@fontsfalse}% + {\@DeclareMathSizes{}}} +\@onlypreamble\DeclareMathSizes +% \end{macrocode} +% \end{macro} +% \end{macro} +% +% \begin{macro}{\@DeclareMathSizes} +% \changes{v3.0p}{1996/07/26}{use faster \cs{if} test} +% \begin{macrocode} +\def\@DeclareMathSizes#1#2#3#4#5{% + \@defaultunits\dimen@#2pt\relax\@nnil + \if$#3$% + \expandafter \let + \csname S@\strip@pt\dimen@\endcsname + \math@fontsfalse + \else + \expandafter \gdef + \csname S@\strip@pt\dimen@\endcsname + {\gdef\tf@size{#3}\gdef\sf@size{#4}% + \gdef\ssf@size{#5}% + #1% + }% + \fi} +\@onlypreamble\@DeclareMathSizes +% \end{macrocode} +% \end{macro} +% +% +% +% \section{Selecting a new font} +% +% \subsection{Macros for the user} +% +% +% \begin{macro}{\fontencoding} +% \changes{v2.1j}{1994/05/12}{Use \cs{DeclareRobustCommand}.} +% \begin{macro}{\f@encoding} +% As we said in the introduction a font is described by four parameters. +% We first define macros to specify the wanted \emph{family}, +% \emph{series}, or \emph{shape}. +% These are simply recorded in internal macros +% |\f@family|, |\f@series|, and |\f@shape|, resp. +% We use |\edef|'s so that the arguments can also be macros. +% \begin{macrocode} +\DeclareRobustCommand\fontencoding[1]{% + \expandafter\ifx\csname T@#1\endcsname\relax + \@latex@error{Encoding scheme `#1' unknown}\@eha + \else + \edef\f@encoding{#1}% + \ifx\cf@encoding\f@encoding +% \end{macrocode} +% If the new encoding is the same as the old +% encoding we have nothing to do. +% However, in case we had a sequence of several encoding changes +% without a |\selectfont| inbetween we can save processing by +% making sure that |\enc@update| is |\relax|. +% \begin{macrocode} + \let\enc@update\relax + \else +% \end{macrocode} +% If current and new encoding differ we define the macro +% |\enc@update| +% to contain all updates necessary at |\selectfont| time. +% \begin{macrocode} + \let\enc@update\@@enc@update + \fi + \fi +} +% \end{macrocode} +% \end{macro} +% \end{macro} +% +% \begin{macro}{\@@enc@update} +% \begin{macrocode} +\def\@@enc@update{% +% \end{macrocode} +% When |\@@enc@update| is executed |\f@encoding| holds the encoding +% name +% for the new encoding and |\cf@encoding| the name of the last active +% encoding. +% +% We start by setting the init command for encoding dependent +% macros to |\@changed@cmd|. +% \begin{macrocode} + \expandafter + \let + \csname\cf@encoding -cmd\endcsname + \@changed@cmd +% \end{macrocode} +% Then we turn the one for the new encoding to |\@current@cmd| (see +% \texttt{ltoutenc.dtx} for further explanations). +% \begin{macrocode} + \expandafter + \let + \csname\f@encoding-cmd\endcsname + \@current@cmd +% \end{macrocode} +% We execute the default settings |\default@T|, followed by the one +% for the new encoding. +% \begin{macrocode} + \default@T + \csname T@\f@encoding\endcsname +% \end{macrocode} +% Finally we change the default substitution values, disable +% |\enc@update| and make |\f@encoding| officially the current +% encoding. +% \begin{macrocode} + \csname D@\f@encoding\endcsname + \let\enc@update\relax + \let\cf@encoding\f@encoding +} +% \end{macrocode} +% \end{macro} +% +% +% \begin{macro}{\enc@update} +% \changes{v2.1m}{1994/05/14}{Macro added} +% The default action in |\selectfont| is to do nothing. +% \begin{macrocode} +\let\enc@update\relax +% \end{macrocode} +% \end{macro} +% +% \begin{macro}{\fontfamily} +% \changes{v2.1j}{1994/05/12}{Use \cs{DeclareRobustCommand}.} +% \begin{macro}{\f@family} +% \begin{macro}{\fontseries} +% \changes{v2.1j}{1994/05/12}{Use \cs{DeclareRobustCommand}.} +% \begin{macro}{\f@series} +% \begin{macro}{\fontshape} +% \changes{v2.1j}{1994/05/12}{Use \cs{DeclareRobustCommand}.} +% \changes{v2.1y}{1994/11/30}{Use \cs{@current@cmd} in +% \cs{@@enc@update}. ASAJ.} +% \begin{macro}{\f@shape} +% \begin{macrocode} +\DeclareRobustCommand\fontfamily[1]{\edef\f@family{#1}} +\DeclareRobustCommand\fontseries[1]{\edef\f@series{#1}} +\DeclareRobustCommand\fontshape [1]{\edef\f@shape{#1}} +% \end{macrocode} +% Some handy abbreviation if you want to get some particular font +% in the current size. If also the size should change one has to +% issue a |\fontsize| comand first. +% \begin{macrocode} +\def\usefont#1#2#3#4{\fontencoding{#1}\fontfamily{#2}% + \fontseries{#3}\fontshape{#4}\selectfont + \ignorespaces} +% \end{macrocode} +% \end{macro} +% \end{macro} +% \end{macro} +% \end{macro} +% \end{macro} +% \end{macro} +% +% +% \begin{macro}{\linespread} +% \changes{v2.1j}{1994/05/12}{New macro} +% \changes{v2.1p}{1994/05/16}{Remove surplus braces} +% The comand |\linespread| changes the current |\baselinestretch| +% by calling |\set@fontsize|. The values for |\f@size| and +% |\f@baselineskip| will be left unchanged. +% \begin{macrocode} +\DeclareRobustCommand\linespread[1] + {\set@fontsize{#1}\f@size\f@baselineskip} +% \end{macrocode} +% \end{macro} +% +% +% \begin{macro}{\fontsize} +% \changes{v2.1j}{1994/05/12}{Redefined to use \cs{set@fontsize}} +% \changes{v2.1p}{1994/05/16}{Pass \cs{baselinstretch} not +% \cs{f@linespread}} +% We also define a macro that allows to specify a size. In this +% case, however, we also need the value of |\baselineskip|. As the +% first argument to |\set@fontsize| we pass the current value of +% |\baselinestretch|. This will either match the internal value (in +% which case nothing changes, or it will be an updated value due to +% a user change of that macro using |\renewcommand|. If we would +% pass the internal |\f@linespread| such a change would be +% efectively overwritten by a size change. +% \begin{macrocode} +\DeclareRobustCommand\fontsize[2] + {\set@fontsize\baselinestretch{#1}{#2}} +% \end{macrocode} +% \end{macro} +% +% +% \changes{v2.1n}{1994/05/14}{Set defaults for all \cs{f@...}} +% +% \begin{macro}{\f@linespread} +% \changes{v2.1j}{1994/05/12}{New macro} +% This macro holds the current internal value for +% |\baselinestretch|. +% \begin{macrocode} +\let\f@family\@empty +\let\f@series\@empty +\let\f@shape\@empty +\let\f@size\@empty +\let\f@baselineskip\@empty +\let\f@linespread\@empty +% \end{macrocode} +% \end{macro} +% +% \begin{macro}{\cf@encoding} +% \changes{v2.1u}{1994/11/06}{New macro} +% \begin{macrocode} +\let\f@encoding\@empty +\let\cf@encoding\@empty +% \end{macrocode} +% \end{macro} +% +% +% +% \begin{macro}{\@defaultunits} +% +% The function |\@defaultunits| when wrapped around a dimen or skip +% assignment supplies default units. Usage: +% +% |\@defaultunits\dimen@=#1pt\relax\@nnil| +% +% Note: the |\relax| is *important*. Other units can be substituted +% for the `pt' if desired. +% +% We use |\remove@to@nnil| as an auxiliary macros for +% |\@defaultunits|. It just has to gobble the supplied default unit +% `pt' or whatever, if it wasn't used in the assignment. +% \begin{macrocode} +\def\@defaultunits{\afterassignment\remove@to@nnil} +% \end{macrocode} +% \end{macro} +% +% \begin{macro}{\strip@pt} +% \begin{macro}{\rem@pt} +% This macro strips the characters |pt| produced by using |\the| +% on a dimen register. +% \begin{macrocode} +\begingroup + \catcode`P=12 + \catcode`T=12 + \lowercase{ + \def\x{\def\rem@pt##1.##2PT{##1\ifnum##2>\z@.##2\fi}}} + \expandafter\endgroup\x +\def\strip@pt{\expandafter\rem@pt\the} +% \end{macrocode} +% \end{macro} +% \end{macro} +% +% +% \begin{macro}{\mathversion} +% \changes{v1.0h}{1989/04/29}{Test if version defined added.} +% \changes{v1.0m}{1989/09/14} +% {Corrected typo: \cs{endscname} to \cs{endcsname}.} +% \changes{v2.1j}{1994/05/12}{Use \cs{DeclareRobustCommand}.} +% \begin{macro}{\math@version} +% |\mathversion| takes the math \emph{version} name as +% argument, defines |\math@version| appropriately and switches +% to the font selected +% forcing a call to |\glb@settings| if the \emph{version} is +% known to the system. +% \changes{v1.0p}{1989/11/14}{Math version prefix `mv@' added.} +% \changes{v1.0r}{1989/11/22} +% {\cs{def} $\to$ \cs{edef} for \cs{math@version}.} +% \changes{v1.2g}{1990/02/16}{\cs{@nomath} added.} +% \changes{v2.1a}{1994/01/17}{New math font setup} +% \begin{macrocode} +\DeclareRobustCommand\mathversion[1] + {\@nomath\mathversion + \expandafter\ifx\csname mv@#1\endcsname\relax + \@latex@error{Math version `#1' is not defined}\@eha\else + \edef\math@version{#1}% +% \end{macrocode} +% We need to force a math font setup both now and at the point +% where we return to the previous math version. +% Forcing a math font setup can simply be done by setting +% |\glb@currsize| to an invalid value since this will trigger the +% setup when the formula starts. +% \begin{macrocode} + \gdef\glb@currsize{}% +% \end{macrocode} +% When the scope of the current |\mathversion| ends we need to +% restore the old setup. However this time we need to force it +% directly at least if we are inside math, otherwise we could wait. +% Another way to enhance this code here is todo the setting only if +% the version really has changed after all. This might be +% interesting in case of \texttt{amstext} and \texttt{boldsymbol}. +% \changes{v2.1b}{1994/01/25}{Corrections for math setup} +% \begin{macrocode} + \aftergroup\glb@settings + \fi} +% \end{macrocode} +% \end{macro} +% \end{macro} +% +% +% If \TeX{} would support a hook just before the end of a formula +% (opposite of |\everymath| so to speak) the implementation of the +% algorithm would be much simpler because in that case we would set up +% the correct math fonts at this point without having to worry about +% incorrect settings due to nesting. The same would be true if in +% \LaTeX{} the use of |$| (as the primitive \TeX{} command) would be +% impossible and instead only a higher-level interface would be +% available. Note that this does not mean that a |$| couldn't be the +% short-hand for starting and stopping that higher-level interface, it +% only means that the direct \TeX{} function must be hidden. +% +% Anyway, since we don't have this and won't have it in \LaTeXe{} we +% need to implement it in a somewhat slower way. +% +% +% We test for the current math font setup on entry of a formula, +% i.e., on the +% hooks |\everymath| and |\everydisplay|. But since these hooks may +% contain user data we provide ourselves with an internal version of +% these hooks which stays frozen. +% +% +% \begin{macro}{\frozen@everymath} +% \changes{v2.1a}{1994/01/17}{New math font setup} +% \begin{macro}{\frozen@everydisplay} +% New internal names for |\everymath| and |\everydisplay|. +% \begin{macrocode} +\let\frozen@everymath\everymath +\let\frozen@everydisplay\everydisplay +% \end{macrocode} +% \end{macro} +% \end{macro} +% +% \begin{macro}{\everymath} +% \changes{v2.1a}{1994/01/17}{New math font setup} +% \begin{macro}{\everydisplay} +% \changes{v2.1a}{1994/01/17}{New math font setup} +% Now we provide now user hooks that will be called in the +% frozen internals. +% \begin{macrocode} +\newtoks\everymath +\newtoks\everydisplay +% \end{macrocode} +% \end{macro} +% \end{macro} +% +% +% \begin{macro}{\frozen@everymath} +% \changes{v2.1a}{1994/01/17}{New math font setup} +% Now we define the behaviour of the frozen hooks: first +% check the math setup then call the user hook. +% \begin{macrocode} +\frozen@everymath = {\check@mathfonts + \the\everymath} +% \end{macrocode} +% \end{macro} +% +% +% \begin{macro}{\frozen@everydisplay} +% \changes{v2.1a}{1994/01/17}{New math font setup} +% Ditto for the display hook. +% \begin{macrocode} +\frozen@everydisplay = {\check@mathfonts + \the\everydisplay} +% \end{macrocode} +% \end{macro} +% +% \changes{v3.0q}{1996/07/27}{\cs{if@inmath} switch removed} +% +% \begin{macro}{\curr@math@size} +% \changes{v2.1a}{1994/01/17}{New math font setup} +% This holds locally the current math size. +% \begin{macrocode} +\let\curr@math@size\@empty +% \end{macrocode} +% \end{macro} +% +% +% +% +% \subsection{Macros for loading fonts} +% +% \begin{macro}{\pickup@font} +% The macro |\pickup@font| which is used in +% |\selectfont| is very simple: +% if the font name is undefined (i.e.\ not known yet) it calls +% |\define@newfont| to load it. +% \begin{macrocode} +\def\pickup@font{% + \expandafter \ifx \font@name \relax + \define@newfont + \fi} +% \end{macrocode} +% \end{macro} +% +% \begin{macro}{\split@name} +% |\pickup@font| assumes that |\font@name| is set +% but it is sometimes called when |\f@family|, |\f@series|, +% |\f@shape|, or |\f@size| may have the wrong settings +% (see, e.g., the definition of |\getanddefine@fonts|). +% Therefore we need a macro to extract font \emph{family}, +% \emph{series}, \emph{shape}, and \emph{size} from the font name. +% To this end we define |\split@name| which takes the font +% name as a list of characters of |\catcode| 12 (without the +% backslash at the beginning) delimited by the +% special control sequence |\@nil|. +% This is not very complicated: we first ensure that |/| has +% the right |\catcode| +% \begin{macrocode} +{\catcode`\/=12 +% \end{macrocode} +% and define |\split@name| so that it will define our +% private |\f@encoding|, |\f@family|, |\f@series|, |\f@shape|, +% and |\f@size| macros. +% \changes{v1.9a}{1992/07/26}{Added splitting into \cs{f@encoding}.} +% \begin{macrocode} +\gdef\split@name#1/#2/#3/#4/#5\@nil{\def\f@encoding{#1}% + \def\f@family{#2}% + \def\f@series{#3}% + \def\f@shape{#4}% + \def\f@size{#5}}} +% \end{macrocode} +% \end{macro} +% +% +% \begin{macro}{\curr@fontshape} +% Abbreviation which may get removed again for speed. +% \changes{v1.9a}{1992/07/26}{} +% \begin{macrocode} +\def\curr@fontshape{\f@encoding/\f@family/\f@series/\f@shape} +% +% \end{macrocode} +% \end{macro} +% +% \begin{macro}{\define@newfont} +% Now we can tackle the problem of defining a new font. +% \changes{v1.9a}{1992/07/26}{} +% \begin{macrocode} +%<*2ekernel|def2|autoload> +\def\define@newfont{% +% \end{macrocode} +% We have already mentioned that the \textsf{token} list that +% |\split@name| will get as argument must not start with +% a backslash. +% To reach this goal we will set the |\escapechar| to $-1$ so +% that the |\string| primitive will not generate an +% escape character. +% To keep this change local we open a group. We use +% |\begingroup| for this purpose since |\define@newfont| +% might be called in math mode, and an empty +% |\bgroup|\ldots|\egroup| would add an empty Ord atom +% to the math list and thus affect the spacing. +% +% Also locally redefine |\typeout| so that `No file ...fd' +% Warnings become Font Info message just sent to the log file. +% \changes{v1.0q}{1989/11/19}{Group added.} +% \changes{v3.0m}{1995/11/17}{Redefine \cs{typeout} latex/1676} +% \begin{macrocode} + \begingroup + \let\typeout\@font@info + \escapechar\m@ne +% \end{macrocode} +% Then we extract \emph{encoding scheme}, \emph{family}, +% \emph{series}, \emph{shape}, +% and \emph{size} from the font name. +% Note the four |\expandafter|'s so that |\font@name| is +% expanded first, then |\string|, and finally +% |\split@name|. +% \begin{macrocode} + \expandafter\expandafter\expandafter + \split@name\expandafter\string\font@name\@nil +% \end{macrocode} +% If the |\curr@fontshape| combination is not available, +% (i.e.\ undefined) we call the macro |\wrong@fontshape| to take +% care of this case. Otherwise |\extract@font| +% will load the external font for us. +% \changes{v1.2f}{1990/01/28}{Added call to \cs{curr@fontshape} macro +% to allow substitution.} +% \begin{macrocode} +% \expandafter\ifx +% \csname\curr@fontshape\endcsname \relax + \try@load@fontshape % try always +% \fi + \expandafter\ifx + \csname\curr@fontshape\endcsname \relax + \wrong@fontshape\else +% \end{macrocode} +% To allow substitution we call the |curr@fontshape| macro +% which usually will expand to |\relax| but may hold code for +% substitution (see |\subst@fontshape| definition). +% \begin{macrocode} +% \csname\curr@fontshape\endcsname + \extract@font\fi +% \end{macrocode} +% We are nearly finished and must only restore the +% |\escapechar| by closing the group. +% \begin{macrocode} + \endgroup} +% +% \end{macrocode} +% +% +% As |autofss2.sty| only makes local definitions it is re-loaded +% for each font, to save some string memory in the kernel, and to +% speed up the loading of some packages which may load fonts +% The code is actually pre-loaded into the kernel and removed +% at |\begin{document}|. The |\ifx| test below ensures that +% if |\usepackage{autofss2}| apears in the preamble, then the code +% is not removed at this time. Can not use |\AtBeginDocument| here +% as it is not defined yet! Listing all the commands like this +% is not ideal as any changes to the |autofss2.sty| need to be +% reflected here, but this seems the most memory efficient mechanism +% as it avoids the use of an extra csname to store the list. +% +% This is currently disabled, so the `autofss2' code remains +% in the kernel, and |autofss2.sty| is not generated in the current +% public release. +% \changes{v3.0l}{1995/10/26} +% {(DPC) disable autofss2 for now} +% \begin{macrocode} +%<*autoloadxxx> +\expandafter\def\expandafter\@begindocumenthook\expandafter{% + \expandafter\ifx\csname ver@autofss2.sty\endcsname\relax + \gdef\define@newfont{% + \begingroup + \makeatletter\nfss@catcodes + \catcode`\#6\relax + \@@input autofss2.sty\relax\define@newfont + \endgroup}% + \begingroup + \def\do##1{\global\let##1\@undefined}% + \do\extract@sizefn + \do\try@simple@size + \do\set@simple@size@args + \do\extract@rangefontinfo + \do\is@range + \do\check@range + \do\check@single + \do\set@size@funct@args + \do\set@size@funct@args@ + \do\try@size@range + \do\empty@sfcnt + \do\gen@sfcnt + \do\genb@sfcnt + \do\sub@sfcnt + \do\subf@sfcnt + \do\fixed@sfcnt + \endgroup + \fi} +% +% \end{macrocode} +% +% \begin{macrocode} +%<*2ekernel|autoload> +\def\try@load@fontshape{% + \expandafter + \ifx\csname \f@encoding+\f@family\endcsname\relax + \@font@info{Try loading font information for + \f@encoding+\f@family}% +% \end{macrocode} +% We predefine this combination to be |\@empty| which means that +% next time we don't try again unnecessary in case we don't find a +% |.fd| file. If the file contains a |\DeclareFontFamily| command +% than this setting will be overwritten. +% \changes{v2.1e}{1994/02/24} +% {Separate restoration of catcodes for fd cmds} +% \changes{v2.1l}{1994/05/13}{Use \cs{@input@} for fd files} +% \begin{macrocode} + \global\expandafter\let + \csname\f@encoding+\f@family\endcsname\@empty +% \end{macrocode} +% Set the catcodes used in the syntax, but do it only once (this +% will be restored at the end of the font loading group). +% \changes{v3.0t}{1997/10/21}{Move \cs{makeatletter} to +% \cs{nfss@catcodes}.} +% \begin{macrocode} + \nfss@catcodes + \let\nfss@catcodes\relax +% \end{macrocode} +% +% \changes{v3.0s}{1996/11/18} +% {(DPC) lowercase fd file names. internal/1044} +% For increased portability make the external filename +% monocase, but look for the (old style) mixed case +% filename if the first attempt fails. +% +% On any monocase system this means that the file is looked for twice +% which takes up time and string space, but at least for this release +% Check for both names to give people time to re-install their private +% fd files with lowercase names. +% \begin{macrocode} + \edef\reserved@a{% + \lowercase{% + \noexpand\InputIfFileExists{\f@encoding\f@family.fd}}}% + \reserved@a\relax + {\@input@{\f@encoding\f@family.fd}}% + \fi} +% \end{macrocode} +% \end{macro} +% +% +% \begin{macro}{\nfss@catcodes} +% \changes{v2.1e}{1994/02/24} +% {Separate restoration of catcodes for fd cmds} +% This macro should contain the standard |\catcode| assignments to +% all characters which are used in the commands found in an +% \texttt{.fd} file and which might have special |\catcode|s in the +% middle of a document. If necessary, this list can be extended in +% a package file using a suitable number of |\expandafter|, i.e., +%\begin{verbatim} +% \expandafter\def\expandafter\nfss@catcodes +% \expandafter{\nfss@catcodes } +%\end{verbatim} +% Note, that this macro might get executed several times since it +% is also called by |\DeclareFontShape|, thus it probably should +% not be misused as a general purpose hook. +% \begin{macrocode} +\def\nfss@catcodes{% +% \end{macrocode} +% We start by making |@| a letter and ignoring all blanks and newlines. +% \changes{v2.1z}{1994/12/06}{Added tab char as well} +% \changes{v3.0p}{1996/07/26}{omit \cs{relax} as not needed} +% \changes{v3.0t}{1997/10/21}{Moved \cs{makeatletter} from +% \cs{try@load@font@shape}.} +% \begin{macrocode} + \makeatletter + \catcode`\ 9% + \catcode`\^^I9% + \catcode`\^^M9% +% \end{macrocode} +% Then we set up |\|, |{|, |}|, |#| and |%| in case an \texttt{.fd} +% file is loaded during a verbatim environment. +% \changes{v3.0n}{1995/11/27}{Reset hash, for definitions in fd files} +% \changes{v3.00}{1995/12/06}{Reset hat, for typeouts etc in fd files} +% \begin{macrocode} + \catcode`\\\z@ + \catcode`\{\@ne + \catcode`\}\tw@ + \catcode`\#6% + \catcode`\^7% + \catcode`\%14% +% \end{macrocode} +% The we make sure that the important syntax parts have the right +% |\catcode|. +% \changes{v2.1s}{1994/09/16}{Reset [ and ] as well, just in case} +% \changes{v3.0r}{1996/08/25}{Reset the acute, grave and double quote +% chars as well} +% \begin{macrocode} + \@makeother\<% + \@makeother\>% + \@makeother\*% + \@makeother\.% + \@makeother\-% + \@makeother\/% + \@makeother\[% + \@makeother\]% + \@makeother\`% + \@makeother\'% + \@makeother\"% +} +% \end{macrocode} +% \end{macro} +% +% +% \begin{macro}{\DeclareErrorFont} +% Declare the last resort shape! We assume that in this fontshape +% there is a 10pt font but it doesn't really matter. We only loose +% one macro name if the assumption is false. But at least the font +% should be there! +% \begin{macrocode} +\def\DeclareErrorFont#1#2#3#4#5{% + \xdef\error@fontshape{% + \noexpand\expandafter\noexpand\split@name\noexpand\string + \expandafter\noexpand\csname#1/#2/#3/#4/#5\endcsname + \noexpand\@nil}% +% \end{macrocode} +% Initialize all those internal variables which may or may not have +% values in the first seconds of NFSS' bootstraping process. Later +% on such values will be updated when an encoding is selected, etc. +% +% We definitely don't want to set |\f@encoding|; we can set all the +% others since if they are left ``blank'' any selection would grap +% ``error default values'' as well. However, this probably should +% go also. +% \changes{v2.1n}{1994/05/14}{Don't set \cs{f@encoding}} +% \begin{macrocode} +% \gdef\f@encoding{#1}% + \gdef\default@family{#2}% + \gdef\default@series{#3}% + \gdef\default@shape{#4}% + \global\let\f@family\default@family + \global\let\f@series\default@series + \global\let\f@shape\default@shape + \gdef\f@size{#5}% + \gdef\f@baselineskip{#5pt}% +} +\@onlypreamble\DeclareErrorFont +% \end{macrocode} +% \end{macro} +% +% +% \begin{macro}{\wrong@fontshape} +% Before we come to the macro |\extract@font| we have to take +% care of unknown |\curr@fontshape| combinations. +% The general strategy is to issue a warning and to try a default +% \emph{shape}, then a default \emph{series}, +% and finally a default \emph{family}. +% If this last one also fails \TeX{} will go into an infinite loop. +% But if the defaults are set incorrectly one deserves nothing else! +% \changes{v1.9a}{1992/07/26}{} +% \begin{macrocode} +\def\wrong@fontshape{% + \csname D@\f@encoding\endcsname % install defaults if in math +% \end{macrocode} +% We remember the wanted |\curr@fontshape| combination +% which we will need in a moment. +% \begin{macrocode} + \edef\reserved@a{\csname\curr@fontshape\endcsname}% + \ifx\last@fontshape\reserved@a + \errmessage{Corrupted NFSS tables}% + \error@fontshape + \else +% \end{macrocode} +% Then we warn the user about the mess and set the shape to its +% default. +% \changes{v1.0q}{1989/11/19} +% {Instead of calling \cs{family}\cs{default@family}, +% etc. we directly set \cs{f@family}, etc.} +% \changes{v1.2f}{1990/01/28}{Warning message slightly changed.} +% \begin{macrocode} + \let\f@shape\default@shape +% \end{macrocode} +% If the combination is not known, try the default \emph{series}. +% \begin{macrocode} + \expandafter\ifx\csname\curr@fontshape\endcsname\relax + \let\f@series\default@series +% \end{macrocode} +% If this is still undefined, try the default \emph{family}. +% Otherwise give up. We never try to change the encoding scheme! +% \changes{v1.9a}{1992/07/26}{} +% \begin{macrocode} + \expandafter + \ifx\csname\curr@fontshape\endcsname\relax + \let\f@family\default@family + \fi \fi + \fi +% \end{macrocode} +% At this point a valid |\curr@fontshape| combination must +% have been found. +% We inform the user about this fact. +%\changes{v3.0n}{1995/11/02} +% {(DPC) Remove extra space with \cs{string} for latex/1676} +% \changes{v3.0m}{1995/11/17} +% {Support \cs{@wrong@font@char} latex/1676} +% +% The |\expandafter\string| here stops \TeX\ adding the space +% that it usually puts after command names in messages. The similar +% construction with |\@undefined| just produces `undefined', but saves +% a few tokens. +% +% |\@wrong@font@char| is locally redefined in |\UseTextSymbol| from +% its normal (empty) definition, to report the symbol generating the +% font switch. +% \begin{macrocode} + \@font@warning{Font shape `\expandafter\string\reserved@a' + \expandafter\@gobble\string\@undefined\MessageBreak + using `\curr@fontshape' instead\@wrong@font@char}% + \global\let\last@fontshape\reserved@a +% \end{macrocode} +% We change |\@defaultsubs| to produce a warning at the end of +% the document. +% \changes{v3.0d}{1995/07/13}{Change a macro not a switch to flag +% default font substitutions} +% \changes{v3.0k}{1995/10/24}{Make this code inline since it +% happens only here} +% The macro |\@defaultsubs| is initially |\relax| but gets changed +% here if some default font substitution happens. +% It is then executed in |\enddocument|. +% \begin{macrocode} + \gdef\@defaultsubs{% + \@font@warning{Some font shapes were not available, defaults + substituted.\@gobbletwo}}% +% \end{macrocode} +% If we substitute a |\curr@fontshape| combination +% by the default one we don't want the warning to be printed out +% whenever this (unknown) combination is used. +% Therefore we globally |\let| the macro corresponding to +% the wanted combination equal to its substitution. +% This requires the use of four |\expandafter|'s +% since |\csname|\dots|\endcsname| has to be +% expanded before |\reserved@a| (i.e.\ the requested +% combination), +% and this must happen before the |\let| is executed. +% \begin{macrocode} + \global\expandafter\expandafter\expandafter\let + \expandafter\reserved@a + \csname\curr@fontshape\endcsname +% \end{macrocode} +% Now we can redefine |\font@name| accordingly. +% This \emph{must} be done globally since it might occur in the +% group opened by |\define@newfont|. If we would this +% definition were local the closing |\endgroup| there +% would restore the old meaning of |\font@name| and then +% switch to the wrong font at the end of |\selectfont| +% although the correct font was loaded. +% \begin{macrocode} + \xdef\font@name{% + \csname\curr@fontshape/\f@size\endcsname}% +% \end{macrocode} +% The last thing this macro does is to call |\pickup@font| +% again to load the font if it is not defined yet. +% At this point this code will loop endlessly if +% the defaults are not well defined. +% \begin{macrocode} + \pickup@font} +% \end{macrocode} +% \end{macro} +% +% \begin{macro}{\@wrong@font@char} +% \changes{v3.0m}{1995/11/17}{(DPC) Macro added. latex/1676} +% Normally empty but redefined in |\UseTextSymbol| so that the +% Font shape undefined message can refer to the symbol causing the +% problem. +% \begin{macrocode} +\let\@wrong@font@char\@empty +% \end{macrocode} +% \end{macro} +% +% \begin{macro}{\@@defaultsubs} +% \changes{v3.0d}{1995/07/13}{macro added} +% \changes{v3.0k}{1995/10/24}{macro removed} +% \begin{macro}{\@defaultsubs} +% \changes{v3.0d}{1995/07/13}{macro added} +% See above. +% \begin{macrocode} +\let\@defaultsubs\relax +% \end{macrocode} +% \end{macro} +% \end{macro} +% +% +% \begin{macro}{\strip@prefix} +% In |\extract@font| we will need a way to recover the +% replacement text of a macro. +% This is done by the primitive |\meaning| together +% with the macro |\strip@prefix| (for the details +% see appendix~D of the \TeX{}book, p.\ 382). +% \begin{macrocode} +\def\strip@prefix#1>{} +% \end{macrocode} +% \end{macro} +% +% ^^A \extract@font +% +% +% +% \section{Assigning math fonts to \emph{versions}} +% +% +% \begin{macro}{\install@mathalphabet} +% This is just another name for |\gdef| but we can redefine it if +% necessary later on. +% \begin{macrocode} +\let\install@mathalphabet\gdef +% \end{macrocode} +% \end{macro} +% +% +% +% \begin{macro}{\math@fonts} +% +% \changes{v1.9a}{1992/07/26}{} +% \begin{macrocode} +\let\math@fonts\@empty +% \end{macrocode} +% \end{macro} +% +% +% +% \begin{macro}{\select@group} +% \changes{v1.0t}{1989/11/26}{\cs{bgroup}/\cs{egroup} changed to +% \cs{begingroup}/\cs{endgroup} to avoid empty Ord atom on math list.} +% |\select@group| has four arguments: the new +% \meta{math alphabet identifier} (a control sequence), the +% \meta{math group number}, the extra macro for math mode +% and the |\curr@fontshape| definition macro name. +% We first check if we are in math mode. +% \changes{v1.1a}{1989/12/16}{\cs{relax} in front added.} +% \changes{v1.1a}{1989/12/16}{Now four arguments.} +% \begin{macrocode} +%\def\select@group#1#2#3{\relax\ifmmode +% \end{macrocode} +% We do these things locally using |\begingroup| instead +% of |\bgroup| to avoid the appearance of an empty Ord +% atom on the math list. +% \begin{macrocode} +% \begingroup +% \end{macrocode} +% We set the math fonts for the \emph{family} in question by calling +% |\getanddefine@fonts| in the correct environment. +% \changes{v1.9a}{1992/07/26}{} +% \begin{macrocode} +% \escapechar\m@ne +% \getanddefine@fonts{\csname c@mv@\math@version\endcsname}#3% +% \end{macrocode} +% We globally select the math fonts\dots +% \begin{macrocode} +% \globaldefs\@ne \math@fonts +% \end{macrocode} +% \dots{} and close the group to +% restore |\globaldefs| and |\escapechar|. +% \begin{macrocode} +% \endgroup +% \end{macrocode} +% As long as no \emph{size} or \emph{version} change occurs +% the \meta{math alphabet identifier} should simply switch to the +% installed \emph{math group} instead of calling +% |\select@group| +% unnecessarily. So we globally redefine the first argument +% (the new \meta{math alphabet identifier}) +% to expand into a |\mathgroup| switch +% and then select this \emph{alphabet}. Note that this redefinition +% will be overwritten by the next call to a \emph{version} macro. +% \changes{v1.1a}{1989/12/16}{Usage of `\quotechar=' macro added.} +% \changes{v1.1a}{1989/12/16}{Redefinition of alphabet now simpler.} +% \changes{v1.2a}{1990/01/20}{Def for alph id changed.} +% The original code for the end of |\select@group| was +% \begin{verbatim} +% \gdef#1{#3\mathgroup #2}#1\fi} +%\end{verbatim} +% i.e.\ first redefining the \meta{math alphabet identifier} and +% then calling the new definition to switch to the wanted +% \meta{math group}. Now we define the \meta{math alphabet +% identifier} as a call to the |\use@mathgroup| command. +% \changes{v1.2b}{1990/01/21}{Code moved to \cs{use@mathgroup}.} +% \begin{macrocode} +% \xdef#1{\noexpand\use@mathgroup\noexpand#2% +% {\number\csname c@mv@\math@version\endcsname}}% +% \end{macrocode} +% \changes{v1.3c}{1992/05/12}{Added call to +% \cs{extract@alph@from@version}.} +% But this is not sufficient, as we learned the hard way. +% The problem here is that the loading of the fonts that comprise +% the alphabet identifier |#1|, as well as the necessary math font +% assignments is deferred until it is used. This is OK so far, but +% if the fonts are switched within the current formula (which may +% happen if a sub-formula is a box that contains a math version +% switch) the font assignments for |#1| are not restored unless +% |#1| is used again. This is disastrous since TeX sees the wrong +% fonts at the end of the math formula, when it converts the math +% list into a horizontal list. +% +% This is taken into account as follows: When a math alphabet +% identifier is used for the first time in a certain version +% it modifies the corresponding macro |\mv@|\meta{version} +% so that it calls |\getanddefine@fonts| directly in future as well. +% We use the macro |\extract@alph@from@version| to do this. +% It takes the math alphabet identifer |#1| and the math version +% macro as arguments. +% \changes{v1.9a}{1992/07/26}{} +% \begin{macrocode} +% \expandafter\extract@alph@from@version +% \csname mv@\math@version\expandafter\endcsname +% \expandafter{\number\csname c@mv@\math@version\endcsname}% +% #1% +% \stepcounter{mv@\math@version}% +% \end{macrocode} +% Finally, it is not possible to simply call the new definition +% since we +% have an argument (the third argument of |\use@mathgroup| +% or more exactly the argument od |\math@egroup| if the {\ttfamily +% margid} option is in force) +% which would swallow our closing |\fi|. So +% we use the |\expandafter| technique to remove the |\fi| +% before the |\use@mathgroup| is expanded. +% \begin{macrocode} +%\expandafter #1\fi} +% \end{macrocode} +% \end{macro} +% +% +% \begin{macro}{\extract@alph@from@version} +% \changes{v1.3c}{1992/05/12}{Macro added.} +% We proceed to the definition of the +% macro |\extract@alph@from@version|. As stated above, it takes +% a math alphabet identifier and a math version macro +% (e.g.\ |\mv@normal|) as its arguments. +% \begin{macrocode} +\def\extract@alph@from@version#1#2#3{% +% \end{macrocode} +% To extract and replace the definition of math alphabet identifier +% |#3| in macro |#1| we have to recall how this definition looks +% like: Somewhere in the replacement text of |#1| there is +% the sequence\\[2pt] +% |\install@mathalphabet|\meta{math alphabet identifier} |#3||{%| \\ +% \hspace*{\MacroIndent}\hspace*{5mm} +% \meta{Definitions for }|#3}| \\[2pt] +% Hence, the first thing we do is to extract the tokens preceding +% this definitions, the definition itself, and the tokens following +% it. To this end we define one auxiliary macro |\reserved@a|. +% \begin{macrocode} + \def\reserved@a##1\install@mathalphabet#3##2##3\@nil{% +% \end{macrocode} +% When |\reserved@a| is expanded, it will have the tokens preceding +% the definition in question in its first argument (|##1|), the +% following tokens in its third argument (|##3|), and the replacement +% text for the math alphabet identifier |#3| in its second argument. +% (|##2|). This is then recorded for later use in a temporary macro +% |\reserved@b|. +% \begin{macrocode} + \def\reserved@b{##2}% +% \end{macrocode} +% Additionally, we define a macro |\reserved@c| to reconstruct the +% definitions for the math version in question from the tokens that +% will remain unchanged (|##1| and |##3|) and the yet to build new +% definitions for the math alphabet identifier |#3|. +% \begin{macrocode} + \def\reserved@c####1{\gdef#1{##1####1##3}}}% +% \end{macrocode} +% Then we execute our auxiliary macro. +% \begin{macrocode} + \expandafter\reserved@a#1\@nil +% \end{macrocode} +% OK, so now we have to build the new definition for |#3|. To do so, +% we first extract the interesting parts out of the old one. +% The old definition looks like:\\[2pt] +% |\select@group|\meta{math alphabet identifier} \\ +% \hspace*{\MacroIndent}\hspace*{5mm} +% \meta{math group number}\meta{math extra part}\\ +% \meta{|curr@fontshape| definition} \\[2pt] +% So we define a new temporary macro |\reserved@a| that +% extracts these parts. +% \begin{macrocode} + \def\reserved@a\select@group#3##1##2\@nil{% +% \end{macrocode} +% This macro can now directly rebuild the math version definition +% by calling |\reserved@c|: +% \begin{macrocode} + \reserved@c{% + \getanddefine@fonts{#2}##2% + \install@mathalphabet#3{% + \relax\ifmmode \else \non@alpherr#3\fi + \use@mathgroup##1{#2}}}% +% \end{macrocode} +% \changes{v2.1t}{1994/10/15}{Warn if math alpha is used outside math} +% In addtion it defines the alphabet the way it should be used from +% now on. +% \begin{macrocode} + \gdef#3{\relax\ifmmode \else \non@alpherr#3\fi + \use@mathgroup##1{#2}}}% +% \end{macrocode} +% Finally, we only have to call this macro |\reserved@a| on the old +% definitions recorded in |\reserved@b|: +% \begin{macrocode} + \expandafter\reserved@a\reserved@b\@nil + } +% \end{macrocode} +% \end{macro} +% +% +% +% \begin{macro}{\math@bgroup} +% \changes{v1.2a}{1990/01/20}{Def. placed in this file.} +% \begin{macro}{\math@egroup} +% \changes{v1.2a}{1990/01/20}{Def. placed in this file.} +% \changes{v1.2h}{1990/03/30}{Changed to have one arg.} +% \changes{v2.2f}{1994/03/10}{Changed \cs{begingroup}/\cs{endgroup} to +% \cs{bgroup}/\cs{egroup}.} +% Here are the default definitions for |\math@bgroup| and +% |\math@egroup|. We use |\bgroup| instead of |\begingroup| +% to avoid `leaking out' of style changes. This has the side +% effect of always producing mathord atoms. +% \begin{macrocode} +\let\math@bgroup\bgroup +\def\math@egroup#1{#1\egroup} +% +% \end{macrocode} +% \end{macro} +% \end{macro} +% +% +% \begin{macro}{\calculate@math@sizes} +% \changes{v2.1i}{1994/04/18}{Changed message to log only} +% Here is the default definition for |\calculate@math@sizes| +% a more elaborate interface +% is under testing in mthscale.sty. +% \begin{macrocode} +%<*2ekernel|def1> +\gdef\calculate@math@sizes{% + \@font@info{Calculating\space math\space sizes\space for\space + size\space <\f@size>}% + \dimen@\f@size \p@ + \@tempdimb \defaultscriptratio \dimen@ + \dimen@ \defaultscriptscriptratio \dimen@ + \expandafter\xdef\csname S@\f@size\endcsname{% + \gdef\noexpand\tf@size{\f@size}% + \gdef\noexpand\sf@size{\strip@pt\@tempdimb}% + \gdef\noexpand\ssf@size{\strip@pt\dimen@}% + \noexpand\math@fontstrue}} +% +%<*autoload> +\def\calculate@math@sizes{\try@sizes\calculate@math@sizes} +% +% \end{macrocode} +% \end{macro} +% +% \begin{macro}{\defaultscriptratio} +% \changes{v2.1h}{1994/04/11}{Macro added} +% \begin{macro}{\defaultscriptscriptratio} +% \changes{v2.1h}{1994/04/11}{Macro added} +% The default ratio for math +% sizes is:\\ +% 1 to |\defaultscriptratio| to |\defaultscriptscriptratio|.\\ +% By default this is 1 to .7 to .5. +% \begin{macrocode} +%<*2ekernel|autoload> +\def\defaultscriptratio{.7} +\def\defaultscriptscriptratio{.5} +% \end{macrocode} +% \end{macro} +% \end{macro} +% +% \begin{macro}{\noaccents@} +% If we don't have a definition for |\noaccents@| we provide a +% dummy. +% \begin{macrocode} +\ifx\noaccents@\@undefined + \let\noaccents@\@empty +\fi +% \end{macrocode} +% \end{macro} +% +% \begin{macro}{\showhyphens} +% \changes{v1.2l}{1990/06/30}{Macro added.} +% \changes{v2.0e}{1993/05/16}{Use \cs{reset@font}} +% \changes{v3.0h}{1995/10/10} +% {Use \cs{normalfont} and make colour safe, and autoloadable} +% \changes{v3.0u}{1998/03/25} +% {Suppress unnecessary error when used in preamble} +% The |\showhyphens| command must be redefined since the version in +% \texttt{plain.tex} uses |\tenrm|. We have also made some further +% adjustments for its use in \LaTeX. +% \begin{macrocode} +% +%<*2ekernel|autoerr> +\gdef\showhyphens#1{% + \setbox0\vbox{% + \color@begingroup + \everypar{}% + \parfillskip\z@skip\hsize\maxdimen + \normalfont + \pretolerance\m@ne\tolerance\m@ne\hbadness\z@\showboxdepth\z@\ #1% + \color@endgroup}} +% +%\def\showhyphens{\@autoerr\showhyphens} +%<*2ekernel|autoload> +% \end{macrocode} +% \end{macro} +% +% +% \begin{macro}{\addto@hook} +% \changes{v1.0u}{1989/12/05}{\cs{addto@hook} added.} +% \changes{v2.1d}{1994/02/10}{Made \cs{addto@hook} long.} +% We need a macro to add tokens to a hook. +% \begin{macrocode} +\long\def\addto@hook#1#2{#1\expandafter{\the#1#2}} +% \end{macrocode} +% \end{macro} +% +% +% \begin{macro}{\@vpt} +% \changes{v2.1v}{1994/11/09}{(DPC) macros added, from setsize.dtx} +% \changes{v2.1v}{1994/11/09}{(DPC) reduce save stack usage latex/1742} +% \begin{macrocode} + \def\@vpt{5} +% \end{macrocode} +% \end{macro} +% +% \begin{macro}{\@vipt} +% \begin{macrocode} + \def\@vipt{6} +% \end{macrocode} +% \end{macro} +% +% \begin{macro}{\@viipt} +% \begin{macrocode} + \def\@viipt{7} +% \end{macrocode} +% \end{macro} +% +% \begin{macro}{\@viiipt} +% \begin{macrocode} + \def\@viiipt{8} +% \end{macrocode} +% \end{macro} +% +% \begin{macro}{\@ixpt} +% \begin{macrocode} + \def\@ixpt{9} +% \end{macrocode} +% \end{macro} +% +% \begin{macro}{\@xpt} +% \begin{macrocode} + \def\@xpt{10} +% \end{macrocode} +% \end{macro} +% +% \begin{macro}{\@xipt} +% \begin{macrocode} + \def\@xipt{10.95} +% \end{macrocode} +% \end{macro} +% +% \begin{macro}{\@xiipt} +% \begin{macrocode} + \def\@xiipt{12} +% \end{macrocode} +% \end{macro} +% +% \begin{macro}{\@xivpt} +% \begin{macrocode} + \def\@xivpt{14.4} +% \end{macrocode} +% \end{macro} +% +% \begin{macro}{\@xviipt} +% \begin{macrocode} + \def\@xviipt{17.28} +% \end{macrocode} +% \end{macro} +% +% \begin{macro}{\@xxpt} +% \begin{macrocode} + \def\@xxpt{20.74} +% \end{macrocode} +% \end{macro} +% +% \begin{macro}{\@xxvpt} +% \begin{macrocode} + \def\@xxvpt{24.88} +% \end{macrocode} +% \end{macro} +% +% \begin{macrocode} +% +% \end{macrocode} +% +% \Finale +% diff --git a/Master/texmf-dist/source/latex/base/ltfsscmp.dtx b/Master/texmf-dist/source/latex/base/ltfsscmp.dtx new file mode 100644 index 00000000000..b4441aa4120 --- /dev/null +++ b/Master/texmf-dist/source/latex/base/ltfsscmp.dtx @@ -0,0 +1,414 @@ +% \iffalse meta-comment +% +% Copyright 1993 1994 1995 1996 1997 1998 1999 2000 2001 2002 2003 2004 +% The LaTeX3 Project and any individual authors listed elsewhere +% in this file. +% +% This file is part of the LaTeX base system. +% ------------------------------------------- +% +% It may be distributed and/or modified under the +% conditions of the LaTeX Project Public License, either version 1.3 +% of this license or (at your option) any later version. +% The latest version of this license is in +% http://www.latex-project.org/lppl.txt +% and version 1.3 or later is part of all distributions of LaTeX +% version 2003/12/01 or later. +% +% This file has the LPPL maintenance status "maintained". +% +% The list of all files belonging to the LaTeX base distribution is +% given in the file `manifest.txt'. See also `legal.txt' for additional +% information. +% +% The list of derived (unpacked) files belonging to the distribution +% and covered by LPPL is defined by the unpacking scripts (with +% extension .ins) which are part of the distribution. +% +% \fi +% \iffalse +%%% From File: ltfsscmp.dtx +%% Copyright (C) 1989-1995 Frank Mittelbach and Rainer Sch\"opf, +%% all rights reserved. +% +%<*driver> +% \fi +% +% +\ProvidesFile{ltfsscmp.dtx} + [1995/08/26 v3.0c LaTeX Kernel (NFSS1 Compatibility)] +% \iffalse +\documentclass{ltxdoc} +\begin{document} +\DocInput{ltfsscmp.dtx} +\end{document} +% +% \fi +% +% \iffalse +%<+checkmem>\def\CHECKMEM{\tracingstats=2 +%<+checkmem> \newlinechar=`\^^J +%<+checkmem> \message{^^JMemory usage: \filename}\shipout\hbox{}} +%<+checkmem>\CHECKMEM +% \fi +% +% \CheckSum{235} +% +% +% \GetFileInfo{ltfsscmp.dtx} +% \title{A new font selection scheme for \TeX{} macro packages\\ +% (Compatibility with NFSS1)\thanks +% {This file has version number +% \fileversion\ dated \filedate}} +% +% \author{Frank Mittelbach \and Rainer Sch\"opf} +% +% \maketitle +% +% This file contains the implementation of commands giving +% compatibility with the original `NFSS1' release of the Font Selection +% Scheme. +% +% \begin{quote} +% \textbf{Warning:} +% The macro documentation is still basically the documentation from the +% first NFSS release and therefore in some cases probably not +% completely accurate. +% \end{quote} +% +% \StopEventually{} +% +% +% \changes{v3.0b}{1995/06/15} +% {(DPC) minor documentation edits} +% \changes{v3.0a}{1995/05/24} +% {(DPC) Make file from previous file, fam.dtx 1995/05/20 v2.2d} +% +% +% +% \section{Compatibility code for NFSS release 1} +% +% There have been a couple of commands which became obsolete with NFSS2. +% In the past they have been still part of the kernel code to make it +% possible to process old packages using those commands but since they +% take up valuable space we decided to remove them and instead +% auto-load their definitions if they are actually encountered in some +% file. +% +% Thus the following code doesn't really belong to this file but I put +% it here for the moment until finally a documented version of +% \texttt{ltfss.dtx} is available. +% +% [ auto-loading not activated ] +% +% \begin{macro}{\new@fontshape} +% \begin{macro}{\subst@fontshape} +% \begin{macro}{\extra@def} +% \begin{macro}{\default@mextra} +% \begin{macro}{\define@mathalphabet} +% \begin{macro}{\define@mathgroup} +% These macros are the interfaces in NFSS1 which shouldn't be used +% any longer. We all define them to call the macro +% |\scan@fontshape| which is an internal macro that loads the real +% definitions and then to execute themselves again. Once this +% auto-loading has happened they have the definition shown below and +% thus execute their real code directly. +% \begin{macrocode} +%<*autoload> +\def\new@fontshape{\scan@fontshape\new@fontshape} +\def\subst@fontshape{\scan@fontshape\subst@fontshape} +\def\extra@def{\scan@fontshape\extra@def} +\def\default@mextra{\scan@fontshape\default@mextra} +\def\define@mathalphabet{\scan@fontshape\define@mathalphabet} +\def\define@mathgroup{\scan@fontshape\define@mathgroup} +% \end{macrocode} +% \end{macro} +% \end{macro} +% \end{macro} +% \end{macro} +% \end{macro} +% \end{macro} +% +% +% \begin{macro}{\scan@fontshape} +% Here is the kernel definition for |\scan@fontshape| which loads +% the actual definitions from the file \texttt{nfsscmp.def}. +% \begin{macrocode} +\def\scan@fontshape{\input{nfsscmp.def}} +% \end{macrocode} +% \end{macro} +% +% +% The following definitions are now placed into the auto-load file. +% \begin{macrocode} +% \end{macrocode} +% +% Since we don't know when this file will be read in we need to +% provide ourselves with standard |\catcode| settings. This is done +% by placing all definitions in a group and calling +% |\nfss@catcodes|. But this macro will also disable spaces which +% isn't very appropriate for the following code because it contains +% a lot of helper messages. Therefore we change this back. +% \begin{macrocode} +\begingroup +\nfss@catcodes +\catcode`\ =10\relax +% +%<*compat> +% \end{macrocode} +% +% \begin{macro}{\new@fontshape} +% The interface is now |\DeclareFontShape|. +% \begin{macrocode} +\gdef\new@fontshape#1#2#3#4{% + \warn@rel@i\new@fontshape\DeclareFontShape + \expandafter\scan@fontshape\@gobble#4<\@nil><<% + \DeclareFontShape U{#1}{#2}{#3}\reserved@f} +\@onlypreamble\new@fontshape +% \end{macrocode} +% \end{macro} +% +% +% \begin{macro}{\warn@rel@i} +% The warning message used above. +% \begin{macrocode} +\gdef\warn@rel@i#1#2{% + \@font@warning{*** NFSS release 1 command + \noexpand#1found\MessageBreak + *** Update by using release 2 command + \string#2.\MessageBreak + *** Recovery is probably possible}% +} +\@onlypreamble\warn@rel@i +% \end{macrocode} +% \end{macro} +% +% +% +% \begin{macro}{\scan@fontshape} +% This will scan the old font shape definition syntax. +% \begin{macrocode} +\gdef\scan@fontshape{% + \let\reserved@f\@empty + \let\reserved@e\@empty % holds last info + \scan@@fontshape +} +\@onlypreamble\scan@fontshape +% \end{macrocode} +% \end{macro} +% +% +% \begin{macro}{\scan@@fontshape} +% \begin{macrocode} +\gdef\scan@@fontshape#1>#2#3<{% + \ifx\@nil#1% + \edef\reserved@f{\reserved@f\reserved@e}% + \else + \def\reserved@b{#1}% nick names + \def\reserved@c{#3}% + \in@{ at}{#3}% + \ifin@ + \in@{pt}{#3}% not a proof but a good chance + \ifin@ +% \end{macrocode} +% We grap also everything after pt and discard it if people have +% forgotten to place a percent sign there. +% \changes{v2.1d}{1994/02/10}{scan away stuff after pt} +% \begin{macrocode} + \def\reserved@a##1 at##2pt##3\@nil{% + \def\reserved@b{##2}% + \def\reserved@c{##1}% + }% + \reserved@a#3\@nil + \fi + \fi + \ifnum 0<0#2 + \edef\reserved@d{subf*\reserved@c}% + \ifcase #2\or + \or + \else + \errmessage{*** What's this? NFSS release 0? ***}% + \fi + \else + \edef\reserved@d{#2\reserved@c}% + \fi + \ifx\reserved@d\reserved@e + \edef\reserved@f{\reserved@f<\reserved@b>}% + \else + \edef\reserved@f{\reserved@f\reserved@e<\reserved@b>}%add old info + \let\reserved@e\reserved@d + \fi + \expandafter\scan@@fontshape + \fi +} +\@onlypreamble\scan@@fontshape +% \end{macrocode} +% \end{macro} +% +% +% +% \begin{macro}{\subst@fontshape} +% This is now also handled by the extend syntax of +% |\DeclareFontShape|. +% \begin{macrocode} +\gdef\subst@fontshape#1#2#3#4#5#6{% + \warn@rel@i\subst@fontshape\DeclareFontShape + \DeclareFontShape{U}{#1}{#2}{#3}{<->sub*#4/#5/#6}{}} +\@onlypreamble\subst@fontshape +% \end{macrocode} +% \end{macro} +% +% +% +% \begin{macro}{\extra@def} +% This was replaced by |\DeclareFontFamily|. +% \begin{macrocode} +\gdef\extra@def#1#2#3{% + \warn@rel@i\extra@def\DeclareFontFamily + \DeclareFontFamily{U}{#1}{}% +} +\@onlypreamble\extra@def +% \end{macrocode} +% \end{macro} +% +% +% +% +% \begin{macro}{\default@mextra} +% The new name is |\DeclareFontEncodingDefaults| but in this case +% we don't feel comfortable with this either. +% \begin{macrocode} +\gdef\default@mextra{% + \warn@rel@i\default@mextra\DeclareFontEncodingDefaults +% \end{macrocode} +% We pick up the argument to |\default@mextra| implicitly as +% the second argument of |\DeclareFontEncodingDefaults|. +% \begin{macrocode} + \DeclareFontEncodingDefaults\relax +} +\@onlypreamble\default@mextra +% \end{macrocode} +% \end{macro} +% +% +% +% \begin{macro}{\preload@sizes} +% The new interface is |\DeclarePreloadSizes|. +% \begin{macrocode} +\gdef\preload@sizes{% + \warn@rel@i\preload@sizes\DeclarePreloadSizes + \DeclarePreloadSizes U% +} +\@onlypreamble\preload@sizes +% \end{macrocode} +% \end{macro} +% +% +% \begin{macro}{\err@rel@i} +% This macro is used in cases where emulation with NFSS2 features +% is not really possible. +% \begin{macrocode} +\gdef\err@rel@i#1#2{% + \@latex@error{*** NFSS release 1 command \noexpand#1found% + ^^J*** Recovery not possible. Use \string#2}% + {The new release of NFSS doesn't support the + \noexpand#1command^^Jany longer. + Please upgrade your file to the syntax of NFSS + release 2^^Jusing the \noexpand#2command.}% +% \end{macrocode} +% Let's die. +% \begin{macrocode} + \batchmode\input.\relax +} +\@onlypreamble\err@rel@i +% \end{macrocode} +% \end{macro} +% +% +% +% \begin{macro}{\newmathalphabet} +% \begin{macro}{\newmathalphabet@@} +% \begin{macro}{\newmathalphabet@@@} +% |\newmathalphabet| is the old form. +% \begin{macrocode} +\gdef\newmathalphabet{% + \if@no@font@opt + \@latex@error{*** NFSS release 1 command + \noexpand\newmathalphabet found% + ^^J \space*** Automatic recovery not possible.% + ^^J \space*** TYPE H for Help% + }% + {Please look at the file usrguide.tex for hints on + how to resolve this problem.}% + \else + \warn@rel@i\newmathalphabet\DeclareMathAlphabet + \fi + \@ifstar\newmathalphabet@@@ + \newmathalphabet@@} +\gdef\newmathalphabet@@#1{\DeclareMathAlphabet#1{U}{}{}{}} +\gdef\newmathalphabet@@@#1#2#3#4{% + \DeclareMathAlphabet{#1}{U}{#2}{#3}{#4}} +\@onlypreamble\newmathalphabet +\@onlypreamble\newmathalphabet@@ +\@onlypreamble\newmathalphabet@@@ +% \end{macrocode} +% \end{macro} +% \end{macro} +% \end{macro} +% +% \begin{macro}{\if@no@font@opt} +% \begin{macro}{\@no@font@optfalse} +% \begin{macrocode} +\global\let\if@no@font@opt\iftrue +\gdef\@no@font@optfalse{\let\if@no@font@opt\iffalse} +% \end{macrocode} +% \end{macro} +% \end{macro} +% +% \begin{macro}{\define@mathalphabet} +% This is a case where dying is best. +% \begin{macrocode} +\gdef\define@mathalphabet{% + \err@rel@i\define@mathalphabet\DeclareMathAlphabet +} +\@onlypreamble\define@mathalphabet +% \end{macrocode} +% \end{macro} +% +% +% +% +% \begin{macro}{\define@mathgroup} +% And here is another one +% \begin{macrocode} +\gdef\define@mathgroup{% + \err@rel@i\define@mathgroup\DeclareSymbolFont +} +\@onlypreamble\define@mathgroup +% +% \end{macrocode} +% \end{macro} +% +% +% \begin{macro}{\addtoversion} +% |\addtoversion| is the old form. +% \begin{macrocode} +\def\addtoversion#1#2{% + \warn@rel@i\addtoversion\SetMathAlphabet + \SetMathAlphabet#2{#1}{U}} +\@onlypreamble\addtoversion +% \end{macrocode} +% \end{macro} +% +% +% +% That finishes the definitions for the old interfaces --- but first +% we better finish the group. +% \begin{macrocode} +%<*autoload> +\endgroup +% +% \end{macrocode} +% +% \Finale +% diff --git a/Master/texmf-dist/source/latex/base/ltfssdcl.dtx b/Master/texmf-dist/source/latex/base/ltfssdcl.dtx new file mode 100644 index 00000000000..f2aee76bdab --- /dev/null +++ b/Master/texmf-dist/source/latex/base/ltfssdcl.dtx @@ -0,0 +1,1521 @@ +% \iffalse meta-comment +% +% Copyright 1993 1994 1995 1996 1997 1998 1999 2000 2001 2002 2003 2004 +% The LaTeX3 Project and any individual authors listed elsewhere +% in this file. +% +% This file is part of the LaTeX base system. +% ------------------------------------------- +% +% It may be distributed and/or modified under the +% conditions of the LaTeX Project Public License, either version 1.3 +% of this license or (at your option) any later version. +% The latest version of this license is in +% http://www.latex-project.org/lppl.txt +% and version 1.3 or later is part of all distributions of LaTeX +% version 2003/12/01 or later. +% +% This file has the LPPL maintenance status "maintained". +% +% The list of all files belonging to the LaTeX base distribution is +% given in the file `manifest.txt'. See also `legal.txt' for additional +% information. +% +% The list of derived (unpacked) files belonging to the distribution +% and covered by LPPL is defined by the unpacking scripts (with +% extension .ins) which are part of the distribution. +% +% \fi +% \iffalse +%%% From File: ltfssdcl.dtx +%% Copyright (C) 1989-1998 Frank Mittelbach and Rainer Sch\"opf, +%% all rights reserved. +% +%<*driver> +% \fi +% +% +\ProvidesFile{ltfssdcl.dtx} + [1998/08/17 v3.0i LaTeX Kernel (NFSS Declarative Interface)] +% \iffalse +\documentclass{ltxdoc} +\begin{document} +\DocInput{ltfssdcl.dtx} +\end{document} +% +% \fi +% +% \iffalse +%<+checkmem>\def\CHECKMEM{\tracingstats=2 +%<+checkmem> \newlinechar=`\^^J +%<+checkmem> \message{^^JMemory usage: \filename}\shipout\hbox{}} +%<+checkmem>\CHECKMEM +% \fi +% +% \CheckSum{1871} +% +% +% \GetFileInfo{ltfssdcl.dtx} +% \title{A new font selection scheme for \TeX{} macro packages\\ +% (Declarative Interface)\thanks +% {This file has version number +% \fileversion\ dated \filedate}} +% +% \author{Frank Mittelbach \and Rainer Sch\"opf} +% +% \maketitle +% +% This file contains the main implementation of the font selection +% scheme commands. See other parts of the \LaTeX\ distribution, or +% \emph{The \LaTeX\ Companion} for higher level documentation of these +% commands. +% +% \begin{quote} +% \textbf{Warning:} +% The macro documentation is still basically the documentation from the +% first NFSS release and therefore in some cases probably not +% completely accurate. +% \end{quote} +% +% \StopEventually{} +% +% \section{Interface Commands} +% +% \changes{v3.0i}{1998/08/17} +% {(RmS) Corrected minor glitches in changes entries.} +% \changes{v3.0b}{1995/06/15} +% {(DPC) minor documentation changes} +% \changes{v3.0a}{1995/05/24} +% {(DPC) Make file from previous file, latint.dtx 1995/05/21 v2.1t} +% +% +% \changes{v2.1o}{1994/11/22} +% {wrap long lines} +% \changes{v2.1m}{1994/11/17} +% {\cs{@tempa} to \cs{reserved@a}} +% \changes{v2.1j}{1994/05/29}{Use new error commands} +% \changes{v2.1h}{1994/05/13}{Removed file identification typeout} +% \changes{v2.1g}{1994/05/12}{Allow \cs{relax}'ed cmds to be declared} +% \changes{v2.1g}{1994/05/12}{Allow \cs{relax} as undefined command} +% \changes{v2.1e}{1994/04/28}{Removed all \cs{uppercase} in hex num +% parsing macros} +% \changes{v2.1d}{1994/04/18}{Removed surplus \cs{no@alphabet@error} +% (see fam.dtx)} +% +% +% +% \changes{v2.1f}{1994/05/03}{Renamed \cs{@@DeclareMathDelimiter} to +% \cs{@DeclareMathDelimiter}} +% \changes{v2.1c}{1994/03/13}{add 2ekernel module to omit repeated code} +% +% +% \begin{macro}{\in@} +% \begin{macro}{\ifin@} +% |\@in| is a utility macro with two arguments. It determines +% whether its first argument occurs in its second (after expanding +% it) and sets the switch |\if@in| accordingly. +% \begin{macrocode} +%<*2ekernel|autoload> +\def\in@#1#2{% + \def\in@@##1#1##2##3\in@@{% + \ifx\in@##2\in@false\else\in@true\fi}% + \in@@#2#1\in@\in@@} +\newif\ifin@ +% \end{macrocode} +% \end{macro} +% \end{macro} +% +% Before the |\begin{document}| command several +% \meta{math versions} and \meta{math alphabet identifiers} may +% be declared. +% In principle, there should be exactly one family/series/shape +% combination be declared for each version/alphabet pair. +% But we want to allow for defaults as well for automagical +% filling of holes. +% +% While building the tables for math alphabet identifiers and math +% versions we keep several lists: +% \begin{itemize} +% \item the list of all math versions, |\version@list|, +% each entry prefixed by the control sequence |\version@elt|, +% i.e.\ this list has the following form +% \begin{quote} +% |\version@elt|\meta{version$_1$}^^A +% |\version@elt|\meta{version$_2$}\ldots\\\hspace*{\fill}^^A +% |\version@elt|\meta{version$_n$} +% \end{quote} +% \item the list of all math alphabet identifiers. Here every +% entry has the form:\\[2pt] +% \hspace*{\MacroIndent} +% |\group@elt|\meta{math group number}\\ +% \hspace*{\MacroIndent} +% |{{|\meta{default family}^^A +% |}{|\meta{default series}^^A +% |}{|\meta{default shape}|}}|. +% \item Each defined math alphabet identifier holds a list containing +% Information about the {\em versions\/} for which it is +% defined. This list has a more complicated structure: it +% looks as follows: +% \begin{quote} +% |\set@alpha|\meta{the alphabet identifier itself}\\ +% \hspace*{\MacroIndent} +% |\reserved@c|\meta{math version}\meta{font info}\\ +% \hspace*{\MacroIndent}\ldots\\ +% |\@nil| +% \end{quote} +% where \meta{font info} is either |\reserved@e| +% (if the combination is not defined yet) or +% \begin{quote} +% |{{|\meta{family}|}{|\meta{series}^^A +% |}{|\meta{shape}|}}| +% \end{quote} +% \end{itemize} +% +% \begin{macro}{\version@list} +% We initialize the version list to be empty. +% \begin{macrocode} +\let\version@list=\@empty +\@onlypreamble\version@list +% \end{macrocode} +% \end{macro} +% +% +% \begin{macro}{\version@elt} +% \begin{macrocode} +\let\version@elt\relax +\@onlypreamble\version@elt +% \end{macrocode} +% \end{macro} +% +% +% \begin{macro}{\new@mathversion} +% The macro |\new@mathversion| is called with the version control +% sequence as its argument. +% \begin{macrocode} +%\def\new@mathversion#1{% +% \end{macrocode} +% The first thing this macro does is to check if the version +% identifier is already present in |\version@list|. +% We enclose |\version@list| in braces since it might be empty +% (if no {\em version\/} is defined yet). But this means that +% we need a suitable number of |\expandafter| primitives. +% \begin{macrocode} +% \expandafter\in@\expandafter#1\expandafter{\version@list}% +% \ifin@ +% \end{macrocode} +% If so it prints an error message. +% The |\next| macro is used to get rid of the four characters +% |\mv@| that would otherwise appear at the begin of the +% version name in the error message. +% \begin{macrocode} +% \@latex@error{Math version +% `\expandafter\@gobblefour\string#1' +% already defined}\@eha +% \end{macrocode} +% Otherwise we have a new version, and we can proceed with +% entering it into the tables. +% We add it to |\version@list|. This is very easy: +% we define |\version@elt| (which is the delimiter in +% |\version@list|) to protect itself and the following token +% from being expanded and simply redefine |\version@list|. +% \begin{macrocode} +% \else +% \global\expandafter\newcount\csname c@\expandafter +% \@gobble\string#1\endcsname +% \global\csname c@\expandafter +% \@gobble\string#1\endcsname\@ne +% \def\version@elt{\noexpand\version@elt\noexpand}% +% \edef\version@list{\version@list\version@elt#1}% +% \end{macrocode} +% Then we prepare to enter the new version into all math +% alphabet identifier lists. Remember that these lists +% use |\reserved@c| as delimiter, and that there appears the +% control sequence |\reserved@e| that must not be expanded. +% Therefore we take suitable precautions. +% \begin{macrocode} +% \def\reserved@c{\noexpand\reserved@c\noexpand}% +% \let\reserved@e\relax +% \end{macrocode} +% We will now go through the |\alpha@list| to process every +% \meta{math alphabet identifier} in turn. +% Since this list has |\group@elt| as a delimiter we define +% this control sequence. It has three arguments as every +% entry consists of three items (as explained above). +% \begin{macrocode} +% \def\group@elt##1##2##3{% +% \end{macrocode} +% The first of these arguments is the \meta{math alphabet +% identifier}. We redefine it by appending the information +% about the new version at the end of the list contained in +% it. However, there is one subtlety: the definitions for +% |\reserved@c| and |\reserved@e| made above prevent the +% main part of the list from being expanded. But we still have +% to take care of the header and the trailer. To do this we +% remove the trailer by means of the macro |\remove@nil| +% which also protect the header from being expanded. Its +% definition is given below. Now we can prepare to add the +% new version. +% \begin{macrocode} +% \edef##1{\expandafter\remove@nil##1% +% \reserved@c +% #1% +% \reserved@e +% \noexpand\@nil}}% +% \end{macrocode} +% Finally we call |\alpha@list| which will now execute +% the macro |\group@elt| once for every defined \meta{math +% alphabet identifier}. And that's all for now. +% \begin{macrocode} +% \alpha@list +% \fi} +% \end{macrocode} +% \end{macro} +% +% +% \begin{macro}{\alpha@list} +% As we explained above every entry in |\alpha@list| has +% the form\\[2pt] +% |\alpha@elt|\\\meta{alphabet identifier}\meta{internal +% group number}\meta{default font assignments}\ldots\\[2pt] +% We initialize it to |\@empty|. +% \begin{macrocode} +\let\alpha@list\@empty +\@onlypreamble\alpha@list +% \end{macrocode} +% \end{macro} +% +% +% \begin{macro}{\alpha@elt} +% \begin{macrocode} +\let\alpha@elt\relax +\@onlypreamble\alpha@elt +% \end{macrocode} +% \end{macro} +% +% +% +% \begin{macro}{\newgroup} +% Start the group (fam) allocation at 0. (Doesn't belong here.) +% \begin{macrocode} +\count18=-1 +% \end{macrocode} +% \end{macro} +% +% \begin{macro}{\stepcounter} +% \changes{v3.0f}{1997/11/13} +% {(DPC) Remove as never used. (Re)defined in ltcounts} +% \end{macro} +% +% \begin{macro}{\select@group} +% We surround |\select@group| with braces so that functions using it +% can be used directly after |_| or |^|. +% \changes{v2.1p}{1994/12/10}{Surround with braces (add fourth arg)} +% However, if we use oldstyle syntax where the math alphabet +% doesn't have arguments (ie if |\math@bgroup| is not |\bgroup|) we +% need to get rid of the extra group. +% \changes{v2.1q}{1995/04/02}{fix problem for pr/1275} +% \changes{v3.0g}{1997/11/20} +% {(DPC) inline use of \cs{stepcounter} (faster, and saves a csname +% per math version as no reset list)} +% \begin{macrocode} +\def\select@group#1#2#3#4{% + \ifx\math@bgroup\bgroup\else\relax\expandafter\@firstofone\fi + {% + \ifmmode + \ifnum\csname c@mv@\math@version\endcsname<\sixt@@n + \begingroup + \escapechar\m@ne + \getanddefine@fonts{\csname c@mv@\math@version\endcsname}#3% + \globaldefs\@ne \math@fonts + \endgroup + \init@restore@version + \xdef#1{\noexpand\use@mathgroup\noexpand#2% + {\number\csname c@mv@\math@version\endcsname}}% + \global\advance\csname c@mv@\math@version\endcsname\@ne + \else + \let#1\relax + \@latex@error{Too many math alphabets used in + version \math@version}% + \@eha + \fi + \else \expandafter\non@alpherr\fi + #1{#4}% + }% +} +\@onlypreamble\restore@mathversion +% \end{macrocode} +% \end{macro} +% +% \begin{macro}{\init@restore@version} +% \changes{v3.0e}{1996/07/26}{Removed \cs{ifrestore@version} switch +% and replaced by \cs{init@restore@version}} +% \begin{macrocode} +\def\init@restore@version{% + \global\let\init@restore@version\relax + \xdef\restore@mathversion + {\expandafter\noexpand\csname mv@\math@version\endcsname + \global\csname c@mv@\math@version\endcsname + \number\csname c@mv@\math@version\endcsname\relax}% + \aftergroup\dorestore@version +} +\@onlypreamble\init@restore@version +% \end{macrocode} +% \end{macro} +% +% \begin{macro}{\non@alpherr} +% \changes{v3.0c}{1995/10/10} +% {(DPC) autoload error message} +% \begin{macrocode} +% +%<*2ekernel|autoerr> +\gdef\non@alpherr#1{\@latex@error{% +% \end{macrocode} +% Since the argument is the internal alphabet name, we have to get +% rid of the |@| in its name. The trick here is to use |\@firstoftwo| +% which is a \LaTeX{} macro which discards the second of two +% arguments. +% \begin{macrocode} + \expandafter\@firstoftwo\string#1 allowed only in math mode}\@ehd} +% +%\def\non@alpherr{\@autoerr\non@alpherr} +%<*2ekernel|autoload> +% \end{macrocode} +% \end{macro} +% +% \begin{macro}{\dorestore@version} +% \begin{macrocode} +\def\dorestore@version + {\ifmmode + \aftergroup\dorestore@version + \else + \gdef\init@restore@version{% + \global\let\init@restore@version\relax + \xdef\restore@mathversion + {\expandafter\noexpand\csname mv@\math@version\endcsname + \global\csname c@mv@\math@version\endcsname + \number\csname c@mv@\math@version\endcsname\relax}% + \aftergroup\dorestore@version + }% + \begingroup + \let\getanddefine@fonts\@gobbletwo + \restore@mathversion + \endgroup + \fi}% +\@onlypreamble\dorestore@version +% \end{macrocode} +% \end{macro} +% +% \begin{macro}{\document@select@group} +% We surround |\select@group| with braces so that functions using it +% can be used directly after |_| or |^|. +% \changes{v2.1p}{1994/12/10}{Surround with braces (add fourth arg)} +% \changes{v2.1q}{1995/04/02}{fix problem for pr/1275} +% \changes{v3.0g}{1997/11/20} +% {(DPC) inline use of \cs{stepcounter} (faster, and saves a csname +% per math version as no reset list)} +% \begin{macrocode} +\def\document@select@group#1#2#3#4{% + \ifx\math@bgroup\bgroup\else\relax\expandafter\@firstofone\fi + {% + \ifmmode + \ifnum\csname c@mv@\math@version\endcsname<\sixt@@n + \begingroup + \escapechar\m@ne + \getanddefine@fonts{\csname c@mv@\math@version\endcsname}#3% + \globaldefs\@ne \math@fonts + \endgroup + \expandafter\extract@alph@from@version + \csname mv@\math@version\expandafter\endcsname + \expandafter{\number\csname + c@mv@\math@version\endcsname}% + #1% + \global\advance\csname c@mv@\math@version\endcsname\@ne + \else + \let#1\relax + \@latex@error{Too many math alphabets used + in version \math@version}% + \@eha + \fi + \else \expandafter\non@alpherr\fi + #1{#4}% + }% +} +% \end{macrocode} +% \end{macro} +% +% \begin{macro}{\process@table} +% \begin{macrocode} +\def\process@table{% + \def\cdp@elt##1##2##3##4{% + \@font@info{Checking defaults for + ##1/##2/##3/##4}% + \expandafter + \ifx\csname##1/##2/##3/##4\endcsname\relax +% \end{macrocode} +% Grouping is important for two reasons, first |\cdp@elt| will get +% redefined if |\Declare...| functions are executed within the +% external |.fd| file and secondly |\try@load@fontshape| changes a +% lot of catcodes without surrounding itself with a group. +% \begin{macrocode} + \begingroup + \def\f@encoding{##1}\def\f@family{##2}% + \try@load@fontshape + \endgroup + \fi + \expandafter + \ifx\csname##1/##2/##3/##4\endcsname\relax + \@latex@error{This NFSS system isn't set up properly}% + {For encoding scheme ##1 the defaults + ##2/##3/##4 do not form a valid font shape}% + \else + \@font@info{... okay}% + \fi}% + \cdp@list +% \end{macrocode} +% Now we make sure that |\error@fontshape| is okay. +% \begin{macrocode} + \begingroup + \escapechar\m@ne + \error@fontshape + \expandafter\ifx\csname \curr@fontshape\endcsname\relax + \begingroup + \try@load@fontshape + \endgroup + \fi + \expandafter\ifx\csname \curr@fontshape\endcsname\relax + \@latex@error{This NFSS system isn't set up properly}% + {The system maintainer forgot to specify a suitable + substitution + font shape using the \noexpand\DeclareErrorFont + command}% + \fi + \endgroup +% \end{macrocode} +% Set |\select@group| to its meaning used within the document body. +% \begin{macrocode} + \let\select@group\document@select@group +% \end{macrocode} +% Install the default font attributes they are currently pointing +% to error font shape. +% Don't use |\reset@font| since that would trigger |\selectfont|. +% \begin{macrocode} + \fontencoding{\encodingdefault}% + \fontfamily{\familydefault}% + \fontseries{\seriesdefault}% + \fontshape{\shapedefault}% +% \end{macrocode} +% kill all macros not longer needed. +% we need to add many more!!!!!! +% \begin{macrocode} + \everyjob{}% +} +\@onlypreamble\process@table +% \end{macrocode} +% \end{macro} +% +% \begin{macrocode} +%\@onlypreamble\set@mathradical +% \end{macrocode} +% +% \begin{macro}{\DeclareMathVersion} +% \begin{macrocode} +\def\DeclareMathVersion#1{% + \expandafter\new@mathversion\csname mv@#1\endcsname} +\@onlypreamble\DeclareMathVersion +% \end{macrocode} +% \end{macro} +% +% \begin{macro}{\new@mathversion} +% \begin{macrocode} +\def\new@mathversion#1{% + \expandafter\in@\expandafter#1\expandafter{\version@list}% + \ifin@ + \@font@info{Redeclaring math version + `\expandafter\@gobblefour\string#1'}% + \else + \global\expandafter\newcount\csname c@\expandafter + \@gobble\string#1\endcsname + \def\version@elt{\noexpand\version@elt\noexpand}% + \edef\version@list{\version@list\version@elt#1}% + \fi +% \end{macrocode} +% |\toks@| is used to gather all tokens for the math version. +% |\count@| will be used to count the math groups we add to this +% version. +% \begin{macrocode} + \toks@{}% + \count@\z@ +% \end{macrocode} +% Now we loop over |\group@list| to add all math groups defined so +% far to the version and at the same time to count them. +% \begin{macrocode} + \def\group@elt##1##2{% + \advance\count@\@ne + \addto@hook\toks@{\getanddefine@fonts##1##2}% + }% + \group@list +% \end{macrocode} +% We set the counter for this math version to the number of math +% groups found in |\group@list|. +% \begin{macrocode} + \global\csname c@\expandafter\@gobble\string#1\endcsname\count@ +% \end{macrocode} +% Now we loop over |\alpha@list| to add all math alphabets known so +% far. We have to distinugish the case that an alphabet by default +% should produce an error in new versions. +% \begin{macrocode} + \def\alpha@elt##1##2##3{% + \ifx##2\no@alphabet@error + \toks@\expandafter{\the\toks@\install@mathalphabet##1% + {\no@alphabet@error##1}}% + \else + \toks@\expandafter{\the\toks@\install@mathalphabet##1% + {\select@group##1##2##3}}% + \fi + }% + \alpha@list +% \end{macrocode} +% Finally we define the math version to expand to the contents of +% |\toks@|. +% \changes{v2.0e}{1993/08/18}{Exchanged names of encodings in warning +% message of \cs{SetSymbolFont}.} +% \begin{macrocode} + \xdef#1{\the\toks@}% +} +\@onlypreamble\new@mathversion +% \end{macrocode} +% \end{macro} +% +% \begin{macro}{\DeclareSymbolFont} +% \begin{macrocode} +\def\DeclareSymbolFont#1#2#3#4#5{% + \@tempswafalse + \edef\reserved@b{#2}% + \def\cdp@elt##1##2##3##4{\def\reserved@c{##1}% + \ifx\reserved@b\reserved@c \@tempswatrue\fi}% + \cdp@list + \if@tempswa + \@ifundefined{sym#1}{% +% \end{macrocode} +% +% \begin{macrocode} + \expandafter\new@mathgroup\csname sym#1\endcsname + \expandafter\new@symbolfont\csname sym#1\endcsname + {#2}{#3}{#4}{#5}}% + {% +% \end{macrocode} +% +% \begin{macrocode} + \@font@info{Redeclaring symbol font `#1'}% +% \end{macrocode} +% \changes{v3.0f}{1997/11/13} +% {(DPC) Really update \cs{group@list} dont +% leave new version in \cs{toks@}. latex/2661} +% Update the group list. +% \begin{macrocode} + \def\group@elt##1##2{% + \noexpand\group@elt\noexpand##1% + \expandafter\ifx\csname sym#1\endcsname##1% + \expandafter\noexpand\csname#2/#3/#4/#5\endcsname + \else + \noexpand##2% + \fi}% + \xdef\group@list{\group@list}% +% \end{macrocode} +% Update the version list. +% \begin{macrocode} + \def\version@elt##1{% + \expandafter + \SetSymbolFont@\expandafter##1\csname#2/#3/#4/#5\expandafter + \endcsname \csname sym#1\endcsname + }% + \version@list + }% + \else + \@latex@error{Encoding scheme `#2' unknown}\@eha + \fi + } +\@onlypreamble\DeclareSymbolFont +% \end{macrocode} +% \end{macro} +% +% \begin{macro}{\group@list} +% \begin{macrocode} +\let\group@list\@empty +\@onlypreamble\group@list +% \end{macrocode} +% \end{macro} +% +% \begin{macro}{\group@elt} +% \begin{macrocode} +\let\group@elt\relax +\@onlypreamble\group@elt +% \end{macrocode} +% \end{macro} +% +% \begin{macro}{\new@symbolfont} +% \begin{macrocode} +\def\new@symbolfont#1#2#3#4#5{% + \toks@\expandafter{\group@list}% + \edef\group@list{\the\toks@\noexpand\group@elt\noexpand#1% + \expandafter\noexpand\csname#2/#3/#4/#5\endcsname}% + \def\version@elt##1{\toks@\expandafter{##1}% + \edef##1{\the\toks@\noexpand\getanddefine@fonts + #1\expandafter\noexpand\csname#2/#3/#4/#5\endcsname}% + \global\advance\csname c@\expandafter + \@gobble\string##1\endcsname\@ne + }% + \version@list +} +\@onlypreamble\new@symbolfont +% \end{macrocode} +% \end{macro} +% +% \begin{macro}{\SetSymbolFont} +% \begin{macrocode} +\def\SetSymbolFont#1#2#3#4#5#6{% + \@tempswafalse + \edef\reserved@b{#3}% + \def\cdp@elt##1##2##3##4{\def\reserved@c{##1}% + \ifx\reserved@b\reserved@c \@tempswatrue\fi}% + \cdp@list + \if@tempswa + \expandafter\SetSymbolFont@ + \csname mv@#2\expandafter\endcsname\csname#3/#4/#5/#6\expandafter + \endcsname \csname sym#1\endcsname + \else + \@latex@error{Encoding scheme `#3' unknown}\@eha + \fi +} +\@onlypreamble\SetSymbolFont +% \end{macrocode} +% \end{macro} +% +% \begin{macro}{\SetSymbolFont@} +% \begin{macrocode} +\def\SetSymbolFont@#1#2#3{% + \expandafter\in@\expandafter#1\expandafter{\version@list}% + \ifin@ + \expandafter\in@\expandafter#3\expandafter{\group@list}% + \ifin@ + \begingroup + \expandafter\get@cdp\string#2\@nil\reserved@a + \toks@{}% + \def\install@mathalphabet##1##2{% + \addto@hook\toks@{\install@mathalphabet##1{##2}}% + }% + \def\getanddefine@fonts##1##2{% + \ifnum##1=#3% + \addto@hook\toks@{\getanddefine@fonts#3#2}% + \expandafter\get@cdp\string##2\@nil\reserved@b + \ifx\reserved@a\reserved@b\else + \@font@warning{Encoding `\reserved@b' has changed + to `\reserved@a' for symbol font\MessageBreak + `\expandafter\@gobblefour\string#3' in the + math version `\expandafter + \@gobblefour\string#1'}% + \fi + \@font@info{% + Overwriting symbol font + `\expandafter\@gobblefour\string#3' in + version `\expandafter + \@gobblefour\string#1'\MessageBreak + \@spaces \expandafter\@gobble\string##2 --> + \expandafter\@gobble\string#2}% + \else + \addto@hook\toks@{\getanddefine@fonts##1##2}% + \fi}% + #1% + \xdef#1{\the\toks@}% + \endgroup + \else + \@latex@error{Symbol font `\expandafter\@gobblefour\string#3' + not defined}\@eha + \fi + \else + \@latex@error{Math version `\expandafter\@gobblefour\string#1' + is not + defined}{You probably mispelled the name of the math + version.^^JOr you have to specify an additional package.}% + \fi +} +\@onlypreamble\SetSymbolFont@ +% \end{macrocode} +% \end{macro} +% +% \begin{macro}{\get@cdp} +% \begin{macrocode} +\def\get@cdp#1#2/#3\@nil#4{\def#4{#2}} +\@onlypreamble\get@cdp +% \end{macrocode} +% \end{macro} +% +% \begin{macro}{\DeclareMathAlphabet} +% \begin{macrocode} +\def\DeclareMathAlphabet#1#2#3#4#5{% + \@tempswafalse + \edef\reserved@b{#2}% + \def\cdp@elt##1##2##3##4{\def\reserved@c{##1}% + \ifx\reserved@b\reserved@c \@tempswatrue\fi}% + \cdp@list + \if@tempswa + \expandafter\ifx + \csname\expandafter\@gobble\string#1\endcsname + \relax + \new@mathalphabet#1{#2}{#3}{#4}{#5}% + \else +% \end{macrocode} +% Check if it is already a math alphabet. +% \begin{macrocode} + \edef\reserved@a{\noexpand\in@{\string\select@group}% + {\expandafter\meaning\csname @\expandafter + \@gobble\string#1\endcsname}}% + \reserved@a + \ifin@ + \@font@info{Redeclaring math alphabet \string#1}% + \def\version@elt##1{% + \expandafter\SetMathAlphabet@\expandafter + ##1\csname#2/#3/#4/#5\expandafter\endcsname +% \end{macrocode} +% \changes{???}{1994/04/18}{Pass correct arg (2 not 3)} +% \begin{macrocode} + \csname M@#2\expandafter\endcsname + \csname @\expandafter\@gobble\string#1\endcsname#1}% + \version@list + \else +% \end{macrocode} +% Check if it is a math alphabet defined via +% |\DeclareSymbolFontAlphabet|. +% \begin{macrocode} + \edef\reserved@a{\noexpand\in@{\string\use@mathgroup}% + {\expandafter\meaning\csname @\expandafter + \@gobble\string#1\endcsname}}% + \reserved@a + \ifin@ +% \end{macrocode} +% In that case overwriting is simple since there is nothing +% inserted in the math version macros. +% \begin{macrocode} + \@font@info{Redeclaring math alphabet \string#1}% + \new@mathalphabet#1{#2}{#3}{#4}{#5}% +% \end{macrocode} +% Otherwise panic. +% \begin{macrocode} + \else + \@latex@error{Command `\string#1' already defined}\@eha + \fi + \fi + \fi + \else + \@latex@error{Encoding scheme `#2' unknown}\@eha + \fi + } +\@onlypreamble\DeclareMathAlphabet +% \end{macrocode} +% \end{macro} +% +% \begin{macro}{\new@mathalphabet} +% \begin{macrocode} +\def\new@mathalphabet#1#2#3#4#5{% + \toks@\expandafter{\alpha@list}% + \edef#1{\expandafter\noexpand\csname @\expandafter + \@gobble\string#1\endcsname + \if/#5/% + \noexpand\no@alphabet@error + \noexpand\no@alphabet@error + \else + \expandafter\noexpand\csname M@#2\endcsname + \expandafter\noexpand\csname#2/#3/#4/#5\endcsname + \fi + }% + \toks2\expandafter{#1}% + \edef\alpha@list{\the\toks@\noexpand\alpha@elt\the\toks2}% + \def\version@elt##1{\toks@\expandafter{##1}% + \edef##1{\the\toks@\install@mathalphabet + \expandafter\noexpand + \csname @\expandafter\@gobble + \string#1\endcsname + {\if/#5/% + \noexpand\no@alphabet@error + \noexpand#1% + \else + \noexpand\select@group\the\toks2 + \fi}}% + }% + \version@list + \expandafter\edef\csname @\expandafter\@gobble + \string#1\endcsname{\if/#5/% + \noexpand\no@alphabet@error + \noexpand#1% + \else + \noexpand\select@group\the\toks2 + \fi}% + \edef#1{\noexpand\protect + \expandafter\noexpand\csname @\expandafter + \@gobble\string#1\endcsname}% +} +\@onlypreamble\new@mathalphabet +% \end{macrocode} +% \end{macro} +% +% \begin{macro}{\SetMathAlphabet} +% \begin{macrocode} +\def\SetMathAlphabet#1#2#3#4#5#6{% + \@tempswafalse + \edef\reserved@b{#3}% + \def\cdp@elt##1##2##3##4{\def\reserved@c{##1}% + \ifx\reserved@b\reserved@c \@tempswatrue\fi}% + \cdp@list + \if@tempswa + \expandafter\SetMathAlphabet@ + \csname mv@#2\expandafter\endcsname\csname#3/#4/#5/#6\expandafter + \endcsname \csname M@#3\expandafter\endcsname + \csname @\expandafter\@gobble\string#1\endcsname#1% + \else + \@latex@error{Encoding scheme `#3' unknown}\@eha + \fi +} +\@onlypreamble\SetMathAlphabet +% \end{macrocode} +% \end{macro} +% +% \begin{macro}{\SetMathAlphabet@} +% \begin{macrocode} +\def\SetMathAlphabet@#1#2#3#4#5{% + \expandafter\in@\expandafter#1\expandafter{\version@list}% + \ifin@ + \expandafter\in@\expandafter#4\expandafter{\alpha@list}% + \ifin@ + \begingroup + \toks@{}% + \def\getanddefine@fonts##1##2{% + \addto@hook\toks@{\getanddefine@fonts##1##2}% + }% + \def\reserved@c##1##2##3##4{% % for message below + \expandafter\@gobble\string##4}% + \def\install@mathalphabet##1##2{% + \ifx##1#4% + \addto@hook\toks@ + {\install@mathalphabet#4{\select@group#4#3#2}}% + \@font@info{Overwriting math alphabet + `\string#5' in version `\expandafter + \@gobblefour\string#1'\MessageBreak + \@spaces \reserved@c##2 --> + \expandafter\@gobble\string#2}% + \else + \addto@hook\toks@{\install@mathalphabet##1{##2}}% + \fi + }% + #1% + \xdef#1{\the\toks@}% + \endgroup + \else +% \end{macrocode} +% If the math alphabet was defined via |\DeclareSymbolFontAlphabet| +% we have remove its external definition and add it as a normal +% math alphabet to every version before trying to change it in one +% version. +% \changes{v2.1b}{1994/03/11}{Changed parameter template in temporary +% macro to catch check add below.} +% \begin{macrocode} + \edef\reserved@a{% + \noexpand\in@{\string\use@mathgroup}{\meaning#4}}% + \reserved@a + \ifin@ + \def\reserved@b##1\use@mathgroup##2##3{% + \def\reserved@b{##3}\def\reserved@c{##2}}% + \expandafter\reserved@b#4% + \begingroup + \def\install@mathalphabet##1##2{% + \addto@hook\toks@{\install@mathalphabet##1{##2}}% + }% + \def\getanddefine@fonts##1##2{% + \addto@hook\toks@{\getanddefine@fonts##1##2}% + \ifnum##1=\reserved@b + \expandafter + \addto@hook\expandafter\toks@ + \expandafter{\expandafter\install@mathalphabet + \expandafter#4\expandafter + {\expandafter\select@group\expandafter + #4\reserved@c##2}}% + \fi + }% + \def\version@elt##1{% + \toks@{}% + ##1% + \xdef##1{\the\toks@}% + }% + \version@list + \endgroup +% \end{macrocode} +% Put it into the |\alpha@list| with default `error' +% \begin{macrocode} + \expandafter\gdef\expandafter\alpha@list\expandafter + {\alpha@list + \alpha@elt #4\no@alphabet@error \no@alphabet@error}% + \gdef#4{\no@alphabet@error #5}% fake things :-) +% \end{macrocode} +% Then call the internal setting routine again: +% \begin{macrocode} + \SetMathAlphabet@{#1}{#2}{#3}#4#5% + \else + \@latex@error{Command `\string#5' not defined as a + math alphabet}% + {Use \noexpand\DeclareMathAlphabet to define it.}% + \fi + \fi + \else + \@latex@error{Math version `\expandafter\@gobblefour\string#1' + is not + defined}{You probably mispelled the name of the math + version.^^JOr you have to specify an additional package.}% + \fi +} +\@onlypreamble\SetMathAlphabet@ +% \end{macrocode} +% \end{macro} +% +% \begin{macro}{\DeclareMathAlphabet} +% could do with more checks like allowing single number in |#4| +% lowercase in |#4| etc +% \begin{macrocode} +\def\DeclareMathAccent#1#2#3#4{% + \expandafter\in@\csname sym#3\expandafter\endcsname + \expandafter{\group@list}% + \ifin@ + \begingroup + \count\z@=#4\relax + \count\tw@\count\z@ + \divide\count\z@\sixt@@n + \count@\count\z@ + \multiply\count@\sixt@@n + \advance\count\tw@-\count@ + \if\relax\noexpand#1% is command? + \edef\reserved@a{\noexpand\in@{\string\mathaccent}{\meaning#1}}% + \reserved@a + \ifin@ + \expandafter\set@mathaccent + \csname sym#3\endcsname#1#2% + {\hexnumber@{\count\z@}\hexnumber@{\count\tw@}}% + \@font@info{Redeclaring math accent \string#1}% + \else + \expandafter\ifx + \csname\expandafter\@gobble\string#1\endcsname + \relax + \expandafter\set@mathaccent + \csname sym#3\endcsname#1#2% + {\hexnumber@{\count\z@}\hexnumber@{\count\tw@}}% + \else + \@latex@error{Command `\string#1' already defined}\@eha + \fi + \fi + \else + \@latex@error{Not a command name: `\noexpand#1'}\@eha + \fi + \endgroup + \else + \@latex@error{Symbol font `#3' is not defined}\@eha + \fi +} +\@onlypreamble\DeclareMathAccent +% \end{macrocode} +% \end{macro} +% +% \begin{macro}{\set@mathaccent} +% \begin{macrocode} +\def\set@mathaccent#1#2#3#4{% + \xdef#2{\mathaccent"\mathchar@type#3\hexnumber@#1#4\relax}} +\@onlypreamble\set@mathaccent +% \end{macrocode} +% \end{macro} +% +% \begin{macro}{\DeclareMathSymbol} +% \begin{macrocode} +\def\DeclareMathSymbol#1#2#3#4{% + \expandafter\in@\csname sym#3\expandafter\endcsname + \expandafter{\group@list}% + \ifin@ + \begingroup + \count\z@=#4\relax + \count\tw@\count\z@ + \divide\count\z@\sixt@@n + \count@\count\z@ + \multiply\count@\sixt@@n + \advance\count\tw@-\count@ + \if\relax\noexpand#1% is command? + \edef\reserved@a{\noexpand\in@{\string\mathchar}{\meaning#1}}% + \reserved@a + \ifin@ + \expandafter\set@mathsymbol + \csname sym#3\endcsname#1#2% + {\hexnumber@{\count\z@}\hexnumber@{\count\tw@}}% + \@font@info{Redeclaring math symbol \string#1}% + \else + \expandafter\ifx + \csname\expandafter\@gobble\string#1\endcsname + \relax + \expandafter\set@mathsymbol + \csname sym#3\endcsname#1#2% + {\hexnumber@{\count\z@}\hexnumber@{\count\tw@}}% + \else + \@latex@error{Command `\string#1' already defined}\@eha + \fi + \fi + \else + \expandafter\set@mathchar + \csname sym#3\endcsname#1#2 + {\hexnumber@{\count\z@}\hexnumber@{\count\tw@}}% + \fi + \endgroup + \else + \@latex@error{Symbol font `#3' is not defined}\@eha + \fi +} +\@onlypreamble\DeclareMathSymbol +% \end{macrocode} +% \end{macro} +% +% \begin{macro}{\set@mathchar} +% \begin{macrocode} +\def\set@mathchar#1#2#3#4{% + \global\mathcode`#2="\mathchar@type#3\hexnumber@#1#4\relax} +\@onlypreamble\set@mathchar +% \end{macrocode} +% \end{macro} +% +% \begin{macro}{\set@mathsymbol} +% \begin{macrocode} +\def\set@mathsymbol#1#2#3#4{% + \global\mathchardef#2"\mathchar@type#3\hexnumber@#1#4\relax} +\@onlypreamble\set@mathsymbol +% \end{macrocode} +% \end{macro} +% +% \begin{macrocode} +%\def\mathsymbol#1#2#3{% +% \@tempcnta=#3\relax +% \@tempcntb\@tempcnta +% \divide\@tempcnta\sixt@@n +% \count@\@tempcnta +% \multiply\count@\sixt@@n +% \advance\@tempcntb-\count@ +% \mathchar"\mathchar@type#1\hexnumber@#2% +% \hexnumber@\@tempcnta\hexnumber@\@tempcntb\relax} +% +%\def\DeclareMathAlphabetCharacter#1#2#3{% +% \DeclareMathSymbol{#1}7{#2}{#3}} +% \end{macrocode} +% +% \begin{macro}{\DeclareMathDelimiter} +% \changes{v2.1m}{1994/11/18} +% {(DPC) \cs{expandafter} instead of \cs{next}} +% \begin{macrocode} +\def\DeclareMathDelimiter#1{% + \if\relax\noexpand#1% + \expandafter\@DeclareMathDelimiter + \else + \expandafter\@xxDeclareMathDelimiter + \fi + #1} +\@onlypreamble\DeclareMathDelimiter +% \end{macrocode} +% \end{macro} +% +% \begin{macro}{\@xxDeclareMathDelimiter} +% \changes{v3.0h}{1998/04/15}{Macro added (pr/2662)} +% This macro checks if the second arg is a ``math type'' such +% as |\mathopen|. The undocumented original code didn't use math +% types when the delimiter was a single letter. +% For this reason the coding is a bit strange as it tries to +% support the undocumented syntax for compatibility reasons. +% \begin{macrocode} +\def\@xxDeclareMathDelimiter#1#2#3#4{% +% \end{macrocode} +% 7 is the default value returned in the case that |\mathchar@type| +% is passed something unexpected, like a math symbol font name. +% We locally move |\mathalpha| out of the way so if you use that +% the right branch is taken. This will still fail if an explicit +% number |7| is used! +% \begin{macrocode} + \begingroup + \let\mathalpha\mathord + \ifnum7=\mathchar@type{#2}% + \endgroup +% \end{macrocode} +% If this branch is taken we have old syntax (5 arguments). +% \begin{macrocode} + \expandafter\@firstofone + \else +% \end{macrocode} +% If this branch is taken |\mathchar@type| is different from 7 so +% we assume new syntax. In this case we also use the arguments to +% set up the letter as a math symbol for the case where it is not +% used as a delimiter. +% \begin{macrocode} + \endgroup + \DeclareMathSymbol#1{#2}{#3}{#4}% +% \end{macrocode} +% Then we arrange that |\@xDeclareMathDelimiter| only gets |#1|, +% |#3|, |#4| \ldots\ as it does not expect a math type as argument. +% \begin{macrocode} + \expandafter\@firstoftwo + \fi + {\@xDeclareMathDelimiter#1}{#2}{#3}{#4}} +\@onlypreamble\@xxDeclareMathDelimiter +% \end{macrocode} +% \end{macro} +% +% \begin{macro}{\@DeclareMathDelimiter} +% \begin{macrocode} +\def\@DeclareMathDelimiter#1#2#3#4#5#6{% + \expandafter\in@\csname sym#3\expandafter\endcsname + \expandafter{\group@list}% + \ifin@ + \expandafter\in@\csname sym#5\expandafter\endcsname + \expandafter{\group@list}% + \ifin@ + \begingroup + \count\z@=#4\relax + \count\tw@\count\z@ + \divide\count\z@\sixt@@n + \count@\count\z@ + \multiply\count@\sixt@@n + \advance\count\tw@-\count@ + \edef\reserved@c{\hexnumber@{\count\z@}\hexnumber@{\count\tw@}}% + % + \count\z@=#6\relax + \count\tw@\count\z@ + \divide\count\z@\sixt@@n + \count@\count\z@ + \multiply\count@\sixt@@n + \advance\count\tw@-\count@ + \edef\reserved@d{\hexnumber@{\count\z@}\hexnumber@{\count\tw@}}% + % + \edef\reserved@a{\noexpand\in@{\string\delimiter}{\meaning#1}}% + \reserved@a + \ifin@ + \expandafter\set@mathdelimiter + \csname sym#3\expandafter\endcsname + \csname sym#5\endcsname#1#2% + \reserved@c\reserved@d + \@font@info{Redeclaring math delimiter \string#1}% + \else + \expandafter\ifx + \csname\expandafter\@gobble\string#1\endcsname + \relax + \expandafter\set@mathdelimiter + \csname sym#3\expandafter\endcsname + \csname sym#5\endcsname#1#2% + \reserved@c\reserved@d + \else + \@latex@error{Command `\string#1' already defined}\@eha + \fi + \fi + \endgroup + \else + \@latex@error{Symbol font `#5' is not defined}\@eha + \fi + \else + \@latex@error{Symbol font `#3' is not defined}\@eha + \fi +} +\@onlypreamble\@DeclareMathDelimiter +% \end{macrocode} +% \end{macro} +% +% \begin{macro}{\@xDeclareMathDelimiter} +% \begin{macrocode} +\def\@xDeclareMathDelimiter#1#2#3#4#5{% + \expandafter\in@\csname sym#2\expandafter\endcsname + \expandafter{\group@list}% + \ifin@ + \expandafter\in@\csname sym#4\expandafter\endcsname + \expandafter{\group@list}% + \ifin@ + \begingroup + \count\z@=#3\relax + \count\tw@\count\z@ + \divide\count\z@\sixt@@n + \count@\count\z@ + \multiply\count@\sixt@@n + \advance\count\tw@-\count@ + \edef\reserved@c{\hexnumber@{\count\z@}\hexnumber@{\count\tw@}}% + % + \count\z@=#5\relax + \count\tw@\count\z@ + \divide\count\z@\sixt@@n + \count@\count\z@ + \multiply\count@\sixt@@n + \advance\count\tw@-\count@ + \edef\reserved@d{\hexnumber@{\count\z@}\hexnumber@{\count\tw@}}% + \expandafter\set@@mathdelimiter + \csname sym#2\expandafter\endcsname\csname sym#4\endcsname#1% + \reserved@c\reserved@d + \endgroup + \else + \@latex@error{Symbol font `#4' is not defined}\@eha + \fi + \else + \@latex@error{Symbol font `#2' is not defined}\@eha + \fi +} +\@onlypreamble\@xDeclareMathDelimiter +% \end{macrocode} +% \end{macro} +% +% \begin{macro}{\set@mathdelimiter} +% We have to end the definition of a math delimiter like |\lfloor| +% with a space and not with |\relax| as we did before, because +% otherwise contructs involving |\abovewithdelims| will prematurely +% end (pr/1329) +% +% \changes{v2.1q}{1995/04/02}{fix pr/1329} +% \begin{macrocode} +\def\set@mathdelimiter#1#2#3#4#5#6{% + \xdef#3{\delimiter"\mathchar@type#4\hexnumber@#1#5% + \hexnumber@#2#6 }} +\@onlypreamble\set@mathdelimiter +% \end{macrocode} +% \end{macro} +% +% \begin{macro}{\set@@mathdelimiter} +% \begin{macrocode} +\def\set@@mathdelimiter#1#2#3#4#5{% + \global\delcode`#3="\hexnumber@#1#4\hexnumber@#2#5\relax} +\@onlypreamble\set@@mathdelimiter +% \end{macrocode} +% \end{macro} +% +% \begin{macro}{\DeclareMathRadical} +% \begin{macrocode} +\def\DeclareMathRadical#1#2#3#4#5{% +% \end{macrocode} +% Below is a crude fix to make this macro work if |#1| is undefined +% or |\relax|. Should be improved! +% \changes{v2.1t}{1995/05/21}{Allow for undefined cs names} +% \begin{macrocode} + \expandafter\ifx + \csname\expandafter\@gobble\string#1\endcsname + \relax + \let#1\radical + \fi + \edef\reserved@a{\noexpand\in@{\string\radical}{\meaning#1}}% + \reserved@a + \ifin@ + \expandafter\in@\csname sym#2\expandafter\endcsname + \expandafter{\group@list}% + \ifin@ + \expandafter\in@\csname sym#4\expandafter\endcsname + \expandafter{\group@list}% + \ifin@ + \begingroup + \count\z@=#3\relax + \count\tw@\count\z@ + \divide\count\z@\sixt@@n + \count@\count\z@ + \multiply\count@\sixt@@n + \advance\count\tw@-\count@ + \edef\reserved@c{% + \hexnumber@{\count\z@}\hexnumber@{\count\tw@}}% + \count\z@=#5\relax + \count\tw@\count\z@ + \divide\count\z@\sixt@@n + \count@\count\z@ + \multiply\count@\sixt@@n + \advance\count\tw@-\count@ + \edef\reserved@d{% + \hexnumber@{\count\z@}\hexnumber@{\count\tw@}}% +% \end{macrocode} +% Coded inline instead of using |\set@mathradical| +% \begin{macrocode} +% \expandafter\set@mathradical +% \csname sym#2\expandafter\endcsname +% \csname sym#4\endcsname#1% +% \reserved@c\reserved@d + \xdef#1{\radical"\expandafter\hexnumber@ + \csname sym#2\endcsname\reserved@c + \expandafter\hexnumber@ + \csname sym#4\endcsname\reserved@d + \relax}% + \endgroup + \else + \@latex@error{Symbol font `#4' is not defined}\@eha + \fi + \else + \@latex@error{Symbol font `#2' is not defined}\@eha + \fi + \else + \@latex@error{Command `\string#1' already defined}\@eha + \fi +} +\@onlypreamble\DeclareMathRadical +% \end{macrocode} +% \end{macro} +% +% Definition below was wrong it contained |\delimiter| ! +% +%\begin{verbatim} +%\def\set@mathradical#1#2#3#4#5{% +% \xdef#3{\radical"\hexnumber@#1#4\hexnumber@#2#5\relax}} +%\end{verbatim} +% +% \begin{macro}{\mathalpha} +% just a dummy currently +% \begin{macrocode} +\let\mathalpha\relax +% \end{macrocode} +% \end{macro} +% +% \begin{macro}{\mathchar@type} +% \begin{macrocode} +\def\mathchar@type#1{% + \ifodd 2#11 #1\else % is this non-negative number? + \ifx#1\mathord 0\else + \ifx#1\mathop 1\else + \ifx#1\mathbin 2\else + \ifx#1\mathrel 3\else + \ifx#1\mathopen 4\else + \ifx#1\mathclose 5\else + \ifx#1\mathpunct 6\else + 7% % anything else is variable ord + \fi + \fi + \fi + \fi + \fi + \fi + \fi + \fi} +\@onlypreamble\mathchar@type +% \end{macrocode} +% \end{macro} +% +% \begin{macro}{\DeclareSymbolFontAlphabet} +% \begin{macrocode} +\def\DeclareSymbolFontAlphabet#1#2{% + \expandafter\DeclareSymbolFontAlphabet@ + \csname @\expandafter\@gobble\string#1\endcsname{#2}#1} +\@onlypreamble\DeclareSymbolFontAlphabet +% \end{macrocode} +% \end{macro} +% +% \begin{macro}{\DeclareSymbolFontAlphabet@} +% \begin{macrocode} +\def\DeclareSymbolFontAlphabet@#1#2#3{% +% \end{macrocode} +% We use the switch |\if@tempswa| to decide if we can declare this +% symbol font alphabet. +% \begin{macrocode} + \@tempswatrue +% \end{macrocode} +% First check if |#2| is known to be a symbol font +% \begin{macrocode} + \expandafter\in@\csname sym#2\expandafter\endcsname + \expandafter{\group@list}% + \ifin@ +% \end{macrocode} +% Check if |#1| is defined as a math alphabet defined via +% |\DeclareMathAlphabet|: +% \begin{macrocode} + \expandafter\in@\expandafter#1\expandafter{\alpha@list}% + \ifin@ +% \end{macrocode} +% If so remove it from the |\alpha@list| and from all math version +% macros. +% \begin{macrocode} + \@font@info{Redeclaring math alphabet \string#3}% + \toks@{}% + \def\alpha@elt##1##2##3{% + \ifx##1#1\else\addto@hook\toks@{\alpha@elt##1##2##3}\fi}% + \alpha@list + \xdef\alpha@list{\the\toks@}% +% \end{macrocode} +% Now we loop over all versions and remove the math alphabet: +% \begin{macrocode} + \def\version@elt##1{% + \begingroup + \toks@{}% + \def\getanddefine@fonts####1####2{% + \addto@hook\toks@{\getanddefine@fonts####1####2}}% + \def\install@mathalphabet####1####2{% + \ifx####1#1\else + \addto@hook\toks@{\install@mathalphabet + ####1{####2}}\fi}% + ##1% + \xdef##1{\the\toks@}% + \endgroup + }% + \version@list + \else +% \end{macrocode} +% If |#3| is not defined as a math alphabet check if it is defined +% at all: +% \begin{macrocode} + \expandafter\ifx + \csname\expandafter\@gobble\string#1\endcsname + \relax +% \end{macrocode} +% If it is undefined, fine otherwise check if it is a math alphabet +% defined via |\DeclareSymbolFontAlphabet|: +% \begin{macrocode} + \else + \edef\reserved@a{% + \noexpand\in@{\string\use@mathgroup}{\meaning#1}}% + \reserved@a + \ifin@ + \@font@info{Redeclaring math alphabet \string#3}% + \else +% \end{macrocode} +% Since the command |#3| is defined to be something which is not a +% math alphabet we have to skip redefining it. +% \begin{macrocode} + \@tempswafalse + \@latex@error{Command `\string#3' already defined}\@eha + \fi + \fi + \fi + \else +% \end{macrocode} +% Since the symbol font is not known we better skip defining this +% alphabet. +% \begin{macrocode} + \@tempswafalse + \@latex@error{Unknown symbol font `#2'}\@eha + \fi + \if@tempswa +% \end{macrocode} +% When we reach this point we are allowed to define |#1| to be a +% symbol font math alphabet. This means that we have to set it to +% \begin{quote} +% |\use@mathgroup| \meta{math-settings} |\sym|\meta{name} +% \end{quote} +% The \meta{math-settings} are the one for the encoding that is +% used in the font shape where |\sym|\meta{name} is pointing to. +% This means that we have to get it from the information stored in +% |\group@list|. Thus we loop through that list after defining +% |\group@elt| in a suitable way. +% \changes{v2.1b}{1994/03/11}{Added check against use of alphabet +% switch outside of math mode.} +% \begin{macrocode} + \def\group@elt##1##2{% + \expandafter\ifx\csname sym#2\endcsname##1% + \expandafter\reserved@a\string##2\@nil + \fi}% + \def\reserved@a##1##2/##3\@nil{% + \def\reserved@a{##2}}% + \group@list + \toks@{\relax\ifmmode \else \non@alpherr#1\fi}% + \edef#1{\the\toks@ + \noexpand\use@mathgroup + \expandafter\noexpand\csname M@\reserved@a\endcsname + \csname sym#2\endcsname}% + \def#3{\protect#1}% + \fi +} +\@onlypreamble\DeclareSymbolFontAlphabet@ +% +% \end{macrocode} +% \end{macro} +% +% \Finale +% diff --git a/Master/texmf-dist/source/latex/base/ltfssini.dtx b/Master/texmf-dist/source/latex/base/ltfssini.dtx new file mode 100644 index 00000000000..c815906b882 --- /dev/null +++ b/Master/texmf-dist/source/latex/base/ltfssini.dtx @@ -0,0 +1,583 @@ +% \iffalse meta-comment +% +% Copyright 1993 1994 1995 1996 1997 1998 1999 2000 2001 2002 2003 2004 +% The LaTeX3 Project and any individual authors listed elsewhere +% in this file. +% +% This file is part of the LaTeX base system. +% ------------------------------------------- +% +% It may be distributed and/or modified under the +% conditions of the LaTeX Project Public License, either version 1.3 +% of this license or (at your option) any later version. +% The latest version of this license is in +% http://www.latex-project.org/lppl.txt +% and version 1.3 or later is part of all distributions of LaTeX +% version 2003/12/01 or later. +% +% This file has the LPPL maintenance status "maintained". +% +% The list of all files belonging to the LaTeX base distribution is +% given in the file `manifest.txt'. See also `legal.txt' for additional +% information. +% +% The list of derived (unpacked) files belonging to the distribution +% and covered by LPPL is defined by the unpacking scripts (with +% extension .ins) which are part of the distribution. +% +% \fi +% \iffalse +%%% From File: ltfssini.dtx +%% Copyright (C) 1989-2001 Frank Mittelbach and Rainer Sch\"opf, +%% all rights reserved. +% +%<*driver> +% \fi +% +% +\ProvidesFile{ltfssini.dtx} + [2001/06/01 v3.0k LaTeX Kernel (NFSS Initialisation)] +% \iffalse +\documentclass{ltxdoc} +\begin{document} +\DocInput{ltfssini.dtx} +\end{document} +% +% \fi +% +% \iffalse +%<+checkmem>\def\CHECKMEM{\tracingstats=2 +%<+checkmem> \newlinechar=`\^^J +%<+checkmem> \message{^^JMemory usage: \filename}\shipout\hbox{}} +%<+checkmem>\CHECKMEM +% \fi +% +% \CheckSum{298} +% +% +% \GetFileInfo{ltfssini.dtx} +% \title{A new font selection scheme for \TeX{} macro packages\\ +% (Initialisation)\thanks +% {This file has version number +% \fileversion\ dated \filedate}} +% +% \author{Frank Mittelbach \and Rainer Sch\"opf} +% +% \maketitle +% +% This file contains the top level \LaTeX\ interface to the font +% selection scheme commands. See other parts of the \LaTeX\ +% distribution, or \emph{The \LaTeX\ Companion} for higher level +% documentation of these commands. +% +% \StopEventually{} +% +% +% \changes{v3.0i}{1998/08/17}{(RmS) Minor documentation fixes.} +% \changes{v3.0b}{1995/06/28} +% {(DPC) Fix documentation typos} +% \changes{v3.0a}{1995/05/24} +% {(DPC) Make file from previous file, lfonts.dtx 1995/05/23 v2.2e} +% +% +% +% \section{NFSS Initialisation} +% +% \iffalse +%<+checkmem>\CHECKMEM +% \fi +% +% +% \changes{v2.2a}{1994/10/14}{New coding for cfg files} +% \changes{v2.1a}{1993/12/03}{update for LaTeX2e} +% \changes{v1.2c}{1992/01/06}{added slitex code} +% \changes{v1.2d}{1992/03/21}{Renamed \cs{text} to \cs{nfss@text} +% to make it internal.} +% \changes{v1.2a}{1991/11/27}{All \cs{family}, \cs{shape} etc. renamed +% to \cs{fontfamily} etc.} +% \changes{v1.1i}{1990/04/02}{\cs{input} of files now handled +% by docstrip.} +% \changes{v1.1g}{1990/02/08}{Protected the commands +% \cs{family}, \cs{series}, +% \cs{shape}, \cs{size}, \cs{selectfont}, and \cs{mathversion}.} +% \changes{v1.1c}{1989/12/03}{Some internal macros renamed to make them +% inaccessible.} +% \changes{v1.1b}{1989/12/02}{\cs{rmmath} renamed to \cs{mathrm}} +% +% \changes{v1.0i}{1989/11/07}{All family, series, and shape names +% abbreviated.} +% \changes{v1.0g}{1989/05/22}{Lines shortened to 72 characters} +% \changes{v1.0f}{1989/04/29}{Corrections to \LaTeX\ tabular env. +% added.} +% \changes{v1.0e}{1989/04/27}{Definitions of \LaTeX\ symbols corrected.} +% \changes{v1.0d}{1989/04/26}{\cs{xpt} added.} +% \changes{v1.0c}{1989/04/21}{Changed to conform to fam.tex.} +% \changes{v1.0b}{1989/04/15}{\cs{mathfontset} renamed to +% \cs{mathversion.}} +% \changes{v1.0a}{1989/04/10}{Starting with version numbers! +% \cs{newif} for \cs{@tempswa} added since this switch is +% unkown at the time when this file is read in. +% (latex.tex is loaded later.) +% \cs{math@famname} changed to \cs{math@version.}} +% +% +% \changes{v2.1j}{1994/05/13}{Removed file identification typeout} +% +% Finally, there are six commands that are to be used in \LaTeX{} +% and that we will therefore protect against expansion at the +% wrong point: +% |\fontfamily|, |\fontseries|, |\fontshape|, |\fontsize|, +% |\selectfont|, and |\mathversion|. +% +% \changes{v2.1i}{1994/05/12}{Moved \cs{fontfamily} to fam.dtx} +% \changes{v2.1i}{1994/05/12}{Moved \cs{fontencoding} to fam.dtx} +% \changes{v2.1i}{1994/05/12}{Moved \cs{fontseries} to fam.dtx} +% \changes{v2.1i}{1994/05/12}{Moved \cs{fontshape} to fam.dtx} +% \changes{v2.1i}{1994/05/12}{Moved \cs{fontsize} to fam.dtx} +% \changes{v2.1i}{1994/05/12}{Moved \cs{mathversion} to fam.dtx} +% \changes{v2.1i}{1994/05/12}{Moved \cs{selectfont} to tracefnt.dtx} +% +% +% +% \subsection{Providing math \emph{versions}} +% +% \LaTeX{} provides two \emph{versions}. We call them +% \textsf{normal} and \textsf{bold}, respectively. +% \begin{macrocode} +\DeclareMathVersion{normal} +\DeclareMathVersion{bold} +% \end{macrocode} +% +% +% Now we define the standard font change commands. +% We don't allow the use of |\rmfamily| etc.\ in math mode. +% +% First the changes to another \emph{family}: +% \begin{macrocode} +\DeclareRobustCommand\rmfamily + {\not@math@alphabet\rmfamily\mathrm + \fontfamily\rmdefault\selectfont} +\DeclareRobustCommand\sffamily + {\not@math@alphabet\sffamily\mathsf + \fontfamily\sfdefault\selectfont} +\DeclareRobustCommand\ttfamily + {\not@math@alphabet\ttfamily\mathtt + \fontfamily\ttdefault\selectfont} +% \end{macrocode} +% Then the commands changing the \emph{series}: +% \begin{macrocode} +\DeclareRobustCommand\bfseries + {\not@math@alphabet\bfseries\mathbf + \fontseries\bfdefault\selectfont} +\DeclareRobustCommand\mdseries + {\not@math@alphabet\mdseries\relax + \fontseries\mddefault\selectfont} +\DeclareRobustCommand\upshape + {\not@math@alphabet\upshape\relax + \fontshape\updefault\selectfont} +% \end{macrocode} +% Then the commands changing the \emph{shape}: +% \begin{macrocode} +\DeclareRobustCommand\slshape + {\not@math@alphabet\slshape\relax + \fontshape\sldefault\selectfont} +\DeclareRobustCommand\scshape + {\not@math@alphabet\scshape\relax + \fontshape\scdefault\selectfont} +\DeclareRobustCommand\itshape + {\not@math@alphabet\itshape\mathit + \fontshape\itdefault\selectfont} +% \end{macrocode} +% +% +% +% We also have to define the {\em emphasize\/} font change command +% (i.e.\ |\em|). This command will look is the current font is +% sloped (i.e.\ has a positive |\fontdimen1|) and will then +% select either |\upshape| or |\itshape|. +% \changes{v1.2b}{1990/01/28}{Call to \cs{@nomath} added.} +% \begin{macrocode} +\DeclareRobustCommand\em + {\@nomath\em \ifdim \fontdimen\@ne\font >\z@ + \upshape \else \itshape \fi} +% \end{macrocode} +% +% +% \begin{macro}{\not@math@alphabet} +% This function generates an error message when it is called in +% math mode. The same function should be defined in +% \texttt{newlfont.sty}. +% \changes{v1.4d}{1992/09/21}{Macro defined.} +% \changes{v2.1e}{1994/01/17}{Message changed} +% \changes{v2.1f}{1994/01/18}{Message corrected} +% \changes{v2.1g}{1994/04/22}{Message changed again} +% \changes{v2.2d}{1995/04/02}{add \cs{noexpand} to second part of message} +% \begin{macrocode} +\def\not@math@alphabet#1#2{% + \relax + \ifmmode + \@latex@error{Command \noexpand#1invalid in math mode}% + {% + Please + \ifx#2\relax + define a new math alphabet^^J% + if you want to use a special font in math mode% + \else +% \end{macrocode} +% We have to a |\noexpand| below to prevent expansion of |#2|. In +% case of |#1| we can omit this (due to the current definition of +% robust commands since they do come out right there :-). +% \begin{macrocode} + use the math alphabet \noexpand#2instead of + the #1command% + \fi + . + }% + \fi} +% \end{macrocode} +% \end{macro} +% +% +% +% Finally we provide two abbreviations to switch to the \LaTeX{} +% \emph{versions}. +% \begin{macrocode} +\def\boldmath{\@nomath\boldmath + \mathversion{bold}} +\def\unboldmath{\@nomath\unboldmath + \mathversion{normal}} +% \end{macrocode} +% Here we switch to the default math version by defining the internal +% macro |\math@version|. We dare not to call |\mathversion| +% at this place because this would call |\glb@settings|. +% \begin{macrocode} +\def\math@version{normal} +% \end{macrocode} +% +% \subsection{Miscellaneous} +% +% \begin{macro}{\newfont} +% \changes{v1.2g}{1991/03/30}{Definition added.} +% \changes{v2.2e}{1995/05/23}{Font assignment made local again.} +% \begin{macro}{\symbol} +% \changes{v1.2g}{1991/03/30}{Definition added.} +% We start by defining a few macros that are part of +% standard \LaTeX's user interface. The use of these functions is +% not encouraged, but they will allow to process older documents +% without changes to the source. +% \begin{macrocode} +\def\newfont#1#2{\@ifdefinable#1{\font#1=#2\relax}} +\def\symbol#1{\char #1\relax} +% \end{macrocode} +% \end{macro} +% \end{macro} +% +% \begin{macro}{\@setfontsize} +% \begin{macro}{\@setsize} +% This abbreviation is used by \LaTeX's user level size changing +% commands, such as |\large|. +% \begin{macrocode} +\def\@setfontsize#1#2#3{\@nomath#1% +% \end{macrocode} +% For the benefit of people relying on keeping the name of the +% current font command saved in |\@currsize| we define it. To ensure +% that |\@setfontsize| keeps being robust we omit this assignment +% during times where |\protect| differs from |\@typeset@protect|. +% \changes{v1.4b}{1992/08/20}{Added \cs{@currsize}.} +% \changes{v2.2b}{1994/11/06}{Use \cs{@typeset@protect}} +% \begin{macrocode} + \ifx\protect\@typeset@protect + \let\@currsize#1% + \fi + \fontsize{#2}{#3}\selectfont} +% \end{macrocode} +% For compatibility we also define |\@setsize| the 209 command +% \begin{macrocode} +%<*compat> +\def\@setsize#1#2#3#4{\@setfontsize#1{#4}{#2}} +% +% \end{macrocode} +% \end{macro} +% \end{macro} +% +% +% \begin{macro}{\oldstylenums} +% This macro implements old style numerals but only works if we +% assume that the standard math fonts are used. Thus it needs +% changing in case other math encodings are used. +% \begin{macrocode} +\def\oldstylenums#1{% + \begingroup +% \end{macrocode} +% Provide spacing using the interword space of the current font. +% \begin{macrocode} + \spaceskip\fontdimen\tw@\font +% \end{macrocode} +% Then switch to the math italic font. We don't change the current +% value of |\f@series| which means that you can use bold numerals +% if |\bfseries| is in force. As family we use |\rmdefault| which +% means that this only works if there exist an |OML| encoded +% version of that font or rather a corresponding |.fd| file (which +% is the case for standard \LaTeX{} fonts even though they only +% contain substitutions). +% \changes{v3.0j}{1999/02/12}{Use \cs{rmdefault} instead of \texttt{cmm} +% (pr/2954)} +% \begin{macrocode} + \usefont{OML}{\rmdefault}{\f@series}{it}% + \mathgroup\symletters #1% + \endgroup +} +% \end{macrocode} +% \end{macro} +% +% \begin{macro}{\hexnumber@} +% To set up \LaTeX's special math character +% definitions we first provide a macro to generate hexadecimal +% numbers. It is a rather simple |\ifcase|. +% \changes{v?}{1992/11/13}{Made expandable.} +% \changes{v?}{1992/12/03}{Make it accept counters.} +% \begin{macrocode} +\def\hexnumber@#1{\ifcase\number#1 + 0\or 1\or 2\or 3\or 4\or 5\or 6\or 7\or 8\or + 9\or A\or B\or C\or D\or E\or F\fi} +% \end{macrocode} +% \end{macro} +% +% +% +% \begin{macro}{\nfss@text} +% \changes{v1.1e}{1990/01/25}{Macro added.} +% In it simplest form |\nfss@text| is an |\mbox|. This will +% produce unbreakable text outside math and inside math you will +% get text with the same fonts as outside. The only drawback is +% that such item won't change sizes in subscripts. But this +% behavior can be easily changed. With the \texttt{amstex} style +% option one will get a sub style called \texttt{amstext} which will +% redefine the |\nfss@text| macro to produce correct text in all +% sizes. +% +% We have to use |\def| instead of the shorter |\let| since +% |\mbox| is undefined when we reach this point. +% \changes{v1.1k}{1990/06/23}{Changed to \cs{mbox}.} +% \changes{v2.1n}{1994/05/17}{Added braces to allow use in subscripts} +% \begin{macrocode} +\def\nfss@text#1{{\mbox{#1}}} +% \end{macrocode} +% \end{macro} +% +% \begin{macro}{\copyright} +% The definition of |\copyright| was changed so +% that it works in other type styles, +% and to make it robust. We leave the family untouched so that +% the copyright notice will come out differently if a different +% font family is in use. +% This command is commented out, since it is now defined in +% ltoutenc.dtx. +% \changes{v1.1m}{1991/03/28}{Extra braces added.} +% \changes{v2.1n}{1994/05/17}{Really add extra braces} +% \changes{v2.2c}{1994/12/02}{\cs{copyright} is now in ltoutenc. +% ASAJ} +% \begin{macrocode} +%\DeclareRobustCommand\copyright +% {{\ooalign{\hfil +% \raise.07ex\hbox{\mdseries\upshape c}\hfil\crcr +% \mathhexbox20D}}} +% \end{macrocode} +% \end{macro} +% +% \changes{v2.1a}{1993/11/24}{Removed \cs{xpt} stuff} +% +% +% \begin{macro}{\normalfont} +% \changes{v2.1a}{1993/11/11}{Macro added} +% \begin{macro}{\reset@font} +% \begin{macro}{\p@reset@font} +% \changes{v1.1n}{1991/08/26}{Macro introduced} +% The macro |\reset@font| is used in \LaTeX{} to switch to a standard +% font, in order to initialize the current font in situations where +% typesetting is done in a new visual context (e.g.\ in a +% footnote). We define it here to allow the test for the new +% \LaTeX{} version above but nevertheless are able to run all kind +% of mixtures. +% \changes{v1.1o}{1991/11/21}{Changed to protected version of macro.} +% \changes{v1.1o}{1991/11/21}{Added extra braces for robustness.} +% +% The user interface name for |\reset@font| is |\normalfont|: +% \changes{v2.1k}{1994/05/14}{Remove surplus braces} +% \changes{v3.0f}{1995/10/16}{Added \cs{relax} after \cs{usefont}, +% as the latter eats up spaces.} +% \begin{macrocode} +\DeclareRobustCommand\normalfont + {\usefont\encodingdefault + \familydefault + \seriesdefault + \shapedefault + \relax} +\let\reset@font\normalfont +% \end{macrocode} +% \end{macro} +% \end{macro} +% \end{macro} +% +% +% +% We left out the special \LaTeX{} fonts which are not automatically +% included in the base version of the font selection since these fonts +% contain only a few characters which are also included in the AMS +% fonts so anybody who is using these fonts doesn't need them. +% But for compatibility reasons we will define these symbols. +% +% \changes{v2.1g}{1994/02/22}{Correct error mssage} +% \begin{macrocode} +\def\not@base#1{\@latex@error + {Command \noexpand#1not provided in base LaTeX2e}% + {Load the latexsym or the amsfonts package to + define this symbol}} +\def\mho{\not@base\mho} +\def\Join{\not@base\Join} +\def\Box{\not@base\Box} +\def\Diamond{\not@base\Diamond} +\def\leadsto{\not@base\leadsto} +\def\sqsubset{\not@base\sqsubset} +\def\sqsupset{\not@base\sqsupset} +\def\lhd{\not@base\lhd} +\def\unlhd{\not@base\unlhd} +\def\rhd{\not@base\rhd} +\def\unrhd{\not@base\unrhd} +% \end{macrocode} +% +% +% +% We now initialize all variables set by |\DeclareErrorFont|. These +% values are not really important since they will be overwritten +% later on by the definition in |fontdef.ltx|. +% +% However, if \texttt{fontdef.cfg} is corrupted then at least a +% hopefully suitable error font is present. +% +% \changes{v2.1k}{1994/05/14}{Init error font just before checking for +% fontdef.cfg} +% \begin{macrocode} +\DeclareErrorFont{OT1}{cmr}{m}{n}{10} %% don't modify this setting + %% overwrite it in fontdef.cfg + %% if necessary +% \end{macrocode} +% +% +% +% +% We now load the customizable parts of NFSS. +% \changes{v3.0d}{1995/07/19} +% {(DPC) TeX2 support} +% \changes{v3.0e}{1995/09/15} +% {(DPC) Modify TeX2 message} +% \changes{v3.0g}{1995/11/01} +% {(DPC) Switch meaning of \cs{@addtofilelist} for cfg files} +% \changes{v3.0h}{1996/12/06} +% {(DPC) Remove *** from messages internal/2338} +% \begin{macrocode} +\ifnum\inputlineno=\m@ne +% \end{macrocode} +% Still using \TeX2. need a configuration file to avoid setting the 8bit +% characters. +% \begin{macrocode} +\InputIfFileExists{fonttext.cfg} + {\typeout{====================================^^J% + ^^J% + Local config file fonttext.cfg used^^J% + ^^J% + ====================================}% + \def\@addtofilelist##1{\xdef\@filelist{\@filelist,##1}}% + } + {\typeout{!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!^^J% + !^^J% + ! You MUST use a fonttext.cfg file!^^J% + ! As you are still using TeX2!!!!!^^J% + !^^J% + ! See the documentation file tex2.txt^^J% + !^^J% + !!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!}% + \batchmode \@@end} +\else +% \end{macrocode} +% With \TeX3 can use the standard |ltx| file if no configuration file +% exists. +% \begin{macrocode} +\InputIfFileExists{fonttext.cfg} + {\typeout{====================================^^J% + ^^J% + Local config file fonttext.cfg used^^J% + ^^J% + ====================================}% + \def\@addtofilelist##1{\xdef\@filelist{\@filelist,##1}}% + } + {\input{fonttext.ltx}} +\fi +\let\@addtofilelist\@gobble +% \end{macrocode} +% +% Ditto for math although I don't think that we will get a lot of +% customisation :-) +% \begin{macrocode} +\InputIfFileExists{fontmath.cfg} + {\typeout{====================================^^J% + ^^J% + Local config file fontmath.cfg used^^J% + ^^J% + ====================================}% + \def\@addtofilelist##1{\xdef\@filelist{\@filelist,##1}}% + } + {\input{fontmath.ltx}} +\let\@addtofilelist\@gobble +% \end{macrocode} +% +% Then we preload several fonts. This file might be customized +% \emph{without} changing the behavior of the format (i.e.\ necessary +% font definitions will be loaded at runtime if they are not +% preloaded). This is done in the file \texttt{preload.ltx}. +% \begin{macrocode} +\InputIfFileExists{preload.cfg} + {\typeout{====================================^^J% + ^^J% + Local config file preload.cfg used^^J% + ^^J% + =====================================}% + \def\@addtofilelist##1{\xdef\@filelist{\@filelist,##1}}% + } + {\input{preload.ltx}} +\let\@addtofilelist\@gobble +% \end{macrocode} +% +% +% \begin{macro}{\@acci} +% \begin{macro}{\@accii} +% \begin{macro}{\@acciii} +% \changes{v2.1m}{1994/05/16}{Define saved versions of accents} +% We also save the values of some accents in |\@acci|, |\@accii| +% and |\@acciii| so they can be restored by a |minipage| inside a +% |tabbing| environment. +% \begin{macrocode} +\let\@acci\' \let\@accii\` \let\@acciii\= +% \end{macrocode} +% \end{macro} +% \end{macro} +% \end{macro} +% +% +% \begin{macro}{\cal} +% \changes{v3.0a}{1995/05/24} +% {(DPC) Remove definition} +% \begin{macro}{\mit} +% \changes{v3.0a}{1995/05/24} +% {(DPC) Remove definition} +% Here were the two old \meta{alphabet identifiers}. +% \end{macro} +% \end{macro} +% +% +% \iffalse +%<+checkmem>\CHECKMEM +% \fi +% +% \Finale +% diff --git a/Master/texmf-dist/source/latex/base/ltfsstrc.dtx b/Master/texmf-dist/source/latex/base/ltfsstrc.dtx new file mode 100644 index 00000000000..3b77cfcf22c --- /dev/null +++ b/Master/texmf-dist/source/latex/base/ltfsstrc.dtx @@ -0,0 +1,1887 @@ +% \iffalse meta-comment +% +% Copyright 1993 1994 1995 1996 1997 1998 1999 2000 2001 2002 2003 2004 +% The LaTeX3 Project and any individual authors listed elsewhere +% in this file. +% +% This file is part of the LaTeX base system. +% ------------------------------------------- +% +% It may be distributed and/or modified under the +% conditions of the LaTeX Project Public License, either version 1.3 +% of this license or (at your option) any later version. +% The latest version of this license is in +% http://www.latex-project.org/lppl.txt +% and version 1.3 or later is part of all distributions of LaTeX +% version 2003/12/01 or later. +% +% This file has the LPPL maintenance status "maintained". +% +% The list of all files belonging to the LaTeX base distribution is +% given in the file `manifest.txt'. See also `legal.txt' for additional +% information. +% +% The list of derived (unpacked) files belonging to the distribution +% and covered by LPPL is defined by the unpacking scripts (with +% extension .ins) which are part of the distribution. +% +% \fi +% +% \iffalse +%%% From File: ltfsstrc.dtx +%% Copyright (C) 1989-97 by Frank Mittelbach and Rainer Sch\"opf. +%% Copyright (C) 1994-97 by LaTeX3 project. All rights reserved. +% +%\NeedsTeXFormat{LaTeX2e}[1995/05/16] +%\ProvidesPackage{tracefnt} +% [1997/05/29 v3.0j Standard LaTeX package (font tracing)] +% \fi +% \ProvidesFile{ltfsstrc.dtx} +% [1997/05/29 v3.0j LaTeX Kernel (NFSS tracing)] +% +% \iffalse +%<+checkmem>\CHECKMEM +% \fi +% +% \CheckSum{1041} +% +% +% +% \changes{v3.0g}{1995/11/28} +% {documentation fixes} +% \changes{v3.0f}{1995/10/22}{Added `genb' and `sgenb' size functions +% to support new DC font naming scheme.} +% \changes{v3.0e}{1995/10/20} +% {(DPC) Modify autoload code} +% \changes{v3.0d}{1995/10/04} +% {(DPC) Modify autoload code} +% \changes{v3.0b}{1995/05/24} +% {(DPC) Fix \cs{ProvidesFile} usage} +% \changes{v3.0a}{1995/05/24} +% {(DPC) Make file from previous file, tracefnt 1995/05/16 v2.3o} +% +% \changes{v2.3m}{1994/11/18} +% {\cs{next} to \cs{reserved@f}} +% \changes{v2.3l}{1994/11/17} +% {\cs{@tempa} to \cs{reserved@a}} +% \changes{v2.3i}{1994/05/20}{Use new error command names} +% \changes{v2.3g}{1994/05/13}{Removed typeouts as +% \cs{ProvidesPackage} writes to log.} +% \changes{v2.3e}{1994/04/27}{Corrected item that was forgotten +% in last change.} +% \changes{v2.3d}{1994/04/18}{Changed to new error/warning scheme} +% \changes{v2.3a}{1994/01/17}{New math font setup} +% \changes{v2.2a}{1993/11/11}{Option concept added for LaTeX2e} +% \changes{v2.1j}{1993/09/15}{Corrected spelling of \cs{noxpand}.} +% \changes{v2.1i}{1993/09/02}{Corrected name of sgen size function.} +% \changes{v2.1h}{1993/07/16}{Changed layout of info messages} +% \changes{v2.1b}{1993/03/18} +% {Changed all \cs{@tempdimb} in \cs{@tempdimx} +% to avoid killing \cs{numberline}} +% \changes{v2.1b}{1993/03/18} +% {Changed all \cs{@tempdima} in \cs{@tempdimb} +% to avoid killing \cs{numberline}} +% \changes{v1.0l}{1990/04/01}{Part of code moved to fam.dtx.} +% \changes{v1.0k}{1990/03/14}{Added code for TeX3.} +% \changes{v1.0h}{1990/01/18}{\cs{tracingfonts} meaning changed.} +% +% \newcommand\module[1]{\texttt{#1}} +% \providecommand{\dst}{\textsc{DocStrip}} +% \newcommand\Loption[1]{\texttt{#1}} +% +% \GetFileInfo{ltfsstrc.dtx} +% \title{The \texttt{tracefnt} package\thanks +% {This file has version number \fileversion, dated +% \filedate.} \\ +% for use with the new font selection scheme} +% \author{Frank Mittelbach \and Rainer Sch\"opf} +% +% +% \maketitle +% +% \section{Introduction} +% +% This package contains the code for tracing font loading and font +% changes. It basically overlays some of the low-level functions of +% NFSS with additional code used for tracing. +% +% The package accepts the following options: +% \begin{description} +% \item[errorshow] Write all information about font changes etc.\ +% only to the transcript file unless an error happens. This means +% that information about font substitution will not be shown on the +% terminal. +% +% \item[warningshow] Show all NFSS warnings on the terminal. This +% setting corresponds to the default behaviour of NFSS if the +% \texttt{tracefnt} package is \emph{not} loaded! +% +% \item[infoshow] Show all NFSS warning and all NFSS info +% messages (that are normally only written to the transcript file) +% also on the terminal. This is the default if the \texttt{tracefnt} +% package is loaded. +% +% \item[debugshow] In addition to \texttt{infoshow} show also +% changing of math fonts as far as possible (this option can produce a +% large amount of output. +% +% \item[loading] Show the name of external fonts when they are +% loaded. This option shows only ``newly'' loaded fonts not those +% already preloaded in the format or the class file before the +% \texttt{tracefnt} package became active. +% +% \item[pausing] +% Turn all font warnings into errors so that \LaTeX{} will stop. +% +% \end{description} +% +% +% \StopEventually{} +% +% \section{A driver for this document} +% +% The next bit of code contains the documentation driver file for +% \TeX{}, i.e., the file that will produce the documentation you +% are currently reading. It will be extracted from this file by the +% \dst{} program. +% +% When this file is processed directly by \LaTeX{} this will +% produce the documentation as well. +% +% \begin{macrocode} +%<*driver> +\documentclass{ltxdoc} + + +%\OnlyDescription % comment out for implementation details + +\begin{document} + \DocInput{ltfsstrc.dtx} +\end{document} +% +% \end{macrocode} +% +% +% \section{The Implementation} +% +% \begin{quote} +% \textbf{Warning:} Read the macro documentation with a grain of +% salt. It is still basically the documentation from the first NFSS +% release and therefore in some cases probably not completely +% accurate. +% \end{quote} +% +% If we are making a package file it is a good idea to test whether +% we are running under 2e. +% This code is actually placed at the very beginning of this file +% for easier maintenance, thus commented out here. +% \begin{macrocode} +%<*package> +%\NeedsTeXFormat{LaTeX2e} +%\ProvidesPackage{tracefnt}[??/??/?? v?.?? +% Standard LaTeX package (font tracing)] +% +% \end{macrocode} +% +% +% The \texttt{debug} module makes use of commands contained in a +% special package file named \texttt{trace.sty}.\footnote{This package +% is not in distribution at the moment (and probably doesn't any +% longer work). Think of this part of the code as being historical +% artefacts.} +% \begin{macrocode} +%<+debug> \input trace.sty +% \end{macrocode} +% +% +% \section{Handling Options} +% +% \begin{macro}{\tracingfonts} +% Here is the definition of the integer register for the font +% trace. As a default in a package file we use $1$ to give error +% messages if fonts are substituted. If this code is used for +% debugging or tracing reasons in the format file (i.e.\ in +% \texttt{fam.dtx}) we use $0$ as the default. But if no font +% trace is used we build a definition that will produce a warning +% message. +% \changes{v1.0l}{1990/04/01} +% {Check if \cs{tracingfonts} already defined.} +% \changes{v1.0o}{1990/04/01} +% {Check if \cs{tracingfonts} defined removed again.} +% \begin{macrocode} +%<*2ekernel|autoload> +\def\tracingfonts{% + \@font@warning{Command \noexpand\tracingfonts + not provided.\MessageBreak + Use the `tracefnt' package.\MessageBreak Command found:}% + \count@} +% +% \end{macrocode} +% The |\count@| in the line above will remove the number after +% |\tracingfonts|. Note that this definition will be overwritten be +% the next line if one of these modules are included. +% \begin{macrocode} +%<*package,trace,debug> +\newcount\tracingfonts +\tracingfonts=0 +% +% \end{macrocode} +% \end{macro} +% +% +% The option \Loption{errorshow} turns off all warnings so that only +% real errors are shown. \Loption{warningshow} corresponds to the +% NFSS default (when \texttt{tracefnt} is not loaded). +% \Loption{infoshow} is the default for this package here; and +% \Loption{debugshow}, \Loption{loading}, and +% \Loption{pausing} extend the amount of information even further. +% \changes{v2.3o}{1995/05/13} +% {Use single hash mark in \cs{DeclareOption}} +% \begin{macrocode} +%<*package> +\DeclareOption{errorshow}{% + \def\@font@info#1{% + \GenericInfo{(Font)\@spaces\@spaces\@spaces\space\space}% + {LaTeX Font Info: \space\space\space#1}}% + \def\@font@warning#1{% + \GenericInfo{(Font)\@spaces\@spaces\@spaces\space\space}% + {LaTeX Font Warning: #1}}% + } +% \end{macrocode} +% +% \begin{macrocode} +\DeclareOption{warningshow}{% + \def\@font@info#1{% + \GenericInfo{(Font)\@spaces\@spaces\@spaces\space\space}% + {LaTeX Font Info: \space\space\space#1}}% + \def\@font@warning#1{% + \GenericWarning{(Font)\@spaces\@spaces\@spaces\space\space}% + {LaTeX Font Warning: #1}}% + } +% \end{macrocode} +% +% \begin{macrocode} +\DeclareOption{infoshow}{% + \def\@font@info#1{% + \GenericWarning{(Font)\@spaces\@spaces\@spaces\space\space}% + {LaTeX Font Info: \space\space\space#1}}% + \def\@font@warning#1{% + \GenericWarning{(Font)\@spaces\@spaces\@spaces\space\space}% + {LaTeX Font Warning: #1}}% + } +% \end{macrocode} +% +% \begin{macrocode} +\DeclareOption{loading}{% + \tracingfonts\tw@ + } +% \end{macrocode} +% +% \begin{macrocode} +\DeclareOption{debugshow}{% + \ExecuteOptions{infoshow}% + \tracingfonts\thr@@ + } +% \end{macrocode} +% +% \changes{v3.0j}{1997/05/29}{Replaced \texttt{\symbol{92}\symbol{92}} +% by \cs{MessageBreak}, as suggested by Donald Arseneau.} +% \begin{macrocode} +\DeclareOption{pausing}{% + \def\@font@warning#1{% + \GenericError + {(Font)\@spaces\@spaces\@spaces\space\space}% + {LaTeX Font Warning: #1}% + {See the LaTeX Companion for details.}% + {I'll stop for every LaTeX Font Warning because + you requested\MessageBreak the `pausing' option + to the tracefnt package.}}% + } +% \end{macrocode} +% We make |infoshow| the default, which in turn defines +% |\font@warning| and |\font@info|. +% \begin{macrocode} +\ExecuteOptions{infoshow} +\ProcessOptions +% +% \end{macrocode} +% +% We also need a default definition inside the kernel: +% \begin{macrocode} +%<*2ekernel|autoload> +\def\@font@info#1{% + \GenericInfo{(Font)\@spaces\@spaces\@spaces\space\space}% + {LaTeX Font Info: \space\space\space#1}}% +\def\@font@warning#1{% + \GenericWarning{(Font)\@spaces\@spaces\@spaces\space\space}% + {LaTeX Font Warning: #1}}% +% +% \end{macrocode} +% +% +% \section{Macros common to \texttt{fam.tex} and \texttt{tracefnt.sty}} +% +% In the first versions of \texttt{tracefnt.dtx} some macros of +% \texttt{fam.dtx}\footnote{This file is currently not distributed in +% documented form. Its code is part of \texttt{ltfss.dtx}.} +% were redefined to included the extra tracing +% information. Now these macros are all defined in this file (i.e.\ +% removed from \texttt{fam.dtx}) and different production versions can +% be obtained simply by specifying a different set of modules to +% include when generating \texttt{ltfss.dtx}. +% +% +% +% \subsection{General font loading} +% +% +% \begin{macro}{\extract@font} +% +% This macro organizes the font loading. +% It first calls |\get@external@font| +% which will return in |\external@font| the name of the external +% font file (the \texttt{.tfm}) as it was determined by the NFSS +% tables. +% \begin{macrocode} +%<*2ekernel|package|autoload> +\def\extract@font{% + \get@external@font +% \end{macrocode} +% Then the external font is loaded and assigned to the font +% identifier stored inside |\font@name| +% (for this reason we need |\expandafter|). +% \begin{macrocode} + \global\expandafter\font\font@name\external@font\relax +% \end{macrocode} +% When tracing we typeout the internal and external font name. +% \changes{v1.0k}{1990/03/14}{Added code for TeX3.} +% \begin{macrocode} +%<*trace> + \ifnum \tracingfonts >\@ne + \@font@info{External font `\external@font' + loaded as\MessageBreak \font@name}\fi +% +% \end{macrocode} +% Finally we call the corresponding ``loading action'' macros to +% finish things. First the font is locally selected to allow the +% use of |\font| inside the loading action macros. +% \begin{macrocode} + \font@name \relax +% \end{macrocode} +% The next two lines execute the ``loading actions'' for the +% family and then for the individual font shape. +% \begin{macrocode} + \csname \f@encoding+\f@family\endcsname + \csname\curr@fontshape\endcsname + \relax + } +% +% \end{macrocode} +% The |\relax| at the end needs to be explained. +% This is inserted to prevent \TeX{} from scanning too far +% when it is executing the replacement text of the loading +% code macros. +% \end{macro} +% +% +% \begin{macro}{\get@external@font} +% This function tries to find an external font name. It will place +% the name into the macro +% |\external@font|. If no font is found it will return the one +% that was defined via |\DeclareErrorFont|. +% \begin{macrocode} +%<*2ekernel|autoload> +\def\get@external@font{% +% \end{macrocode} +% We don't know the external font name at the beginning. +% \begin{macrocode} + \let\external@font\@empty + \edef\font@info{\expandafter\expandafter\expandafter\string + \csname \curr@fontshape \endcsname}% + \try@size@range +% \end{macrocode} +% If this failed, we'll try to substitute another size of the same +% font. This is done by the |\try@size@substitution| macro. It +% ``knows about'' |\do@extract@font|, |\font@name|, |\f@size|, and +% so on. +% \begin{macrocode} + \ifx\external@font\@empty + \try@size@substitution + \ifx\external@font\@empty + \@latex@error{Font \expandafter \string\font@name\space + not found}\@eha + \error@fontshape + \get@external@font + \fi\fi +} +% +% \end{macrocode} +% \end{macro} +% +% +% \changes{v1.0j}{1990/02/18} +% {Redefine unprotected version \cs{p@selectfont} +% instead of \cs{selectfont}.} +% +% +% \begin{macro}{\selectfont} +% \changes{v1.1a}{1989/12/16}{Changed order of calls.} +% \changes{v2.3f}{1994/05/12}{Use \cs{DeclareRobustCommand}} +% The macro |\selectfont| is called whenever a font change must +% take place. +% \begin{macrocode} +%<*2ekernel|package|autoload> +\DeclareRobustCommand\selectfont + {% +% \end{macrocode} +% When \module{debug} is specified we actually want something like +% `undebug'. The font selection is now stable so that using +% |\tracingall| on some other macros will show us a lot of unwanted +% information about font loading. Therefore we disable tracing during +% font loading as long as |\tracingfonts| is less than $4$. +% \changes{v1.0m}{1990/04/05} +% {Call \cs{tracingon} only if \cs{tracingfonts} greater than 3.} +% \changes{v1.0n}{1990/05/05}{\cs{tracingon} with new syntax.} +% \begin{macrocode} +%<+debug> \pushtracing +%<+debug> \ifnum\tracingfonts<4 \tracingoff +%<+debug> \else \tracingon\p@selectfont \fi +% \end{macrocode} +% If |\baselinestretch| was redefined by the user it will not +% longer match its internal counterpart |\f@linespread|. If so we +% call |\set@fontsize| to prepare |\size@update|. +% \begin{macrocode} + \ifx\f@linespread\baselinestretch \else + \set@fontsize\baselinestretch\f@size\f@baselineskip \fi +% \end{macrocode} +% Then we generate the internal name of the font +% by concatenating {\em family}, {\em series}, +% {\em shape}, and current {\em size}, +% with slashes as delimiters between them. +% This is much more readable than standard +% \LaTeX's |\twfbf|, etc. +% We define |\font@name| globally, as always. +% The reason for this is explained later on. +% \changes{v2.0b}{1992/07/26}{} +% \begin{macrocode} + \xdef\font@name{% + \csname\curr@fontshape/\f@size\endcsname}% +% \end{macrocode} +% We call the macro |\pickup@font| which will load the font if +% necessary. +% \begin{macrocode} + \pickup@font +% \end{macrocode} +% Then we select the font. +% \begin{macrocode} + \font@name +% \end{macrocode} +% If |\tracingfonts| is +% greater than 2 we also show the font switch. +% We do this before |\glb@settings| is called since this +% macro might redefine |\font@name|. +% \changes{v1.0k}{1990/03/14}{Added code for TeX3.} +% \changes{v1.0i}{1990/02/16}{Changed \cs{f@size} to \cs{lcl@currsize} +% (see fam file).} +% \begin{macrocode} +%<*trace> + \ifnum \tracingfonts>\tw@ + \@font@info{Switching to \font@name}\fi +% +% \end{macrocode} +% Finally we call |\size@update|. This macro is normally empty but +% will contain actions (like setting the |\baselineskip|) that have +% to be carried out when the font size, the base |\baselineskip| or +% the |\baselinestretch| have changed. +% \begin{macrocode} + \size@update +% \end{macrocode} +% A similar function is called to handle anything related to +% encoding updates. This one is changed from |\relax| by +% |\fontencoding|. +% \changes{v2.3h}{1994/05/14}{Added \cs{enc@update}} +% \begin{macrocode} + \enc@update +% \end{macrocode} +% Just before ending this macro we have to pop the tracing stack +% if it was pushed before. +% \begin{macrocode} +%<+debug> \poptracing + } +% \end{macrocode} +% \end{macro} +% +% +% +% \begin{macro}{\set@fontsize} +% The macro |\set@fontsize| does the actual work. First it assigns +% new values to |\f@size|, |\f@baselineskip| and |\f@linespread|. +% \begin{macrocode} +\def\set@fontsize#1#2#3{% + \@defaultunits\@tempdimb#2pt\relax\@nnil + \edef\f@size{\strip@pt\@tempdimb}% + \@defaultunits\@tempskipa#3pt\relax\@nnil + \edef\f@baselineskip{\the\@tempskipa}% + \edef\f@linespread{#1}% +% \end{macrocode} +% For backward compatibility and for later testing within +% |\selectfont| the internal value of |\f@linespread| is passed +% back to |\baselinestretch|. +% \begin{macrocode} + \let\baselinestretch\f@linespread +% \end{macrocode} +% Additional processing will happen within |\selectfont|. For this +% reason the macro |\size@update| (which will be called in +% |\selectfont|) will be defined to be: +% \begin{macrocode} + \def\size@update{% +% \end{macrocode} +% First calculate the new |\baselineskip| and also store it in +% |normalbaselineskip| +% \begin{macrocode} + \baselineskip\f@baselineskip\relax + \baselineskip\f@linespread\baselineskip + \normalbaselineskip\baselineskip +% \end{macrocode} +% then to set up a new |\strutbox| +% \begin{macrocode} + \setbox\strutbox\hbox{% + \vrule\@height.7\baselineskip + \@depth.3\baselineskip + \@width\z@}% +% \end{macrocode} +% We end with a bit of tracing information. +% \begin{macrocode} +%<*trace> + \ifnum \tracingfonts>\tw@ + \ifx\f@linespread\@empty + \let\reserved@a\@empty + \else + \def\reserved@a{\f@linespread x}% + \fi + \@font@info{Changing size to \f@size/\reserved@a + \f@baselineskip}% + \aftergroup\type@restoreinfo \fi +% +% \end{macrocode} +% When all this is processed |\size@update| redefines itself to +% |\relax| so that in later calls of |\selectfont| no extra code +% will be executed. +% \begin{macrocode} + \let\size@update\relax}% + } +% \end{macrocode} +% Instead of defining this macro internally we might speed things +% up by placing the code into a separate macro and use |\let|! +% \end{macro} +% +% +% \begin{macro}{\size@update} +% Normally this macro does nothing; it will be redefined by +% |\set@fontsize| to initiate an update. +% \begin{macrocode} +\let\size@update\relax +% \end{macrocode} +% \end{macro} +% +% +% \begin{macro}{\type@restoreinfo} +% This macro produces some info when a font size and/or baseline +% change will get restored. +% \changes{1.0r}{1990/08/27}{Some extra tracing info.} +% \begin{macrocode} +%<*trace> + \def\type@restoreinfo{% + \ifx\f@linespread\@empty + \let\reserved@a\@empty + \else + \def\reserved@a{\f@linespread x}% + \fi + \@font@info{Restoring size to + \f@size/\reserved@a\f@baselineskip}} +% +% \end{macrocode} +% \end{macro} +% +% \begin{macro}{\glb@settings} +% \begin{macro}{\glb@currsize} +% \changes{v2.3a}{1994/01/17}{New math font setup} +% \changes{v2.3k}{1994/11/06}{New implementation} +% The macro |\glb@settings| globally selects +% all math fonts for the current size if necessary. +% \begin{macrocode} +\def\glb@settings{% +% \end{macrocode} +% When |\glb@settings| gains control a size +% change was requested and all previous font assignments need to +% be replaced. +% Therefore the old values of the fonts are no longer needed. +% For every {\em math group\/} the new assignments are appended to +% |\math@fonts|. +% But this happens only if the |math@fonts| switch +% is set to true. +% However, we always set up the correct math sizes for script and +% scriptscript fonts since they may be needed even if we don't set +% up the whole math machinery. +% +% Here we set the math size, script size and scriptscript size. +% If the |S@|\ldots{} macro is not defined we have to first +% calculate the three sizes. +% \begin{macrocode} + \expandafter\ifx\csname S@\f@size\endcsname\relax + \calculate@math@sizes + \fi +% \end{macrocode} +% The effect of this is that |\calculate@math@sizes| +% may or may not define the |S@|\ldots{} macro. In the +% first case the next time the same size is requested +% this macro is used, otherwise |\calculate@math@sizes| is +% called again. +% This also sets the |math@fonts| switch. +% If it is true we must switch the math fonts. +% \begin{macrocode} + \csname S@\f@size\endcsname + \ifmath@fonts +%<*trace> + \ifnum \tracingfonts>\tw@ + \@font@info{Setting up math fonts for + \f@size/\f@baselineskip}\fi +% +% \end{macrocode} +% Inside a group we execute the macro for the current math {\em +% version}. This sets |\math@fonts| to a list of +% |\textfont|\dots{} assignments. |\getanddefine@fonts| (which may +% be called at this point) needs the |\escapechar| parameter to be +% set to $-1$. +% \begin{macrocode} + \begingroup + \escapechar\m@ne + \csname mv@\math@version \endcsname +% \end{macrocode} +% Then we set |\globaldefs| to 1 so that all following changes are +% done globally. The math font assignments recorded in +% |\math@fonts| are executed and |\glb@currsize| is set equal to +% |\f@size|. This signals that the fonts for math in this size are +% set up. +% \begin{macrocode} + \globaldefs\@ne + \math@fonts + \let \glb@currsize \f@size + \endgroup +% \end{macrocode} +% Finally we execute any code that is supposed to happen +% whenever the math font setup changes. This register will +% be executed in local mode which means that everything that is +% supposed to have any effect should be done globally inside. +% We can't execute it within |\globaldefs\@ne| as we don't know +% what ends up inside this register, e.g., it might contain +% calculations which use some local registers to calculate the +% final (global) value. +% \begin{macrocode} + \the\every@math@size +% \end{macrocode} +% Otherwise we announce that the math fonts are not set up for this +% size. +% \begin{macrocode} +%<*trace> + \else + \ifnum \tracingfonts>\tw@ + \@font@info{No math setup for + \f@size/\f@baselineskip}\fi +% + \fi +} +% +% \end{macrocode} +% \end{macro} +% \end{macro} +% +% +% \begin{macro}{\baselinestretch} +% \changes{v1.0o}{1990/06/24}{Moved to tracefnt.dtx.} +% In |\selectfont| we used |\baselinestretch| as +% a factor when assigning a value to |\baselineskip|. +% We use 1 as a default (i.e.\ no stretch). +% \begin{macrocode} +%<*2ekernel|autoload> +\def\baselinestretch{1} +% \end{macrocode} +% \end{macro} +% +% \begin{macro}{\every@math@size} +% \changes{v1.0u fam.dtx}{1989/12/05}{Hook \cs{every@size} added.} +% \changes{v23.k}{1994/10/23}{Renamed to \cs{every@math@size}} +% We must still define the hook |\every@math@size| we used in +% |\glb@settings|. We initialize it to nothing. It is important to +% remember that everything that goes into this hook should to global +% updates, local changes will have weird effects. +% \begin{macrocode} +\newtoks\every@math@size +\every@math@size={} +% +% \end{macrocode} +% \end{macro} +% +% +% +% \subsection{Math fonts setup} +% +% +% \subsubsection{Outline of algorithm for math font sizes} +% +% \TeX{} uses the the math fonts that are current when the end of a +% formula is reached. If we don't want to keep font setups local to +% every formula (which would result in an enormous overhead, we have +% to be careful not to end up with the wrong setup in case formulas +% are nested, e.g., we need to be able to handle +% \begin{verbatim} +% $ a=b+c \mbox{ \small for all $b$ and $c\in Z$}$ +%\end{verbatim} +% Here the inner formulae |b| and |c\in Z| are typeset in |\small| but +% we have to return to |\normalsize| before we reach the closing |$| +% of the outer formula. +% +% This is handled in the following way: +% \begin{enumerate} +% \item At any point in the document the global variable +% |\gbl@currsize| contains the point size for which the math fonts +% currently are set up. +% +% \item \label{it:everymath} Whenever we start a formula we compare +% its value with the local variable |\f@size| that describes the +% current text font size. +% +% \item If both are the same we assume that we can use the current +% math font setup without adjustment. +% +% \item \label{it:everymathend} If they differ we call |\gbl@settings| +% which changes the math font setup and updates |\gbl@currsize|. +% \begin{enumerate} +% \item If we are recursively inside another formula (|\if@inmath|) we +% ensure that |\gbl@settings| is executed again in the outer +% formula, so that the old setup is automatically restored. +% \item Otherwise, we set the switch |@inmath| locally to |true| so +% that all nested formulae will be able to detect that they are +% nested in some outer formula. +% \end{enumerate} +% \end{enumerate} +% +% +% The above algorithm has the following features: +% \begin{itemize} +% \item For sizes which are not containing any formula no math setup +% is done. Compared to the original algorithm of NFSS this results +% in the following savings: +% \begin{itemize} +% \item No unnecessary loading of math fonts for sizes that are not +% used to typeset any math formulae (explicit or implicit ones). +% \item No time overhead due to unnecessary changes of the math font +% setup on entrance and exit of the text font size. +% \end{itemize} +% +% \item Math font setup changes for top-level formulae will survive +% (there is no restoration after the formula) thus any following +% formula in the same size will be directly typesetable. Compared to +% original implementation in NFSS2 +% the new algorithm has the overhead of one test per formula +% to see if the current math setup is valid (in the original +% algorithm the setup was always valid, thus no test was necessary). +% +% \item In nested formulae the math font setup is restored in the +% outer formula by a series of |\aftergroup| commands and checks. +% Compared to the original algorithm this involves additional checks +% ($2 \times \langle\mbox{non-math levels}\rangle$ per inner +% formula). +% \end{itemize} +% +% \subsubsection{Code for math font size setting} +% +% \begin{macro}{\check@mathfonts} +% \changes{v2.3a}{1994/01/17}{New math font setup} +% \changes{v2.3c}{1994/01/26}{Correct trace info placement} +% In the |\check@mathfonts| macros we implement the steps +% \ref{it:everymath} to \ref{it:everymathend} except that instead +% of a switch the macro |\init@restore@glb@settings| is used. +% \begin{macrocode} +%<*2ekernel|package|autoload> +\def\check@mathfonts{% + \ifx \glb@currsize \f@size +%<*trace> + \ifnum \tracingfonts>\thr@@ + \@font@info{*** MATH: no change \f@size\space + curr/global (\curr@math@size/\glb@currsize)}\fi +% + \else +%<*trace> + \ifnum \tracingfonts>\thr@@ + \@font@info{*** MATH: setting up \f@size\space + curr/global (\curr@math@size/\glb@currsize)}\fi +% + \glb@settings + \init@restore@glb@settings + \fi + \let\curr@math@size\f@size + \def\init@restore@glb@settings{\aftergroup\restglb@settings}% +} +% \end{macrocode} +% \end{macro} +% +% +% +% +% \begin{macro}{\init@restore@glb@settings} +% \changes{v3.0i}{1996/07/26}{macro added replacing \cs{if@inmath} switch} +% This macros does by default nothing but get redefined inside +% |\check@mathfonts| to initiate fontsize restoring in nested +% formulas. +% \begin{macrocode} +%<-trace>\let\init@restore@glb@settings\relax +%<*trace> +\def\init@restore@glb@settings{% + \ifnum \tracingfonts>\thr@@ + \@font@info{*** MATH: no resetting (not in + nested math)}\fi +} +% +% \end{macrocode} +% \end{macro} +% +% +% \begin{macro}{\restglb@settings} +% \changes{v2.3a}{1994/01/17}{New math font setup} +% \changes{v2.3c}{1994/01/26}{Correct trace info placement} +% This macro will be executed the first time after the current +% formula. +% \begin{macrocode} +\def\restglb@settings{% +%<*trace> + \ifnum \tracingfonts>\thr@@ + \@font@info{*** MATH: restoring}\fi +% + \begingroup + \let\f@size\curr@math@size + \ifx\glb@currsize \f@size +%<*trace> + \ifnum \tracingfonts>\thr@@ + \@font@info{*** MATH: ... already okay (\f@size)}\fi +% + \else +%<*trace> + \ifnum \tracingfonts>\thr@@ + \@font@info{*** MATH: ... to \f@size}\fi +% + \glb@settings + \fi + \endgroup +} +% \end{macrocode} +% \end{macro} +% +% +% \subsubsection{Other code for math} +% +% +% \begin{macro}{\use@mathgroup} +% \changes{v1.2b}{1990/01/21}{Macro added to allow cleaner interface.} +% \changes{v1.2h}{1990/03/30}{Third argument removed (see +% \cs{math@egroup}).} +% The |\use@mathgroup| macro should be used in user +% macros to select a math group. Depending on whether or not the +% \texttt{margid} option is in force it has two or three arguments. +% For this reason it should be called as the last macro. +% +% First we test if we are inside math mode since we don't want to +% apply a useless definition. +% \changes{v1.1a}{1989/12/16}{Usage of `\quotechar=' macro added.} +% \changes{v1.1a}{1989/12/16}{Redefinition of alphabet now simpler.} +% \begin{macrocode} +\def\use@mathgroup#1#2{\relax\ifmmode +% \end{macrocode} +% \changes{v1.0o}{1990/06/24}{Tracing code added.} +% \changes{v1.0q}{1990/07/07}{Group number added to tracing.} +% \begin{macrocode} +%<*trace> + \ifnum \tracingfonts>\tw@ + \count@#2\relax + \@font@info{Using \noexpand\mathgroup + (\the\count@) #2}\fi +% +% \end{macrocode} +% If so we first call the `=' macro (i.e.\ argument three) to set +% up special things for the selected math group. Then we call +% |\mathgroup| to select the group given by argument two and +% finally we place |#1| (i.e.\ the argument of the \meta{math +% alphabet identifier} at the end. This part of the code is +% surrounded by two commands which behave like |\begingroup| +% and |\endgroup| if we want \meta{math alphabet identifier}s +% but will expand into |\@empty| if we want simply switches to +% a new math group. +% \changes{v1.0p}{1990/06/30}{Added \cs{relax} after math group number.} +% Since argument number $2$ may be a digit instead of a control +% sequence we add a |\relax|. +% Otherwise something like |\mit{1}| would switch to math group +% $11$ (and back) instead of printing an oldstyle $\mit {1}$. +% \changes{v2.0b}{1992/07/26}{} +% \begin{macrocode} + \math@bgroup + \expandafter\ifx\csname M@\f@encoding\endcsname#1\else + #1\fi + \mathgroup#2\relax +% \end{macrocode} +% Before we reinsert the swallowed token (arg.\ three) into the +% input stream, in the case that the \meta{math alphabet +% identifier} isn't called in math mode, we remove the |\fi| +% with the |\expandafter| trick. This is necessary if the +% token is actually an macro with arguments. In such a case the +% |\fi| will be misinterpreted as the first argument which +% would be disastrous. +% \changes{v1.0f}{1989/12/13} +% {\cs{expandafter} added before final \cs{fi}.} +% \begin{macrocode} + \expandafter\math@egroup\fi}% +% \end{macrocode} +% The surrounding macros equal |\begingroup| and |\endgroup|. But +% using internal names makes it possible to overwrite their meaning +% in certain cases. This is for example used in \AmSTeX{} macros +% for placing accents. +% \end{macro} +% +% \begin{macro}{\math@egroup} +% \changes{v1.0q}{1990/07/07}{Tracing code added.} If the +% \texttt{margid} option is in force (which can be tested by +% looking at the definition of |\math@bgroup| we change the +% |\math@egroup| command a bit to display the current \meta{math +% group number} after it closes the scope of \meta{math alphabet} +% with |\endgroup|. +% \changes{v3.0h}{1996/05/08}{Use \cs{bgroup} instead of \cs{begingroup} +% to match a kernel change made in 1994!!!!} +% \begin{macrocode} +%<*trace> + \ifx\math@bgroup\bgroup + \def\math@egroup#1{#1\egroup + \ifnum \tracingfonts>\tw@ + \@font@info{Restoring \noexpand\mathgroup + (\ifnum\mathgroup=\m@ne default\else \the\mathgroup \fi)% + }\fi} + \fi +% +% \end{macrocode} +% \end{macro} +% +% \begin{macro}{\getanddefine@fonts} +% \changes{v1.0o}{1990/06/24}{\cs{Macro} moved from fam.dtx.} +% |\getanddefine@fonts| has two arguments: the \meta{math +% group number} and the {\em family/series/shape\/} name as a +% control sequence. +% \begin{macrocode} +\def\getanddefine@fonts#1#2{% +% \end{macrocode} +% First we turn of tracing when |\tracingfonts| is less than $4$. +% \changes{v1.0o}{1990/06/24}{Adding debug code.} +% \changes{v1.0r}{1990/08/27} +% {Correcting missing name after \cs{tracingon}.} +% \begin{macrocode} +%<+debug> \pushtracing +%<+debug> \ifnum\tracingfonts<4 \tracingoff +%<+debug> \else \tracingon\getanddefine@fonts \fi +% \end{macrocode} +% \changes{v1.0o}{1990/06/24}{\cs{Adding} tracing code.} +% \changes{v1.0q}{1990/07/07}{Group number added to tracing.} +% \changes{v2.1a}{1992/09/22}{Introduced \cs{tf@size} for math size.} +% \begin{macrocode} +%<*trace> + \ifnum \tracingfonts>\tw@ + \count@#1\relax + \@font@info{\noexpand\mathgroup (\the\count@) #1 :=\MessageBreak + \string#2 \tf@size/\sf@size/\ssf@size}\fi +% +% \end{macrocode} +% We append the current |\tf@size| to |#2| to obtain the font +% name.\footnote{One might ask why this expansion does not generate +% a macro name that starts with an additional \texttt{\bslash} +% character. The solution is that \texttt{\bslash escapechar} is +% set to $-1$ before \texttt{\bslash getanddefine@fonts} is +% called.} Again, |font@name| is defined globally, for the reasons +% explained in the description of |\wrong@fontshape|. +% \begin{macrocode} + \xdef\font@name{\csname \string#2/\tf@size\endcsname}% +% \end{macrocode} +% Then we call |\pickup@font| to load it if necessary. +% We remember the internal name as |\textfont@name|. +% \begin{macrocode} + \pickup@font \let\textfont@name\font@name +% \end{macrocode} +% Same game for |\scriptfont| and |\scriptscriptfont|: +% \begin{macrocode} + \xdef\font@name{\csname \string#2/\sf@size\endcsname}% + \pickup@font \let\scriptfont@name\font@name + \xdef\font@name{\csname \string#2/\ssf@size\endcsname}% + \pickup@font +% \end{macrocode} +% Then we append the new |\textfont|\ldots{} assignments to +% the |\math@fonts|. +% \begin{macrocode} + \edef\math@fonts{\math@fonts + \textfont#1\textfont@name + \scriptfont#1\scriptfont@name + \scriptscriptfont#1\font@name}% +% \end{macrocode} +% Just before ending this macro we have to pop the tracing stack +% if it was pushed before. +% \begin{macrocode} +%<+debug> \poptracing + } +% +% \end{macrocode} +% \end{macro} +% +% +% \section{Scaled font extraction} +% +% \begin{macro}{\ifnot@nil} +% We begin with a simple auxiliary macro. It checks +% whether its argument is the token |\@nil|. If so, +% it expands to |\@gobble| which discards the following +% argument, otherwise it expands to |\@firstofone| which +% reproduces it argument. +% \changes{v2.3n}{1995/05/08}{Use \cs{@firstofone}} +% \begin{macrocode} +%<*2ekernel|autoload> +\def\ifnot@nil#1{\def\reserved@a{#1}% + \ifx\reserved@a\@nnil \expandafter\@gobble + \else \expandafter\@firstofone\fi} +% \end{macrocode} +% \end{macro} +% +% +% \begin{macro}{\remove@to@nnil} +% \begin{macro}{\remove@angles} +% \begin{macro}{\remove@star} +% Three other auxiliary macros will be needed in the following: +% |\remove@to@nnil| gobbles up everything up to, and including, +% the next |\@nnil| token, and |\remove@angles| and |\remove@star| +% do the same +% for the character |>| and |*|, respectively, instead of |\@nnil|. +% \begin{macrocode} +\def\remove@to@nnil#1\@nnil{} +\def\remove@angles#1>{\set@simple@size@args} +\def\remove@star#1*{#1} +% +% \end{macrocode} +% \end{macro} +% \end{macro} +% \end{macro} +% \changes{v3.0c}{1995/08/24}{Macro \cs{gobble@font@spec} removed} +% +% \begin{macro}{\extract@sizefn} +% This macro takes a size specification and parses it into size +% function and the optional and mandatory arguments. +% \begin{macrocode} +%<*2ekernel|def2|autoload> +\def\extract@sizefn#1*#2\@nil{% + \if>#2>\set@size@funct@args#1\@nil + \let\sizefn@info\@empty + \else\expandafter\set@size@funct@args\remove@star#2\@nil + \def\sizefn@info{#1}\fi + } +% \end{macrocode} +% \end{macro} +% +% +% \begin{macro}{\try@simple@size} +% This function tries to extract the given size (specified by +% |\f@size|) for the requested font shape. The font information +% must already be present in |\font@info|. +% The central macro that does the real work is |\extract@fontinfo|. +% We will first give a simple example how this macro works, and +% describe it in full generality later. +% +% Assume that the requested parameters are: {\em encoding scheme\/} +% `OT1', {\em family\/} `cm', {\em series\/} `sansserif', +% {\em shape\/} `normal', and {\em size\/} `$12$'. +% The correspondign font definitions have already been +% extracted from the macro |\OT1/cm/sansserif/normal| and +% stored in |font@info|. +% (Otherwise |\extract@fontinfo| doesn't get called.) +% This information consists of a token list made of characters +% of category code $12$ of the form +% \begin{verbatim} +% <10*>cmss10<12*>cmss12<17*>cmss17 +%\end{verbatim} +% For reasonable packages one usually needs more sizes but this is +% sufficient to get the flavour. +% We will define a macro |\extract@fontinfo| to find +% the external font name (`cmss12') for us: +% \begin{verbatim} +% \def\extract@fontinfo#1<12*#2>#3<#4\@nnil{% +% \set@simple@size@args#3<#4\@nnil +% \execute@size@function{#2}} +%\end{verbatim} +% so that when it gets called via +% \begin{verbatim} +% \extract@fontinfo<10*>cmss10<12*>cmss12<17*>cmss17\@nnil +%\end{verbatim} +% |#1| will contain all characters before |<12*>|, +% |#2| will be empty, |#3| will be exactly |cmss12|, +% and |#3| will be |17>cmss17|. +% The expansion is therefore +% \begin{verbatim} +% \set@simple@size@args cmss12<17*>cmss17\@nnil +% \execute@size@function{} +%\end{verbatim} +% This means: the default (empty) size function will be executed, +% with its optional argument argument set to empty and its mandatory +% argument set to |cmss12| by |\set@simple@size@args|. +% As we discussed earlier, the effect of the default size function +% is to load the given external font (cmss12) at the specified size +% (12)---which is exactly what was intended. +% +% But this is only part of the whole story. +% It may be that the size requested does not occur +% in the token list |\font@info|. +% And the simple definition of |\extract@fontinfo| we gave +% above does not allow to specify give more than one +% size specification in front of the external font name. +% +% Let's address these two problems separately. The first one +% is solved with the following trick: +% We define |\extract@fontinfo| as follows: +% \begin{verbatim} +% \def\extract@fontinfo#1<12*#2>#3<#4\@nnil{% +% \ifnot@nil{#3}% +% {\set@simple@size@args#3<#4\@nnil +% \execute@size@function{#2}% +% }}% +%\end{verbatim} +% How does this work? +% We call |\extract@fontinfo| via +% \begin{verbatim} +% \expandafter\extract@fontinfo\font@info<12*>\@nil<\@nnil +%\end{verbatim} +% i.e. by appending |<12*>\@nil<\@nnil|. +% If the size (`12' in this case) appears in |\font@info| +% everything works as explained above, the only difference being +% that argument |#4| of |\extract@fontinfo| +% additionally gets the tokens |<12*>\@nil<\@nnil|. +% However, if the size is not found everything up to the final +% |<12*>| is in argument |#1|, +% |#3| gets |\@nil|, +% and |#2| and |#4| are empty. +% The macro |\ifnot@nil| will discard the calls to +% |\set@simple@size@args| and |execute@size@function|, and +% hence |\font@info| will continue to be equal to |\@empty|. +% This means that no simple size specification matching the +% requested size could be found. +% +% The second problem (more than one simple size specification +% for one external font name) will be addressed in +% |\set@simple@size@args| below. +% +% The macros are hidden inside other control sequences +% so that we have to build |\extract@fontinfo| in +% several steps. +% +% So here's the actual definition of |\extract@font| in +% |\try@simple@size|. +% \begin{macrocode} +% % this could be replaced by \try@size@range making the subst slower! +\def\try@simple@size{% +% \end{macrocode} +% |\reserved@a| is made an abbreviation for the head of the +% definition of the macro |\extract@fontinfo|. +% \begin{macrocode} + \def\reserved@a{\def\extract@fontinfo####1}% +% \end{macrocode} +% Now we can define |\extract@fontinfo|. Here we handle a small +% but convenient variation: in case of the default (empty) size +% function it is allowed to omit the |*| character. +% \changes{v2.0b}{1992/07/26}{} +% \changes{v2.0c}{1992/09/19}{} +% \begin{macrocode} + \expandafter\reserved@a\expandafter<\f@size>##2<##3\@nnil{% + \ifnot@nil{##2}% + {\set@simple@size@args##2<##3\@nnil + \execute@size@function\sizefn@info + }}% +% \end{macrocode} +% \changes{v2.0b}{1992/07/26}{} +% Now we call |\extract@fontinfo|. Note the |<\@nil| \textsf{tokens} +% at the end. +% \begin{macrocode} + \expandafter\expandafter + \expandafter\extract@fontinfo\expandafter\font@info + \expandafter<\f@size>\@nil<\@nnil +} +% \end{macrocode} +% \end{macro} +% +% \begin{macro}{\set@simple@size@args} +% As promised above, the macro |\set@simple@size@args| will handle +% the case of several size specifications in a row. +% If another size specification follows, the very first token of +% its argument list is the character |<|. +% By starting the definition as follows, +% \begin{macrocode} +\def\set@simple@size@args#1<{% +% \end{macrocode} +% parameter |#1| is empty in this case, and contains the size +% function's arguments otherwise. We distinguish these two cases +% (Note that the character |<| cannot appear in |#1|) by calling +% |\remove@angles| for empty |#1| and |\extract@sizefn| +% otherwise. In the latter case we have to take care of the +% remaining character tokens and discard them. This is done by +% |\remove@to@nnil|. Note also the use of Kabelschacht's method. +% \begin{macrocode} + \if<#1<% + \expandafter\remove@angles + \else + \extract@sizefn#1*\@nil + \expandafter\remove@to@nnil + \fi} +% \end{macrocode} +% \end{macro} +% +% +% Now, we are through with the case of a simple size, except for +% calling the size function. This will be handled later, as it is +% the same mechanism for all types of size specification. We will +% now proceed to macors for extraction of size range specification. +% +% +% +% \begin{macro}{\extract@rangefontinfo} +% |\extract@rangefontinfo| goes through a font shape definition +% in the input until it recognizes the tokens |<\@nil->|. +% It looks for font ranges with font size functions. It's operation +% is rather simple: it discards everything up to the next size +% specification and passes this on to |\is@range| for inspection. +% The specification (parameter |#2| is inserted again, in case +% it is needed later. +% \begin{macrocode} +\def\extract@rangefontinfo#1<#2>{% + \is@range#2->\@nil#2>} +% \end{macrocode} +% \end{macro} +% +% \begin{macro}{\is@range} +% |\is@range| is again a sort of dispatcher macro: if the size +% specification it is looking at is not a range specification +% it discards it and calls |\extract@rangefontinfo| to continue +% the search. Otherwise it calls |\check@range| to check the +% requested size against the specified range. +% +% From the way |\is@range| is called inside |\extract@rangefontinfo| +% we see that |#2| is the character |>| if the size specification +% found is a simple one (as it does not contain a |-| character. +% This is checked easily enough and |\extract@rangefontinfo| +% called again. Note that the extra tokens inserted after the +% |\@nil| in the call to |\is@range| appear at the beginning of +% the first argument to |\extract@rangefontinfo| and are hence +% ignored. +% \begin{macrocode} +\def\is@range#1-#2\@nil{% + \if>#2\expandafter\check@single\else + \expandafter\check@range\fi} +% \end{macrocode} +% \end{macro} +% +% +% \begin{macro}{\check@range} +% |\check@range| takes lower bound as parameter |#1|, upper bound +% as |#2|, size function as |#3| and the size function's arguments +% as |#4|. If |#3| is the special token |\@nil| |\font@info| is +% exhausted and we can stop searching. +% \begin{macrocode} +\def\check@range#1-#2>#3<#4\@nnil{% + \ifnot@nil{#3}{% +% \end{macrocode} +% If |#3| wasn't |\@nil| we have a range. We start by assuming that +% we have to recurse. Note that we have to reinsert an |<| as it +% was already removed by scanning. +% \begin{macrocode} + \def\reserved@f{\extract@rangefontinfo<#4\@nnil}% +% \end{macrocode} +% We have to make sure that both boundaries are present, if not we +% have to set them. Here we check the upper bound. If |\upper@bound| +% is zero after the assignment we set it to |\maxdimen| (upper open +% range). We need to use a \meta{dimen} register for the scan since +% we may have a decimal number as the boundary. +% \begin{macrocode} + \upper@bound0#2\p@ + \ifdim\upper@bound=\z@ \upper@bound\maxdimen\fi +% \end{macrocode} +% Now we check the upper boundary against |\f@size|. +% If it is larger or equal than |\f@size| this +% range is no good and we have to recurse. +% \begin{macrocode} + \ifdim \f@size \p@<\upper@bound +% \end{macrocode} +% Otherwise we have to check the lower bound. This time it is not +% necessary to scan the boundary value into a register because if +% it is empty we get zero as desired. We could even omit the |0| +% which would result in |1pt| as default lower boundary. If +% |\f@size| is smaller than the boundary we have to recurse. +% \begin{macrocode} + \lower@bound0#1\p@ + \ifdim \f@size \p@<\lower@bound + \else +% \end{macrocode} +% If both tests are passed we can try executing the size function. +% \begin{macrocode} + \set@simple@size@args#3<#4\@nnil + \execute@size@function\sizefn@info +% \end{macrocode} +% If the function was successful it should have left an external +% font name in |\external@font|. We use this to see if we can stop +% scanning. Otherwise we recurse. +% \begin{macrocode} + \ifx\external@font\@empty + \else + \let\reserved@f\@empty + \fi + \fi + \fi + \reserved@f}} +% +% \end{macrocode} +% \end{macro} +% +% \begin{macro}{\lower@bound} +% \begin{macro}{\upper@bound} +% We use two dimen registers |\lower@bound| and |\upper@bound| +% to store the lower and upper endpoints of the range we found. +% \begin{macrocode} +%<*2ekernel|autoload> +\newdimen\lower@bound +\newdimen\upper@bound +% +% \end{macrocode} +% \end{macro} +% \end{macro} +% +% +% \begin{macro}{\check@single} +% |\check@single| takes the size as parameter |#1|, size function +% as |#2| and the size function's arguments as |#3|. We can assume +% that there is always something in the pipeline since the very +% last entry is a faked range (see above). +% \begin{macrocode} +%<*2ekernel|def2|autoload> +\def\check@single#1>#2<#3\@nnil{% +% \end{macrocode} +% We start by assuming that +% we have to recurse. Note that we have to reinsert an |<| as it +% was already removed by scanning. +% \begin{macrocode} + \def\reserved@f{\extract@rangefontinfo<#3\@nnil}% +% \end{macrocode} +% Now we check the the size against |\f@size|. If it is not equal +% |\f@size| it is no good and we have to recurse. +% \begin{macrocode} + \ifdim \f@size \p@=#1\p@ +% \end{macrocode} +% Otherwise if this test is passed we can try executing the size +% function. +% \begin{macrocode} + \set@simple@size@args#2<#3\@nnil + \execute@size@function\sizefn@info +% \end{macrocode} +% If the function was successful it should have left an external +% font name in |\external@font|. We use this to see if we can stop +% scanning. Otherwise we recurse. +% \begin{macrocode} + \ifx\external@font\@empty + \else + \let\reserved@f\@empty + \fi + \fi + \reserved@f} +% \end{macrocode} +% \end{macro} +% +% +% \begin{macro}{\set@size@funct@args} +% \begin{macro}{\set@size@funct@args@} +% This macro sets the optional and mandatory arguments for a size +% function. If the optional argument is not present it is set to +% the empty token list. The mandatory argument is delimited by the +% token |\@nil|. +% \begin{macrocode} +\def\set@size@funct@args{\@ifnextchar[% + \set@size@funct@args@{\set@size@funct@args@[]}} +% \end{macrocode} +% +% \begin{macrocode} +\def\set@size@funct@args@[#1]#2\@nil{% + \def\mandatory@arg{#2}% + \def\optional@arg{#1}} +% +% \end{macrocode} +% \end{macro} +% \end{macro} +% +% +% \begin{macro}{\DeclareSizeFunction} +% This function defines a new size function hiding the internal +% from the designer. The body of the size function may use +% |\optional@arg| and |\mandatory@arg| denoting the optional and +% mandatory argument that may follow the size specification |<...>|. +% \changes{v2.1c}{1993/03/18}{Added all args to avoid blanks problems} +% \begin{macrocode} +%<*2ekernel|autoload> +\def\DeclareSizeFunction#1#2{\@namedef{s@fct@#1}{#2}} +\@onlypreamble\DeclareSizeFunction +% +% \end{macrocode} +% \end{macro} +% +% +% \begin{macro}{\execute@size@function} +% This macro is very simple. The only point worth noting +% is that calling an undefined size function will do nothing +% (actually execute a |\relax|). +% \begin{macrocode} +%<*2ekernel|package|autoload> +\def\execute@size@function#1{% %%% could be added to autoload as well +%<*trace> + \@ifundefined{s@fct@#1}% + {\errmessage{Undefined font size function #1}% + \s@fct@}% + {\csname s@fct@#1\endcsname}% +% +%<-trace> \csname s@fct@#1\endcsname +} +% +% \end{macrocode} +% \end{macro} +% +% \changes{v2.3j}{1994/05/23}{Removed def of \cs{f@warn@break}} +% +% +% \begin{macro}{\try@size@range} +% This macro tries to find a suitable range for requested size +% (specified by |\f@size|) in |\font@info|. All the relevant +% action is done in |\extract@rangefontinfo|. All that needs +% to be done is to stuff in the token list in |\font@info| so +% that |\extract@rangefontinfo| can inspect it. +% Note the |<-*\@nil><| token at the end to stop scanning. +% \changes{v2.0b}{1992/07/26}{} +% \begin{macrocode} +%<*2ekernel|def2|autoload> +\def\try@size@range{% + \expandafter\extract@rangefontinfo\font@info <-*>\@nil<\@nnil +} +% +% \end{macrocode} +% \end{macro} +% +% +% \begin{macro}{\try@size@substitution} +% \changes{v2.3k}{1994/11/06}{New implementation} +% This is the last thing that can be tried. If the desired |\f@size| +% is found neither among the simple size specifications nor in one +% of the ranges the whole list of size specifications is searched for +% a nearby simple size. +% \begin{macrocode} +%<*2ekernel|def1> +\gdef\try@size@substitution{% +% \end{macrocode} +% First we do some initializations. |\@tempdimb| +% will hold the difference between the wanted size and the best +% solution found so far, so we initialise it with |\maxdimen|. +% The macro |\best@size| will hold the best size found, nothing +% found is indicated by the empty value. +% \begin{macrocode} + \@tempdimb \maxdimen + \let \best@size \@empty +% \end{macrocode} +% Now we loop over the specification +% \begin{macrocode} + \expandafter \try@simples \font@info <\number\@M>\@nil<\@nnil +} +% +%<*autoload> +\def\try@size@substitution{\try@simples\try@size@substitution} +% +% \end{macrocode} +% \end{macro} +% +% +% \begin{macro}{\font@submax} +% \changes{v2.3d}{1994/04/18}{Changed dimen to macro} +% \begin{macro}{\fontsubfuzz} +% \changes{v2.3d}{1994/04/18}{Changed dimen to macro} +% The macro |\font@submax| records the maximal deviation from the +% desired size encountered so far. Its value is used in a warning +% message at |\end{coument}|. The macro +% |\fontsubfuzz| contains the amount that will not cause terminal +% warnings (warnings still go into the transcript file). +% \begin{macrocode} +%<*2ekernel|autoload> +\def\font@submax{0pt} +\def\fontsubfuzz{.4pt} +% +%<+package>\def\fontsubfuzz{0pt} +% \end{macrocode} +% \end{macro} +% \end{macro} +% +% +% +% \begin{macro}{\try@simples} +% \changes{v2.3k}{1994/11/06}{New implementation} +% |\try@simples| goes through a font shape definition +% in the input until it recognizes the tokens |<*\@nil><|. +% It looks for simple sizes to determine the two closest sizes. +% It is assumed that simple sizes are in increasing order. +% \begin{macrocode} +%<*2ekernel|def1> +\gdef\try@simples#1<#2>{% + \tryif@simple#2->\tryif@simple} +% +%<*autoload> +\def\try@simples{\@autoload{fss1}} +% +% \end{macrocode} +% \end{macro} +% +% \begin{macro}{\tryis@simple} +% \changes{v2.3k}{1994/11/06}{New implementation} +% |\tryis@simple| is similar to |\is@range|. If it sees a simple size, +% it checks it against the value of |\f@size| and sets +% |\lower@font@size| or |\higher@font@size|. In the latter case, it +% stops the iteration. By adding |<\number\@M>| at the end of the +% line we always have an end point. This is a hack which probably +% should be corrected. +% +% First it checks whether it is finished already, then whether the +% size specification in question is a simple one. +% \begin{macrocode} +%<*2ekernel|def1> +\gdef\tryif@simple#1-#2\tryif@simple{% +% \end{macrocode} +% Most common case for |\reserved@f| first: +% \begin{macrocode} + \let \reserved@f \try@simples + \if>#2% +% \end{macrocode} +% If so, it compares it to the value of |\f@size|. This is done using +% a dimen register since there may be fractional numbers. +% \begin{macrocode} + \dimen@ #1\p@ + \ifdim \dimen@<\@M\p@ +% \end{macrocode} +% If |\dimen@| is |\@M\p@| we have reached the end of the fontspec +% (hopefully) otherwise we compare the value with |\f@size| and +% compute in |\@tempdimc| the absolute value of the difference +% between the two values. +% \begin{macrocode} + \ifdim \f@size\p@<\dimen@ + \@tempdimc \dimen@ + \advance\@tempdimc -\f@size\p@ + \else + \@tempdimc \f@size\p@ + \advance\@tempdimc -\dimen@ + \fi +% \end{macrocode} +% The result is then compared with the smallest difference we have +% encountered, if the new value (in |\@tempdimc| is smaller) we +% have found a size which is a better approximation so we make it +% the |\best@size| and adjust |\@tempdimb|. +% \begin{macrocode} + \ifdim \@tempdimc<\@tempdimb + \@tempdimb \@tempdimc + \def \best@size{#1}% + \fi +% \end{macrocode} +% When we have reached the end of the fontspec we substitute the +% best size found (if any). We code this inline to save macro +% space; in the past this was done by a macro called |\subst@size|. +% \begin{macrocode} + \else +% \end{macrocode} +% +% +% \begin{macro}{\subst@size} +% This macro substitutes the size recorded in |\best@size| for +% the unavailable size |\f@size|. |\font@submax| records the maximum +% difference between desired size and selected size in the +% whole run. +% \changes{v2.3d}{1994/04/18}{\cs{font@submax} and \cs{fontsubfuzz} +% now macros} +% \begin{macrocode} +% %\subst@size %% coded inline +% %\def\subst@size{% + \ifx \external@font\@empty + \ifx \best@size\@empty + \else + \ifdim \@tempdimb>\font@submax \relax + \xdef \font@submax {\the\@tempdimb}% + \fi + \let \f@user@size \f@size + \let \f@size \best@size + \ifdim \@tempdimb>\fontsubfuzz\relax + \@font@warning{Font\space shape\space + `\curr@fontshape'\space in\space size\space + <\f@user@size>\space not\space available\MessageBreak + size\space <\f@size>\space substituted}% + \fi + \try@simple@size + \do@subst@correction + \fi + \fi +% %} +% \end{macrocode} +% \end{macro} +% +% This brings us back into the main part of |\tryif@simple|. +% Finally we get rid of any rubbish left over on the input stack. +% +% \changes{v3.0c}{1995/08/24}{} +% \begin{macrocode} + \let \reserved@f \remove@to@nnil + \fi + \fi +% \end{macrocode} +% If it's a range iterate also. +% \begin{macrocode} + \reserved@f} +% +% \end{macrocode} +% \end{macro} +% +% +% +% \subsection{Sizefunctions} +% +% In the following we define some useful size functions. +% +% +% \begin{macro}{\s@fct@} +% This is the default size function. Mandatory argument is an +% external font name, optinal argument a scale factor. +% The font is scaled +% to |\f@size| if no optional argument is present, and to +% |\f@size| multiplied by the optional argument otherwise. +% \changes{v2.0b}{1992/07/26}{} +% \begin{macrocode} +%<*2ekernel|autoload> +\DeclareSizeFunction{}{\empty@sfcnt\@font@warning} +\DeclareSizeFunction{s}{\empty@sfcnt\@font@info} +% +% \end{macrocode} +% +% \begin{macrocode} +%<*2ekernel|def2|autoload> +\def\empty@sfcnt#1{% + \@tempdimb \f@size\p@ + \ifx\optional@arg\@empty + \else + \@tempdimb \optional@arg\@tempdimb + #1{Font\space shape\space `\curr@fontshape'\space + will\space be\MessageBreak + scaled\space to\space size\space \the\@tempdimb}% + \fi + \edef\external@font{\mandatory@arg\space at\the\@tempdimb}} +% +% \end{macrocode} +% \end{macro} +% +% +% +% \begin{macro}{\s@fct@gen} +% \begin{macro}{\s@fct@sgen} +% This size function generates the external name from the mandatory +% argument and the requested user size, and thus can be used for +% external names where the size is encoded in the font name. The +% optinal argument a scale factor. The font is scaled to |\f@size| +% if no optional argument is present, and to |\f@size| multiplied +% by the optional argument otherwise. +% \begin{macrocode} +%<*2ekernel|autoload> +\DeclareSizeFunction{gen}{\gen@sfcnt\@font@warning} +\DeclareSizeFunction{sgen}{\gen@sfcnt\@font@info} +% +% \end{macrocode} +% +% \begin{macrocode} +%<*2ekernel|def2|autoload> +\def\gen@sfcnt{% + \edef\mandatory@arg{\mandatory@arg\f@size}% + \empty@sfcnt} +% +% \end{macrocode} +% \end{macro} +% \end{macro} +% +% +% +% \begin{macro}{\s@fct@genb} +% \begin{macro}{\s@fct@sgenb} +% This size function is similar to |gen|, but for fonts where the +% size is encoded in the font name in centipoints, as in the DC +% fonts version 1.2. The font is scaled to |\f@size| +% if no optional argument is present, and to |\f@size| multiplied +% by the optional argument otherwise. +% \begin{macrocode} +%<*2ekernel|autoload> +\DeclareSizeFunction{genb}{\genb@sfcnt\@font@warning} +\DeclareSizeFunction{sgenb}{\genb@sfcnt\@font@info} +% +% \end{macrocode} +% +% \begin{macrocode} +%<*2ekernel|def2|autoload> +\def\genb@sfcnt{% + \edef\mandatory@arg{\mandatory@arg\expandafter\genb@x\f@size..\@@}% + \empty@sfcnt} +% +% \end{macrocode} +% \end{macro} +% \end{macro} +% +% +% \begin{macro}{\genb@x} +% \begin{macro}{\genb@y} +% The auxiliary macros |\genb@x| and |\genb@y| are used to convert +% the |\f@size| into centipoints. +% \begin{macrocode} +%<*2ekernel|def2|autoload> +\def\genb@x#1.#2.#3\@@{\two@digits{#1}\genb@y#200\@@} +\def\genb@y#1#2#3\@@{#1#2} +% +% \end{macrocode} +% \end{macro} +% \end{macro} +% +% +% +% \begin{macro}{\s@fct@sub} +% This size function handles font substitution. +% The mandatory argument is a family/series/shape combination, +% the optional argument (if present) is ignored. The font encoding +% scheme cannot be changed. Therefore, the first thing we do is to +% prepend the encoding scheme. +% \changes{v2.0b}{1992/07/26}{} +% \begin{macrocode} +%<*2ekernel|autoload> +\DeclareSizeFunction{sub}{\sub@sfcnt\@font@warning} +\DeclareSizeFunction{ssub}{\sub@sfcnt\@font@info} +% +% \end{macrocode} +% +% \begin{macrocode} +%<*2ekernel|def2|autoload> +\def\sub@sfcnt#1{% + \edef\mandatory@arg{\f@encoding/\mandatory@arg}% +% \end{macrocode} +% Next action is split the arg into its individual components and +% allow for a late font shape load. +% \begin{macrocode} + \begingroup + \expandafter\split@name\mandatory@arg/\@nil + \try@load@fontshape + \endgroup +% \end{macrocode} +% Then we record the current |\f@size| since it may get clobbered. +% \begin{macrocode} + \let\f@user@size\f@size +% \end{macrocode} +% Then we check whether this new combination is defined and +% give an error message if not. In this case we also switch to +% |\error@fontshape|. +% \begin{macrocode} + \expandafter + \ifx\csname\mandatory@arg\endcsname\relax + \errmessage{No\space declaration\space for\space + shape\space \mandatory@arg}% + \error@fontshape + \else +% \end{macrocode} +% Otherwise we warn the user about the substitution taking place. +% \begin{macrocode} + #1{Font\space shape\space `\curr@fontshape'\space in\space + size\space <\f@size>\space not\space available\MessageBreak + Font\space shape\space `\mandatory@arg'\space tried\space + instead}% + \expandafter\split@name\mandatory@arg/\@nil + \fi +% \end{macrocode} +% Then we restart the font specification scan by calling +% |\get@external@font|. +% \begin{macrocode} + \edef\f@size{\f@user@size}% + \get@external@font +% \end{macrocode} +% Finally |\do@subst@correction| is called to get the font name +% right. +% \begin{macrocode} + \do@subst@correction +} +% +% \end{macrocode} +% \end{macro} +% +% +% \begin{macro}{\s@fct@subf} +% The |subf| size function allows substitution of another font. The +% mandatory argument is the external name of the font to be +% substituted, the optional argument a size scaling factor like +% in the default size function. +% The main difference to the default size function is the warning +% message. +% \begin{macrocode} +%<*2ekernel|autoload> +\DeclareSizeFunction{subf}{\subf@sfcnt\@font@warning} +\DeclareSizeFunction{ssubf}{\subf@sfcnt\@font@info} +% +% \end{macrocode} +% +% \begin{macrocode} +%<*2ekernel|def2|autoload> +\def\subf@sfcnt#1{% + #1{Font\space shape\space `\curr@fontshape'\space in\space + size\space \f@size\space not\space available\MessageBreak + external\space font\space `\mandatory@arg'\space used}% + \empty@sfcnt#1% + } +% +% \end{macrocode} +% \end{macro} +% +% +% \begin{macro}{\s@fct@fixed} +% The |fixed| size function is for using a font at a different size +% than requested. A warning message is printed, and the external +% font to be used is taken from the mandatory argument. +% If an optional argument is present it is used as the `at' +% size for the font. Otherwise the font is loaded at its design size. +% \begin{macrocode} +%<*2ekernel|autoload> +\DeclareSizeFunction{fixed}{\fixed@sfcnt\@font@warning} +\DeclareSizeFunction{sfixed}{\fixed@sfcnt\@font@info} +% +% \end{macrocode} +% +% \begin{macrocode} +%<*2ekernel|def2|autoload> +\def\fixed@sfcnt#1{% + \ifx\optional@arg\@empty + \let\external@font\mandatory@arg + \else + \edef\external@font{\mandatory@arg\space at\optional@arg pt}% + \fi + #1{External\space font\space `\external@font'\space loaded\space + for\space size\MessageBreak + <\f@size>}% +} +% +% \end{macrocode} +% \end{macro} +% +% \iffalse +%<+checkmem>\CHECKMEM +% \fi +% +% +% \Finale diff --git a/Master/texmf-dist/source/latex/base/lthyphen.dtx b/Master/texmf-dist/source/latex/base/lthyphen.dtx new file mode 100644 index 00000000000..03849a56131 --- /dev/null +++ b/Master/texmf-dist/source/latex/base/lthyphen.dtx @@ -0,0 +1,158 @@ +% \iffalse meta-comment +% +% Copyright 1993 1994 1995 1996 1997 1998 1999 2000 2001 2002 2003 2004 +% The LaTeX3 Project and any individual authors listed elsewhere +% in this file. +% +% This file is part of the LaTeX base system. +% ------------------------------------------- +% +% It may be distributed and/or modified under the +% conditions of the LaTeX Project Public License, either version 1.3 +% of this license or (at your option) any later version. +% The latest version of this license is in +% http://www.latex-project.org/lppl.txt +% and version 1.3 or later is part of all distributions of LaTeX +% version 2003/12/01 or later. +% +% This file has the LPPL maintenance status "maintained". +% +% The list of all files belonging to the LaTeX base distribution is +% given in the file `manifest.txt'. See also `legal.txt' for additional +% information. +% +% The list of derived (unpacked) files belonging to the distribution +% and covered by LPPL is defined by the unpacking scripts (with +% extension .ins) which are part of the distribution. +% +% \fi +% \iffalse +%<*driver> +\ProvidesFile{lthyphen.dtx} +% +%\ProvidesFile{hyphen.ltx} +% \fi +% \ProvidesFile{lthyphen.dtx} + [1994/12/04 v1.0h LaTeX Kernel (hyphenation interface)] +% +% +% \CheckSum{13} +%% \CharacterTable +%% {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 +%% 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 +%% Digits \0\1\2\3\4\5\6\7\8\9 +%% Exclamation \! Double quote \" Hash (number) \# +%% Dollar \$ Percent \% Ampersand \& +%% Acute accent \' Left paren \( Right paren \) +%% Asterisk \* Plus \+ Comma \, +%% Minus \- Point \. Solidus \/ +%% Colon \: Semicolon \; Less than \< +%% Equals \= Greater than \> Question mark \? +%% Commercial at \@ Left bracket \[ Backslash \\ +%% Right bracket \] Circumflex \^ Underscore \_ +%% Grave accent \` Left brace \{ Vertical bar \| +%% Right brace \} Tilde \~} +% +%\iffalse This is a META comment +% +% File `lthyphen.dtx'. +% Copyright (C) 1994-94 LaTeX3 project, Frank Mittelbach and +% Rainer Sch\"opf, all rights reserved. +% +%\fi +% \GetFileInfo{lthyphen.dtx} +% \title{The \texttt{lthyphen.dtx} file\thanks +% {This file has version number \fileversion, dated \filedate.}\\ +% for use with \LaTeXe} +% \author{Frank Mittelbach, Chris Rowley \and Rainer Sch\"opf} +% +% \def\dst{{\normalfont\scshape docstrip}} +% \setcounter{StandardModuleDepth}{1} +% +% +% \maketitle +% +% This file contains the code for loading hyphenation patterns into +% \LaTeX. Most of this will end up in a file called +% \texttt{hyphen.ltx}. If you wish to customize your \LaTeX{} system +% in respect of hyphenation patterns, write a file +% \texttt{hyphen.cfg}. If this file exists, it will be loaded instead +% of \texttt{hyphen.ltx}. See the comments below for additional +% information. +% +% \StopEventually{} +% +% To produce the printed version of this file the following code +% is used. It can be extracted with the \dst{} program, or one can run +% this file directly through \LaTeXe{}. +% \begin{macrocode} +%<*driver> +\documentclass{ltxdoc} +\begin{document} +\DocInput{lthyphen.dtx} +\end{document} +% +% \end{macrocode} +% +% \changes{v0.1c}{1994/03/07}{move the 2ekernel code to ltfinal.dtx} +% \changes{v1.0g}{1994/12/01}{Rename lthyphen.ltx/cfg to hyphen.ltx/cfg} +% \changes{v1.0h}{1994/12/04}{Documentation edits for /1989} +% +% The default file |hyphen.ltx| loads hyphenation patterns for US +% english. If you want to load additional or other hyphenation +% patterns, you should create a file |hyphen.cfg|. This is best done +% by starting from |hyphen.ltx|. +% +% For backward compatibility, the default file, |hyphen.ltx|, +% first tries to load +% the file |hyphen.tex|. If this file exists, an information +% message is issued and the appropriate defaults for \TeX's internal +% parameters are set: |\language| is initialized to $0$, and +% |\lefthyphenmin| and |\righthyphenmin| to $2$ and $3$, respectively, +% to disallow x- or -xx breaks. +% \begin{macrocode} +%<*default> +\InputIfFileExists{hyphen.tex}% + {\message{Loading hyphenation patterns for US english.}% + \language=0 + \lefthyphenmin=2 \righthyphenmin=3 }% +% \end{macrocode} +% Otherwise, since we cannot do anything without any hyphenation +% patterns, an error message is printed and the Ini\TeX{} run +% is terminated by invoking |\@@end| (which is the \LaTeXe{} name +% for \TeX's |\end| primitive). +% \begin{macrocode} + {\errhelp{The configuration for hyphenation is incorrectly + installed.^^J% + If you don't understand this error message you need + to seek^^Jexpert advice.}% + \errmessage{OOPS! I can't find any hyphenation patterns for + US english.^^J \space Think of getting some or the + latex2e setup will never succeed}\@@end} +% +% \end{macrocode} +% The following example describes the possible contents of a file +% |hyphen.cfg| that will load both US English and German hyphenation +% patterns, making the former the default. +% It sets |\language| to $0$ for the US patterns and to $1$ for the +% German patterns. +% Then |\language| is set to $0$ to make this the default and the +% default values of |\lefthyphenmin| and |\righthyphenmin| are set. +% \begin{verbatim} +%\language=0 +%\input hyphen % (or \input ushyphen1 if the file has been renamed) +%\language=1 +%\input ghyph31 +%\language=0 +%\lefthyphenmin=2 +%\righthyphenmin=3 +%\endinput +%\end{verbatim} +% +% Another possibility is to use the package |babel|, by Johannes Braams. +% That package is distributed with a suitable |hyphen.cfg| file. +% +% +% \Finale +% +\endinput diff --git a/Master/texmf-dist/source/latex/base/ltidxglo.dtx b/Master/texmf-dist/source/latex/base/ltidxglo.dtx new file mode 100644 index 00000000000..7a630b77e97 --- /dev/null +++ b/Master/texmf-dist/source/latex/base/ltidxglo.dtx @@ -0,0 +1,217 @@ +% \iffalse meta-comment +% +% Copyright 1993 1994 1995 1996 1997 1998 1999 2000 2001 2002 2003 2004 +% The LaTeX3 Project and any individual authors listed elsewhere +% in this file. +% +% This file is part of the LaTeX base system. +% ------------------------------------------- +% +% It may be distributed and/or modified under the +% conditions of the LaTeX Project Public License, either version 1.3 +% of this license or (at your option) any later version. +% The latest version of this license is in +% http://www.latex-project.org/lppl.txt +% and version 1.3 or later is part of all distributions of LaTeX +% version 2003/12/01 or later. +% +% This file has the LPPL maintenance status "maintained". +% +% The list of all files belonging to the LaTeX base distribution is +% given in the file `manifest.txt'. See also `legal.txt' for additional +% information. +% +% The list of derived (unpacked) files belonging to the distribution +% and covered by LPPL is defined by the unpacking scripts (with +% extension .ins) which are part of the distribution. +% +% \fi +% \iffalse +%%% From File: ltidxglo.dtx +% +%<*driver> +% \fi +\ProvidesFile{ltidxglo.dtx} + [1996/01/20 v1.1e LaTeX Kernel (Index and Glossary)] +% \iffalse +\documentclass{ltxdoc} +\GetFileInfo{ltidxglo.dtx} +\title{\filename} +\date{\filedate} + \author{% + Johannes Braams\and + David Carlisle\and + Alan Jeffrey\and + Leslie Lamport\and + Frank Mittelbach\and + Chris Rowley\and + Rainer Sch\"opf} + +\begin{document} +\maketitle + \DocInput{\filename} +\end{document} +% +% \fi +% +% \CheckSum{77} +% +% \section{Index and Glossary Generation} +% Index and Glossary commands. +% +% \DescribeMacro{\makeindex} A preamble command to turn on indexing. +% +% \DescribeMacro{\makeglossary} A preamble command to turn on making +% glossary entries. +% +% \DescribeMacro{\index} Make an index entry for |#1|. +% +% \DescribeMacro{\glossary} Make a glossary entry for |#1|. +% +% \StopEventually{} +% +% +% \changes{v1.0a}{1994/03/31}{Initial version of ltidxbib.dtx, +% split from ltherest.dtx} +% \changes{v1.1a}{1994/05/19}{Initial version of ltidxglo.dtx, +% split from ltidxbib.dtx} +% \changes{v1.1d}{1995/10/25}{Doc cleanup} +% +% +% \begin{oldcomments} +% \makeindex == +% BEGIN +% \index == BEGIN \@bsphack +% \begingroup +% \protect{X} == \string X\space +% %% added 3 Feb 87 for \index commands +% %% in \footnotes +% re-\catcode special characters +% to 'other' +% \@wrindex +% END +% +% \@wrindex{ITEM} == +% BEGIN +% write of {\indexentry{ITEM}{page number}} +% \endgroup +% \@esphack +% END +% +% INITIALIZATION: +% +% \index == BEGIN \@bsphack +% \begingroup +% re-\catcode special characters (in case '%' there) +% \@index +% END +% +% \@index{ITEM} == BEGIN \endgroup \@esphack END +% +% Changes made 14 Apr 89 to write \glossaryentry's instead of +% \indexentry's on the .glo file. +% \end{oldcomments} +% +% \begin{macrocode} +%<*2ekernel> +\message{index,} +% \end{macrocode} +% +% \changes{v1.1b}{1994/11/04}{Removed \cs{if@filesw} from +% \cs{makeindex}.} +% +% \begin{macro}{\makeindex} +% \begin{macrocode} +\def\makeindex{% + \newwrite\@indexfile + \immediate\openout\@indexfile=\jobname.idx + \def\index{\@bsphack\begingroup + \@sanitize + \@wrindex}\typeout + {Writing index file \jobname.idx}% +% \end{macrocode} +% \changes{v1.1e}{1996/01/20}{Make no-op after use pr/2048} +% Opening the write channel should be done only once +% since on some OS multiple opens are forbidden and in +% any case it is useless. So we turn this into a no-op after +% use. +% \begin{macrocode} + \let\makeindex\@empty +} +\@onlypreamble\makeindex +% \end{macrocode} +% \end{macro} +% +% \begin{macro}{\@wrindex} +% \changes{v1.1b}{1994/11/04}{Added \cs{protected@write} to +% \cs{@wrindex}.} +% \begin{macrocode} +\def\@wrindex#1{% + \protected@write\@indexfile{}% + {\string\indexentry{#1}{\thepage}}% + \endgroup + \@esphack} +% \end{macrocode} +% \end{macro} +% +% \begin{macro}{\index} +% \begin{macrocode} +\def\index{\@bsphack\begingroup \@sanitize\@index} +% \end{macrocode} +% \end{macro} +% +% \begin{macro}{\@index} +% \begin{macrocode} +\def\@index#1{\endgroup\@esphack} +% \end{macrocode} +% \end{macro} +% +% \begin{macro}{\makeglossary} +% \changes{v1.1b}{1994/11/04}{Removed \cs{if@filesw} from +% \cs{makeglossary}.} +% \begin{macrocode} +\def\makeglossary{% + \newwrite\@glossaryfile + \immediate\openout\@glossaryfile=\jobname.glo + \def\glossary{\@bsphack\begingroup + \@sanitize + \@wrglossary}\typeout + {Writing glossary file \jobname.glo }% +% \end{macrocode} +% \changes{v1.1e}{1996/01/20}{Make no-op after use pr/2048} +% Opening the write channel should be done only once +% since on some OS multiple opens are forbidden and in +% any case it is useless. So we turn this into a no-op after +% use. +% \begin{macrocode} + \let\makeglossary\@empty +} +\@onlypreamble\makeglossary +% \end{macrocode} +% \end{macro} +% +% \begin{macro}{\@wrglossary} +% \changes{v1.1b}{1994/11/04}{Added \cs{protected@write} to +% \cs{@wrglossary}.} +% \begin{macrocode} +\def\@wrglossary#1{% + \protected@write\@glossaryfile{}% + {\string\glossaryentry{#1}{\thepage}}% + \endgroup + \@esphack} +% \end{macrocode} +% \end{macro} +% +% \begin{macro}{\glossary} +% \begin{macrocode} +\def\glossary{\@bsphack\begingroup\@sanitize\@index} +% \end{macrocode} +% \end{macro} +% +% \begin{macrocode} +% +% \end{macrocode} +% +% +% \Finale +% diff --git a/Master/texmf-dist/source/latex/base/ltlength.dtx b/Master/texmf-dist/source/latex/base/ltlength.dtx new file mode 100644 index 00000000000..e48ebfeedd6 --- /dev/null +++ b/Master/texmf-dist/source/latex/base/ltlength.dtx @@ -0,0 +1,152 @@ +% \iffalse meta-comment +% +% Copyright 1993 1994 1995 1996 1997 1998 1999 2000 2001 2002 2003 2004 +% The LaTeX3 Project and any individual authors listed elsewhere +% in this file. +% +% This file is part of the LaTeX base system. +% ------------------------------------------- +% +% It may be distributed and/or modified under the +% conditions of the LaTeX Project Public License, either version 1.3 +% of this license or (at your option) any later version. +% The latest version of this license is in +% http://www.latex-project.org/lppl.txt +% and version 1.3 or later is part of all distributions of LaTeX +% version 2003/12/01 or later. +% +% This file has the LPPL maintenance status "maintained". +% +% The list of all files belonging to the LaTeX base distribution is +% given in the file `manifest.txt'. See also `legal.txt' for additional +% information. +% +% The list of derived (unpacked) files belonging to the distribution +% and covered by LPPL is defined by the unpacking scripts (with +% extension .ins) which are part of the distribution. +% +% \fi +% +% \iffalse +%%% From File: ltlength.dtx +% +%<*driver> +% \fi +\ProvidesFile{ltlength.dtx} + [1995/08/11 v1.1b LaTeX Kernel (Lengths)] +% \iffalse +\documentclass{ltxdoc} +\GetFileInfo{ltlength.dtx} +\title{\filename} +\date{\filedate} + \author{% + Johannes Braams\and + David Carlisle\and + Alan Jeffrey\and + Leslie Lamport\and + Frank Mittelbach\and + Chris Rowley\and + Rainer Sch\"opf} + +\begin{document} +\maketitle + \DocInput{\filename} +\end{document} +% +% \fi +% +% \CheckSum{40} +% +% \changes{v1.0c}{1994/03/29} +% {Create file ltcntlen from parts of ltmiscen and ltherest.} +% \changes{v1.1a}{1994/05/19} +% {Extract file ltlength from ltcntlen.} +% \changes{v1.1b}{1995/08/11} +% {Doc typos fixed for latex/753} +% +% \section{Lengths} +% +% \DescribeMacro{\newlength} +% Declare |#1| to be a new length command. +% +% \DescribeMacro{\setlength} +% Set the length command, |#1|, to the value |#2|. +% +% \DescribeMacro{\addtolength} +% Increase the value of the length command, |#1|, by the value |#2|. +% +% \DescribeMacro{\settowidth} +% Set the length, |#1| to the width of a box containing |#2|. +% +% \DescribeMacro{\settoheight} +% Set the length, |#1| to the height of a box containing |#2|. +% +% \DescribeMacro{\settodepth} +% Set the length, |#1| to the depth of a box containing |#2|. +% +% \StopEventually{} +% +% \begin{macrocode} +%<*2ekernel> +\message{lengths,} +% \end{macrocode} +% +% \begin{macro}{\newlength} +% \begin{macrocode} +\def\newlength#1{\@ifdefinable#1{\newskip#1}} +% \end{macrocode} +% \end{macro} +% +% \begin{macro}{\setlength} +% \begin{macrocode} +\def\setlength#1#2{#1#2\relax} +% \end{macrocode} +% \end{macro} +% +% \begin{macro}{\addtolength} +% |\relax| added 24 Mar 86 +% \begin{macrocode} +\def\addtolength#1#2{\advance#1 #2\relax} +% \end{macrocode} +% \end{macro} +% +% +% \begin{macro}{\settoheight} +% \changes{LaTeX2e}{1993/11/22}{Macro added} +% \begin{macro}{\settodepth} +% \changes{LaTeX2e}{1993/11/22}{Macro added} +% \begin{macro}{\settowidth} +% \begin{macro}{\@settodim} +% \changes{LaTeX2e}{1993/11/22}{Macro added} +% \changes{v1.0a}{1994/03/07}{(DPC) Extra group for colour} +% The obvious analogs of |\settowidth|. +% \begin{macrocode} +\def\@settodim#1#2#3{\setbox\@tempboxa\hbox{{#3}}#2#1\@tempboxa +% \end{macrocode} +% Clear the memory afterwards (which might be a lot). +% \begin{macrocode} + \setbox\@tempboxa\box\voidb@x} +\def\settoheight{\@settodim\ht} +\def\settodepth {\@settodim\dp} +\def\settowidth {\@settodim\wd} +% \end{macrocode} +% \end{macro} +% \end{macro} +% \end{macro} +% \end{macro} +% +% +% \begin{macro}{\@settopoint} +% This macro takes the contents of the skip register that is +% supplied as its argument and removes the fractional part to make +% it a whole number of points. This can be used in class files to +% avoid values like |345.4666666pt| when calulating a dimension. +% \changes{LaTeX2e}{1993/11/22}{Macro added} +% \begin{macrocode} +\def\@settopoint#1{\divide#1\p@\multiply#1\p@} +% +% \end{macrocode} +% \end{macro} +% +% \Finale +% diff --git a/Master/texmf-dist/source/latex/base/ltlists.dtx b/Master/texmf-dist/source/latex/base/ltlists.dtx new file mode 100644 index 00000000000..6a4a91d7271 --- /dev/null +++ b/Master/texmf-dist/source/latex/base/ltlists.dtx @@ -0,0 +1,1075 @@ +% \iffalse meta-comment +% +% Copyright 1993 1994 1995 1996 1997 1998 1999 2000 2001 2002 2003 2004 +% The LaTeX3 Project and any individual authors listed elsewhere +% in this file. +% +% This file is part of the LaTeX base system. +% ------------------------------------------- +% +% It may be distributed and/or modified under the +% conditions of the LaTeX Project Public License, either version 1.3 +% of this license or (at your option) any later version. +% The latest version of this license is in +% http://www.latex-project.org/lppl.txt +% and version 1.3 or later is part of all distributions of LaTeX +% version 2003/12/01 or later. +% +% This file has the LPPL maintenance status "maintained". +% +% The list of all files belonging to the LaTeX base distribution is +% given in the file `manifest.txt'. See also `legal.txt' for additional +% information. +% +% The list of derived (unpacked) files belonging to the distribution +% and covered by LPPL is defined by the unpacking scripts (with +% extension .ins) which are part of the distribution. +% +% \fi +% \iffalse +%%% From File: ltlists.dtx +%<*driver> +% \fi +\ProvidesFile{ltlists.dtx} + [2002/10/28 v1.0s LaTeX Kernel (List Environments)] +% \iffalse +\documentclass{ltxdoc} +\GetFileInfo{ltlists.dtx} +\title{\filename} +\date{\filedate} + \author{% + Johannes Braams\and + David Carlisle\and + Alan Jeffrey\and + Leslie Lamport\and + Frank Mittelbach\and + Tobias Oetiker\thanks{Tobi has converted the documentation to + doc.sty standard}\and + Chris Rowley\and + Rainer Sch\"opf} + +\begin{document} +\maketitle + \DocInput{\filename} +\end{document} +% +% \fi +% +% \CheckSum{498} +% +% \changes{v1.0b}{1994/03/28}{Improve documentation} +% \changes{v1.0f}{1994/05/21}{Use new error commands} +% \changes{v1.0f}{1995/05/21}{Moved to doc.sty standard} +% +% \section{List, and related environments} +% +% The generic commands for creating an indented environment -- +% |enumerate|, |itemize|, |quote|, etc -- are: +% \begin{quote} +% |\list|\marg{LABEL}\marg{COMMANDS} ... |\endlist| +% \end{quote} +% +% which can be invoked by the user as the list environment. The LABEL +% argument specifies item labeling. COMMANDS contains commands for +% changing the horizontal and vertical spacing parameters. +% +% Each item of the environment is begun by the command +% |\item[|ITEMLABEL|]| +% which produces an item labeled by ITEMLABEL. If the argument is +% missing, then the LABEL argument of the |\list| command is used as the +% item label. +% +% The label is formed by putting |\makelabel|\marg{ITEMLABEL} in an hbox +% whose width is either its natural width or else |\labelwidth|, +% whichever is larger. The |\list| command defines |\makelabel| to have +% the default definition: +% \begin{quote} +% |\makelabel|\marg{ARG} == BEGIN |\hfil| ARG END +% \end{quote} +% which, for a label of width less than |\labelwidth|, puts the label +% flushright, |\labelsep| to the left of the item's text. However, +% |\makelabel| can be |\let| to another command by the |\list|'s +% COMMANDS argument. +% +% A |\usecounter|\marg{foo} command in the second argument causes the +% counter \emph{foo} to be initialized to zero, and stepped by every +% |\item| command without an argument. (|\label| commands within the +% list refer to this counter.) +% +% When you leave a list environment, returning either to an enclosing +% list or normal text mode, LaTeX begins a new paragraph if and only if +% you leave a blank line after the |\end| command. This is accomplished +% by the |\@endparenv| command. +% +% Blank lines are ignored every other reasonable place--i.e.: +% \begin{itemize} +% \item Between the |\begin{list}| and the first |\item|, +% \item Between the |\item| and the text of that item. +% \item Between the end of the last item and the |\end{list}|. +% \end{itemize} +% +% For an environment like quotation, in which items are not labeled, +% the entire environment is a single item. It is defined by +% letting |\quotation| == |\list{}{...}\item\relax|. (Note the +% |\relax|, there in case the first character in the environment is a +% '['.) The spacing parameters provide a great deal of flexability in +% designing the format, including the ability to let the indentation of +% the first paragraph be different from that of the subsequent ones. +% +% The trivlist environment is equivalent to a list environment +% whose second argument sets the following parameter values: +% \begin{description} +% \item[\cs{leftmargin} = 0:] causes no indentation of left margin +% \item[\cs{labelwidth} = 0:] see below for precise effect this has. +% \item[\cs{itemindent} = 0:] with a null label, makes first paragraph +% have no indentation. Succeeding paragraphs have |\parindent| +% indentation. To give first paragraph same indentation, set +% |\itemindent| = |\parindent| before the |\item[]|. +% \end{description} +% +% Every |\item| in a trivlist environment must have an argument---in +% many cases, this will be the null argument (|\item[]|). The trivlist +% environment is mainly used for paragraphing environments, like +% verbatim, in which there is no margin change. It provides the same +% vertical spacing as the list environment, and works reasonably well +% when it occurs immediately after an |\item| command in an enclosing +% list. +% +% \StopEventually{} +% +% +% \changes{v1.0a}{1994/03/07}{Initial version, split from latex.dtx} +% \changes{v1.0a}{1994/03/07}{Long lines wrapped to 72 columns} +% +% +% \subsection{List and Trivlist} +% +% +% The following variables are used inside a list environment: +% \begin{description} +% \item[\cs{@totalleftmargin}] The distance that the prevailing left +% margin is indented from the outermost left margin, +% \item[\cs{linewidth}] The width of the current line. Must be +% initialized to |\hsize|. +% \item[\cs{@listdepth}] A count for holding current list nesting depth. +% \item[\cs{makelabel}] A macro with a single argument, used to +% generate the label from the argument (given or implied) +% of the |\item| command. Initialized to |\@mklab| by the |\list| +% command. This command must produce some stretch---i.e., an +% |\hfil|. +% \item[\cs{@inlabel}] A switch that is false except between the time +% an |\item| is encountered and the time that \TeX{} +% actually enters horizontal mode. Should be tested by commands +% that can be messed up by the list environment's use of |\everypar|. +% \item[\cs{box\@labels}] When |@inlabel = true|, it holds the labels +% to be put out by |\everypar|. +% \item[\texttt{@noparitem}] A switch set by |\list| when +% |@inlabel = true|. +% Handles the case of a |\list| being the first thing in an item. +% \item[\texttt{@noparlist}] A switch set true for a list that begins an +% item. No |\topsep| space is added before or after |\item|'s such a +% list. +% \item[\texttt{@newlist}] Set true by |\list|, set false by the first +% text (by |\everypar|). +% \item[\texttt{@noitemarg}] Set true when executing an |\item| with no +% explicit argument. Used to save space. To save time, make two +% separate |\@item| commands. +% \item[\texttt{@nmbrlist}] Set true by |\usecounter| command, causes +% list to be numbered. +% \item[\cs{@listctr}] |\def|'ed by |\usecounter| to name of counter. +% \item[\cs{@noskipsec}] A switch set true by a sectioning command when +% it is creating an in-text heading with |\everypar|. +% \end{description} +% +% Throughout a list environment, |\hsize| is the width of the current +% line, measured from the outermost left margin to the outermost right +% margin. Environments like tabbing should use |\linewidth| instead of +% |\hsize|. +% +% Here are the parameters of a list that can be set by commands in +% the |\list|'s COMMANDS argument. These parameters are all TeX +% skips or dimensions (defined by |\newskip| or |\newdimen|), so the +% usual \TeX\ or \LaTeX\ commands can be used to set them. The +% commands will be executed in vmode if and only if the |\list| was +% preceded by a |\par| (or something like an |\end{list}|), so the +% spacing parameters can be set according to whether the list is +% inside a paragraph or is its own paragraph. +% +% +% \subsection{Vertical Spacing (skips)} +% \begin{description} +% \item[\cs{topsep}:] Space between first item and preceding paragraph. +% \item[\cs{partopsep}:] Extra space added to \cs{topsep} when +% environment starts a new paragraph (is called in vmode). +% \item[\cs{itemsep}:] Space between successive items. +% \item[\cs{parsep}:] Space between paragraphs within an item -- the +% \cs{parskip} for this environment. +% \end{description} +% +% \subsection{Penalties} +% \begin{description} +% +% \item[\cs{@beginparpenalty}:] put at the beginning of a list +% \item[\cs{@endparpenalty}:] put at end of list +% \item[\cs{@itempenalty}:] put between items. +% \end{description} +% +% \subsection{Horizontal Spacing (dimens)} +% \begin{description} +% \item[\cs{leftmargin}:] space between left margin of enclosing +% environment (or of page if top level list) and left margin of +% this list. Must be nonnegative. +% \item[\cs{rightmargin}:] analogous. +% \item[\cs{listparindent}:] extra indentation at beginning of every +% paragraph of a list except the one started by the \cs{item} +% command. May be negative! Usually, labeled +% lists have \cs{listparindent} equal to zero. +% \item[\cs{itemindent}:] extra indentation added right BEFORE an item +% label. +% \item[\cs{labelwidth}:] nominal width of box that contains the label. +% If the natural width of the +% label $< =$ \cs{labelwidth}, +% then the label is flushed right inside a box +% of width \cs{labelwidth} (with an \cs{hfil}). +% Otherwise, +% a box of the natural width is employed, which +% causes an indentation of the text on that line. +% \item[\cs{labelsep}:] space between end of label box and text of +% first item. +% \end{description} +% \subsection{Default Values} +% Defaults for the list environment are set as follows. +% First, \cs{rightmargin}, \cs{listparindent} and \cs{itemindent} +% are set +% to 0pt. Then, one of the commands +% \cs{@listi}, \cs{@listii}, ... , \cs{@listvi} +% is called, depending upon the current level of the list. +% The \cs{@list} \ldots commands should be defined by the document +% style. A convention that the document style should follow is +% to set \cs{leftmargin} to +% \cs{leftmargini},\ldots, \cs{leftmarginvi} for +% the appropriate level. Items that aren't changed may be left +% alone, but everything that could possibly be changed must be +% reset. +% \begin{oldcomments} +% \list{LABEL}{COMMANDS} == +% BEGIN +% if \@listdepth > 5 +% then LaTeX error: 'Too deeply nested' +% else \@listdepth :=G \@listdepth + 1 +% fi +% \rightmargin := 0pt +% \listparindent := 0pt +% \itemindent := 0pt +% \eval(@list \romannumeral\the\@listdepth) %% Set default values: +% \@itemlabel :=L LABEL +% \makelabel == \@mklab +% @nmbrlist :=L false +% COMMANDS +% +% \@trivlist % commands common to \list and \trivlist +% +% \parskip :=L \parsep +% \parindent :=L \listparindent +% \linewidth :=L \linewidth - \rightmargin -\leftmargin +% \@totalleftmargin :=L \@totalleftmargin + \leftmargin +% \parshape 1 \@totalleftmargin \linewidth +% \ignorespaces % gobble space up to \item +% END +% +% \endlist == BEGIN \@listdepth :=G \@listdepth -1 +% \endtrivlist +% END +% +% \@trivlist == +% BEGIN +% if @newlist = T then \@noitemerr fi +% %% This command removed for some forgotten reason. +% \@topsepadd :=L \topsep +% if @noskipsec then leave vertical mode fi %% Added 11 Jun 85 +% if vertical mode +% then \@topsepadd :=L \@topsepadd + \partopsep +% else \unskip \par % remove glue from end of last line +% fi +% if @inlabel = true +% then @noparitem :=L true +% @noparlist :=L true +% else @noparlist :=L false +% \@topsep :=L \@topsepadd +% fi +% \@topsep :=L \@topsep + \parskip %% Change 4 Sep 85 +% \leftskip :=L 0pt % Restore paragraphing parameters +% \rightskip :=L \@rightskip +% \parfillskip :=L 0pt + 1fil +% +% NOTE: \@setpar called on every \list in case \par has been +% temporarily munged before the \list command. +% \@setpar{if @newlist = false then {\@@par} fi} +% \@newlist :=G T +% \@outerparskip :=L \parskip +% END +% +% \trivlist == +% BEGIN +% \parsep := \parskip +% @nmbrlist := F +% \@trivlist +% \labelwidth := 0 +% \leftmargin := 0 +% \itemindent := \parindent +% \@itemlabel :=L "empty" %% added 93/12/13 +% \makelabel{LABEL} == LABEL +% END +% +% \endtrivlist == +% BEGIN +% if @inlabel = T then \indent fi +% if horizontal mode then \unskip \par fi +% if @noparlist = true +% else if \lastskip > 0 +% then \@tempskipa := \lastskip +% \vskip - \lastskip +% \vskip \@tempskipa -\@outerparskip + \parskip +% fi +% \@endparenv +% fi +% END +% +% \@endparenv == +% BEGIN +% \addpenalty{@endparpenalty} +% \addvspace{\@topsepadd} +% \endgroup %% ends the \begin command's \begingroup +% \par == BEGIN +% \@restorepar +% \everypar{} +% \par +% END +% \everypar == BEGIN remove \lastbox \everypar{} END +% \begingroup %% to match the \end commands \endgroup +% END +% +% \item == BEGIN if math mode then WARNING fi +% if next char = [ +% then \@item +% else @noitemarg := true +% \@item[@itemlabel] +% END +% +% \@item[LAB] == +% BEGIN +% if @noparitem = true +% then @noparitem := false +% % NOTE: then clause hardly every taken, +% % so made a macro \@donoparitem +% \box\@labels :=G \hbox{\hskip -\leftmargin +% \box\@labels +% \hskip \leftmargin } +% if @minipage = false then +% \@tempskipa := \lastskip +% \vskip -\lastskip +% \vskip \@tempskipa + \@outerparskip - \parskip +% fi +% else if @inlabel = true +% then \indent \par % previous item empty. +% fi +% if hmode then 2 \unskip's +% % To remove any space at end of prev. +% % paragraph that could cause a blank line. +% \par +% fi +% if @newlist = T +% then if @nobreak = T % Kludge if list follows \section +% then \addvspace{\@outerparskip - \parskip} +% else \addpenalty{\@beginparpenalty} +% \addvspace{\@topsep} +% \addvspace{-\parskip} %% added 4 Sep 85 +% fi +% else \addpenalty{\@itempenalty} +% \addvspace{\itemsep} +% fi +% @inlabel :=G true +% fi +% +% \everypar{ @minipage :=G F +% @newlist :=G F +% if @inlabel = true +% then @inlabel :=G false +% \hskip -\parindent +% \box\@labels +% \penalty 0 +% %% 3 Oct 85 -- allow line break here +% \box\@labels :=G null +% fi +% \everypar{} } +% @nobreak :=G false +% if @noitemarg = true +% then @noitemarg := false +% if @nmbrlist +% then \refstepcounter{\@listctr} +% fi fi +% \@tempboxa :=L \hbox{\makelabel{LAB}} +% \box\@labels :=G \@labels \hskip \itemindent +% \hskip - (\labelwidth + \labelsep) +% if \wd \@tempboxa > \labelwidth +% then \box\@tempboxa +% else \hbox to \labelwidth {\unhbox\@tempboxa} +% fi +% \hskip\labelsep +% \ignorespaces %gobble space up to text +% END +% +% \makelabel{LABEL} == ERROR %% default to catch lonely \item +% +% +% \usecounter{CTR} == BEGIN @nmbrlist :=L true +% \@listctr == CTR +% \setcounter{CTR}{0} +% END +% +% DEFINE \dimen's and \count +% \end{oldcomments} +% \begin{macro}{\topskip} +% \begin{macro}{\partopsep} +% \begin{macro}{\itemsep} +% \begin{macro}{\parsep} +% \begin{macro}{\@topsep} +% \begin{macro}{\@topsepadd} +% \begin{macro}{\outerparskip} +% \begin{macrocode} +%<*2ekernel> +\newskip\topsep +\newskip\partopsep +\newskip\itemsep +\newskip\parsep +\newskip\@topsep +\newskip\@topsepadd +\newskip\@outerparskip +% \end{macrocode} +% \end{macro}\end{macro}\end{macro}\end{macro}\end{macro}\end{macro} +% \end{macro} +% \begin{macro}{\leftmargin}\begin{macro}{\rightmargin} +% \begin{macro}{\listparindent}\begin{macro}{\itemindent} +% \begin{macro}{\labelwidth}\begin{macro}{\labelsep} +% \begin{macro}{\@totalleftmargin} +% \begin{macrocode} +\newdimen\leftmargin +\newdimen\rightmargin +\newdimen\listparindent +\newdimen\itemindent +\newdimen\labelwidth +\newdimen\labelsep +\newdimen\linewidth +\newdimen\@totalleftmargin \@totalleftmargin=\z@ +% \end{macrocode} +% \end{macro}\end{macro}\end{macro}\end{macro}\end{macro} +% \end{macro}\end{macro} +% +% \begin{macro}{\leftmargini} +% \begin{macro}{\leftmarginii} +% \begin{macro}{\leftmarginiii} +% \begin{macro}{\leftmarginiv} +% \begin{macro}{\leftmarginv} +% \begin{macro}{\leftmarginvi} +% \begin{macrocode} +\newdimen\leftmargini +\newdimen\leftmarginii +\newdimen\leftmarginiii +\newdimen\leftmarginiv +\newdimen\leftmarginv +\newdimen\leftmarginvi +% \end{macrocode} +% \end{macro}\end{macro}\end{macro} +% \end{macro}\end{macro}\end{macro} +% +% \begin{macro}{\@listdepth}\begin{macro}{\@itempenalty} +% \begin{macro}{\@beginparpenalty}\begin{macro}{\@endparpenalty} +% \begin{macrocode} +\newcount\@listdepth \@listdepth=0 +\newcount\@itempenalty +\newcount\@beginparpenalty +\newcount\@endparpenalty +% \end{macrocode} +% \end{macro}\end{macro}\end{macro}\end{macro} +% +% \begin{macro}{\@labels} +% \begin{macrocode} +\newbox\@labels +% \end{macrocode} +% \end{macro} +% +% \begin{macro}{\if@inlabel} +% \begin{macro}{\@inlabelfalse} +% \begin{macro}{\@inlabeltrue} +% \begin{macrocode} +\newif\if@inlabel \@inlabelfalse +% \end{macrocode} +% \end{macro}\end{macro}\end{macro} +% +% \begin{macro}{\if@newlist} +% \begin{macro}{\@newlistfalse} +% \begin{macro}{\@newlisttrue} +% \begin{macrocode} +\newif\if@newlist \@newlistfalse +% \end{macrocode} +% \end{macro}\end{macro}\end{macro} +% +% \begin{macro}{\if@noparitem} +% \begin{macro}{\@noparitemfalse} +% \begin{macro}{\@noparitemtrue} +% \begin{macrocode} +\newif\if@noparitem \@noparitemfalse +% \end{macrocode} +% \end{macro}\end{macro}\end{macro} +% +% \begin{macro}{\if@noparlist} +% \begin{macro}{\@noparlistfalse} +% \begin{macro}{\@noparlisttrue} +% \begin{macrocode} +\newif\if@noparlist \@noparlistfalse +% \end{macrocode} +% \end{macro}\end{macro}\end{macro} +% +% \begin{macro}{\if@noitemarg} +% \begin{macro}{\@noitemargfalse} +% \begin{macro}{\@noitemargtrue} +% \begin{macrocode} +\newif\if@noitemarg \@noitemargfalse +% \end{macrocode} +% \end{macro}\end{macro}\end{macro} +% +% \begin{macro}{\if@newlist} +% \begin{macro}{\@newlistfalse} +% \begin{macro}{\@newlisttrue} +% \begin{macrocode} +\newif\if@nmbrlist \@nmbrlistfalse +% \end{macrocode} +% \end{macro}\end{macro}\end{macro} +% +% \begin{macro}{\list} +% \begin{macrocode} +\def\list#1#2{% + \ifnum \@listdepth >5\relax + \@toodeep + \else + \global\advance\@listdepth\@ne + \fi + \rightmargin\z@ + \listparindent\z@ + \itemindent\z@ + \csname @list\romannumeral\the\@listdepth\endcsname + \def\@itemlabel{#1}% + \let\makelabel\@mklab + \@nmbrlistfalse + #2\relax + \@trivlist + \parskip\parsep + \parindent\listparindent + \advance\linewidth -\rightmargin + \advance\linewidth -\leftmargin + \advance\@totalleftmargin \leftmargin + \parshape \@ne \@totalleftmargin \linewidth + \ignorespaces} +% \end{macrocode} +% \end{macro} +% +% \begin{macro}{\par@deathcycles} +% \begin{macrocode} +\newcount\par@deathcycles +% \end{macrocode} +% \end{macro} +% +% \begin{macro}{\@trivlist} +% \changes{v1.0e}{1994/12/02}{RmS: Added check for looping} +% \changes{v1.0p}{1996/10/31}{Added check for missing item in outer +% list} +% \changes{v1.0q}{1996/11/04}{Moved check for missing item: only checked +% when not inlabel flag is false} +% Because |\par| is sometimes made a no-op it is possible for a missing +% |\item| to produce a loop that does not fill memory and so never gets +% trapped by \TeX. We thus need to trap this here by seting |\par| to +% count the number of times a paragraph ii is called with no progress +% being made started. +% \begin{macrocode} +\def\@trivlist{% + \if@noskipsec \leavevmode \fi + \@topsepadd \topsep + \ifvmode + \advance\@topsepadd \partopsep + \else + \unskip \par + \fi + \if@inlabel + \@noparitemtrue + \@noparlisttrue + \else + \if@newlist \@noitemerr \fi + \@noparlistfalse + \@topsep \@topsepadd + \fi + \advance\@topsep \parskip + \leftskip \z@skip + \rightskip \@rightskip + \parfillskip \@flushglue + \par@deathcycles \z@ + \@setpar{\if@newlist + \advance\par@deathcycles \@ne + \ifnum \par@deathcycles >\@m + \@noitemerr + {\@@par}% + \fi + \else + {\@@par}% + \fi}% + \global \@newlisttrue + \@outerparskip \parskip} +% \end{macrocode} +% \end{macro} +% +% \changes{0.0}{1992/03/18}{RmS: added \cs{@nmbrlistfalse}} +% \begin{macro}{\trivlist} +% \begin{macrocode} +\def\trivlist{% + \parsep\parskip + \@nmbrlistfalse + \@trivlist + \labelwidth\z@ + \leftmargin\z@ + \itemindent\z@ +% \end{macrocode} +% +% We initialise |\@itemlabel| so that a \texttt{trivlist} with +% an |\item| not having an optional argument doesn't produce an +% error message. +% \changes{latex2e}{1993/12/13}{Initialised \cs{@itemlabel}} +% \begin{macrocode} + \let\@itemlabel\@empty + \def\makelabel##1{##1}} +% \end{macrocode} +% \end{macro} +% +% \begin{macro}{\endlist} +% \begin{macrocode} +\def\endlist{% + \global\advance\@listdepth\m@ne + \endtrivlist} +% \end{macrocode} +% \end{macro} +% +% The definition of \cs{trivlist} used to be in ltspace.dtx +% so that other commands could be `let to it'. +% They now use \cs{def}. +% \begin{macro}{\endtrivlist} +% \changes{v1.2b ltspace}{1994/11/12}{Changed order of tests to make +% \cs{@noitemerror} correct: end of an era.} +% \changes{v1.0i}{1995/05/25}{Macros moved from ltspace.dtx} +% \changes{v1.0n}{1996/10/25}{Change \cs{indent} to \cs{leavevmode}} +% \changes{v1.0n}{1996/10/25}{Reset flags explicitly} +% \changes{v1.0o}{1996/10/26}{Correct typo} +% \begin{macrocode} +\def\endtrivlist{% + \if@inlabel + \leavevmode + \global \@inlabelfalse + \fi + \if@newlist + \@noitemerr + \global \@newlistfalse + \fi + \ifhmode\unskip \par +% \end{macrocode} +% We also check if we are in math mode and issue an error message +% if so (hoping that |\@currenvir| resolves suitably). Otherwise +% the usual ``perhaps a missing item'' error will get triggered +% later which is confusing. +% \changes{v1.0s}{2002/10/28}{Check for math mode (pr/3437)} +% \begin{macrocode} + \else + \@inmatherr{\end{\@currenvir}}% + \fi + \if@noparlist \else + \ifdim\lastskip >\z@ + \@tempskipa\lastskip \vskip -\lastskip + \advance\@tempskipa\parskip \advance\@tempskipa -\@outerparskip + \vskip\@tempskipa + \fi + \@endparenv + \fi +} +% \end{macrocode} +% \end{macro} +% +% +% +% \begin{macro}{\@endparenv} +% \begin{macro}{\@doendpe} +% To suppress the paragraph indentation in text immediately following +% a paragraph-making environment, \cs{everypar} is changed to remove the +% space, and \cs{par} is redefined to restore \cs{everypar}. Instead of +% redefining \cs{par} and \cs{everpar}, \cs{@endparenv} was changed to +% set the @endpe switch, letting \cs{end} redefine \cs{par} and +% \cs{everypar}. +% +% This allows paragraph-making environments to work right when called +% by other environments. (Changed 27 Oct 86) +% \begin{macrocode} +\def\@endparenv{% + \addpenalty\@endparpenalty\addvspace\@topsepadd\@endpetrue} +% \end{macrocode} +% +% \begin{macrocode} +\def\@doendpe{\@endpetrue + \def\par{\@restorepar\everypar{}\par\@endpefalse}\everypar +% \end{macrocode} +% +% Use |\setbox0=\lastbox| instead of |\hskip -\parindent| +% so that a \cs{noindent} becomes a no-op when used before +% a line immediately following a list environment(23 Oct 86). +% \changes{v1.0k}{1995/11/07}{Enclosed \cs{setbox0} assignment by a +% group so that it leaves the contents of box $0$ intact.} +% \begin{macrocode} + {{\setbox\z@\lastbox}\everypar{}\@endpefalse}} +% \end{macrocode} +% \end{macro} +% \end{macro} +% +% +% \begin{macro}{\if@endpe} +% \begin{macro}{\@endpefalse} +% \begin{macro}{\@endpeltrue} +% \begin{macrocode} +\newif\if@endpe +\@endpefalse +% \end{macrocode} +% \end{macro}\end{macro}\end{macro} +% +% +% \begin{macro}{\@mklab} +% \begin{macrocode} +\def\@mklab#1{\hfil #1} +% \end{macrocode} +% \end{macro} +% +% \changes{LaTeX2.09}{1992/09/18} +% {(RmS) Added warning if \cs{item} is used in math mode} +% \changes{v1.0c}{1994/04/28} +% {Replaced \cs{@ltxnomath} by \cs{@inmatherr}} +% \changes{v1.0d}{1994/05/03} +% {Removed superfluous braces} +% \begin{macro}{\item} +% \begin{macrocode} +\def\item{% + \@inmatherr\item + \@ifnextchar [\@item{\@noitemargtrue \@item[\@itemlabel]}} +% \end{macrocode} +% \end{macro} +% \begin{macro}{\@donoparitem} +% \begin{macrocode} +\def\@donoparitem{% + \@noparitemfalse + \global\setbox\@labels\hbox{\hskip -\leftmargin + \unhbox\@labels + \hskip \leftmargin}% + \if@minipage\else + \@tempskipa\lastskip + \vskip -\lastskip + \advance\@tempskipa\@outerparskip + \advance\@tempskipa -\parskip + \vskip\@tempskipa + \fi} +% \end{macrocode} +% \end{macro} +% +% \begin{macro}{\@item} +% \changes{v1.0l}{1996/07/26}{Remove unecessary \cs{global} before +% \cs{@minipage...}} +% \begin{macrocode} +\def\@item[#1]{% + \if@noparitem + \@donoparitem + \else + \if@inlabel + \indent \par + \fi + \ifhmode + \unskip\unskip \par + \fi + \if@newlist + \if@nobreak + \@nbitem + \else + \addpenalty\@beginparpenalty + \addvspace\@topsep + \addvspace{-\parskip}% + \fi + \else + \addpenalty\@itempenalty + \addvspace\itemsep + \fi + \global\@inlabeltrue + \fi + \everypar{% + \@minipagefalse + \global\@newlistfalse +% \end{macrocode} +% This |\if@inlabel| check is needed in case an item starts of +% inside a group so that |\everypar| does not become empty +% outside that group. +% \@nobreakfalse, etc etc. +% \begin{macrocode} + \if@inlabel + \global\@inlabelfalse +% \end{macrocode} +% The paragraph indent is now removed by using |\setbox...| since +% this makes |\noindent| a no-op here, as it should be. Thus the +% following comment is redundant but is left here for the sake of +% future historians: +% this next command was changed from an hskip to a kern to avoid +% a break point after the parindent box: the skip could cause a +% line-break if a very long label occurs in raggedright setting. +% \changes{v1.0d}{1994/05/03}{\cs{hskip} changed to \cs{kern}} +% \changes{v1.0m}{1996/10/23}{\cs{kern...} changed to \cs{setbox...}} +% \changes{v1.0r}{1997/02/21} +% {\cs{ifvoid} check added for \cs{noindent}. latex/2414} +% If |\noindent| was used after |\item| want to cancel the |\itemindent| +% skip. This case can be detected as the indentation box will be void. +% \begin{macrocode} + {\setbox\z@\lastbox + \ifvoid\z@ + \kern-\itemindent + \fi}% +% \end{macrocode} +% +% \begin{macrocode} + \box\@labels + \penalty\z@ + \fi +% \end{macrocode} +% This code is intended to prevent a page break after the first +% line of an item that comes immediately after a section title. It +% may be sensible to always forbid a page break after one line of +% an item? As with all such settings of |\clubpenalty| it is local +% so will have no effect if the item starts in a group. +% +% Only resetting |\@nobreak| when it is true is now +% essential since now it is sometimes set locally. +% \changes{v1.0m}{1996/10/23}{Added setting of \cs{clubpenalty} and +% set \cs{@nobreakfalse} only when necessary} +% \begin{macrocode} + \if@nobreak + \@nobreakfalse + \clubpenalty \@M + \else + \clubpenalty \@clubpenalty + \everypar{}% + \fi}% +% \end{macrocode} +% \changes{v1.0l}{1996/07/26}{Remove unecessary \cs{global} before +% \cs{@nobreak...}} +% \changes{v1.0m}{1996/10/23}{\cs{@nobreak...} moved into the +% \cs{everypar} and not executed unconditionally, see above} +% \begin{macrocode} + \if@noitemarg + \@noitemargfalse + \if@nmbrlist +% \end{macrocode} +% \changes{v1.0g}{1995/05/17}{Removed surplus braces} +% \begin{macrocode} + \refstepcounter\@listctr + \fi + \fi +% \end{macrocode} +% We use |\sbox| to support colour commands. +% \changes{LaTeX2e}{1993/12/08}{use \cs{sbox} to support colour} +% \begin{macrocode} + \sbox\@tempboxa{\makelabel{#1}}% + \global\setbox\@labels\hbox{% + \unhbox\@labels + \hskip \itemindent + \hskip -\labelwidth + \hskip -\labelsep + \ifdim \wd\@tempboxa >\labelwidth + \box\@tempboxa +% \end{macrocode} +% \changes{LaTeX2.09}{1991/11/22} +% {(RmS) Changed second call to \cs{makelabel} to +% \cs{unhbox}\cs{@tempboxa}. +% Avoids problems with side effects in \cs{makelabel} and is +% more efficient.} +% \begin{macrocode} + \else + \hbox to\labelwidth {\unhbox\@tempboxa}% + \fi + \hskip \labelsep}% + \ignorespaces} +% \end{macrocode} +% \end{macro} +% +% \begin{macro}{\makelabel} +% \changes{LaTeX2.09}{1991/11/04} +% {(RmS) added default definition for \cs{makelabel}, +% to produce an error message.} +% \begin{macrocode} +\def\makelabel#1{% + \@latex@error{Lonely \string\item--perhaps a missing + list environment}\@ehc} +% \end{macrocode} +% \end{macro} +% +% \begin{macro}{\@nbitem} +% \changes{v1.0g}{1995/05/17}{Removed surplus braces} +% \begin{macrocode} +\def\@nbitem{% + \@tempskipa\@outerparskip + \advance\@tempskipa -\parskip + \addvspace\@tempskipa} +% \end{macrocode} +% \end{macro} +% +% \begin{macro}{\usecounter} +% \begin{macrocode} +\def\usecounter#1{\@nmbrlisttrue\def\@listctr{#1}\setcounter{#1}\z@} +% \end{macrocode} +% \end{macro} +% +% +% \subsection{Itemize and Enumerate} +% +% Enumeration is done with four counters: |enumi|, |enumii|, |enumiii| +% and |enumiv|, where |enum|N controls the numbering of the Nth level +% enumeration. The label is generated by the commands +% \cs{labelenumi} \ldots{} \cs{labelenumiv}, which should be defined +% by the document style. +% Note that \cs{p@enum}N\cs{theenum}N defines the output +% of a \cs{ref} command. A typical definition might be: +% \begin{verbatim} +% \def\theenumii{\alph{enumii}} +% \def\p@enumii{\theenumi} +% \def\labelenumii{(\theenumii)} +% \end{verbatim} +% which will print the labels as `(a)', `(b)', \ldots +% and print a \cs{ref} as `3a'. +% +% The item numbers are moved to the right of the label box, so they are +% always a distance of \cs{labelsep} from the item. +% +% \cs{@enumdepth} holds the current enumeration nesting depth. +% +% Itemization is controlled by four commands: \cs{labelitemi}, +% \cs{labelitemii}, +% \cs{labelitemiii}, and \cs{labelitemiv}. +% To cause the second-level list to be +% bulleted, you just define \cs{labelitemii} +% to be $\bullet$. \cs{@itemspacing} +% and \cs{@itemdepth} are the analogs of \cs{@enumspacing} and +% \cs{@enumdepth}. +% +% \begin{oldcomments} +% \enumerate == +% BEGIN +% if \@enumdepth > 3 +% then errormessage: ``Too deeply nested''. +% else \@enumdepth :=L \@enumdepth + 1 +% \@enumctr :=L eval(enum@\romannumeral\the\@enumdepth) +% \list{\label(\@enumctr)} +% {\usecounter{\@enumctr} +% \makelabel{LABEL} == \hss \llap{LABEL}} +% fi +% END +% +% \endenumerate == \endlist +% \end{oldcomments} +% +% \begin{macro}{\@enumdepth} +% \begin{macrocode} +\newcount\@enumdepth \@enumdepth = 0 +% \end{macrocode} +% \end{macro} +% +% \begin{macro}{\c@enumi} +% \begin{macro}{\c@enumii} +% \begin{macro}{\c@enumii} +% \begin{macro}{\c@enumiv} +% \begin{macrocode} +\@definecounter{enumi} +\@definecounter{enumii} +\@definecounter{enumiii} +\@definecounter{enumiv} +% \end{macrocode} +% \end{macro} +% \end{macro} +% \end{macro} +% \end{macro} +% +% \begin{environment}{enumerate} +% \changes{v1.0g}{1995/05/17}{Use \cs{thr@@} and remove surplus braces} +% \begin{macrocode} +\def\enumerate{% + \ifnum \@enumdepth >\thr@@\@toodeep\else + \advance\@enumdepth\@ne + \edef\@enumctr{enum\romannumeral\the\@enumdepth}% +% \end{macrocode} +% +% \changes{v1.0j}{1995/07/09}{Use \cs{expandafter}} +% \begin{macrocode} + \expandafter + \list + \csname label\@enumctr\endcsname + {\usecounter\@enumctr\def\makelabel##1{\hss\llap{##1}}}% + \fi} +% \end{macrocode} +% +% \begin{macrocode} +\let\endenumerate =\endlist +% \end{macrocode} +% \end{environment} +% +% +% \begin{oldcomments} +% \itemize == +% BEGIN +% if \@itemdepth > 3 +% then errormessage: 'Too deeply nested'. +% else \@itemdepth :=L \@itemdepth + 1 +% \@itemitem == eval(labelitem\romannumeral\the\@itemdepth) +% \list{\@nameuse{\@itemitem}} +% {\makelabel{LABEL} == \hss \llap{LABEL}} +% fi +% END +% +% \enditemize == \endlist +% +% \end{oldcomments} +% +% \begin{macro}{\@itemdepth} +% \begin{macrocode} +\newcount\@itemdepth \@itemdepth = 0 +% \end{macrocode} +% \end{macro} +% +% \begin{environment}{itemize} +% \changes{v1.0g}{1995/05/17}{Use \cs{thr@@}} +% \begin{macrocode} +\def\itemize{% + \ifnum \@itemdepth >\thr@@\@toodeep\else + \advance\@itemdepth\@ne + \edef\@itemitem{labelitem\romannumeral\the\@itemdepth}% +% \end{macrocode} +% +% \changes{v1.0j}{1995/07/09}{Use \cs{expandafter}} +% \begin{macrocode} + \expandafter + \list + \csname\@itemitem\endcsname + {\def\makelabel##1{\hss\llap{##1}}}% + \fi} +% \end{macrocode} +% +% \begin{macrocode} +\let\enditemize =\endlist +% +% \end{macrocode} +% \end{environment} +% +% \Finale +% diff --git a/Master/texmf-dist/source/latex/base/ltlogos.dtx b/Master/texmf-dist/source/latex/base/ltlogos.dtx new file mode 100644 index 00000000000..61173b17e2d --- /dev/null +++ b/Master/texmf-dist/source/latex/base/ltlogos.dtx @@ -0,0 +1,123 @@ +% \iffalse meta-comment +% +% Copyright 1993 1994 1995 1996 1997 1998 1999 2000 2001 2002 2003 2004 +% The LaTeX3 Project and any individual authors listed elsewhere +% in this file. +% +% This file is part of the LaTeX base system. +% ------------------------------------------- +% +% It may be distributed and/or modified under the +% conditions of the LaTeX Project Public License, either version 1.3 +% of this license or (at your option) any later version. +% The latest version of this license is in +% http://www.latex-project.org/lppl.txt +% and version 1.3 or later is part of all distributions of LaTeX +% version 2003/12/01 or later. +% +% This file has the LPPL maintenance status "maintained". +% +% The list of all files belonging to the LaTeX base distribution is +% given in the file `manifest.txt'. See also `legal.txt' for additional +% information. +% +% The list of derived (unpacked) files belonging to the distribution +% and covered by LPPL is defined by the unpacking scripts (with +% extension .ins) which are part of the distribution. +% +% \fi +% +% \iffalse +%%% From File: ltlogos.dtx +%<*driver> +% \fi +\ProvidesFile{ltlogos.dtx} + [1998/08/17 v1.1i LaTeX Kernel (Logos)] +% \iffalse +\documentclass{ltxdoc} +\GetFileInfo{ltlogos.dtx} +\title{\filename} +\date{\filedate} + \author{% + Johannes Braams\and + David Carlisle\and + Alan Jeffrey\and + Leslie Lamport\and + Frank Mittelbach\and + Chris Rowley\and + Rainer Sch\"opf} +\begin{document} +\maketitle + \DocInput{\filename} +\end{document} +% +% \fi +% +% \CheckSum{40} +% +% \changes{v1.1a}{1994/05/16}{(ASAJ) Split from ltinit.dtx.} +% \changes{v1.1b}{1994/05/18}{(ASAJ) Added the \TeX{} logo.} +% \changes{v1.1b}{1994/05/18}{(ASAJ) Made the \LaTeXe{} logo use the +% text font `2' rather than the math font `2'.} +% \changes{v1.1i}{1998/08/17}{(RmS) Minor documentation fixes.} +% +% \section{Logos} +% +% Various logos are defined here. +% +% \StopEventually{} +% +% \begin{macro}{\TeX} +% The \TeX{} logo, adjusted so that a full stop after the logo +% counts as ending a sentence. +% \begin{macrocode} +%<*2ekernel> +\def\TeX{T\kern-.1667em\lower.5ex\hbox{E}\kern-.125emX\@} +% \end{macrocode} +% \end{macro} +% +% \begin{macro}{\LaTeX} +% The \LaTeX{} logo. +% \changes{LaTeX2e}{1993/11/24}{Macro changed} +% \changes{v1.0o}{1994/05/11}{Use \cs{DeclareProtectedCommand}. ASAJ.} +% \changes{v1.1d}{1994/06/01} +% {Add \cs{m@th} to force math size calculations} +% \changes{v1.1e}{1994/07/20}{Save a few tokens} +% +% \changes{v1.1h}{1997/10/08}{Simplify macro (force loading of +% suitable math fonts once).} +% \begin{macrocode} +\DeclareRobustCommand{\LaTeX}{L\kern-.36em% + {\sbox\z@ T% + \vbox to\ht\z@{\hbox{\check@mathfonts + \fontsize\sf@size\z@ + \math@fontsfalse\selectfont + A}% + \vss}% + }% + \kern-.15em% + \TeX} +% \end{macrocode} +% \end{macro} +% +% \changes{v1.1c}{1994/05/26}{Remove \cs{SLiTeX} logo} +% +% \begin{macro}{\LaTeXe} +% The \LaTeXe\ logo as proposed by A-W designers. +% \changes{LaTeX2e}{1993/11/22}{Macro added} +% \changes{LaTeX2e}{1993/12/16}{Extended logo by DPC} +% \changes{v1.0o}{1994/05/11}{Use \cs{DeclareProtectedCommand}. ASAJ.} +% \changes{v1.1e}{1994/07/20}{Save a few tokens} +% \changes{v1.1f}{1997/05/29}{Added \cs{m@th} so that the \LaTeXe{} +% logo works with non-zero values of \cs{mathsurround}.} +% \begin{macrocode} +\DeclareRobustCommand{\LaTeXe}{\mbox{\m@th + \if b\expandafter\@car\f@series\@nil\boldmath\fi + \LaTeX\kern.15em2$_{\textstyle\varepsilon}$}} +% +% \end{macrocode} +% \end{macro} +% +% \Finale +% +\endinput diff --git a/Master/texmf-dist/source/latex/base/ltmath.dtx b/Master/texmf-dist/source/latex/base/ltmath.dtx new file mode 100644 index 00000000000..f50778c5826 --- /dev/null +++ b/Master/texmf-dist/source/latex/base/ltmath.dtx @@ -0,0 +1,996 @@ +% \iffalse meta-comment +% +% Copyright 1993 1994 1995 1996 1997 1998 1999 2000 2001 2002 2003 2004 +% The LaTeX3 Project and any individual authors listed elsewhere +% in this file. +% +% This file is part of the LaTeX base system. +% ------------------------------------------- +% +% It may be distributed and/or modified under the +% conditions of the LaTeX Project Public License, either version 1.3 +% of this license or (at your option) any later version. +% The latest version of this license is in +% http://www.latex-project.org/lppl.txt +% and version 1.3 or later is part of all distributions of LaTeX +% version 2003/12/01 or later. +% +% This file has the LPPL maintenance status "maintained". +% +% The list of all files belonging to the LaTeX base distribution is +% given in the file `manifest.txt'. See also `legal.txt' for additional +% information. +% +% The list of derived (unpacked) files belonging to the distribution +% and covered by LPPL is defined by the unpacking scripts (with +% extension .ins) which are part of the distribution. +% +% \fi +% \iffalse +%%% From File: ltmath.dtx +% +%\ProvidesFile{leqno.clo} +%\ProvidesFile{fleqn.clo} +% [1998/08/17 v1.1c Standard LaTeX option +% (left equation numbers)] +% (flush left equations)] +% +%<*driver> +% \fi +\ProvidesFile{ltmath.dtx} + [1999/10/09 v1.1f LaTeX Kernel (Math Setup)] +% \iffalse +% +% +%<*driver> +\documentclass{ltxdoc} +\GetFileInfo{ltmath.dtx} +\title{\filename} +\date{\filedate} +\author{% + Johannes Braams\and + David Carlisle\and + Alan Jeffrey\and + Leslie Lamport\and + Frank Mittelbach\and + Chris Rowley\and + Rainer Sch\"opf} +\begin{document} + \maketitle + \DocInput{\filename} +\end{document} +% +% \fi +% +% \CheckSum{1101} +% +% \changes{v1.1b}{1996/07/26}{Removed \cs{global} before +% \cs{@ignoretrue} in various places.} +% \changes{v1.1c}{1998/08/17}{(RmS) Minor documentation fixes.} +% +% \section{Math setup} +% +% This file contains a lot of the original plain \TeX{} code, as well +% as the \LaTeX{} environments for math. It still needs sorting out. +% +% \StopEventually{} +% +% \begin{macrocode} +%<*2ekernel> +\message{math definitions,} +% \end{macrocode} +% +% +%% \CharacterTable +%% {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 +%% 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 +%% Digits \0\1\2\3\4\5\6\7\8\9 +%% Exclamation \! Double quote \" Hash (number) \# +%% Dollar \$ Percent \% Ampersand \& +%% Acute accent \' Left paren \( Right paren \) +%% Asterisk \* Plus \+ Comma \, +%% Minus \- Point \. Solidus \/ +%% Colon \: Semicolon \; Less than \< +%% Equals \= Greater than \> Question mark \? +%% Commercial at \@ Left bracket \[ Backslash \\ +%% Right bracket \] Circumflex \^ Underscore \_ +%% Grave accent \` Left brace \{ Vertical bar \| +%% Right brace \} Tilde \~} +%% +% +% \subsection{Math commands based on plain \TeX} +% +% \subsubsection{The log-like functions} +% +% \changes{1.0m}{1994/10/29}{ASAJ: Added \cs{DeclareMathOperator}.} +% \changes{v1.0o}{1994/11/17} +% {\cs{@tempa} to \cs{reserved@a}} +% \changes{1.0q}{1994/11/30}{ASAJ: \cs{DeclareMathOperator} moved to +% AMS\LaTeX.} +% \changes{v1.0r}{1995/05/07}{Use \cs{hb@xt@}} +% \changes{v1.0r}{1995/05/21}{Update some plain macros} +% \changes{v1.0t}{1995/06/28}{minor doc edits} +% +% \begin{macro}{\log} +% The standard operators: +% \begin{macrocode} +\def\log{\mathop{\operator@font log}\nolimits} +\def\lg{\mathop{\operator@font lg}\nolimits} +\def\ln{\mathop{\operator@font ln}\nolimits} +\def\lim{\mathop{\operator@font lim}} +\def\limsup{\mathop{\operator@font lim\,sup}} +\def\liminf{\mathop{\operator@font lim\,inf}} +\def\sin{\mathop{\operator@font sin}\nolimits} +\def\arcsin{\mathop{\operator@font arcsin}\nolimits} +\def\sinh{\mathop{\operator@font sinh}\nolimits} +\def\cos{\mathop{\operator@font cos}\nolimits} +\def\arccos{\mathop{\operator@font arccos}\nolimits} +\def\cosh{\mathop{\operator@font cosh}\nolimits} +\def\tan{\mathop{\operator@font tan}\nolimits} +\def\arctan{\mathop{\operator@font arctan}\nolimits} +\def\tanh{\mathop{\operator@font tanh}\nolimits} +\def\cot{\mathop{\operator@font cot}\nolimits} +\def\coth{\mathop{\operator@font coth}\nolimits} +\def\sec{\mathop{\operator@font sec}\nolimits} +\def\csc{\mathop{\operator@font csc}\nolimits} +\def\max{\mathop{\operator@font max}} +\def\min{\mathop{\operator@font min}} +\def\sup{\mathop{\operator@font sup}} +\def\inf{\mathop{\operator@font inf}} +\def\arg{\mathop{\operator@font arg}\nolimits} +\def\ker{\mathop{\operator@font ker}\nolimits} +\def\dim{\mathop{\operator@font dim}\nolimits} +\def\hom{\mathop{\operator@font hom}\nolimits} +\def\det{\mathop{\operator@font det}} +\def\exp{\mathop{\operator@font exp}\nolimits} +\def\Pr{\mathop{\operator@font Pr}} +\def\gcd{\mathop{\operator@font gcd}} +\def\deg{\mathop{\operator@font deg}\nolimits} +% \end{macrocode} +% \end{macro} +% +% \begin{macro}{\bmod} +% And some operators have to be done by hand: +% \begin{macrocode} +\def\bmod{% + \nonscript\mskip-\medmuskip\mkern5mu% + \mathbin{\operator@font mod}\penalty900\mkern5mu% + \nonscript\mskip-\medmuskip} +% \end{macrocode} +% \end{macro} +% +% \begin{macro}{\pmod} +% \begin{macrocode} +\def\pmod#1{% + \allowbreak\mkern18mu({\operator@font mod}\,\,#1)} +% \end{macrocode} +% \end{macro} +% +% \subsubsection{Biggggg} +% +% \begin{macro}{\big} +% Variants on |\big| and friends for use with delimiters: +% \begin{macrocode} +\def\bigl{\mathopen\big} +\def\bigm{\mathrel\big} +\def\bigr{\mathclose\big} +\def\Bigl{\mathopen\Big} +\def\Bigm{\mathrel\Big} +\def\Bigr{\mathclose\Big} +\def\biggl{\mathopen\bigg} +\def\biggm{\mathrel\bigg} +\def\biggr{\mathclose\bigg} +\def\Biggl{\mathopen\Bigg} +\def\Biggm{\mathrel\Bigg} +\def\Biggr{\mathclose\Bigg} +% \end{macrocode} +% \end{macro} +% +% \subsubsection{The UNSORTED Rest} +% +% The other math commands are lifted from plain \TeX. +% +% \begin{macro}{\jot} +% \begin{macrocode} +\newdimen\jot +\jot=3pt +% \end{macrocode} +% \end{macro} +% +% \begin{macro}{\interdisplaylinepenalty} +% \begin{macrocode} +\newcount\interdisplaylinepenalty +\interdisplaylinepenalty=100 +% \end{macrocode} +% \end{macro} +% +% \begin{macro}{\choose} +% \begin{macrocode} +\def\choose{\atopwithdelims()} +% \end{macrocode} +% \end{macro} +% +% \begin{macro}{\atopwithdelims} +% \begin{macrocode} +\def\brack{\atopwithdelims[]} +% \end{macrocode} +% \end{macro} +% +% \begin{macro}{\brace} +% \begin{macrocode} +\def\brace{\atopwithdelims\{\}} +% \end{macrocode} +% \end{macro} +% +% \begin{macro}{\mathpalette} +% \changes{v1.0r}{1995/05/21}{Use \cs{sqrtsign} instead of +% \cs{sqrt}} +% \begin{macrocode} +\def\mathpalette#1#2{% + \mathchoice + {#1\displaystyle{#2}}% + {#1\textstyle{#2}}% + {#1\scriptstyle{#2}}% + {#1\scriptscriptstyle{#2}}} +% \end{macrocode} +% \end{macro} +% +% \begin{macro}{\root} +% \changes{v1.1d}{1997/01/08} +% {(DPC) Remove spurious space tokens from +% plain \TeX\ definition /2359} +% \begin{macro}{\rootbox} +% \begin{macro}{\r@@t} +% \begin{macrocode} +\newbox\rootbox +% \end{macrocode} +% +% \begin{macrocode} +\def\root#1\of{% + \setbox\rootbox\hbox{$\m@th\scriptscriptstyle{#1}$}% + \mathpalette\r@@t} +% \end{macrocode} +% +% \begin{macrocode} +\def\r@@t#1#2{% + \setbox\z@\hbox{$\m@th#1\sqrtsign{#2}$}% + \dimen@\ht\z@ \advance\dimen@-\dp\z@ + \mkern5mu\raise.6\dimen@\copy\rootbox + \mkern-10mu\box\z@} +% \end{macrocode} +% \end{macro} +% \end{macro} +% \end{macro} +% +% \begin{macro}{\phantom} +% \changes{v1.0p}{1994/11/18} +% {(DPC) use \cs{expandafter} instead of \cs{next}} +% \changes{v1.0p}{1994/11/18} +% {(DPC) colour support} +% \begin{macro}{\hphantom} +% \begin{macro}{\vphantom} +% \begin{macrocode} +\newif\ifv@ +\newif\ifh@ +% \end{macrocode} +% +% \begin{macrocode} +\def\vphantom{\v@true\h@false\ph@nt} +% \end{macrocode} +% +% \begin{macrocode} +\def\hphantom{\v@false\h@true\ph@nt} +% \end{macrocode} +% +% \begin{macrocode} +\def\phantom{\v@true\h@true\ph@nt} +% \end{macrocode} +% +% \begin{macrocode} +\def\ph@nt{% + \ifmmode + \expandafter\mathpalette\expandafter\mathph@nt + \else + \expandafter\makeph@nt + \fi} +% \end{macrocode} +% +% \begin{macrocode} +\def\makeph@nt#1{% + \setbox\z@\hbox{\color@begingroup#1\color@endgroup}\finph@nt} +% \end{macrocode} +% +% \begin{macrocode} +\def\mathph@nt#1#2{% + \setbox\z@\hbox{$\m@th#1{#2}$}\finph@nt} +% \end{macrocode} +% +% \begin{macrocode} +\def\finph@nt{% + \setbox\tw@\null + \ifv@ \ht\tw@\ht\z@ \dp\tw@\dp\z@\fi + \ifh@ \wd\tw@\wd\z@\fi \box\tw@} +% \end{macrocode} +% \end{macro} +% \end{macro} +% \end{macro} +% +% \begin{macro}{\mathstrut} +% \begin{macrocode} +\def\mathstrut{\vphantom(} +% \end{macrocode} +% \end{macro} +% +% \begin{macro}{\smash} +% \changes{v1.0p}{1994/11/18} +% {(DPC) use \cs{expandafter} instead of \cs{next}} +% \changes{v1.0p}{1994/11/18} +% {(DPC) colour support} +% \begin{macrocode} +\def\smash{% + \relax % \relax, in case this comes first in \halign + \ifmmode + \expandafter\mathpalette\expandafter\mathsm@sh + \else + \expandafter\makesm@sh + \fi} +% \end{macrocode} +% +% \begin{macrocode} +\def\makesm@sh#1{% + \setbox\z@\hbox{\color@begingroup#1\color@endgroup}\finsm@sh} +\def\mathsm@sh#1#2{% + \setbox\z@\hbox{$\m@th#1{#2}$}\finsm@sh} +\def\finsm@sh{\ht\z@\z@ \dp\z@\z@ \box\z@} +% \end{macrocode} +% \end{macro} +% +% \begin{macro}{\buildrel} +% \begin{macrocode} +\def\buildrel#1\over#2{\mathrel{\mathop{\kern\z@#2}\limits^{#1}}} +% \end{macrocode} +% \end{macro} +% +% +% \begin{macro}{\cases} +% \changes{LaTeX2.09}{1991/08/14} +% {(RmS) inserted extra braces around entry for NFSS} +% \begin{macrocode} +\def\cases#1{\left\{\,\vcenter{\normalbaselines\m@th + \ialign{$##\hfil$&\quad{##}\hfil\crcr#1\crcr}}\right.} +% \end{macrocode} +% \end{macro} +% +% \begin{macro}{\matrix} +% \begin{macrocode} +\def\matrix#1{\null\,\vcenter{\normalbaselines\m@th + \ialign{\hfil$##$\hfil&&\quad\hfil$##$\hfil\crcr + \mathstrut\crcr\noalign{\kern-\baselineskip} + #1\crcr\mathstrut\crcr\noalign{\kern-\baselineskip}}}\,} +% \end{macrocode} +% \end{macro} +% +% \begin{macro}{\pmatrix} +% \begin{macrocode} +\def\pmatrix#1{\left(\matrix{#1}\right)} +% \end{macrocode} +% \end{macro} +% +% +% \begin{macro}{\bordermatrix} +% \changes{LaTeX2e}{1994/01/25}{Removed \cs{p@renwd}.} +% \begin{macrocode} +\def\bordermatrix#1{\begingroup \m@th + \@tempdima 8.75\p@ + \setbox\z@\vbox{% + \def\cr{\crcr\noalign{\kern2\p@\global\let\cr\endline}}% + \ialign{$##$\hfil\kern2\p@\kern\@tempdima&\thinspace\hfil$##$\hfil + &&\quad\hfil$##$\hfil\crcr + \omit\strut\hfil\crcr\noalign{\kern-\baselineskip}% + #1\crcr\omit\strut\cr}}% + \setbox\tw@\vbox{\unvcopy\z@\global\setbox\@ne\lastbox}% + \setbox\tw@\hbox{\unhbox\@ne\unskip\global\setbox\@ne\lastbox}% + \setbox\tw@\hbox{$\kern\wd\@ne\kern-\@tempdima\left(\kern-\wd\@ne + \global\setbox\@ne\vbox{\box\@ne\kern2\p@}% + \vcenter{\kern-\ht\@ne\unvbox\z@\kern-\baselineskip}\,\right)$}% + \null\;\vbox{\kern\ht\@ne\box\tw@}\endgroup} +% \end{macrocode} +% \end{macro} +% +% \begin{macro}{\openup} +% \begin{macrocode} +\def\openup{\afterassignment\@penup\dimen@} +% \end{macrocode} +% +% \begin{macrocode} +\def\@penup{\advance\lineskip\dimen@ + \advance\baselineskip\dimen@ + \advance\lineskiplimit\dimen@} +% \end{macrocode} +% \end{macro} +% +% \begin{macro}{\displaylines} +% \begin{macrocode} +\newif\ifdt@p +% \end{macrocode} +% +% \begin{macrocode} +\def\displ@y{\global\dt@ptrue\openup\jot\m@th + \everycr{\noalign{\ifdt@p \global\dt@pfalse \ifdim\prevdepth>-1000\p@ + \vskip-\lineskiplimit \vskip\normallineskiplimit \fi + \else \penalty\interdisplaylinepenalty \fi}}} +% \end{macrocode} +% +% \begin{macrocode} +\def\@lign{\tabskip\z@skip\everycr{}} % restore inside \displ@y +% \end{macrocode} +% +% \begin{macrocode} +\def\displaylines#1{\displ@y \tabskip\z@skip + \halign{\hb@xt@\displaywidth{$\@lign\hfil\displaystyle##\hfil$}\crcr + #1\crcr}} +% \end{macrocode} +% \end{macro} +% +% \changes{v1.0r}{1995/05/21}{Remove \cs{mathhexbox} from this file} +% +% \begin{macro}{\sp} +% \begin{macro}{\sb} +% \begin{macrocode} +\let\sp=^ +\let\sb=_ +% \end{macrocode} +% \end{macro} +% \end{macro} +% +% \begin{macro}{\>} +% \begin{macro}{\;} +% \begin{macro}{\!} +% \begin{macrocode} +%\def\,{\mskip\thinmuskip} % already defined in ltspace +\def\>{\mskip\medmuskip} +\def\;{\mskip\thickmuskip} +\def\!{\mskip-\thinmuskip} +% \end{macrocode} +% \end{macro} +% \end{macro} +% \end{macro} +% +% \begin{macro}{\*} +% \begin{macrocode} +\def\*{\discretionary{\thinspace\the\textfont2\char2}{}{}} +% \end{macrocode} +% \end{macro} +% +% \begin{macro}{\:} +% Nickname for the medium space since |\>| is not available inside +% \texttt{tabbing}. +% \begin{macrocode} +\let\:=\> +% \end{macrocode} +% \end{macro} +% +% \begin{macro}{\active@math@prime} +% \changes{v1.1e}{1999/10/09}{Macro added, see PR 3104.} +% This is the definition of the active math prime. +% \begin{macrocode} +\def\active@math@prime{^\bgroup\prim@s} +% \end{macrocode} +% \end{macro} +% +% \begin{macro}{\prime@s} +% \changes{v1.0p}{1994/11/18} +% {(DPC) use \cs{@let@token} instead of \cs{next} +% and \cs{expandafter} instead of \cs{nxt}} +% \changes{v1.1e}{1999/10/09}{Introduce \cs{active@math@prime}.} +% \begin{macrocode} +{\catcode`\'=\active \global\let'\active@math@prime} +% \end{macrocode} +% +% \begin{macrocode} +\def\prim@s{% + \prime\futurelet\@let@token\pr@m@s} +% \end{macrocode} +% +% \begin{macrocode} +\def\pr@m@s{% + \ifx'\@let@token + \expandafter\pr@@@s + \else + \ifx^\@let@token + \expandafter\expandafter\expandafter\pr@@@t + \else + \egroup + \fi + \fi} +% \end{macrocode} +% +% \begin{macrocode} +\def\pr@@@s#1{\prim@s} +% \end{macrocode} +% +% \begin{macrocode} +\def\pr@@@t#1#2{#2\egroup} +% \end{macrocode} +% \end{macro} +% +% \changes{v1.0i}{1994/05/17}{Replaced \cs{let} by \cs{gdef}, for +% indirect definition.} +% \begin{macrocode} +{\catcode`\_=\active \gdef_{\_}} % _ in math is + % either subscript or \_ +% \end{macrocode} +% +% +% \changes{v1.0m}{1994/10/29}{ASAJ: Removed \cs{dag}, \cs{ddag}.} +% \changes{v1.0m}{1994/10/29}{ASAJ: Renamed \cs{S} and \cs{P} to +% \cs{mathsection} and \cs{mathparagraph} and made them +% \cs{mathchardef}s.} +% \changes{v1.0m}{1994/10/29}{ASAJ: Added \cs{mathellipsis}, +% \cs{mathdollar} and \cs{mathsterling}.} +% \changes{v1.0n}{1994/10/30}{ASAJ: Moved the new commands to ltoutenc.} +% +% \subsection{Math Environments} +% +% \changes{1.0m}{1994/10/29}{ASAJ: Tidied up documentation.} +% +% \begin{macro}{\(} +% \begin{macro}{\)} +% Produces |$...$| with checks that |\(| isn't used in math mode, and +% that |\)| is only used in math mode begun with |\(|. +% \begin{macrocode} +\def\({\relax\ifmmode\@badmath\else$\fi} +\def\){\relax\ifmmode\ifinner$\else\@badmath\fi\else \@badmath\fi} +% \end{macrocode} +% \end{macro} +% \end{macro} +% +% \begin{macro}{\[} +% \begin{macro}{\]} +% Produces |$$...$$| with checks that |\[| isn't used in math mode, +% and that |\]| is only used in math mode begun with |\]|. +% \begin{macrocode} +\def\[{% + \relax\ifmmode + \@badmath + \else + \ifvmode + \nointerlineskip + \makebox[.6\linewidth]% + \fi + $$%%$$ BRACE MATCH HACK + \fi +} +% \end{macrocode} +% +% \begin{macrocode} +\def\]{% + \relax\ifmmode + \ifinner + \@badmath + \else + $$%%$$ BRACE MATCH HACK + \fi + \else + \@badmath + \fi + \ignorespaces +} +% \end{macrocode} +% \end{macro} +% \end{macro} +% +% \begin{environment}{math} +% \begin{environment}{displaymath} +% Disguises for |\(...\)| and |\[...\]|. +% \begin{macrocode} +\let\math=\( +\let\endmath=\) +% \end{macrocode} +% +% \begin{macrocode} +\def\displaymath{\[} +\def\enddisplaymath{\]\@ignoretrue} +% \end{macrocode} +% \end{environment} +% \end{environment} +% +% +% \begin{environment}{equation} +% \changes{LaTeX2.09}{1992/01/10}{RmS: put \cs{hbox} around \cs{@eqnnum} +% to typeset the equation number in text mode +% (as in the eqnarray env.)} +% \begin{macro}{\c@equation} +% Numbered equations, using the counter |\c@equation|. +% \emph{Note}: The document style must define |\theequation| etc., and +% do the appropriate |\@addtoreset|. It should also redefine |\@eqnnum| +% if another format for the equation number is desired other than the +% standard (...), or to move the equation numbers to the flushleft. +% (See comment on the |\def| of |\@eqnnum|.) +% \begin{macrocode} +\@definecounter{equation} +\def\equation{$$\refstepcounter{equation}} +\def\endequation{\eqno \hbox{\@eqnnum}$$\@ignoretrue} +% \end{macrocode} +% \end{macro} +% \end{environment} +% +% \begin{macro}{\@eqnnum} +% \changes{LaTeX2.09}{1991/09/29}{RmS: \cs{reset@font} added.} +% \changes{v1.0l}{1994/10/23}{Added \cs{normalcolor} since \cs{eqno} +% introduces a subgroup of the displayed math group} +% +% Produces the equation number for equation and +% eqnarray environments. The following definition is for +% flushright numbers; for flushleft numbers, see leqno.clo. +% The equation number is set in black roman type even +% if an eqnarray environment appears in an italic environment. +% \changes{v1.0s}{1995/05/26}{Removed \cs{rmfamily} (PR 1578), +% replaced \cs{reset@font} with \cs{normalfont}} +% \begin{macrocode} +\def\@eqnnum{{\normalfont \normalcolor (\theequation)}} +% \end{macrocode} +% \end{macro} +% +% \begin{macro}{\stackrel} +% A disguise for plain \TeX's buildrel. +% \begin{macrocode} +\def\stackrel#1#2{\mathrel{\mathop{#2}\limits^{#1}}} +% \end{macrocode} +% \end{macro} +% +% \changes{v0.9g}{1993/12/11}{Added a group around the first argument +% of \cs{frac} to prevent +% changes (for example font changes) from modifying the contents of +% the second argument.} +% +% \begin{macro}{\frac} +% A disguise for plain \TeX's |\over|. +% \begin{macrocode} +\def\frac#1#2{{\begingroup#1\endgroup\over#2}} +% \end{macrocode} +% \end{macro} +% +% \begin{macro}{\sqrt} +% \changes{v1.0y}{1995/10/16}{(DPC) Make robust /1808} +% \begin{macro}{\@sqrt} +% Add an optional argument to plain's |\sqrt| to give the $n$th root +% of an expression $\sqrt[n]{e}$. +% \changes{v1.0r}{1995/05/21}{Use \cs{sqrtsign}} +% \begin{macrocode} +\DeclareRobustCommand\sqrt{\@ifnextchar[\@sqrt\sqrtsign} +\def\@sqrt[#1]{\root #1\of} +% \end{macrocode} +% \end{macro} +% \end{macro} +% +% \changes{LaTeX2.09}{1985/11/04}{produce warning message if line +% extends into margin. Doesn't warn about formula +% overprinting equation number.} +% \changes{LaTeX2.09}{1993/11/02}{RmS: +% Corrected description of \cs{@eqnsel}, moved \cs{@eqnsel} +% accordingly and removed extra \cs{tabskip} assignment.} +% \changes{LaTeX2e}{1993/11/03}{RmS: Initialized \cs{everycr} to empty} +% \changes{v0.9i}{1993/12/16} +% {use \cs{refstepcounter} instead of shortcut} +% \changes{v0.9o}{1994/01/13}{correcting 0.9i} +% +% \begin{environment}{eqnarray} +% \begin{macro}{\@eqcnt} +% \begin{macro}{\@eqpen} +% \begin{macro}{\if@eqnsw} +% \begin{macro}{\@eqnsel} +% Here's the eqnarray environment: +% Default is for left-hand side of equations to be flushright. +% To make them flushleft, |\let\@eqnsel = \hfil|. +% \begin{macrocode} +\newcount\@eqcnt +\newcount\@eqpen +\newif\if@eqnsw\@eqnswtrue +\newskip\@centering +\@centering = 0pt plus 1000pt +% \end{macrocode} +% To get a proper \cs{@currentlabel} we have to redefine it for the +% whole display. Note that we can't use \cs{refstepcounter} as this +% results in |\@currentlabel| getting restored at the wrong and +% thus always writing the first label to the \texttt{.aux} file. +% \begin{macrocode} +\def\eqnarray{% + \stepcounter{equation}% + \def\@currentlabel{\p@equation\theequation}% + \global\@eqnswtrue + \m@th + \global\@eqcnt\z@ + \tabskip\@centering + \let\\\@eqncr + $$\everycr{}\halign to\displaywidth\bgroup + \hskip\@centering$\displaystyle\tabskip\z@skip{##}$\@eqnsel + &\global\@eqcnt\@ne\hskip \tw@\arraycolsep \hfil${##}$\hfil + &\global\@eqcnt\tw@ \hskip \tw@\arraycolsep + $\displaystyle{##}$\hfil\tabskip\@centering + &\global\@eqcnt\thr@@ \hb@xt@\z@\bgroup\hss##\egroup + \tabskip\z@skip + \cr +} +% \end{macrocode} +% +% \begin{macrocode} +\def\endeqnarray{% + \@@eqncr + \egroup + \global\advance\c@equation\m@ne + $$\@ignoretrue +} +% \end{macrocode} +% +% \begin{macrocode} +\let\@eqnsel=\relax +% \end{macrocode} +% \end{macro} +% \end{macro} +% \end{macro} +% \end{macro} +% \end{environment} +% +% \begin{macro}{\nonumber} +% Switches off equation numbering. +% \begin{macrocode} +\def\nonumber{\global\@eqnswfalse} +% \end{macrocode} +% \end{macro} +% +% \begin{macro}{\@eqncr} +% \begin{macro}{\@xeqncr} +% \begin{macro}{\@yeqncr} +% \changes{v1.0y}{1995/10/16}{(DPC) Use \cs{@testopt} /1911} +% \begin{macrocode} +\def\@eqncr{% + {\ifnum0=`}\fi + \@ifstar{% + \global\@eqpen\@M\@yeqncr + }{% + \global\@eqpen\interdisplaylinepenalty \@yeqncr + }% +} +% \end{macrocode} +% +% \begin{macrocode} +\def\@yeqncr{\@testopt\@xeqncr\z@skip} +% \end{macrocode} +% +% \begin{macrocode} +\def\@xeqncr[#1]{% + \ifnum0=`{\fi}% + \@@eqncr + \noalign{\penalty\@eqpen\vskip\jot\vskip #1\relax}% +} +% \end{macrocode} +% +% \end{macro} +% \end{macro} +% \end{macro} +% +% \begin{macro}{\@@eqncr} +% \changes{v0.9i}{1993/12/16}{use \cs{refstepcounter} instead of shortcut} +% \changes{v0.9o}{1994/01/13}{correcting 0.9i} +% +% \begin{macrocode} +\def\@@eqncr{\let\reserved@a\relax + \ifcase\@eqcnt \def\reserved@a{& & &}\or \def\reserved@a{& &}% + \or \def\reserved@a{&}\else + \let\reserved@a\@empty + \@latex@error{Too many columns in eqnarray environment}\@ehc\fi + \reserved@a \if@eqnsw\@eqnnum\stepcounter{equation}\fi + \global\@eqnswtrue\global\@eqcnt\z@\cr} +% \end{macrocode} +% \end{macro} +% +% \begin{environment}{eqnarray*} +% \begin{macro}{\@seqncr} +% Here's the eqnarray* environment: +% \begin{macrocode} +\let\@seqncr=\@eqncr +% \end{macrocode} +% +% \begin{macrocode} +\@namedef{eqnarray*}{\def\@eqncr{\nonumber\@seqncr}\eqnarray} +% \end{macrocode} +% +% \begin{macrocode} +\@namedef{endeqnarray*}{\nonumber\endeqnarray} +% \end{macrocode} +% \end{macro} +% \end{environment} +% +% \begin{macro}{\lefteqn} +% |\lefteqn{FORMULA}| typesets |FORMULA| in display math style +% flushleft in a box of width zero. +% \changes{v1.0r}{1995/05/21}{Use \cs{rlap}} +% \begin{macrocode} +\def\lefteqn#1{\rlap{$\displaystyle #1$}} +% \end{macrocode} +% \end{macro} +% +% \begin{macro}{\ensuremath} +% In math mode, |\ensuremath{text}| is equivalent to text; in LR or +% paragraph mode, it is equivalent to |$|text|$|. +% |\relax| is not needed +% in front of the |\ifmmode| as |\protect| will be |\let| to |\relax|. +% This version (due to Donald Arseneau) avoids duplicating its +% argument in the `then' and `else' part of the |\ifmath| which is +% necessary in nested `tabular' like environments. See amslatex/2104. +% \changes{v1.0k}{1994/05/16} +% {Use \cs{DeclareRobustCommand} and add extra braces in math mode} +% \changes{v1.0l}{1994/10/23}{Remove extra braces: but see p 168 of +% Leslie's book} +% \changes{v1.1a}{1996/03/25}{Reimplement for amslatex/2104} +% \begin{macrocode} +\DeclareRobustCommand{\ensuremath}{% + \ifmmode + \expandafter\@firstofone + \else + \expandafter\@ensuredmath + \fi} +% \end{macrocode} +% \end{macro} +% +% \begin{macro}{\@ensuredmath} +% \changes{v1.1a}{1996/03/25}{Macro added for amslatex/2104} +% \changes{v1.1c}{1996/11/09}{Made long, as it was before. /2104} +% The |\relax| stops |\ensuremath{}| starting display math. +% \begin{macrocode} +\long\def\@ensuredmath#1{$\relax#1$} +% \end{macrocode} +% \end{macro} +% +% \begin{macrocode} +% +% \end{macrocode} +% +% +% +% \subsection{External options to the standard document classes} +% +% \changes{v1.0u}{1995/08/09} +% {Added code for class options leqno and fleqn} +% +% \subsubsection{Left equation numbering} +% +% \begin{macro}{\@eqnnum} +% To put the equation number on the left side of an equation we +% have to use a little trick. The number is shifted |\displaywidth| +% to the left inside a box of (approximately) zero width. This +% fails when the quation is too wide, the equation number than may +% overprint the equation itself. +% \changes{v1.2y classes}{1995/01/12}{Added \cs{normalcolor}} +% \changes{v1.3c classes}{1995/05/25} +% {replace \cs{reset@font}\cs{rmfamily} with \cs{normalfont} +% (PR 1578)} +% \begin{macrocode} +%<*leqno> +\renewcommand\@eqnnum{\hb@xt@.01\p@{}% + \rlap{\normalfont\normalcolor + \hskip -\displaywidth(\theequation)}} +% +% \end{macrocode} +% \end{macro} +% +% \subsubsection{Flush left equations} +% +% To get the displayed math environments to print the contents +% flush left (with an indentation) we have to redefine all of +% \LaTeXe's displayed math environments. +% +% \begin{macro}{\mathindent} +% The amount of indentation of the equations is stored in a register. +% \begin{macrocode} +%<*fleqn> +\newdimen\mathindent +% \end{macrocode} +% The setting of |\mathindent| has to be deferred until the class +% file has been processed, because |\leftmargini| is still 0pt +% wide at the moment \texttt{fleqn.clo} is read in. +% \changes{v1.0n classes} +% {1994/01/19}{Deferred setting of \cs{mathindent}} +% \changes{v1.2t classes} +% {1994/06/22}{Set \cs{mathindent} at the end of the +% class instead of at begin document} +% \begin{macrocode} +\AtEndOfClass{\mathindent\leftmargini} +% \end{macrocode} +% \end{macro} +% +% \begin{macro}{\[} +% Begin display math; +% \begin{macrocode} +\renewcommand\[{\relax + \ifmmode\@badmath + \else + \begin{trivlist}% + \@beginparpenalty\predisplaypenalty + \@endparpenalty\postdisplaypenalty + \item[]\leavevmode + \hb@xt@\linewidth\bgroup $\m@th\displaystyle %$ + \hskip\mathindent\bgroup + \fi} +% \end{macrocode} +% \end{macro} +% +% \begin{macro}{\]} +% end display math; +% \begin{macrocode} +\renewcommand\]{\relax + \ifmmode + \egroup $\hfil% $ + \egroup + \end{trivlist}% + \else \@badmath + \fi} +% \end{macrocode} +% \end{macro} +% +% \begin{environment}{equation} +% The \textsf{equation} environment +% \begin{macrocode} +\renewenvironment{equation}% + {\@beginparpenalty\predisplaypenalty + \@endparpenalty\postdisplaypenalty + \refstepcounter{equation}% + \trivlist \item[]\leavevmode + \hb@xt@\linewidth\bgroup $\m@th% $ + \displaystyle + \hskip\mathindent}% + {$\hfil % $ + \displaywidth\linewidth\hbox{\@eqnnum}% + \egroup + \endtrivlist} +% \end{macrocode} +% \end{environment} +% +% \begin{environment}{eqnarray} +% The \textsf{eqnarray} environment +% \begin{macrocode} +\renewenvironment{eqnarray}{% + \stepcounter{equation}% + \def\@currentlabel{\p@equation\theequation}% + \global\@eqnswtrue\m@th + \global\@eqcnt\z@ + \tabskip\mathindent + \let\\=\@eqncr + \setlength\abovedisplayskip{\topsep}% + \ifvmode + \addtolength\abovedisplayskip{\partopsep}% + \fi +% \end{macrocode} +% When the documentclass uses a non-zero |\parskip| setting the +% |\topsep| might have a negative value to compensate for +% that. Therefore we add |\parskip| to |\abovedisplayskip|. +% \changes{v1.2v classes}{1994/11/10}{Added value of \cs{parskip} to +% \cs{abovedisplayskip} to compensate for negative \cs{topsep}} +% \begin{macrocode} + \addtolength\abovedisplayskip{\parskip}% + \setlength\belowdisplayskip{\abovedisplayskip}% + \setlength\belowdisplayshortskip{\abovedisplayskip}% + \setlength\abovedisplayshortskip{\abovedisplayskip}% + $$\everycr{}\halign to\linewidth% $$ + \bgroup + \hskip\@centering + $\displaystyle\tabskip\z@skip{##}$\@eqnsel&% + \global\@eqcnt\@ne \hskip \tw@\arraycolsep \hfil${##}$\hfil&% + \global\@eqcnt\tw@ \hskip \tw@\arraycolsep + $\displaystyle{##}$\hfil \tabskip\@centering&% + \global\@eqcnt\thr@@ + \hb@xt@\z@\bgroup\hss##\egroup\tabskip\z@skip\cr}% + {\@@eqncr + \egroup + \global\advance\c@equation\m@ne$$% $$ + \@ignoretrue + } +% +% \end{macrocode} +% \end{environment} +% +% +% +% \Finale +% diff --git a/Master/texmf-dist/source/latex/base/ltmiscen.dtx b/Master/texmf-dist/source/latex/base/ltmiscen.dtx new file mode 100644 index 00000000000..e6eb56416ed --- /dev/null +++ b/Master/texmf-dist/source/latex/base/ltmiscen.dtx @@ -0,0 +1,796 @@ +% \iffalse meta-comment +% +% Copyright 1993 1994 1995 1996 1997 1998 1999 2000 2001 2002 2003 2004 +% The LaTeX3 Project and any individual authors listed elsewhere +% in this file. +% +% This file is part of the LaTeX base system. +% ------------------------------------------- +% +% It may be distributed and/or modified under the +% conditions of the LaTeX Project Public License, either version 1.3 +% of this license or (at your option) any later version. +% The latest version of this license is in +% http://www.latex-project.org/lppl.txt +% and version 1.3 or later is part of all distributions of LaTeX +% version 2003/12/01 or later. +% +% This file has the LPPL maintenance status "maintained". +% +% The list of all files belonging to the LaTeX base distribution is +% given in the file `manifest.txt'. See also `legal.txt' for additional +% information. +% +% The list of derived (unpacked) files belonging to the distribution +% and covered by LPPL is defined by the unpacking scripts (with +% extension .ins) which are part of the distribution. +% +% \fi +% \iffalse +%%% From File: ltmiscen.dtx +% +%<*driver> +% \fi +\ProvidesFile{ltmiscen.dtx} + [2000/07/11 v1.1j LaTeX Kernel (Misc. Environments)] +% \iffalse +\documentclass{ltxdoc} +\GetFileInfo{ltmiscen.dtx} +\title{\filename} +\date{\filedate} + \author{% + Johannes Braams\and + David Carlisle\and + Alan Jeffrey\and + Leslie Lamport\and + Frank Mittelbach\and + Chris Rowley\and + Rainer Sch\"opf} + +\begin{document} +\maketitle + \DocInput{\filename} +\end{document} +% +% \fi +% +% \CheckSum{457} +% +% \changes{v1.0c}{1994/03/28}{Improve Documentation} +% \changes{v1.0d}{1994/03/29}{Remove counter macros to ltcntlen} +% \changes{v1.0g}{1994/05/02}{Changed 91 to 1991 and moved some bits} +% \changes{v1.0i}{1994/05/05}{Removed braces from ifnextchar and +% ifstar arguments} +% \changes{v1.0m}{1994/05/20}{Use new warning commands} +% \changes{v1.0n}{1994/05/21}{Use new error commands} +% \changes{v1.0s}{1994/10/14}{Move math to other file} +% \changes{v1.0v}{1994/11/17} +% {\cs{@tempa} to \cs{reserved@a}} +% \changes{v1.0x}{1995/04/22}{Removed extra def of \cs{@gobble}} +% \changes{v1.0z}{1995/07/13}{Improve Documentation} +% \changes{v1.1c}{1996/04/22}{Improve Documentation} +% \changes{v1.1d}{1996/06/03}{Move setting of verbatim font and +% \cs{@noligs}.} +% \changes{v1.1g}{1998/08/17}{(RmS) Minor documentation fixes.} +% +% \section{Miscellaneous Environments} +% This section implements the basic environment mechanism, and also +% a few specific environments including |document|, The math +% environments and related commands, the `flushing' environments, +% (|center|, |flushleft|, |flushright|), and |verbatim|. +% +% \StopEventually{} +% +% \begin{macrocode} +%<*2ekernel> +\message{environments,} +% \end{macrocode} +% +% \subsection{Environments} +% +% |\begin{foo}| and |\end{foo}| are used to delimit environment |foo|. +% +% |\begin{foo}| starts a group and calls |\foo| if it is defined, +% otherwise it does nothing. +% +% |\end{foo}| checks to see that it matches the +% corresponding |\begin| and if so, it calls |\endfoo| and does an +% |\endgroup|. Otherwise, |\end{foo}| does nothing. +% +% If |\end{foo}| needs to ignore blanks after it, then |\endfoo| should +% globally set the |@ignore| switch true with |\@ignoretrue| +% (this will automatically be global). +% +% +% NOTE: |\@@end| is defined to be the |\end| command of \TeX82. +% +% |\enddocument| is the user's command for ending the manuscript file. +% +% |\stop| is a panic button --- to end \TeX\ in the middle. +% +% \begin{oldcomments} +% \enddocument == +% BEGIN +% \@checkend{document} %% checks for unmatched \begin +% \clearpage +% \begingroup +% if @filesw = true +% then close file @mainaux +% if G@refundefined = true +% then LaTeX Warning: 'There are undefined references.' fi +% if @multiplelabels = true +% then LaTeX Warning: +% 'One or more label(s) multiply defined.' +% else +% \@setckpt {ARG1}{ARG2} == null +% \newlabel{LABEL}{VAL} == +% BEGIN +% \reserved@a == VAL +% if def(\reserved@a) = def(\r@LABEL) +% else @tempswa := true fi +% END +% \bibcite{LABEL}{VAL} == null +% BEGIN +% \reserved@a == VAL +% if def(\reserved@a) = def(\g@LABEL) +% else @tempswa := true fi +% END +% @tempswa := false +% make @ a letter +% \input \jobname.AUX +% if @tempswa = true +% then LaTeX Warning: 'Label may have changed. +% Rerun to get cross-references right.' +% fi fi fi +% \endgroup +% finish up +% END +% +% \@writefile{EXT}{ENTRY} == +% if tf@EXT undefined +% else \write\tf@EXT{ENTRY} +% fi +% \end{oldcomments} +% +% \begin{macro}{\@currenvir} +% The name of the current environment. Initialized to +% \texttt{document} to so that |\end{document}| works correctly. +% \begin{macrocode} +\def\@currenvir{document} +% \end{macrocode} +% \end{macro} +% +% \begin{macro}{\if@ignore} +% \begin{macro}{\@ignoretrue} +% \begin{macro}{\@ignorefalse} +% \changes{v1.1e}{1996/07/26}{put \cs{global} into definition} +% \begin{macrocode} +\def\@ignorefalse{\global\let\if@ignore\iffalse} +\def\@ignoretrue {\global\let\if@ignore\iftrue} +\@ignorefalse +% \end{macrocode} +% \end{macro} +% \end{macro} +% \end{macro} +% +% +% \begin{macro}{\ignorespacesafterend} +% \changes{v1.1e}{1996/07/26}{user level macro added} +% \begin{macrocode} +\let\ignorespacesafterend\@ignoretrue +% \end{macrocode} +% \end{macro} +% +% \begin{macro}{\enddocument} +% \changes{LaTeX2.09}{1993/08/03} +% {Changed redefinition of \cs{global} to redefinition +% of \cs{@setckpt}.} +% \changes{LaTeX2.09}{1993/09/08} +% {Added warning in case of undefined references.}% +% \changes{v0.9e}{1993/12/09}{Hook added} +% \begin{macrocode} +\def\enddocument{% +% \end{macrocode} +% The |\end{document}| hook is executed first. If necessary it can +% contain a |\clearpage| to output dangling floats first. In this +% position it can also contain something like |\end{foo}| so that +% the whole document effectively starts and ends with some special +% environment. However, this must be used with care, eg if two +% applications would use this without knowledge of each other the +% order of the environments will be wrong after all. +% |\AtEndDocument| is redefined +% at this point so that and such commands that get into the hook do +% not chase their tail\ldots +% \changes{v1.0y}{1995/04/27}{\cs{@checkend} moved after hook} +% \changes{v1.0z}{1995/07/13}{Set \cs{@setckpt} to \cs{@gobbletwo} +% instead of defining it by hand} +% \changes{v1.1i}{2000/05/19} +% {Reset \cs{AtEndDocument} for latex/3060} +% \begin{macrocode} + \let\AtEndDocument\@firstofone + \@enddocumenthook + \@checkend{document}% + \clearpage + \begingroup + \if@filesw + \immediate\closeout\@mainaux + \let\@setckpt\@gobbletwo + \let\@newl@bel\@testdef +% \end{macrocode} +% \changes{v1.0z}{1995/07/13}{Sorten redefinition of \cs{bibcite} and +% \cs{newlabel}} +% The previous line is equiv to setting +%\begin{verbatim} +% \def\newlabel{\@testdef r}% +% \def\bibcite{\@testdef b}% +%\end{verbatim} +% \begin{macrocode} + \@tempswafalse + \makeatletter \input\jobname.aux + \fi +% \end{macrocode} +% \changes{v1.0w}{1994/11/30} +% {(DPC) Use \cs{@dofilelist}} +% \begin{macrocode} + \@dofilelist +% \end{macrocode} +% First we check for font size substitution bigger than +% |\fontsubfuzz|. The |\relax| is necessary because this is a macro +% not a register. +% \changes{v1.0w}{1994/11/30} +% {(DPC) Do warnings even for \cs{nofiles}} +% \begin{macrocode} + \ifdim \font@submax >\fontsubfuzz\relax +% \end{macrocode} +% In case you wonder about the |\@gobbletwo| inside the message +% below, this is a horrible hack to remove the tokens |\on@line.| +% that are added by |\@font@warning| at the end. +% \changes{v1.1j}{2000/07/11}{Fix typo in warning} +% \begin{macrocode} + \@font@warning{Size substitutions with differences\MessageBreak + up to \font@submax\space have occurred.\@gobbletwo}% + \fi +% \end{macrocode} +% The macro |\@defaultsubs| is initially |\relax| but gets redefined +% to produce +% a warning if there have been some default font substitutions. +% \changes{v1.0z}{1995/07/13}{Use \cs{\@defaultsubs} instead of switch} +% \begin{macrocode} + \@defaultsubs +% \end{macrocode} +% The macro |\@refundefined| is initially |\relax| but gets redefined +% to produce a warning if there are undefined refs. +% \changes{v1.1b}{1995/10/24}{Use \cs{\@refundefined} instead of switch} +% \begin{macrocode} + \@refundefined +% \end{macrocode} +% If a label is defined more than once, |\@tempswa| will always be +% true and thus produce a ``Label(s) may \ldots'' warning. But +% since a rerun will not solve that problem (unless one uses a +% package like \texttt{varioref} that generates labels on the fly), +% we suppress this message. +% \changes{v1.0e}{1994/04/20}{Changed logic for producing +% warning messages} +% \changes{v1.1b}{1995/10/24}{Changed logic for producing +% warning messages and removed switch} +% \begin{macrocode} + \if@filesw + \ifx \@multiplelabels \relax + \if@tempswa + \@latex@warning@no@line{Label(s) may have changed. + Rerun to get cross-references right}% + \fi + \else + \@multiplelabels + \fi + \fi + \endgroup + \deadcycles\z@\@@end} +% \end{macrocode} +% \end{macro} +% +% \begin{macro}{\@testdef} +% \begin{macrocode} +\def\@testdef #1#2#3{% + \def\reserved@a{#3}\expandafter \ifx \csname #1@#2\endcsname + \reserved@a \else \@tempswatrue \fi} +% \end{macrocode} +% \end{macro} +% +% +% \begin{macro}{\@writefile} +% \changes{v1.0l}{1994/05/20}{Added correct setting of \cs{protect}.} +% \changes{v1.0t}{1994/11/04}{Removed setting of \cs{protect}. ASAJ.} +% \changes{v1.0z}{1995/07/13}{Added missing percent and use \cs{relax} +% in the THEN case} +% \begin{macrocode} +\long\def\@writefile#1#2{% + \@ifundefined{tf@#1}\relax + {\@temptokena{#2}% + \immediate\write\csname tf@#1\endcsname{\the\@temptokena}% + }% +} +% \end{macrocode} +% \end{macro} +% +% \begin{macro}{\stop} +% \begin{macrocode} +\def\stop{\clearpage\deadcycles\z@\let\par\@@par\@@end} +% \end{macrocode} +% \end{macro} +% +% +% \begin{oldcomments} +% +% \begin{macrocode} +\everypar{\@nodocument} %% To get an error if text appears before the +\nullfont %% \begin{document} +% \end{macrocode} +% +% \begin, \end, and \@checkend changed so \end{document} will catch +% an unmatched \begin. Changed 24 May 89 as suggested by +% Frank Mittelbach and Rainer Sch\"opf. +% +% \begin{NAME} == +% BEGIN +% IF \NAME undefined THEN \reserved@a == BEGIN report error END +% ELSE \reserved@a == +% (\@currenvir :=L NAME) \NAME +% FI +% @ignore :=G F %% Added 30 Nov 88 +% \begingroup +% \@endpe := F +% \@currenvir :=L NAME +% \NAME +% END +% +% \end{NAME} == +% BEGIN +% \endNAME +% \@checkend{NAME} +% \endgroup +% IF @endpe = T %% @endpe set True by \@endparenv +% THEN \@doendpe %% \@doendpe redefines \par and \everypar +% %% to suppress paragraph indentation in +% FI %% immediately following text +% IF @ignore = T +% THEN @ignore :=G F +% \ignorespaces +% FI +% END +% +% \@checkend{NAME} == +% BEGIN +% IF \@currenvir = NAME +% ELSE \@badend{NAME} +% FI +% END +% +% \end{oldcomments} +% +% +% \begin{macro}{\begin} +% \changes{LaTeX2.09}{1992/03/18}{Changed \cs{@ignoretrue} to +% \cs{@ignorefalse} (as documented)} +% \changes{LaTeX2.09}{1992/08/24}{Added code to \cs{begin} to +% remember line number. Used by \cs{@badend} to display +% position of non-matching \cs{begin}.} +% \changes{v1.1e}{1996/07/26}{remove \cs{global} before \cs{@ignore...}} +% \begin{macrocode} +\def\begin#1{% + \@ifundefined{#1}% + {\def\reserved@a{\@latex@error{Environment #1 undefined}\@eha}}% + {\def\reserved@a{\def\@currenvir{#1}% + \edef\@currenvline{\on@line}% + \csname #1\endcsname}}% + \@ignorefalse + \begingroup\@endpefalse\reserved@a} +% \end{macrocode} +% \end{macro} +% +% \begin{macro}{\end} +% \changes{v1.1e}{1996/07/26}{remove \cs{global} before \cs{@ignore...}} +% \begin{macrocode} +\def\end#1{% + \csname end#1\endcsname\@checkend{#1}% + \expandafter\endgroup\if@endpe\@doendpe\fi + \if@ignore\@ignorefalse\ignorespaces\fi} +% \end{macrocode} +% \end{macro} +% +% \begin{macro}{\@checkend} +% \begin{macrocode} +\def\@checkend#1{\def\reserved@a{#1}\ifx + \reserved@a\@currenvir \else\@badend{#1}\fi} +% \end{macrocode} +% \end{macro} +% +% \begin{macro}{\@currenvline} +% We do need a default value for |\@currenvline| on top-level since +% the document environment cancels the brace group. This means that +% a missmatch with |\begin|\allowbreak|{document}| will not produce +% a line number. Thus the outer default must be |\@empty| or we +% will end up with two spaces. +% \changes{v1.0q}{1994/05/24}{Use \cs{@empty} as outer default} +% \begin{macrocode} +\let\@currenvline\@empty +% \end{macrocode} +% \end{macro} +% +% +% \subsection{Center, Flushright, Flushleft} +% +% \begin{macrocode} +\message{center,} +% \end{macrocode} +% +% \begin{oldcomments} +% +% \center, \flushright and \flushleft set +% \rightskip = 0pt or \@flushglue (as appropriate) +% \leftskip = 0pt or \@flushglue (as appropriate) +% \parindent = 0pt +% \parfillskip = 0pt. (except \flushleft) +% \\ == \par \vskip -\parskip +% \\[LENGTH] == \\ \vskip LENGTH +% \\* == \par \penalty 10000 \vskip -\parskip +% \\*[LEN] == \\* \vskip LENGTH +% +% They invoke the trivlist environment to handle vertical spacing before +% and after them. +% +% \centering, \raggedright and \raggedleft are the declaration analogs +% of the above. +% +% \raggedright has a more universal effect, however. It sets +% \@rightskip := flushglue. Every environment, like the list +% environments, +% that set \rightskip to its 'normal' value set it to \@rightskip +% +% \end{oldcomments} +% +% \begin{macro}{\@centercr} +% \changes{v1.0h}{1994/05/03}{\cs{@badcrerr} replaced by \cs{@nolnerr}} +% \changes{v1.0z}{1995/07/13}{Use \cs{nobreak}} +% \begin{macrocode} +\def\@centercr{\ifhmode \unskip\else \@nolnerr\fi + \par\@ifstar{\nobreak\@xcentercr}\@xcentercr} +% \end{macrocode} +% \end{macro} +% +% \begin{macro}{\@xcentercr} +% \begin{macrocode} +\def\@xcentercr{\addvspace{-\parskip}\@ifnextchar + [\@icentercr\ignorespaces} +% \end{macrocode} +% \end{macro} +% +% \begin{macro}{\@icentercr} +% \begin{macrocode} +\def\@icentercr[#1]{\vskip #1\ignorespaces} +% \end{macrocode} +% \end{macro} +% +% +% \begin{environment}{center} +% \changes{v0.9h}{1993/12/13}{Removed optional argument of \cs{item}} +% \changes{v1.0u}{1994/11/12}{Changed end macro to \cs{def}: safer and +% consistent} +% We use |\relax| to prevent |\item| scanning too far. +% \begin{macrocode} +\def\center{\trivlist \centering\item\relax} +% \end{macrocode} +% +% \begin{macrocode} +\def\endcenter{\endtrivlist} +% \end{macrocode} +% \end{environment} +% +% \begin{macro}{\centering} +% \begin{macrocode} +\def\centering{% + \let\\\@centercr + \rightskip\@flushglue\leftskip\@flushglue + \parindent\z@\parfillskip\z@skip} +% \end{macrocode} +% \end{macro} +% +% \begin{macro}{\@rightskip} +% \begin{macrocode} +\newskip\@rightskip \@rightskip \z@skip +% \end{macrocode} +% \end{macro} +% +% \begin{environment}{flushleft} +% \changes{v0.9h}{1993/12/13}{Removed optional argument of \cs{item}} +% \changes{v1.0u}{1994/11/12}{Changed end macro to \cs{def}: safer and +% consistent} +% We use |\relax| to prevent |\item| scanning too far. +% \begin{macrocode} +\def\flushleft{\trivlist \raggedright\item\relax} +% \end{macrocode} +% +% \begin{macrocode} +\def\endflushleft{\endtrivlist} +% \end{macrocode} +% \end{environment} +% +% \begin{macro}{\raggedright} +% \begin{macrocode} +\def\raggedright{% + \let\\\@centercr\@rightskip\@flushglue \rightskip\@rightskip + \leftskip\z@skip + \parindent\z@} +% \end{macrocode} +% \end{macro} +% +% \begin{environment}{flushright} +% \changes{v0.9h}{1993/12/13}{Removed optional argument of \cs{item}} +% \changes{v1.0u}{1994/11/12}{Changed end macro to \cs{def}: safer and +% consistent} +% We use |\relax| to prevent |\item| scanning too far. +% \begin{macrocode} +\def\flushright{\trivlist \raggedleft\item\relax} +% \end{macrocode} +% +% \begin{macrocode} +\def\endflushright{\endtrivlist} +% \end{macrocode} +% \end{environment} +% +% \begin{macro}{\raggedleft} +% \begin{macrocode} +\def\raggedleft{% + \let\\\@centercr + \rightskip\z@skip\leftskip\@flushglue + \parindent\z@\parfillskip\z@skip} +% \end{macrocode} +% \end{macro} +% +% \begin{macrocode} +\message{verbatim,} +% \end{macrocode} +% +% \subsection{Verbatim} +% +% +% The verbatim environment uses the fixed-width |\ttfamily| font, turns +% blanks into spaces, starts a new line for each carrige return (or +% sequence of consecutive carriage returns), and interprets +% \emph{every} character literally. +% I.e., all special characters |\, {, $|, etc. +% are |\catcode|'d to 'other'. +% +% The command |\verb| produces in-line verbatim text, where the argument +% is delimited by any pair of characters. E.g., |\verb #...#| takes +% `|...|' as its argument, and sets it verbatim in |\ttfamily| font. +% +% The *-variants of these commands are the same, except that spaces +% print as the \TeX{}book's space character instead of as blank spaces. +% +% \begin{macro}{\@vobeyspaces} +% \begin{macrocode} +{\catcode`\ =\active% +\gdef\@vobeyspaces{\catcode`\ \active\let \@xobeysp}} +% \end{macrocode} +% \end{macro} +% +% \begin{macro}{\@xobeysp} +% \changes{v1.0z}{1995/07/13}{Use \cs{nobreak}} +% \changes{v1.1f}{1996/09/28}{Moved to ltspace.dtx} +% \end{macro} +% +% +% \begin{macro}{\@xverbatim} +% \begin{macro}{\@sxverbatim} +% \begin{macrocode} +\begingroup \catcode `|=0 \catcode `[= 1 +\catcode`]=2 \catcode `\{=12 \catcode `\}=12 +\catcode`\\=12 |gdef|@xverbatim#1\end{verbatim}[#1|end[verbatim]] +|gdef|@sxverbatim#1\end{verbatim*}[#1|end[verbatim*]] +|endgroup +% \end{macrocode} +% \end{macro} +% \end{macro} +% +% \begin{macro}{\@verbatim} +% \changes{LaTeX2.09}{1991/07/24}{Added \cs{penalty}\cs{interlinepenalty} +% to definition of \cs{par} so that \cs{samepage} works} +% \changes{v0.9h}{1993/12/13}{Removed optional argument of \cs{item}} +% Real start of verbatim environment +% We use |\relax| to prevent |\item| scanning too far. +% \changes{v0.9p}{1994/01/18} +% {Add \cs{global}\cs{@inlabelfalse}} +% \changes{v1.0b}{1994/03/16} +% {Remove \cs{global}\cs{@inlabelfalse} again.} +% \begin{macrocode} +\def\@verbatim{\trivlist \item\relax + \if@minipage\else\vskip\parskip\fi + \leftskip\@totalleftmargin\rightskip\z@skip + \parindent\z@\parfillskip\@flushglue\parskip\z@skip +% \end{macrocode} +% \changes{LaTeX2.09}{1991/08/26}{\cs{@@par} added} +% Added |\@@par| to clear possible |\parshape| definition +% from a surrounding list (the verbatim guru says). +% \changes{v0.9p}{1994/01/18} +% {Only add \cs{penalty} if in hmode} +% \begin{macrocode} + \@@par + \@tempswafalse + \def\par{% + \if@tempswa +% \end{macrocode} +% A |\leavevmode| added: needed if, for example, a blank verbatim +% line is the first thing in a list item (wow!). +% \changes{v1.0f}{1994/04/29}{\cs{leavevmode} added} +% \begin{macrocode} + \leavevmode \null \@@par\penalty\interlinepenalty + \else + \@tempswatrue + \ifhmode\@@par\penalty\interlinepenalty\fi + \fi}% +% \end{macrocode} +% To allow customization we hide the font used in a separate macro. +% \changes{v0.9a}{1993/11/21}{use \cs{verbatim@font} instead of \cs{tt}} +% \changes{v0.9h}{1993/12/13}{Readded \cs{@noligs}} +% \changes{v1.1d}{1996/06/03}{Exchanged the following two code lines +% so that \cs{dospecials} cannot reset the category code +% of characters handled by \cs{@noligs}.} +% \changes{v1.1h}{2000/01/07}{Disable hyphenation even if the font allows it.} +% \begin{macrocode} + \let\do\@makeother \dospecials + \obeylines \verbatim@font \@noligs + \hyphenchar\font\m@ne +% \end{macrocode} +% To avoid a breakpoint after the labels box, we remove the penalty +% put there by the list macros: another use of |\unpenalty|! +% \changes{v1.0f}{1994/04/29}{Change to \cs{everypar} added} +% \begin{macrocode} + \everypar \expandafter{\the\everypar \unpenalty}% +} +% \end{macrocode} +% \end{macro} +% +% \begin{macro}{\verbatim} +% \begin{macro}{\endverbatim} +% (RmS 93/09/19) Protected against `missing item' error message +% triggered by empty verbatim environment. +% \begin{macrocode} +\def\verbatim{\@verbatim \frenchspacing\@vobeyspaces \@xverbatim} +\def\endverbatim{\if@newlist \leavevmode\fi\endtrivlist} +% \end{macrocode} +% \end{macro} +% \end{macro} +% +% \begin{macro}{\verbatim@font} +% \changes{v0.9a}{1993/11/21}{Macro added} +% Macro to select the font used for verbatim typesetting. +% It also does other work if necessary for the font used. +% \changes{v0.9s}{1994/01/21}{Removed unnecessary category code +% hackery.} +% \begin{macrocode} +\def\verbatim@font{\normalfont\ttfamily} +% \end{macrocode} +% \end{macro} +% +% +% \begin{environment}{verbatim*} +% \begin{macrocode} +\@namedef{verbatim*}{\@verbatim\@sxverbatim} +\expandafter\let\csname endverbatim*\endcsname =\endverbatim +% \end{macrocode} +% \end{environment} +% +% \begin{macro}{\@makeother} +% \begin{macrocode} +\def\@makeother#1{\catcode`#112\relax} +% \end{macrocode} +% \end{macro} +% +% \begin{macro}{\verb@balance@group} +% \changes{LaTeX2.09}{1993/09/07} +% {(RmS) Changed definition of \cs{verb} so that it detects a +% missing second delimiter.} +% \begin{macrocode} +\let\verb@balance@group\@empty +% \end{macrocode} +% \end{macro} +% +% \begin{macro}{\verb@egroup} +% \begin{macrocode} +\def\verb@egroup{\global\let\verb@balance@group\@empty\egroup} +% \end{macrocode} +% \end{macro} +% +% \begin{macro}{\verb@eol@error} +% \begin{macrocode} +\begingroup + \obeylines% + \gdef\verb@eol@error{\obeylines% + \def^^M{\verb@egroup\@latex@error{% + \noexpand\verb ended by end of line}\@ehc}}% +\endgroup +% \end{macrocode} +% \end{macro} +% +% \begin{macro}{\verb} +% \changes{LaTeX2.09}{1992/08/24} +% {Changed \cs{verb} and \cs{@sverb} to work correctly +% in math mode} +% \changes{v0.9a}{1993/11/21}{Use \cs{verbatim@font} instead of +% \cs{tt}.} +% \changes{v1.1a}{1995/09/19}{Put \cs{@noligs} after +% \cs{verbatim@font} where it belongs.} +% Typesetting a small piece verbatim. +% \changes{v1.1d}{1996/06/03}{Put setting of verbatim font after +% \cs{dospecials} +% so that \cs{dospecials} cannot reset the category code +% of characters handled by \cs{@noligs}.} +% \begin{macrocode} +\def\verb{\relax\ifmmode\hbox\else\leavevmode\null\fi + \bgroup + \verb@eol@error \let\do\@makeother \dospecials + \verbatim@font\@noligs + \@ifstar\@sverb\@verb} +% \end{macrocode} +% \end{macro} +% +% +% \begin{macro}{\@sverb} +% \changes{v1.0j}{1994/05/10}{Slight change in error message text.} +% Definitions of |\@sverb| and |\@verb| changed so |\verb+ foo+| +% does not lose leading blanks when it comes at the beginning of a line. +% Change made 24 May 89. Suggested by Frank Mittelbach and Rainer +% Sch\"opf. +% +% \begin{macrocode} +\def\@sverb#1{% + \catcode`#1\active + \lccode`\~`#1% + \gdef\verb@balance@group{\verb@egroup + \@latex@error{\noexpand\verb illegal in command argument}\@ehc}% + \aftergroup\verb@balance@group + \lowercase{\let~\verb@egroup}}% +% \end{macrocode} +% \end{macro} +% +% \begin{macro}{\@verb} +% \begin{macrocode} +\def\@verb{\@vobeyspaces \frenchspacing \@sverb} +% \end{macrocode} +% \end{macro} +% +% \begin{macro}{\verbatim@nolig@list} +% \changes{LaTeX2.09}{1993/09/03} +% {Replaced \cs{@noligs} by extensible list} +% \begin{macrocode} +\def\verbatim@nolig@list{\do\`\do\<\do\>\do\,\do\'\do\-} +% \end{macrocode} +% \end{macro} +% +% \begin{macro}{\do@noligs} +% \begin{macrocode} +\def\do@noligs#1{% + \catcode`#1\active + \begingroup + \lccode`\~`#1\relax + \lowercase{\endgroup\def~{\leavevmode\kern\z@\char`#1}}} +% \end{macrocode} +% \end{macro} +% +% \begin{macro}{\@noligs} +% To stay compatible with packages that use |\@noligs| we keep it. +% \changes{v0.9h}{1993/12/13}{Readded \cs{@noligs}} +% \begin{macrocode} +\def\@noligs{\let\do\do@noligs \verbatim@nolig@list} +% \end{macrocode} +% \end{macro} +% +% \changes{v0.9i}{1993/12/16}{\cs{literal} added} +% \changes{v1.0r}{1994/05/26/16}{\cs{literal} removed} +% \begin{macrocode} +% +% \end{macrocode} +% +% \Finale +% diff --git a/Master/texmf-dist/source/latex/base/ltoutenc.dtx b/Master/texmf-dist/source/latex/base/ltoutenc.dtx new file mode 100644 index 00000000000..f31394f32d2 --- /dev/null +++ b/Master/texmf-dist/source/latex/base/ltoutenc.dtx @@ -0,0 +1,3320 @@ +% \iffalse meta-comment +% +% Copyright 1993 1994 1995 1996 1997 1998 1999 2000 2001 2002 2003 2004 +% The LaTeX3 Project and any individual authors listed elsewhere +% in this file. +% +% This file is part of the LaTeX base system. +% ------------------------------------------- +% +% It may be distributed and/or modified under the +% conditions of the LaTeX Project Public License, either version 1.3 +% of this license or (at your option) any later version. +% The latest version of this license is in +% http://www.latex-project.org/lppl.txt +% and version 1.3 or later is part of all distributions of LaTeX +% version 2003/12/01 or later. +% +% This file has the LPPL maintenance status "maintained". +% +% The list of all files belonging to the LaTeX base distribution is +% given in the file `manifest.txt'. See also `legal.txt' for additional +% information. +% +% The list of derived (unpacked) files belonging to the distribution +% and covered by LPPL is defined by the unpacking scripts (with +% extension .ins) which are part of the distribution. +% +% \fi +% \iffalse +%%% From File: ltoutenc.dtx +%\NeedsTeXFormat{LaTeX2e}[2000/06/01] +%\ProvidesFile{ot1enc.def} +%\ProvidesFile{t1enc.def} +%\ProvidesFile{omsenc.def} +%\ProvidesFile{omlenc.def} +%\ProvidesFile{ot4enc.def} +%\ProvidesFile{ts1enc.def}[2001/06/05 v3.0e (jk/car/fm) +%\ProvidesPackage{fontenc} +%\ProvidesPackage{textcomp} +% [2004/02/22 v1.99f +% Standard LaTeX file] +% Standard LaTeX package] +% +%<*driver> +% \fi +\ProvidesFile{ltoutenc.dtx} + [2004/02/22 v1.99f LaTeX Kernel (font encodings)] +% \iffalse +\documentclass{ltxdoc} +\GetFileInfo{ltoutenc.dtx} +\title{\filename} +\date{\filedate} +\author{% + Johannes Braams\and + David Carlisle\and + Alan Jeffrey\and + Frank Mittelbach\and + Chris Rowley\and + Rainer Sch\"opf} +\usepackage{textcomp} +\begin{document} + \maketitle + \DocInput{\filename} +\end{document} +% +% \fi +% +% \CheckSum{2762} +% +% \CharacterTable +% {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 +% 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 +% Digits \0\1\2\3\4\5\6\7\8\9 +% Exclamation \! Double quote \" Hash (number) \# +% Dollar \$ Percent \% Ampersand \& +% Acute accent \' Left paren \( Right paren \) +% Asterisk \* Plus \+ Comma \, +% Minus \- Point \. Solidus \/ +% Colon \: Semicolon \; Less than \< +% Equals \= Greater than \> Question mark \? +% Commercial at \@ Left bracket \[ Backslash \\ +% Right bracket \] Circumflex \^ Underscore \_ +% Grave accent \` Left brace \{ Vertical bar \| +% Right brace \} Tilde \~} +% +% +% \changes{v1.99e}{2004/02/13}{Documentation fixes: typos} +% \changes{v1.9k}{1998/01/12}{Added \cs{ProvidesPackage} +% for textcomp.sty} +% \changes{v1.9i}{1997/12/19}{Documentation corrections.} +% \changes{v1.9h}{1997/12/17}{Documentation changes and additions.} +% \changes{v1.9h}{1997/12/17}{Added textcomp.sty.} +% \changes{v1.9f}{1997/08/29}{Added OT4 encoding, +% provided by Marcin Woli\'nski.} +% \changes{v1.7r}{1995/11/28}{doc fixes} +% \changes{v1.7h}{1995/04/21}{Added \cs{null} \cs{k} latex/1274} +% \changes{v1.7f}{1994/12/14}{Added braces to \cs{copyright} so it +% works unbraced in subscripts.} +% \changes{v1.7f}{1994/12/14}{Added check for math mode in +% \cs{@changed@cmd}.} +% \changes{v1.7f}{1994/12/14}{Commented out \cs{textasciicircum}, +% \cs{textasciitilde}, \cs{textbackslash}, \cs{textbar}, +% \cs{textgreater}, \cs{texthyphenchar}, \cs{texthyphen} and +% \cs{textless} to save memory.} +% \changes{v1.7e}{1994/12/10}{Added documentation for the OML encoding.} +% \changes{v1.7e}{1994/12/10}{Replaced width with \cs{@width} and +% ditto height in vrules.} +% \changes{v1.7d}{1994/12/08}{Added \cs{null} and \cs{sh@ft} to \cs{b} +% and \cs{d}.} +% \changes{v1.7c}{1994/12/05}{Added braces to \cs{textcircled}.} +% \changes{v1.7b}{1994/12/02}{Fixed a bug with \cs{a}.} +% \changes{v1.7a}{1994/11/30}{Added new code for encoding-specific +% commands. These now expand in the mouth, which means that +% ligaturing and kerning can happen.} +% \changes{v1.6i}{1994/11/22}{Fixed empty accents. Again.} +% \changes{v1.6i}{1994/11/22}{Corrected \cs{dots} so that there's no +% kerning in monowidth fonts.} +% \changes{v1.6i}{1994/11/22}{Corrected typo with +% \cs{mathunderscore}.} +% \changes{v1.6h}{1994/11/17}{(DPC) \cs{@tempa} to \cs{reserved@a}} +% \changes{v1.6d}{1994/11/02}{Wrapped lines longer than 70 characters.} +% \changes{v1.6d}{1994/10/30}{Added math commands.} +% \changes{v1.6d}{1994/10/30}{Added OML encoding.} +% \changes{v1.6d}{1994/10/30}{Added \cs{textcircled}.} +% \changes{v1.6d}{1994/10/30}{Added \cs{DeclareTextCompositeCommand}.} +% \changes{v1.6c}{1994/10/29}{Renamed \cs{P}, \cs{S}, \cs{dag} and +% \cs{ddag} to \cs{textparagraph}, \cs{textsection}, +% \cs{textdagger} and \cs{textdaggerdbl}.} +% \changes{v1.6b}{1994/10/27}{Removed the enc.def files} +% \changes{v1.6a}{1994/10/25}{Added \cs{ProvideTextCommand}, +% \cs{UseTextSymbol}, +% \cs{UseTextAccent}, +% \cs{DeclareTextSymbolDefault}, +% \cs{DeclareTextAccentDefault}, +% \cs{DeclareTextCommandDefault}, and +% \cs{ProvideTextCommandDefault}.} +% \changes{v1.5m}{1994/10/18}{Added new definitions of \cs{patterns} +% and \cs{hyphenation}.} +% \changes{v1.5l}{1994/10/07}{Moved the ogonek accent.} +% \changes{v1.5k}{1994/05/18}{Removed braces from \cs{pounds} and +% \cs{dollar}.} +% \changes{v1.5k}{1994/05/18}{Replaced \cs{defaultencoding} with +% \cs{encodingdefault}.} +% \changes{v1.5k}{1994/05/18}{Made dotted-i produce `i'.} +% \changes{v1.5j}{1994/05/17}{Added braces to \cs{pounds} so it works +% as a subscript.} +% \changes{v1.5i}{1994/05/16}{Fixed a bug with \cs{d}.} +% \changes{v1.5h}{1994/05/16}{Added \cs{NG}, \cs{ng}, \cs{TH}, +% \cs{th}, \cs{DH}, \cs{dh}, \cs{DJ} and \cs{dj}.} +% \changes{v1.5h}{1994/05/16}{Added \cs{r} (ring accent) and \cs{k} +% (ogonek) accents.} +% \changes{v1.5h}{1994/05/16}{Removed \cs{P} from the OT1 definitions +% file.} +% \changes{v1.5h}{1994/05/16}{Fixed a bug with \cs{pounds}.} +% \changes{v1.5g}{1994/05/16}{Made fontenc.sty use the new mixed-case +% encoding files.} +% \changes{v1.5f}{1994/05/16}{Revert code so that the encoding +% given is used in \cs{DeclareTextCommand} (FMi)} +% \changes{v1.5f}{1994/05/16}{enc files now have uc encoding name +% parts (FMi)} +% \changes{v1.5e}{1994/05/14}{Replaced \cs{ENC@cmd} by \cs{ENC-cmd}.} +% \changes{v1.5d}{1994/05/14}{Rewrote \cs{DeclareTextCommand} to define +% its argument to use the current encoding by default, rather than +% the encoding provided to \cs{DeclareTextCommand}.} +% \changes{v1.5d}{1994/05/14}{Tidied up the documentation.} +% \changes{v1.5c}{1994/05/14}{Added the fontenc package.} +% \changes{v1.5c}{1994/05/14}{Fixed a bug which caused an infinite loop +% if \cs{f@encoding} was incorrectly set.} +% \changes{v1.5c}{1994/05/14}{Moved fontsmpl to its own dtx file.} +% \changes{v1.5b}{1994/05/13}{Added \cmd\{, \cmd\} and \cmd\$.} +% \changes{v1.5b}{1994/05/13} +% {Replaces \cs{space} by `~' in \cs{csname}.} +% \changes{v1.5b}{1994/05/13}{Renamed \cs{DeclareProtectedCommand} to +% \cs{DeclareRobustCommand}.} +% \changes{v1.5a}{1994/05/11}{Renamed the commands again. Made the +% encoding part of the command syntax. Added the +% \cs{DeclareTextCommand} interface. Used +% \cs{DeclareProtectedCommand}.} +% \changes{v1.4a}{1994/05/01}{Renamed the commands, removed the +% \cs{EncodingSpecific} command. Turned all slots into decimal. +% Added \cs{a}.} +% \changes{v1.4a}{1994/05/01}{Removed Rokicki's encoding.} +% \changes{v1.3d}{1993/12/18}{Some T1 stuff had drifted into the OT1 +% file.} +% \changes{v1.3c}{1993/12/18}{A new syntax, separating +% accent-definitions from encoing-specific definitions, and +% allowing encoding-specific \cs{chardef}, \cs{let}, etc.} +% \changes{v1.3c}{1993/12/18}{Rewrote for the new syntax of +% \cs{EncodingSpecific}.} +% \changes{v1.3b}{1993/12/18}{Corrected typos.} +% \changes{v1.3b}{1993/12/18}{Replaced the missing last argument to +% \cs{DeclareFontEncoding}.} +% \changes{v1.3a}{1993/12/18}{Replaced OT3 by XXX} +% \changes{v1.3}{1993/12/17}{Added \cs{EncodingSpecificAccent}, +% \cs{EncodingSpecificAccentedLetter} and +% \cs{EncodingSpecificCommand}.} +% \changes{v1.3}{1993/12/17}{Made Rokicki's encoding a proper encoding +% scheme rather than a variant of OT1.} +% \changes{v1.2b}{1993/12/13}{Corrected file name in driver code.} +% \changes{v1.2a}{1993/12/11}{Corrected for t1enc, math.} +% \changes{v1.2}{1993/12/10}{Added source code for t1enc.sty.} +% \changes{v1.1}{1993/12/07}{Made all character numbers decimal.} +% \changes{v1.1}{1993/12/07}{Removed a lot of equal signs and the +% like.} +% +% +% \section{Font encodings} +% +% This section of the kernel contains commands for declaring +% encoding-specific +% commands, such as accents. It also contains the code for some of +% the encoding files, including |omlenc.def|, +% |omsenc.def|, |t1enc.def| and |ot1enc.def| files, which define +% the |OLM|, +% |OMS|, |T1| and |OT1| encodings, and the |fontenc| package +% for selecting encodings. +% +% The |fontenc| package has options for encodings, of which the +% last option is the default encoding. For example, to use the +% |OT2|, |OT3| and |T1| encodings, with |T1| as the default, you +% say: +%\begin{verbatim} +% \usepackage[OT2,OT3,T1]{fontenc} +%\end{verbatim} +% The standard kernel set-up loads font encoding files and selects +% an encoding as follows. +%\begin{verbatim} +% \input {omlenc.def} +% \input {t1enc.def} +% \input {ot1enc.def} +% \input {omsenc.def} +% \fontencoding{OT1} +%\end{verbatim} +% Note that the files in the standard |inputenc| package depend on +% this behaviour of the kernel. +% +% The syntax for declaring encoding-specific commands is: +% \begin{quote} +% |\DeclareTextCommand{|^^A +% \meta{command}|}{|^^A +% \meta{encoding}|}|\\\hspace*{\fill}|[|^^A +% \meta{number}|][|^^A +% \meta{default}|]{|^^A +% \meta{commands}|}| +% \end{quote} +% This command is like |\newcommand|, except that it defines a +% command which is specific to one encoding. The resulting command +% is always robust, even if its definition is fragile. For example, +% the definition of |\l| in the |OT1| encoding is: +%\begin{verbatim} +% \DeclareTextCommand{\l}{OT1}{{\@xxxii l}} +%\end{verbatim} +% |\DeclareTextCommand| takes the same optional arguments as +% |\newcommand|. +% \begin{quote} +% |\ProvideTextCommand{|^^A +% \meta{command}|}{|^^A +% \meta{encoding}|}|\\\hspace*{\fill}|[|^^A +% \meta{number}|][|^^A +% \meta{default}|]{|^^A +% \meta{commands}|}| +% \end{quote} +% This acts like |\DeclareTextCommand|, but does nothing if the +% command is already defined. +% \begin{quote} +% |\DeclareTextSymbol{|^^A +% \meta{command}|}{|^^A +% \meta{encoding}|}{|^^A +% \meta{slot}|}| +% \end{quote} +% This command defines a text symbol, with a particular slot in that +% encoding. The commands: +% \changes{v1.9h}{1997/12/17}{Example corrected, braces removed.} +%\begin{verbatim} +% \DeclareTextSymbol{\ss}{OT1}{25} +% \DeclareTextCommand{\ss}{OT1}{\char25 } +%\end{verbatim} +% have the same effect, but the |\DeclareTextSymbol| is faster. +% \begin{quote} +% |\DeclareTextAccent{|^^A +% \meta{command}|}{|^^A +% \meta{encoding}|}{|^^A +% \meta{slot}|}| +% \end{quote} +% \changes{v1.8e}{1996/11/23}{Corrected description} +% \changes{v1.9k}{1997/12/31}{Further correction} +% This command declares a text accent. The commands: +%\begin{verbatim} +% \DeclareTextAccent{\"}{OT1}{127} +% \DeclareTextCommand{\"}{OT1}{\add@accent {127}} +%\end{verbatim} +% have the same effect. +% \changes{v1.8c}{1996/10/27} +% {Corrected syntax descriptions} +% \begin{quote} +% |\DeclareTextComposite{|^^A +% \meta{command}|}|\\\hspace*{\fill}|{|^^A +% \meta{encoding}|}{|^^A +% \meta{argument}|}{|^^A +% \meta{slot}|}| +% \end{quote} +% This command declares a composite letter, for example in the |T1| +% encoding |\'{a}| is slot 225, which is declared by: +%\begin{verbatim} +% \DeclareTextComposite{\'}{T1}{a}{225} +%\end{verbatim} +% \changes{v1.8e}{1996/11/23} +% {Corrected description} +% The \emph{command} will normally have been declared with +% |\DeclareTextAccent|, or as a one-argument |\DeclareTextCommand|. +% +% |\DeclareTextComposite| is the most common example of using +% the more general declaration +% |\DeclareTextCompositeCommand|, which can define a composite +% to be an arbitrary piece of text. +% \begin{quote} +% |\DeclareTextCompositeCommand{|^^A +% \meta{command}|}|\\\hspace*{\fill}|{|^^A +% \meta{encoding}|}{|^^A +% \meta{argument}|}{|^^A +% \meta{text}|}| +% \end{quote} +% For example, in the OT1 encoding \r A has a hand-crafted +% defintion this is declared as follows +%\begin{verbatim} +% \DeclareTextCompositeCommand{\r}{OT1}{A} +% {\leavevmode\setbox\z@\hbox{!}\dimen@\ht\z@\advance\dimen@-1ex% +% \rlap{\raise.67\dimen@\hbox{\char23}}A} +%\end{verbatim} +% \changes{v1.8e}{1996/11/23} +% {Corrected description} +% The \emph{command} will normally have been declared with +% |\DeclareTextAccent|, or as a one-argument |\DeclareTextCommand|. +% +% The commands defined using the above declarations can be used in +% two ways. +% Normally they are used by just calling the command in the +% appropriate encoding, for example |\ss|. However, sometimes you +% may wish to use a command in an encoding where it is not defined. +% If the command has no arguments, then you can use it in another +% encoding by calling |\UseTextSymbol|: +% \begin{quote} +% |\UseTextSymbol{|^^A +% \meta{encoding}|}{|^^A +% \meta{command}|}| +% \end{quote} +% +% \task{Document the problems of these commands, see pr/3160} +% \changes{v1.9e}{1997/08/05}{Corrected order of arguments in +% \cs{UseTextSymbol} example.} +% For example, |\UseTextSymbol{OT1}{\ss}| has the same effect as: +%\begin{verbatim} +% {\fontencoding{OT1}\selectfont\ss} +%\end{verbatim} +% If the command has one argument then you can use it in another +% encoding by calling +% |\UseTextAccent|: +% \begin{quote} +% |\UseTextAccent{|^^A +% \meta{encoding}|}{|^^A +% \meta{command}|}{|^^A +% \meta{text}|}| +% \end{quote} +% For example, if the current encoding is |OT2| then +% |\UseTextAccent{OT1}{\'}{a}| has the same effect as: +%\begin{verbatim} +% {\fontencoding{OT1}\selectfont\'{\fontencoding{OT2}\selectfont a}} +%\end{verbatim} +% \changes{v1.8e}{1996/11/23} +% {Extended description} +% You can also declare a default definition for a text command, which +% will be used if the current encoding has no appropriate definition. +% Such use will also set the definition for this command in the +% current encoding to equal this default definition; this makes +% subsequent uses of the command much faster. +% \begin{quote} +% |\DeclareTextCommandDefault{|^^A +% \meta{command}|}{|^^A +% \meta{definition}|}| +% \end{quote} +% For example, the default definition of the command +% |\textonequarter| (which produces the fraction $\frac14$) could be +% built using math mode: +%\begin{verbatim} +% \DeclareTextCommandDefault{\textonequarter}{\ensuremath {\frac14}} +%\end{verbatim} +% There is a matching |\Provide| command which will not override an +% existing default definition: +% \begin{quote} +% |\ProvideTextCommandDefault{|^^A +% \meta{command}|}{|^^A +% \meta{definition}|}| +% \end{quote} +% The most common use for these commands is to use symbols from +% other encodings, so there are some optimizations provided: +% \begin{quote} +% |\DeclareTextSymbolDefault{|^^A +% \meta{command}|}|^^A +% \meta{encoding}|}|\\ +% |\DeclareTextAccentDefault{|^^A +% \meta{command}|}|^^A +% \meta{encoding}|}| +% \end{quote} +% are short for: +% \begin{quote} +% |\DeclareTextCommandDefault{|^^A +% \meta{command}|}|\\\hspace*{\fill}^^A +% |{\UseTextSymbol{|^^A +% \meta{encoding}|}{|\meta{command}|}}| \\ +% |\DeclareTextCommandDefault[1]{|^^A +% \meta{command}|}|\\\hspace*{\fill}^^A +% |{\UseTextAccent{|^^A +% \meta{encoding}|}{|\meta{command}|}{#1}}| +% \end{quote} +% For example, to make |OT1| the default encoding for |\ss| and +% |\'| you say: +%\begin{verbatim} +% \DeclareTextSymbolDefault{\ss}{OT1} +% \DeclareTextAccentDefault{\'}{OT1} +%\end{verbatim} +% Note that you can use these commands on any zero- or one-argument +% commands declared with |\DeclareText*| or |\ProvideText*|, not +% just those defined using |\DeclareTextSymbol| or +% |\DeclareTextAccent|. +% +% \subsection{Removing encoding-specific commands} +% \label{sec:removeencspec} +% +% \changes{v1.9o}{1998/03/20}{Documentation added for pr/2783} +% +% In some cases encoding definitions are given to provide some limited +% support since nothing better is available, for example, the definition +% for |\textdollar| in \texttt{OT1} is a hack since \$ and \pounds{} +% actually share the same slot in this encoding. Thus if such a glyph +% becomes available in a different encoding (e.g., \texttt{TS1}) one +% would like to get rid of the flacky one and make the default +% definition point to the new encoding. In such a case defining +%\begin{verbatim} +% \DeclareTextSymbol{\textdollar}{TS1}{36} +% \DeclareTextSymbolDefault{\textdollar}{TS1} +%\end{verbatim} +% is not enough since if typesetting in \texttt{OT1} \LaTeX{} will +% still find the encoding specific-definition for \texttt{OT1} and +% therefore ignore the new default. +% Therefore to ensure that in this case the \texttt{TS1} version is +% used we have to remove the \texttt{OT1} declaration: +%\begin{verbatim} +% \UndeclareTextCommand{\textdollar}{OT1} +%\end{verbatim} +% +% Since the \$ sign is a proper glyph in the \texttt{T1} encoding there +% is no point removing its definition and forcing \LaTeX{} to pick up +% the \texttt{TS1} version if typesetting in this encoding. +% However, assume you want to use the variant dollar sign, +% i.e., \textdollaroldstyle{} +% for your dollars. In that case you have to get rid of the \texttt{T1} +% declaration as well, e.g., the following would do that for you: +%\begin{verbatim} +% \UndeclareTextCommand{\textdollar}{OT1} +% \UndeclareTextCommand{\textdollar} {T1} +% \DeclareTextCommandDefault{\textdollar} +% {\UseTextSymbol{TS1}\textdollaroldstyle} +%\end{verbatim} +% +% \subsection{The order of declarations}\label{sec:orderofdecls} +% +% \changes{v1.9o}{1998/03/20}{Documentation added about order of decls} +% +% If an encoding-specific command is defined for more than one encoding, +% then it will execute fastest in the encoding in which it was defined +% last since its top-level definition will be set up to execute in that +% encoding without any overhead. +% +% For this reason the file \texttt{fonttext.ltx} currently first loads +% the definitions for the \texttt{T1} encoding and then those for the +% \texttt{OT1} encoding so that typesetting in \texttt{OT1} is optimized +% since that is (still) the default. However, when \texttt{T1} is +% explicitly requested (via |\usepackage[T1]{fontenc}|) the +% top-level definitions are automatically changed to favour +% \texttt{T1} since its declarations are reloaded in the process. +% +% For the same reason default declarations should never come last since +% they are implemented as a special encoding themselves (with the +% name |?|). +% Specifying them last would simply mean to make those encoding-specific +% commands equally inefficient in all encodings. Therefore the +% \texttt{textcomp} package, for example, first sets up all defaults +% to point to \texttt{TS1} and then declares the commands in the +% \texttt{TS1} encoding. +% +% +% \StopEventually{} +% +% \subsection{Docstrip modules} +% +% This |.dtx| file is be used to generate several related files +% containing font encoding definitions. The mutually exclusive +% docstrip options are listed here. +% \begin{center} +% \begin{tabular}{lp{10cm}} +% |T1| & generates |t1enc.def| for the Cork encoding. \\ +% |TS1| & generates |ts1enc.def| for the Text Companion +% encoding. \\ +% |TS1sty| & generates |textcomp.sty|, package that sets up use +% of the Text Companion encoding. \\ +% |OT1| & generates |ot1enc.def| for Knuth's CM encoding. \\ +% |OMS| & generates |omsenc.def| for Knuth's +% math symbol encoding. \\ +% |OML| & generates |omlenc.def| for Knuth's +% math letters encoding. \\ +% |OT4| & generates |ot4enc.def| for the Polish extension to +% the OT1 encoding, created by B.~Jackowski and +% M.~Ry\'cko for use with the Polish version of +% Computer Modern and Computer Concrete.\\ +% |package| & generates |fontenc.sty| for +% selecting encodings. \\ +% |2ekernel| & for the kernel commands.\\ +% |autoload| & for the `autoload' kernel commands.\\ +% |autoerr| & for the autoerr.sty error message autoload file. +% \end{tabular} +% \end{center} +% \changes{1.0d}{1993/07/17}{changed \cs{catcoding} @} +% \changes{1.0f}{1993/08/13}{Protected against active @ sign.} +% \changes{1.0g}{1993/08/16}{Needs space after \cs{string}} +% \changes{1.1}{1993/12/07}{Protected all special characters with +% \cs{string}.} +% \changes{1.3}{1993/12/17}{Removed the catcode hackery, since the file +% is only read as a package in the preamble, and removed all the +% messages on the screen, which just confuse users. Replaced them +% by the appropriate \cs{ProvidesPackage} commands. Added XXXenc.} +% \changes{1.3b}{1993/12/18} +% {Fixed typos with \cs{ProvidesPackage} lines. +% Added the \cs{NeedsTeXFormat} line. Added the last argument to +% \cs{DeclareEncoding}. Moved the use of the encodings to after their +% declaration. } +% \changes{1.4a}{1994/04/29}{Removed Rokicki's OT1 variant encoding. +% Moved the driver to the top.} +% \changes{1.5a}{1994/05/11}{Made T1 and OT1 generate packages rather +% than def files. Renamed the `package' module to `teststy'.} +% \changes{1.5d}{1994/05/14}{Moved the driver to the top.} +% +% \subsection{Definitions for the kernel} +% +% \subsubsection{Declaration commands} +% +% \changes{1.3}{1993/12/17}{Added this section} +% \changes{1.3c}{1993/12/18}{Split \cs{EncodingSpecificAccent} up into +% \cs{EncodingSpecific} and \cs{DeclareAccent}.} +% \changes{1.4a}{1994/04/29}{Removed \cs{EncodingSpecific}. Renamed +% all the commands. Added \cs{DeclareTextGlyph} and +% \cs{UndeclareTextCommand}.} +% \changes{v1.5a}{1994/05/11}{Reimplemented \cs{DeclareTextCommand} +% using \cs{@changed@cmd} and \cs{DeclareProtectedCommand}.} +% \changes{v1.5c}{1994/05/14}{Fixed a bug which caused an infinite loop +% if \cs{f@encoding} was incorrectly set.} +% \changes{v1.5d}{1994/05/14}{Rewrote \cs{DeclareTextCommand} to define +% its argument to use the current encoding by default, rather than +% the encoding provided to \cs{DeclareTextCommand}.} +% \changes{v1.6a}{1994/10/25}{Added the \cs{Provide} commands, +% and the default definitions.} +% +% This section contains definitions for commands such as accents which +% depend on the current encoding. These commands will usually be kept +% in |.def| files, for example |ot1enc.def| contains the definitions +% for the |OT1| encoding. +% \begin{macrocode} +%<*2ekernel|autoload> +\message{font encodings,} +% \end{macrocode} +% +% \changes{v1.5d}{1994/10/27}{Rewrote \cs{DeclareTextSymbol} to define +% its argument to use the current encoding by default, to fit with +% \cs{DeclareTextCommand}.} +% +% \changes{v1.7a}{1994/11/30}{Redefined \cs{@changed@cmd} to expand in +% the mouth.} +% \changes{v1.7a}{1994/11/30}{Removed \cs{@changed@x@mouth} since +% \cs{@changed@x} now expands in the mouth.} +% +% \changes{v1.7r}{1995/11/28}{Renamed \cs{@changed@x@err} to +% \cs{TextSymbolUnavailable}.} +% \changes{v1.7r}{1995/11/28}{Added math mode checks to text commands.} +% Far too many macros in one block here! +% \begin{macro}{\DeclareTextCommand} +% \begin{macro}{\ProvideTextCommand} +% \begin{macro}{\DeclareTextSymbol} +% \begin{macro}{\@dec@text@cmd} +% \begin{macro}{\chardef@text@cmd} +% \begin{macro}{\@changed@cmd} +% \begin{macro}{\@changed@x} +% \begin{macro}{\TextSymbolUnavailable} +% \begin{macro}{\@inmathwarn} +% If you say: +%\begin{verbatim} +% \DeclareTextCommand{\foo}{T1}... +%\end{verbatim} +% then |\foo| is defined to be |\T1-cmd \foo \T1\foo|, +% where |\T1\foo| is \emph{one} control sequence, not two! +% We then call |\newcommand| to define |\T1\foo|. +% \begin{macrocode} +\def\DeclareTextCommand{% + \@dec@text@cmd\newcommand} +% \end{macrocode} +% +% \begin{macrocode} +\def\ProvideTextCommand{% + \@dec@text@cmd\providecommand} +% \end{macrocode} +% +% \begin{macrocode} +\def\@dec@text@cmd#1#2#3{% + \expandafter\def\expandafter#2% + \expandafter{% + \csname#3-cmd\expandafter\endcsname + \expandafter#2% + \csname#3\string#2\endcsname + }% + \let\@ifdefinable\@rc@ifdefinable + \expandafter#1\csname#3\string#2\endcsname} +% \end{macrocode} +% \changes{v1.99d}{2004/02/06}{New command added to fix +% severe bug: pr/3563} +% This command was introduced to fix a major bug +% in |\@dec@text@cmd| without changing that command itself. +% This was thought to be necessary because it is defined +% in more than one package. (Perhaps the more serious bug is to put +% complex low-level commands like this in packages?) +% +% The problem it solves is that whereas both |\newcommand| and +% |\providecommand| (used just above) both handle the +% resetting of |\@ifdefinable| (following its disabling in +% |\@dec@text@cmd|), the primitive |\chardef| neither needs the +% disabling, nor does the resetting. +% +% \begin{macrocode} +\def\chardef@text@cmd{% + \let\@ifdefinable\@@ifdefinable + \chardef + } +\def\DeclareTextSymbol#1#2#3{% + \@dec@text@cmd\chardef@text@cmd#1{#2}#3\relax + } +% \end{macrocode} +% +% The declarations are only available before |\begin{document}|. +% \changes{v1.7h}{1995/05/21}{Added several \cs{@onlypreamble}} +% \changes{v1.7k}{1995/06/05}{Removed \cs{protected@cmd} and replaced +% with explicit \cs{noexpand}.} +% \begin{macrocode} +\@onlypreamble\DeclareTextCommand +\@onlypreamble\DeclareTextSymbol +% \end{macrocode} +% The sneaky bit in all this is what |\T1-cmd \foo \T1\foo| does. +% There are five possibilities, depending on the current values of +% |\protect|, |\cf@encoding| and |\ifmmode|: +% \begin{itemize} +% \item If |\protect| is |\@typeset@protect| and |\cf@encoding| is +% |T1|, then we execute |\T1\foo|. This should be the normal +% behaviour, and is optimized for speed. +% \item If |\protect| is |\@typeset@protect|, |\cf@encoding| is +% (say) |OT1|, and |\OT1\foo| is defined, then we execute +% |\OT1\foo|. +% \item If |\protect| is |\@typeset@protect|, |\cf@encoding| is +% (say) |OT1|, we're in text mode, +% and |\OT1\foo| is undefined, then we define +% |\OT1\foo| to be the default value of |\foo|, and execute +% |\OT1\foo|. +% \item If |\protect| is |\@typeset@protect|, |\cf@encoding| is +% (say) |OT1|, we're in math mode, +% and |\OT1\foo| is undefined, then we execute the default value +% of |\foo|. (This is necessary so that things like +% |$X_\copyright$| work properly.) +% \item If |\protect| is not |\@typeset@protect| then we execute +% |\noexpand\foo|. For example, if we are writing to a file, +% then this results in |\foo| being written. If we are in a +% |\mark|, then |\foo| will be put in the mark---since |\foo| is +% robust, it will then survive all the things which may happen +% to it whilst it's a |\mark|. +% \end{itemize} +% So after all that, we will either execute the appropriate +% definition of |\foo| for the current encoding, or we will execute +% |\noexpand\foo|. +% +% The default value of |\foo| is |\?\foo| if it is defined, and an +% error message otherwise. +% +% When the encoding is changed from |T1| to |OT1|, |\T1-cmd| is +% defined to be |\@changed@cmd| and |\OT1-cmd| is defined to be +% |\@current@cmd|. This means that the test for what the current +% encoding is can be performed quickly. +% \begin{macrocode} +\def\@current@cmd#1{% + \ifx\protect\@typeset@protect + \@inmathwarn#1% + \else + \noexpand#1\expandafter\@gobble + \fi} +% \end{macrocode} +% +% \begin{macrocode} +\def\@changed@cmd#1#2{% + \ifx\protect\@typeset@protect + \@inmathwarn#1% + \expandafter\ifx\csname\cf@encoding\string#1\endcsname\relax + \expandafter\ifx\csname ?\string#1\endcsname\relax + \expandafter\def\csname ?\string#1\endcsname{% + \TextSymbolUnavailable#1% + }% + \fi + \global\expandafter\let + \csname\cf@encoding \string#1\expandafter\endcsname + \csname ?\string#1\endcsname + \fi + \csname\cf@encoding\string#1% + \expandafter\endcsname + \else + \noexpand#1% + \fi} +% \end{macrocode} +% \changes{v1.7m}{1995/10/09}{Autoload error} +% \changes{v1.7v}{1995/12/05}{Changed \cs{TextSymbolUnavailable} text} +% \begin{macrocode} +% +%<*2ekernel|autoerr> +\gdef\TextSymbolUnavailable#1{% + \@latex@error{% + Command \protect#1 unavailable in encoding \cf@encoding% + }\@eha} +% +%\gdef\TextSymbolUnavailable{\@autoerr\TextSymbolUnavailable} +%<*2ekernel|autoload> +% \end{macrocode} +% The command |\@inmathwarn| produces a warning message if we are +% currently in math mode. Note that since this command is used +% inside text commands, it can't call |\relax| before the +% |\ifmmode|. This means that it is possible for the warning to +% fail to be issued at the beginning of a row of an halign whose +% template enters math mode. This is probably a bad feature, but +% there's not much that can be done about it, since adding a |\relax| +% would break ligatures and kerning between text symbols. +% +% A more efficient solution would be to make |\@inmathwarn| and +% |\@inmatherr| equal to |\@empty| and |\relax| by default, and +% to have +% |\everymath| reset them to their usual definitions. This is left +% for future investigation (for example it may break some third +% party code). +% \begin{macrocode} +\def\@inmathwarn#1{% + \ifmmode + \@latex@warning{Command \protect#1 invalid in math mode}% + \fi} +% \end{macrocode} +% \end{macro} +% \end{macro} +% \end{macro} +% \end{macro} +% \end{macro} +% \end{macro} +% \end{macro} +% \end{macro} +% \end{macro} +% +% \changes{v1.7k}{1995/06/05}{Allowed \cs{ProvideTextCommandDefault} +% after the preamble.} +% +% \begin{macro}{\DeclareTextCommandDefault} +% \begin{macro}{\ProvideTextCommandDefault} +% These define commands with encoding |?|. +% +% Note that |\DeclareTextCommandDefault| can only be used in the +% preamble, but that the |\Provide| version is allowed in inputenc +% |.def| files, so is allowed anywhere. +% \begin{macrocode} +\def\DeclareTextCommandDefault#1{% + \DeclareTextCommand#1?} +% \end{macrocode} +% +% \begin{macrocode} +\def\ProvideTextCommandDefault#1{% + \ProvideTextCommand#1?} +% \end{macrocode} +% +% \begin{macrocode} +\@onlypreamble\DeclareTextCommandDefault +%\@onlypreamble\ProvideTextCommandDefault +% \end{macrocode} +% They require |\?-cmd| to be initialized as |\@changed@cmd|. +% \begin{macrocode} +\expandafter\let\csname?-cmd\endcsname\@changed@cmd +% \end{macrocode} +% \end{macro} +% \end{macro} +% +% \begin{macro}{\DeclareTextAccent} +% \changes{v1.5a}{1994/05/11} +% {Reimplemented using \cs{DeclareTextCommand}.} +% \changes{v1.7z}{1996/05/23} +% {Reimplemented using \cs{add@accent} to save space latex/2133} +% This is just a disguise for defining a \TeX~|\accent| command. +% \begin{macrocode} +\def\DeclareTextAccent#1#2#3{% + \DeclareTextCommand#1{#2}{\add@accent{#3}}} +% \end{macrocode} +% +% \begin{macrocode} +\@onlypreamble\DeclareTextAccent +% \end{macrocode} +% \end{macro} +% +% \changes{v1.7a}{1994/11/30}{Rewrote \cs{@text@composite} so it +% allows an empty argument, or an argument containing lots of +% commands.} +% +% \begin{macro}{\add@accent} +% \changes{v1.7z}{1996/05/23}{macro added. latex/2133} +% \changes{v1.91}{2000/08/30}{Rearranged but no change to final code, +% CAR (pr/3160)} +% To save space this code is shared between all text accents that are +% set using the |\accent| primitive. +% The argument is pre-set in a box so that any +% font loading that is needed is already done within the box. +% This is needed because font-loading involves grouping and that would +% prevent the accent mechanism from working so that the accent would +% not be positioned over the argument. +% Declarations that change the font should be allowed (only low-level +% ones are at present) inside the argument of an accent command, +% but not size changes, as they involve |\setbox| operations which +% also inhibit the mechanism of the |\accent| primitive. +% +% Note that the whole process is within a group. +% \changes{v1.9y}{2000/01/30}{Use \cs{hmode@bgroup} where applicable +% (pr/3160)} +% For a detailed discussion of this reimplementation and its +% deficiencies, see pr/3160. +% \task{Improve this and document its problems, see pr/3160} +% \changes{v1.9z}{2000/01/30}{Macro reimplemented (pr/3160)} +% \begin{macrocode} +\def\add@accent#1#2{\hmode@bgroup +% \end{macrocode} +% Turn off the group in |\UseTextSymbol| in case this is used +% inside the argument of |\add@accent|. +% \begin{macrocode} + \let\hmode@start@before@group\@firstofone + \setbox\@tempboxa\hbox{#2% +% \end{macrocode} +% When presetting the argument in a box we record its |\spacefactor| +% for later use after the accent got typeset. This way something like +% |\`A| gets the spacefactor of |A| (i.e., 999) rather than the +% default value of 1000. +% \changes{v1.9q}{1998/06/12} +% {Explicitly set \cs{spacefactor} after \cs{accent} (pr/2877)} +% \begin{macrocode} + \global\mathchardef\accent@spacefactor\spacefactor}% + \accent#1 #2\egroup\spacefactor\accent@spacefactor} +% \end{macrocode} +% Default definition for |\accent@spacefactor| prevents a horrible +% death of the above macro inside an unprotected |\edef|. +% \changes{v1.9w}{1999/10/28}{Give \cs{accent@spacefactor} a default +% definition (pr/3084)} +% \begin{macrocode} +\let\accent@spacefactor\relax +% \end{macrocode} +% \end{macro} +% +% \begin{macro}{\hmode@bgroup} +% \changes{v1.9y}{2000/01/30}{Macro added} +% \begin{macrocode} +\def\hmode@bgroup{\leavevmode\bgroup} +% \end{macrocode} +% \end{macro} +% +% +% \begin{macro}{\DeclareTextCompositeCommand} +% \changes{v1.7z}{1996/05/23} +% {Modified to cope with new \cs{add@accent} command: required +% removal of check for one argument-command} +% \begin{macro}{\DeclareTextComposite} +% \changes{v1.7l}{1995/06/09}{Rewrote \cs{DeclareTextComposite} to +% define the composite as a no-argument command rather than a +% two-argument command.} +% \begin{macro}{\@text@composite} +% \begin{macro}{\@text@composite@x} +% \begin{macro}{\@strip@args} +% \changes{v1.8c}{1996/10/27} +% {Removed macro} +% Another amusing game to play with |\expandafter|, |\csname|, and +% |\string|. When you say +% |\DeclareTextCompositeCommand{\foo}{T1}{a}{bar}|, we look to see +% if the expansion of |\T1\foo| begins with |\@text@composite|, and +% if it doesn't, we redefine |\T1\foo| to be: +%\begin{verbatim} +% #1 -> \@text@composite \T1\foo #1\@empty \@text@composite {...} +%\end{verbatim} +% where |...| is the +% previous definition of |\T1\foo|. Finally, we define |\\T1\foo-a| +% to expand to |bar|. +% \begin{macrocode} +\def\DeclareTextCompositeCommand#1#2#3#4{% + \expandafter\let\expandafter\reserved@a\csname#2\string#1\endcsname + \expandafter\expandafter\expandafter\ifx + \expandafter\@car\reserved@a\relax\relax\@nil \@text@composite \else + \edef\reserved@b##1{% + \def\expandafter\noexpand + \csname#2\string#1\endcsname####1{% + \noexpand\@text@composite + \expandafter\noexpand\csname#2\string#1\endcsname + ####1\noexpand\@empty\noexpand\@text@composite + {##1}}}% + \expandafter\reserved@b\expandafter{\reserved@a{##1}}% + \fi + \expandafter\def\csname\expandafter\string\csname + #2\endcsname\string#1-\string#3\endcsname{#4}} +% \end{macrocode} +% +% \begin{macrocode} +\@onlypreamble\DeclareTextCompositeCommand +% \end{macrocode} +% This all works because: +%\begin{verbatim} +% \@text@composite \T1\foo A\@empty \@text@composite {...} +%\end{verbatim} +% expands to +% |\\T1\foo-A| if |\\T1\foo-A| has been defined, and |{...}| +% otherwise. +% +% Note that |\@text@composite| grabs the first token of the +% argument and puts just that in the +% csname. This is so that |\'{\textit{e}}| will work---it checks +% whether |\\T1\'-\textit| is defined (which presumably it isn't) +% and so expands to |{\accent 1 \textit{e}}|. +% +% This trick won't always work, for example |\'{{\itshape e}}| will +% expand to (with spaces added for clarity): +%\begin{verbatim} +% \csname \string \T1\' - \string {\itshape e} \@empty \endcsname +%\end{verbatim} +% which will die pretty horribly. Unfortunately there's not much +% can be done about this if we're going to use |\csname| lookups as a +% fast way of accessing composites. +% +% This has an unfortunate `misfeature' though, which is that in +% the T1 encoding, |\'{aa}| produces \'a. This is not the expected +% behaviour, and should perhaps be fixed if the fix doesn't affect +% performance too badly. +% +% Finally, it's worth noting that the |\@empty| is used in +% |\@text@composite| so that accents will work even when the +% argument is empty. If you say |\'{}| then this looks up +% |\\T1\'-\@empty|, which ought to be |\relax|, and so all is well. +% If we didn't include the |\@empty|, then |\'{}| would expand to: +%\begin{verbatim} +% \csname \string \T1\' - \string \endcsname +%\end{verbatim} +% so the |\endcsname| would be |\string|'ed and the whole of the +% rest of the document would be put inside the |\csname|. This +% would not be good. +% \begin{macrocode} +\def\@text@composite#1#2#3\@text@composite{% + \expandafter\@text@composite@x + \csname\string#1-\string#2\endcsname} +% \end{macrocode} +% +% \changes{v1.7z}{1996/05/23} +% {\cs{expandafter} added to match other changes for latex/2133} +% \changes{v1.9r}{1999/01/06}{New impl for latex/2930} +% \changes{v1.9s}{1999/01/13}{Simplified solution for latex/2930} +% Originally the |\@text@composite@x| macro had two arguments and if +% |#1| was not |\relax| it was executed, otherwise |#2| was executed. +% All this happened within the |\ifx| code so that neither |#1| +% nor |#2| could have picked up any additional arguments form +% the input stream. +% This has now being changed using the typical |\@firstoftwo| / +% |\@secondoftwo| coding. This way the +% final expansion will happen without any |\else| or |\fi| +% intervening in the case that we need to get a further token +% from the input stream. +% \begin{macrocode} +\def\@text@composite@x#1{% + \ifx#1\relax + \expandafter\@secondoftwo + \else + \expandafter\@firstoftwo + \fi + #1} +% \end{macrocode} +% The command |\DeclareTextComposite| uses +% |\DeclareTextCompositeCommand| to declare a command which +% expands out to a single glyph. +% \changes{v1.8a}{1996/07/19} +% {Use char 0 not @ as carrier for \cs{lowercase} /2197} +% \begin{macrocode} +\catcode\z@=11\relax +% \end{macrocode} +% +% \begin{macrocode} +\def\DeclareTextComposite#1#2#3#4{% + \def\reserved@a{\DeclareTextCompositeCommand#1{#2}{#3}}% + \bgroup + \lccode\z@#4% + \lowercase{% + \egroup + \reserved@a ^^@}} +% \end{macrocode} +% +% \begin{macrocode} +\catcode\z@=15\relax +% \end{macrocode} +% +% \begin{macrocode} +\@onlypreamble\DeclareTextComposite +% \end{macrocode} +% \end{macro} +% \end{macro} +% \end{macro} +% \end{macro} +% \end{macro} +% +% \begin{macro}{\UseTextAccent} +% \begin{macro}{\UseTextSymbol} +% \changes{v1.7p}{1995/11/17}{Support \cs{@wrong@font@char} latex/1676} +% \changes{v1.7q}{1995/11/18}{Modify message slightly} +% \begin{macro}{\@use@text@encoding} +% \changes{v1.91}{2000/08/30}{Rearranged but no change to final code, +% CAR (pr/3160)} +% These fragile commands access glyphs from different encodings. +% They use grotty low-level calls to the font selection scheme for +% speed, and in order to make sure that |\UseTextSymbol| doesn't +% do anything which you're not allowed to do between an |\accent| +% and its glyph. +% +% For a detailed discussion of this reimplementation and its +% deficiencies, see pr/3160. +% \task{Improve this and document its problems, see pr/3160} +% \changes{v1.9z}{2000/01/30}{Macro reimplemented (pr/3160)} +% \begin{macrocode} +\def\UseTextAccent#1#2#3{% + \hmode@start@before@group + {% +% \end{macrocode} +% Turn off the group in |\UseTextSymbol| in case this is used +% inside the arguments of |\UseTextAccent|. +% \begin{macrocode} + \let\hmode@start@before@group\@firstofone + \let\@curr@enc\cf@encoding + \@use@text@encoding{#1}% + #2{\@use@text@encoding\@curr@enc#3}% + }} +% \end{macrocode} +% +% \changes{v1.9z}{2000/01/30}{Macro reimplemented (pr/3160)} +% \begin{macrocode} +\def\UseTextSymbol#1#2{% + \hmode@start@before@group + {% + \def\@wrong@font@char{\MessageBreak + for \noexpand\symbol`\string#2'}% + \@use@text@encoding{#1}% + #2% + }% + } +% \end{macrocode} +% +% \begin{macrocode} +\def\@use@text@encoding#1{% + \edef\f@encoding{#1}% + \xdef\font@name{% + \csname\curr@fontshape/\f@size\endcsname}% + \pickup@font + \font@name + \@@enc@update} +% \end{macrocode} +% \end{macro} +% \end{macro} +% \end{macro} +% +% \begin{macro}{\hmode@start@before@group} +% The |\hmode@start@before@group| starts hmode and should be +% immediately followed by an explicit |{...}|. Its purpose is to +% ensure that hmode is started before this group is opened. Inside +% |\add@accent| and |\UseTextAccent| it is redefined to remove this +% group so that it doesn't conflict with the |\accent| primitive. +% +% For a detailed discussion see pr/3160. +% \changes{v1.9z}{2000/01/30}{Macro added (pr/3160)} +% \begin{macrocode} +\let\hmode@start@before@group\leavevmode +% \end{macrocode} +% \end{macro} +% +% \begin{macro}{\DeclareTextSymbolDefault} +% \begin{macro}{\DeclareTextAccentDefault} +% Some syntactic sugar. Again, these should probably be optimized +% for speed. +% \begin{macrocode} +\def\DeclareTextSymbolDefault#1#2{% + \DeclareTextCommandDefault#1{\UseTextSymbol{#2}#1}} +% \end{macrocode} +% +% \begin{macrocode} +\def\DeclareTextAccentDefault#1#2{% + \DeclareTextCommandDefault#1{\UseTextAccent{#2}#1}} +% \end{macrocode} +% +% \begin{macrocode} +\@onlypreamble\DeclareTextSymbolDefault +\@onlypreamble\DeclareTextAccentDefault +% \end{macrocode} +% \end{macro} +% \end{macro} +% +% +% \begin{macro}{\UndeclareTextCommand} +% This command safely removes and encoding specific declaration +% for a given encoding. It is helpful if one intends to use the +% default definition always and therefore wants to get rid of +% a declaration for some specific encoding. +% \changes{v1.9o}{1998/03/20}{Macro added for pr/2783} +% \begin{macrocode} +\def\UndeclareTextCommand#1#2{% +% \end{macrocode} +% If there is no declaration for the current encoding do nothing. +% (This makes a hash table entry but without e\TeX{} we can't do +% anything about that). +% \begin{macrocode} + \expandafter\ifx\csname#2\string#1\endcsname\relax + \else +% \end{macrocode} +% Else: throw away that declaration. +% \begin{macrocode} + \global\expandafter\let\csname#2\string#1\endcsname + \@undefined +% \end{macrocode} +% But this is unfortunately not enough, we have to take a look +% at the top-level definition of the encoding specific command +% which for a command |\foo| would look similar to +% |\T1-cmd \foo \T1\foo| (three tokens). +% +% Of course, instead of |T1| one could see a different encoding name; +% which one depends the encoding for which |\foo| was declared +% last. +% +% Now assume we have just removed the declaration for |\foo| in |T1| +% and the top-level of |\foo| expands to the above. Then we better +% change that pretty fast otherwise we do get an ``undefined csname +% error'' when we try to typeset |\foo| within |T1| instead of +% getting the default definition for |\foo|. +% And what is the best way to change that top-level definition? Well, +% the only ``encoding'' we know for sure will still be around is +% the default encoding denoted by |?|. +% +% Thus in case the last token of the top-level expansion +% is now undefined we change the declaration to look like +% |\?-cmd \foo \?\foo| which is done by the following +% (readable?) code: +% \begin{macrocode} + \expandafter\expandafter\expandafter + \ifx\expandafter\@thirdofthree#1\@undefined + \expandafter\gdef\expandafter#1\expandafter + {\csname ?-cmd\expandafter\endcsname\expandafter + #1\csname?\string#1\endcsname}% + \fi + \fi +} +% \end{macrocode} +% +% \begin{macrocode} +\@onlypreamble\UndeclareTextCommand +% \end{macrocode} +% \end{macro} +% +% +% \subsubsection{Hyphenation} +% +% \changes{v1.5l}{1994/10/18}{Added new definitions of \cs{patterns} +% and \cs{hyphenation}.} +% \changes{v1.6g}{1994/11/05}{Added setting of \cs{@typeset@protect} +% to \cs{patterns} and \cs{hyphenation}.} +% \changes{v1.6g}{1994/11/30}{Removed new definitions of \cs{patterns} +% and \cs{hyphenation}, since encoding-specific commands now expand +% in the mouth.} +% +% \begin{macro}{\patterns} +% \begin{macro}{\@@patterns} +% \begin{macro}{\hyphenation} +% \begin{macro}{\@@hyphenation} +% We redefine |\patterns| and |\hyphenation| to allow the use of +% commands declared with |\DeclareText*| to be used inside them. +% \begin{macrocode} +%\let\@@patterns\patterns +%\let\@@hyphenation\hyphenation +%\def\patterns{% +% \bgroup +% \let\protect\@empty +% \let\@typeset@protect\@empty +% \let\@changed@x\@changed@x@mouth +% \afterassignment\egroup +% \@@patterns +%} +%\def\hyphenation{% +% \bgroup +% \let\protect\@empty +% \let\@typeset@protect\@empty +% \let\@changed@x\@changed@x@mouth +% \afterassignment\egroup +% \@@hyphenation +%} +% \end{macrocode} +% \end{macro} +% \end{macro} +% \end{macro} +% \end{macro} +% +% \subsubsection{Miscellania} +% +% \changes{1.4a}{1994/05/01}{Added the \cs{a} command.} +% \changes{1.7a}{1994/11/30}{Redefined \cs{a} for the new scheme.} +% \changes{1.7b}{1994/12/02}{Redefined \cs{a} properly.} +% \changes{1.7g}{1995/03/03}{Corrected an error in documentation +% referring to the tabular rather than the tabbing +% environment.} +% \changes{v1.7n}{1995/11/02}{Changed internal name \cs{a} to +% \cs{@tabacckludge} to protect against redefinition by malicicous +% users.} +% +% \begin{macro}{\a} +% The |\a| command is used to access the accent commands even when +% they have been redefined (for example by the |tabbing| +% environment). Its internal name is |\@tabacckludge|. +% +% The |\string| within the |\csname| guards against something +% like |'| being active at the point of use. +% \changes{v1.9r}{1998/09/19}{Added \cs{string} (pr/2878)} +% \begin{macrocode} +\def\@tabacckludge#1{\expandafter\@changed@cmd + \csname\string#1\endcsname\relax} +\let\a=\@tabacckludge +% \end{macrocode} +% \end{macro} +% +% \changes{v1.6a}{1994/10/25}{Added the files OT1enc.def, T1enc.def and +% OMSenc.def.} +% \changes{v1.6b}{1994/10/27}{Removed the files OT1enc.def, T1enc.def +% and OMSenc.def.} +% +% \subsubsection{Default encodings} +% +% We define the default encodings for most commands to be either OT1, +% OML or OMS. These defaults are in the kernel and therefore +% fonts with these encodings must be available unless these +% defaults are redefined elsewhere. Recall that the standard kernel +% loads the encoding files for these encodings, and also that for +% the T1 encoding. +% +% The naming conventions in the kernel are not what we would use if we +% were starting from scratch\dots\ +% Those defined by DEK (like |\ae| and |\ss|) or by the \TeX{} Users +% Group Technical Working Group on multi-lingual typesetting (like +% |\th| and |\ng|) have short names. Those which were added to the +% kernel in 1993 and early 1994 are named after their Adobe glyph +% names (like |\guillemotleft| and |\quotedblbase|). Unfortunately, +% this naming scheme won't work for all glyphs, since some names (like +% |\space|) are already used, and some (like |\endash|) are very +% likely to be defined by users. So we're now using the naming scheme +% of |\text| followed by the Adobe name, (like |\textendash| and +% |\textsterling|). Except that some glyphs don't have Adobe names, +% so we're using the names used by fontinst for those (like +% |\textcompwordmark|). Sigh. +% +% \changes{v1.6a}{1994/10/25}{Added the defaults.} +% \changes{v1.6b}{1994/10/27}{Added more defaults for OT1.} +% \changes{v1.6c}{1994/10/29}{Added commands like \cs{dots} for use in +% text and math.} +% +% Some accents from OT1: +% \begin{macrocode} +\DeclareTextAccentDefault{\"}{OT1} +\DeclareTextAccentDefault{\'}{OT1} +\DeclareTextAccentDefault{\.}{OT1} +\DeclareTextAccentDefault{\=}{OT1} +\DeclareTextAccentDefault{\H}{OT1} +\DeclareTextAccentDefault{\^}{OT1} +\DeclareTextAccentDefault{\`}{OT1} +\DeclareTextAccentDefault{\b}{OT1} +\DeclareTextAccentDefault{\c}{OT1} +\DeclareTextAccentDefault{\d}{OT1} +\DeclareTextAccentDefault{\r}{OT1} +\DeclareTextAccentDefault{\u}{OT1} +\DeclareTextAccentDefault{\v}{OT1} +\DeclareTextAccentDefault{\~}{OT1} +% \end{macrocode} +% Some symbols from OT1: +% \changes{v1.8c}{1996/10/27} +% {Removed \cs{aa} and \cs{AA}} +% \begin{macrocode} +%\DeclareTextSymbolDefault{\AA}{OT1} +\DeclareTextSymbolDefault{\AE}{OT1} +\DeclareTextSymbolDefault{\L}{OT1} +\DeclareTextSymbolDefault{\OE}{OT1} +\DeclareTextSymbolDefault{\O}{OT1} +%\DeclareTextSymbolDefault{\aa}{OT1} +\DeclareTextSymbolDefault{\ae}{OT1} +\DeclareTextSymbolDefault{\i}{OT1} +\DeclareTextSymbolDefault{\j}{OT1} +\DeclareTextSymbolDefault{\l}{OT1} +\DeclareTextSymbolDefault{\oe}{OT1} +\DeclareTextSymbolDefault{\o}{OT1} +\DeclareTextSymbolDefault{\ss}{OT1} +\DeclareTextSymbolDefault{\textdollar}{OT1} +\DeclareTextSymbolDefault{\textemdash}{OT1} +\DeclareTextSymbolDefault{\textendash}{OT1} +\DeclareTextSymbolDefault{\textexclamdown}{OT1} +%\DeclareTextSymbolDefault{\texthyphenchar}{OT1} +%\DeclareTextSymbolDefault{\texthyphen}{OT1} +\DeclareTextSymbolDefault{\textquestiondown}{OT1} +\DeclareTextSymbolDefault{\textquotedblleft}{OT1} +\DeclareTextSymbolDefault{\textquotedblright}{OT1} +\DeclareTextSymbolDefault{\textquoteleft}{OT1} +\DeclareTextSymbolDefault{\textquoteright}{OT1} +\DeclareTextSymbolDefault{\textsterling}{OT1} +% \end{macrocode} +% Some symbols from OMS: +% \changes{v1.7t}{1995/11/29}{Added \cs{textbackslash} and +% \cs{textbar}.} +% \changes{v1.8c}{1996/10/27} +% {Added \cs{textasteriskcentered}} +% \changes{v1.95}{2002/06/16}{Added default for \cs{textbardbl} (pr/3400)} +% \begin{macrocode} +\DeclareTextSymbolDefault{\textasteriskcentered}{OMS} +\DeclareTextSymbolDefault{\textbackslash}{OMS} +\DeclareTextSymbolDefault{\textbar}{OMS} +\DeclareTextSymbolDefault{\textbardbl}{OMS} +\DeclareTextSymbolDefault{\textbraceleft}{OMS} +\DeclareTextSymbolDefault{\textbraceright}{OMS} +\DeclareTextSymbolDefault{\textbullet}{OMS} +\DeclareTextSymbolDefault{\textdaggerdbl}{OMS} +\DeclareTextSymbolDefault{\textdagger}{OMS} +\DeclareTextSymbolDefault{\textparagraph}{OMS} +\DeclareTextSymbolDefault{\textperiodcentered}{OMS} +\DeclareTextSymbolDefault{\textsection}{OMS} +\DeclareTextAccentDefault{\textcircled}{OMS} +% \end{macrocode} +% +% \changes{v1.6d}{1994/10/30}{Added OML encoding.} +% \changes{v1.6d}{1994/10/30}{Made \cs{textless} and \cs{textgreater} +% come from OML.} +% \changes{v1.6d}{1994/10/30}{Added \cs{t}.} +% \changes{v1.7k}{1995/06/05}{Commented out \cs{textless} and +% \cs{textgreater}.} +% +% Some symbols from OML: +% \changes{v1.7t}{1995/11/29}{Added \cs{textless} and +% \cs{textgreater}.} +% \begin{macrocode} +\DeclareTextSymbolDefault{\textless}{OML} +\DeclareTextSymbolDefault{\textgreater}{OML} +\DeclareTextAccentDefault{\t}{OML} +% \end{macrocode} +% +% \changes{v1.6d}{1994/10/30}{Added \cs{textcircled}.} +% \changes{v1.6d}{1994/10/30}{Rewrote \cs{copyright} to use +% \cs{textcircled}.} +% \changes{v1.6d}{1994/10/30}{Removed \cs{textregistered}.} +% \changes{v1.7k}{1995/06/05}{Save some tokens in +% \cs{textvisiblespace} and \cs{textunderscore}.} +% \changes{v1.7t}{1995/11/29}{Added \cs{textasciicircum}, +% \cs{textasciitilde}, \cs{textregistered} and \cs{texttrademark}.} +% \changes{v1.7u}{1995/12/01}{Made \cs{SS} a Default, rather than +% having the default point to the OT1 definition.} +% \changes{v1.7w}{1995/12/11}{Modified \cs{copyright}} +% \changes{v1.9a}{1997/04/30}{Introduced \cs{textcopyright} and modified +% \cs{copyright}} +% +% Some defaults we can fake. +% +% The interface for defining |\copyright| changed, it used to +% use |\expandafter| to add braces at the appropriate points. +% \begin{macrocode} +\DeclareTextCommandDefault{\textcopyright}{\textcircled{c}} +% \expandafter\def\expandafter +% \copyright\expandafter{\expandafter{\copyright}} +% \end{macrocode} +% +% \changes{v1.9a}{1997/04/30}{Modified \cs{textunderscore}, removing +% \cs{mathunderscore}} +% \changes{v1.9b}{1997/04/30}{Added \cs{leavevmode} to +% \cs{textunderscore}} +% \changes{v1.9d}{1997/05/07}{Added \cs{leavevmode} to +% \cs{textcompwordmark}} +% \begin{macrocode} +\DeclareTextCommandDefault{\textasciicircum}{\^{}} +\DeclareTextCommandDefault{\textasciitilde}{\~{}} +\DeclareTextCommandDefault{\textcompwordmark}{\leavevmode\kern\z@} +\DeclareTextCommandDefault{\textunderscore}{% + \leavevmode \kern.06em\vbox{\hrule\@width.3em}} +% \end{macrocode} +% +% \begin{macrocode} +\DeclareTextCommandDefault{\textvisiblespace}{% + \mbox{\kern.06em\vrule \@height.3ex}% + \vbox{\hrule \@width.3em}% + \hbox{\vrule \@height.3ex}} +% \end{macrocode} +% +% Using |\fontdimen3| in the next definition is some sort of a +% kludge (since it is the interword stretch) but it makes the +% ellipsis come out right in mono-spaced fonts too (since there it +% is zero). +% \begin{macrocode} +\DeclareTextCommandDefault{\textellipsis}{% + .\kern\fontdimen3\font + .\kern\fontdimen3\font + .\kern\fontdimen3\font} +% \end{macrocode} +% +% \changes{v1.9a}{1997/04/30}{Changed \cs{textsc} to \cs{scshape}} +% \changes{v1.95}{2002/06/18}{Changed def for \cs{textregistered} to +% avoid small caps (pr/3420)} +% \begin{macrocode} +%\DeclareTextCommandDefault{\textregistered}{\textcircled{\scshape r}} +\DeclareTextCommandDefault{\textregistered}{\textcircled{% + \check@mathfonts\fontsize\sf@size\z@\math@fontsfalse\selectfont R}} +\DeclareTextCommandDefault{\texttrademark}{\textsuperscript{TM}} +\DeclareTextCommandDefault{\SS}{SS} +% \end{macrocode} +% +% \changes{v1.9n}{1998/03/05}{Added masc/fem ords as in pr/2579} +% \begin{macrocode} +\DeclareTextCommandDefault{\textordfeminine}{\textsuperscript{a}} +\DeclareTextCommandDefault{\textordmasculine}{\textsuperscript{o}} +% \end{macrocode} +% +% \subsubsection{Math material} +% +% Some commands can be used in both text and math mode: +% \begin{macrocode} +\DeclareRobustCommand{\$}{\ifmmode\mathdollar\else\textdollar\fi} +\DeclareRobustCommand{\{}{\ifmmode\lbrace\else\textbraceleft\fi} +\DeclareRobustCommand{\}}{\ifmmode\rbrace\else\textbraceright\fi} +\DeclareRobustCommand{\P}{\ifmmode\mathparagraph\else\textparagraph\fi} +\DeclareRobustCommand{\S}{\ifmmode\mathsection\else\textsection\fi} +\DeclareRobustCommand{\dag}{\ifmmode{\dagger}\else\textdagger\fi} +\DeclareRobustCommand{\ddag}{\ifmmode{\ddagger}\else\textdaggerdbl\fi} +% \end{macrocode} +% +% For historical reasons |\copyright| +% needs |{}| around the definition in maths. +% +% \changes{v1.6f}{1994/11/04}{Added \cmd\_.} +% +% \changes{v1.9a}{1997/04/30}{Modified \cs{underscore}, removing +% \cs{mathunderscore}} +% \changes{v1.9a}{1997/04/30}{Introduced \cs{textcopyright} and modify +% \cs{copyright}} +% \begin{macrocode} +\DeclareRobustCommand{\_}{% + \ifmmode\nfss@text{\textunderscore}\else\textunderscore\fi} +\DeclareRobustCommand{\copyright}{% + \ifmmode{\nfss@text{\textcopyright}}\else\textcopyright\fi} +\DeclareRobustCommand{\pounds}{% + \ifmmode\mathsterling\else\textsterling\fi} +% \end{macrocode} +% +% \begin{macrocode} +\DeclareRobustCommand{\dots}{% + \ifmmode\mathellipsis\else\textellipsis\fi} +% \end{macrocode} +% +% \begin{macrocode} +\let\ldots\dots +% +% \end{macrocode} +% +% \changes{v1.6d}{1994/10/30}{Moved math commands here from ltmath.} +% \changes{v1.6f}{1994/11/04}{Added \cs{mathunderscore}.} +% \changes{v1.7k}{1995/06/05}{Moved math commands to fontdef.dtx.} +% +% +% \changes{1.4a}{1994/05/01}{Added the \cs{SaveAtCatcode} and +% \cs{RestoreAtCatcode} commands.} +% +% \changes{1.5a}{1994/05/12}{Removed the \cs{SaveAtCatcode} and +% \cs{RestoreAtCatcode} commands.} +% +% +% \subsection{Definitions for the OT1 encoding} +% +% \changes{1.3}{1993/12/17}{Removed all the hackery for use in +% \cs{DeclareFontEncoding}, and redid everything using +% \cs{DeclareTextFoo}.} +% \changes{1.3b}{1993/12/18}{Replaced the missing last argument to +% \cs{DeclareFontEncoding}.} +% \changes{1.3c}{1993/12/18}{Rewrote for the new syntax of +% \cs{EncodingSpecific}.} +% \changes{1.4a}{1994/05/01}{Rewrote for the new syntax.} +% \changes{1.5a}{1994/05/12}{Rewrote for the new syntax.} +% \changes{1.5h}{1994/05/16}{\cs{pounds} was still using u rather than +% ui shape.} +% \changes{1.6b}{1994/10/27}{Added: +% \cs{textemdash} +% \cs{textendash} +% \cs{textexclamdown} +% \cs{texthyphenchar} +% \cs{texthyphen} +% \cs{textquestiondown} +% \cs{textquotedblleft} +% \cs{textquotedblright} +% \cs{textquoteleft} +% \cs{textquoteright} +% } +% +% The definitions for the `\TeX{} text' (OT1) encoding. +% +% Declare the encoding. +% \begin{macrocode} +%<*OT1> +\DeclareFontEncoding{OT1}{}{} +% \end{macrocode} +% Declare the accents. +% \begin{macrocode} +\DeclareTextAccent{\"}{OT1}{127} +\DeclareTextAccent{\'}{OT1}{19} +\DeclareTextAccent{\.}{OT1}{95} +\DeclareTextAccent{\=}{OT1}{22} +\DeclareTextAccent{\^}{OT1}{94} +\DeclareTextAccent{\`}{OT1}{18} +\DeclareTextAccent{\~}{OT1}{126} +\DeclareTextAccent{\H}{OT1}{125} +\DeclareTextAccent{\u}{OT1}{21} +\DeclareTextAccent{\v}{OT1}{20} +\DeclareTextAccent{\r}{OT1}{23} +% \end{macrocode} +% Some accents have to be built by hand: +% Note that |\ooalign| and |\o@lign| must be inside a group. +% \changes{v1.7j}{1995/05/21}{Updated some plain macros} +% \changes{v1.7o}{1995/11/07}{Added \cs{leavevmode} at start of +% \cs{c}, otherwise the output routine might be invoked within the +% macro.} +% \changes{v1.9y}{2000/01/30}{Use \cs{hmode@bgroup} where applicable +% (pr/3160)} +% \begin{macrocode} +\DeclareTextCommand{\b}{OT1}[1] + {\hmode@bgroup\o@lign{\relax#1\crcr\hidewidth\sh@ft{29}% + \vbox to.2ex{\hbox{\char22}\vss}\hidewidth}\egroup} +\DeclareTextCommand{\c}{OT1}[1] + {\leavevmode\setbox\z@\hbox{#1}\ifdim\ht\z@=1ex\accent24 #1% + \else{\ooalign{\unhbox\z@\crcr\hidewidth\char24\hidewidth}}\fi} +\DeclareTextCommand{\d}{OT1}[1] + {\hmode@bgroup + \o@lign{\relax#1\crcr\hidewidth\sh@ft{10}.\hidewidth}\egroup} +% \end{macrocode} +% Declare the text symbols. +% \begin{macrocode} +\DeclareTextSymbol{\AE}{OT1}{29} +\DeclareTextSymbol{\OE}{OT1}{30} +\DeclareTextSymbol{\O}{OT1}{31} +\DeclareTextSymbol{\ae}{OT1}{26} +\DeclareTextSymbol{\i}{OT1}{16} +\DeclareTextSymbol{\j}{OT1}{17} +\DeclareTextSymbol{\oe}{OT1}{27} +\DeclareTextSymbol{\o}{OT1}{28} +\DeclareTextSymbol{\ss}{OT1}{25} +\DeclareTextSymbol{\textemdash}{OT1}{124} +\DeclareTextSymbol{\textendash}{OT1}{123} +% \end{macrocode} +% Using the ligatures helps with OT1 fonts that have +% |\textexclamdown| and |\textquestiondown| in unusual positions. +% \changes{v1.95}{2002/06/17}{Definition of \cs{textexclamdown} changed (pr/3368)} +% \changes{v1.95}{2002/06/17}{Definition of \cs{textquestiondown} changed (pr/3368)} +% \begin{macrocode} +%\DeclareTextSymbol{\textexclamdown}{OT1}{60} +%\DeclareTextSymbol{\textquestiondown}{OT1}{62} +\DeclareTextCommand{\textexclamdown}{OT1}{!`} +\DeclareTextCommand{\textquestiondown}{OT1}{?`} +%\DeclareTextSymbol{\texthyphenchar}{OT1}{`\-} +%\DeclareTextSymbol{\texthyphen}{OT1}{`\-} +\DeclareTextSymbol{\textquotedblleft}{OT1}{92} +\DeclareTextSymbol{\textquotedblright}{OT1}{`\"} +\DeclareTextSymbol{\textquoteleft}{OT1}{`\`} +\DeclareTextSymbol{\textquoteright}{OT1}{`\'} +% \end{macrocode} +% Some symbols which are faked from others: +% \changes{v1.7o}{1995/11/07}{Changed \cs{char}32 to \cs{@xxxii} (two +% tokens less).} +% \changes{v1.7o}{1995/11/07}{Replaced octal number 27 by decimal +% number 23 to protect against the quote character being active.} +% \changes{v1.7o}{1995/11/07}{Replaced some 0's by \cs{z@} (faster).} +% \changes{v1.8c}{1996/10/27} +% {Removed \cs{aa} and \cs{AA}} +% \changes{v1.9y}{2000/01/30}{Use \cs{hmode@bgroup} where applicable +% (pr/3160)} +% \begin{macrocode} +% \DeclareTextCommand{\aa}{OT1} +% {{\accent23a}} +\DeclareTextCommand{\L}{OT1} + {\leavevmode\setbox\z@\hbox{L}\hb@xt@\wd\z@{\hss\@xxxii L}} +\DeclareTextCommand{\l}{OT1} + {\hmode@bgroup\@xxxii l\egroup} +% \DeclareTextCommand{\AA}{OT1} +% {\leavevmode\setbox\z@\hbox{h}\dimen@\ht\z@\advance\dimen@-1ex% +% \rlap{\raise.67\dimen@\hbox{\char23}}A} +% \end{macrocode} +% In the OT1 encoding \r A has a hand-crafted definition, so we +% have here the first recorded explicit use of +% |\DeclareTextCompositeCommand|. +% \changes{v1.8c}{1996/10/27} +% {Added \cs{r} A} +% \changes{v1.96}{2002/10/28}{% +% coding change, to follow bug fix by DEK in plain.tex (pr/3469)} +% \begin{macrocode} +\DeclareTextCompositeCommand{\r}{OT1}{A} + {\leavevmode\setbox\z@\hbox{!}\dimen@\ht\z@\advance\dimen@-1ex% + \rlap{\raise.67\dimen@\hbox{\char23}}A} +% \end{macrocode} +% In the OT1 encoding, \pounds~and \$ share a slot. +% \changes{v1.9y}{2000/01/30}{Use \cs{hmode@bgroup} where applicable +% (pr/3160)} +% \begin{macrocode} +\DeclareTextCommand{\textdollar}{OT1}{\hmode@bgroup + \ifdim \fontdimen\@ne\font >\z@ + \slshape + \else + \upshape + \fi + \char`\$\egroup} +% \end{macrocode} +% +% \begin{macrocode} +\DeclareTextCommand{\textsterling}{OT1}{\hmode@bgroup + \ifdim \fontdimen\@ne\font >\z@ + \itshape + \else + \fontshape{ui}\selectfont + \fi + \char`\$\egroup} +% \end{macrocode} +% +% Here we are adding some more composite commands to the |OT1| +% encoding. This makes the use of certain accents with |i| +% compatible with their use with the |T1| encoding; this +% enables them to become true \LaTeX{} internal representations. +% However, it will make these accents work a little less fast since +% a check will always be made for the existence of a composite. +% +% \changes{v1.93}{2001/05/28}{Added composites for compatibility with +% T1, pr/3295} +% \changes{v1.94}{2001/06/05}{Text composite Commands need kludges for +% `,' -- see tlb1903.lvt} +% \begin{macrocode} +\DeclareTextComposite{\.}{OT1}{i}{`\i} +\DeclareTextComposite{\.}{OT1}{\i}{`\i} +\DeclareTextCompositeCommand{\`}{OT1}{i}{\@tabacckludge`\i} +\DeclareTextCompositeCommand{\'}{OT1}{i}{\@tabacckludge'\i} +\DeclareTextCompositeCommand{\^}{OT1}{i}{\^\i} +\DeclareTextCompositeCommand{\"}{OT1}{i}{\"\i} +% \end{macrocode} +% +% \begin{macrocode} +% +% \end{macrocode} +% +% \subsection{Definitions for the T1 encoding} +% +% \changes{1.3}{1993/12/17}{Removed all the hackery for use in +% \cs{DeclareFontEncoding}, and redid everything using +% \cs{DeclareTextFoo}.} +% \changes{1.3b}{1993/12/18}{Replaced the missing last argument to +% \cs{DeclareFontEncoding}.} +% \changes{1.3c}{1993/12/18}{Rewrote for the new syntax of +% \cs{EncodingSpecific}.} +% \changes{1.4a}{1994/05/01}{Rewrote for the new syntax.} +% \changes{1.5a}{1994/05/12}{Rewrote for the new syntax.} +% \changes{1.6a}{1994/10/25}{Added \cs{textdollar}, +% \cs{textlbrace}, \cs{textrbrace}, \cs{textsterling}, +% \cs{textunderline}.} +% \changes{1.6a}{1994/10/25}{Removed +% \cs{textlbrace}, \cs{textrbrace}, \cs{textunderline} to give them +% their proper names.} +% \changes{1.6b}{1994/10/27}{Added +% \cs{textasciicircum} +% \cs{textasciitilde} +% \cs{textbackslash} +% \cs{textbar} +% \cs{textbraceleft} +% \cs{textbraceright} +% \cs{textcompwordmark} +% \cs{textemdash} +% \cs{textendash} +% \cs{textexclamdown} +% \cs{textgreater} +% \cs{texthyphenchar} +% \cs{texthyphen} +% \cs{textless} +% \cs{textquestiondown} +% \cs{textquotedblleft} +% \cs{textquotedblright} +% \cs{textquotedbl} +% \cs{textquoteleft} +% \cs{textquoteright} +% \cs{textunderscore} +% \cs{textvisiblespace} +% } +% \changes{v1.9h}{1997/12/17} +% {Added \cs{textperthousand} and \cs{textpertenthousand}} +% +% The definitions for the `Extended \TeX{} text' (T1) encoding. +% +% Declare the encoding. +% \begin{macrocode} +%<*T1> +\DeclareFontEncoding{T1}{}{} +% \end{macrocode} +% Declare the accents. +% \begin{macrocode} +\DeclareTextAccent{\`}{T1}{0} +\DeclareTextAccent{\'}{T1}{1} +\DeclareTextAccent{\^}{T1}{2} +\DeclareTextAccent{\~}{T1}{3} +\DeclareTextAccent{\"}{T1}{4} +\DeclareTextAccent{\H}{T1}{5} +\DeclareTextAccent{\r}{T1}{6} +\DeclareTextAccent{\v}{T1}{7} +\DeclareTextAccent{\u}{T1}{8} +\DeclareTextAccent{\=}{T1}{9} +\DeclareTextAccent{\.}{T1}{10} +% \end{macrocode} +% Some accents have to be built by hand. +% Note that |\ooalign| and |\o@lign| must be inside a group. +% \changes{v1.9h}{1997/12/17}{As in OT1, Added \cs{leavevmode} at +% start of \cs{c}, otherwise the output routine might be invoked +% within the macro.} +% \changes{v1.9y}{2000/01/30}{Use \cs{hmode@bgroup} where applicable +% (pr/3160)} +% \changes{v1.95}{2002/06/17}{Corrected \cs{c} for T1 (pr/3442)} +% \changes{v1.99b}{2004/01/03}{Use \cs{ooalign} for \cs{k} (pr/3532)} +% \changes{v1.99b}{2004/01/03}{Added \cs{textogonekcentered} (pr/3532)} +% \changes{v1.99c}{2004/01/04}{More adjustments for ogonek (pr/3532)} +% \begin{macrocode} +\DeclareTextCommand{\b}{T1}[1] + {\hmode@bgroup\o@lign{\relax#1\crcr\hidewidth\sh@ft{29}% + \vbox to.2ex{\hbox{\char9}\vss}\hidewidth}\egroup} +\DeclareTextCommand{\c}{T1}[1] + {\leavevmode\setbox\z@\hbox{#1}\ifdim\ht\z@=1ex\accent11 #1% + \else{\ooalign{\unhbox\z@\crcr + \hidewidth\char11\hidewidth}}\fi} +\DeclareTextCommand{\d}{T1}[1] + {\hmode@bgroup + \o@lign{\relax#1\crcr\hidewidth\sh@ft{10}.\hidewidth}\egroup} +\DeclareTextCommand{\k}{T1}[1] + {\hmode@bgroup\ooalign{\null#1\crcr\hidewidth\char12}\egroup} +\DeclareTextCommand{\textogonekcentered}{T1}[1] + {\hmode@bgroup\ooalign{\null#1\crcr\hidewidth\char12\hidewidth}\egroup} +% \end{macrocode} +% +% Some symbols are constructed. +% +% \changes{v1.9h}{1997/12/17} +% {Added \cs{textperthousand} and \cs{textpertenthousand}} +% Slot 24 contains a small circle intended for construction of +% these two glyphs. +% +% \begin{macrocode} +\DeclareTextCommand{\textperthousand}{T1} + {\%\char 24 } % space or `relax as delimiter? +\DeclareTextCommand{\textpertenthousand}{T1} + {\%\char 24\char 24 } % space or `relax as delimiter? +% \end{macrocode} +% +% Declare the text symbols. +% \changes{v1.7t}{1995/11/29}{Added \cs{textasciicircum}, +% \cs{textasciitilde}, \cs{textbackslash}, \cs{textbar}, +% \cs{textgreater} and \cs{textless}.} +% \changes{v1.8c}{1996/10/27} +% {Removed \cs{aa} and \cs{AA}} +% +% \begin{macrocode} +%\DeclareTextSymbol{\AA}{T1}{197} +\DeclareTextSymbol{\AE}{T1}{198} +\DeclareTextSymbol{\DH}{T1}{208} +\DeclareTextSymbol{\DJ}{T1}{208} +\DeclareTextSymbol{\L}{T1}{138} +\DeclareTextSymbol{\NG}{T1}{141} +\DeclareTextSymbol{\OE}{T1}{215} +\DeclareTextSymbol{\O}{T1}{216} +\DeclareTextSymbol{\SS}{T1}{223} +\DeclareTextSymbol{\TH}{T1}{222} +%\DeclareTextSymbol{\aa}{T1}{229} +\DeclareTextSymbol{\ae}{T1}{230} +\DeclareTextSymbol{\dh}{T1}{240} +\DeclareTextSymbol{\dj}{T1}{158} +\DeclareTextSymbol{\guillemotleft}{T1}{19} +\DeclareTextSymbol{\guillemotright}{T1}{20} +\DeclareTextSymbol{\guilsinglleft}{T1}{14} +\DeclareTextSymbol{\guilsinglright}{T1}{15} +\DeclareTextSymbol{\i}{T1}{25} +\DeclareTextSymbol{\j}{T1}{26} +\DeclareTextSymbol{\l}{T1}{170} +\DeclareTextSymbol{\ng}{T1}{173} +\DeclareTextSymbol{\oe}{T1}{247} +\DeclareTextSymbol{\o}{T1}{248} +\DeclareTextSymbol{\quotedblbase}{T1}{18} +\DeclareTextSymbol{\quotesinglbase}{T1}{13} +\DeclareTextSymbol{\ss}{T1}{255} +\DeclareTextSymbol{\textasciicircum}{T1}{`\^} +\DeclareTextSymbol{\textasciitilde}{T1}{`\~} +\DeclareTextSymbol{\textbackslash}{T1}{`\\} +\DeclareTextSymbol{\textbar}{T1}{`\|} +\DeclareTextSymbol{\textbraceleft}{T1}{`\{} +\DeclareTextSymbol{\textbraceright}{T1}{`\}} +\DeclareTextSymbol{\textcompwordmark}{T1}{23} +\DeclareTextSymbol{\textdollar}{T1}{`\$} +\DeclareTextSymbol{\textemdash}{T1}{22} +\DeclareTextSymbol{\textendash}{T1}{21} +\DeclareTextSymbol{\textexclamdown}{T1}{189} +\DeclareTextSymbol{\textgreater}{T1}{`\>} +%\DeclareTextSymbol{\texthyphenchar}{T1}{127} +%\DeclareTextSymbol{\texthyphen}{T1}{`\-} +\DeclareTextSymbol{\textless}{T1}{`\<} +\DeclareTextSymbol{\textquestiondown}{T1}{190} +\DeclareTextSymbol{\textquotedblleft}{T1}{16} +\DeclareTextSymbol{\textquotedblright}{T1}{17} +\DeclareTextSymbol{\textquotedbl}{T1}{`\"} +\DeclareTextSymbol{\textquoteleft}{T1}{`\`} +\DeclareTextSymbol{\textquoteright}{T1}{`\'} +\DeclareTextSymbol{\textsection}{T1}{159} +\DeclareTextSymbol{\textsterling}{T1}{191} +\DeclareTextSymbol{\textunderscore}{T1}{95} +\DeclareTextSymbol{\textvisiblespace}{T1}{32} +\DeclareTextSymbol{\th}{T1}{254} +% \end{macrocode} +% Declare the composites. +% \changes{v1.93}{2001/05/28}{Changed the effect of +% \cs{\.}\cs{\i}, pr/3295} +% \begin{macrocode} +\DeclareTextComposite{\.}{T1}{i}{`\i} +\DeclareTextComposite{\.}{T1}{\i}{`\i} +% \end{macrocode} +% \changes{v1.9c}{1997/05/04}{Added `hex index tabs'} +% "80 = 128 +% \begin{macrocode} +\DeclareTextComposite{\u}{T1}{A}{128} +\DeclareTextComposite{\k}{T1}{A}{129} +\DeclareTextComposite{\'}{T1}{C}{130} +\DeclareTextComposite{\v}{T1}{C}{131} +\DeclareTextComposite{\v}{T1}{D}{132} +\DeclareTextComposite{\v}{T1}{E}{133} +\DeclareTextComposite{\k}{T1}{E}{134} +\DeclareTextComposite{\u}{T1}{G}{135} +% \end{macrocode} +% "88 = 136 +% \begin{macrocode} +\DeclareTextComposite{\'}{T1}{L}{136} +\DeclareTextComposite{\v}{T1}{L}{137} +\DeclareTextComposite{\'}{T1}{N}{139} +\DeclareTextComposite{\v}{T1}{N}{140} +\DeclareTextComposite{\H}{T1}{O}{142} +\DeclareTextComposite{\'}{T1}{R}{143} +% \end{macrocode} +% "90 = 144 +% \begin{macrocode} +\DeclareTextComposite{\v}{T1}{R}{144} +\DeclareTextComposite{\'}{T1}{S}{145} +\DeclareTextComposite{\v}{T1}{S}{146} +\DeclareTextComposite{\c}{T1}{S}{147} +\DeclareTextComposite{\v}{T1}{T}{148} +\DeclareTextComposite{\c}{T1}{T}{149} +\DeclareTextComposite{\H}{T1}{U}{150} +\DeclareTextComposite{\r}{T1}{U}{151} +% \end{macrocode} +% "98 = 152 +% \begin{macrocode} +\DeclareTextComposite{\"}{T1}{Y}{152} +\DeclareTextComposite{\'}{T1}{Z}{153} +\DeclareTextComposite{\v}{T1}{Z}{154} +\DeclareTextComposite{\.}{T1}{Z}{155} +\DeclareTextComposite{\.}{T1}{I}{157} +% \end{macrocode} +% "A0 = 160 +% \begin{macrocode} +\DeclareTextComposite{\u}{T1}{a}{160} +\DeclareTextComposite{\k}{T1}{a}{161} +\DeclareTextComposite{\'}{T1}{c}{162} +\DeclareTextComposite{\v}{T1}{c}{163} +\DeclareTextComposite{\v}{T1}{d}{164} +\DeclareTextComposite{\v}{T1}{e}{165} +\DeclareTextComposite{\k}{T1}{e}{166} +\DeclareTextComposite{\u}{T1}{g}{167} +% \end{macrocode} +% "A8 = 168 +% \begin{macrocode} +\DeclareTextComposite{\'}{T1}{l}{168} +\DeclareTextComposite{\v}{T1}{l}{169} +\DeclareTextComposite{\'}{T1}{n}{171} +\DeclareTextComposite{\v}{T1}{n}{172} +\DeclareTextComposite{\H}{T1}{o}{174} +\DeclareTextComposite{\'}{T1}{r}{175} +% \end{macrocode} +% "B0 = 176 +% \begin{macrocode} +\DeclareTextComposite{\v}{T1}{r}{176} +\DeclareTextComposite{\'}{T1}{s}{177} +\DeclareTextComposite{\v}{T1}{s}{178} +\DeclareTextComposite{\c}{T1}{s}{179} +\DeclareTextComposite{\v}{T1}{t}{180} +\DeclareTextComposite{\c}{T1}{t}{181} +\DeclareTextComposite{\H}{T1}{u}{182} +\DeclareTextComposite{\r}{T1}{u}{183} +% \end{macrocode} +% "B8 = 184 +% \begin{macrocode} +\DeclareTextComposite{\"}{T1}{y}{184} +\DeclareTextComposite{\'}{T1}{z}{185} +\DeclareTextComposite{\v}{T1}{z}{186} +\DeclareTextComposite{\.}{T1}{z}{187} +% \end{macrocode} +% "C0 = 192 +% \begin{macrocode} +\DeclareTextComposite{\`}{T1}{A}{192} +\DeclareTextComposite{\'}{T1}{A}{193} +\DeclareTextComposite{\^}{T1}{A}{194} +\DeclareTextComposite{\~}{T1}{A}{195} +\DeclareTextComposite{\"}{T1}{A}{196} +\DeclareTextComposite{\r}{T1}{A}{197} +\DeclareTextComposite{\c}{T1}{C}{199} +% \end{macrocode} +% "C8 = 200 +% \begin{macrocode} +\DeclareTextComposite{\`}{T1}{E}{200} +\DeclareTextComposite{\'}{T1}{E}{201} +\DeclareTextComposite{\^}{T1}{E}{202} +\DeclareTextComposite{\"}{T1}{E}{203} +\DeclareTextComposite{\`}{T1}{I}{204} +\DeclareTextComposite{\'}{T1}{I}{205} +\DeclareTextComposite{\^}{T1}{I}{206} +\DeclareTextComposite{\"}{T1}{I}{207} +% \end{macrocode} +% "D0 = 208 +% \begin{macrocode} +\DeclareTextComposite{\~}{T1}{N}{209} +\DeclareTextComposite{\`}{T1}{O}{210} +\DeclareTextComposite{\'}{T1}{O}{211} +\DeclareTextComposite{\^}{T1}{O}{212} +\DeclareTextComposite{\~}{T1}{O}{213} +\DeclareTextComposite{\"}{T1}{O}{214} +% \end{macrocode} +% "D8 = 216 +% \begin{macrocode} +\DeclareTextComposite{\`}{T1}{U}{217} +\DeclareTextComposite{\'}{T1}{U}{218} +\DeclareTextComposite{\^}{T1}{U}{219} +\DeclareTextComposite{\"}{T1}{U}{220} +\DeclareTextComposite{\'}{T1}{Y}{221} +% \end{macrocode} +% "E0 = 224 +% \begin{macrocode} +\DeclareTextComposite{\`}{T1}{a}{224} +\DeclareTextComposite{\'}{T1}{a}{225} +\DeclareTextComposite{\^}{T1}{a}{226} +\DeclareTextComposite{\~}{T1}{a}{227} +\DeclareTextComposite{\"}{T1}{a}{228} +\DeclareTextComposite{\r}{T1}{a}{229} +\DeclareTextComposite{\c}{T1}{c}{231} +% \end{macrocode} +% "E8 = 232 +% \begin{macrocode} +\DeclareTextComposite{\`}{T1}{e}{232} +\DeclareTextComposite{\'}{T1}{e}{233} +\DeclareTextComposite{\^}{T1}{e}{234} +\DeclareTextComposite{\"}{T1}{e}{235} +\DeclareTextComposite{\`}{T1}{i}{236} +\DeclareTextComposite{\`}{T1}{\i}{236} +\DeclareTextComposite{\'}{T1}{i}{237} +\DeclareTextComposite{\'}{T1}{\i}{237} +\DeclareTextComposite{\^}{T1}{i}{238} +\DeclareTextComposite{\^}{T1}{\i}{238} +\DeclareTextComposite{\"}{T1}{i}{239} +\DeclareTextComposite{\"}{T1}{\i}{239} +% \end{macrocode} +% "F0 = 240 +% \begin{macrocode} +\DeclareTextComposite{\~}{T1}{n}{241} +\DeclareTextComposite{\`}{T1}{o}{242} +\DeclareTextComposite{\'}{T1}{o}{243} +\DeclareTextComposite{\^}{T1}{o}{244} +\DeclareTextComposite{\~}{T1}{o}{245} +\DeclareTextComposite{\"}{T1}{o}{246} +% \end{macrocode} +% "F8 = 248 +% \begin{macrocode} +\DeclareTextComposite{\`}{T1}{u}{249} +\DeclareTextComposite{\'}{T1}{u}{250} +\DeclareTextComposite{\^}{T1}{u}{251} +\DeclareTextComposite{\"}{T1}{u}{252} +\DeclareTextComposite{\'}{T1}{y}{253} +% \end{macrocode} +% \changes{v1.99b}{2004/01/03}{Added composites for \cs{k} (pr/3532)} +% \begin{macrocode} +\DeclareTextCompositeCommand{\k}{T1}{o}{\textogonekcentered{o}} +\DeclareTextCompositeCommand{\k}{T1}{O}{\textogonekcentered{O}} +% \end{macrocode} +% +% \begin{macrocode} +% +% \end{macrocode} +% +% \changes{1.4a}{1994/05/01}{Removed the uc/lc table settings, since +% the T1 uc/lc table is now the default.} +% +% \subsection{Definitions for the OMS encoding} +% +% \changes{v1.6a}{1994/10/25}{Added the OMS encoding.} +% \changes{v1.6b}{1994/10/27}{Renamed \cs{textlbrace} to +% \cs{textbraceleft} and \cs{textrbrace} to \cs{textbraceright}.} +% \changes{v1.6b}{1994/10/27}{Added \cs{textbackslash}.} +% \changes{v1.6d}{1994/10/30}{Added \cs{textcircled}.} +% +% The definitions for the `\TeX{} math symbol' (OMS) encoding. Even +% though this is meant to be a math font, it includes some of the +% standard \LaTeX{} text symbols. +% +% Declare the encoding. +% \begin{macrocode} +%<*OMS> +\DeclareFontEncoding{OMS}{}{} +% \end{macrocode} +% Declare the symbols. +% \changes{v1.7t}{1995/11/29}{Added \cs{textbackslash} and +% \cs{textbar}.} +% \changes{v1.8c}{1996/10/27} +% {Added \cs{textasteriskcentered}} +% \changes{v1.9y}{2000/01/30}{Use \cs{hmode@bgroup} where applicable +% (pr/3160)} +% \changes{v1.95}{2002/06/16}{Added \cs{textbardbl} (pr/3400)} +% \begin{macrocode} +% \changes{v1.99}{2004/02/02}{Added \cs{textbigcircle}} +% Note that slot 13 has in places been named |\Orb|: please root +% out and destroy this impolity wherever you find it! +% \begin{macrocode} +\DeclareTextSymbol{\textasteriskcentered}{OMS}{3} % "03 +\DeclareTextSymbol{\textbackslash}{OMS}{110} % "6E +\DeclareTextSymbol{\textbar}{OMS}{106} % "6A +\DeclareTextSymbol{\textbardbl}{OMS}{107} % "6B +\DeclareTextSymbol{\textbraceleft}{OMS}{102} % "66 +\DeclareTextSymbol{\textbraceright}{OMS}{103} % "67 +\DeclareTextSymbol{\textbullet}{OMS}{15} % "0F +\DeclareTextSymbol{\textdaggerdbl}{OMS}{122} % "7A +\DeclareTextSymbol{\textdagger}{OMS}{121} % "79 +\DeclareTextSymbol{\textparagraph}{OMS}{123} % "7B +\DeclareTextSymbol{\textperiodcentered}{OMS}{1} % "01 +\DeclareTextSymbol{\textsection}{OMS}{120} % "78 +\DeclareTextSymbol{\textbigcircle}{OMS}{13} % "0D +\DeclareTextCommand{\textcircled}{OMS}[1]{\hmode@bgroup + \ooalign{% + \hfil \raise .07ex\hbox {\upshape#1}\hfil \crcr + \char 13 % "0D + }% + \egroup} +% +% \end{macrocode} +% +% \subsection{Definitions for the OML encoding} +% +% \changes{v1.6d}{1994/10/30}{Added the OML encoding.} +% +% The definitions for the `\TeX{} math italic' (OML) encoding. Even +% though this is meant to be a math font, it includes some of the +% standard \LaTeX{} text symbols. +% +% Declare the encoding. +% \begin{macrocode} +%<*OML> +\DeclareFontEncoding{OML}{}{} +% \end{macrocode} +% Declare the symbols. +% \changes{v1.7t}{1995/11/29}{Added \cs{textless} and +% \cs{textgreater}.} +% \changes{v1.9h}{1997/12/17}{Changed to decimal codes.} +% \changes{v1.9m}{1998/01/16}{fixed decimal codes. latex/2734} +% \begin{macrocode} +\DeclareTextSymbol{\textless}{OML}{`\<} +\DeclareTextSymbol{\textgreater}{OML}{`\>} +\DeclareTextAccent{\t}{OML}{127} % "7F +% +% \end{macrocode} +% +% \subsection{Definitions for the OT4 encoding} +% +% These definitions are for the Polish extension to the +% `\TeX\ text' (OT1) encoding. +% This encoding was created by B.~Jackowski and M.~Ry\'cko +% for use with the Polish version of Computer Modern and Computer +% Concrete. In positions 0--127 it is identical to OT1 but it +% contains some additional characters in the upper half. The \LaTeX{} +% support was developed by Mariusz Olko. +% +% The PL fonts that use it are available as follows:\\ +% Metafont sources +% \texttt{ftp://ftp.gust.org.pl/TeX/language/polish/pl-mf.zip}; +% +% Font files +% \texttt{ftp://ftp.gust.org.pl/TeX/language/polish/pl-tfm.zip}. +% +% Declare the encoding. +% \begin{macrocode} +%<*OT4> +\DeclareFontEncoding{OT4}{}{} +\DeclareFontSubstitution{OT4}{cmr}{m}{n} +% \end{macrocode} +% Declare the accents. +% \begin{macrocode} +\DeclareTextAccent{\"}{OT4}{127} +\DeclareTextAccent{\'}{OT4}{19} +\DeclareTextAccent{\.}{OT4}{95} +\DeclareTextAccent{\=}{OT4}{22} +\DeclareTextAccent{\^}{OT4}{94} +\DeclareTextAccent{\`}{OT4}{18} +\DeclareTextAccent{\~}{OT4}{126} +\DeclareTextAccent{\H}{OT4}{125} +\DeclareTextAccent{\u}{OT4}{21} +\DeclareTextAccent{\v}{OT4}{20} +\DeclareTextAccent{\r}{OT4}{23} +% \end{macrocode} +% The ogonek accent is available only under a e A \& E. But we +% have to provide some definition for \cs{k}. Some other accents +% have to be built by hand as in OT1: +% \changes{v1.9y}{2000/01/30}{Use \cs{hmode@bgroup} where applicable +% (pr/3160)} +% \begin{macrocode} +\DeclareTextCommand{\k}{OT4}[1]{% + \TextSymbolUnavailable{\k{#1}}#1} +\DeclareTextCommand{\b}{OT4}[1] + {\hmode@bgroup\o@lign{\relax#1\crcr\hidewidth\sh@ft{29}% + \vbox to.2ex{\hbox{\char22}\vss}\hidewidth}\egroup} +\DeclareTextCommand{\c}{OT4}[1] + {\leavevmode\setbox\z@\hbox{#1}\ifdim\ht\z@=1ex\accent24 #1% + \else{\ooalign{\unhbox\z@\crcr\hidewidth\char24\hidewidth}}\fi} +\DeclareTextCommand{\d}{OT4}[1] + {\hmode@bgroup + \o@lign{\relax#1\crcr\hidewidth\sh@ft{10}.\hidewidth}\egroup} +% \end{macrocode} +% Declare the text symbols. +% \begin{macrocode} +\DeclareTextSymbol{\AE}{OT4}{29} +\DeclareTextSymbol{\OE}{OT4}{30} +\DeclareTextSymbol{\O}{OT4}{31} +\DeclareTextSymbol{\L}{OT4}{138} +\DeclareTextSymbol{\ae}{OT4}{26} +\DeclareTextSymbol{\guillemotleft}{OT4}{174} +\DeclareTextSymbol{\guillemotright}{OT4}{175} +\DeclareTextSymbol{\i}{OT4}{16} +\DeclareTextSymbol{\j}{OT4}{17} +\DeclareTextSymbol{\l}{OT4}{170} +\DeclareTextSymbol{\o}{OT4}{28} +\DeclareTextSymbol{\oe}{OT4}{27} +\DeclareTextSymbol{\quotedblbase}{OT4}{255} +\DeclareTextSymbol{\ss}{OT4}{25} +\DeclareTextSymbol{\textemdash}{OT4}{124} +\DeclareTextSymbol{\textendash}{OT4}{123} +\DeclareTextSymbol{\textexclamdown}{OT4}{60} +%\DeclareTextSymbol{\texthyphenchar}{OT4}{`\-} +%\DeclareTextSymbol{\texthyphen}{OT4}{`\-} +\DeclareTextSymbol{\textquestiondown}{OT4}{62} +\DeclareTextSymbol{\textquotedblleft}{OT4}{92} +\DeclareTextSymbol{\textquotedblright}{OT4}{`\"} +\DeclareTextSymbol{\textquoteleft}{OT4}{`\`} +\DeclareTextSymbol{\textquoteright}{OT4}{`\'} +% \end{macrocode} +% Definition for \r A as in OT1: +% \changes{v1.96}{2002/10/28}{% +% coding change, to follow bug fix by DEK in plain.tex (pr/3469)} +% \begin{macrocode} +\DeclareTextCompositeCommand{\r}{OT4}{A} + {\leavevmode\setbox\z@\hbox{!}\dimen@\ht\z@\advance\dimen@-1ex% + \rlap{\raise.67\dimen@\hbox{\char23}}A} +% \end{macrocode} +% In the OT4 encoding, \pounds~and \$ share a slot. +% \changes{v1.9y}{2000/01/30}{Use \cs{hmode@bgroup} where applicable +% (pr/3160)} +% \begin{macrocode} +\DeclareTextCommand{\textdollar}{OT4}{\hmode@bgroup + \ifdim \fontdimen\@ne\font >\z@ + \slshape + \else + \upshape + \fi + \char`\$\egroup} +\DeclareTextCommand{\textsterling}{OT4}{\hmode@bgroup + \ifdim \fontdimen\@ne\font >\z@ + \itshape + \else + \fontshape{ui}\selectfont + \fi + \char`\$\egroup} +% \end{macrocode} +% Declare the composites. +% \begin{macrocode} +\DeclareTextComposite{\k}{OT4}{A}{129} +\DeclareTextComposite{\'}{OT4}{C}{130} +\DeclareTextComposite{\k}{OT4}{E}{134} +\DeclareTextComposite{\'}{OT4}{N}{139} +\DeclareTextComposite{\'}{OT4}{S}{145} +\DeclareTextComposite{\'}{OT4}{Z}{153} +\DeclareTextComposite{\.}{OT4}{Z}{155} +\DeclareTextComposite{\k}{OT4}{a}{161} +\DeclareTextComposite{\'}{OT4}{c}{162} +\DeclareTextComposite{\k}{OT4}{e}{166} +\DeclareTextComposite{\'}{OT4}{n}{171} +\DeclareTextComposite{\'}{OT4}{s}{177} +\DeclareTextComposite{\'}{OT4}{z}{185} +\DeclareTextComposite{\.}{OT4}{z}{187} +\DeclareTextComposite{\'}{OT4}{O}{211} +\DeclareTextComposite{\'}{OT4}{o}{243} +% +% \end{macrocode} +% +% +% \subsection{Definitions for the TS1 encoding} +% +% \changes{v1.9c}{1997/05/04}{Added TS1 encoding v2.2.beta} +% \changes{v1.9g}{1997/11/23} +% {Use \cs{textperthousand}, \cs{textpertenthousand} and +% \cs{textfractionsolidus} not +% \cs{textpermill}, \cs{textpertenmill} and \cs{textfraction}. +% /2673 } +% \changes{v1.9h}{1997/12/17} +% {Removed default settings, see next section.} +% +% \begin{macrocode} +%<*TS1> +\DeclareFontEncoding{TS1}{}{} +\DeclareFontSubstitution{TS1}{cmr}{m}{n} +% \end{macrocode} +% Some accents have to be built by hand. +% Note that |\ooalign| and |\o@lign| must be inside a group. +% \changes{v1.9y}{2000/01/30}{Use \cs{hmode@bgroup} where applicable +% (pr/3160)} +% \begin{macrocode} +\DeclareTextCommand{\capitalcedilla}{TS1}[1] + {\hmode@bgroup + \ooalign{\null#1\crcr\hidewidth\char11\hidewidth}\egroup} +\DeclareTextCommand{\capitalogonek}{TS1}[1] + {\hmode@bgroup + \ooalign{\null#1\crcr\hidewidth\char12\hidewidth}\egroup} +% \end{macrocode} +% +% Accents for capital letters. +% +% These commands can be used by the end user either directly or through +% definitions of the type +% \begin{verbatim} +% \DeclareTextCompositeCommand{\'}{T1}{X}{\capitalacute X} +% \end{verbatim} +% None of the latter definitions are provided by default, since they +% are probably rarely used. +% +% "00 = 0 +% \begin{macrocode} +\DeclareTextAccent{\capitalgrave}{TS1}{0} +\DeclareTextAccent{\capitalacute}{TS1}{1} +\DeclareTextAccent{\capitalcircumflex}{TS1}{2} +\DeclareTextAccent{\capitaltilde}{TS1}{3} +\DeclareTextAccent{\capitaldieresis}{TS1}{4} +\DeclareTextAccent{\capitalhungarumlaut}{TS1}{5} +\DeclareTextAccent{\capitalring}{TS1}{6} +\DeclareTextAccent{\capitalcaron}{TS1}{7} +% \end{macrocode} +% "08 = 8 +% \begin{macrocode} +\DeclareTextAccent{\capitalbreve}{TS1}{8} +\DeclareTextAccent{\capitalmacron}{TS1}{9} +\DeclareTextAccent{\capitaldotaccent}{TS1}{10} +% \end{macrocode} +% Tie accents. +% +% The tie accent was borrowed from the |cmmi| font. The tc fonts +% now provide four tie accents, the first two are done in the +% classical way with assymetric glyphs hanging out of their boxes; +% the new ties are centered in their boxes like all other accents. +% They need a name: please tell us if you know what to call them. +% +% " = +% \begin{macrocode} +\DeclareTextAccent{\t}{TS1}{26} +\DeclareTextAccent{\capitaltie}{TS1}{27} +\DeclareTextAccent{\newtie}{TS1}{28} +\DeclareTextAccent{\capitalnewtie}{TS1}{29} +% \end{macrocode} +% +% Compund word marks. +% +% The text companion fonts contain two compound word marks of +% different heights, one has |cap_height|, the other |asc_height|. +% +% \begin{macrocode} +\DeclareTextSymbol{\textcapitalcompwordmark}{TS1}{23} +\DeclareTextSymbol{\textascendercompwordmark}{TS1}{31} +% \end{macrocode} +% +% The text companion symbols. +% +% \begin{macrocode} +\DeclareTextSymbol{\textquotestraightbase}{TS1}{13} +% \end{macrocode} +% "10 = 16 +% \begin{macrocode} +\DeclareTextSymbol{\textquotestraightdblbase}{TS1}{18} +\DeclareTextSymbol{\texttwelveudash}{TS1}{21} +\DeclareTextSymbol{\textthreequartersemdash}{TS1}{22} +% \end{macrocode} +% "18 = 24 +% \begin{macrocode} +\DeclareTextSymbol{\textleftarrow}{TS1}{24} +\DeclareTextSymbol{\textrightarrow}{TS1}{25} +% \end{macrocode} +% "20 = 32 +% \begin{macrocode} +\DeclareTextSymbol{\textblank}{TS1}{32} +\DeclareTextSymbol{\textdollar}{TS1}{36} +\DeclareTextSymbol{\textquotesingle}{TS1}{39} +% \end{macrocode} +% "28 = 40 +% \begin{macrocode} +\DeclareTextSymbol{\textasteriskcentered}{TS1}{42} +% \end{macrocode} +% Note that '054 is a comma and '056 is a full stop: these make +% numbers using oldstyle digits easier to input. +% \begin{macrocode} +\DeclareTextSymbol{\textdblhyphen}{TS1}{45} +\DeclareTextSymbol{\textfractionsolidus}{TS1}{47} +% \end{macrocode} +% +% Oldstyle digits. +% +% "30 = 48 +% \begin{macrocode} +\DeclareTextSymbol{\textzerooldstyle}{TS1}{48} +\DeclareTextSymbol{\textoneoldstyle}{TS1}{49} +\DeclareTextSymbol{\texttwooldstyle}{TS1}{50} +\DeclareTextSymbol{\textthreeoldstyle}{TS1}{51} +\DeclareTextSymbol{\textfouroldstyle}{TS1}{52} +\DeclareTextSymbol{\textfiveoldstyle}{TS1}{53} +\DeclareTextSymbol{\textsixoldstyle}{TS1}{54} +\DeclareTextSymbol{\textsevenoldstyle}{TS1}{55} +% \end{macrocode} +% "38 = 56 +% \begin{macrocode} +\DeclareTextSymbol{\texteightoldstyle}{TS1}{56} +\DeclareTextSymbol{\textnineoldstyle}{TS1}{57} +% \end{macrocode} +% +% More text companion symbols. +% +% \begin{macrocode} +\DeclareTextSymbol{\textlangle}{TS1}{60} +\DeclareTextSymbol{\textminus}{TS1}{61} +\DeclareTextSymbol{\textrangle}{TS1}{62} +% \end{macrocode} +% "48 = 72 +% \begin{macrocode} +\DeclareTextSymbol{\textmho}{TS1}{77} +% \end{macrocode} +% +% \changes{v1.9r}{1999/01/06}{Minor documentation fix.} +% The big circle is here to define the command \cs{textcircled}. +% Formerly it was taken from the |cmsy| font. +% \changes{v1.9h}{1997/12/17}{Changed to decimal codes in \cs{ooalign}.} +% \changes{v1.9k}{1998/01/12}{Adding missing braces and \cs{ushape}.} +% \changes{v1.9y}{2000/01/30}{Use \cs{hmode@bgroup} where applicable +% (pr/3160)} +% \begin{macrocode} +\DeclareTextSymbol{\textbigcircle}{TS1}{79} +\DeclareTextCommand{\textcircled}{TS1}[1]{\hmode@bgroup + \ooalign{% + \hfil \raise .07ex\hbox {\upshape#1}\hfil \crcr + \char 79 % '117 = "4F + }% + \egroup} +% \end{macrocode} +% +% More text companion symbols. +% +% "50 = 80 +% \begin{macrocode} +\DeclareTextSymbol{\textohm}{TS1}{87} +% \end{macrocode} +% "58 = 88 +% \begin{macrocode} +\DeclareTextSymbol{\textlbrackdbl}{TS1}{91} +\DeclareTextSymbol{\textrbrackdbl}{TS1}{93} +\DeclareTextSymbol{\textuparrow}{TS1}{94} +\DeclareTextSymbol{\textdownarrow}{TS1}{95} +% \end{macrocode} +% "60 = 96 +% \begin{macrocode} +\DeclareTextSymbol{\textasciigrave}{TS1}{96} +\DeclareTextSymbol{\textborn}{TS1}{98} +\DeclareTextSymbol{\textdivorced}{TS1}{99} +\DeclareTextSymbol{\textdied}{TS1}{100} +% \end{macrocode} +% "68 = 104 +% \begin{macrocode} +\DeclareTextSymbol{\textleaf}{TS1}{108} +\DeclareTextSymbol{\textmarried}{TS1}{109} +\DeclareTextSymbol{\textmusicalnote}{TS1}{110} +% \end{macrocode} +% "78 = 120 +% \begin{macrocode} +\DeclareTextSymbol{\texttildelow}{TS1}{126} +% \end{macrocode} +% +% This glyph, |\textdblhyphenchar| is hanging, like the hyphenchar of +% the ec fonts. +% +% \begin{macrocode} +\DeclareTextSymbol{\textdblhyphenchar}{TS1}{127} +% \end{macrocode} +% "80 = 128 +% \begin{macrocode} +\DeclareTextSymbol{\textasciibreve}{TS1}{128} +\DeclareTextSymbol{\textasciicaron}{TS1}{129} +% \end{macrocode} +% +% This next glyph is \emph{not} the same as |\textquotedbl|. +% +% \changes{v1.9p}{1998/06/12}{Corrected 130 and 131, see pr/2834} +% \begin{macrocode} +\DeclareTextSymbol{\textacutedbl}{TS1}{130} +\DeclareTextSymbol{\textgravedbl}{TS1}{131} +\DeclareTextSymbol{\textdagger}{TS1}{132} +\DeclareTextSymbol{\textdaggerdbl}{TS1}{133} +\DeclareTextSymbol{\textbardbl}{TS1}{134} +\DeclareTextSymbol{\textperthousand}{TS1}{135} +% \end{macrocode} +% "88 = 136 +% \begin{macrocode} +\DeclareTextSymbol{\textbullet}{TS1}{136} +\DeclareTextSymbol{\textcelsius}{TS1}{137} +\DeclareTextSymbol{\textdollaroldstyle}{TS1}{138} +\DeclareTextSymbol{\textcentoldstyle}{TS1}{139} +\DeclareTextSymbol{\textflorin}{TS1}{140} +\DeclareTextSymbol{\textcolonmonetary}{TS1}{141} +\DeclareTextSymbol{\textwon}{TS1}{142} +\DeclareTextSymbol{\textnaira}{TS1}{143} +% \end{macrocode} +% "90 = 144 +% \begin{macrocode} +\DeclareTextSymbol{\textguarani}{TS1}{144} +\DeclareTextSymbol{\textpeso}{TS1}{145} +\DeclareTextSymbol{\textlira}{TS1}{146} +\DeclareTextSymbol{\textrecipe}{TS1}{147} +\DeclareTextSymbol{\textinterrobang}{TS1}{148} +\DeclareTextSymbol{\textinterrobangdown}{TS1}{149} +\DeclareTextSymbol{\textdong}{TS1}{150} +\DeclareTextSymbol{\texttrademark}{TS1}{151} +% \end{macrocode} +% "98 = 152 +% \begin{macrocode} +\DeclareTextSymbol{\textpertenthousand}{TS1}{152} +\DeclareTextSymbol{\textpilcrow}{TS1}{153} +\DeclareTextSymbol{\textbaht}{TS1}{154} +\DeclareTextSymbol{\textnumero}{TS1}{155} +% \end{macrocode} +% This next name may change. +% For the following sign we know only a german name, which is +% abz\"uglich. The meaning is something like ``commercial minus''. +% An ASCII ersatz is ./. (dot slash dot). +% The temporary English name is |\textdiscount|. +% \begin{macrocode} +\DeclareTextSymbol{\textdiscount}{TS1}{156} +\DeclareTextSymbol{\textestimated}{TS1}{157} +\DeclareTextSymbol{\textopenbullet}{TS1}{158} +\DeclareTextSymbol{\textservicemark}{TS1}{159} +% \end{macrocode} +% "A0 = 160 +% \begin{macrocode} +\DeclareTextSymbol{\textlquill}{TS1}{160} +\DeclareTextSymbol{\textrquill}{TS1}{161} +\DeclareTextSymbol{\textcent}{TS1}{162} +\DeclareTextSymbol{\textsterling}{TS1}{163} +\DeclareTextSymbol{\textcurrency}{TS1}{164} +\DeclareTextSymbol{\textyen}{TS1}{165} +\DeclareTextSymbol{\textbrokenbar}{TS1}{166} +\DeclareTextSymbol{\textsection}{TS1}{167} +% \end{macrocode} +% "A8 = 168 +% \begin{macrocode} +\DeclareTextSymbol{\textasciidieresis}{TS1}{168} +\DeclareTextSymbol{\textcopyright}{TS1}{169} +\DeclareTextSymbol{\textordfeminine}{TS1}{170} +\DeclareTextSymbol{\textcopyleft}{TS1}{171} +\DeclareTextSymbol{\textlnot}{TS1}{172} +% \end{macrocode} +% +% The meaning of the circled-P is ``sound recording copyright''. +% +% \changes{v1.9p}{1998/06/12}{Renamed \cs{textmacron} pr/2840} +% \begin{macrocode} +\DeclareTextSymbol{\textcircledP}{TS1}{173} +\DeclareTextSymbol{\textregistered}{TS1}{174} +\DeclareTextSymbol{\textasciimacron}{TS1}{175} +% \end{macrocode} +% "B0 = 176 +% \begin{macrocode} +\DeclareTextSymbol{\textdegree}{TS1}{176} +\DeclareTextSymbol{\textpm}{TS1}{177} +\DeclareTextSymbol{\texttwosuperior}{TS1}{178} +\DeclareTextSymbol{\textthreesuperior}{TS1}{179} +\DeclareTextSymbol{\textasciiacute}{TS1}{180} +\DeclareTextSymbol{\textmu}{TS1}{181} % micro sign +\DeclareTextSymbol{\textparagraph}{TS1}{182} +\DeclareTextSymbol{\textperiodcentered}{TS1}{183} +% \end{macrocode} +% "B8 = 184 +% \begin{macrocode} +\DeclareTextSymbol{\textreferencemark}{TS1}{184} +\DeclareTextSymbol{\textonesuperior}{TS1}{185} +\DeclareTextSymbol{\textordmasculine}{TS1}{186} +\DeclareTextSymbol{\textsurd}{TS1}{187} +\DeclareTextSymbol{\textonequarter}{TS1}{188} +\DeclareTextSymbol{\textonehalf}{TS1}{189} +\DeclareTextSymbol{\textthreequarters}{TS1}{190} +\DeclareTextSymbol{\texteuro}{TS1}{191} +% \end{macrocode} +% "E0 = 208 +% \begin{macrocode} +\DeclareTextSymbol{\texttimes}{TS1}{214} +% \end{macrocode} +% "F0 = 240 +% \begin{macrocode} +\DeclareTextSymbol{\textdiv}{TS1}{246} +% +% \end{macrocode} +% +% \section{Package files} +% +% \changes{v1.9h}{1997/12/17}{Added section.} +% \changes{v1.9h}{1997/12/17}{Added code for textcomp.sty.} +% This file now also contains some packages that provide access to +% the more specialised encodings. +% +% \subsection{The fontenc package} +% +% \changes{v1.5c}{1994/05/14}{Added the fontenc package} +% \changes{v1.5g}{1994/05/16}{Removed the lowercasing of the filename.} +% \changes{v1.7a}{1994/11/30}{Always load the enc.def file, so that +% the default encoding for the commands will change.} +% \changes{v1.7x}{1996/05/18}{Produce error if encoding not found. +% pr/2054} +% \changes{v1.7y}{1996/05/21}{Corrected error message (CAR)} +% \changes{v1.8d}{1996/11/18} +% {(DPC) lowercase external file names. internal/1044}% +% This package allows authors to specify which encodings they will use. +% For each encoding |FOO|, the package looks to see if the encoding +% |FOO| has already been declared. If it has not, the file |fooenc.def| +% is loaded. The default encoding is set to be |FOO|. +% +% In addition the package at the moment contains extra code to extend +% the |\@uclclist| (list of upper/lower case pairs) for encodings that +% involve cyrillic characters. THIS IS A TEMPORARY SOLUTION and will not +% stay this way forever (or so we hope) but right now we are missing a +% proper interface for this and didn't wanted to rush it. +% \changes{v1.9r}{1999/01/07}{Hackery to temp support cyrillic uc/lc} +% \changes{v1.9t}{1999/02/24}{Corrected hackery cyrillic uc/lc list} +% \changes{v1.9x}{1999/12/08}{Changed \cs{CYRRHOOK} and \cs{cyrrhook} +% to\cs{CYRRHK} and \cs{cyrrhk} as name changed in the cyrillic +% bundle for naming consistency with other ``hook'' glyphs.} +% \begin{macrocode} +%<*package> +% \end{macrocode} +% +% Here we define a macro that extends the |\@uclclist| if needed and +% aferwards turns itself in a noop. +% \begin{macrocode} +\def\update@uclc@with@cyrillic{% + \expandafter\def\expandafter\@uclclist\expandafter + {\@uclclist + \cyra\CYRA\cyrabhch\CYRABHCH\cyrabhchdsc\CYRABHCHDSC\cyrabhdze + \CYRABHDZE\cyrabhha\CYRABHHA\cyrae\CYRAE\cyrb\CYRB\cyrbyus + \CYRBYUS\cyrc\CYRC\cyrch\CYRCH\cyrchldsc\CYRCHLDSC\cyrchrdsc + \CYRCHRDSC\cyrchvcrs\CYRCHVCRS\cyrd\CYRD\cyrdelta\CYRDELTA + \cyrdje\CYRDJE\cyrdze\CYRDZE\cyrdzhe\CYRDZHE\cyre\CYRE\cyreps + \CYREPS\cyrerev\CYREREV\cyrery\CYRERY\cyrf\CYRF\cyrfita + \CYRFITA\cyrg\CYRG\cyrgdsc\CYRGDSC\cyrgdschcrs\CYRGDSCHCRS + \cyrghcrs\CYRGHCRS\cyrghk\CYRGHK\cyrgup\CYRGUP\cyrh\CYRH + \cyrhdsc\CYRHDSC\cyrhhcrs\CYRHHCRS\cyrhhk\CYRHHK\cyrhrdsn + \CYRHRDSN\cyri\CYRI\cyrie\CYRIE\cyrii\CYRII\cyrishrt\CYRISHRT + \cyrishrtdsc\CYRISHRTDSC\cyrizh\CYRIZH\cyrje\CYRJE\cyrk\CYRK + \cyrkbeak\CYRKBEAK\cyrkdsc\CYRKDSC\cyrkhcrs\CYRKHCRS\cyrkhk + \CYRKHK\cyrkvcrs\CYRKVCRS\cyrl\CYRL\cyrldsc\CYRLDSC\cyrlhk + \CYRLHK\cyrlje\CYRLJE\cyrm\CYRM\cyrmdsc\CYRMDSC\cyrmhk\CYRMHK + \cyrn\CYRN\cyrndsc\CYRNDSC\cyrng\CYRNG\cyrnhk\CYRNHK\cyrnje + \CYRNJE\cyrnlhk\CYRNLHK\cyro\CYRO\cyrotld\CYROTLD\cyrp\CYRP + \cyrphk\CYRPHK\cyrq\CYRQ\cyrr\CYRR\cyrrdsc\CYRRDSC\cyrrhk + \CYRRHK\cyrrtick\CYRRTICK\cyrs\CYRS\cyrsacrs\CYRSACRS + \cyrschwa\CYRSCHWA\cyrsdsc\CYRSDSC\cyrsemisftsn\CYRSEMISFTSN + \cyrsftsn\CYRSFTSN\cyrsh\CYRSH\cyrshch\CYRSHCH\cyrshha\CYRSHHA + \cyrt\CYRT\cyrtdsc\CYRTDSC\cyrtetse\CYRTETSE\cyrtshe\CYRTSHE + \cyru\CYRU\cyrushrt\CYRUSHRT\cyrv\CYRV\cyrw\CYRW\cyry\CYRY + \cyrya\CYRYA\cyryat\CYRYAT\cyryhcrs\CYRYHCRS\cyryi\CYRYI\cyryo + \CYRYO\cyryu\CYRYU\cyrz\CYRZ\cyrzdsc\CYRZDSC\cyrzh\CYRZH + \cyrzhdsc\CYRZHDSC}% + \let\update@uclc@with@cyrillic\relax +} +% \end{macrocode} +% +% Here we process each option: +% \begin{macrocode} +\DeclareOption*{% + \let\encodingdefault\CurrentOption + \edef\reserved@f{% + \lowercase{\def\noexpand\reserved@f{\CurrentOption enc.def}}}% + \reserved@f + \InputIfFileExists\reserved@f + {}{\PackageError{fontenc}% + {Encoding file `\reserved@f' not found.% + \MessageBreak + You might have misspelt the name of the encoding}% + {Necessary code for this encoding was not + loaded.\MessageBreak + Thus calling the encoding later on will + produce further error messages.}}% + \let\reserved@f\relax +% \end{macrocode} +% +% In case the current encoding is one of a list of known +% cyrillic ones we extend the |\@uclclist|: +% \begin{macrocode} + \expandafter\in@\expandafter{\CurrentOption}% + {T2A,T2B,T2C,X2,LCY,OT2}% + \ifin@ +% \end{macrocode} +% +% But only if it hasn't already been extended. This might happen if +% there are several calls to fontenc loading one of the above +% encodings. If we don't do this check the |\@uclclist| gets +% unnecessarily big, slowing down the processing at runtime. +% \changes{v1.9v}{1999/06/12}{Extend \cs{@uclclist} only once} +% \begin{macrocode} + \expandafter\in@\expandafter\cyra\expandafter + {\@uclclist}% + \ifin@ + \else + \update@uclc@with@cyrillic + \fi + \fi +} +% \end{macrocode} +% +% \begin{macrocode} +\ProcessOptions* +% \end{macrocode} +% +% \begin{macrocode} +\fontencoding\encodingdefault\selectfont +% \end{macrocode} +% +% To save some space we get rid of the macro extending the +% |\@uclclist| (might have happened already). +% \begin{macrocode} +\let\update@uclc@with@cyrillic\relax +% \end{macrocode} +% +% Finally we pretend that the fontenc package wasn't read in. This +% allows for using it several times, e.g., in a class file and in the +% preamble (at the cost of not getting any version info). +% That kind of hackery shows that using a general purpose +% package just for loading an encoding is not the right kind +% of interface for setting up encodings --- it will get replaced at +% some point in the future. +% \changes{v1.9r}{1999/01/07}{Hackery to allow using fontenc several +% times} +% \changes{v1.9u}{1999/06/10}{Ensure that we also forget old options +% (pr/2888)} +% \begin{macrocode} +\global\expandafter\let\csname ver@fontenc.sty\endcsname\relax +\global\expandafter\let\csname opt@fontenc.sty\endcsname\relax +\global\let\@ifl@ter@@\@ifl@ter +\def\@ifl@ter#1#2#3#4#5{\global\let\@ifl@ter\@ifl@ter@@} +% +% \end{macrocode} +% +% +% \subsection{The textcomp package} +% +% This one is for the |TS1| encoding which contains text symbols +% for use with the |T1|-encoded text fonts. It therefore first +% inputs the file |TS1enc.def| and then sets (or resets) the +% defaults for the symbols it contains. The result of this is that +% when one of these symbols is accessed and the current encoding +% does not provide it, the symbol will be supplied by a silent, +% local change to this encoding. +% +% \begin{macrocode} +%<*TS1sty> +% \end{macrocode} +% Since many PostScript fonts only implement a subset of |TS1| many +% commands only produce black blobs of ink. To resolve the +% resulting problems a number of options have been introduced and +% some code has been developed to distinguish sub-encodings. +% +% The sub-encodings have a numerical id and are defined as follows +% for \texttt{TS1}: +% \begin{description} +% +% \item[\#5] those \texttt{TS1} symbols that are also in the ISO-Adobe +% character set; without \verb=textcurrency=, which is often +% misused for the Euro. Older Type1 fonts from the non-\TeX{} +% world provide only this subset. +% +% \item[\#4] = \#5 + \verb=\texteuro=. Most newer fonts provide this. +% +% \item[\#3] = \#4 + \verb=\textomega=. Can also be described as +% $\texttt{TS1} \cap (\texttt{ISO-Adobe} \cup +% \texttt{MacRoman})$. (Except for the missing "currency".) + +% +% \item[\#2] = \#3 + \verb=\textestimated= + \verb=\textcurrency=. Can +% also be described as $\texttt{TS1} \cap +% \texttt{Adobe-Western-2}$. This may be relevant for OpenType +% fonts, which usually show the Adobe-Western-2 character set. +% +% \item[\#1] = \texttt{TS1} without \verb=\textcircled= and \verb=\t=. +% These two glyphs are often not implemented and if their kernel +% defaults are changed commands like \verb=\copyright= +% unnecessarily fail. +% +% \item[\#0] = full \texttt{TS1} +% \end{description} +% +% And here a summary to go in the transcript file: +% \begin{macrocode} +\PackageInfo{textcomp}{Sub-encoding information:\MessageBreak + \space\space 5 = only ISO-Adobe without \string\textcurrency\MessageBreak + \space\space 4 = 5 + \string\texteuro\MessageBreak + \space\space 3 = 4 + \string\textohm\MessageBreak + \space\space 2 = 3 + \noexpand\textestimated+ \string\textcurrency\MessageBreak + \space\space 1 = TS1 - \noexpand\textcircled- \string\t\MessageBreak + \space\space 0 = TS1 (full)\MessageBreak + Font families with sub-encoding setting implement\MessageBreak + only a restricted character set as indicated.\MessageBreak + Family '?' is the default used for unknown fonts.\MessageBreak + See the documentation for details\@gobble} +% \end{macrocode} +% +% \begin{macro}{\DeclareEncodingSubset} +% An encoding subset to which a font family belongs is declared by +% |\DeclareEncodingSubset| that take the major encoding as the +% first argument (e.g., |TS1|), the family name as the second +% argument (e.g., |cmr|), and the subset encoding id as a third, +% (e.g., |0| for |cmr|). +% +% The default encoding subset to use when nothing is known about +% the current font family is named |?|. +% \begin{macrocode} +\def\DeclareEncodingSubset#1#2#3{% + \@ifundefined{#1:#2}% + {\PackageInfo{textcomp}{Setting #2 sub-encoding to #1/#3}}% + {\PackageInfo{textcomp}{Changing #2 sub-encoding to #1/#3}}% + \@namedef{#1:#2}{#3}} +\@onlypreamble\DeclareEncodingSubset +% \end{macrocode} +% \end{macro} +% +% +% The options for the package are the following: +% \begin{description} +% \item[safe] +% for unknown font families enables only symbols that are also +% in the ISO-Adobe character set; without "currency", which is +% often misused for the Euro. Older Type1 fonts from the +% non-TeX world provide only this subset. +% +% \item[euro] +% enables the ``safe'' symbols plus the |\texteuro| +% command. Most newer fonts provide this. +% +% \item[full] enables all |TS1| commands; useful only with fonts +% like EC or CM bright. +% +% \item[almostfull] +% same as ``full'', except that |\textcircled| +% and |\t| are \emph{not} redefined from their defaults to avoid +% that commands like |\copyright| suddenly no longer work. +% +% \item[force] +% ignore all subset encoding definitions stored in the package +% itself or in the configuration file and always use the default +% subset as specifed by one of the other options (seldom useful, +% only dangerous). +% \end{description} + +% \begin{macro}{\iftc@forced} +% Switch used to implement the \texttt{force} option +% \begin{macrocode} +\newif\iftc@forced \tc@forcedfalse +% \end{macrocode} +% \end{macro} + +% This is implemented by defining the default subset: +% \begin{macrocode} +\DeclareOption{full}{\DeclareEncodingSubset{TS1}{?}{0}} +\DeclareOption{almostfull}{\DeclareEncodingSubset{TS1}{?}{1}} +\DeclareOption{euro}{\DeclareEncodingSubset{TS1}{?}{4}} +\DeclareOption{safe}{\DeclareEncodingSubset{TS1}{?}{5}} +% \end{macrocode} +% The default is ``almostfull'' which means that old documents will +% work except that |\textcircled| and |\t| will use the kernel +% defaults (with the advantage that this also works if the current +% font (as often the case) doesn't implement these glyphs. +% +% The ``force'' option simply sets the switch to true. +% \begin{macrocode} +\DeclareOption{force}{\tc@forcedtrue} +% \end{macrocode} +% +% The suggestions to user is to use the ``safe'' option always +% unless that balks in which case they could switch to +% ``almostfull'' but then better check their output manually. +% +% \begin{macrocode} +\def\tc@errorwarn{\PackageError} +\DeclareOption{warn}{\gdef\tc@errorwarn#1#2#3{\PackageWarning{#1}{#2}}} +% \end{macrocode} +% +% \begin{macrocode} +\ExecuteOptions{almostfull} +\ProcessOptions\relax +% \end{macrocode} +% +% \begin{macro}{\CheckEncodingSubset} +% The command |\CheckEncodingSubset| will check if the current font +% family has the right encoding subset to typeset a certain +% command. It takes five arguments as follows: +% first argument is either |\UseTextSymbol|, |\UseTextAccent| +% depending on whether or not the symbol is a text symbol or a text +% accent. + +% The second argument is the encoding from which this symbol should +% be fetched. +% +% The third argument is either a fake accessor command or an error +% message. the code in that argument (if ever executed) receives +% two arguments: |#2| and |#5| of |\CheckEncodingSubset|. +% +% Argument four is the subset encoding id to test against: if this +% value is higher than the subset id of the current font family +% then we typeset the symbol, i.e., execute |#1{#2}#5| otherwise +% it runs |#3#5|, e.g., to produce an error message or fake the +% glyph somehow. +% +% Argument five is the symbol or accent command that is being +% checked. +% +% For usage examples see definitions below. +% \begin{macrocode} +\iftc@forced +% \end{macrocode} +% If the ``force'' option was given we always use the default for +% testing against. +% \begin{macrocode} +\def\CheckEncodingSubset#1#2#3#4#5{% + \ifnum #4>% + 0\csname #2:?\endcsname + \relax + \expandafter\@firstoftwo + \else + \expandafter\@secondoftwo + \fi + {#1{#2}}{#3}% + #5% +} +% \end{macrocode} +% In normal circumstances the test is a bit more complicated: first +% check if there exists a macro +% |\|\meta{arg2}|:|\meta{current-family} and if so use that value +% to test against, otherwise use the default to test against. +% \begin{macrocode} +\else +\def\CheckEncodingSubset#1#2#3#4#5{% + \ifnum #4>% + \expandafter\ifx\csname #2:\f@family\endcsname\relax + 0\csname #2:?\endcsname + \else + \csname #2:\f@family\endcsname + \fi + \relax + \expandafter\@firstoftwo + \else + \expandafter\@secondoftwo + \fi + {#1{#2}}{#3}% + #5% +} +\fi +% \end{macrocode} +% \end{macro} +% +% \begin{macro}{tc@subst} +% \begin{macrocode} +\def\tc@subst#1{% + \tc@errorwarn{textcomp}% % should be latex error if general + {Symbol \string#1 not provided by\MessageBreak + font family \f@family\space + in TS1 encoding.\MessageBreak Default family used instead}\@eha + \bgroup\fontfamily\textcompsubstdefault\selectfont#1\egroup +} +% \end{macrocode} +% \end{macro} +% +% \begin{macro}{\textcompsubstdefault} +% \begin{macrocode} +\def\textcompsubstdefault{cmr} +% \end{macrocode} +% \end{macro} + +% \begin{macro}{\tc@error} +% |\tc@error| is going to be used in arg |#3| of +% |\CheckEncodingSubset| when a symbol is not available in a +% certain font family. It gets pass the encoding it normally lives +% in (arg one) and the name of the symbol or accent that has a +% problem. +% +% \begin{macrocode} +% error commands take argument: +% #1 symbol to be used +\def\tc@error#1{% + \PackageError{textcomp}% % should be latex error if general + {Accent \string#1 not provided by\MessageBreak + font family \f@family\space + in TS1 encoding}\@eha +} +% \end{macrocode} +% \end{macro} +% +% +% \begin{macro}{\tc@fake@euro} +% |\tc@fake@euro| is an example of a ``fake'' definition to use in arg |#3| of +% |\CheckEncodingSubset| when a symbol is not available in a +% certain font family. Here we produce an Euro symbol by combining +% a ``C'' with a ``=''. +% \begin{macrocode} +\def\tc@fake@euro#1{% + \leavevmode + \PackageInfo{textcomp}{Faking \noexpand#1for font family + \f@family\MessageBreak in TS1 encoding}% + \valign{##\cr + \vfil\hbox to 0.07em{\dimen@\f@size\p@ + \math@fontsfalse + \fontsize{.7\dimen@}\z@\selectfont=\hss}\vfil\cr% + \hbox{C}\crcr + }% +} +% \end{macrocode} +% \end{macro} +% +% \begin{macro}{\tc@check@symbol} +% \begin{macro}{\tc@check@accent} +% These are two abbreviations that we use below to check symbols +% and accents in TS1. Only there to save some space, e.g., we can +% then write +%\begin{verbatim} +%\DeclareTextCommandDefault{\textcurrency}{\tc@check@symbol3\textcurrency} +%\end{verbatim} +% to ensure that |\textcurrency| is only typeset if the current +% font has a \texttt{TS1} subset id of less than 3. Otherwise +% |\tc@error| is called telling the user that for this font family +% |\textcurreny| is not available. +% \begin{macrocode} +\def\tc@check@symbol{\CheckEncodingSubset\UseTextSymbol{TS1}\tc@subst} +\def\tc@check@accent{\CheckEncodingSubset\UseTextAccent{TS1}\tc@error} +% \end{macrocode} +% \end{macro} +% \end{macro} +% +% We start with the commands that are ``safe'' and which can be +% unconditionally set up, first the accents\ldots +% \begin{macrocode} +\DeclareTextAccentDefault{\capitalcedilla}{TS1} +\DeclareTextAccentDefault{\capitalogonek}{TS1} +\DeclareTextAccentDefault{\capitalgrave}{TS1} +\DeclareTextAccentDefault{\capitalacute}{TS1} +\DeclareTextAccentDefault{\capitalcircumflex}{TS1} +\DeclareTextAccentDefault{\capitaltilde}{TS1} +\DeclareTextAccentDefault{\capitaldieresis}{TS1} +\DeclareTextAccentDefault{\capitalhungarumlaut}{TS1} +\DeclareTextAccentDefault{\capitalring}{TS1} +\DeclareTextAccentDefault{\capitalcaron}{TS1} +\DeclareTextAccentDefault{\capitalbreve}{TS1} +\DeclareTextAccentDefault{\capitalmacron}{TS1} +\DeclareTextAccentDefault{\capitaldotaccent}{TS1} +% \end{macrocode} +% \ldots and then the other glyphs. +% \changes{v1.9p}{1998/06/12}{Renamed \cs{textmacron} pr/2840} +% \begin{macrocode} +\DeclareTextSymbolDefault{\textcapitalcompwordmark}{TS1} +\DeclareTextSymbolDefault{\textascendercompwordmark}{TS1} +\DeclareTextSymbolDefault{\textquotestraightbase}{TS1} +\DeclareTextSymbolDefault{\textquotestraightdblbase}{TS1} +\DeclareTextSymbolDefault{\texttwelveudash}{TS1} +\DeclareTextSymbolDefault{\textthreequartersemdash}{TS1} +\DeclareTextSymbolDefault{\textdollar}{TS1} +\DeclareTextSymbolDefault{\textquotesingle}{TS1} +\DeclareTextSymbolDefault{\textasteriskcentered}{TS1} +\DeclareTextSymbolDefault{\textfractionsolidus}{TS1} +\DeclareTextSymbolDefault{\textminus}{TS1} +\DeclareTextSymbolDefault{\textlbrackdbl}{TS1} +\DeclareTextSymbolDefault{\textrbrackdbl}{TS1} +\DeclareTextSymbolDefault{\textasciigrave}{TS1} +\DeclareTextSymbolDefault{\texttildelow}{TS1} +\DeclareTextSymbolDefault{\textasciibreve}{TS1} +\DeclareTextSymbolDefault{\textasciicaron}{TS1} +\DeclareTextSymbolDefault{\textgravedbl}{TS1} +\DeclareTextSymbolDefault{\textacutedbl}{TS1} +\DeclareTextSymbolDefault{\textdagger}{TS1} +\DeclareTextSymbolDefault{\textdaggerdbl}{TS1} +\DeclareTextSymbolDefault{\textbardbl}{TS1} +\DeclareTextSymbolDefault{\textperthousand}{TS1} +\DeclareTextSymbolDefault{\textbullet}{TS1} +\DeclareTextSymbolDefault{\textcelsius}{TS1} +\DeclareTextSymbolDefault{\textflorin}{TS1} +\DeclareTextSymbolDefault{\texttrademark}{TS1} +\DeclareTextSymbolDefault{\textcent}{TS1} +\DeclareTextSymbolDefault{\textsterling}{TS1} +\DeclareTextSymbolDefault{\textyen}{TS1} +\DeclareTextSymbolDefault{\textbrokenbar}{TS1} +\DeclareTextSymbolDefault{\textsection}{TS1} +\DeclareTextSymbolDefault{\textasciidieresis}{TS1} +\DeclareTextSymbolDefault{\textcopyright}{TS1} +\DeclareTextSymbolDefault{\textordfeminine}{TS1} +\DeclareTextSymbolDefault{\textlnot}{TS1} +\DeclareTextSymbolDefault{\textregistered}{TS1} +\DeclareTextSymbolDefault{\textasciimacron}{TS1} +\DeclareTextSymbolDefault{\textdegree}{TS1} +\DeclareTextSymbolDefault{\textpm}{TS1} +\DeclareTextSymbolDefault{\texttwosuperior}{TS1} +\DeclareTextSymbolDefault{\textthreesuperior}{TS1} +\DeclareTextSymbolDefault{\textasciiacute}{TS1} +\DeclareTextSymbolDefault{\textmu}{TS1} +\DeclareTextSymbolDefault{\textparagraph}{TS1} +\DeclareTextSymbolDefault{\textperiodcentered}{TS1} +\DeclareTextSymbolDefault{\textonesuperior}{TS1} +\DeclareTextSymbolDefault{\textordmasculine}{TS1} +\DeclareTextSymbolDefault{\textonequarter}{TS1} +\DeclareTextSymbolDefault{\textonehalf}{TS1} +\DeclareTextSymbolDefault{\textthreequarters}{TS1} +\DeclareTextSymbolDefault{\texttimes}{TS1} +\DeclareTextSymbolDefault{\textdiv}{TS1} +% \end{macrocode} +% +% The |\texteuro| is only available for subsets with id 4 or +% less. Otherwise we fake the glyph using |\tc@fake@euro| +% \begin{macrocode} +\DeclareTextCommandDefault{\texteuro} + {\CheckEncodingSubset\UseTextSymbol{TS1}\tc@fake@euro5\texteuro} +% \end{macrocode} +% +% The |\textohm| is only available for subsets with id 3 or +% less. Otherwise we produce an error. +% \begin{macrocode} +\DeclareTextCommandDefault{\textohm}{\tc@check@symbol4\textohm} +% \end{macrocode} +% The |\textestimated| and |\textcurrency| are only provided for +% fonts with subset encoding with id 2 or less. +% \begin{macrocode} +\DeclareTextCommandDefault{\textestimated}{\tc@check@symbol3\textestimated} +\DeclareTextCommandDefault{\textcurrency}{\tc@check@symbol3\textcurrency} +% \end{macrocode} +% Nearly all of the remaining glyphs are provided only with fonts +% with id 1 or 0, i.e., are essentially complete. +% \begin{macrocode} +\DeclareTextCommandDefault{\capitaltie}{\tc@check@accent2\capitaltie} +\DeclareTextCommandDefault{\newtie}{\tc@check@accent2\newtie} +\DeclareTextCommandDefault{\capitalnewtie}{\tc@check@accent2\capitalnewtie} +\DeclareTextCommandDefault{\textleftarrow}{\tc@check@symbol2\textleftarrow} +\DeclareTextCommandDefault{\textrightarrow}{\tc@check@symbol2\textrightarrow} +\DeclareTextCommandDefault{\textblank}{\tc@check@symbol2\textblank} +\DeclareTextCommandDefault{\textdblhyphen}{\tc@check@symbol2\textdblhyphen} +\DeclareTextCommandDefault{\textzerooldstyle}{\tc@check@symbol2\textzerooldstyle} +\DeclareTextCommandDefault{\textoneoldstyle}{\tc@check@symbol2\textoneoldstyle} +\DeclareTextCommandDefault{\texttwooldstyle}{\tc@check@symbol2\texttwooldstyle} +\DeclareTextCommandDefault{\textthreeoldstyle}{\tc@check@symbol2\textthreeoldstyle} +\DeclareTextCommandDefault{\textfouroldstyle}{\tc@check@symbol2\textfouroldstyle} +\DeclareTextCommandDefault{\textfiveoldstyle}{\tc@check@symbol2\textfiveoldstyle} +\DeclareTextCommandDefault{\textsixoldstyle}{\tc@check@symbol2\textsixoldstyle} +\DeclareTextCommandDefault{\textsevenoldstyle}{\tc@check@symbol2\textsevenoldstyle} +\DeclareTextCommandDefault{\texteightoldstyle}{\tc@check@symbol2\texteightoldstyle} +\DeclareTextCommandDefault{\textnineoldstyle}{\tc@check@symbol2\textnineoldstyle} +\DeclareTextCommandDefault{\textlangle}{\tc@check@symbol2\textlangle} +\DeclareTextCommandDefault{\textrangle}{\tc@check@symbol2\textrangle} +\DeclareTextCommandDefault{\textmho}{\tc@check@symbol2\textmho} +\DeclareTextCommandDefault{\textbigcircle}{\tc@check@symbol2\textbigcircle} +\DeclareTextCommandDefault{\textuparrow}{\tc@check@symbol2\textuparrow} +\DeclareTextCommandDefault{\textdownarrow}{\tc@check@symbol2\textdownarrow} +\DeclareTextCommandDefault{\textborn}{\tc@check@symbol2\textborn} +\DeclareTextCommandDefault{\textdivorced}{\tc@check@symbol2\textdivorced} +\DeclareTextCommandDefault{\textdied}{\tc@check@symbol2\textdied} +\DeclareTextCommandDefault{\textleaf}{\tc@check@symbol2\textleaf} +\DeclareTextCommandDefault{\textmarried}{\tc@check@symbol2\textmarried} +\DeclareTextCommandDefault{\textmusicalnote}{\tc@check@symbol2\textmusicalnote} +\DeclareTextCommandDefault{\textdblhyphenchar}{\tc@check@symbol2\textdblhyphenchar} +\DeclareTextCommandDefault{\textdollaroldstyle}{\tc@check@symbol2\textdollaroldstyle} +\DeclareTextCommandDefault{\textcentoldstyle}{\tc@check@symbol2\textcentoldstyle} +\DeclareTextCommandDefault{\textcolonmonetary}{\tc@check@symbol2\textcolonmonetary} +\DeclareTextCommandDefault{\textwon}{\tc@check@symbol2\textwon} +\DeclareTextCommandDefault{\textnaira}{\tc@check@symbol2\textnaira} +\DeclareTextCommandDefault{\textguarani}{\tc@check@symbol2\textguarani} +\DeclareTextCommandDefault{\textpeso}{\tc@check@symbol2\textpeso} +\DeclareTextCommandDefault{\textlira}{\tc@check@symbol2\textlira} +\DeclareTextCommandDefault{\textrecipe}{\tc@check@symbol2\textrecipe} +\DeclareTextCommandDefault{\textinterrobang}{\tc@check@symbol2\textinterrobang} +\DeclareTextCommandDefault{\textinterrobangdown}{\tc@check@symbol2\textinterrobangdown} +\DeclareTextCommandDefault{\textdong}{\tc@check@symbol2\textdong} +\DeclareTextCommandDefault{\textpertenthousand}{\tc@check@symbol2\textpertenthousand} +\DeclareTextCommandDefault{\textpilcrow}{\tc@check@symbol2\textpilcrow} +\DeclareTextCommandDefault{\textbaht}{\tc@check@symbol2\textbaht} +\DeclareTextCommandDefault{\textnumero}{\tc@check@symbol2\textnumero} +\DeclareTextCommandDefault{\textdiscount}{\tc@check@symbol2\textdiscount} +\DeclareTextCommandDefault{\textopenbullet}{\tc@check@symbol2\textopenbullet} +\DeclareTextCommandDefault{\textservicemark}{\tc@check@symbol2\textservicemark} +\DeclareTextCommandDefault{\textlquill}{\tc@check@symbol2\textlquill} +\DeclareTextCommandDefault{\textrquill}{\tc@check@symbol2\textrquill} +\DeclareTextCommandDefault{\textcopyleft}{\tc@check@symbol2\textcopyleft} +\DeclareTextCommandDefault{\textcircledP}{\tc@check@symbol2\textcircledP} +\DeclareTextCommandDefault{\textreferencemark}{\tc@check@symbol2\textreferencemark} +\DeclareTextCommandDefault{\textsurd}{\tc@check@symbol2\textsurd} +% \end{macrocode} +% The |\textcircled| and |\t| are handled specially, unless the +% current font has a subset id of 0 (i.e. full \texttt{TS1}) we +% pick the symbols up from the the math font encodings, i.e., the +% third argument to |\CheckEncodingSubset| uses |\UseTextAccent| to +% get them from there. +% \begin{macrocode} +\DeclareTextCommandDefault{\textcircled} + {\CheckEncodingSubset\UseTextAccent{TS1}{\UseTextAccent{OMS}}1\textcircled} +\DeclareTextCommandDefault{\t} + {\CheckEncodingSubset\UseTextAccent{TS1}{\UseTextAccent{OML}}1\t} +% \end{macrocode} + + +% +% Finally input the encoding-specific definitions for +% \texttt{TS1} thus making the top-level definitions +% optimised for this encoding (and not for the default +% encoding, see section~\ref{sec:orderofdecls}). +% \changes{v1.9o}{1998/03/20}{Load decls after defaults for speed.} +% \begin{macrocode} +\input{ts1enc.def} +% \end{macrocode} +% Now having the new glyphs available we also want to make sure +% that they are used. For most cases this will automatically happen +% but for some glyphs there are inferior definitions already known +% to \LaTeX{} which will prevent the usage of the \texttt{TS1} +% versions (see section~\ref{sec:removeencspec} above). So we better +% get rid of them: +% \changes{v1.9o}{1998/03/20}{Added various \cs{UndeclareTextCommand} +% declarations for pr/2783} +% \begin{macrocode} +\UndeclareTextCommand{\textsterling}{OT1} +\UndeclareTextCommand{\textdollar} {OT1} +% \end{macrocode} +% Similar declarations should probably be made for other encodings +% like \texttt{OT4} if they are in use. +% \begin{macrocode} +%\UndeclareTextCommand{\textsterling}{OT4} +%\UndeclareTextCommand{\textdollar} {OT4} +% \end{macrocode} +% From the \texttt{T1} encoding there are two candidates for removal: +% \textperthousand{} and \textpertenthousand{} since these are both +% constructed from \% followed by a tiny +% `{\fontencoding{T1}\selectfont \char 24}' +% rather than being a single glyph. The problem with this +% approach is that in PostScript fonts this small zero is usually not +% available resulting in \%\rule{3pt}{3pt} rather than +% \textperthousand{} while the real glyph (at least for +% |\textperthousand|) is available in the PostScript version of +% \texttt{TS1}. So for the moment we compromise by removing the +% \texttt{T1} declaration for |\textperthousand| but keeping the one +% for |\textpertenthousand|. This will have the effect that with +% Computer Modern fonts everything will come out (although +% \textperthousand{} and \textpertenthousand{} are not taken from the +% same physical font) and with PostScript fonts \textperthousand{} +% will come out correctly while \textpertenthousand{} will most +% likely look like \%\rule{6pt}{3pt} --- which is probably an +% improvement over just getting a single `\rule{3pt}{3pt}' to +% indicate a completely missing glyph, which would happen if we +% also `undeclared' |\textpertenthousand|. +% \begin{macrocode} +\UndeclareTextCommand{\textperthousand}{T1} +%\UndeclareTextCommand{\textpertenthousand}{T1} +% \end{macrocode} +% +% +% \subsubsection{Supporting oldstyle digits} +% +% \begin{macrocode} +\DeclareRobustCommand\oldstylenums[1]{% + \begingroup + \ifmmode + \mathgroup\symletters #1% + \else + \CheckEncodingSubset\@use@text@encoding{TS1}% + {\PackageWarning{textcomp}% + {Oldstyle digits unavailable for + family \f@family.\MessageBreak + Lining digits used instead}}% + \tw@{#1}% + \fi + \endgroup +} +% \end{macrocode} +% +% \subsubsection{Subset encoding defaults} +% +% For many font families commonly used in the \TeX{} world we +% provide the subset encoding data here. Users can add additional +% font families in the file \texttt{textcomp.cfg} if they own other +% fonts. +% +% However, if the option ``forced'' was given then all subset +% encoding specifications are ignored, so there is no point in +% setting any of them up: +% \begin{macrocode} +\iftc@forced \else +% \end{macrocode} +% +% Computer modern based fonts (e.g., CM, CM-Bright, Concrete): +% \begin{macrocode} +\DeclareEncodingSubset{TS1}{cmr} {0} +\DeclareEncodingSubset{TS1}{cmss} {0} +\DeclareEncodingSubset{TS1}{cmtt} {0} +\DeclareEncodingSubset{TS1}{cmvtt} {0} +\DeclareEncodingSubset{TS1}{cmbr} {0} +\DeclareEncodingSubset{TS1}{cmtl} {0} +\DeclareEncodingSubset{TS1}{ccr} {0} +% \end{macrocode} +% +% PSNFSS fonts: +% \begin{macrocode} +\DeclareEncodingSubset{TS1}{ptm} {4} +\DeclareEncodingSubset{TS1}{pcr} {4} +\DeclareEncodingSubset{TS1}{phv} {4} +\DeclareEncodingSubset{TS1}{ppl} {3} +\DeclareEncodingSubset{TS1}{pag} {4} +\DeclareEncodingSubset{TS1}{pbk} {4} +\DeclareEncodingSubset{TS1}{pnc} {4} +\DeclareEncodingSubset{TS1}{pzc} {4} +\DeclareEncodingSubset{TS1}{bch} {4} +\DeclareEncodingSubset{TS1}{put} {5} +% \end{macrocode} +% +% Other CTAN fonts (probably not complete): +% \begin{macrocode} +\DeclareEncodingSubset{TS1}{uag} {5} +\DeclareEncodingSubset{TS1}{ugq} {5} +\DeclareEncodingSubset{TS1}{ul8} {4} +\DeclareEncodingSubset{TS1}{ul9} {4} % (LuxiSans, one day) +\DeclareEncodingSubset{TS1}{augie} {5} +\DeclareEncodingSubset{TS1}{dayrom} {3} +\DeclareEncodingSubset{TS1}{dayroms} {3} +\DeclareEncodingSubset{TS1}{pxr} {0} +\DeclareEncodingSubset{TS1}{pxss} {0} +\DeclareEncodingSubset{TS1}{pxtt} {0} +\DeclareEncodingSubset{TS1}{txr} {0} +\DeclareEncodingSubset{TS1}{txss} {0} +\DeclareEncodingSubset{TS1}{txtt} {0} +% \end{macrocode} +% +% Fourier-GUTenberg: +% \begin{macrocode} +\DeclareEncodingSubset{TS1}{futs} {4} +\DeclareEncodingSubset{TS1}{futx} {4} +\DeclareEncodingSubset{TS1}{futj} {4} +% \end{macrocode} +% +% Y\&Y's Lucida Bright +% \begin{macrocode} +\DeclareEncodingSubset{TS1}{hlh} {3} +\DeclareEncodingSubset{TS1}{hls} {3} +\DeclareEncodingSubset{TS1}{hlst} {3} +% \end{macrocode} +% The remaining settings for Lucida are conservative: the following +% fonts contain the |\textohm| character but not the |\texteuro|, +% i.e., belong to neither subset~4 nor subset~3. If you want to +% use the |\textohm| with these fonts copy these definition to +% \texttt{textcomp.cfg} and change the subset to~3. However in that +% case make sure that you do not use the |\texteuro|. +% \begin{macrocode} +\DeclareEncodingSubset{TS1}{hlct} {5} +\DeclareEncodingSubset{TS1}{hlx} {5} +\DeclareEncodingSubset{TS1}{hlce} {5} +\DeclareEncodingSubset{TS1}{hlcn} {5} +\DeclareEncodingSubset{TS1}{hlcw} {5} +\DeclareEncodingSubset{TS1}{hlcf} {5} +% \end{macrocode} +% +% Other commercial families\ldots +% \begin{macrocode} +\DeclareEncodingSubset{TS1}{pplx} {3} +\DeclareEncodingSubset{TS1}{pplj} {3} +\DeclareEncodingSubset{TS1}{ptmx} {4} +\DeclareEncodingSubset{TS1}{ptmj} {4} +% \end{macrocode} +% +% If the file \texttt{textcomp.cfg} exists it will be loaded at +% this point. This allows to define further subset encodings for +% font families not covered by default. +% +% \begin{macrocode} +\InputIfFileExists{textcomp.cfg} + {\PackageInfo{textcomp}{Local configuration file used}}{} +% \end{macrocode} +% +% \begin{macrocode} +\fi +% +% \end{macrocode} +% +% \Finale +% +\endinput diff --git a/Master/texmf-dist/source/latex/base/ltoutenc.ins b/Master/texmf-dist/source/latex/base/ltoutenc.ins new file mode 100644 index 00000000000..8212686c492 --- /dev/null +++ b/Master/texmf-dist/source/latex/base/ltoutenc.ins @@ -0,0 +1,97 @@ +%% +%% This file will generate fast loadable files and documentation +%% driver files from the doc files in this package when run through +%% LaTeX or TeX. +%% +%% Copyright 1993 1994 1995 1996 1997 1998 1999 2000 2001 2002 2003 2004 +%% The LaTeX3 Project and any individual authors listed elsewhere +%% in this file. +%% +%% This file is part of the LaTeX base system. +%% ------------------------------------------- +%% +%% It may be distributed and/or modified under the +%% conditions of the LaTeX Project Public License, either version 1.3 +%% of this license or (at your option) any later version. +%% The latest version of this license is in +%% http://www.latex-project.org/lppl.txt +%% and version 1.3 or later is part of all distributions of LaTeX +%% version 2003/12/01 or later. +%% +%% This file has the LPPL maintenance status "maintained". +%% +%% In particular, NO PERMISSION is granted to modify the contents of this +%% file since it contains the legal notices that are placed in the files +%% it generates. +%% +%% The list of all files belonging to the LaTeX base distribution is +%% given in the file `manifest.txt'. See also `legal.txt' for additional +%% information. +%% +%% +%% +%% +%% --------------- start of docstrip commands ------------------ +%% + +\input docstrip + +\preamble + +This is a generated file. + +Copyright 1993 1994 1995 1996 1997 1998 1999 2000 2001 2002 2003 2004 +The LaTeX3 Project and any individual authors listed elsewhere +in this file. + +This file was generated from file(s) of the LaTeX base system. +-------------------------------------------------------------- + +It may be distributed and/or modified under the +conditions of the LaTeX Project Public License, either version 1.3 +of this license or (at your option) any later version. +The latest version of this license is in + http://www.latex-project.org/lppl.txt +and version 1.3 or later is part of all distributions of LaTeX +version 2003/12/01 or later. + +This file has the LPPL maintenance status "maintained". + +This file may only be distributed together with a copy of the LaTeX +base system. You may however distribute the LaTeX base system without +such generated files. + +The list of all files belonging to the LaTeX base distribution is +given in the file `manifest.txt'. See also `legal.txt' for additional +information. + +The list of derived (unpacked) files belonging to the distribution +and covered by LPPL is defined by the unpacking scripts (with +extension .ins) which are part of the distribution. +\endpreamble + +\keepsilent +\usedir{tex/latex/base} + +\generate{ + \file{ot1enc.def}{ + \from{ltoutenc.dtx}{OT1}} + \file{omsenc.def}{ + \from{ltoutenc.dtx}{OMS}} + \file{omlenc.def}{ + \from{ltoutenc.dtx}{OML}} + \file{t1enc.def}{ + \from{ltoutenc.dtx}{T1}} + \file{ot4enc.def}{ + \from{ltoutenc.dtx}{OT4}} + \file{ts1enc.def}{ + \from{ltoutenc.dtx}{TS1}} + \file{textcomp.sty}{ + \from{ltoutenc.dtx}{TS1sty}} + \file{fontenc.sty}{ + \from{ltoutenc.dtx}{package}} +} + +\endbatchfile + + diff --git a/Master/texmf-dist/source/latex/base/ltoutput.dtx b/Master/texmf-dist/source/latex/base/ltoutput.dtx new file mode 100644 index 00000000000..d7eee068854 --- /dev/null +++ b/Master/texmf-dist/source/latex/base/ltoutput.dtx @@ -0,0 +1,3963 @@ +% \iffalse meta-comment +% +% Copyright 1993 1994 1995 1996 1997 1998 1999 2000 2001 2002 2003 2004 +% The LaTeX3 Project and any individual authors listed elsewhere +% in this file. +% +% This file is part of the LaTeX base system. +% ------------------------------------------- +% +% It may be distributed and/or modified under the +% conditions of the LaTeX Project Public License, either version 1.3 +% of this license or (at your option) any later version. +% The latest version of this license is in +% http://www.latex-project.org/lppl.txt +% and version 1.3 or later is part of all distributions of LaTeX +% version 2003/12/01 or later. +% +% This file has the LPPL maintenance status "maintained". +% +% The list of all files belonging to the LaTeX base distribution is +% given in the file `manifest.txt'. See also `legal.txt' for additional +% information. +% +% The list of derived (unpacked) files belonging to the distribution +% and covered by LPPL is defined by the unpacking scripts (with +% extension .ins) which are part of the distribution. +% +% \fi +% \iffalse +%%% From File: ltoutput.dtx +%\ProvidesFile{autoout1.sty} +%\ProvidesPackage{flafter} +% [2000/07/23 v1.2i +% Output Routine autoload file] +% Standard LaTeX floats after reference (FMi)] +% +%<*driver> +% \fi +\ProvidesFile{ltoutput.dtx} + [2004/02/07 v1.2l LaTeX Kernel (Output Routine)] +% \iffalse +\documentclass{ltxdoc} +\GetFileInfo{ltoutput.dtx} +\title{\filename} +\date{\filedate} +\author{Leslie Lamport, Frank Mittelbach, Chris Rowley} +\begin{document} +\maketitle +\DocInput{\filename} +\end{document} +% +% \fi +% +% \CheckSum{2764} +% +% +% \iffalse +% LATEX VERSION 2e +% Copyright (C) 1992 by Leslie Lamport +% Copyright (C) 1994-2000 by Leslie Lamport, LaTeX3 project +% +% LaTeX 2e kernel file for the output routine. +% +% Part of this file is the latest (not greatest, it still +% deserves its name) version of kludge.sty. +% +% It also contains a few enhancements and many changes (corrections +% and tidyings) to the float mechanism and other parts of the output +% routine. +% +% The tracing in the file at present is mainly to help in testing the +% code but it may well be developed into a full float tracing +% package one day. +% +% ============================ +% \fi +% +% \changes{v1.1p}{1995/08/25}{Support autoloading feature (FMi).} +% \task{CAR}{Update documentation.} +% \changes{v1.0k}{1994/02/08}{Documentation and tasks tidied.} +% \changes{v1.0l}{1994/03/15}{Driver added and further tidying.} +% \changes{v1.0l}{1994/03/15}{Some boxmaxdepth settings removed.} +% \changes{v1.0l}{1994/03/15}{Added some warnings when page gets full of +% top floats.} +% \changes{v1.0l}{1994/03/15}{Removed duplicated code and corrected +% docstrip options.} +% \changes{v1.0m}{1994/04/24}{Removed some long lines and other +% aesthetic changes.} +% \changes{v1.0m}{1994/04/24}{Corrected unverbed commands in +% documentation.} +% \changes{v1.0m}{1994/04/24}{Changed \cs{@normalsize} to +% \cs{normalsize}.} +% \changes{v1.0m}{1994/04/24}{Warning messages changed/corrected.} +% \changes{v1.0n}{1994/04/30}{Added \cs{col@number}.} +% \changes{v1.0n}{1994/04/30}{Fixed bug from \cs{dblfigrule} with +% \cs{@topnewpage}.} +% \changes{v1.0n}{1994/04/30}{Documentation tidied.} +% \changes{v1.0n}{1994/04/30}{\cs{@activechar@warning} changed to an +% info message.} +% \changes{v1.0n}{1994/04/30}{Full of floats action improved.} +% \changes{v1.0n}{1994/04/30}{Empty column action added.} +% \changes{v1.0o}{1994/05/02}{Code of \cs{@resethfps} shortened.} +% \changes{v1.0p}{1994/05/12}{\cs{normalcolor}added in various +% places (DPC).} +% \changes{v1.0q}{1994/05/16}{Changed setting of accents (FMi).} +% \changes{v1.0s}{1994/05/20}{Added setting of \cs{protect} +% during \cs{shipout}.} +% \changes{v1.0t}{1994/05/22}{Changed warnings and infos to +% new commands.} +% \changes{v1.0u}{1994/05/23}{Added \cs{MessageBreak}.} +% \changes{v1.0u}{1994/05/23}{Changed resetting of \cs{protect} after +% shipout.} +% \changes{v1.0v}{1994/05/25}{Extra documentation.} +% \changes{v1.0w}{1994/06/01}{Tidied up typesetting.} +% +% \changes{v1.1f}{1994/11/14}{Removed old definition of \cs{@testfp}.} +% \changes{v1.1h}{1994/11/17} +% {\cs{@tempa} to \cs{reserved@a}.} +% \changes{v1.1m}{1995/05/07}{Use \cs{hb@xt@}.} +% +% \StopEventually{} +% +% \def \ie {i.e.~} +% \def \eg {e.g.~} +% +% \section{Output Routine} +% +% \subsection{Floats} +% +% The `2ekernel' code ensures that a |\usepackage{autoout1}| is +% essentially ignored if a `full' format is being used that has +% the autoload file mode already in the format. +% \begin{macrocode} +%\begingroup +%\makeatletter +%\nfss@catcodes +%<2ekernel>\expandafter\let\csname ver@autoout1.sty\endcsname\fmtversion +% \end{macrocode} +% +% +% \begin{oldcomments} +% \begin{macrocode} +%<*2ekernel|autoload> +\message{output,} +% \end{macrocode} +% **************************************** +% * OUTPUT * +% **************************************** +% +% +% PAGE LAYOUT PARAMETERS +% +% \topmargin : Extra space added to top of page. +% @twoside : boolean. T if two-sided printing +% \oddsidemargin : IF @twoside = T +% THEN extra space added to left of odd-numbered +% pages. +% ELSE extra space added to left of all pages. +% \evensidemargin : IF @twoside = T +% THEN extra space added to left of even-numbered +% pages. +% \headheight : height of head +% \headsep : separation between head and text +% \footskip : distance separation between baseline of last +% line of text and baseline of foot. +% Note difference between \footSKIP and \headSEP. +% \textheight : height of text on page, excluding head and foot +% \textwidth : width of printing on page +% \columnsep : IF @twocolumn = T +% THEN width of space between columns +% \columnseprule : IF @twocolumn = T +% THEN width of rule between columns (0 if none). +% \columnwidth : IF @twocolumn = T +% THEN (\textwidth - \columnsep)/2 +% ELSE \textwidth +% It is set by the \twocolumn and +% \onecolumn commands. +% \@textbottom : Command executed at bottom of vbox holding text of +% page (including figures). The \raggedbottom +% command almost \let's this to \vfil (actually sets +% it to \vskip \z@ plus.0001fil). +% Should have depth 0pt. +% +% \@texttop : Command executed at top of vbox holding text of +% page (including figures). Used by letter style; +% can also be used to produce centered pages. +% Let to \relax by \raggedbottom and \flushbottom. +% +% Page layout must initialize \@colht and \@colroom to \textheight. +% +% PAGE STYLE PARAMETERS: +% +% \floatsep : Space left between floats. +% \textfloatsep : Space between last top float or first bottom float +% and the text. +% \topfigrule : Command to place rule (or whatever) between floats +% at top of page and text. Executed in inner +% vertical mode right before the \textfloatsep skip +% separating the floats from the text. Must occupy +% zero vertical space. (See \footnoterule.) +% \botfigrule : Same as \topfigrule, but put after the +% \textfloatsep skip separating text from the +% floats at bottom of page. +% \intextsep : Space left on top and bottom of an in-text float. +% \dblfloatsep : Space between double-column floats. +% \dbltextfloatsep : Space between top double-column floats +% and text. +% \dblfigrule : Similar to \topfigrule, but for double-column +% floats. +% \@fptop : Glue to go at top of float column -- must be 0pt + +% stretch +% \@fpsep : Glue to go between floats in a float column. +% \@fpbot : Glue to go at bottom of float column +% -- must be 0pt + +% stretch +% \@dblfptop, \@dblfpsep, \@dblfpbot +% : Analogous for double-column float page in +% two-column format. +% +% FOOTNOTES: As in PLAIN, footnotes use \insert\footins. +% +% PAGE LAYOUT SWITCHES AND MACROS +% +% @twocolumn : Boolean. T if two columns per page globally. +% +% PAGE STYLE MACROS AND SWITCHES +% +% \@oddhead : IF @twoside = T +% THEN macro to generate head of odd-numbered +% pages. +% ELSE macro to generate head of all pages. +% \@evenhead : IF @twoside = T +% THEN macro to generate head of even-numbered +% pages. +% \@oddfoot : IF @twoside = T +% THEN macro to generate foot of odd-numbered +% pages. +% ELSE macro to generate foot of all pages. +% \@evenfoot : IF @twoside = T +% THEN macro to generate foot of even-numbered +% pages. +% @specialpage : boolean. T if current page is to have a special +% format. +% \@specialstyle : If its value is foo then +% IF @specialpage = T +% THEN the command \ps@foo is executed to +% temporarily reset the page style parameters +% before composing the current page. +% This command should execute only \def's and +% \edef's, making only local definitions. +% +% FLOAT PLACEMENT PARAMETERS +% +% The following parameters are set by the macro \@floatplacement. +% When \@floatplacement is called, +% \@colht is the height of the page or column being built. I.e.: +% * For single-column page it equals \textheight. +% * For double-column page it equals \textheight - height +% of double-column floats on page. +% Note that some are set globally and some locally: +% \@topnum :=G Maximum number of floats allowed on the top of a +% column. +% \@toproom :=G Maximum amount of top of column devoted to floats-- +% excluding \textfloatsep separation below the floats +% and \floatsep separation between them. For +% two-column output, should be computed as a function +% of \@colht. +% \@botnum, \@botroom +% : Analogous to above. +% \@colnum :=G Maximum number of floats allowed in a column, +% including in-text floats. +% \@textmin :=L Minimum amount of text (excluding footnotes) that +% must appear on a text page. +% %% 27 Sep 85 : made local to +% %% \@addtocurcol and \@addtonextcol +% It is now also used locally in processing double +% floats. +% \@fpmin :=L Minimum height of floats in a float column. +% +% The macro \@dblfloatplacement sets the following parameters. +% \@dbltopnum :=G Maximum number of double-column floats allowed at +% the top of a two-column page. +% \@dbltoproom :=G Maximum height of double-column floats allowed at +% top of two-column page. +% \@fpmin :=L Minimum height of floats in a float column. +% It should also perform the following local assignments where necessary +% -- i.e., where the new value differs from the old one: +% \@fptop :=L \@dblfptop +% \@fpsep :=L \@dblfpsep +% \@fpbot :=L \@dblfpbot +% +% OUTPUT ROUTINE VARIABLES +% +% \@colht : The total height of the current column. In single column +% style, it equals \textheight. In two-column style, it is +% \textheight minus the height of the double-column floats +% on the current page. MUST BE INITIALIZED TO \textheight. +% +% \@colroom : The height available in the current column for text and +% footnotes. It equals \@colht minus the height of all +% floats committed to the top and bottom of the current +% column. +% +% \@textfloatsheight : The total height of in-text floats on the +% current page. +% +% \footins : Footnote insertion number. +% +% \@maxdepth : Saved value of TeX's \maxdepth. Must be set +% when any routine sets \maxdepth. +% +% CALLING THE OUTPUT ROUTINE +% -------------------------- +% +% The output routine is called either by TeX's normal page-breaking +% mechanism, or by a macro putting a penalty < or = -10000 in the output +% list. In the latter case, the penalty indicates why the output +% routine was called, using the following code. +% +% penalty reason +% ------- ------ +% -10000 \pagebreak +% \newpage +% -10001 \clearpage (\penalty -10000 \vbox{} \penalty -10001) +% -10002 float insertion, called from horizontal mode +% -10003 float insertion, called from vertical mode. +% -10004 float insertion. +% +% Note: A float or marginpar puts the following sequence in the output +% list: (i) a penalty of -10004, +% (ii) a null \vbox +% (iii) a penalty of -10002 or -10003. +% This solves two special problems: +% 1. If the float comes right after a \newpage or \clearpage, +% then the first penalty is ignored, but the second one +% invokes the output routine. +% 2. If there is a split footnote on the page, the second 'page' +% puts out the rest of the footnote. +% +% THE OUTPUT ROUTINE +% ------------------ +% +% FUNCTIONS USED IN THE OUTPUT ROUTINE: +% +% \@outputpage : Produces an output page with the contents of box +% \@outputbox as the text part. +% Also sets \@colht :=G \textheight. +% The page style is determined as follows. +% IF @thispagestyle = true +% THEN use \thispagestyle style +% ELSE use ordinary page style. +% +% \@tryfcolumn\FLIST : Tries to form a float column composed of floats +% from \FLIST (if nonempty) with the following parameters: +% \@colht : height of box +% \@fpmin : minimum height of floats in the box +% \@fpsep : interfloat space +% \@fptop : glue at top of box +% \@fpbot : glue at bottom of box. +% If it succeeds, then it does the following: +% * \@outputbox :=L the composed float box. +% * @fcolmade :=G true +% * \FLIST :=G \FLIST - floats put in box +% * \@freelist :=G \@freelist + floats put in box +% If it fails, then: +% * @fcolmade :=G false +% NOTE: BIT MUST BE A SINGLE TOKEN! +% +% \@makefcolumn \FLIST : Same as \@tryfcolumn except that it +% fails to make a float column only if \FLIST is empty. +% Otherwise, it makes a float column containing at least +% the first box in \FLIST, disregarding \@fpmin. +% +% \@startcolumn : +% Calls \@tryfcolumn\@deferlist. If \@tryfcolumn returns with +% (globally set) @fcolmade = false, then: +% * Globally sets \@toplist and \@botlist to floats +% from \@deferlist to go at top and bottom of column, +% deleting them from \@deferlist. It does +% this using \@colht as the total height, the page +% style parameters \@floatsep and \@textfloatsep, and +% the float placement parameters \@topnum, \@toproom, +% \@botnum, \@botroom, \@colnum and \textfraction. +% * Globally sets \@colroom to \@colht minus the height +% of the added floats. +% +% \@startdblcolumn : +% Calls \@tryfcolumn\@dbldeferlist{8}. If \@tryfcolumn returns +% with (globally set) @fcolmade = false, then: +% * Globally sets \@dbltoplist to floats from +% \@dbldeferlist to go at top and bottom of column, +% deleting them from \@dbldeferlist. +% It does this using \textheight as the +% total height, and the parameters \@dblfloatsep, etc. +% * Globally sets \@colht to \textheight minus the height +% of the added floats. +% +% \@combinefloats : Combines the text from box +% \@outputbox with the floats from \@toplist and \@botlist, +% putting the new box in \@outputbox. It uses \floatsep +% and \textfloatsep for the appropriate separations. +% It puts the elements of \TOPLIST and \BOTLIST onto +% \@freelist, and makes those lists null. +% +% \@makecol : Makes the contents of \box255 plus the accumulated +% footnotes, plus the floats in \@toplist and \@botlist, +% into a single column of height \@colht (unless the page +% height has been locally changed), which it puts +% into box \@outputbox. It puts boxes in \@midlist back +% onto \@freelist and restores \maxdepth. +% +% \@opcol : Outputs a column whose text is in box \@outputbox +% If @twocolumn = false, then it calls \@outputpage, +% sets \@colht :=G \textheight, and calls \@floatplacement. +% +% If @twocolumn = true, then: +% If @firstcolumn = true, then it puts box \@outputbox +% into \@leftcolumn and sets @firstcolumn :=G false. +% +% If @firstcolumn = false, then it puts out the current +% two-column page, any possible two-column float pages, +% and determines \@dbltoplist for the next page. +% +% +% +% USER COMMANDS THAT CALL OR AFFECT THE OUTPUT ROUTINE +% ---------------------------------------------------- +% +% \newpage == BEGIN \par\vfil\penalty -10000 END +% +% \clearpage == BEGIN \newpage +% \write -1{} % Part of hack to make sure no +% \vbox{} % \write's get lost. +% \penalty -10001 +% END +% +% \cleardoublepage == BEGIN \clearpage +% if @twoside = true and c@page is even +% then \hbox{} \newpage fi +% END +% +% +% \twocolumn[BOX] : starts a new page, changing to twocolumn setting +% and puts BOX in a parbox of width \textwidth across the top. +% Useful for full-width titles for double-column pages. +% SURPRISE: The stretch from \@dbltextfloatsep will be inserted +% between the BOX and the top of the two columns. +% +% +% FLOAT-HANDLING MECHANISMS +% ------------------------- +% +% The float environment obtains an insertion number B from the +% \@freelist (see below for a description of list manipulation), puts +% the float into box B and sets \count B to a FLOAT SPECIFIER. For +% a normal (not double-column) float, it then causes a page break +% in one of the following two ways: +% - In outer hmode: \vadjust{\penalty -10002} +% - In vmode : \penalty -10003. +% For a double-column float, it puts B onto the \@dbldeferlist. +% The float specifier has two components: +% * A PLACEMENT SPECIFICATION, describing where the float may +% be placed. +% * A TYPE, which is a power of two--e.g., figures might be +% type 1 floats, tables type 2 floats, programs type 4 floats, etc. +% The float specifier is encoded as follows, where bit 0 is the least +% significant bit. +% +% Bit Meaning +% --- ------- +% 0 1 iff the float may go where it appears in the text. +% 1 1 iff the float may go on the top of a page. +% 2 1 iff the float may go on the bottom of a page. +% 3 1 iff the float may go on a float page. +% 4 1 unless the PLACEMENT incluses a ! +% 5 1 iff a type 1 float +% 6 1 iff a type 2 float +% etc. +% +% A negative float specifier is used to indicate a marginal note. +% +% MACROS AND DATA STRUCTURES FOR PROCESSING FLOATS +% ------------------------------------------------ +% +% A FLOAT LIST consisting of the floats in boxes \boxa ... \boxN has +% the form: +% \@elt \boxa ... \@elt \boxN +% where \boxI is defined by +% \newinsert\boxI +% Normally, \@elt is \let to \relax. A test can be performed on the +% entire float list by locally \def'ing \@elt appropriately and +% executing the list. +% This is a lot more efficient than looping through the list. +% +% The following macros are used for manipulating float lists. +% +% \@next \CS \LIST {NONEMPTY}{EMPTY} == %% NOTE: ASSUME \@elt = \relax +% BEGIN assume that \LIST == \@elt \B1 ... \@elt \Bn +% if n = 0 +% then EMPTY +% else \CS :=L \B1 +% \LIST :=G \@elt \B2 ... \@elt \Bn +% NONEMPTY +% fi +% END +% +% +% \@bitor\NUM\LIST : Globally sets switch @test to the disjunction for +% all I of bit log2 \NUM of the float specifiers of all the +% floats in \LIST. +% I.e., @test is set to true iff there is at least one +% float in \LIST having bit log2 \NUM of its float specifier +% equal to 1. +% +% Note: log2 [(\count I)/32] is the bit number corresponding to the +% type of float I. To see if there is any float in \LIST having +% the same type as float I, you run \@bitor with +% \NUM = [(\count I)/32] * 32. +% +% \@bitor\NUM\LIST == +% BEGIN +% @test :=G false +% { \@elt \CTR == if \NUM <> 0 then +% if \count\CTR / \NUM is odd +% then @test := true fi fi +% \LIST +% } +% END +% +% +% \@cons\LIST\NUM : Globally sets \LIST := \LIST * \@elt \NUM +% +% \@cons\LIST\NUM == +% BEGIN { \@elt == \relax +% \LIST :=G \LIST \@elt \NUM +% } +% +% BOX LISTS FOR FLOAT-PLACEMENT ALGORITHMS +% +% \@freelist : List of empty boxes for placing new floats. +% \@toplist : List of floats to go at top of current column. +% \@midlist : List of floats in middle of current column. +% \@botlist : List of floats to go at bottom of current column. +% \@deferlist : List of floats to go after current column. +% \@dbltoplist : List of double-col. floats to go at top of current +% page. +% \@dbldeferlist : List of double-column floats to go on subsequent +% pages. +% +% FLOAT-PLACEMENT ALGORITHMS +% +% +% \@addtobot : Tries to put insert \@currbox on \@botlist. +% Called only when: +% * \ht BOX < \@colroom +% * type of \@currbox not on \@deferlist +% * \@colnum > 0 +% * @insert = false +% If it succeeds, then: +% * sets @insert true +% * decrements \@botroom by \ht BOX +% * decrements \@botnum and \@colnum by 1 +% * decrements \@colroom by \ht BOX + either \floatsep +% or \textfloatsep, as appropriate. +% * sets \maxdepth to 0pt +% +% \@addtotoporbot : Tries to put insert \@currbox on \@toplist or +% \@botlist. +% Called only under same conditions as \@addtobot. +% If it succeeds, then: +% * sets @insert true +% * decrements \@toproom or \@botroom by \ht BOX +% * decrements \@colnum and either \@topnum or +% \@botnum by 1 +% * decrements \@colroom by \ht BOX + \floatsep +% or \textfloatsep, as appropriate. +% +% \@addtocurcol : Tries to add \@currbox to current column, setting +% @insert true if it succeeds, false otherwise. +% It will add \@currbox to top only if bit 0 of +% \count \@currbox is 0, and to the bottom only if +% bit 0 = 0 or an earlier float of the same type is +% put on the bottom. +% If the float is put in the text, then +% \penalty\interlinepenalty is put +% right after the float, before the following \vskip, +% and \outputpenalty :=L 0. +% +% \@addtonextcol : Tries to add \@currbox to the next column, setting +% @insert true if it succeeds, false otherwise. +% +% \@addtodblcol : Tries to add \@currbox to the next double-column page, +% adding it to \@dbltoplist if it succeeds and +% \@dbldeferlist if it fails. +% +% +% \@addmarginpar == +% BEGIN +% if \@currlist nonempty +% then remove \@marbox from \@currlist +% add \@marbox and \@currbox to \@freelist +% %% NOTE: \@currbox = left box +% else LaTeX error: ? %% shouldn't happen +% fi +% \@tempcnta := 1 %% 1 = right, -1 = left +% if @twocolumn = true +% then if @firstcolumn = true +% then \@tempcnta := -1 +% fi +% else if @mparswitch = true +% then if count0 odd +% else \@tempcnta := -1 +% fi +% fi +% if @reversemargin = true +% then \@tempcnta := -\@tempcnta +% fi +% fi +% if \@tempcnta < 0 then \box\@marbox :=G \box\@currbox +% fi +% \@tempdima :=L maximum(\@mparbottom - \@pageht +% + ht of \@marbox, 0) +% if \@tempdima > 0 then LaTeX warning: 'marginpar moved' fi +% \@mparbottom :=G \@pageht + \@tempdima + depth of \@marbox +% + \marginparpush +% \@tempdima :=L \@tempdima - ht of \@marbox +% \box\@marbox :=G \box\@currbox +% \vbox { \vskip \@tempdima +% \box\@marbox +% } +% height of \@marbox :=G depth of \@marbox :=G 0 +% \kern -\@pagedp +% \nointerlineskip +% \hbox{ if @tempcnta > 0 then \hskip \columnwidth +% \hskip \marginparsep +% else \hskip -\marginparsep +% \hskip -\marginparwidth +% fi +% \box\@marbox \hss +% } +% \nobreak +% \nointerlineskip +% \hbox{\vrule height 0 width 0 depth \@pagedp} +% END +% +% Floats and marginpars add a lot of dead cycles. +% \begin{macrocode} +\maxdeadcycles = 100 +% \end{macrocode} +% +% \begin{macrocode} +\let\@elt\relax +% \end{macrocode} +% +% \begin{macrocode} +\def\@next#1#2#3#4{\ifx#2\@empty #4\else + \expandafter\@xnext #2\@@#1#2#3\fi} +% \end{macrocode} +% +% \begin{macrocode} +\def\@xnext \@elt #1#2\@@#3#4{\def#3{#1}\gdef#4{#2}} +% \end{macrocode} +% +% \changes{v1.1v}{1996/07/26}{put \cs{global} into definition} +% \begin{macrocode} +\def\@testfalse{\global\let\if@test\iffalse} +\def\@testtrue {\global\let\if@test\iftrue} +\@testfalse +% \end{macrocode} +% +% \changes{v1.1v}{1996/07/26}{remove \cs{global} before \cs{@test...}} +% \begin{macrocode} +\def\@bitor#1#2{\@testfalse {\let\@elt\@xbitor + \@tempcnta #1\relax #2}} +% \end{macrocode} +% RmS 91/11/22: Added test for |\count#1 = 0|. +% Suggested by Chris Rowley. +% +% +% \changes{v1.1v}{1996/07/26}{remove \cs{global} before \cs{@test...}} +% \begin{macrocode} +\def\@xbitor #1{\@tempcntb \count#1 + \ifnum \@tempcnta =\z@ + \else + \divide\@tempcntb\@tempcnta + \ifodd\@tempcntb \@testtrue\fi + \fi} +% \end{macrocode} +% +% DEFINITION OF FLOAT BOXES: +% \begin{macrocode} +\newinsert\bx@A +\newinsert\bx@B +\newinsert\bx@C +\newinsert\bx@D +\newinsert\bx@E +\newinsert\bx@F +\newinsert\bx@G +\newinsert\bx@H +\newinsert\bx@I +\newinsert\bx@J +\newinsert\bx@K +\newinsert\bx@L +\newinsert\bx@M +\newinsert\bx@N +\newinsert\bx@O +\newinsert\bx@P +\newinsert\bx@Q +\newinsert\bx@R +% \end{macrocode} +% +% \begin{macrocode} +\gdef\@freelist{\@elt\bx@A\@elt\bx@B\@elt\bx@C\@elt\bx@D\@elt\bx@E + \@elt\bx@F\@elt\bx@G\@elt\bx@H\@elt\bx@I\@elt\bx@J + \@elt\bx@K\@elt\bx@L\@elt\bx@M\@elt\bx@N + \@elt\bx@O\@elt\bx@P\@elt\bx@Q\@elt\bx@R} +% \end{macrocode} +% +% \begin{macrocode} +\gdef\@toplist{} +\gdef\@botlist{} +\gdef\@midlist{} +\gdef\@currlist{} +\gdef\@deferlist{} +\gdef\@dbltoplist{} +\gdef\@dbldeferlist{} +% \end{macrocode} +% +% PAGE LAYOUT PARAMETERS +% \begin{macrocode} +\newdimen\topmargin +\newdimen\oddsidemargin +\newdimen\evensidemargin +\let\@themargin=\oddsidemargin +\newdimen\headheight +\newdimen\headsep +\newdimen\footskip +\newdimen\textheight +\newdimen\textwidth +\newdimen\columnwidth +\newdimen\columnsep +\newdimen\columnseprule +\newdimen\marginparwidth +\newdimen\marginparsep +\newdimen\marginparpush +% \end{macrocode} +% \end{oldcomments} +% +% \begin{macro}{\AtBeginDvi} +% \changes{v1.1c}{1994/11/05} +% {Added macro} +% \begin{macro}{\@begindvibox} +% \changes{v1.1c}{1994/11/05} +% {Added macro} +% \changes{v1.1f}{1994/11/14}{Use normal box register: why a box?} +% \changes{v1.1l}{1995/04/24}{Add \cs{vbox} latex/1392} +% +% We use a box register in which to put +% stuff that must appear before anything else in the +% |.dvi| file. +% +% The stuff in the box should not add any typeset material to the +% page when it is unboxed. +% \begin{macrocode} +\newbox\@begindvibox +\def \AtBeginDvi #1{% + \global \setbox \@begindvibox + \vbox{\unvbox \@begindvibox #1}% +} +% \end{macrocode} +% \end{macro} +% \end{macro} +% +% \begin{macro}{\@maxdepth} +% This is not the right place to set this; it needs to be set in a +% class/style file when |\maxdepth| is set. +% +% Also, many settings to |\maxdepth| should be to |\@maxdepth|, +% probably? +% \task{All}{Sort out maxdepth: both should be set in the class files.} +% \begin{macrocode} +\newdimen\@maxdepth +\@maxdepth = \maxdepth +% \end{macrocode} +% \end{macro} +% \begin{macro}{\paperheight} +% \changes{v0.1a}{1993/11/23}{Register added} +% \begin{macro}{\paperwidth} +% \changes{v0.1a}{1993/11/23}{Register added} +% New |\paper|\ldots\ registers. +% \begin{macrocode} +\newdimen\paperheight +\newdimen\paperwidth +% \end{macrocode} +% \end{macro} +% \end{macro} +% +% \begin{macro}{\if@insert} +% \begin{macro}{\if@fcolmade} +% \begin{macro}{\if@specialpage} +% \begin{macro}{\if@firstcolumn} +% \begin{macro}{\if@twocolumn} +% \begin{macro}{\if@twoside} +% \begin{macro}{\if@reversemarginpar} +% \begin{macro}{\if@mparswitch} +% \begin{macro}{\col@number} +% \changes{v1.0n}{1994/04/30}{Added \cs{col@number}} +% Local switches first: +% \begin{macrocode} +\newif \if@insert +% \end{macrocode} +% These should definitely be global: +% \begin{macrocode} +\newif \if@fcolmade +\newif \if@specialpage \@specialpagefalse +% \end{macrocode} +% These should be global but are not always set globally in other +% files. +% \begin{macrocode} +\newif \if@firstcolumn \@firstcolumntrue +\newif \if@twocolumn \@twocolumnfalse +% \end{macrocode} +% Not sure about these: two questions. +% Should things which must apply to a whole doument be local or +% global (they probably should be `preamble only' commands)? +% Are these three such things? +% \begin{macrocode} +\newif \if@twoside \@twosidefalse +\newif \if@reversemargin \@reversemarginfalse +\newif \if@mparswitch \@mparswitchfalse +% \end{macrocode} +% This counter has been imported from `multicol'. +% \begin{macrocode} +\newcount \col@number +\col@number \@ne +% \end{macrocode} +% \end{macro} +% \end{macro} +% \end{macro} +% \end{macro} +% \end{macro} +% \end{macro} +% \end{macro} +% \end{macro} +% \end{macro} +% +% \begin{oldcomments} +% INTERNAL REGISTERS +% +% \begin{macrocode} +\newcount\@topnum +\newdimen\@toproom +\newcount\@dbltopnum +\newdimen\@dbltoproom +\newcount\@botnum +\newdimen\@botroom +\newcount\@colnum +\newdimen\@textmin +\newdimen\@fpmin +\newdimen\@colht +\newdimen\@colroom +\newdimen\@pageht +\newdimen\@pagedp +\newdimen\@mparbottom \@mparbottom\z@ +\newcount\@currtype +\newbox\@outputbox +\newbox\@leftcolumn +\newbox\@holdpg +% \end{macrocode} +% +% \begin{macrocode} +\def\@thehead{\@oddhead} % initialization +\def\@thefoot{\@oddfoot} +% \end{macrocode} +% \end{oldcomments} +% +% \begin{macro}{\clearpage} +% \changes{v1.1r}{1995/10/11}{Added a check so that it does not lose +% the argument of \cs{twocolumn[...]}} +% +% The tests at the beginning are an experimental attempt to avoid a +% completely empty page after a |\twocolumn[...]|. This prevents the +% text from the argument vanishing into a float box, never to be seen +% again. We hope that it does not produce wrong formatting in other +% cases. +% \changes{v1.1v}{1996/07/26}{add number of missing percents} +% \begin{macrocode} +\def\clearpage{% + \ifvmode + \ifnum \@dbltopnum =\m@ne + \ifdim \pagetotal <\topskip + \hbox{}% + \fi + \fi + \fi + \newpage + \write\m@ne{}% + \vbox{}% + \penalty -\@Mi +} +% \end{macrocode} +% \end{macro} +% +% \begin{macro}{\cleardoublepage} +% +% \begin{macrocode} +\def\cleardoublepage{\clearpage\if@twoside \ifodd\c@page\else + \hbox{}\newpage\if@twocolumn\hbox{}\newpage\fi\fi\fi} +% +% \end{macrocode} +% \end{macro} +% +% \begin{macro}{\onecolumn} +% \changes{v1.0n}{1994/04/30}{Added setting of \cs{col@number}} +% \begin{macrocode} +%<*2ekernel|autoload|fltrace> +\def\onecolumn{% + \clearpage + \global\columnwidth\textwidth + \global\hsize\columnwidth + \global\linewidth\columnwidth + \global\@twocolumnfalse + \col@number \@ne + \@floatplacement} +% \end{macrocode} +% \end{macro} +% +% \begin{macro}{\newpage} +% \changes{v1.1x}{1996/09/29}{Checks for noskipsec and inlabel added} +% \changes{v1.1x}{1996/09/29}{Checks for noskipsec and inlabel added} +% \changes{v1.1y}{1996/09/30}{Checks for noskipsec and inlabel removed +% pending further tests} +% \changes{v1.1z}{1996/10/24}{Better checks for noskipsec and +% inlabel added, plus nobreak} +% \changes{v1.2a}{1996/10/25}{Reset all flags explicitly} +% The two checks at the beginning ensure that an item label or +% run-in section title immediately before a |\newpage| get printed +% on the correct page, the one before the page break. +% +% All three tests are largely to make error processing more robust; +% that is why they all reset the flags explicitly, even when it +% would appear that this would be done by a |\leavevmode|. +% \begin{macrocode} +\def \newpage {% + \if@noskipsec + \ifx \@nodocument\relax + \leavevmode + \global \@noskipsecfalse + \fi + \fi + \if@inlabel + \leavevmode + \global \@inlabelfalse + \fi + \if@nobreak \@nobreakfalse \everypar{}\fi + \par + \vfil + \penalty -\@M} +% \end{macrocode} +% \end{macro} +% +% \begin{macro}{\@emptycol} +% \changes{v1.0n}{1994/04/30}{Empty column action added: +% \cs{@emptycol}} +% It may be better to use an invisible rule rather than an empty +% box here. +% \begin{macrocode} +\def \@emptycol {\vbox{}\penalty -\@M} +% \end{macrocode} +% \end{macro} +% +% \begin{macro}{\twocolumn} +% \begin{macro}{\@topnewpage} +% \changes{v1.0f}{1993/12/05}{Commands changed} +% \changes{v1.0g}{1993/12/06}{\cs{@floatplacement} placement bug +% fixed} +% \changes{v1.0j}{1993/12/17}{check for vsize too small added} +% \changes{v1.2c}{1997/11/09}{Documentation of vsize check enhanced} +% There are several bug fixes to the two-column stuff here. +% +% \changes{v1.0n}{1994/04/30}{Added setting of \cs{col@number}} +% \begin{macrocode} +\def \twocolumn {% + \clearpage + \global\columnwidth\textwidth + \global\advance\columnwidth-\columnsep + \global\divide\columnwidth\tw@ + \global\hsize\columnwidth + \global\linewidth\columnwidth + \global\@twocolumntrue + \global\@firstcolumntrue + \col@number \tw@ +% \end{macrocode} +% There is no reason to put a |\@dblfloatplacement| here since +% |\@topnewpage| ignores these settings. +% The |\@floatplacement| is needed in case this comes after some +% changes. +% \changes{v1.0h}{1993/12/12}{braces removed} +% \begin{macrocode} + \@ifnextchar [\@topnewpage\@floatplacement +} +% \end{macrocode} +% +% Note that here, getting a box from the freelist can assume +% success since this comes just after a |\clearpage|. +% \changes{v1.0n}{1994/04/30}{Added setting of \cs{col@number}} +% \changes{v1.1a}{1994/10/31} +% {(DPC/CAR) Use \cs{color@begingroup} for colour} +% \changes{v1.1a}{1994/10/31} +% {(DPC/CAR) Use \cs{normalcolor}} +% \changes{v1.1a}{1994/10/31} +% {(DPC/CAR) Extra box added to remove colour resetting from vmode} +% \changes{v1.1b}{1994/11/05} +% {Use new \cs{color@hbox} concept.} +% \changes{v1.1i}{1994/11/21}{Changed to \cs{color@vbox}} +% \changes{v1.1z}{1996/10/24}{Added \cs{@nodocument} to trap +% \cs{twocolumn} in the preamble} +% \begin{macrocode} +\long\def \@topnewpage [#1]{% + \@nodocument + \@next\@currbox\@freelist{}{}% + \global \setbox\@currbox + \color@vbox + \normalcolor + \vbox {% + \hsize\textwidth + \@parboxrestore + \col@number \@ne + #1% + \vskip -\dbltextfloatsep + }% + \color@endbox +% \end{macrocode} +% Added size test and warning message; perhaps we should use +% an error message. +% \changes{v1.0l}{1994/03/15}{Corrected and amended warning message} +% \changes{v1.0m}{1994/04/24}{Warning message removed as it will be +% generated later} +% \begin{macrocode} + \ifdim \ht\@currbox>\textheight + \ht\@currbox \textheight + \fi +% \end{macrocode} +% This next line is not essential but it is more robust to make this +% value non-zero, in case of weird errors. +% +% This next bit is what is needed from |\@addtodblcol|, plus some +% extra checks for error trapping. +% \begin{macrocode} + \global \count\@currbox \tw@ + \@tempdima -\ht\@currbox + \advance \@tempdima -\dbltextfloatsep + \global \advance \@colht \@tempdima + \ifx \@dbltoplist \@empty + \else + \@latexerr{Float(s) lost}\@ehb + \let \@dbltoplist \@empty + \fi + \@cons \@dbltoplist \@currbox +% \end{macrocode} +% This setting of |\@dbltopnum| is used only to change the +% typesetting in\\ |\@combinedblfloats|. +% \begin{macrocode} + \global \@dbltopnum \m@ne +%<*trace> + \tr@ce{dbltopnum set to -1 (= \the \@dbltopnum) (topnewpage)}% +% +% \end{macrocode} +% At points such as this we need to check that there is still a +% minimal amount of room left on the page; this uses an arbitrary +% small value at present; but note that this value is larger than +% that used when checking that page is too full of normal floats. +% +% If there is little room left we just force a page-break, OK? +% This involves producing two empty columns. The second empty +% column may be produced by |\output|, in which case an extra, +% misleading, warning will be generated, OK? (This happens only +% when there is too little room left on the page for any float.) +% Otherwise (\ie if the size is such that it is allowed as a normal +% float) the extra |\@emptycol| will be invoked in the second +% column by the conditional code guarded by the |\if@firstcolumn| +% test. +% +% I now think that the cut-off point here should be |3\baselineskip|, +% but we make it a bit less so that 3 lines of text will be +% allowed, OK? +% +% Since this happens only when there is nothing on the page but the +% `top-box', the empty box should not cause any problem other than +% some overfull box messages, which is not entirely misleading. +% +% Here we need two page-ends since both columns need to be empty. +% \task{???}{Make it less arbitrary?} +% \changes{v1.0j}{1993/12/17}{Page room test added} +% \changes{v1.0l}{1994/03/15}{Warning added: it should be improved} +% \changes{v1.0m}{1994/04/24}{Message changed to give more info} +% \changes{v1.0n}{1994/04/30}{Message changed for Frank} +% \changes{v1.0n}{1994/04/30}{Empty column action added: +% \cs{@emptycol}} +% \changes{v1.0n}{1994/04/30}{Cut-off point changed to +% 3\cs{baselineskip}} +% \changes{v1.1t}{1996/05/24}{Cut-off point changed to +% 2.5\cs{baselineskip}} +% \begin{macrocode} + \ifdim \@colht<2.5\baselineskip + \@latex@warning@no@line {Optional argument of \noexpand\twocolumn + too tall on page \thepage}% + \@emptycol + \if@firstcolumn + \else + \@emptycol + \fi + \else + \global \vsize \@colht + \global \@colroom \@colht + \@floatplacement + \fi +} +% \end{macrocode} +% \end{macro} +% \end{macro} +% +% +% \begin{macro}{\output} +% \changes{v1.0f}{1993/12/05}{Command changed} +% \begin{macro}{\@specialoutput} +% \changes{v0.1c}{1993/11/23}{Command changed} +% \changes{v1.0f}{1993/12/06}{Unboxing of 255 added to rescue writes} +% This needs some small adjustments. We cannot +% guarantee that the float mechanism will interact correctly with +% this stuff, but that mechanism does not always work properly +% with footnotes already. +% +% RmS 91/09/29: +% +% added reset of |\par| to the output routine. +% This avoids problems when the output routine is +% called within a list where |\par| may be a no-op. +% +% \begin{macrocode} +\output {% + \let \par \@@par + \ifnum \outputpenalty<-\@M + \@specialoutput + \else + \@makecol + \@opcol +% \end{macrocode} +% Moved to |\@opcol|: |\@floatplacement|. +% \begin{macrocode} + \@startcolumn +% \end{macrocode} +% This loop could be replaced by an |\expandafter| tail +% recursion in |\@startcolumn|. +% \begin{macrocode} + \@whilesw \if@fcolmade \fi + {% +%<*trace> + \tr@ce{PAGE: float \if@twocolumn column \else page \fi + completed}% +% + \@opcol\@startcolumn}% + \fi + \ifnum \outputpenalty>-\@Miv +% \end{macrocode} +% At points such as this we need to check that there is still a +% minimal amount of room left on the page; this uses an arbitrary +% small value at present. If there is little room left we just +% force a page-break, OK? +% +% This bit is essential only if a float has just been processed so +% maybe it should be moved; but this is the natural place at which +% to set the vsize and a test would need to be done anyway. A +% check has been added to ensure that there really has been a +% change in the value of |\@colroom|. +% +% Since this happens only when there is nothing on the page but +% floats, the empty box should not cause any problem other than +% some overfull box messages, which is not entirely misleading. +% +% The twocolumn case does not need any extra code here since this +% is the |\output| itself; in the second column there will still +% not be enough room left so |\@emptycol| will be executed again +% when the OR is called by the-page builder when it gets to the +% penalty inserted by the first execution. (The page-builder is +% never invoked whilst the OR is being executed since it builds a +% inner vlist; thus any conditional code for the two-column case +% within |\output| may not get executed with the correct value of +% |\if@firstcolumn|. +% +% \task{???}{Make it less arbitrary?} +% \changes{v1.0j}{1993/12/17}{Page room test added} +% \changes{v1.0m}{1994/04/24}{Message changed to give more info and +% `top' removed} +% \changes{v1.0n}{1994/04/30}{Extra empty column added for +% twocolumn case (wrong, see below)} +% \changes{v1.0n}{1994/04/30}{Extra empty column added for +% twocolumn case} +% \changes{v1.0n}{1994/04/30}{Empty column action added: +% \cs{@emptycol}} +% \changes{v1.0n}{1994/04/30}{Cut-off point changed to +% 2\cs{baselineskip}} +% \changes{v1.1t}{1996/05/24}{Cut-off point changed to +% 1.5\cs{baselineskip}} +% \changes{v1.1t}{1996/05/24}{Check that \cs{@colroom} is less +% than \cs{vsize}, indicating that a float has been added} +% \changes{v1.1u}{1996/05/25}{Correct the above check} +% \changes{v1.2c}{1997/11/09}{Remove incorrect code: only one +% \cs{@emptycol} is needed here} +% \begin{macrocode} + \ifdim \@colroom<1.5\baselineskip + \ifdim \@colroom<\textheight + \@latex@warning@no@line {Text page \thepage\space + contains only floats}% + \@emptycol +% \if@twocolumn +% \if@firstcolumn +% \else +% \@emptycol +% \fi +% \fi + \else + \global \vsize \@colroom + \fi + \else + \global \vsize \@colroom + \fi + \else + \global \vsize \maxdimen + \fi +} +% +% \end{macrocode} +% +% \begin{oldcomments} +% CHANGES TO \@specialoutput: +% * \penalty\z@ changed to \penalty\interlinepenalty so \samepage +% works properly with figure and table environments. +% (Changed 23 Oct 86) +% +% * Definition of \@specialoutput changed 26 Feb 88 so \@pageht and +% \@pagedp aren't changed for a marginal note. +% (Change suggested by Chris Rowley.) +% \end{oldcomments} +% +% \begin{macrocode} +%<*2ekernel|def1|autoload|fltrace> +\gdef\@specialoutput{% + \ifnum \outputpenalty>-\@Mii + \@doclearpage + \else + \ifnum \outputpenalty<-\@Miii + \ifnum \outputpenalty<-\@MM \deadcycles \z@ \fi + \global \setbox\@holdpg \vbox {\unvbox\@cclv}% + \else +% \end{macrocode} +% Note that |\boxmaxdepth| should not be set here since we wish to +% record the natural depth of the holdpg box. +% +% This is changed so as to not lose anything, such as writes +% and marks, which may get into box 255 and should be returned to +% the list. This should only happen when the first penalty in the +% mechanism is discarded and therefore |\@holdpg| should always be +% void in this case. This can happen because a penalty is +% discarded whenever there is no box on the list. +% +% It was just: |\setbox\@tempboxa \box \@cclv|. +% +% The last box which is removed is the box put there by the +% double-penalty mechanism. The |\unskip| then removes the +% |\topskip| which is put there since the box is the first on the +% page. +% \task{CAR/FMi}{Is it more efficient to check whether the holdpg box +% is void and then act accordingly?} +% \begin{macrocode} + \global \setbox\@holdpg \vbox{% + \unvbox\@holdpg + \unvbox\@cclv +% \end{macrocode} +% We must now remove the box added by the float mechanism and the +% |\topskip| glue therefore added above it by \TeX. +% \begin{macrocode} + \setbox\@tempboxa \lastbox + \unskip + }% +% \end{macrocode} +% These two are needed as separate dimensions only by +% |\@addmarginpar|; for other purposes we put the whole size into +% |\@pageht| (see below). +% \begin{macrocode} + \@pagedp \dp\@holdpg + \@pageht \ht\@holdpg + \unvbox \@holdpg + \@next\@currbox\@currlist{% + \ifnum \count\@currbox>\z@ +% \end{macrocode} +% Putting the whole size into |\@pageht| (see above). +% \begin{macrocode} + \advance \@pageht \@pagedp + \ifvoid\footins \else + \advance \@pageht \ht\footins + \advance \@pageht \skip\footins + \advance \@pageht \dp\footins + \fi +%<*2ekernel|def1> + \ifvbox \@kludgeins +% \end{macrocode} +% We want to make the adjustment due to this insert only if the +% non-star form is used. The *-form will probably not work with +% floats, but maybe it still could make some adjustment here even +% so? +% \begin{macrocode} + \ifdim \wd\@kludgeins=\z@ + \advance \@pageht \ht\@kludgeins +%<*trace> + \tr@ce {Extra size added: \the \ht\@kludgeins}% +% + \fi + \fi +% +% \end{macrocode} +% This version puts the inserts back just before the additional +% material; it could be moved earlier, before unboxing the +% page-so-far. Neither is guaranteed not to put things on the wrong +% page. This version is similar to the original version. +% \begin{macrocode} + \@reinserts + \@addtocurcol + \else + \@reinserts + \@addmarginpar + \fi + }\@latexbug +% \end{macrocode} +% A 2e change: use |\addpenalty| instead of |\penalty| here. Some +% penalty is needed to create a potential break-point immediately +% after the reinserts (or the marginal). Otherwise there can be no +% possibility to break here and this can cause the reinserts or the +% marginal to appear on the next page (which is often incorrect). +% However, if the nobreak flag is true, a |\nobreak| must be +% correct. +% \changes{v1.1i}{1994/11/21}{Added \cs{if@nobreak} test} +% \changes{v1.1z}{1996/10/24}{Added \cs{nobreak} as appropriate} +% \begin{macrocode} + \ifnum \outputpenalty<\z@ + \if@nobreak + \nobreak + \else + \addpenalty \interlinepenalty + \fi + \fi + \fi + \fi +} +% +% \end{macrocode} +% \end{macro} +% \end{macro} +% +% \begin{macro}{\@doclearpage} +% \task{CAR/FMi}{Investigate better float clearance} +% \task{CAR/FMi}{Put non-boxes back in the `right place', or nowhere?} +% This is a very much an emergency action, just dumping everything: +% footnotes first then floats. A more sophisticated version is +% needed; but even more urgent is a bug-free version (see, for +% example, pr/3528). +% +% Also, it puts any left-over non-boxes (writes, specials, etc.) back +% after any float pages created: this is a very bad bug since, +% for example, a kludge insert will be in quite the wrong place +% and, worse, be irremovable and uncancelable. +% +% \begin{macrocode} +%<*2ekernel|autoload> +\def \@doclearpage {% + \ifvoid\footins +% \end{macrocode} +% \changes{v1.2l}{2004/02/07}{Empty kludgeins box if necessary, pr/3528} +% We empty any left over kludge insert box here; this is a temporary fix. +% It should perhaps be applied to one page of cleared floats, but +% who cares? The whole of this stuff needs completely redoing for +% many such reasons. +% \begin{macrocode} + \ifvbox\@kludgeins + {\setbox \@tempboxa \box \@kludgeins}% +%<*trace> + \tr@ce {kludgeins box made void}% +% + \fi + \setbox\@tempboxa\vsplit\@cclv to\z@ \unvbox\@tempboxa + \setbox\@tempboxa\box\@cclv + \xdef\@deferlist{\@toplist\@botlist\@deferlist}% +% \end{macrocode} +% \changes{v1.0h}{1993/12/12}{defs changed to lets} +% \begin{macrocode} + \global \let \@toplist \@empty + \global \let \@botlist \@empty + \global \@colroom \@colht + \ifx \@currlist\@empty + \else + \@latexerr{Float(s) lost}\@ehb +% \end{macrocode} +% \changes{v1.0h}{1993/12/12}{defs changed to lets} +% \begin{macrocode} + \global \let \@currlist \@empty + \fi + \@makefcolumn\@deferlist + \@whilesw\if@fcolmade \fi{\@opcol\@makefcolumn\@deferlist}% + \if@twocolumn + \if@firstcolumn + \xdef\@dbldeferlist{\@dbltoplist\@dbldeferlist}% +% \end{macrocode} +% \changes{v1.0h}{1993/12/12}{defs changed to lets} +% \begin{macrocode} + \global \let \@dbltoplist \@empty + \global \@colht \textheight + \begingroup + \@dblfloatplacement + \@makefcolumn\@dbldeferlist + \@whilesw\if@fcolmade \fi{\@outputpage + \@makefcolumn\@dbldeferlist}% + \endgroup + \else + \vbox{}\clearpage + \fi + \fi + \else + \setbox\@cclv\vbox{\box\@cclv\vfil}% + \@makecol\@opcol + \clearpage + \fi +} +% +% \end{macrocode} +% \end{macro} +% +% \begin{macro}{\@opcol} +% \changes{v1.0f}{1993/12/05}{Command changed} +% \changes{v1.0f}{1993/12/05}{Hook added} +% \changes{v1.0j}{1993/12/17}{Hook removed} +% Several changes in detail here. +% +% \begin{macrocode} +%<*2ekernel|autoload|fltrace> +\def \@opcol {% + \if@twocolumn + \@outputdblcol + \else + \@outputpage +%<*trace> + \tr@ce{PAGE: one column (float? see above) page completed}% +% +% \end{macrocode} +% Not needed since it comes after |\@outputpage|: +% \begin{macrocode} +% \global\@colht\textheight + \fi +% \end{macrocode} +% These do not need to be done every time |\@opcol| is used: they +% should be grouped together since they all need to be done at the +% end of the non-special output routine, or at the end of a clearpage +% one. +% \begin{macrocode} + \global \@mparbottom \z@ \global \@textfloatsheight \z@ + \@floatplacement +} +% +% \end{macrocode} +% \end{macro} +% +% +% \begin{macro}{\@makecol} +% \changes{v0.1c}{1993/11/23}{Command changed} +% \changes{v1.0b}{1993/11/29}{\cs{@makespecialcolbox} added} +% We must rewrite this macro to alllow for variations in page-makeup +% required by changes in page-length. +% +% This uses a different macro if a special-length column is being +% produced. +% +% \begin{macrocode} +%<*2ekernel|def1|autoload> +\gdef \@makecol {% + \ifvoid\footins + \setbox\@outputbox \box\@cclv + \else + \setbox\@outputbox \vbox {% +% \end{macrocode} +% This |\boxmaxdepth| setting is to ensure that deep footnotes +% do not overwrite the footer (on account of the negative skip +% added later): it should use |\@maxdepth| otherwise the change is +% pointless when there are footnotes. +% \task{CAR}{Investigate providing an option to put the footnotes +% below the bottom floats.} +% +% But see also its use when combining floats. +% \changes{v1.0l}{1994/03/15}{\cs{maxdepth} changed to \cs{@maxdepth}} +% \begin{macrocode} + \boxmaxdepth \@maxdepth +% \end{macrocode} +% +% \changes{v1.2e}{1999/01/06}{Added negative vskip, as when processing +% outputbox below: suggested by Fred Bartlett pr/2892} +% \changes{1.2i}{2000/07/12}{Removed negative vskip, as it gives +% unacceptable results when the depth is large: pr/3189} +% \task{CAR}{As can be seen from the above two changes, getting a good +% layout here is difficult: fix!} +% \begin{macrocode} + \@tempdima\dp\@cclv + \unvbox \@cclv +% \vskip-\@tempdima + \vskip \skip\footins +% \end{macrocode} +% \changes{v1.1a}{1994/10/31} +% {(DPC/CAR) Colour resetting moved to here} +% \begin{macrocode} + \color@begingroup + \normalcolor + \footnoterule + \unvbox \footins + \color@endgroup + }% + \fi +% \end{macrocode} +% The h floats have now been finally committed to this page so we +% can reset their list. The top and bottom floats are then added +% to the page. +% \changes{v1.2k}{2003/12/16}{Ensure that \cs{@elt} has a defined +% state (pr/3586)} +% \begin{macrocode} + \let\@elt\relax + \xdef\@freelist{\@freelist\@midlist}% +% \end{macrocode} +% \changes{v1.0h}{1993/12/12}{defs changed to lets} +% \begin{macrocode} + \global \let \@midlist \@empty + \@combinefloats +% \end{macrocode} +% The variations start here in case |\enlargethispage| has +% been used. +% \begin{macrocode} +%<*2ekernel|def1> + \ifvbox\@kludgeins + \@makespecialcolbox + \else +% +% \end{macrocode} +% This extra reboxing is only needed to add the +% |\@texttop| and |\@textbotttom| but this could be done earlier, +% when the floats are added. +% +% The |\boxmaxdepth| resetting here will have no effect unless +% |\@textbottom| ends with a box or rule. So is this (or possibly +% |\@maxdepth|) the correct value? +% +% The |\vskip -\dimen@| +% ensures that the visible depth of the box does not +% affect the placement of anything on the page. +% Thus very deep pages will overprint the footer; but these should +% have been prevented by suitable settings of the maxdepths at +% appropriate times. +% +% If |\@textbottom| ends with a box or rule of non-zero depth +% then this skip adjustemnt should be done again after it. +% +% I think that the final boxing of the main text page could have a +% common ending which may make it simpler to see what is going on. +% +% This needs further investigation, especially in the `special +% case'. +% \task{CAR}{Further investigation of makecol} +% +% Also, the |\boxmaxdepth| setting here affects what happens wthin +% |\@texttop| and |\@textbottom|, should it? Is it needed at all? +% \changes{v1.0l}{1994/03/15}{Removed boxmaxdepth setting.} +% +% RmS 91/10/22: Replaced |\dimen128| by |\dimen@|. +% +% \begin{macrocode} + \setbox\@outputbox \vbox to\@colht {% +% \boxmaxdepth \maxdepth %?? + \@texttop + \dimen@ \dp\@outputbox + \unvbox \@outputbox + \vskip -\dimen@ + \@textbottom + }% +%<*2ekernel|def1> + \fi +% + \global \maxdepth \@maxdepth +} +% +% \end{macrocode} +% \end{macro} +% +% \begin{macro}{\@reinserts} +% \changes{v1.0e}{1993/12/01}{Command added} +% This is the code which reinserts the inserts. It puts them all +% in one place; this can make some of them come out on the wrong +% page. +% It has been put into a separate macro to expidite experimentation. +% \begin{macrocode} +%<*2ekernel|def1|autoload> +\gdef \@reinserts{% + \ifvoid\footins\else\insert\footins{\unvbox\footins}\fi +%<+2ekernel|def1> \ifvbox\@kludgeins\insert\@kludgeins +%<+2ekernel|def1> {\unvbox\@kludgeins}\fi +} +% +% \end{macrocode} +% \end{macro} +% +% +% +% \begin{macro}{\@makespecialcolbox} +% \changes{v1.0b}{1993/11/29}{Command added} +% This implements certain variations in page-makeup. +% \begin{macrocode} +%<*2ekernel|def1|fltrace> +\gdef \@makespecialcolbox {% +%<*trace> + \tr@ce{Kludgeins ht \the\ht\@kludgeins\space + dp \the\dp\@kludgeins\space + wd \the\wd\@kludgeins}% +% +% \end{macrocode} +% First we find the natural height of the column. +% +% See above for discussion of what is happening here. +% +% This needs further investigation, especially in this `special +% case'. +% \changes{v1.0k}{1994/02/08}{boxmaxdepth setting removed} +% \begin{macrocode} + \setbox\@outputbox \vbox {% + \@texttop + \dimen@ \dp\@outputbox + \unvbox\@outputbox + \vskip-\dimen@ + }% + \@tempdima \@colht + \ifdim \wd\@kludgeins>\z@ +% \end{macrocode} +% Note that in this case (the *-version), the height of the +% |\@kludgeins| box is not used since its value is somewhat +% arbitrary: it need only be big enough to ensure that the +% page-break is not taken prematurely. +% +% Here we calculate how much vertical space needs to be added in +% order to enable the column to fit into a box of size |\@colht| +% using the best information we have about the amount of shrink +% available (another thing which is known internally about a box, +% but cannot be accessed at the \TeX{} level!). +% +% This needs \TeX3 otherwise |\pageshrink| is zero anyway; it may +% not be exactly the figure we wish as it is the total available +% from the all the material collected before the page-break +% decision is made. It will, we think, always be an overestimate +% of the actual shrink in the box; therefore this should always +% force the shortest possible column with the possibility of an +% overfull box. +% +% This should work for bothe flush- and ragged-bottom setting since +% it makes the contents no smaller than the size (|\@colht|) of the +% box into which they are put. +% +% Their should perhaps be an upper limit, of 0pt?, on the extra +% space added to force shrinking. +% \task{CAR}{Further investigation of kludge-* space} +% +% See above for a discussion of the |\boxmaxdepth| setting here. +% +% \changes{v1.0k}{1994/02/08}{boxmaxdepth setting added} +% \changes{v1.0l}{1994/03/15}{Removed boxmaxdepth setting.} +% \begin{macrocode} + \advance \@tempdima -\ht\@outputbox + \advance \@tempdima \pageshrink +%<*trace> + \tr@ce {Natural ht of col: \the \ht\@outputbox}% + \tr@ce {\string \@colht: \the \@colht}% + \tr@ce {Pageshrink added: \the \pageshrink}% + \tr@ce {Hence, space added: \the \@tempdima}% +% + \setbox\@outputbox \vbox to \@colht {% +% \boxmaxdepth \maxdepth + \unvbox\@outputbox + \vskip \@tempdima + \@textbottom + }% +% \end{macrocode} +% For the unstarred version, the final size of the page is +% precisely specified. Therefore, at least for the flush-bottom +% case, we need to ensure that, visually, it has this size exactly. +% +% Thus we calculate this size and set the material in a box of this +% size, which is then put into a box of size |\@colht| with |\vss| +% at the bottom. +% \begin{macrocode} + \else + \advance \@tempdima -\ht\@kludgeins +%<*trace> + \tr@ce {Natural ht of col: \the \ht\@outputbox}% + \tr@ce {\string \@colht: \the \@colht}% + \tr@ce {Extra size added: -\the \ht \@kludgeins}% + \tr@ce {Hence, height of inner box: \the \@tempdima}% + \tr@ce {Max? pageshrink available: \the \pageshrink}% +% +% \end{macrocode} +% This type of final packaging could be done always; this may +% simplify all of this page-makeup. +% +% It is not necessary to set |\boxmaxdepth| here since the +% |\@outputbox| ends with glue. +% \changes{v1.0k}{1994/02/03}{correct mistakes in the documentation} +% \begin{macrocode} + \setbox \@outputbox \vbox to \@colht {% + \vbox to \@tempdima {% + \unvbox\@outputbox + \@textbottom}% + \vss}% + \fi +% \end{macrocode} +% Finally we need to explicitly make the insert box void. +% \begin{macrocode} + {\setbox \@tempboxa \box \@kludgeins}% +%<*trace> + \tr@ce {kludgeins box made void}% +% +} +% +% \end{macrocode} +% \end{macro} +% +% \begin{macro}{\@texttop} +% \begin{macro}{\@textbottom} +% These do nothing as a default. +% \begin{macrocode} +%<*2ekernel|autoload> +\let \@texttop \relax +\let \@textbottom \relax +% \end{macrocode} +% \end{macro} +% \end{macro} +% +% \begin{macro}{\@resetactivechars} +% \begin{macro}{\@activechar@info} +% +% \changes{v1.0n}{1994/04/30}{\cs{@activechar@warning} changed to +% \cs{@activechar@info}} +% RmS 93/09/06: +% added hook to protect against certain active characters in the +% output routine. Default checks are for active space and end-of-line. +% \changes{v1.0u}{1994/05/23}{Added \cs{MessageBreak}} +% \begin{macrocode} +\def\@activechar@info #1{% + \@latex@info@no@line {Active #1 character found while + output routine is active + \MessageBreak + This may be a bug in a package file + you are using}% +} +% \end{macrocode} +% +% Do not put any spaces in this next bit! +% \changes{1.2f}{1999/10/09}{Reset definition of active prime +% character (used in math mode)} +% \begin{macrocode} +\begingroup +\obeylines\obeyspaces% +\catcode`\'\active% +\gdef\@resetactivechars{% +\def^^M{\@activechar@info{EOL}\space}% +\def {\@activechar@info{space}\space}% +\let'\active@math@prime}% +\endgroup +% \end{macrocode} +% \end{macro} +% \end{macro} +% +% \begin{macro}{\@outputpage} +% \changes{v1.0f}{1993/12/05}{Command changed} +% \begin{macro}{\@shipoutsetup} +% \changes{v1.0f}{1993/12/05}{Command added} +% \changes{v1.1s}{1995/11/10}{Command removed} +% \begin{macro}{\@writesetup} +% \changes{v1.1s}{1995/11/10}{Command removed} +% \changes{v1.1o}{1995/07/21}{Command added} +% \changes{v1.0f}{1993/12/05}{\cs{@startpagehook} added} +% \changes{v1.0j}{1993/12/17}{---and then removed} +% \changes{v1.0p}{1994/05/12}{\cs{normalcolor}added} +% \changes{v1.0s}{1994/05/20}{Added setting of \cs{protect} +% during \cs{shipout}.} +% \changes{v1.0u}{1994/05/23}{Changed resetting of \cs{protect} after +% shipout to use \cs{aftergroup}} +% \changes{v1.1b}{1994/11/05} +% {Use new \cs{color@hbox} concept.} +% \changes{v1.1b}{1994/11/05} +% {Change protect settings for new-style, protect-free +% aux-files.} +% \changes{v1.1c}{1994/11/05} +% {Add new \cs{AtBeginDvi} concept} +% \changes{v1.1e}{1994/11/10} +% {Modify \cs{protect} setting} +% \changes{v1.1f}{1994/11/14} +% {Modify new \cs{AtBeginDvi} concept} +% \changes{v1.1o}{1995/07/21} +% {New, experimental, versions: need in-lining} +% \changes{v1.1s}{1995/11/10}{In-lined} +% \changes{v1.1w}{1996/09/21}{Added \cs{@parboxrestore} and made +% consequent deletions: wait for the howls of protest} +% +% The |\color@hbox| hooks here are used to avoid putting just a +% colour special into an otherwise empty box (in a header or +% footer). These boxes are often set to be completely empty and so +% adding a special produces a very underfull box message. +% +% There has been extensive tidying up of the old code here; +% including the removal of a level of grouping. +% +% The setting of |\protect| immediately before the |\shipout| +% is needed so that protected commands within |\write|s are +% handled correctly. +% +% Within shipout's vbox it is reset to its default value, |\relax|. +% +% Resetting it to its default value after the shipout has been +% completed (and the contents of the writes have been expanded) +% must be done by use of |\aftergroup|. +% This is because it must have the value |\relax| +% before macros coming from other uses of |\aftergroup| within +% this box are expanded. +% +% Putting this into the |\aftergroup| token list does not affect +% the definition used in expanding the |\write|s because the +% aftergroup token list is only constructed when popping the +% save-stack, it is not expanded until after the shipout is +% completed. +% +% Question: should things from an |\aftergroup| within the shipped +% out box be executed in the environment set up for the writes, or +% after it finishes? +% +% A lot of this code has been in-lined tp prevent mis-use of +% internal commands as hooks. +% \begin{macrocode} +\def\@outputpage{% +\begingroup % the \endgroup is put in by \aftergroup +% \end{macrocode} +% Now all the set-up stuff has been in-lined for Frank. +% +% First the stuff for the writes. +% +% From here \ldots\ was in the command |\@writesetup|. +% \begin{macrocode} + \let \protect \noexpand +% \end{macrocode} +% +% RmS 93/08/19: Redefined accents to allow changes in font encoding; +% but exactly why was this needed? +% +% The |\catcode`\ = 10| was removed as it was considered useless +% (presumably because nothing gets tokenised during shipout). +% +% This was put in as some error produced active spaces in a mark, I +% think. +% +% Why was the hyphen reset? +% +% \begin{macrocode} + \@resetactivechars +% \end{macrocode} +% If a page break happens between the start of a list and its first +% item the |@newlist| will be true and this will mess up any list +% that is used in the header or footer of the page. So we have to +% reset that flag. +% \changes{v1.2h}{2000/07/19} +% {Reset and restore \cs{@if@newlist} for internal/3231} +% \changes{v1.2j}{2001/01/07} +% {And do it in the right macro! (pr/3286)} +% \begin{macrocode} + \global\let\@@if@newlist\if@newlist + \global\@newlistfalse +% \end{macrocode} +% +% \changes{v1.0q}{1994/05/16}{Changed setting of accents (FMi): +% with the new encoding setup they can use \cs{let}. +% It could also use the new internal commands?} +% \changes{v1.1l}{1995/04/24}{Reset \cmd\\ latex/1451 (DPC)} +% This next hook replaces the following: +% \begin{verbatim} +% \let\-\@dischyph +% \let\'\@acci\let\`\@accii\let\=\@acciii +% \let\\\@normalcr +% \let\par\@@par %% 15 Sep 87 (this was once inside the box) +% \end{verbatim} +% and it does more than they did; in particular it sets: +% \begin{verbatim} +% \parindent\z@ +% \parskip\z@skip +% \everypar{}% +% \leftskip\z@skip +% \rightskip\z@skip +% \parfillskip\@flushglue +% \lineskip\normallineskip +% \baselineskip\normalbaselineskip +% \sloppy +% \end{verbatim} +% +% \begin{macrocode} + \@parboxrestore +% \end{macrocode} +% \ldots\ to here was in the command |\@writesetup|. +% \begin{macrocode} + \shipout \vbox{% + \set@typeset@protect + \aftergroup \endgroup + \aftergroup \set@typeset@protect + % correct? or just restore by ending + % the group? +% \end{macrocode} +% This first bit has been moved inside the shipped out box. +% +% Now the setup inside the shipped out box; this should conatin all +% the stuff that could only affect typesetting; other stuff may need +% to be reset for the writes also. +% +% From here \ldots\ was in the command |\@shipoutsetup|. +% \begin{macrocode} + \if@specialpage + \global\@specialpagefalse\@nameuse{ps@\@specialstyle}% + \fi + \if@twoside + \ifodd\count\z@ \let\@thehead\@oddhead \let\@thefoot\@oddfoot + \let\@themargin\oddsidemargin + \else \let\@thehead\@evenhead + \let\@thefoot\@evenfoot \let\@themargin\evensidemargin + \fi + \fi +% \end{macrocode} +% +% The rest was always inside the box. +% +% RmS 91/08/15: aded this line: +% \begin{macrocode} + \reset@font +% \end{macrocode} +% RmS 93/08/06 Added |\lineskiplimit=0pt| to guard against it being +% nonzero: e.g. by |\offinterlineskip| being in effect. +% +% There are probably lots of other things that may need resetting. +% +% \begin{macrocode} + \normalsize +% \end{macrocode} +% Reset the space factors. +% \changes{v1.2b}{1997/04/14} +% {Call \cs{normalsfcodes} (from patch file) latex/2404} +% \begin{macrocode} + \normalsfcodes +% \end{macrocode} +% +% Reset these here (previously reset separately for head and foot) +% \changes{v1.2b}{1997/04/14} +% {Move \cs{label} and \cs{index} (from patch file)} +% \begin{macrocode} + \let\label\@gobble + \let\index\@gobble + \let\glossary\@gobble +% \end{macrocode} +% +% \begin{macrocode} + \baselineskip\z@skip \lineskip\z@skip \lineskiplimit\z@ +% \end{macrocode} +% \ldots\ to here was in the command |\@shipoutsetup|. +% \begin{macrocode} + \@begindvi + \vskip \topmargin + \moveright\@themargin \vbox {% + \setbox\@tempboxa \vbox to\headheight{% + \vfil + \color@hbox + \normalcolor + \hb@xt@\textwidth{\@thehead}% + \color@endbox + }% %% 22 Feb 87 + \dp\@tempboxa \z@ + \box\@tempboxa + \vskip \headsep + \box\@outputbox + \baselineskip \footskip + \color@hbox + \normalcolor + \hb@xt@\textwidth{\@thefoot}% + \color@endbox + }% + }% +% \end{macrocode} +% |\endgroup| now inserted by |\aftergroup| +% +% Restore |\if@newlist| +% \begin{macrocode} + \global\let\if@newlist\@@if@newlist +% \end{macrocode} +% +% \begin{macrocode} + \global \@colht \textheight + \stepcounter{page}% +% \end{macrocode} +% It is now clear that this does something useful, thanks to Piet +% van Oostrum. It is needed because a float page is made without +% using TeX's page-builder; thus the output routine is never called +% so the marks are not updated. +% \begin{macrocode} + \let\firstmark\botmark +} +% \end{macrocode} +% \end{macro} +% \end{macro} +% \end{macro} +% +% \begin{macro}{\@begindvi} +% \changes{v1.1c}{1994/11/05} +% {Added macro} +% \changes{v1.1f}{1994/11/14}{Use normal box register: why a box?} +% +% This unboxes stuff that must appear before anything else in the +% |.dvi| file, then returns that box register to the free list and +% cancels itself. +% +% The stuff in the box should not add any typeset material to the +% page. +% \begin{macrocode} +\def \@begindvi{% + \unvbox \@begindvibox + \global\let \@begindvi \@empty +} +% \end{macrocode} +% \end{macro} +% +% \begin{macro}{\@combinefloats} +% \begin{macro}{\@cflt} +% \changes{v1.0h}{1993/12/12}{name changed} +% \begin{macro}{\@cflb} +% The |\boxmaxdepth| setting here was not made local to +% a box so was dangerous. It is needed only within the box made +% by |\@cflt| (and not normally even there), so it has been +% moved there; this also agrees with the original pseudcode. +% +% \changes{v1.0h}{1993/12/12}{boxmaxdepth setting moved} +% \begin{macrocode} +\def \@combinefloats {% +% \boxmaxdepth \maxdepth + \ifx \@toplist\@empty \else \@cflt \fi + \ifx \@botlist\@empty \else \@cflb \fi +} +% \end{macrocode} +% +% \changes{v1.0h}{1993/12/12}{defs changed to lets} +% \begin{macrocode} +\def \@cflt{% + \let \@elt \@comflelt + \setbox\@tempboxa \vbox{}% + \@toplist + \setbox\@outputbox \vbox{% + \boxmaxdepth \maxdepth + \unvbox\@tempboxa + \vskip -\floatsep + \topfigrule + \vskip \textfloatsep + \unvbox\@outputbox + }% + \let\@elt\relax + \xdef\@freelist{\@freelist\@toplist}% + \global\let\@toplist\@empty +} +% \end{macrocode} +% +% \begin{macrocode} +\def \@cflb {% + \let\@elt\@comflelt + \setbox\@tempboxa \vbox{}% + \@botlist + \setbox\@outputbox \vbox{% + \unvbox\@outputbox + \vskip \textfloatsep + \botfigrule + \unvbox\@tempboxa + \vskip -\floatsep + }% + \let\@elt\relax + \xdef\@freelist{\@freelist\@botlist}% + \global \let \@botlist\@empty +} +% \end{macrocode} +% \end{macro} +% \end{macro} +% \end{macro} +% +% \begin{macro}{\@comflelt} +% \begin{macro}{\@comdblflelt} +% \begin{macro}{\@combinedblfloats} +% +% \begin{macrocode} +\def\@comflelt#1{\setbox\@tempboxa + \vbox{\unvbox\@tempboxa\box #1\vskip\floatsep}} +% \end{macrocode} +% +% \begin{macrocode} +\def\@comdblflelt#1{\setbox\@tempboxa + \vbox{\unvbox\@tempboxa\box #1\vskip\dblfloatsep}} +% \end{macrocode} +% +% \begin{macrocode} +\def \@combinedblfloats{% + \ifx \@dbltoplist \@empty + \else + \setbox\@tempboxa \vbox{}% + \let \@elt \@comdblflelt + \@dbltoplist + \let \@elt \relax + \xdef \@freelist {\@freelist\@dbltoplist}% + \global\let \@dbltoplist \@empty + \setbox\@outputbox \vbox to\textheight +% \end{macrocode} +% +% The setting of |\boxmaxdepth| here has no effect since the +% |\@outputbox| should already have depth zero. Even so, it would +% have no effect on the layout of the page. +% \changes{v1.0l}{1994/03/15}{Removed boxmaxdepth setting.} +% \begin{macrocode} + {%\boxmaxdepth\maxdepth %% probably not needed, CAR + \unvbox\@tempboxa\vskip-\dblfloatsep +% \end{macrocode} +% Here we need different typesetting if the top float comes from +% |\@topnewpage|. +% \changes{v1.0n}{1994/04/30}{Removed rule in topnewpage case} +% \begin{macrocode} + \ifnum \@dbltopnum>\m@ne + \dblfigrule + \fi + \vskip \dbltextfloatsep + \box\@outputbox + }% + \fi +} +% +% \end{macrocode} +% \end{macro} +% \end{macro} +% \end{macro} +% +% +% \begin{macro}{\@startcolumn} +% \changes{v1.0f}{1993/12/05}{Command changed} +% \begin{macro}{\@startdblcolumn} +% \changes{v1.0f}{1993/12/05}{Command changed} +% +% We could combine (most of) these two into |\@startcol |. +% Note that |\@xstartcol| was only used once (\ie in +% |\@startcolumn|); it has therefore been removed. This is not quite +% as efficient but it now has the same structure as +% |\@startdblcolumn|. +% +% The empty-list test has been moved to |\@tryfcolumn|. +% +% \begin{macrocode} +%<*2ekernel|autoload|fltrace> +\def \@startcolumn {% + \global \@colroom \@colht + \@tryfcolumn \@deferlist + \if@fcolmade +%<*trace> + \tr@ce{PAGE: float \if@twocolumn column \else page \fi + completed}% +% + \else +% \end{macrocode} +% \changes{v1.0h}{1993/12/12}{defs changed to lets} +% \begin{macrocode} + \begingroup + \let \reserved@b \@deferlist + \global \let \@deferlist \@empty + \let \@elt \@scolelt + \reserved@b + \endgroup + \fi +} +% \end{macrocode} +% +% This one does not need to set |\@colht|. +% +% \begin{macrocode} +\def \@startdblcolumn {% +% \end{macrocode} +% Not needed since this always comes after |\@outputpage|: +% \begin{macrocode} +% \global \@colht \textheight + \@tryfcolumn \@dbldeferlist + \if@fcolmade +%<*trace> + \tr@ce{PAGE: double float page completed}% +% + \else +% \end{macrocode} +% \changes{v1.0h}{1993/12/12}{defs changed to lets} +% \begin{macrocode} + \begingroup + \let \reserved@b \@dbldeferlist + \global \let \@dbldeferlist \@empty + \let \@elt \@sdblcolelt + \reserved@b + \endgroup + \fi +} +% \end{macrocode} +% \end{macro} +% \end{macro} +% +% \begin{macro}{\@tryfcolumn} +% \changes{v1.0f}{1993/12/05}{Command changed} +% Now tests if its list is empty before any further exertion. +% +% \begin{macrocode} +\def \@tryfcolumn #1{% + \global \@fcolmadefalse + \ifx #1\@empty + \else +%<*trace> + \tr@ce{PAGE: try float \if@twocolumn column/page\else page\fi + ---\string #1}% + \tr@ce{----- \string #1: #1}% +% +% \end{macrocode} +% \changes{v1.0h}{1993/12/12}{defs changed to lets} +% \begin{macrocode} + \xdef\@trylist{#1}% + \global \let \@failedlist \@empty + \begingroup + \let \@elt \@xtryfc \@trylist + \endgroup + \if@fcolmade + \@vtryfc #1% + \fi + \fi +} +% +% \end{macrocode} +% +% \end{macro} +% +% \begin{macrocode} +%<*2ekernel|autoload> +% \end{macrocode} +% +% \begin{macro}{\@scolelt} +% \begin{macrocode} +\def\@scolelt#1{\def\@currbox{#1}\@addtonextcol} +% \end{macrocode} +% \end{macro} +% +% \begin{macro}{\@sdblcolelt} +% \begin{macrocode} +\def\@sdblcolelt#1{\def\@currbox{#1}\@addtodblcol} +% \end{macrocode} +% \end{macro} +% +% \begin{macro}{\@vtryfc} +% \changes{v1.2d}{1997/11/19}{Reindent code, to be understandable(DPC).} +% \begin{macrocode} +\def\@vtryfc #1{% + \global\setbox\@outputbox\vbox{}% + \let\@elt\@wtryfc + \@flsucceed + \global\setbox\@outputbox \vbox to\@colht{% + \vskip \@fptop + \vskip -\@fpsep + \unvbox \@outputbox + \vskip \@fpbot}% + \let\@elt\relax + \xdef #1{\@failedlist\@flfail}% + \xdef\@freelist{\@freelist\@flsucceed}} +% \end{macrocode} +% \end{macro} +% +% \begin{macro}{\@wtryfc} +% \begin{macrocode} +\def\@wtryfc #1{% + \global\setbox\@outputbox\vbox{% + \unvbox\@outputbox + \vskip\@fpsep + \box #1}} +% \end{macrocode} +% \end{macro} +% +% \begin{macro}{\@xtryfc} +% \changes{v1.1v}{1996/07/26}{remove \cs{global} before \cs{@test...}} +% \begin{macrocode} +\def\@xtryfc #1{% + \@next\reserved@a\@trylist{}{}% + \@currtype \count #1% + \divide\@currtype\@xxxii + \multiply\@currtype\@xxxii + \@bitor \@currtype \@failedlist + \@testfp #1% + \ifdim \ht #1>\@colht + \@testtrue + \fi + \if@test + \@cons\@failedlist #1% + \else + \@ytryfc #1% + \fi} +% \end{macrocode} +% \end{macro} +% +% \begin{macro}{\@ytryfc} +% \begin{macrocode} +\def\@ytryfc #1{% + \begingroup + \gdef\@flsucceed{\@elt #1}% + \global\let\@flfail\@empty + \@tempdima\ht #1% + \let\@elt\@ztryfc + \@trylist + \ifdim \@tempdima >\@fpmin + \global\@fcolmadetrue + \else + \@cons\@failedlist #1% + \fi + \endgroup + \if@fcolmade + \let\@elt\@gobble + \fi} +% \end{macrocode} +% \end{macro} +% +% \begin{macro}{\@ztryfc} +% \changes{v1.1v}{1996/07/26}{remove \cs{global} before \cs{@test...}} +% \begin{macrocode} +\def\@ztryfc #1{% + \@tempcnta \count#1% + \divide\@tempcnta\@xxxii + \multiply\@tempcnta\@xxxii + \@bitor \@tempcnta {\@failedlist \@flfail}% + \@testfp #1% + \@tempdimb\@tempdima + \advance\@tempdimb \ht#1% + \advance\@tempdimb\@fpsep + \ifdim \@tempdimb >\@colht + \@testtrue + \fi + \if@test + \@cons\@flfail #1% + \else + \@cons\@flsucceed #1% + \@tempdima\@tempdimb + \fi} +% \end{macrocode} +% \end{macro} +% +% \begin{macrocode} +% +% \end{macrocode} +% +% The major changes for float suppression and the changes to the float +% mechanism to make it conform to the documentation are in these next +% macros. +% +% \begin{macro}{\@addtobot} +% \changes{v1.0f}{1993/12/05}{Command changed} +% Lots of changes. +% +% \begin{macrocode} +%<*2ekernel|autoload|fltrace> +\def \@addtobot {% +%<*trace> + \tr@ce{***Start addtobot}% +% + \@getfpsbit 4\relax +%<*trace> + \tr@ce{fpstype \ifodd \@tempcnta OK \else not \fi bot: + \the \@fpstype}% +% + \ifodd \@tempcnta + \@flsetnum \@botnum + \ifnum \@botnum>\z@ + \@tempswafalse + \@flcheckspace \@botroom \@botlist + \if@tempswa +% \end{macrocode} +% This next line means that this page is produced with box 255 +% having depth zero, rather than the normal maxdepth: is this +% needed, useful? +% \task{CAR/FMi}{Investigate resetting of maxdepth: I do not think it is +% necessary here; Frank does.} +% \begin{macrocode} + \global \maxdepth \z@ + \@flupdates \@botnum \@botroom \@botlist +%<*trace> + \tr@ce{colroom (after-bot) = \the \@colroom}% + \tr@ce{colnum (after-bot) = \the \@colnum}% + \tr@ce{botnum (after-bot) = \the \@botnum}% + \tr@ce{***Success: bot}% +% + \@inserttrue + \fi +%<*trace> + \else + \tr@ce{Fail: botnum = \the \@botnum: + fpstype \the \@fpstype=ORD?}% + \ifnum \@fpstype<\sixt@@n + \tr@ce{ERROR: !b float not successful (addtobot)}% + \fi +% + \fi + \fi +} +% \end{macrocode} +% \end{macro} +% +% \begin{macro}{\@addtotoporbot} +% \changes{v1.0f}{1993/12/05}{Command changed} +% Lots of changes. +% +% \begin{macrocode} +\def \@addtotoporbot {% +%<*trace> + \tr@ce{***Start addtotoporbot}% +% + \@getfpsbit \tw@ +%<*trace> + \tr@ce{fpstype \ifodd \@tempcnta OK \else not \fi top: + \the \@fpstype}% +% + \ifodd \@tempcnta + \@flsetnum \@topnum + \ifnum \@topnum>\z@ + \@tempswafalse + \@flcheckspace \@toproom \@toplist + \if@tempswa + \@bitor\@currtype{\@midlist\@botlist}% +%<*trace> + \tr@ce{(mid+bot)list: \@midlist, \@botlist: + (addtotoporbot-before)}% +% + \if@test +%<*trace> + \tr@ce{type already on list: mid or bot---sent to addtobot}% +% + \else + \@flupdates \@topnum \@toproom \@toplist +%<*trace> + \tr@ce{colroom (after-top) = \the \@colroom}% + \tr@ce{colnum (after-top) = \the \@colnum}% + \tr@ce{topnum (after-top) = \the \@topnum}% + \tr@ce{***Success: top}% +% + \@inserttrue + \fi + \fi +%<*trace> + \else + \tr@ce{Fail: topnum = \the \@topnum: fpstype + \the \@fpstype=ORD?}% + \ifnum \@fpstype<\sixt@@n + \tr@ce{ERROR: !t float not successful (addtotoporbot)}% + \fi +% + \fi + \fi + \if@insert + \else +%<*trace> + \tr@ce{sent to addtobot (addtotoporbot)}% +% + \@addtobot + \fi +} +% +% \end{macrocode} +% \end{macro} +% +% \begin{macro}{\@addtocurcol} +% \changes{v1.0f}{1993/12/05}{Command changed} +% \task{CAR}{Add rules around h floats for FMi} +% \task{CAR}{Investigate pagebreak option possibilities} +% Lots of changes. +% +% \begin{macrocode} +%<*2ekernel|autoload|fltrace|flafter> +\def \@addtocurcol {% +%<*trace> + \tr@ce{***Start addtocurcol}% +% + \@insertfalse + \@setfloattypecounts + \ifnum \@fpstype=8 +%<*trace> + \tr@ce{fpstype !p only (addtocurcol): \the \@fpstype = 8?}% +% + \else + \ifnum \@fpstype=24 +%<*trace> + \tr@ce{fpstype p only (addtocurcol): \the \@fpstype = 24?}% +% + \else + \@flsettextmin +% \end{macrocode} +% This is a new adjustment which is quite a major change in +% functionality; but it implements the documentation. +% Note that |\@reqcolroom| will include the whole of the +% page-so-far, and hence includes |\@textfloatsheight| of floats, +% so before comparing it with |\@textmin|, we add this to +% |\@textmin| also. +% \begin{macrocode} +%<*trace> + \tr@ce{textfloatsheight (before) = \the \@textfloatsheight}% +% + \advance \@textmin \@textfloatsheight + \@reqcolroom \@pageht +% \end{macrocode} +% This line must be removed since |\@specialoutput| changed. +% \begin{macrocode} +% \advance \@reqcolroom \@pagedp +%<*trace> + \tr@ce{textmin + textfloatsheight: \the \@textmin}% + \tr@ce{page-so-far: \the \@reqcolroom}% +% + \ifdim \@textmin>\@reqcolroom + \@reqcolroom \@textmin +%<*trace> + \tr@ce{ORD? textmin being used}% +% + \fi + \advance \@reqcolroom \ht\@currbox +%<*trace> + \tr@ce{float size = \the \ht \@currbox (addtocurcol)}% + \tr@ce{colroom = \the \@colroom (addtocurcol)}% + \tr@ce{reqcolroom = \the \@reqcolroom (addtocurcol)}% +% + \ifdim \@colroom>\@reqcolroom + \@flsetnum \@colnum + \ifnum \@colnum>\z@ + \@bitor\@currtype\@deferlist +%<*trace> + \tr@ce{deferlist: \@deferlist: (addtocurcol-before)}% +% + \if@test +%<*trace> + \tr@ce{type already on list: defer (addtocurcol)}% +% + \else + \@bitor\@currtype\@botlist +%<*trace> + \tr@ce{botlist: \@botlist: (addtocurcol-before)}% +% + \if@test +%<*trace> + \tr@ce{type already on list: bot---sent to addtobot}% +% + \@addtobot + \else +%<*trace> + \tr@ce{fpstype \ifodd \@tempcnta OK \else not \fi + here: \the \@fpstype}% +% + \ifodd \count\@currbox + \advance \@reqcolroom \intextsep + \ifdim \@colroom>\@reqcolroom + \global \advance \@colnum \m@ne + \global \advance \@textfloatsheight \ht\@currbox +% \end{macrocode} +% This may sometimes give an overestimate. +% \begin{macrocode} + \global \advance \@textfloatsheight 2\intextsep + \@cons \@midlist \@currbox +%<*trace> + \tr@ce{***Success: here}% + \tr@ce{textfloatsheight (after-here) = + \the \@textfloatsheight}% + \tr@ce{colnum (after-here) = \the \@colnum}% +% +% \end{macrocode} +% +% CHANGE TO |\@addtocurcol|: +% +% |\penalty\z@| changed to |\penalty\interlinepenalty| so |\samepage| +% works properly with figure and table environments. +% (Changed 23 Oct 86) +% +% There is also an |\addpenalty\interlinepenalty| above. +% +% Since in 2e |\samepage| is no longer supported, these could be +% removed. +% +% Although it is best to use |\addvspace| in case two h floats come +% together, this makes other spacing more difficult to adjust; whereas +% if a user specifies two h floats together then they can more easily +% get the spacing correct by ad hoc commands. +% +% It is necessary to adjust for the addition of |\parskip| here in +% case the float is added betweeen paragraphs (\ie when in vertical +% mode). +% +% If the nobreak switch is true we need to reset it and clear +% |\everypar| sionce the float may not reset the flag and cannot reset +% the |\everypar| globally. +% \changes{v1.0l}{1994/03/15}{Changed \cs{addvspace} to \cs{vskip}} +% \changes{v1.1i}{1994/11/21} +% {Added \cs{if@nobreak} test before float box} +% \changes{v1.1z}{1996/10/24}{Added \cs{nobreak}, etc as appropriate} +% +% Typesetting starts here (we are in vertical mode). +% \begin{macrocode} + \if@nobreak + \nobreak + \@nobreakfalse + \everypar{}% + \else + \addpenalty \interlinepenalty + \fi + \vskip \intextsep + \box\@currbox + \penalty\interlinepenalty + \vskip\intextsep + \ifnum\outputpenalty <-\@Mii \vskip -\parskip\fi +% \end{macrocode} +% Typesetting ends here. +% \begin{macrocode} + \outputpenalty \z@ + \@inserttrue +%<*trace> + \else + \tr@ce{Fail---no room at 2nd test of colroom + (addtocorcol \string\intextsep)}% +% + \fi + \fi + \if@insert + \else +%<*2ekernel|autoload|fltrace> +%<*trace> + \tr@ce{not here: sent to addtotoporbot}% +% + \@addtotoporbot +% +%<*!2ekernel&!autoload&!fltrace> +%<*trace> + \tr@ce{not here: sent to addtobot}% +% + \@addtobot +% + \fi + \fi + \fi +%<*trace> + \else + \tr@ce{Fail: colnum = \the \@colnum: + fpstype \the \@fpstype=ORD?}% + \ifnum \@fpstype<\sixt@@n + \tr@ce{ERROR: BANG float not successful (addtocurcol)}% + \fi +% + \fi +%<*trace> + \else + \tr@ce{Fail---no room: fl box ht: \the \ht \@currbox + (addtocurcol)}% +% + \fi + \fi + \fi + \if@insert + \else + \@resethfps +%<*trace> + \tr@ce{put on deferlist (addtocurcol)}% +% + \@cons\@deferlist\@currbox +%<*trace> + \tr@ce{deferlist: \@deferlist: (addtocurcol-after)}% +% + \fi +} +% +% \end{macrocode} +% \end{macro} +% +% \begin{macro}{\@addtonextcol} +% \changes{v1.0f}{1993/12/05}{Command changed} +% Lots of changes. +% +% \begin{macrocode} +%<*2ekernel|autoload|fltrace> +\def\@addtonextcol{% + \begingroup +%<*trace> + \tr@ce{***Start addtonextcol}% +% + \@insertfalse + \@setfloattypecounts + \ifnum \@fpstype=8 +%<*trace> + \tr@ce{fpstype not curcol: \the \@fpstype = 8?}% +% + \else + \ifnum \@fpstype=24 +%<*trace> + \tr@ce{fpstype not curcol: \the \@fpstype = 24?}% +% + \else + \@flsettextmin +%<*trace> + \tr@ce{text-so-far: 0pt (top of col)}% +% + \@reqcolroom \ht\@currbox +%<*trace> + \tr@ce{float size: \the \@reqcolroom (addtonextcol)}% +% + \advance \@reqcolroom \@textmin +%<*trace> + \tr@ce{colroom = \the \@colroom (addtonextcol)}% + \tr@ce{reqcolroom = \the \@reqcolroom (addtonextcol)}% +% + \ifdim \@colroom>\@reqcolroom + \@flsetnum \@colnum + \ifnum\@colnum>\z@ + \@bitor\@currtype\@deferlist +%<*trace> + \tr@ce{deferlist: \@deferlist: (addtonextcol-before)}% +% + \if@test +%<*trace> + \tr@ce{type already on list: defer (addtonextcol)}% +% + \else +%<*trace> + \tr@ce{sent to addtotoporbot (addtonextcol)}% +% + \@addtotoporbot + \fi + \fi +%<*trace> + \else + \tr@ce{Fail---no room: fl box ht: \the \ht \@currbox + (addtonextcol)}% +% + \fi + \fi + \fi + \if@insert + \else +%<*trace> + \tr@ce{put back on deferlist (addtonextcol)}% +% + \@cons\@deferlist\@currbox +%<*trace> + \tr@ce{deferlist: \@deferlist: (addtonextcol-after)}% +% + \fi +%<*trace> + \tr@ce{End of addtonextcol -- locally counts:}% + \tr@ce{ col: \the \@colnum. top: \the \@topnum. bot: \the \@botnum.}% +% + \endgroup +%<*trace> + \tr@ce{End of addtonextcol -- globally counts:}% + \tr@ce{col: \the \@colnum. top: \the \@topnum. bot: \the \@botnum.}% +% +} +% \end{macrocode} +% \end{macro} +% +% \begin{macro}{\@addtodblcol} +% \changes{v1.0f}{1993/12/05}{Command changed} +% Lots of changes. +% +% \begin{macrocode} +\def\@addtodblcol{% + \begingroup +%<*trace> + \tr@ce{***Start addtodblcol}% +% + \@insertfalse + \@setfloattypecounts + \@getfpsbit \tw@ +%<*trace> + \tr@ce{fpstype \ifodd \@tempcnta OK \else not \fi dbltop: + \the \@fpstype}% +% + \ifodd\@tempcnta + \@flsetnum \@dbltopnum + \ifnum \@dbltopnum>\z@ + \@tempswafalse + \ifdim \@dbltoproom>\ht\@currbox + \@tempswatrue +%<*trace> + \tr@ce{Space OK: \@dbltoproom = + \the \@dbltoproom > \the \ht \@currbox + (dbltoproom)}% +% + \else +%<*trace> + \tr@ce{fpstype: \the \@fpstype (addtodblcol)}% +% + \ifnum \@fpstype<\sixt@@n +%<*trace> + \tr@ce{BANG float ignoring \@dbltoproom}% + \tr@ce{\@spaces \@dbltoproom = \the \@dbltoproom. + Ht float: \the \ht \@currbox-BANG}% +% +% \end{macrocode} +% Need to check that there is room on the page, using the local value +% of |\@textmin| to make the necessary adjustment to |\@dbltoproom|. +% \begin{macrocode} + \advance \@dbltoproom \@textmin +%<*trace> + \tr@ce{Local value of texmin: \the\@textmin}% + \tr@ce{\@spaces space on page = \the \@dbltoproom. + Ht float: \the \ht \@currbox-BANG}% +% + \ifdim \@dbltoproom>\ht\@currbox + \@tempswatrue +%<*trace> + \tr@ce{Space OK BANG: space on page = \the \@dbltoproom > + \the \ht \@currbox}% + \else + \tr@ce{fpstype: \the \@fpstype}% + \tr@ce{Fail---no room dbltoproom-BANG?:}% + \tr@ce{\@spaces space on page = \the \@dbltoproom. + Ht float: \the \ht \@currbox}% +% + \fi + \advance \@dbltoproom -\@textmin +%<*trace> + \else + \tr@ce{fpstype: \the \@fpstype}% + \tr@ce{Fail---no room dbltoproom-ORD?:}% + \tr@ce{\@spaces \@dbltoproom = \the \@dbltoproom. + Ht float: \the \ht \@currbox}% +% + \fi + \fi + \if@tempswa + \@bitor \@currtype \@dbldeferlist +%<*trace> + \tr@ce{dbldeferlist: \@dbldeferlist: (before)}% +% + \if@test +%<*trace> + \tr@ce{type already on list: dbldefer}% +% + \else + \@tempdima -\ht\@currbox + \advance\@tempdima + -\ifx \@dbltoplist\@empty \dbltextfloatsep \else + \dblfloatsep \fi + \global \advance \@dbltoproom \@tempdima + \global \advance \@colht \@tempdima + \global \advance \@dbltopnum \m@ne + \@cons \@dbltoplist \@currbox +%<*trace> + \tr@ce{dbltopnum (after) = \the \@dbltopnum}% + \tr@ce{***Success: dbltop}% +% + \@inserttrue + \fi + \fi +%<*trace> + \else + \tr@ce{Fail: dbltopnum = \the \@dbltopnum: fpstype + \the \@fpstype=ORD?}% + \ifnum \@fpstype<\sixt@@n + \tr@ce{ERROR: !t float not successful (addtodblcol)}% + \fi +% + \fi + \fi + \if@insert + \else +%<*trace> + \tr@ce{put on dbldeferlist}% +% + \@cons\@dbldeferlist\@currbox +%<*trace> + \tr@ce{dbldeferlist: \@dbldeferlist: (after)}% +% + \fi +%<*trace> + \tr@ce{End of addtodblcol -- locally count:}% + \tr@ce{ dbltop: \the \@dbltopnum.}% +% + \endgroup +%<*trace> + \tr@ce{End of addtodblcol -- globally count:}% + \tr@ce{dbltop: \the \@dbltopnum.}% +% +} +% +% \end{macrocode} +% \end{macro} +% +% +% +% \begin{macro}{\@addmarginpar} +% \begin{macrocode} +%<*2ekernel|autoload> +\def\@addmarginpar{\@next\@marbox\@currlist{\@cons\@freelist\@marbox + \@cons\@freelist\@currbox}\@latexbug\@tempcnta\@ne + \if@twocolumn + \if@firstcolumn \@tempcnta\m@ne \fi + \else + \if@mparswitch + \ifodd\c@page \else\@tempcnta\m@ne \fi + \fi + \if@reversemargin \@tempcnta -\@tempcnta \fi + \fi + \ifnum\@tempcnta <\z@ \global\setbox\@marbox\box\@currbox \fi + \@tempdima\@mparbottom + \advance\@tempdima -\@pageht + \advance\@tempdima\ht\@marbox + \ifdim\@tempdima >\z@ + \@latex@warning@no@line {Marginpar on page \thepage\space moved}% + \else + \@tempdima\z@ + \fi + \global\@mparbottom\@pageht + \global\advance\@mparbottom\@tempdima + \global\advance\@mparbottom\dp\@marbox + \global\advance\@mparbottom\marginparpush + \advance\@tempdima -\ht\@marbox +% \end{macrocode} +% Putting box movement inside the `marbox': +% \begin{macrocode} + \global\setbox \@marbox + \vbox {\vskip \@tempdima + \box \@marbox}% + \global \ht\@marbox \z@ + \global \dp\@marbox \z@ +% \end{macrocode} +% Sticking (rather than gluing:-) the `marbox' to the line above, +% changed vskip to kern: +% \begin{macrocode} + \kern -\@pagedp + \nointerlineskip + \hb@xt@\columnwidth + {\ifnum \@tempcnta >\z@ + \hskip\columnwidth \hskip\marginparsep + \else + \hskip -\marginparsep \hskip -\marginparwidth + \fi + \box\@marbox \hss}% +% \end{macrocode} +% For this reason the following code can vanish: +%\begin{verbatim} +% \nobreak %% No longer needed. CAR92/12 +% \vskip -\@tempdima %% No longer needed. CAR92/12 +%\end{verbatim} +% \begin{macrocode} + \nointerlineskip + \hbox{\vrule \@height\z@ \@width\z@ \@depth\@pagedp}} +% +% \end{macrocode} +% \end{macro} +% +% \subsubsection{Kludgeins} +% +% This part of the file is part of the implementation of the following +% two new commands for \LaTeX2e{}. +% +% +% \begin{verbatim} +% \enlargethispage{} +% \end{verbatim} +% +% Adds || to the height of the current column only. On the printed +% page the bottom of this column is extended downwards by exactly +% || without having any effect on the placement of the footer; this +% may result in an overprinting. +% +% \begin{verbatim} +% \enlargethispage*{} +% \end{verbatim} +% +% Similar to |\enlargethispage| but it tries to squeeze the column to +% be printed in as small a space as possible, ie it uses any +% shrinkability in the column. If the column was not explicitly broken +% (\eg with |\pagebreak|) this may result in an overfull box message but +% execpt for this it will come out as expected (if you know what to +% expect). +% +% The star form of this command is dedicated to Leslie Lamport, the +% other we need for ourselves (FMi, CAR). +% +% These commands may well have unwanted effects if used soon +% before a \clearpage: please give keep them clear of such places. +% +% \begin{macro}{\@kludgeins} +% \changes{v0.1c}{1993/11/23}{Insert added} +% The insert which makes \TeX{} do a lot of the necessary work. +% All we need to put into it is the amount by which the pagegoal +% should be changed. +% \begin{macrocode} +%<*2ekernel|def1> +\newinsert \@kludgeins +\global\dimen\@kludgeins \maxdimen +\global\count\@kludgeins 1000 +% +% \end{macrocode} +% \end{macro} +% +% +% \begin{macro}{\enlargethispage} +% \begin{macro}{\enlargethispage*} +% \changes{v0.1c}{1993/11/23}{Commands added} +% The user command. +% \begin{macrocode} +%<*2ekernel|def1> +\gdef \enlargethispage {% + \@ifstar + {% +%<*trace> + \tr@ce{Enlarging page height * }% +% + \@enlargepage{\hbox{\kern\p@}}}% + {% +%<*trace> + \tr@ce{Enlarging page height exactly---}% +% + \@enlargepage\@empty}% +} +% +%<*autoload> +\def\enlargethispage{\@autoload{out1}\enlargethispage} +% +% \end{macrocode} +% \end{macro} +% \end{macro} +% +% +% \begin{macro}{\@enlargepage} +% \changes{v0.1c}{1993/11/23}{Command added} +% This actually inserts the insert, after checking for extreme +% values of the change. +% \begin{macrocode} +%<*2ekernel|def1> +\gdef\@enlargepage#1#2{% +%<*trace> + \tr@ce{\@spaces\@spaces by #2}% +% + \@tempskipa#2\relax + \ifdim \@tempskipa>.5\maxdimen + \@latexerr{Suggested\space extra\space height\space + (\the\@tempskipa)\space dangerously\space + large}\@eha + \else + \ifdim \vsize<.5\maxdimen +%<*trace> + \tr@ce {Kludgeins added--pagegoal before: \the\pagegoal}% +% + \@bsphack + \insert\@kludgeins{#1\vskip-\@tempskipa}% + \@esphack +% \end{macrocode} +% This next bit is for tracing only: +% \begin{macrocode} +%<*trace> + \ifvmode \par + \tr@ce {Kludgeins added--pagegoal after: \the \pagegoal}% + \fi +% + \else + \@latexerr{Page\space height\space already\space + too\space large}\@eha + \fi + \fi +} +% +% \end{macrocode} +% \end{macro} +% +% \subsubsection{Float control} +% +% This part implements controllable floats and other changes +% to the float mechanism. +% +% It provides, at the doument level, the following command for +% inclusion in \LaTeX2e{}. +% +% \begin{verbatim} +% \suppressfloats +% \end{verbatim} +% +% This suppresses all further floats on the current page. +% +% With an optional argument it suppresses only floats only in certain +% positions on the current page. +% \begin{quote} +% |[t]|\quad suppresses only floats at the top of the page +% |[b]|\quad suppresses only floats at the bottom of the page +% \end{quote} +% +% It also enables the use of an extra specifier, {\tt !}, in the +% location optional argument of a float. If this is present then, +% just for this particular float, whenever it is processed by the float +% mechanism the followinhg are ignored: +% +% \begin{itemize} +% \item all restrictions on the number of floats which can appear; +% \item all explicit restrictions on the amount of space which should +% (not) be occupied by floats and/or text. +% \end{itemize} +% +% The mechanism will still attempt to ensure that pages are not +% overfull. +% +% These specifiers override, for the single float, the suppression +% commands described above. +% +% +% In its current form, it also suplies a reasonably exhaustive, and +% somewhat baroque, means of tracing some aspects of the float +% mechanism. +% +% More tracing. +% \begin{macro}{\tr@ce} +% \begin{macro}{\notrace} +% \begin{macro}{\tracefloats} +% \begin{macro}{\@traceval} +% \begin{macro}{\tracefloatvals} +% \begin{macro}{\@tracemessage} +% \changes{v1.0c}{1993/11/30}{Commands added} +% \changes{v1.0h}{1993/12/12}{Commands changed} +% \changes{v1.0j}{1993/12/17}{tracefloatvals made a document command} +% Set-up tracing for floats independent of other tracing as it +% produces mega-output. Default is no tracing. +% \changes{v1.1j}{1995/04/24} +% {Do not add to kernel unless `trace' specified} +% \task{???}{Make proper tracing module} +% +% \begin{macrocode} +%<*trace> +\def \@tracemessage #1{\typeout{LaTeX2e: #1}} +\def \tracefloats{\let \tr@ce \@tracemessage} +\def \notrace {\let \tr@ce \@gobble} +\notrace +\def \@traceval #1{\tr@ce{\string #1 = \the #1}} +\def \tracefloatvals{% + \@dblfloatplacement + \@floatplacement + \@traceval\@colnum + \@traceval\@colroom + \@traceval\@topnum + \@traceval\@toproom + \@traceval\@botnum + \@traceval\@botroom + \@traceval\@fpmin + \tr@ce{\string\textfraction = \textfraction}% + \@traceval\@dbltopnum + \@traceval\@dbltoproom +} +% +%<*flafter> +\providecommand\tr@ce[1]{} +% +% \end{macrocode} +% \end{macro} +% \end{macro} +% \end{macro} +% \end{macro} +% \end{macro} +% \end{macro} +% +% \begin{macro}{\suppressfloats} +% \begin{macro}{\@flstop} +% \changes{v1.0f}{1993/12/05}{Commands added} +% Float suppression commands: these set the relevant counter +% globally to zero. Thus they are overridden for a particular float +% by an ! specifier. +% +% \begin{macrocode} +%<*2ekernel|autoload> +\def \suppressfloats {% + \@ifnextchar [% + \@flstop + {\global \@colnum \z@}% +} +% \end{macrocode} +% Maybe this should be a loop over |#1|? +% \begin{macrocode} +\def \@flstop [#1]{% + \if t#1% + \global \@topnum \z@ + \fi + \if b#1% + \global \@botnum \z@ + \fi +} +% \end{macrocode} +% \end{macro} +% \end{macro} +% +% +% Manipulation of float placement and type; both their strings and the +% corresponding count registers. +% +% \begin{macro}{\@fpstype} +% \begin{macro}{\@reqcolroom} +% \begin{macro}{\@textfloatsheight} +% \changes{v1.0f}{1993/12/05}{Commands added} +% First a new count register to go with |\@currtype|. +% +% Then a new skip register, for information needed to remove the +% |\@maxsep| conservatism: it is possible that this could use a +% temporary register. +% +% Finally a dimension register to hold the total height of in-text +% floats on the current page. This is needed to implement a +% major change in the functionality of |\@addtocurcol| which is, +% nevertheless, a bug fix. +% It is not local and therefore cannot be a temporary register. +% +% \begin{macrocode} +\newcount \@fpstype +\newdimen \@reqcolroom +\newdimen \@textfloatsheight +% +% \end{macrocode} +% \end{macro} +% \end{macro} +% \end{macro} +% +% \begin{macro}{\@fpsadddefault} +% \changes{v1.0f}{1993/12/05}{Command added} +% Adds the default placement to what is already there. +% +% Should not need to change this, but could do it as follows: +% \begin{verbatim} +%\def \@fpsadddefault {% +% \@temptokena \expandafter\expandafter\expandafter +% {\csname fps@\@captype \endcsname}% +% \edef \reserved@a {\the\@temptokena}% +% \@onelevel@sanitize \reserved@a +% \edef \@fps {\@fps\reserved@a}% +%} +% \end{verbatim} +% +% \begin{macrocode} +%<*2ekernel|autoload|fltrace> +\def \@fpsadddefault {% +%<*trace> + \tr@ce{fps changed from: \@fps}% +% + \edef \@fps {\@fps\csname fps@\@captype \endcsname}% + \@latex@warning {% + No positions in optional float specifier.\MessageBreak + Default added (so using `\@fps')}% +} +% \end{macrocode} +% \end{macro} +% +% \begin{macro}{\@setfloattypecounts} +% \changes{v1.0f}{1993/12/05}{Command added} +% Sets counters |\@fpstype| and |\@currtype|. +% +% BANG $==$ bit4 of $|\count\@currbox| = 0$. +% +% \begin{macrocode} +\def \@setfloattypecounts {% + \@currtype \count\@currbox + \@fpstype \count\@currbox + \divide\@currtype\@xxxii \multiply\@currtype\@xxxii + \advance \@fpstype -\@currtype +%<*trace> + \tr@ce{(mod 32) fpstype: \the \@fpstype}% + \tr@ce{(mult of 32) currtype: \the \@currtype}% +% Tracing only: but some should be changed into real errors/warnings? + \ifnum \@fpstype<\sixt@@n + \ifnum \@fpstype=\z@ + \tr@ce{ERROR: no PLACEMENT, fpstype = \the \@fpstype = 0?}% + \fi + \ifnum \@fpstype=\@ne + \tr@ce{WARNING: only h, fpstype = \the \@fpstype = 1?}% + \fi + \tr@ce{BANG float}% + \else + \ifnum \@fpstype=\sixt@@n + \tr@ce{ERROR: no PLACEMENT, fpstype = \the \@fpstype = 16?}% + \fi + \ifnum \@fpstype=17 + \tr@ce{WARNING: only h, fpstype = \the \@fpstype = 17?}% + \fi + \tr@ce{ORD float}% + \fi +% +} +% +% \end{macrocode} +% \end{macro} +% +% Macros for getting, testing and setting bits of the fps. +% +% +% \begin{macro}{\@getfpsbit} +% \changes{v1.0f}{1993/12/05}{Command added} +% Sets |\@tempcnta| to required bit of |\count\@currbox|. +% +% \begin{macrocode} +%<*2ekernel|autoload> +\def \@getfpsbit {% + \@boxfpsbit \@currbox +} +% \end{macrocode} +% \end{macro} +% +% +% \begin{macro}{\@boxfpsbit} +% \changes{v1.0f}{1993/12/05}{Command added} +% Used above. +% \begin{macrocode} +\def \@boxfpsbit #1#2{% + \@tempcnta \count#1% + \divide \@tempcnta #2\relax +} +% \end{macrocode} +% \end{macro} +% +% \begin{macro}{\@testfp} +% \changes{v1.0f}{1993/12/05}{Command added} +% New definition of the float page test. +% +% \changes{v1.1v}{1996/07/26}{remove \cs{global} before \cs{@test...}} +% \begin{macrocode} +\def \@testfp #1{% + \@boxfpsbit #18\relax % Really `#1 8' for human readers! + \ifodd \@tempcnta + \else + \@testtrue + \fi +} +% \end{macrocode} +% \end{macro} +% +% +% \begin{macro}{\@setfpsbit} +% \changes{v1.0f}{1993/12/05}{Command added} +% Sets required bit of |\@tempcnta| (to 1). +% +% \begin{macrocode} +\def \@setfpsbit #1{% + \@tempcntb \@tempcnta + \divide \@tempcntb #1\relax + \ifodd \@tempcntb + \else + \advance \@tempcnta #1\relax + \fi +} +% +% \end{macrocode} +% \end{macro} +% +% +% \begin{macro}{\@resethfps} +% \changes{v1.0f}{1993/12/05}{Command added} +% \changes{v1.0h}{1993/12/12}{Warnings added: minimal} +% \changes{v1.0m}{1994/04/24}{Warning changed} +% \changes{v1.0m}{1994/04/24}{Number 2 changed to \cs{tw@}} +% \changes{v1.0o}{1994/05/02}{Code shortened} +% Globally adds t as a possible location for an h or !h only placement: +% this must be done using the count. +% +% Although it will leave |\@fpstype| set to 17 even if it was +% originally 1, this does not matter since it is the last thing in +% |\@addtocurcol|. +% \begin{macrocode} +%<*2ekernel|autoload|fltrace> +\def \@resethfps {% + \let\reserved@a\@empty + \ifnum \@fpstype=\@ne + \def \reserved@a {!}% + \@fpstype 17 + \fi + \ifnum \@fpstype=17 + \global \advance \count\@currbox \tw@ + \@latex@warning@no@line {% + `\reserved@a h' float specifier changed to `\reserved@a ht'}% +%<*trace> + \tr@ce{% + `t' added to `\reserved@a h'- new Count: \the \count\@currbox}% +% + \fi +} +% \end{macrocode} +% \end{macro} +% +% +% Special stuff for BANG floats. +% +% \begin{macro}{\@flsetnum} +% \changes{v1.0f}{1993/12/05}{Command added} +% +% Ignores any zero float counter value in case BANG. +% +% It uses a local assignment to the normally global counter: a bit +% naughty, perhaps? +% +% These assgnments are safe so long as the counter involved is only +% consulted once (\ie only for the `bang float') with the changed value. +% This is the case within |\@addtocurcol| because it is used only +% once within a call of the output routine (which forms a group). +% +% For |\@addtonextcol| this is achieved by putting a group around its +% code; this is needed because it is called (by |\@startcolumn|) for +% each float which was on the deferlist. Almost identical +% considerations pertain to |\@addtodblcol|. There may be more +% efficient ways to handle this, but the group seems to be the simplest. +% +% \changes{v1.0n}{1994/04/30}{Rogue space removed} +% \begin{macrocode} +\def \@flsetnum #1{% +%<*trace> + \tr@ce{fpstype: \the \@fpstype (flsetnum \string#1)}% +% + \ifnum \@fpstype<\sixt@@n + \ifnum #1=\z@ +%<*trace> + \tr@ce{BANG float resetting \string#1 to 1}% +% + #1\@ne + \fi + \fi +%<*trace> + \tr@ce{#1 (before) = \the #1}% +% +} +% \end{macrocode} +% \end{macro} +% +% +% \begin{macro}{\@flsettextmin} +% \changes{v1.0f}{1993/12/05}{Command added} +% This ignores |\textfraction| space restriction in case BANG. +% +% \begin{macrocode} +\def \@flsettextmin {% +%<*trace> + \tr@ce{fpstype: \the \@fpstype (flsettextmin)}% +% + \ifnum \@fpstype<\sixt@@n +%<*trace> + \tr@ce{BANG ignoring textmin}% +% + \@textmin \z@ + \else + \@textmin \textfraction\@colht +%<*trace> + \tr@ce{ORD textmin = \the \@textmin}% +% + \fi +} +% \end{macrocode} +% \end{macro} +% +% +% \begin{macro}{\@flcheckspace} +% \changes{v1.0f}{1993/12/05}{Command added} +% This ignores space restriction in case BANG; this is still slightly +% conervative since it does not allow for the fact that, if there is +% no text in the column then |\textfloatsep| is not needed. +% Sets |@tempswa| true if there is room for |\@currbox|. +% +% \begin{macrocode} +\def \@flcheckspace #1#2{% + \advance \@reqcolroom + \ifx #2\@empty \textfloatsep \else \floatsep \fi +%<*trace> + \tr@ce{colroom = \the \@colroom (flcheckspace \string#1 \string#2)}% + \tr@ce{reqcolroom = \the \@reqcolroom + (flcheckspace \string#1 \string#2)}% +% + \ifdim \@colroom>\@reqcolroom + \ifdim #1>\ht\@currbox + \@tempswatrue +%<*trace> + \tr@ce{Space OK: #1 = \the #1 > \the \ht \@currbox + (flcheckspace \string#1 \string#2)}% +% + \else +%<*trace> + \tr@ce{fpstype: \the \@fpstype + (flcheckspace \string#1 \string#2)}% +% + \ifnum \@fpstype<\sixt@@n +%<*trace> + \tr@ce{BANG float ignoring #1 + (flcheckspace \string#1 \string#2):}% + \tr@ce{\@spaces #1 = \the #1. Ht float: \the \ht \@currbox + BANG}% +% + \@tempswatrue +%<*trace> + \else + \tr@ce{Fail---no room (flcheckspace \string#1 \string#2) + (fpstype \the \@fpstype=ORD?):}% + \tr@ce{\@spaces #1 = \the #1. Ht float: \the \ht \@currbox + ORD?}% +% + \fi + \fi +%<*trace> + \else + \tr@ce{Fail---no room at 2nd test of colroom + (flcheckspace \string#1 \string#2)}% +% + \fi +} +% +% \end{macrocode} +% \end{macro} +% +% +% \begin{macro}{\@flupdates} +% \changes{v1.0f}{1993/12/05}{Command added} +% This updates everything when a float is placed. +% +% \begin{macrocode} +%<*2ekernel|autoload> +\def \@flupdates #1#2#3{% + \global \advance #1\m@ne + \global \advance \@colnum \m@ne + \@tempdima -\ht\@currbox + \advance \@tempdima + -\ifx #3\@empty \textfloatsep \else \floatsep \fi + \global \advance #2\@tempdima + \global \advance \@colroom \@tempdima + \@cons #3\@currbox +} +% +% \end{macrocode} +% \end{macro} +% +% +% Interesting facts about float mechanisms past and present, together +% with a summary of various features, some unresolved: +% +% \begin{enumerate} +% \item The value |\textfraction| does not affect the processing +% of doublecol floats: this seems sensible, but should be +% documented. +% \item |\twocolumn| floatplacement was wrong: dbl not needed, ord +% needed. +% \item |\@floatplacement| was not called after |\@startdblcol| +% or |\@topnewpage|. This has been changed; it is clearly a bug +% fix. +% \item The use |\@topnewpage| when |\dblfigrule| is non-trivial +% produced a rule in the wrong place. This has been fixed by not +% using |\dblfigrule| when processing the `float' from +% |\@topnewpage|. +% \item If the specifier was just h and the float could not be put +% here, it went on the deferlist and stayed there until a clearpage. +% It now gets changed to a `th': this is only an error-recovery +% action, putting just h or !h should be deprecated. +% \item |\@dblmaxsep| was `the maximum of |\dblfloatsep| and +% |\dbltexfloatsep|'. But it was never used! Now gone completely, +% like |\@maxsep|. +% \item After an h float is put on a page, it was counted as text when +% applying the |\textfraction| test; this is possibly too big a +% change although it is a bug fix? +% \item Two consecutive h floats are separated by twice |\intextsep|: +% this could be changed to one by use of |\addvspace|, OK? +% Note that it would also mean that less space is put in if an h +% float immediaiely follows other spaces. This is also possibly +% too big a change, at least for compatibility mode? +% Or it may be simply wrong! It has not been changed. +% \item Now |\@addtocurcol| checks first for just p fps. I think +% that this is an increase in efficiency, but maybe the coding +% should be made even more efficient. +% \item |\@tryfcolumn| now tests if the list is empty first, otherwise +% lots of wasted time! Thus this test has been removed from +% |\@startcolumn|. +% As Frank pointed out, this makes |\@startcolumn| less +% efficient. But it is now the same as |\@startdblcolumn|: I can +% see no reason why they should be different, but which is best? +% \item Why is |\@colroom| set in |\@doclearpage|? +% \item Footnotes. Check what |\clearpage| does when footnotes are +% left over. Footnotes are not put on float pages and, also, +% |\@addtonextcol| ignores the existence of held-over footnotes +% in deciding what floats can go on the page. Not changed. +% \item |\clearpage| can still lose non-boxes, at least when floats +% are involved. It also moves some to the `wrong page', but this +% may be a coding problem. +% \item The ! option makes it necessary to check in |\output| that +% there is enough room left on the page after adding a float. (This +% would have been necessary anyway if anyone set |\@textmin| too +% close to zero! A similar danger existed also if the text in a +% |\twocolumn[text]| entity gets too large.) +% The current implementation of this also makes the normal case a +% little less efficient, OK? +% Not enough room means, at present, less than |\baselineskip|, +% with a warning: is this OK? Should it be made generic (another +% parameter)? +% \item There are four possibilities for supporting this: +% +% |\twocolumn[\maketitle more text]| +% +% One is to change +% |\maketitle| slightly to allow this. Another is to change +% |\@topnewpage| so that more than one |\twocolumn[]| command is +% allowed; in this case |\maketitle\twoclumn[more text]| will work. +% The former is more robust from the user's viewpoint, but makes the +% code for |\maketitle| rather ad hoc (maybe it is already?). +% Another is to misuse the global twocolumn flag locally within +% |\@topnewpage|. +% Yet another is to move the column count register from the multicol +% package into the kernel. This has beeen done. +% \item Where should the reinserts be put to maximise the +% probability that footmotes come out on the correct page? +% Or should we go for as much compatibility as possible (but see +% next item)? +% \item Should we continue to support (as much as possible) +% |\samepage|? Some of its intended functionality is now advertised +% as being provided by |\enlargethispage|. Use of either is likely +% to result in wrongly placed footnotes, marginals, etc. +% Which should have priority: obeying the pagination instructions, +% or correct placement of notes/marginalia? +% \item Is the adjustment of space to cause shrinking in the +% kludge-* case correct? Should it be limited to 0pt? +% \item Is the setting of |\boxmaxdepth| in makecol and friends +% needed? It only has any effect if |\@textbottom| ends with a box +% or rule, in which case the vskip to allow for its depth should +% also be added. If it is kept, it should probably be the last +% thing in the box. It has now been removed. +% +% It would perhaps be better to document that |\@textbottom| +% and |\@texttop| must have natural height 0pt. +% \item I cannot see why the vskip adjustement for the depth +% is needed if boxmaxdepth is used to ensure that there is never +% a too deep box. +% \item The value of |\boxmaxdepth| should be explicitly set +% whenever necessary: it is too risky to assume that it has any +% particular value. Care is needed in deciding what to set it to. +% +% It is interesting to note that the value of |\boxmaxdepth| is +% unique in being read before the local settings for the box group +% are reset; all other parameter settings which affect the box +% construction use their values outside the box group. +% \item Should |\@maxdepth| store the setting of |\maxdepth| from +% lplain? Or should we provide a proper interface to class files +% for setting these? +% \end{enumerate} +% +% An analysis of various other macros. +% +% |\@opcol| should do |\@floatplacement|, but where? Right at the +% end, since it always occurs at the start of a column. +% \begin{verbatim} +% \def\@opcol{% +% % Why is this done first? +% \global \@mparbottom \z@ +% \if@twocolumn +% \@outputdblcol +% \else +% \@outputpage +% % This is not needed since it is done at the end of +% % |\@outputpage|: +% \global \@colht \textheight +% \fi} +% \end{verbatim} +% +% Only tracing has been added to these. +% +% \begin{macrocode} +%<*2ekernel|autoload|fltrace> +\def\@makefcolumn #1{% + \begingroup + \@fpmin \z@ + \let \@testfp \@gobble + \@tryfcolumn #1% + \endgroup +%<*trace> + \if@fcolmade + \tr@ce{PAGE: in \string\clearpage \if@twocolumn ---twocolumn\fi---}% + \tr@ce{----- float column/page completed from \string#1}% + \fi +% +} +% \end{macrocode} +% This will line up the last baselines in the two +% columns provided they are constructed in the normal way: \ie ending +% in a skip of minus the original depth, with |\@textbottom| adding +% nothing. +% +% Thus again it is essential for |\@textbottom| to have depth 0pt. +% \changes{1.2g}{2000/07/12}{Ensure that rule is in \cs{normalcolor}} +% \begin{macrocode} +\def\@outputdblcol{% + \if@firstcolumn + \global \@firstcolumnfalse + \global \setbox\@leftcolumn \box\@outputbox +%<*trace> + \tr@ce{PAGE: first column boxed}% +% + \else + \global \@firstcolumntrue + \setbox\@outputbox \vbox {% + \hb@xt@\textwidth {% + \hb@xt@\columnwidth {% + \box\@leftcolumn \hss}% + \hfil + {\normalcolor\vrule \@width\columnseprule}% + \hfil + \hb@xt@\columnwidth {% + \box\@outputbox \hss}% + }% + }% +%<*trace> + \tr@ce{PAGE: second column also boxed}% +% + \@combinedblfloats + \@outputpage +%<*trace> + \tr@ce{PAGE: two column page completed}% +% + \begingroup + \@dblfloatplacement + \@startdblcolumn +% \end{macrocode} +% This loop could be replaced by an |\expandafter| tail +% recursion in\\ |\@startdblcolumn|. +% \begin{macrocode} + \@whilesw\if@fcolmade \fi + {\@outputpage +%<*trace> + \tr@ce{PAGE: double float page completed}% +% + \@startdblcolumn}% + \endgroup + \fi +} +% +% \end{macrocode} +% +% \subsubsection{Float placement parameters} +% \changes{v1.0i}{1993/12/14}{Section added to declare all parameters} +% +% The main purpose of this section is to ensure that all the +% float-placement parameters which need to be set in a class file or +% package have been declared. It also describes their use and sets +% values for them which are reasonable for typical douments using +% US letter or A4 sized paper. +% +% \paragraph{Limits for the placement of floating objects} +% +% \begin{macro}{\c@topnumber} +% This counter holds the maximum number of +% floats that can appear at the top of a text page or column. +% \begin{macrocode} +%<*2ekernel|autoload> +\newcount\c@topnumber +\setcounter{topnumber}{2} +% \end{macrocode} +% \end{macro} +% +% \begin{macro}{\topfraction} +% This macro holds the maximum proportion (as a decimal number) of +% a text page or column that can be occupied by floats at the top. +% \begin{macrocode} +\newcommand\topfraction{.7} +% \end{macrocode} +% \end{macro} +% +% \begin{macro}{\c@bottomnumber} +% This counter holds the maximum number of +% floats that can appear at the bottom of a text page or column. +% \begin{macrocode} +\newcount\c@bottomnumber +\setcounter{bottomnumber}{1} +% \end{macrocode} +% \end{macro} +% +% \begin{macro}{\bottomfraction} +% This macro holds the maximum proportion (as a decimal number) of +% a text page or column that can be occupied by floats at the bottom. +% \begin{macrocode} +\newcommand\bottomfraction{.3} +% \end{macrocode} +% \end{macro} +% +% \begin{macro}{\c@totalnumber} +% This counter holds the maximum number of floats that can appear on +% any text page or column. +% \begin{macrocode} +\newcount\c@totalnumber +\setcounter{totalnumber}{3} +% \end{macrocode} +% \end{macro} +% +% \begin{macro}{\textfraction} +% This macro holds the minimum proportion (as a decimal number) of +% a text page or column that must be occupied by text. +% \begin{macrocode} +\newcommand\textfraction{.2} +% \end{macrocode} +% \end{macro} +% +% \begin{macro}{\floatpagefraction} +% This macro holds the minimum proportion (as a decimal number) of +% a page or column that must be occupied by floating objects before a +% `float page' is produced. +% \begin{macrocode} +\newcommand\floatpagefraction{.5} +% \end{macrocode} +% \end{macro} +% +% \begin{macro}{\c@dbltopnumber} +% This counter holds the maximum number of double-column floats that +% can appear on the top of a two-column text page. +% \begin{macrocode} +\newcount\c@dbltopnumber +\setcounter{dbltopnumber}{2} +% \end{macrocode} +% \end{macro} +% +% \begin{macro}{\dbltopfraction} +% This macro holds the maximum proportion (as a decimal number) of +% a two-column text page that can be occupied by double-column floats +% at the top. +% \begin{macrocode} +\newcommand\dbltopfraction{.7} +% \end{macrocode} +% \end{macro} +% +% \begin{macro}{\dblfloatpagefraction} +% This macro holds the minimum proportion (as a decimal number) of +% a page that must be occupied by double-column floating objects +% before a `double-column float page' is produced. +% \begin{macrocode} +\newcommand\dblfloatpagefraction{.5} +% \end{macrocode} +% \end{macro} +% +% \paragraph{Floats on a text page} +% +% \begin{macro}{\floatsep} +% \begin{macro}{\textfloatsep} +% \begin{macro}{\intextsep} +% When a floating object is placed on a page with text, these +% parameters control the seperation between the float and the other +% objects on the page. These parameters are used for both +% one-column mode and single-column floats in two-column mode. +% They are all rubber lengths. +% +% |\floatsep| is the space between adjacent floats that are placed +% at the top or bottom of the text page or column. +% +% |\textfloatsep| is the space between the main text and floats +% at the top or bottom of the page or column. +% +% |\intextsep| is the space between in-text floats and the text. +% \begin{macrocode} +\newskip\floatsep +\newskip\textfloatsep +\newskip\intextsep +\setlength\floatsep {12\p@ \@plus 2\p@ \@minus 2\p@} +\setlength\textfloatsep{20\p@ \@plus 2\p@ \@minus 4\p@} +\setlength\intextsep {12\p@ \@plus 2\p@ \@minus 2\p@} +% \end{macrocode} +% \end{macro} +% \end{macro} +% \end{macro} +% +% \begin{macro}{\dblfloatsep} +% \begin{macro}{\dbltextfloatsep} +% When double-column floats (floating objects that span the whole +% |\textwidth|) are placed at the top of a text page in two-column +% mode, the separation between the float and the text is controlled +% by |\dblfloatsep| and |\dbltextfloatsep|. They are rubber lengths. +% +% |\dblfloatsep| is the space between adjacent double-column floats +% placed at the top of the text page. +% +% |\dbltextfloatsep| is the space between the main text and +% double-column floats at the top of the page. +% \begin{macrocode} +\newskip\dblfloatsep +\newskip\dbltextfloatsep +\setlength\dblfloatsep {12\p@ \@plus 2\p@ \@minus 2\p@} +\setlength\dbltextfloatsep{20\p@ \@plus 2\p@ \@minus 4\p@} +% \end{macrocode} +% \end{macro} +% \end{macro} +% +% \paragraph{Floats on their own page or column} +% +% \begin{macro}{\@fptop} +% \begin{macro}{\@fpsep} +% \begin{macro}{\@fpbot} +% When floating objects are placed on a seperate page or column, +% called a `float page', the layout of the page is controlled by +% these parameters, which are rubber lengths. +% +% At the top of the page |\@fptop| is inserted; +% typically this supplies some stretchable whitespace. +% At the bottom of the page |\@fpbot| ais inserted. +% Between adjacent floats |\@fpsep| is inserted. +% +% These parameters are used for all floating objects on a +% `float page' in one-column mode, and for single-column +% floats in two-column mode. +% +% Note that at least one of the two parameters |\@fptop| and +% |\@fpbot| should contain a |plus ...fil| so as to fill the +% remaining empty space. +% \begin{macrocode} +\newskip\@fptop +\newskip\@fpsep +\newskip\@fpbot +\setlength\@fptop{0\p@ \@plus 1fil} +\setlength\@fpsep{8\p@ \@plus 2fil} +\setlength\@fpbot{0\p@ \@plus 1fil} +% \end{macrocode} +% \end{macro} +% \end{macro} +% \end{macro} +% +% \begin{macro}{\@dblfptop} +% \begin{macro}{\@dblfpsep} +% \begin{macro}{\@dblfpbot} +% Double-column `float pages' in two-column mode use similar +% parameters. +% \begin{macrocode} +\newskip\@dblfptop +\newskip\@dblfpsep +\newskip\@dblfpbot +\setlength\@dblfptop{0\p@ \@plus 1fil} +\setlength\@dblfpsep{8\p@ \@plus 2fil} +\setlength\@dblfpbot{0\p@ \@plus 1fil} +% \end{macrocode} +% \end{macro} +% \end{macro} +% \end{macro} +% +% \begin{macro}{\topfigrule} +% \begin{macro}{\botfigrule} +% \begin{macro}{\dblfigrule} +% The macros can be used to put in rules between floats and text; +% whatever they insert should be vertical mode material which takes +% up zero space. +% \task{CAR}{Add more rules (for Frank in addtocurcol)} +% \begin{macrocode} +\let\topfigrule=\relax +\let\botfigrule=\relax +\let\dblfigrule=\relax +% +% \end{macrocode} +% \end{macro} +% \end{macro} +% \end{macro} +% +% +% \Finale +\endinput diff --git a/Master/texmf-dist/source/latex/base/ltpage.dtx b/Master/texmf-dist/source/latex/base/ltpage.dtx new file mode 100644 index 00000000000..e7ded9e0e48 --- /dev/null +++ b/Master/texmf-dist/source/latex/base/ltpage.dtx @@ -0,0 +1,334 @@ +% \iffalse meta-comment +% +% Copyright 1993 1994 1995 1996 1997 1998 1999 2000 2001 2002 2003 2004 +% The LaTeX3 Project and any individual authors listed elsewhere +% in this file. +% +% This file is part of the LaTeX base system. +% ------------------------------------------- +% +% It may be distributed and/or modified under the +% conditions of the LaTeX Project Public License, either version 1.3 +% of this license or (at your option) any later version. +% The latest version of this license is in +% http://www.latex-project.org/lppl.txt +% and version 1.3 or later is part of all distributions of LaTeX +% version 2003/12/01 or later. +% +% This file has the LPPL maintenance status "maintained". +% +% The list of all files belonging to the LaTeX base distribution is +% given in the file `manifest.txt'. See also `legal.txt' for additional +% information. +% +% The list of derived (unpacked) files belonging to the distribution +% and covered by LPPL is defined by the unpacking scripts (with +% extension .ins) which are part of the distribution. +% +% \fi +% +% \iffalse +%%% From File: ltpage.dtx +% +%<*driver> +% \fi +\ProvidesFile{ltpage.dtx} + [2000/06/02 v1.0k LaTeX Kernel (page style setup)] +% \iffalse +\documentclass{ltxdoc} +\GetFileInfo{ltpage.dtx} +\title{\filename} +\date{\filedate} + \author{% + Johannes Braams\and + David Carlisle\and + Alan Jeffrey\and + Leslie Lamport\and + Frank Mittelbach\and + Chris Rowley\and + Rainer Sch\"opf} + +\begin{document} +\maketitle + \DocInput{\filename} +\end{document} +% +% \fi +% +% \CheckSum{175} +% +% \section{Page styles and related commands} +% +% +% \changes{v1.0a}{1994/03/07}{Initial version, split from ltherest.dtx} +% \changes{v1.0b}{1994/04/19}{Improve documentation} +% \changes{v1.0i}{1996/04/18}{Improve documentation} +% +% +% \subsection{Page Style Commands} +% +% |\pagestyle|\marg{style} : sets the page style of the +% current and succeeding pages to \emph{style} +% +% |\thispagestyle|\marg{style} : sets the page style of the +% current page only to \emph{style}. +% +% To define a page style \emph{style}, you must define +% |\ps@|\emph{style} to set the page style parameters. +% +% \subsection{How a page style makes running heads and feet} +% +% The |\ps@|\ldots command defines the macros |\@oddhead|, |\@oddfoot|, +% |\@evenhead|, and |\@evenfoot| to define the running heads and feet. +% (See output routine.) To make headings determined by the sectioning +% commands, the page style defines the commands |\chaptermark|, +% |\sectionmark|, etc., where |\chaptermark|\marg{text} is called by +% |\chapter| to set a mark. The |\...mark| commands and the |\...head| +% macros are defined with the help of the following macros. +% +% (All the |\...mark| commands should be initialized to no-ops.) +% +% \subsection{marking conventions} +% +% \LaTeX\ extends \TeX's |\mark| facility by producing two kinds of marks +% a `left' and a `right' mark, using the following commands:\\ +% |\markboth|\marg{left}\marg{right} : Adds both marks.\\ +% |\markright|\marg{right} : Adds a 'right' mark.\\ +% |\leftmark| : +% Used in the output routine, gets the current `left' mark. +% Works like \TeX's |\botmark.|\\ +% |\rightmark| : +% Used in the output routine, gets the current `right' mark. +% Works like \TeX's |\firstmark|. +% The marking commands work reasonably well for right marks `numbered +% within' left marks---e.g., the left mark is changed by a |\chapter| +% command and the right mark is changed by a |\section| command. +% However, it does produce somewhat anomalous results if 2 |\markboth|'s +% occur on the same page. +% +% Commands like |\tableofcontents| that should set the marks in some +% page styles use a |\@mkboth| command, which is |\let| by the pagestyle +% command (|\ps@...|) to |\markboth| for setting the heading or to +% |\@gobbletwo| to do nothing. +% +% \StopEventually{} +% +% \begin{macrocode} +%<*2ekernel> +% \end{macrocode} +% +% \begin{macro}{\pagestyle} +% User command to set the page style for this and following pages. +% \changes{LaTeX2e}{1994/01/24} +% {(DPC) Complain if pagestyle is undefined.} +% \changes{LaTeX2e}{1994/02/01} +% {(DPC) Modify to get nicer error message} +% \begin{macrocode} +\def\pagestyle#1{% + \@ifundefined{ps@#1}% + \undefinedpagestyle + {\@nameuse{ps@#1}}} +% \end{macrocode} +% \end{macro} +% +% \begin{macro}{\thispagestyle} +% User command to set the page style for this page only. +% \changes{LaTeX2e}{1994/02/01} +% {(DPC) Modify to get nicer error message} +% \begin{macrocode} +\def\thispagestyle#1{% + \@ifundefined{ps@#1}% + \undefinedpagestyle + {\global\@specialpagetrue\gdef\@specialstyle{#1}}} +% \end{macrocode} +% \end{macro} +% +% +% \begin{macro}{\ps@empty} +% The empty page style: No head or foot line. +% \begin{macrocode} +\def\ps@empty{% + \let\@mkboth\@gobbletwo\let\@oddhead\@empty\let\@oddfoot\@empty + \let\@evenhead\@empty\let\@evenfoot\@empty} +% \end{macrocode} +% \end{macro} +% +% \begin{macro}{\ps@plain} +% \changes{v1.0g}{1995/05/26}{removed \cs{rmfamily} (PR 1578)} +% The plain page style: No head, centred page number in foot. +% \begin{macrocode} +\def\ps@plain{\let\@mkboth\@gobbletwo + \let\@oddhead\@empty\def\@oddfoot{\reset@font\hfil\thepage + \hfil}\let\@evenhead\@empty\let\@evenfoot\@oddfoot} +% \end{macrocode} +% \end{macro} +% +% \begin{macro}{\@leftmark} +% \begin{macro}{\@rightmark} +% We implement |\@leftmark| and |\@rightmark| in terms of already +% defined commands to save token space. We can't get rid of them +% since they are sometimes used in applications. +% \begin{macrocode} +\let\@leftmark\@firstoftwo +\let\@rightmark\@secondoftwo +% \end{macrocode} +% \end{macro} +% \end{macro} +% +% \begin{macro}{\markboth} +% \begin{macro}{\markright} +% \changes{v1.0d}{1994/05/20}{Changed setting for \cs{protect}.} +% \changes{v1.0e}{1994/11/04}{Added \cs{@unexpandable@protect}. +% ASAJ.} +% +% User commands for setting \LaTeX\ marks. +% +% Test for |\@nobreak| added 15 Apr 86 in |\markboth| and |\markright| +% letting |\label| and |\index| to |\relax| added 22 Feb 86 so these +% commands can appear in sectioning command arguments +% RmS 91/06/21 Same for |\glossary| +% \changes{v1.0k}{2000/06/02}{Tidied 1.0j reimplementation, CAR} +% \changes{v1.0k}{2000/06/02}{Small adjustment to give slightly less +% expansion, CAR} +% \changes{v1.0j}{2000/05/26}{Reimplementation to fix expansion +% error (pr/3203).} +% \begin{macrocode} +\def\markboth#1#2{% + \begingroup + \let\label\relax \let\index\relax \let\glossary\relax + \unrestored@protected@xdef\@themark {{#1}{#2}}% + \@temptokena \expandafter{\@themark}% + \mark{\the\@temptokena}% + \endgroup + \if@nobreak\ifvmode\nobreak\fi\fi} +\def\markright#1{% + \begingroup + \let\label\relax \let\index\relax \let\glossary\relax +% \end{macrocode} +% Protection is handled inside |\@markright|. +% \begin{macrocode} + \expandafter\@markright\@themark {#1}% + \@temptokena \expandafter{\@themark}% + \mark{\the\@temptokena}% + \endgroup + \if@nobreak\ifvmode\nobreak\fi\fi} +% \end{macrocode} +% \end{macro} +% \end{macro} +% +% +% \begin{macro}{\@markright} +% \changes{v1.0j}{2000/05/26}{Reimplementation to fix expansion +% error (pr/3203).} +% \changes{v1.0k}{2000/06/02}{Small adjustment to give slightly less +% expansion, CAR} +% \begin{macro}{\leftmark} +% \changes{v1.0j}{2000/05/26}{Use \cs{@empty} instead of brace group +% (pr/3203).} +% \begin{macro}{\rightmark} +% \changes{LaTeX2e}{1993/12/17}{Stopgap solution to mark \cs{leftmark} +% and \cs{rightmark} work without initializing mark until +% the problem is solved.} +% \changes{v1.0j}{2000/05/26}{Use \cs{@empty} instead of brace group +% (pr/3203).} +% \task{???}{mark initialisation solved?} +% \begin{macrocode} +\def\@markright#1#2#3{\@temptokena {#1}% + \unrestored@protected@xdef\@themark{{\the\@temptokena}{#3}}} +\def\leftmark{\expandafter\@leftmark\botmark\@empty\@empty} +\def\rightmark{\expandafter\@rightmark\firstmark\@empty\@empty} +% \end{macrocode} +% \end{macro} +% \end{macro} +% \end{macro} +% +% +% \begin{macro}{\@themark} +% Initialise \LaTeX's marks without setting a \TeX\ mark \meta{whatsit}. +% \begin{macrocode} +\def\@themark{{}{}} +% \end{macrocode} +% \end{macro} +% +% \begin{macro}{\mark} +% Test versions of \LaTeXe\ initialised \TeX's |\mark| system +% at this point, but this was removed before the first release. +% \changes{LaTeX2e}{1993/12/16}{Init \cs{mark} at begin document} +% \changes{LaTeX2e}{1993/12/17}{Removed init \cs{mark} at begin +% document, since it doesn't work.} +%\begin{verbatim} +%\AtBeginDocument{\mark{{}{}}} +%\end{verbatim} +% \end{macro} +% +% +% \begin{macro}{\raggedbottom} +% |\raggedbottom| typesets pages with no vertical stretch, so they have +% their natural height instead of all being exactly the +% same height. (Uses a space of .0001fil to avoid +% interfering with the 1fil space of |\newpage|.) +% +% \begin{macrocode} +\def\raggedbottom{% + \def\@textbottom{\vskip \z@ \@plus.0001fil}\let\@texttop\relax} +% \end{macrocode} +% \end{macro} +% +% \begin{macro}{\flushbottom} +% |\flushbottom|: +% Inverse of |\raggedbottom| --- makes all pages the same height. +% \begin{macrocode} +\def\flushbottom{% + \let\@textbottom\relax \let\@texttop\relax} +% \end{macrocode} +% \end{macro} +% +% +% \begin{macro}{\sloppy} +% |\sloppy| will never (well, hardly ever) produce overfull boxes, but +% may produce underfull ones. (14 June 85) +% \changes{LaTeX2e}{1993/12/18}{Added \cs{emergencystretch}} +% \changes{v1.0h}{1994/07/20}{Save a few tokens} +% \begin{macrocode} +\def\sloppy{% + \tolerance 9999% + \emergencystretch 3em% + \hfuzz .5\p@ + \vfuzz\hfuzz} +% \end{macrocode} +% \end{macro} +% +% \begin{environment}{sloppypar} +% A sloppypar environment is equivalent to |{\par \sloppy ... \par}|. +% \begin{macrocode} +\def\sloppypar{\par\sloppy} +\def\endsloppypar{\par} +% \end{macrocode} +% \end{environment} +% +% \begin{macro}{\fussy} +% \changes{v1.0f}{1995/04/24}{reset \cs{emergencystretch} latex/1344} +% Resets \TeX's parameters to their normal finicky values. +% \begin{macrocode} +\def\fussy{% + \emergencystretch\z@ + \tolerance 200% + \hfuzz .1\p@ + \vfuzz\hfuzz} +% \end{macrocode} +% \end{macro} +% +% \begin{macro}{\overfullrule} +% \LaTeX\ default is no overfull box rule. Changed by document +% class option. +% \begin{macrocode} +\overfullrule 0pt +% \end{macrocode} +% \end{macro} +% +% \begin{macrocode} +% +% \end{macrocode} +% +% \Finale +% diff --git a/Master/texmf-dist/source/latex/base/ltpageno.dtx b/Master/texmf-dist/source/latex/base/ltpageno.dtx new file mode 100644 index 00000000000..3deb9820936 --- /dev/null +++ b/Master/texmf-dist/source/latex/base/ltpageno.dtx @@ -0,0 +1,101 @@ +% \iffalse meta-comment +% +% Copyright 1993 1994 1995 1996 1997 1998 1999 2000 2001 2002 2003 2004 +% The LaTeX3 Project and any individual authors listed elsewhere +% in this file. +% +% This file is part of the LaTeX base system. +% ------------------------------------------- +% +% It may be distributed and/or modified under the +% conditions of the LaTeX Project Public License, either version 1.3 +% of this license or (at your option) any later version. +% The latest version of this license is in +% http://www.latex-project.org/lppl.txt +% and version 1.3 or later is part of all distributions of LaTeX +% version 2003/12/01 or later. +% +% This file has the LPPL maintenance status "maintained". +% +% The list of all files belonging to the LaTeX base distribution is +% given in the file `manifest.txt'. See also `legal.txt' for additional +% information. +% +% The list of derived (unpacked) files belonging to the distribution +% and covered by LPPL is defined by the unpacking scripts (with +% extension .ins) which are part of the distribution. +% +% \fi +% +% \iffalse +%%% From File: ltpageno.dtx +% +%<*driver> +% \fi +\ProvidesFile{ltpageno.dtx} + [1994/05/19 v1.1a LaTeX Kernel (Page Numbering)] +% \iffalse +\documentclass{ltxdoc} +\GetFileInfo{ltpageno.dtx} +\title{\filename} +\date{\filedate} + \author{% + Johannes Braams\and + David Carlisle\and + Alan Jeffrey\and + Leslie Lamport\and + Frank Mittelbach\and + Chris Rowley\and + Rainer Sch\"opf} + +\begin{document} +\maketitle + \DocInput{\filename} +\end{document} +% +% \fi +% +% \CheckSum{16} +% +% \changes{v1.0c}{1994/03/29} +% {Create file ltcntlen from parts of ltmiscen and ltherest.} +% \changes{v1.1a}{1994/05/19} +% {Extract file ltpageno from ltcntlen.} +% +% \section{Page Numbering} +% Page numbers are produced by a page counter, used just like any other +% counter. The only difference is that |\c@page| contains the number of +% the next page to be output (the one currently being produced), rather +% than one minus it. Thus, it is normally initialized to~1 rather +% than~0. |\c@page| is defined to be |\count0|, rather than a count +% assigned by |\newcount|. +% +% \DescribeMacro{\pagenumbering} +% The user sets the pagenumber style with the |\pagenumbering|\marg{foo} +% command, which sets the page counter to 1 and defines |\thepage| to be +% |\foo|. For example, |\pagenumbering{roman}| causes pages to be +% numbered i, ii, etc. +% +% +% \StopEventually{} +% +% \begin{macrocode} +%<*2ekernel> +\message{page nos.,} +% \end{macrocode} +% +% +% \begin{macrocode} +\countdef\c@page=0 \c@page=1 +\def\cl@page{} +\def\pagenumbering#1{% + \global\c@page \@ne \gdef\thepage{\csname @#1\endcsname + \c@page}} +% \end{macrocode} +% +% \begin{macrocode} +% +% \end{macrocode} +% +% \Finale +% diff --git a/Master/texmf-dist/source/latex/base/ltpar.dtx b/Master/texmf-dist/source/latex/base/ltpar.dtx new file mode 100644 index 00000000000..417d45226b2 --- /dev/null +++ b/Master/texmf-dist/source/latex/base/ltpar.dtx @@ -0,0 +1,196 @@ +% \iffalse meta-comment +% +% Copyright 1993 1994 1995 1996 1997 1998 1999 2000 2001 2002 2003 2004 +% The LaTeX3 Project and any individual authors listed elsewhere +% in this file. +% +% This file is part of the LaTeX base system. +% ------------------------------------------- +% +% It may be distributed and/or modified under the +% conditions of the LaTeX Project Public License, either version 1.3 +% of this license or (at your option) any later version. +% The latest version of this license is in +% http://www.latex-project.org/lppl.txt +% and version 1.3 or later is part of all distributions of LaTeX +% version 2003/12/01 or later. +% +% This file has the LPPL maintenance status "maintained". +% +% The list of all files belonging to the LaTeX base distribution is +% given in the file `manifest.txt'. See also `legal.txt' for additional +% information. +% +% The list of derived (unpacked) files belonging to the distribution +% and covered by LPPL is defined by the unpacking scripts (with +% extension .ins) which are part of the distribution. +% +% \fi +% +% \iffalse +%%% From File: ltpar.dtx +% +%<*driver> +% \fi +\ProvidesFile{ltpar.dtx} + [1995/04/29 v1.1c LaTeX Kernel (paragraphs)] +% \iffalse +\documentclass{ltxdoc} +\GetFileInfo{ltpar.dtx} +\title{\filename} +\date{\filedate} + \author{% + Johannes Braams\and + David Carlisle\and + Alan Jeffrey\and + Leslie Lamport\and + Frank Mittelbach\and + Tobias Oetiker \thanks{Tobi did the documentation update}\and + Chris Rowley\and + Rainer Sch\"opf} +\begin{document} + \maketitle + \DocInput{\filename} +\end{document} +% +% \fi +% +% \CheckSum{18} +% +% \CharacterTable +% {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 +% 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 +% Digits \0\1\2\3\4\5\6\7\8\9 +% Exclamation \! Double quote \" Hash (number) \# +% Dollar \$ Percent \% Ampersand \& +% Acute accent \' Left paren \( Right paren \) +% Asterisk \* Plus \+ Comma \, +% Minus \- Point \. Solidus \/ +% Colon \: Semicolon \; Less than \< +% Equals \= Greater than \> Question mark \? +% Commercial at \@ Left bracket \[ Backslash \\ +% Right bracket \] Circumflex \^ Underscore \_ +% Grave accent \` Left brace \{ Vertical bar \| +% Right brace \} Tilde \~} +% +% \changes{v1.1a}{1994/05/16}{(ASAJ) Split from ltinit.dtx.} +% \changes{v1.1b}{1995/04/29}{(TO) Comments clean-up.} +% +% \section{Paragraphs} +% +% This section of the kernel declares the commands used to set +% |\par| and |\everypar| when ever their function needs to be +% changed for a long time. +% +% \StopEventually{} +% +% \subsection{Implementation} +% +% +% There are two situations in which |\par| may be changed: +% +% \begin{itemize} +% \item Long-term changes, in which the new value is to remain in effect +% until the current environment is left. The environments that +% change |\par| in this way are the following: +% \begin{itemize} +% \item All list environments (itemize, quote, etc.) +% \item Environments that turn |\par| into a noop: +% tabbing, array and tabular. +% \end{itemize} +% \item Temporary changes, in which |\par| is restored to its previous +% value the next time it is executed. The following are all such uses. +% \begin{itemize} +% \item |\end| when preceded by |\@endparenv|, which is called by +% |\endtrivlist| +% \item The mechanism for avoiding page breaks and getting the +% spacing right after section heads. +% \end{itemize} +% \end{itemize} +% +% \DescribeMacro{\@setpar} +% To permit the proper interaction of these two situations, long-term +% changes are made by the |\@setpar{|\meta{VAL}|}| command. +% It's function is: +% \begin{quote} +% To set |\par|. It |\def|'s |\par| and |\@par| to \meta{VAL}. +% \end{quote} +% +% \DescribeMacro{\@restorepar} +% Short-term changes are made by the usual |\def\par| commands. +% The original values are restored after a short-term change +% by the |\@restorepar| commands. +% +% \DescribeMacro{\@@par} +% |\@@par| always is defined to be the original \TeX{} |\par|. +% +% \DescribeMacro{\everypar} +% |\everypar| is changed only for the short term. Whenever |\everypar| +% is set non-null, it should restore itself to null when executed. +% +% The following commands change |\everypar| in this way: +% \begin{itemize} +% \item |\item| +% \item |\end| when preceded by |\@endparenv|, which is called by +% |endtrivlist| +% \item |\minipage| +% \end{itemize} +% +% When dealing with |\par| and |\everypar| remember the following two +% warnings: +% \begin{enumerate} +% \item Commands that make short-term changes to |\par| and |\everypar| +% must take account of the possibility that the new commands and the +% ones that do the restoration may be executed inside a group. In +% particular, |\everypar| is executed inside a group whenever a new +% paragraph begins with a left brace. The |\everypar| command +% that restores its definition should be local to the current +% group (in case the command +% is inside a minipage used inside someplace where |\everypar| has +% been redefined). Thus, if |\everypar| is redefined to do an +% |\everypar{}| it could take several executions of |\everypar| +% before the restoration ``holds''. This usually causes no problem. +% However, to prevent the extra executions from doing harm, +% use a global switch to keep anything harmful in the new +% |\everypar| from being done twice. +% \item Commands that change |\everypar| should remember that +% |\everypar| might be supposed to set the following switches false: +% \begin{itemize} +% \item |@nobreak| +% \item |@minipage| +% \end{itemize} +% they should do the setting if necessary. +% \end{enumerate} +% \begin{macrocode} +%<*2ekernel> +\message{par,} +% \end{macrocode} +% +% +% \begin{macro}{\@setpar} +% \begin{macro}{\@par} +% Initiate a long-term change to |\par|. +% \begin{macrocode} +\def\@setpar#1{\def\par{#1}\def\@par{#1}} +% \end{macrocode} +% +% The default definition of |\@par| will ensure that if +% |\@restorepar| defines |\par| to execute |\@par| it will redefine +% itself to the primitive |\@@par| after one iteration. +% \begin{macrocode} +\def\@par{\let\par\@@par\par} +% +% \end{macrocode} +% \end{macro} +% \end{macro} +% +% \begin{macro}{\@restorepar} +% Restore from a short-term change to |\par|. +% \begin{macrocode} +\def\@restorepar{\def\par{\@par}} +% \end{macrocode} +% \end{macro} +% +% \Finale +\endinput + diff --git a/Master/texmf-dist/source/latex/base/ltpictur.dtx b/Master/texmf-dist/source/latex/base/ltpictur.dtx new file mode 100644 index 00000000000..a93f3f4cd67 --- /dev/null +++ b/Master/texmf-dist/source/latex/base/ltpictur.dtx @@ -0,0 +1,1487 @@ +% \iffalse meta-comment +% +% Copyright 1993 1994 1995 1996 1997 1998 1999 2000 2001 2002 2003 2004 +% The LaTeX3 Project and any individual authors listed elsewhere +% in this file. +% +% This file is part of the LaTeX base system. +% ------------------------------------------- +% +% It may be distributed and/or modified under the +% conditions of the LaTeX Project Public License, either version 1.3 +% of this license or (at your option) any later version. +% The latest version of this license is in +% http://www.latex-project.org/lppl.txt +% and version 1.3 or later is part of all distributions of LaTeX +% version 2003/12/01 or later. +% +% This file has the LPPL maintenance status "maintained". +% +% The list of all files belonging to the LaTeX base distribution is +% given in the file `manifest.txt'. See also `legal.txt' for additional +% information. +% +% The list of derived (unpacked) files belonging to the distribution +% and covered by LPPL is defined by the unpacking scripts (with +% extension .ins) which are part of the distribution. +% +% \fi +% +% \iffalse +%%% From File: ltpictur.dtx +%\ProvidesFile{autopict.sty} +% [2001/08/27 v1.1k Picture mode autoload file] +%<*driver> +% \fi + \ProvidesFile{ltpictur.dtx} + [2003/12/30 v1.1j LaTeX Kernel (Picture Mode)] +% \iffalse +\documentclass{ltxdoc} +\GetFileInfo{ltpictur.dtx} +\title{\filename} +\date{\filedate} +\author{% + Johannes Braams\and + David Carlisle\and + Alan Jeffrey\and + Leslie Lamport\and + Frank Mittelbach\and + Chris Rowley\and + Rainer Sch\"opf} +\begin{document} +\maketitle + \DocInput{\filename} +\end{document} +% +% \fi +% +% \CheckSum{1528} +% +% \changes{v1.0g}{1995/05/07}{Use \cs{hb@xt@}} +% \changes{v1.1a}{1995/05/19}{Support autoloading feature} +% \changes{v1.1b}{1995/06/13}{Use \cs{ProvidesFile} in autoload} +% \changes{v1.1d}{1995/07/12}{allow 2e commands in 209 mode. latex/1737} +% \changes{v1.1e}{1995/10/03}{New autoload code} +% \changes{v1.1h}{1999/04/15}{Replaced octal numbers, CAR} +% +% \section{Picture Mode} +% Picture mode commands. In addition to the commands available in +% \LaTeX2.09, This section adds the new |\qbezier| command for +% drawing curves. +% +% \DescribeMacro{\qbezier} +% |\qbezier|\oarg{N}\parg{AX,AY}\parg{BX,BY}\parg{CX,CY} +% plots a quadratic Bezier curve from \parg{AX,AY} to \parg{CX,CY}, +% with \parg{BX,BY} as the third Bezier point, using $N+1$ points +% equally spaced parametrically. +% If $N = 0$ (the default value), then a sufficient number of points +% are used to draw a connected curve--except that at most +% $|\qbeziermax| + 1$ points are drawn. A ``point'' is a square of +% side |\@wholewidth|. +% +% \DescribeMacro{\bezier} +% In addition, to be compatible with the old |bezier| package, a +% variant of this command, |\bezier|, is defined, in which the first +% argument is not optional. +% +% \StopEventually{} +% +% +% \changes{v0.1a}{1994/03/07}{Initial version, split from latex.dtx} +% \changes{v0.1a}{1994/03/07}{Long lines wrapped to 72 columns} +% \changes{v0.1b}{1994/04/24} +% {Removed surplus spaces after \cs{hbox to } in several cases} +% \changes{v0.1d}{1994/05/13} +% {Removed surplus braces from \cs{@if..} constructions} +% \changes{v0.1e}{1994/05/22}{Use new warning cmds} +% \changes{v1.0f}{1994/11/17} +% {\cs{@tempa} to \cs{reserved@a}} +% +% \begin{oldcomments} +% +% \unitlength = value of dimension argument +% \@wholewidth = current line width +% \@halfwidth = half of current line width +% \@linefnt = font for drawing lines +% \@circlefnt = font for drawing circles +% +% \linethickness{DIM} : Sets the width of horizontal and vertical lines +% in a picture to DIM. Does not change width of slanted lines +% or circles. Width of all lines reset by \thinlines and +% \thicklines +% +% \picture(XSIZE,YSIZE)(XORG,YORG) +% BEGIN +% \@picht :=L YSIZE * \unitlength +% box \@picbox := +% \hb@xt@ XSIZE * \unitlength +% {\hskip -XORG * \unitlength +% \lower YORG * \unitlength +% \hbox{ +% \ignorespaces %% added 13 June 89 +% END +% +% \endpicture == +% BEGIN +% } \hss } +% heigth of \@picbox := \@picht +% depth of \@picbox := 0 +% \mbox{\box\@picbox} %% change 26 Aug 91 +% END +% +% \put(X, Y){OBJ} == +% BEGIN +% \@killglue +% \raise Y * \unitlength \hb@xt@ 0pt { \hskip X * \unitlength +% OBJ \hss } +% \ignorespaces +% END +% +% \multiput(X,Y)(DELX,DELY){N}{OBJ} == +% BEGIN +% \@killglue +% \@multicnt := N +% \@xdim := X * \unitlength +% \@ydim := Y * \unitlength +% while \@multicnt > 0 +% do \raise \@ydim \hb@xt@ 0pt { \hskip \@xdim +% OBJ \hss } +% \@multicnt := \@multicnt - 1 +% \@xdim := \@xdim + DELX * \unitlength +% \@ydim := \@ydim + DELY * \unitlength +% od +% \ignorespaces +% END +% +% \shortstack[POS]{TEXT} : Makes a \vbox containing TEXT stacked as +% a one-column array, positioned l, r or c as indicated by POS. +% +% \end{oldcomments} +% +% The `2ekernel' code ensures that a |\usepackage{autopict}| is +% essentially ignored if a `full' format is being used that has +% picture mode already in the format. +% \begin{macrocode} +%<2ekernel>\expandafter\let\csname ver@autopict.sty\endcsname\fmtversion +% \end{macrocode} +% +% \begin{macro}{\@wholewidth} +% \begin{macro}{\@halfwidth} +% \begin{macrocode} +%<*2ekernel|autoload> +\newdimen\@wholewidth +\newdimen\@halfwidth +% \end{macrocode} +% \end{macro} +% \end{macro} +% +% \begin{macro}{\unitlength} +% \begin{macrocode} +\newdimen\unitlength \unitlength =1pt +% \end{macrocode} +% \end{macro} +% +% \begin{macro}{\@picbox} +% \begin{macro}{\@picht} +% \begin{macrocode} +\newbox\@picbox +\newdimen\@picht +% +% \end{macrocode} +% \end{macro} +% \end{macro} +% +% \begin{macro}{\picture} +% \changes{v0.1c}{1994/04/28}{(DPC) Ignore spaces before (} +% |#1| should be white space. +% \begin{macro}{\pictur@} +% \changes{v1.0h}{1995/05/12}{Macro added for latex/1355} +% |#1| should be a |(| (eating any white space before the bracket), +% \begin{macrocode} +%<*2ekernel|def> +\long\gdef\picture#1{\pictur@#1} +\gdef\pictur@(#1){% + \@ifnextchar({\@picture(#1)}{\@picture(#1)(0,0)}} +% +%<*autoload> +\def\pictur@{\@autoload{pict}} +\def\picture{\pictur@\picture} +% +% \end{macrocode} +% \end{macro} +% \end{macro} +% +% \begin{macro}{\@picture} +% \begin{macrocode} +%<*2ekernel|def> +\gdef\@picture(#1,#2)(#3,#4){% + \@picht#2\unitlength + \setbox\@picbox\hb@xt@#1\unitlength\bgroup + \hskip -#3\unitlength + \lower #4\unitlength\hbox\bgroup + \ignorespaces} +% \end{macrocode} +% \end{macro} +% +% \begin{macro}{\endpicture} +% \changes{LaTeX2.09}{1991/08/26} +% {(RmS \& FMi) extra boxing level around \cs{@picbox} +% to guard against unboxing in math mode +% (proposed by John Hobby)} +% +% \begin{macrocode} +\gdef\endpicture{% + \egroup\hss\egroup + \ht\@picbox\@picht\dp\@picbox\z@ + \mbox{\box\@picbox}} +% \end{macrocode} +% \end{macro} +% +% In the definitions of |\put| and |\multiput|, |\hskip| was replaced by +% |\kern| just in case arg |#3| = ``plus''. (Bug detected by Don Knuth. +% changed 20 Jul 87). +% +% \begin{macrocode} +\long\gdef\put(#1,#2)#3{% + \@killglue\raise#2\unitlength + \hb@xt@\z@{\kern#1\unitlength #3\hss}% + \ignorespaces} +% \end{macrocode} +% +% +% \begin{macro}{\multiput} +% \changes{v0.1c}{1994/04/28}{(DPC) Ignore spaces between )(} +% |#3| had better be a |(|. +% \begin{macrocode} +\gdef\multiput(#1,#2)#3{% + \@xdim #1\unitlength + \@ydim #2\unitlength + \@multiput(} +% \end{macrocode} +% \end{macro} +% +% \begin{macro}{\multiput} +% \changes{v0.1c}{1994/04/28}{(DPC) Macro added} +% \begin{macrocode} +\long\gdef\@multiput(#1,#2)#3#4{% + \@killglue\@multicnt #3\relax + \@whilenum \@multicnt >\z@\do + {\raise\@ydim\hb@xt@\z@{\kern\@xdim #4\hss}% + \advance\@multicnt\m@ne + \advance\@xdim#1\unitlength\advance\@ydim#2\unitlength}% + \ignorespaces} +% \end{macrocode} +% \end{macro} +% +% \begin{macro}{\@killglue} +% \begin{macrocode} +\gdef\@killglue{\unskip\@whiledim \lastskip >\z@\do{\unskip}} +% +% \end{macrocode} +% \end{macro} +% +% \begin{macro}{\thinlines} +% \begin{macro}{\thicklines} +% \begin{macrocode} +%<*2ekernel|def> +\gdef\thinlines{\let\@linefnt\tenln \let\@circlefnt\tencirc + \@wholewidth\fontdimen8\tenln \@halfwidth .5\@wholewidth} +\gdef\thicklines{\let\@linefnt\tenlnw \let\@circlefnt\tencircw + \@wholewidth\fontdimen8\tenlnw \@halfwidth .5\@wholewidth} +% +%<*autoload> +\def\thinlines{\pictur@\thinlines} +\def\thicklines{\pictur@\thicklines} +% +% \end{macrocode} +% \end{macro} +% \end{macro} +% +% \begin{macro}{\linethickness} +% \begin{macrocode} +%<*2ekernel|def> +\gdef\linethickness#1{\@wholewidth #1\relax \@halfwidth .5\@wholewidth} +% +%<*autoload> +\def\linethickness{\pictur@\linethickness} +% +% \end{macrocode} +% \end{macro} +% +% \begin{macro}{\ishortstack} +% \begin{macrocode} +%<*2ekernel|def> +\gdef\shortstack{\@ifnextchar[\@shortstack{\@shortstack[c]}} +% \end{macrocode} +% \end{macro} +% +% \begin{macro}{\@ishortstack} +% \begin{macrocode} +\gdef\@shortstack[#1]{% + \leavevmode + \vbox\bgroup + \baselineskip-\p@\lineskip 3\p@ + \let\mb@l\hss\let\mb@r\hss + \expandafter\let\csname mb@#1\endcsname\relax + \let\\\@stackcr + \@ishortstack} +% \end{macrocode} +% \end{macro} +% +% +% \changes{LaTeX2.09}{1991/08/14} +% {(RmS) inserted extra braces around entry for NFSS} +% \changes{LaTeX2.09}{1993/11/03} +% {(RmS) changed \cs{halign} to \cs{ialign} to initialize +% \cs{tabskip} and \cs{everycr}} +% +% \begin{macro}{\@ishortstack} +% \begin{macrocode} +\gdef\@ishortstack#1{\ialign{\mb@l {##}\unskip\mb@r\cr #1\crcr}\egroup} +% \end{macrocode} +% \end{macro} +% +% \begin{macro}{\@stackcr} +% \begin{macro}{\@ixstackcr} +% \begin{macrocode} +\gdef\@stackcr{\@ifstar\@ixstackcr\@ixstackcr} +\gdef\@ixstackcr{\@ifnextchar[\@istackcr{\cr\ignorespaces}} +% \end{macrocode} +% \end{macro} +% \end{macro} +% +% \begin{macro}{\@istackcr} +% \begin{macrocode} +\gdef\@istackcr[#1]{\cr\noalign{\vskip #1}\ignorespaces} +% \end{macrocode} +% \end{macro} +% +% \begin{oldcomments} +% \line(X,Y){LEN} == +% BEGIN +% \@xarg := X +% \@yarg := Y +% \@linelen := LEN * \unitlength +% if \@xarg = 0 +% then \@vline +% else if \@yarg = 0 +% then \@hline +% else \@sline +% if +% if +% END +% +% \@sline == +% BEGIN +% if \@xarg < 0 +% then @negarg := T +% \@xarg := -\@xarg +% \@yyarg := -\@yarg +% else @negarg := F +% \@yyarg := \@yarg +% fi +% \@tempcnta := |\@yyarg| +% if \@tempcnta > 6 +% then error: 'LATEX ERROR: Illegal \line or \vector argument.' +% \@tempcnta := 0 +% fi +% \box\@linechar := \hbox{\@linefnt \@getlinechar(\@xarg,\@yyarg) } +% if \@yarg > 0 then \@upordown = \raise +% \@clnht := 0 +% else \@upordown = \lower +% \@clnht := height of \box\@linechar +% fi +% \@clnwd := width of \box\@linechar +% if @negarg +% then \hskip - width of \box\@linechar +% \reserved@a == \hskip - 2* width of box \@linechar +% else \reserved@a == \relax +% fi +% %% Put out integral number of line segments +% while \@clnwd < \@linelen +% do \@upordown \@clnht \copy\@linechar +% \reserved@a +% \@clnht := \@clnht + ht of \box\@linechar +% \@clnwd := \@clnwd + width of \box\@linechar +% od +% +% %% Put out last segment +% \@clnht := \@clnht - height of \box\@linechar +% \@clnwd := \@clnwd - width of \box\@linechar +% \@tempdima := \@linelen - \@clnwd +% \@tempdimb := \@tempdima - width of \box\@linechar +% if @negarg then \hskip -\@tempdimb +% else \hskip \@tempdimb +% fi +% \@tempdima := 1000 * \@tempdima +% \@tempcnta := \@tempdima / width of \box\@linechar +% \@tempdima := (\@tempcnta * ht of \box\@linechar)/1000 +% \@clnht := \@clnht + \@tempdima +% if \@linelen < width of box\@linechar +% then \hskip width of box\@linechar +% else \hbox{\@upordown \@clnht \copy\@linechar} +% fi +% END +% +% \@hline == +% BEGIN +% if \@xarg < 0 then \hskip -\@linelen \fi +% \vrule height \@halfwidth depth \@halfwidth width \@linelen +% if \@xarg < 0 then \hskip -\@linelen \fi +% END +% +% \@vline == if \@yarg < 0 \@downline else \@upline fi +% +% +% \@getlinechar(X,Y) == +% BEGIN +% \@tempcnta := 8*X - 9 +% if Y > 0 +% then \@tempcnta := \@tempcnta + Y +% else \@tempcnta := \@tempcnta - Y + 64 +% fi +% \char\@tempcnta +% END +% +% \vector(X,Y){LEN} == +% BEGIN +% \@xarg := X +% \@yarg := Y +% \@linelen := LEN * \unitlength +% if \@xarg = 0 +% then \@vvector +% else if \@yarg = 0 +% then \@hvector +% else \@svector +% if +% if +% END +% +% \@hvector == +% BEGIN +% \@hline +% {\@linefnt if \@xarg < 0 then \@getlarrow(1,0) +% else \@getrarrow(1,0) +% fi} +% END +% +% \@vvector == if \@yarg < 0 \@downvector else \@upvector fi +% +% \@svector == +% BEGIN +% \@sline +% \@tempcnta := |\@yarg| +% if \@tempcnta < 5 +% then \hskip - width of \box\@linechar +% \@upordown \@clnht \hbox +% {\@linefnt +% if @negarg then \@getlarrow(\@xarg,\@yyarg) +% else \@getrarrow(\@xarg,\@yyarg) +% fi } +% else error: 'LATEX ERROR: Illegal \line or \vector argument.' +% fi +% END +% +% \@getlarrow(X,Y) == +% BEGIN +% if Y = 0 +% then \@tempcnta := '33 +% else \@tempcnta := 16 * X - 9 +% \@tempcntb := 2 * Y +% if \@tempcntb > 0 +% then \@tempcnta := \@tempcnta + \@tempcntb +% else \@tempcnta := \@tempcnta - \@tempcntb + 64 +% fi +% fi +% \char\@tempcnta +% END +% +% \@getrarrow(X,Y) == +% BEGIN +% \@tempcntb := |Y| +% case of \@tempcntb +% 0 : \@tempcnta := '55 +% 1 : if X < 3 +% then \@tempcnta := 24*X - 6 +% else if X = 3 +% then \@tempcnta := 49 +% else \@tempcnta := 58 fi +% fi +% 2 : if X < 3 +% then \@tempcnta := 24*X - 3 +% else \@tempcnta := 51 % X must = 3 +% fi +% 3 : \@tempcnta := 16*X - 2 +% 4 : \@tempcnta := 16*X + 7 +% endcase +% if Y < 0 +% then \@tempcnta := \@tempcnta + 64 +% fi +% \char\@tempcnta +% END +% \end{oldcomments} +% +% \begin{macro}{\if@negarg} +% \begin{macrocode} +\newif\if@negarg +% \end{macrocode} +% \end{macro} +% +% \begin{macro}{\line} +% \begin{macrocode} +\gdef\line(#1,#2)#3{\@xarg #1\relax \@yarg #2\relax + \@linelen #3\unitlength + \ifdim\@linelen<\z@\@badlinearg\else + \ifnum\@xarg =\z@ \@vline + \else \ifnum\@yarg =\z@ \@hline \else \@sline\fi + \fi + \fi} +% \end{macrocode} +% \end{macro} +% +% \begin{macro}{\@sline} +% \begin{macrocode} +\gdef\@sline{% + \ifnum\@xarg<\z@ \@negargtrue \@xarg -\@xarg \@yyarg -\@yarg + \else \@negargfalse \@yyarg \@yarg \fi +\ifnum \@yyarg >\z@ \@tempcnta\@yyarg \else \@tempcnta -\@yyarg \fi +\ifnum\@tempcnta>6 \@badlinearg\@tempcnta\z@ \fi +\ifnum\@xarg>6 \@badlinearg\@xarg \@ne \fi +\setbox\@linechar\hbox{\@linefnt\@getlinechar(\@xarg,\@yyarg)}% +% \end{macrocode} +% If we have something like |\line(5,5){30}| the |\@linechar| will +% not contain a char and later on we will end in an infinite loop. +% So we check the width of the box and put in something as an +% emergency fix if necessary. +% \changes{v1.1k}{2003/08/27}{check for \cs{@linechar} being empty pr/3570} +% \begin{macrocode} +\ifdim\wd\@linechar=\z@ + \setbox\@linechar\hbox{.}% + \@badlinearg +\fi +\ifnum \@yarg >\z@ \let\@upordown\raise \@clnht\z@ + \else\let\@upordown\lower \@clnht \ht\@linechar\fi +\@clnwd \wd\@linechar +\if@negarg + \hskip -\wd\@linechar \def\reserved@a{\hskip -2\wd\@linechar}% +\else + \let\reserved@a\relax +\fi +\@whiledim \@clnwd <\@linelen \do + {\@upordown\@clnht\copy\@linechar + \reserved@a + \advance\@clnht \ht\@linechar + \advance\@clnwd \wd\@linechar}% +\advance\@clnht -\ht\@linechar +\advance\@clnwd -\wd\@linechar +\@tempdima\@linelen\advance\@tempdima -\@clnwd +\@tempdimb\@tempdima\advance\@tempdimb -\wd\@linechar +\if@negarg \hskip -\@tempdimb \else \hskip \@tempdimb \fi +\multiply\@tempdima \@m +\@tempcnta \@tempdima +\@tempdima \wd\@linechar \divide\@tempcnta \@tempdima +\@tempdima \ht\@linechar \multiply\@tempdima \@tempcnta +\divide\@tempdima \@m +\advance\@clnht \@tempdima +\ifdim \@linelen <\wd\@linechar + \hskip \wd\@linechar +% \end{macrocode} +% Warn if line gets so short that it can't be printed. +% \changes{v1.1g}{1997/09/15}{Warn if lines become invisible pr/2524} +% But don't warn if it is exactly zero since that was probably +% deliberate (e.g., to get a vector head only). +% \changes{v1.1j}{2001/06/04}{Don't warn for exactly zero pr/3318} +% \begin{macrocode} + \ifdim \@linelen = \z@ + \else + \@picture@warn + \fi + \else\@upordown\@clnht\copy\@linechar\fi} +% \end{macrocode} +% \end{macro} +% +% \begin{macro}{\@hline} +% \begin{macrocode} +\gdef\@hline{\ifnum \@xarg <\z@ \hskip -\@linelen \fi +\vrule \@height \@halfwidth \@depth \@halfwidth \@width \@linelen +\ifnum \@xarg <\z@ \hskip -\@linelen \fi} +% \end{macrocode} +% \end{macro} +% +% \begin{macro}{\getlinechar} +% \begin{macrocode} +\gdef\@getlinechar(#1,#2){\@tempcnta#1\relax\multiply\@tempcnta 8% + \advance\@tempcnta -9\ifnum #2>\z@ \advance\@tempcnta #2\relax\else + \advance\@tempcnta -#2\relax\advance\@tempcnta 64 \fi + \char\@tempcnta} +% \end{macrocode} +% \end{macro} +% +% \begin{macro}{\vector} +% \begin{macrocode} +\gdef\vector(#1,#2)#3{\@xarg #1\relax \@yarg #2\relax + \@tempcnta \ifnum\@xarg<\z@ -\@xarg\else\@xarg\fi + \ifnum\@tempcnta<5\relax + \@linelen #3\unitlength + \ifdim\@linelen<\z@\@badlinearg\else + \ifnum\@xarg =\z@ \@vvector + \else \ifnum\@yarg =\z@ \@hvector \else \@svector\fi + \fi + \fi + \else\@badlinearg\fi} +% \end{macrocode} +% \end{macro} +% +% \begin{macro}{\@hvector} +% \begin{macrocode} +\gdef\@hvector{\@hline\hb@xt@\z@{\@linefnt + \ifnum \@xarg <\z@ \@getlarrow(1,0)\hss\else + \hss\@getrarrow(1,0)\fi}} +% \end{macrocode} +% \end{macro} +% +% \begin{macro}{\@vvector} +% \begin{macrocode} +\gdef\@vvector{\ifnum \@yarg <\z@ \@downvector \else \@upvector \fi} +% \end{macrocode} +% \end{macro} +% +% \begin{macro}{\@svector} +% \begin{macrocode} +\gdef\@svector{\@sline + \@tempcnta\@yarg \ifnum\@tempcnta <\z@ \@tempcnta -\@tempcnta\fi + \ifnum\@tempcnta <5% + \hskip -\wd\@linechar + \@upordown\@clnht \hbox{\@linefnt \if@negarg + \@getlarrow(\@xarg,\@yyarg)\else \@getrarrow(\@xarg,\@yyarg)\fi}% + \else\@badlinearg\fi} +% \end{macrocode} +% \end{macro} +% +% \begin{macro}{\@getlarrow} +% \changes{v1.1h}{1999/04/15}{Replaced octal number, CAR} +% \begin{macrocode} +\gdef\@getlarrow(#1,#2){\ifnum #2=\z@ \@tempcnta 27 % '33 + \else + \@tempcnta #1\relax\multiply\@tempcnta \sixt@@n + \advance\@tempcnta -9 \@tempcntb #2\relax\multiply\@tempcntb \tw@ + \ifnum \@tempcntb >\z@ \advance\@tempcnta \@tempcntb + \else\advance\@tempcnta -\@tempcntb\advance\@tempcnta 64 + \fi\fi\char\@tempcnta} +% \end{macrocode} +% \end{macro} +% +% \changes{v1.1h}{1999/04/15}{Replaced octal number, CAR} +% \begin{macro}{\@getrarrow} +% \begin{macrocode} +\gdef\@getrarrow(#1,#2){\@tempcntb #2\relax +\ifnum\@tempcntb <\z@ \@tempcntb -\@tempcntb\relax\fi +\ifcase \@tempcntb\relax \@tempcnta 45 % '55 +\or +\ifnum #1<\thr@@ \@tempcnta #1\relax\multiply\@tempcnta +24\advance\@tempcnta -6 \else \ifnum #1=\thr@@ \@tempcnta 49 +\else\@tempcnta 58 \fi\fi\or +\ifnum #1<\thr@@ \@tempcnta=#1\relax\multiply\@tempcnta +24\advance\@tempcnta -\thr@@ \else \@tempcnta 51 \fi\or +\@tempcnta #1\relax\multiply\@tempcnta +\sixt@@n \advance\@tempcnta -\tw@ \else +\@tempcnta #1\relax\multiply\@tempcnta +\sixt@@n \advance\@tempcnta 7 \fi\ifnum #2<\z@ \advance\@tempcnta 64 \fi +\char\@tempcnta} +% \end{macrocode} +% \end{macro} +% +% \begin{macro}{\@vline} +% \begin{macrocode} +\gdef\@vline{\ifnum \@yarg <\z@ \@downline \else \@upline\fi} +% \end{macrocode} +% \end{macro} +% +% \begin{macro}{\@upline} +% \begin{macrocode} +\gdef\@upline{% + \hb@xt@\z@{\hskip -\@halfwidth \vrule \@width \@wholewidth + \@height \@linelen \@depth \z@\hss}} +% \end{macrocode} +% \end{macro} +% +% \begin{macro}{\@downline} +% \begin{macrocode} +\gdef\@downline{% + \hb@xt@\z@{\hskip -\@halfwidth \vrule \@width \@wholewidth + \@height \z@ \@depth \@linelen \hss}} +% \end{macrocode} +% \end{macro} +% +% \begin{macro}{\@upvector} +% \changes{v1.1h}{1999/04/15}{Replaced octal number, CAR} +% \changes{v1.1i}{2000/01/15}{Removed space at end-of-line, CAR} +% \begin{macrocode} +\gdef\@upvector{\@upline\setbox\@tempboxa\hbox{\@linefnt\char 54}% % '66 + \raise \@linelen \hb@xt@\z@{\lower \ht\@tempboxa\box\@tempboxa\hss}} +% \end{macrocode} +% \end{macro} +% +% \changes{v1.1h}{1999/04/15}{Replaced octal number, CAR} +% \begin{macro}{\@downvector} +% \begin{macrocode} +\gdef\@downvector{\@downline\lower \@linelen + \hb@xt@\z@{\@linefnt\char 63 % '77 + \hss}} +% \end{macrocode} +% \end{macro} +% +% \begin{oldcomments} +% \dashbox{D}(X,Y) == +% BEGIN +% leave vertical mode +% \hb@xt@ 0pt { +% \baselineskip := 0pt +% \lineskip := 0pt +% %% HORIZONTAL DASHES +% \@dashdim := X * \unitlength +% \@dashcnt := \@dashdim + 200 % to prevent roundoff error +% \@dashdim := D * \unitlength +% \@dashcnt := \@dashcnt / \@dashdim +% if \@dashcnt is odd +% then \@dashdim := 0pt +% \@dashcnt := (\@dashcnt + 1) / 2 +% else \@dashdim := \@dashdim / 2 +% \@dashcnt := \@dashcnt / 2 - 1 +% \box\@dashbox := \hbox{\vrule height \@halfwidth +% depth \@halfwidth width \@dashdim} +% \put(0,0){\copy\@dashbox} +% \put(0,Y){\copy\@dashbox} +% \put(X,0){\hskip -\@dashdim\copy\@dashbox} +% \put(X,Y){\hskip -\@dashdim\box\@dashbox} +% \@dashdim := 3 * \@dashdim +% fi +% \box\@dashbox := \hbox{\vrule height \@halfwidth +% depth \@halfwidth width D * \unitlength +% \hskip D * \unitlength} +% \@tempcnta := 0 +% \put(0,0){\hskip \@dashdim +% while \@tempcnta < \@dascnt +% do \copy\@dashbox +% \@tempcnta := \@tempcnta + 1 +% od +% } +% \@tempcnta := 0 +% put(0,Y){\hskip \@dashdim +% while \@tempcnta < \@dascnt +% do \copy\@dashbox +% \@tempcnta := \@tempcnta + 1 +% od +% } +% +% %% vertical dashes +% \@dashdim := Y * \unitlength +% \@dashcnt := \@dashdim + 200 % to prevent roundoff error +% \@dashdim := D * \unitlength +% \@dashcnt := \@dashcnt / \@dashdim +% if \@dashcnt is odd +% then \@dashdim := 0pt +% \@dashcnt := (\@dashcnt + 1) / 2 +% else \@dashdim := \@dashdim / 2 +% \@dashcnt := \@dashcnt / 2 - 1 +% \box\@dashbox := \hbox{\hskip -\@halfwidth +% \vrule width \@wholewidth +% height \@dashdim } +% \put(0,0){\copy\@dashbox} +% \put(X,0){\copy\@dashbox} +% \put(0,Y){\lower\@dashdim\copy\@dashbox} +% \put(X,Y){\lower\@dashdim\copy\@dashbox} +% \@dashdim := 3 * \@dashdim +% fi +% \box\@dashbox := \hbox{\vrule width \@wholewidth +% height D * \unitlength } +% \@tempcnta := 0 +% put(0,0){\hskip -\halfwidth +% \vbox{while \@tempcnta < \@dashcnt +% do \vskip D*\unitlength +% \copy\@dashbox +% \@tempcnta := \@tempcnta + 1 +% od +% \vskip \@dashdim +% } } +% \@tempcnta := 0 +% put(X,0){\hskip -\halfwidth +% \vbox{while \@tempcnta < \@dashcnt +% do \vskip D*\unitlength +% \copy\@dashbox +% \@tempcnta := \@tempcnta + 1 +% od +% \vskip \@dashdim +% } +% } +% } % END DASHES +% +% \@imakepicbox(X,Y) +% END +% \end{oldcomments} +% +% \begin{macro}{\dashbox} +% \begin{macrocode} +\gdef\dashbox#1(#2,#3){\leavevmode\hb@xt@\z@{\baselineskip \z@skip +\lineskip \z@skip +\@dashdim #2\unitlength +\@dashcnt \@dashdim \advance\@dashcnt 200 +\@dashdim #1\unitlength\divide\@dashcnt \@dashdim +\ifodd\@dashcnt\@dashdim \z@ +\advance\@dashcnt \@ne \divide\@dashcnt \tw@ +\else \divide\@dashdim \tw@ \divide\@dashcnt \tw@ +\advance\@dashcnt \m@ne +\setbox\@dashbox \hbox{\vrule \@height \@halfwidth \@depth \@halfwidth +\@width \@dashdim}\put(0,0){\copy\@dashbox}% +\put(0,#3){\copy\@dashbox}% +\put(#2,0){\hskip-\@dashdim\copy\@dashbox}% +\put(#2,#3){\hskip-\@dashdim\box\@dashbox}% +\multiply\@dashdim \thr@@ +\fi +\setbox\@dashbox \hbox{\vrule \@height \@halfwidth \@depth \@halfwidth +\@width #1\unitlength\hskip #1\unitlength}\@tempcnta\z@ +\put(0,0){\hskip\@dashdim \@whilenum \@tempcnta <\@dashcnt +\do{\copy\@dashbox\advance\@tempcnta \@ne }}\@tempcnta\z@ +\put(0,#3){\hskip\@dashdim \@whilenum \@tempcnta <\@dashcnt +\do{\copy\@dashbox\advance\@tempcnta \@ne }}% +\@dashdim #3\unitlength +\@dashcnt \@dashdim \advance\@dashcnt 200 +\@dashdim #1\unitlength\divide\@dashcnt \@dashdim +\ifodd\@dashcnt \@dashdim \z@ +\advance\@dashcnt \@ne \divide\@dashcnt \tw@ +\else +\divide\@dashdim \tw@ \divide\@dashcnt \tw@ +\advance\@dashcnt \m@ne +\setbox\@dashbox\hbox{\hskip -\@halfwidth +\vrule \@width \@wholewidth +\@height \@dashdim}\put(0,0){\copy\@dashbox}% +\put(#2,0){\copy\@dashbox}% +\put(0,#3){\lower\@dashdim\copy\@dashbox}% +\put(#2,#3){\lower\@dashdim\copy\@dashbox}% +\multiply\@dashdim \thr@@ +\fi +\setbox\@dashbox\hbox{\vrule \@width \@wholewidth +\@height #1\unitlength}\@tempcnta\z@ +\put(0,0){\hskip -\@halfwidth \vbox{\@whilenum \@tempcnta <\@dashcnt +\do{\vskip #1\unitlength\copy\@dashbox\advance\@tempcnta \@ne }% +\vskip\@dashdim}}\@tempcnta\z@ +\put(#2,0){\hskip -\@halfwidth \vbox{\@whilenum \@tempcnta<\@dashcnt +\do{\vskip #1\unitlength\copy\@dashbox\advance\@tempcnta \@ne }% +\vskip\@dashdim}}}\@makepicbox(#2,#3)} +% \end{macrocode} +% \end{macro} +% +% \begin{oldcomments} +% CIRCLES AND OVALS +% +% USER COMMANDS: +% +% \circle{D} : Produces the circle with the diameter as close as +% possible to D * \unitlength. \put(X,Y){\circle{D}} +% puts the circle with its center at (X,Y). +% +% \oval(X,Y) : Makes an oval as round as possible that fits in the +% rectangle of width X * \unitlength and height +% Y * \unitlength. The reference point is the center. +% +% \oval(X,Y)[POS] : Save as \oval(X,Y) except it draws only the +% half or quadrant of the oval indicated by POS. +% E.G., \oval(X,Y)[t] draws just the top half +% and \oval(X,Y)[br] draws just the bottom right +% quadrant. In all cases, the reference point is +% the same as the unqualified \oval(X,Y) command. +% +% \@ovvert {DELTA1} {DELTA2} : Makes a vbox containing either the left +% side or the right side of the oval being constructed. The baseline +% will coincide with the outside bottom edge of the oval; the left +% side of the box will coincide with the left edge of the vertical +% rule. The width of the box will be \@tempdima. +% DELTA1 and DELTA2 are added to the character number in \@tempcnta +% to get the characters for the top and bottom quarter circle pieces. +% +% \@ovhorz : Makes an hbox containing the straight rule for either the +% top or the bottom of the oval being constructed. The baseline +% will coincide with bottom edge of the rule; the left side of +% the box will coincide with the left side of the oval. +% The width of the box will be \@ovxx. +% +% \@getcirc {DIAM} : Sets \@tempcnta to the character number +% of the top-right quarter circle with the largest +% diameter less than or equal to DIAM. +% Sets \@tempboxa to an hbox containing that character. +% Sets \@tempdima to \wd \@tempboxa, which is the distance +% from the circle's left outside edge to its right +% inside edge. +% (These characters are like those described in the +% TeXbook, pp. 389-90.) +% +% \@getcirc {DIAM} == +% BEGIN +% \@tempcnta := integer coercion of (DIAM + 2pt) +% + 2pt added 1 Nov 88 +% \@tempcnta := \@tempcnta / integer coercion of 4pt +% if \@tempcnta > 10 +% then \@tempcnta := 10 fi +% if \@tempcnta > 0 +% then \@tempcnta := \@tempcnta-1 +% else LaTeX Warning: Oval too small. +% fi +% \@tempcnta := 4 * \@tempcnta +% \@tempboxa := \hbox{\@circlefnt \char \@tempcnta} +% \@tempdima := \wd \@tempboxa +% END +% +% \@put{X}{Y}{OBJ} == +% BEGIN +% \raise Y \hb@xt@ 0pt{\hskip X OBJ \hss} +% END +% +% \@oval(X,Y)[POS] == +% BEGIN +% \begingroup +% \boxmaxdepth := \maxdimen +% @ovt := @ovb := @ovl := @ovr := true +% for all E in POS +% do @ovE := false od +% \@ovxx := X * \unitlength +% \@ovyy := Y * \unitlength +% \@tempdimb := min(\@ovxx,\@ovyy) +% \@getcirc{\@tempdimb-2pt} %% "-2pt" added 7 Dec 89 +% \@ovro := \ht \@tempboxa +% \@ovri := \dp \@tempboxa +% \@ovdx := \@ovxx - \@tempdima +% \@ovdx := \@ovdx/2 +% \@ovdy := \@ovyy - \@tempdima +% \@ovdy := \@ovyy/2 +% \@circlefnt +% \@tempboxa := +% \hbox{ +% if @ovr +% then \@ovvert{3}{2} \kern -\@tempdima +% fi +% if @ovl +% then \kern \@ovxx \@ovvert{0}{1} \kern -\@tempdima +% \kern -\@ovxx +% fi +% if @ovt +% then \@ovhorz \kern -\@ovxx +% fi +% if @ovb +% then \raise \@ovyy \@ovhorz +% fi +% } +% \@ovdx := \@ovdx + \@ovro +% \@ovdy := \@ovdy + \@ovro +% \ht\@tempboxa := \dp\@tempboxa := 0 +% \@put{-\@ovdx}{-\@ovdy}{\box\@tempboxa} +% \endgroup +% END +% +% \@ovvert {DELTA1} {DELTA2} == +% BEGIN +% \vbox to \@ovyy { +% if @ovb +% then \@tempcntb := \@tempcnta + DELTA1 +% \kern -\@ovro +% \hbox { \char \@tempcntb } +% \nointerlineskip +% else \kern \@ovri \kern \@ovdy +% fi +% \leaders \vrule width \@wholewidth \vfil +% \nointerlineskip +% if @ovt +% then \@tempcntb := \@tempcnta + DELTA2 +% \hbox { \char \@tempcntb } +% else \kern \@ovdy \kern \@ovro +% fi +% } +% END +% +% \@ovhorz == +% BEGIN +% \hb@xt@ \@ovxx{ +% \kern \@ovro +% if @ovr +% then +% else \kern \@ovdx +% fi +% \leaders \hrule height \@wholewidth \hfil +% if @ovl +% then +% else \kern \@ovdx +% fi +% \kern \@ovri +% } +% END +% +% \circle{DIAM} == +% BEGIN +% \begingroup +% \boxmaxdepth := maxdimen +% \@tempdimb := DIAM *\unitlength +% if \@tempdimb > 15.5pt +% then \@getcirc{\@tempdimb} +% \@ovro := \ht \@tempboxa +% \@tempboxa := \hbox{ +% \@circlefnt +% \@tempcnta := \@tempcnta + 2 +% \char \@tempcnta +% \@tempcnta := \@tempcnta - 1 +% \char \@tempcnta +% \kern -2\@tempdima +% \@tempcnta := \@tempcnta + 2 +% \raise \@tempdima \hbox { \char \@tempcnta } +% \raise \@tempdima \box\@tempboxa +% } +% \ht\@tempboxa := \dp\@tempboxa := 0 +% \@put{-\@ovro}{-\@ovro}{\@tempboxa} +% else +% \@circ{\@tempdimb}{96} +% fi +% \endgroup +% END +% +% \circle*{DIAM} == \@dot{DIAM} == \@circ{DIAM*\unitlength}{112} +% +% \@circ{DIAM}{CHAR} == +% BEGIN +% \@tempcnta := integer coercion of (DIAM + .5pt)/1pt. +% if \@tempcnta > 15 then \@tempcnta := 15 fi +% if \@tempcnta > 1 then \@tempcnta := \@tempcnta - 1 fi +% \@tempcnta := \@tempcnta + CHAR +% \@circlefnt +% \char \@tempcnta +% END +% \end{oldcomments} +% +% +% \begin{macro}{\if@ovt} +% \begin{macro}{\if@ovb} +% \begin{macro}{\if@ovl} +% \begin{macro}{\if@ovr} +% If producing the Top Bottom Left or Right of an oval. +% \begin{macrocode} +\newif\if@ovt +\newif\if@ovb +\newif\if@ovl +\newif\if@ovr +% \end{macrocode} +% \end{macro} +% \end{macro} +% \end{macro} +% \end{macro} +% +% \begin{macrocode} +% +%<*2ekernel|autoload> +% \end{macrocode} +% +% \begin{macro}{\@ovxx} +% \begin{macro}{\@ovyy} +% \begin{macro}{\@ovdx} +% \begin{macro}{\@ovdy} +% \begin{macro}{\@ovro} +% \begin{macro}{\@ovri} +% \begin{macrocode} +\newdimen\@ovxx +\newdimen\@ovyy +\newdimen\@ovdx +\newdimen\@ovdy +\newdimen\@ovro +\newdimen\@ovri +% \end{macrocode} +% \end{macro} +% \end{macro} +% \end{macro} +% \end{macro} +% \end{macro} +% \end{macro} +% +% \begin{macrocode} +% +% \end{macrocode} +% +% |\advance\@tempdima 2pt\relax| added 1 Nov 88 to fix bug in which +% size of drawn circle not monotonic function of argument of |\circle|, +% caused by different rounding for dimensions of large and small +% circles. +% +% \begin{macrocode} +%<*2ekernel|def> +% \end{macrocode} +% +% \begin{macro}{\@getcirc} +% \changes{v1.1j}{2003/12/30}{issue warning if circle size can't be met pr/3473} +% \begin{macrocode} +\gdef\@getcirc#1{\@tempdima #1\relax \advance\@tempdima 2\p@ + \@tempcnta\@tempdima + \@tempdima 4\p@ \divide\@tempcnta\@tempdima + \ifnum \@tempcnta >10\relax + \@picture@warn + \@tempcnta 10\relax + \fi + \ifnum \@tempcnta >\z@ \advance\@tempcnta\m@ne +% \end{macrocode} +% Warn if requirements for oval or circle can't be met. +% \changes{v1.1g}{1997/09/15}{Warn if lines become invisible pr/2524} +% \begin{macrocode} + \else \@picture@warn \fi + \multiply\@tempcnta 4\relax + \setbox \@tempboxa \hbox{\@circlefnt + \char \@tempcnta}\@tempdima \wd \@tempboxa} +% \end{macrocode} +% \end{macro} +% +% \begin{macro}{\@picture@warn} +% Generic warning for lines, vectors (used in |\@sline|) and +% oval or circle (used un |\@getcirc|) are not available at +% right size. +% \changes{v1.1g}{1997/09/15}{Macro added pr/2524} +% \begin{macrocode} +\def\@picture@warn{\@latex@warning{% + \string\oval, \string\circle, or \string\line\space + size unavailable}} +% \end{macrocode} +% \end{macro} +% +% \begin{macro}{\@put} +% \begin{macrocode} +\gdef\@put#1#2#3{\raise #2\hb@xt@\z@{\hskip #1#3\hss}} +% \end{macrocode} +% \end{macro} +% +% \begin{macro}{\oval} +% \begin{macrocode} +\gdef\oval(#1,#2){\@ifnextchar[{\@oval(#1,#2)}{\@oval(#1,#2)[]}} +% \end{macrocode} +% \end{macro} +% +% \begin{macro}{\@oval} +% \begin{macrocode} +\gdef\@oval(#1,#2)[#3]{\begingroup\boxmaxdepth \maxdimen + \@ovttrue \@ovbtrue \@ovltrue \@ovrtrue + \@tfor\reserved@a :=#3\do{\csname @ov\reserved@a false\endcsname}% + \@ovxx + #1\unitlength \@ovyy #2\unitlength + \@tempdimb \ifdim \@ovyy >\@ovxx \@ovxx\else \@ovyy \fi + \advance \@tempdimb -2\p@ + \@getcirc \@tempdimb + \@ovro \ht\@tempboxa \@ovri \dp\@tempboxa + \@ovdx\@ovxx \advance\@ovdx -\@tempdima \divide\@ovdx \tw@ + \@ovdy\@ovyy \advance\@ovdy -\@tempdima \divide\@ovdy \tw@ + \@circlefnt \setbox\@tempboxa + \hbox{\if@ovr \@ovvert32\kern -\@tempdima \fi + \if@ovl \kern \@ovxx \@ovvert01\kern -\@tempdima \kern -\@ovxx \fi + \if@ovt \@ovhorz \kern -\@ovxx \fi + \if@ovb \raise \@ovyy \@ovhorz \fi}\advance\@ovdx\@ovro + \advance\@ovdy\@ovro \ht\@tempboxa\z@ \dp\@tempboxa\z@ + \@put{-\@ovdx}{-\@ovdy}{\box\@tempboxa}% + \endgroup} +% \end{macrocode} +% \end{macro} +% +% \begin{macro}{\@ovvert} +% \begin{macrocode} +\gdef\@ovvert#1#2{\vbox to\@ovyy{% + \if@ovb \@tempcntb \@tempcnta \advance \@tempcntb #1\relax + \kern -\@ovro \hbox{\char \@tempcntb}\nointerlineskip + \else \kern \@ovri \kern \@ovdy \fi + \leaders\vrule \@width \@wholewidth\vfil \nointerlineskip + \if@ovt \@tempcntb \@tempcnta \advance \@tempcntb #2\relax + \hbox{\char \@tempcntb}% + \else \kern \@ovdy \kern \@ovro \fi}} +% \end{macrocode} +% \end{macro} +% +% \begin{macro}{\@ovhorz} +% \begin{macrocode} +\gdef\@ovhorz{\hb@xt@\@ovxx{\kern \@ovro + \if@ovr \else \kern \@ovdx \fi + \leaders \hrule \@height \@wholewidth \hfil + \if@ovl \else \kern \@ovdx \fi + \kern \@ovri}} +% \end{macrocode} +% \end{macro} +% +% \begin{macro}{\circle} +% \changes{LaTeX2.09}{1993/08/05} +% {(RMS) Added error message if \cs{circle} is used in math mode.} +% \begin{macrocode} +\gdef\circle{\@inmatherr\circle\@ifstar\@dot\@circle} +% \end{macrocode} +% \end{macro} +% +% \begin{macro}{\@circle} +% \begin{macrocode} +\gdef\@circle#1{% + \begingroup \boxmaxdepth \maxdimen \@tempdimb #1\unitlength + \ifdim \@tempdimb >15.5\p@ \@getcirc\@tempdimb + \@ovro\ht\@tempboxa + \setbox\@tempboxa\hbox{\@circlefnt + \advance\@tempcnta\tw@ \char \@tempcnta + \advance\@tempcnta\m@ne \char \@tempcnta \kern -2\@tempdima + \advance\@tempcnta\tw@ + \raise \@tempdima \hbox{\char\@tempcnta}\raise \@tempdima + \box\@tempboxa}\ht\@tempboxa\z@ \dp\@tempboxa\z@ + \@put{-\@ovro}{-\@ovro}{\box\@tempboxa}% + \else \@circ\@tempdimb{96}\fi\endgroup} +% \end{macrocode} +% \end{macro} +% +% \begin{macro}{\@dot} +% Internal form of |\circle*|. +% \begin{macrocode} +\gdef\@dot#1{\@tempdimb #1\unitlength \@circ\@tempdimb{112}} +% \end{macrocode} +% \end{macro} +% +% \begin{macro}{\@circ} +% \begin{macrocode} +\gdef\@circ#1#2{\@tempdima #1\relax \advance\@tempdima .5\p@ + \@tempcnta\@tempdima \@tempdima \p@ + \divide\@tempcnta\@tempdima + \ifnum\@tempcnta >15\relax \@tempcnta 15\relax \fi + \ifnum \@tempcnta >\z@ \advance\@tempcnta\m@ne\fi + \advance\@tempcnta #2\relax + \@circlefnt \char\@tempcnta} +% \end{macrocode} +% \end{macro} +% +% \begin{macrocode} +% +% \end{macrocode} +% +% \begin{macrocode} +%<*2ekernel|autoload> +% \end{macrocode} +% +% \begin{macro}{\@xarg} +% \begin{macro}{\@yarg} +% \begin{macro}{\@yyarg} +% Counters used for manipulating the `slope' arguments. +% \begin{macrocode} +\newcount\@xarg +\newcount\@yarg +\newcount\@yyarg +% \end{macrocode} +% \end{macro} +% \end{macro} +% \end{macro} +% +% \begin{macro}{\@multicnt} +% Counter used in |\multiput|, and also |\multicolumn|. +% \begin{macrocode} +\newcount\@multicnt +% \end{macrocode} +% \end{macro} +% +% \begin{macro}{\@xdim} +% \begin{macro}{\yxdim} +% Length registers. +% \begin{macrocode} +\newdimen\@xdim +\newdimen\@ydim +% \end{macrocode} +% \end{macro} +% \end{macro} +% +% \begin{macro}{\@linechar} +% Box for holding a line segment character, for sloping lines. +% \begin{macrocode} +\newbox\@linechar +% \end{macrocode} +% \end{macro} +% +% \begin{macro}{\@linelen} +% Length of the line currently being built. +% \begin{macrocode} +\newdimen\@linelen +% \end{macrocode} +% \end{macro} +% +% \begin{macro}{\@clnwd} +% \begin{macro}{\@clnht} +% Height and width of current line segment. +% \begin{macrocode} +\newdimen\@clnwd +\newdimen\@clnht +% \end{macrocode} +% \end{macro} +% \end{macro} +% +% \begin{macro}{\@dashdim} +% \begin{macro}{\@dashbox} +% \begin{macro}{\@dashcnt} +% |\dashbox| internal registers. +% \begin{macrocode} +\newdimen\@dashdim +\newbox\@dashbox +\newcount\@dashcnt +% \end{macrocode} +% \end{macro} +% \end{macro} +% \end{macro} +% +% Initialization: ``|\thinlines|'' +% \changes{v1.1f}{1995/10/27} +% {Move initialisation to kernel from autoload file} +% \begin{macrocode} +\let\@linefnt\tenln +\let\@circlefnt\tencirc +\@wholewidth\fontdimen8\tenln +\@halfwidth .5\@wholewidth +% \end{macrocode} +% +% \begin{macrocode} +% +% \end{macrocode} +% +% +% \subsection{Curves} +% The new |\qbezier| command, based on the old |\bezier| defined in +% |bezier.sty|. +% \changes{v0.1c}{1994/04/28}{bezier curves added} +% +% \begin{oldcomments} +% +% \qbezier[N] == \bezier{N} +% +% \bezier{N}(AX,AY)(BX,BY)(CX,CY) == +% BEGIN +% IF N = 0 +% THEN \@xdima := |BX - AX| +% \@xb := |CX - BX| +% \@xa := Max(\@xa, \@xb) +% \@ya := |BY - AY| +% \@yb := |CY - BY| +% \@ya := Max(\@ya, \@yb) +% @sc := Max(\@xa, \@ya) +% %% The coefficient .5 below is the degree of overlap of +% %% successive points, where 1 is no overlap and 0 is +% %% complete overlap. A coefficient of C multiplies +% %% the number of points plotted by 1/C. +% %% +% \@xa := .5 * \@halfwidth +% @sc := @sc / \@halfwidth +% @sc := Max(@sc, qbeziermax) +% ELSE @sc := N +% @scp := @sc+1 +% \@xb := 2 * (BX - AX) * \unitlength +% \@xa := ((CX-AX)*\unitlength - \@xb)/@sc +% \@yb := 2 * (BY - AY) * \unitlength +% \@ya := ((CY-AY)*\unitlength - \@yb)/@sc +% \@pictdot := square rule of width \@wholewidth +% \count@ := 0 +% WHILE \count@ < @scp +% DO \@xdim := ((\count@*\@xa + @xb) / @sc) * \count@ +% \@ydim := ((\count@*\@ya + @yb) / @sc) * \count@ +% plot pt with relative coords (\@xdim,\@ydim) +% \count@ := \count@+1 +% OD +% +% \end{oldcomments} +% +% \begin{macro}{\qbeziermax} +% The maximum number of points to plot. +% \begin{macrocode} +%<*2ekernel|def> +%\ifx\qbeziermax\@undefined +\gdef\qbeziermax{500} +%\fi +% \end{macrocode} +% \end{macro} +% +% +% In the code below, to save registers |\@a| \ldots\ are not used. +% Instead other registers are reused. +% +% |\newcounter{@sc} -> \c@multicnt|\par +% |\newcounter{@scp} -> \@tempcnta|\par +% |\newdimen\@xa -> \@ovxx|\par +% +% |\newdimen\@xb -> \@ovdx| +% +% |\newdimen\@ya -> \@ovyy|\par +% |\newdimen\@yb -> \@ovdy| +% +% |\newsavebox{\@pictdot} -> \@tempboxa| +% +% \begin{macro}{\qbezier} +% Main user-level command to plot quadratic bezier curves. +% |#2| should be |(|. +% \begin{macrocode} +\newcommand\qbezier[2][0]{\bezier{#1}#2} +% \end{macrocode} +% \end{macro} +% +% \begin{macro}{\bezier} +% Form of |\bezier| compatible with 2.09 |bezier.sty|, but modified to +% ignore spaces between its arguments. +% |#2| should be white space, and |#4| should be |(|. +% \begin{macrocode} +\gdef\bezier#1)#2(#3)#4({\@bezier#1)(#3)(} +% \end{macrocode} +% +% \begin{macro}{\@bezier} +% \begin{macrocode} +\gdef\@bezier#1(#2,#3)(#4,#5)(#6,#7){% + \ifnum #1=\z@ + \@ovxx #4\unitlength + \advance\@ovxx -#2\unitlength + \ifdim \@ovxx<\z@ \@ovxx -\@ovxx \fi + \@ovdx #6\unitlength + \advance\@ovdx -#4\unitlength + \ifdim \@ovdx<\z@ \@ovdx -\@ovdx \fi + \ifdim \@ovxx<\@ovdx \@ovxx \@ovdx \fi + \@ovyy #5\unitlength + \advance\@ovyy -#3\unitlength + \ifdim \@ovyy<\z@ \@ovyy -\@ovyy \fi + \@ovdy #7\unitlength + \advance\@ovdy -#5\unitlength + \ifdim \@ovdy<\z@ \@ovdy -\@ovdy \fi + \ifdim \@ovyy<\@ovdy \@ovyy \@ovdy \fi + \@multicnt + \ifdim \@ovxx>\@ovyy \@ovxx \else \@ovyy \fi + \@ovxx .5\@halfwidth \divide\@multicnt\@ovxx + \ifnum \qbeziermax<\@multicnt \@multicnt\qbeziermax\relax \fi + \else \@multicnt#1\relax \fi + \@tempcnta\@multicnt \advance\@tempcnta\@ne + \@ovdx #4\unitlength \advance\@ovdx -#2\unitlength + \multiply\@ovdx \tw@ + \@ovxx #6\unitlength \advance\@ovxx -#2\unitlength + \advance\@ovxx -\@ovdx \divide\@ovxx\@multicnt + \@ovdy #5\unitlength \advance\@ovdy -#3\unitlength + \multiply\@ovdy \tw@ + \@ovyy #7\unitlength \advance\@ovyy -#3\unitlength + \advance\@ovyy -\@ovdy \divide\@ovyy\@multicnt +% \end{macrocode} +% +% \changes{v1.1k}{2003/08/27}{added missing displacement pr/3566} +% \begin{macrocode} + \setbox\@tempboxa\hbox{% + \hskip -\@halfwidth + \vrule \@height\@halfwidth + \@depth \@halfwidth + \@width \@wholewidth}% + \put(#2,#3){% + \count@\z@ + \@whilenum{\count@<\@tempcnta}\do + {\@xdim\count@\@ovxx + \advance\@xdim\@ovdx + \divide\@xdim\@multicnt + \multiply\@xdim\count@ + \@ydim\count@\@ovyy + \advance\@ydim\@ovdy + \divide\@ydim\@multicnt + \multiply\@ydim\count@ + \raise \@ydim + \hb@xt@\z@{\kern\@xdim + \unhcopy\@tempboxa\hss}% + \advance\count@\@ne}}} +% +% \end{macrocode} +% \end{macro} +% \end{macro} +% +% \Finale +% diff --git a/Master/texmf-dist/source/latex/base/ltplain.dtx b/Master/texmf-dist/source/latex/base/ltplain.dtx new file mode 100644 index 00000000000..0b172df540b --- /dev/null +++ b/Master/texmf-dist/source/latex/base/ltplain.dtx @@ -0,0 +1,1112 @@ +% \iffalse meta-comment +% +% Copyright 1993 1994 1995 1996 1997 1998 1999 2000 2001 2002 2003 2004 +% The LaTeX3 Project and any individual authors listed elsewhere +% in this file. +% +% This file is part of the LaTeX base system. +% ------------------------------------------- +% +% It may be distributed and/or modified under the +% conditions of the LaTeX Project Public License, either version 1.3 +% of this license or (at your option) any later version. +% The latest version of this license is in +% http://www.latex-project.org/lppl.txt +% and version 1.3 or later is part of all distributions of LaTeX +% version 2003/12/01 or later. +% +% This file has the LPPL maintenance status "maintained". +% +% The list of all files belonging to the LaTeX base distribution is +% given in the file `manifest.txt'. See also `legal.txt' for additional +% information. +% +% The list of derived (unpacked) files belonging to the distribution +% and covered by LPPL is defined by the unpacking scripts (with +% extension .ins) which are part of the distribution. +% +% \fi +% \iffalse +%%% From File: ltplain.dtx +% +%<*driver> +% \fi +\ProvidesFile{ltplain.dtx} + [2004/02/24 v1.1x LaTeX Kernel (Plain TeX)] +% \iffalse +\documentclass{ltxdoc} +\GetFileInfo{ltplain.dtx} +\begin{document} +\title{\filename\\(The file plain.tex, modified for \LaTeX)} +\author{Donald~E.~Knuth\\ + Modified by + Leslie Lamport, Frank Mittelbach,\\ + Rainer Sch\"opf, David Carlisle} +\date{\filedate} +\maketitle + \DocInput{\filename} +\end{document} +% +% \fi +% +% \CheckSum{756} +% +% \changes{v1.0a}{1994/03/08} +% {Remove need for a driver file.} +% \changes{v1.0b}{1994/03/12} +% {Name changed from lplain. The end of an era} +% \changes{v1.0e}{1994/03/12}{Replaced remaining width, height, depth +% by \LaTeX{} macro names to save tokens.} +% \changes{v1.1a}{1994/10/14} +% {Moved code to other files.} +% \changes{v1.1b}{1994/11/10} +% {(CAR) added patch to \cs{loop}.} +% \changes{v1.1f}{1994/11/25} +% {(DPC) Comment out lots of obsolete code} +% \changes{v1.1g}{1994/12/01} +% {(DPC) More doc changes} +% \changes{v1.1j}{1995/05/07}{Use \cs{hb@xt@}} +% \changes{v1.1j}{1995/05/21}{Moved some code to other files} +% \changes{v1.1n}{1995/07/02}{Removed surplus `by' and `\quotechar=' in +% various places} +% \changes{v1.1o}{1995/09/14}{Moved \cs{multispan} to lttab.dtx} +% \changes{v1.1r}{1995/10/10}{Autoload tracing code} +% \changes{v1.1u}{1996/10/28}{(CAR) More doc changes} +% +% \section{Plain \TeX} +% +% \LaTeX\ includes almost all of the functionality of Knuth's original +% `Basic Macros' That is, the plain \TeX\ format described in Appendix~B +% of the \TeX{}Book. However, some of the user commands are not much +% use so, in order to save memory, we may remove them from the kernel +% into a package. Here is a list of the commands that may be removed +% (PROBABLY NOT COMPLETE). +% \begin{verbatim} +% \magstep \magstephalf +% \mathhexbox +% \vglue \vgl@ +% \hglue \hgl@ +% \end{verbatim} +% +% This file is by now very small as most of it has been moved to more +% appropriate kernel files: it may disappear completely one day. +% +% \LaTeX\ font definitions are done using NFSS2 so none of PLAIN's +% font definitions are in \LaTeX. +% +% \LaTeX\ has its own tabbing environment, so PLAIN's is disabled. +% +% \LaTeX{} uses its own output routine, so most of the plain one was +% removed. +% +% \StopEventually{} +% +% \iffalse +%% \CharacterTable +%% {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 +%% 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 +%% Digits \0\1\2\3\4\5\6\7\8\9 +%% Exclamation \! Double quote \" Hash (number) \# +%% Dollar \$ Percent \% Ampersand \& +%% Acute accent \' Left paren \( Right paren \) +%% Asterisk \* Plus \+ Comma \, +%% Minus \- Point \. Solidus \/ +%% Colon \: Semicolon \; Less than \< +%% Equals \= Greater than \> Question mark \? +%% Commercial at \@ Left bracket \[ Backslash \\ +%% Right bracket \] Circumflex \^ Underscore \_ +%% Grave accent \` Left brace \{ Vertical bar \| +%% Right brace \} Tilde \~} +%% +% \fi +% +% \begin{macrocode} +%<*2ekernel|autoload> +\catcode`\{=1 % left brace is begin-group character +\catcode`\}=2 % right brace is end-group character +\catcode`\$=3 % dollar sign is math shift +\catcode`\&=4 % ampersand is alignment tab +\catcode`\#=6 % hash mark is macro parameter character +\catcode`\^=7 % circumflex and uparrow are for superscripts +\catcode`\_=8 % underline and downarrow are for subscripts +\catcode`\^^I=10 % ascii tab is a blank space +\chardef\active=13 \catcode`\~=\active % tilde is active +\catcode`\^^L=\active \outer\def^^L{\par}% ascii form-feed is \outer\par +% \end{macrocode} +% +% \begin{macrocode} +\message{catcodes,} +% \end{macrocode} +% +% We had to define the |\catcodes| right away, before the message line, +% since |\message| uses the |{| and |}| characters. +% When INITEX (the \TeX\ initializer) starts up, +% it has defined the following |\catcode| values:\\ +% |\catcode`\^^@=9 % | ascii null is ignored\\ +% |\catcode`\^^M=5 % | ascii return is end-line\\ +% |\catcode`\\=0 % | backslash is TeX escape character\\ +% |\catcode`\%=14 % | percent sign is comment character\\ +% |\catcode`\ =10 % | ascii space is blank space\\ +% |\catcode`\^^?=15 %| ascii delete is invalid\\ +% |\catcode`\A=11 ... \catcode`\Z=11 %| uppercase letters\\ +% |\catcode`\a=11 ... \catcode`\z=11 %| lowercase letters\\ +% all others are type 12 (other) +% +% Here is a list of the characters that have been specially catcoded: +% \begin{macrocode} +\def\dospecials{\do\ \do\\\do\{\do\}\do\$\do\&% + \do\#\do\^\do\_\do\%\do\~} +% \end{macrocode} +% (not counting ascii null, tab, linefeed, formfeed, return, delete) +% Each symbol in the list is preceded by \do, which can be defined +% if you want to do something to every item in the list. +% +% We make |@| signs act like letters, temporarily, to avoid conflict +% between user names and internal control sequences of plain format. +% \begin{macrocode} +\catcode`@=11 +% \end{macrocode} +% +% To make the plain macros more efficient in time and space, +% several constant values are declared here as control sequences. +% If they were changed, anything could happen; +% so they are private symbols. +% \begin{macro}{\@ne} +% \begin{macro}{\tw@} +% \begin{macro}{\thr@@} +% \begin{macro}{\sixt@@n} +% \begin{macro}{\@cclv} +% Small constants are defined using |\chardef|. +% \begin{macrocode} +\chardef\@ne=1 +\chardef\tw@=2 +\chardef\thr@@=3 +\chardef\sixt@@n=16 +\chardef\@cclv=255 +% \end{macrocode} +% \end{macro} +% \end{macro} +% \end{macro} +% \end{macro} +% \end{macro} +% +% \begin{macro}{\@cclvi} +% \begin{macro}{\@m} +% \begin{macro}{\@M} +% \begin{macro}{\@MM} +% Constants above 255 defined using |\mathchardef|. +% \begin{macrocode} +\mathchardef\@cclvi=256 +\mathchardef\@m=1000 +\mathchardef\@M=10000 +\mathchardef\@MM=20000 +% \end{macrocode} +% \end{macro} +% \end{macro} +% \end{macro} +% \end{macro} +% +% Allocation of registers +% +% Here are macros for the automatic allocation of |\count|, |\box|, +% |\dimen|, |\skip|, |\muskip|, and |\toks| registers, as well as +% |\read| and |\write| stream numbers, |\fam| codes, |\language| codes, +% and |\insert| numbers. +% +% \begin{macrocode} +\message{registers,} +% \end{macrocode} +% +% When a register is used only temporarily, it need not be allocated; +% grouping can be used, making the value previously in the register +% return after the close of the group. The main use of these macros is +% for registers that are defined by one macro and used by others, +% possibly at different nesting levels. All such registers should be +% defined through these macros; otherwise conflicts may occur, +% especially when two or more macro packages are being used at +% the same time. +% +% \begin{oldcomments} +% The following counters are reserved: +% 0 to 9 page numbering +% 10 count allocation +% 11 dimen allocation +% 12 skip allocation +% 13 muskip allocation +% 14 box allocation +% 15 toks allocation +% 16 read file allocation +% 17 write file allocation +% 18 math family allocation +% 19 language allocation +% 20 insert allocation +% 21 the most recently allocated number +% 22 constant -1 +% \end{oldcomments} +% +% New counters are allocated starting with 23, 24, etc. Other registers +% are allocated starting with 10. This leaves 0 through 9 for the user +% to play with safely, except that counts 0 to 9 are considered to be +% the page and subpage numbers (since they are displayed during +% output). In this scheme, |\count| 10 always contains the number of the +% highest-numbered counter that has been allocated, |\count| 14 the +% highest-numbered box, etc. Inserts are given numbers 254, 253, etc., +% since they require a |\count|, |\dimen|, |\skip|, and |\box| all with +% the same number; |\count| 20 contains the lowest-numbered insert that +% has been allocated. Of course, |\box|255 is reserved for |\output|; +% |\count|255, |\dimen|255, and |\skip|255 can be used freely. +% +% It is recommended that macro designers always use +% |\global| assignments with respect to registers numbered\\ +% 1, 3, 5, 7, 9,\\ +% and always non-|\global| assignments with respect to registers\\ +% 0, 2, 4, 6, 8, 255.\\ +% This will prevent ``save stack buildup'' that might otherwise occur. +% +% \begin{macrocode} +\count10=22 % allocates \count registers 23, 24, ... +\count11=9 % allocates \dimen registers 10, 11, ... +\count12=9 % allocates \skip registers 10, 11, ... +\count13=9 % allocates \muskip registers 10, 11, ... +\count14=9 % allocates \box registers 10, 11, ... +\count15=9 % allocates \toks registers 10, 11, ... +\count16=-1 % allocates input streams 0, 1, ... +\count17=-1 % allocates output streams 0, 1, ... +\count18=3 % allocates math families 4, 5, ... +\count19=0 % allocates \language codes 1, 2, ... +\count20=255 % allocates insertions 254, 253, ... +% \end{macrocode} +% +% \begin{macro}{\insc@unt} +% \begin{macro}{\allocationnumber} +% The insertion counter and most recent allocation. +% \begin{macrocode} +\countdef\insc@unt=20 +\countdef\allocationnumber=21 +% \end{macrocode} +% \end{macro} +% \end{macro} +% +% \begin{macro}{\m@ne} +% The constant $-1$. +% \begin{macrocode} +\countdef\m@ne=22 \m@ne=-1 +% \end{macrocode} +% \end{macro} +% +% \begin{macro}{\wlog} +% Write on log file (only) +% \begin{macrocode} +\def\wlog{\immediate\write\m@ne} +% \end{macrocode} +% \end{macro} +% +% \begin{macro}{\count@} +% \begin{macro}{\dimen@} +% \begin{macro}{\dimen@i} +% \begin{macro}{\dimen@ii} +% \begin{macro}{\skip@} +% \begin{macro}{\toks@} +% Here are abbreviations for the names of scratch registers +% that don't need to be allocated. +% \begin{macrocode} +\countdef\count@=255 +\dimendef\dimen@=0 +\dimendef\dimen@i=1 % global only +\dimendef\dimen@ii=2 +\skipdef\skip@=0 +\toksdef\toks@=0 +% \end{macrocode} +% \end{macro} +% \end{macro} +% \end{macro} +% \end{macro} +% \end{macro} +% \end{macro} +% +% \begin{macro}{\newcount} +% \begin{macro}{\newdimen} +% \begin{macro}{\newskip} +% \begin{macro}{\newmuskip} +% \begin{macro}{\newbox} +% \begin{macro}{\newhelp} +% \begin{macro}{\newtoks} +% \changes{v1.0c}{1994/03/28} +% {Remove some \cs{outer} declarations.} +% \changes{v1.1h}{1995/04/24} +% {Remove remaining \cs{outer} declarations.} +% Now, we define |\newcount|, |\newbox|, etc. so that you can say +% |\newcount\foo| and |\foo| will be defined (with |\countdef|) to +% be the next counter. +% +% To find out which counter |\foo| is, you can look at +% |\allocationnumber|. +% +% Since there's no |\boxdef| command, |\chardef| is used to define a +% |\newbox|, |\newinsert|, |\newfam|, and so on. +% +% \LaTeX\ change: remove |\outer| from |\newcount| and |\newdimen| (FMi) +% This is necessary to use |\newcount| inside |\if...| +% later on. Also remove from |\newskip|, |\newbox| +% |\newwrite| and |\newfam| (DPC) to save later redefinition. +% \begin{macrocode} +\def\newcount{\alloc@0\count\countdef\insc@unt} +\def\newdimen{\alloc@1\dimen\dimendef\insc@unt} +\def\newskip{\alloc@2\skip\skipdef\insc@unt} +\def\newmuskip{\alloc@3\muskip\muskipdef\@cclvi} +\def\newbox{\alloc@4\box\chardef\insc@unt} +\def\newhelp#1#2{\newtoks#1#1\expandafter{\csname#2\endcsname}} +\def\newtoks{\alloc@5\toks\toksdef\@cclvi} +% \end{macrocode} +% \end{macro} +% \end{macro} +% \end{macro} +% \end{macro} +% \end{macro} +% \end{macro} +% \end{macro} +% +% \begin{macro}{\newread} +% \begin{macro}{\newwrite} +% \begin{macrocode} +\def\newread{\alloc@6\read\chardef\sixt@@n} +\def\newwrite{\alloc@7\write\chardef\sixt@@n} +% \end{macrocode} +% \end{macro} +% \end{macro} +% +% \LaTeX\ defines |\newfam| in |ltfss.dtx|. +%\begin{verbatim} +%\def\newfam{\alloc@8\fam\chardef\sixt@@n} +%\end{verbatim} +% +% \begin{macro}{\newlanguage} +% \begin{macrocode} +\def\newlanguage{\alloc@9\language\chardef\@cclvi} +% \end{macrocode} +% \end{macro} +% +% \begin{macro}{\alloc@} +% \begin{macrocode} +\def\alloc@#1#2#3#4#5{\global\advance\count1#1\@ne + \ch@ck#1#4#2% make sure there's still room + \allocationnumber\count1#1% + \global#3#5\allocationnumber + \wlog{\string#5=\string#2\the\allocationnumber}} +% \end{macrocode} +% \end{macro} +% +% \begin{macro}{\newinsert} +% \begin{macrocode} +\def\newinsert#1{\global\advance\insc@unt \m@ne + \ch@ck0\insc@unt\count + \ch@ck1\insc@unt\dimen + \ch@ck2\insc@unt\skip + \ch@ck4\insc@unt\box + \allocationnumber\insc@unt + \global\chardef#1\allocationnumber + \wlog{\string#1=\string\insert\the\allocationnumber}} +% \end{macrocode} +% \end{macro} +% +% \begin{macro}{\ch@ck} +% \begin{macrocode} +% +%<*2ekernel|autoload|autoerr> +\gdef\ch@ck#1#2#3{% + \ifnum\count1#1<#2\else +% \errmessage{No room for a new #3}% +% \@autoerr\ch@ck#1#2#3% + \fi} +% +%<*2ekernel|autoload> +% \end{macrocode} +% \end{macro} +% +% \begin{macro}{\maxdimen} +% \begin{macro}{\hideskip} +% Here are some examples of allocation. +% \begin{macrocode} +\newdimen\maxdimen \maxdimen=16383.99999pt % the largest legal +\newskip\hideskip \hideskip=-1000pt plus 1fill % negative but can grow +% \end{macrocode} +% \end{macro} +% \end{macro} +% +% \begin{macro}{\p@} +% \begin{macro}{\z@} +% \begin{macro}{\z@skip} +% \begin{macro}{\voidb@x} +% \begin{macrocode} +\newdimen\p@ \p@=1pt % this saves macro space and time +\newdimen\z@ \z@=0pt % can be used both for 0pt and 0 +\newskip\z@skip \z@skip=0pt plus0pt minus0pt +\newbox\voidb@x % permanently void box register +% \end{macrocode} +% \end{macro} +% \end{macro} +% \end{macro} +% \end{macro} +% +% \changes{v1.1p}{1995/10/02}{Move \cs{newif} to ltdefns} +% +% \begin{macrocode} +\message{compatibility for TeX 2, } +% \end{macrocode} +% +% If this file is used in an old \TeX\ we define the new features +% of \TeX\ 3.0 as simple macros or counters so that files that uses +% these features can be processed in such an environment +% (They will however produce some other results). +% +% \begin{macrocode} +\ifx\@undefined\inputlineno + \newcount\inputlineno +% \end{macrocode} +% This could be used to detect that an old \TeX\ is in force +% \begin{macrocode} + \inputlineno-1 +% \end{macrocode} +% Extra test for MLTeX 2, RmS 91/11/07. +% \begin{macrocode} + \ifx\@undefined\language + \newcount\language + \fi + \newcount\lefthyphenmin + \newcount\righthyphenmin + \newcount\errorcontextlines + \newcount\holdinginserts + \newdimen\emergencystretch + \newcount\badness + \let\noboundary\relax + \newcount\setlanguage +\fi +% \end{macrocode} +% +% Assign initial values to \TeX's parameters +% +% \begin{macrocode} +\message{parameters,} +% \end{macrocode} +% +% All of \TeX's numeric parameters are listed here, +% but the code is commented out if no special value needs to be set. +% INITEX makes all parameters zero except where noted. +% +% \begin{oldcomments} +% \begin{macrocode} +\pretolerance=100 +\tolerance=200 % INITEX sets this to 10000 +\hbadness=1000 +\vbadness=1000 +\linepenalty=10 +\hyphenpenalty=50 +\exhyphenpenalty=50 +\binoppenalty=700 +\relpenalty=500 +\clubpenalty=150 +\widowpenalty=150 +\displaywidowpenalty=50 +\brokenpenalty=100 +\predisplaypenalty=10000 +% \end{macrocode} +% \postdisplaypenalty=0 +% \interlinepenalty=0 +% \floatingpenalty=0, set during \insert +% \outputpenalty=0, set before TeX enters \output +% \begin{macrocode} +\doublehyphendemerits=10000 +\finalhyphendemerits=5000 +\adjdemerits=10000 +% \end{macrocode} +% \looseness=0, cleared by TeX after each paragraph +% \pausing=0 +% \holdinginserts=0 +% \tracingonline=0 +% \tracingmacros=0 +% \tracingstats=0 +% \tracingparagraphs=0 +% \tracingpages=0 +% \tracingoutput=0 +% \begin{macrocode} +\tracinglostchars=1 +% \end{macrocode} +% \tracingcommands=0 +% \tracingrestores=0 +% \language=0 +% \begin{macrocode} +\uchyph=1 +% \end{macrocode} +% \lefthyphenmin=2 \righthyphenmin=3 set below +% \globaldefs=0 +% \maxdeadcycles=25 % INITEX does this +% \hangafter=1 % INITEX does this, also TeX after each paragraph +% \fam=0 +% \mag=1000 % INITEX does this +% \escapechar=`\\ % INITEX does this +% \begin{macrocode} +\defaulthyphenchar=`\- +\defaultskewchar=-1 +% \end{macrocode} +% \endlinechar=`\^^M % INITEX does this +% \newlinechar=-1 \LaTeX\ sets this in ltdefns.dtx. +% \begin{macrocode} +\delimiterfactor=901 +% \end{macrocode} +% \time=now % TeX does this at beginning of job +% \day=now % TeX does this at beginning of job +% \month=now % TeX does this at beginning of job +% \year=now % TeX does this at beginning of job +% +% \end{oldcomments} +% In \LaTeX{} we don't want box information in the transcript +% unless we do a full tracing. +% \changes{v1.0g}{1994/04/28}{Turn off overfull box tracing in log} +% +% \begin{macrocode} +\showboxbreadth=-1 +\showboxdepth=-1 +\errorcontextlines=-1 +% \end{macrocode} +% +% \begin{macrocode} +\hfuzz=0.1pt +\vfuzz=0.1pt +\overfullrule=5pt +\maxdepth=4pt +\splitmaxdepth=\maxdimen +\boxmaxdepth=\maxdimen +% \end{macrocode} +% +% \begin{oldcomments} +% \lineskiplimit=0pt, changed by \normalbaselines +% \begin{macrocode} +\delimitershortfall=5pt +\nulldelimiterspace=1.2pt +\scriptspace=0.5pt +% \end{macrocode} +% \mathsurround=0pt +% \predisplaysize=0pt, set before TeX enters $$ +% \displaywidth=0pt, set before TeX enters $$ +% \displayindent=0pt, set before TeX enters $$ +% \begin{macrocode} +\parindent=20pt +% \end{macrocode} +% \hangindent=0pt, zeroed by TeX after each paragraph +% \hoffset=0pt +% \voffset=0pt +% +% \baselineskip=0pt, changed by \normalbaselines +% \lineskip=0pt, changed by \normalbaselines +% \begin{macrocode} +\parskip=0pt plus 1pt +\abovedisplayskip=12pt plus 3pt minus 9pt +\abovedisplayshortskip=0pt plus 3pt +\belowdisplayskip=12pt plus 3pt minus 9pt +\belowdisplayshortskip=7pt plus 3pt minus 4pt +% \end{macrocode} +% \leftskip=0pt +% \rightskip=0pt +% \begin{macrocode} +\topskip=10pt +\splittopskip=10pt +% \end{macrocode} +% \tabskip=0pt +% \spaceskip=0pt +% \xspaceskip=0pt +% \begin{macrocode} +\parfillskip=0pt plus 1fil +% \end{macrocode} +% \end{oldcomments} +% +% +% \begin{macro}{\normalbaselineskip} +% \begin{macro}{\normallineskip} +% \begin{macro}{\normallineskiplimit} +% We also define special registers that function like parameters: +% \begin{macrocode} +\newskip\normalbaselineskip \normalbaselineskip=12pt +\newskip\normallineskip \normallineskip=1pt +\newdimen\normallineskiplimit \normallineskiplimit=0pt +% \end{macrocode} +% \end{macro} +% \end{macro} +% \end{macro} +% +% \begin{macro}{\interfootlinepenalty} +% \begin{macrocode} +\newcount\interfootnotelinepenalty \interfootnotelinepenalty=100 +% \end{macrocode} +% \end{macro} +% +% Definitions for preloaded fonts +% +% \begin{macro}{\magstephalf} +% \begin{macro}{\magstep} +% \begin{macrocode} +\def\magstephalf{1095 } +\def\magstep#1{\ifcase#1 \@m\or 1200\or 1440\or 1728\or + 2074\or 2488\fi\relax} +% \end{macrocode} +% \end{macro} +% \end{macro} +% +% +% Macros for setting ordinary text +% +% \begin{macro}{\frenchspacing} +% \begin{macro}{\nonfrenchspacing} +% \begin{macrocode} +\def\frenchspacing{\sfcode`\.\@m \sfcode`\?\@m \sfcode`\!\@m + \sfcode`\:\@m \sfcode`\;\@m \sfcode`\,\@m} +\def\nonfrenchspacing{\sfcode`\.3000\sfcode`\?3000\sfcode`\!3000% + \sfcode`\:2000\sfcode`\;1500\sfcode`\,1250 } +% \end{macrocode} +% \end{macro} +% \end{macro} +% +% \begin{macro}{\normalbaselines} +% \begin{macrocode} +\def\normalbaselines{\lineskip\normallineskip + \baselineskip\normalbaselineskip \lineskiplimit\normallineskiplimit} +% \end{macrocode} +% \end{macro} +% +% \begin{macro}{\M} +% \begin{macro}{\I} +% \changes{v1.1m}{1995/09/01}{Use \cs{let} to save space} +% Save a bit of space by using |\let| here. +% \begin{macrocode} +\def\^^M{\ } % control = control +\let\^^I\^^M % same for +% \end{macrocode} +% \end{macro} +% \end{macro} +% +% \begin{macro}{\lq} +% \begin{macro}{\rq} +% \begin{macrocode} +\def\lq{`} +\def\rq{'} +% \end{macrocode} +% \end{macro} +% \end{macro} +% +% \begin{macro}{\lbrack} +% \begin{macro}{\rbrack} +% \begin{macrocode} +\def\lbrack{[} +\def\rbrack{]} +% \end{macrocode} +% \end{macro} +% \end{macro} +% +% \begin{macro}{\aa} +% \begin{macro}{\AA} +% These are not from plain.tex but they are similar to other commands +% found here and nowhere else, being alternate input forms for +% characters. +% \begin{macrocode} +\def \aa {\r a} +\def \AA {\r A} +% \end{macrocode} +% \end{macro} +% \end{macro} +% +% \begin{macro}{\endgraf} +% \begin{macro}{\endline} +% \begin{macrocode} +\let\endgraf=\par +\let\endline=\cr +% \end{macrocode} +% \end{macro} +% \end{macro} +% +% \begin{macro}{\space} +% \begin{macrocode} +\def\space{ } +% \end{macrocode} +% \end{macro} +% +% \begin{macro}{\empty} +% \changes{v1.1m}{1995/09/01}{Use \cs{let} to save space} +% This probably ought to go altogether, but let it to the \LaTeX\ +% version to save space. +% \begin{macrocode} +\let\empty\@empty +% \end{macrocode} +% \end{macro} +% +% \begin{macro}{\null} +% \begin{macrocode} +\def\null{\hbox{}} +% \end{macrocode} +% \end{macro} +% +% \begin{macro}{\bgroup} +% \begin{macro}{\egroup} +% \begin{macrocode} +\let\bgroup={ +\let\egroup=} +% \end{macrocode} +% \end{macro} +% \end{macro} +% +% \begin{macro}{\obeylines} +% \begin{macro}{\obeyspaces} +% In |\obeylines|, we say |\let^^M=\par| instead of |\def^^M{\par}| +% since this allows, for example, |\let\par=\cr \obeylines \halign{...| +% \begin{macrocode} +{\catcode`\^^M=\active % these lines must end with % + \gdef\obeylines{\catcode`\^^M\active \let^^M\par}% + \global\let^^M\par} % this is in case ^^M appears in a \write +\def\obeyspaces{\catcode`\ \active} +{\obeyspaces\global\let =\space} +% \end{macrocode} +% \end{macro} +% \end{macro} +% +% \begin{macro}{\loop} +% \changes{v1.0h}{1994/05/16}{Use Kabelschacht method} +% \begin{macro}{\iterate} +% \changes{v1.1b}{1994/11/10} +% {(CAR) added extra \cs{relax}} +% \changes{v1.1m}{1994/05/26} +% {(CAR) added \cs{long}} +% \begin{macro}{\repeat} +% We use Kabelschacht's method of doing loops, see TUB 8\#2 (1987). +% (unless that breaks something :-). It turned out to need an +% extra |\relax|: see pr/642 (|\loop| could do one iteration too much +% in certain cases). +% \begin{macrocode} +\long\def \loop #1\repeat{% + \def\iterate{#1\relax % Extra \relax + \expandafter\iterate\fi + }% + \iterate + \let\iterate\relax +} +% \end{macrocode} +% This setting of |\repeat| is needed to make |\loop...\if...\repeat| +% skippable within another |\if...|. +% \begin{macrocode} +\let\repeat=\fi +% \end{macrocode} +% \end{macro} +% \end{macro} +% \end{macro} +% +% \LaTeX\ defines |\smallskip|, etc.\ in |ltspace.dtx|. +% +% \begin{macro}{\nointerlineskip} +% \begin{macro}{\offinterlineskip} +% \changes{v1.1n}{1995/07/02}{Replaced 1000 by \cs{@m}} +% \begin{macrocode} +\def\nointerlineskip{\prevdepth-\@m\p@} +\def\offinterlineskip{\baselineskip-\@m\p@ + \lineskip\z@ \lineskiplimit\maxdimen} +% \end{macrocode} +% \end{macro} +% \end{macro} +% +% \begin{macro}{\vglue} +% \begin{macro}{\hglue} +% \begin{macrocode} +\def\vglue{\afterassignment\vgl@\skip@=} +\def\vgl@{\par \dimen@\prevdepth \hrule \@height\z@ + \nobreak\vskip\skip@ \prevdepth\dimen@} +\def\hglue{\afterassignment\hgl@\skip@=} +\def\hgl@{\leavevmode \count@\spacefactor \vrule \@width\z@ + \nobreak\hskip\skip@ \spacefactor\count@} +% \end{macrocode} +% \end{macro} +% \end{macro} +% +% \LaTeX\ defines |~| in |ltdefns.dtx|. +% +% \begin{macro}{\slash} +% \begin{macrocode} +\def\slash{/\penalty\exhyphenpenalty} % a `/' that acts like a `-' +% \end{macrocode} +% \end{macro} +% +% \begin{macro}{\break} +% \begin{macro}{\nobreak} +% \begin{macro}{\allowbreak} +% \begin{macrocode} +\def\break{\penalty-\@M} +\def\nobreak{\penalty \@M} +\def\allowbreak{\penalty \z@} +% \end{macrocode} +% \end{macro} +% \end{macro} +% \end{macro} +% +% \begin{macro}{\filbreak} +% \begin{macro}{\goodbreak} +% \begin{macrocode} +\def\filbreak{\par\vfil\penalty-200\vfilneg} +\def\goodbreak{\par\penalty-500 } +% \end{macrocode} +% \end{macro} +% \end{macro} +% +% \begin{macro}{\eject} +% \changes{v1.1s}{1995/10/17}{Move \cs{supereject} to compat file} +% Define |\eject| as in plain \TeX\ but define |\supereject| only in +% the compatibility file. +% \begin{macrocode} +\def\eject{\par\break} +% \end{macrocode} +% \end{macro} +% +% \begin{macro}{\removelastskip} +% \begin{macrocode} +\def\removelastskip{\ifdim\lastskip=\z@\else\vskip-\lastskip\fi} +% \end{macrocode} +% \end{macro} +% +% \begin{macro}{\smallbreak} +% \begin{macro}{\medbreak} +% \begin{macro}{\bigbreak} +% \begin{macrocode} +\def\smallbreak{\par\ifdim\lastskip<\smallskipamount + \removelastskip\penalty-50\smallskip\fi} +\def\medbreak{\par\ifdim\lastskip<\medskipamount + \removelastskip\penalty-100\medskip\fi} +\def\bigbreak{\par\ifdim\lastskip<\bigskipamount + \removelastskip\penalty-200\bigskip\fi} +% \end{macrocode} +% \end{macro} +% \end{macro} +% \end{macro} +% +% \begin{macro}{\m@th} +% \changes{v1.0h}{1994/05/16}{Remove unnecssary space} +% \begin{macrocode} +\def\m@th{\mathsurround\z@} +% \end{macrocode} +% \end{macro} +% +% \begin{macro}{\underbar} +% Due to \LaTeX's redefinition of |\underline| plain \TeX's +% |\underbar| can be done in a simpler fashion (but do we +% need it at all?). +% \changes{v1.1m}{1994/05/26} +% {(CAR/FMi) changed to use box \cs{tw@}} +% \changes{v1.1p}{1994/05/26} +% {(DPC) changed to use \cs{sbox}} +% \begin{macrocode} +\def\underbar#1{\underline{\sbox\tw@{#1}\dp\tw@\z@\box\tw@}} +% \end{macrocode} +% \end{macro} +% +% \begin{macro}{\strutbox} +% \begin{macro}{\strut} +% \LaTeX\ sets |\strutbox| in |\set@fontsize|. +% \begin{macrocode} +\newbox\strutbox +\def\strut{\relax\ifmmode\copy\strutbox\else\unhcopy\strutbox\fi} +% \end{macrocode} +% \end{macro} +% \end{macro} +% +% \begin{macro}{\hidewidth} +% For alignment entries that can stick out. +% \begin{macrocode} +\def\hidewidth{\hskip\hideskip} +% \end{macrocode} +% \end{macro} +% +% \changes{v1.0h}{1994/05/16}{Remove unnecessary def for \cs{item}} +% \changes{v1.1i}{1995/04/27} +% {Move \cs{hang} and \cs{textindent} to latex209.def} +% \changes{RmS}{1991/11/04}{Removed \cs{itemitem} since never +% needed/useful with \LaTeX.} +% +% \begin{macro}{\narrower} +% \begin{macrocode} +\def\narrower{% + \advance\leftskip\parindent + \advance\rightskip\parindent} +% \end{macrocode} +% \end{macro} +% +% \changes{v1.1c}{1994/11/12}{Comment out more encoding specific +% commands} +% \LaTeX\ defines |\ae| and similar commands elsewhere. +% +% \begin{macrocode} +\chardef\%=`\% +\chardef\&=`\& +\chardef\#=`\# +% \end{macrocode} +% +% Most text commands are actually encoding specific and therefore +% defined later, so commented out or removed from this file. +% \changes{v1.0h}{1994/05/16}{Comment out encoding specific commands} +% +% \begin{macro}{\leavevmode} +% begins a paragraph, if necessary +% \begin{macrocode} +\def\leavevmode{\unhbox\voidb@x} +% \end{macrocode} +% \end{macro} +% +% \begin{macro}{\mathhexbox} +% \begin{macrocode} +\def\mathhexbox#1#2#3{\mbox{$\m@th \mathchar"#1#2#3$}} +% \end{macrocode} +% \end{macro} +% +% +% \begin{macro}{\ialign} +% \begin{macrocode} +\def\ialign{\everycr{}\tabskip\z@skip\halign} % initialized \halign +% \end{macrocode} +% \end{macro} +% +% \begin{macro}{\oalign} +% \begin{macro}{\o@lign} +% \begin{macro}{\ooalign} +% \begin{macrocode} +\def\oalign#1{\leavevmode\vtop{\baselineskip\z@skip \lineskip.25ex% + \ialign{##\crcr#1\crcr}}} +\def\o@lign{\lineskiplimit\z@ \oalign} +\def\ooalign{\lineskiplimit-\maxdimen \oalign} +% \end{macrocode} +% \end{macro} +% \end{macro} +% \end{macro} +% +% \begin{macro}{\sh@ft} +% \changes{v1.1t}{1996/07/26}{replace \cs{dimen}\cs{z@} by +% \cs{dimen@}} +% \begin{macrocode} +\def\sh@ft#1{\dimen@.00#1ex\multiply\dimen@\fontdimen1\font + \kern-.0156\dimen@} % compensate for slant in lowered accents +% \end{macrocode} +% \end{macro} +% +% \LaTeX\ change: |\d|, |\b|, |\c|, |\copyright|, |\TeX| +% defined elsewhere. +% +% \changes{LaTeX2e} +% {1993/11/29}{All accents in decimals; suggested by Paul Taylor} +% \changes{v1.0d}{1994/04/12} +% {Define \cs{@acci}} +% \changes{v1.0h}{1994/05/16}{Remove \cs{@acci} and friends again} +% +% \LaTeX{} change: Make |\t| work in a moving argument. +% Now defined elsewhere. +% +% \begin{macro}{\hrulefill} +% \begin{macro}{\dotfill} +% \LaTeX\ change: |\kern\z@| added to end of +% |\hrulefill| and |\dotfill| +% to make them work in `tabular' and `array' environments. +% (Change made 24 July 1987). +% \LaTeX\ change: |\leavevmode| added at begining of +% |\dotfill| and |\hrulefill| +% so that they work as expected in vertical mode. +% \begin{macrocode} +\def\hrulefill{\leavevmode\leaders\hrule\hfill\kern\z@} +% \end{macrocode} +% The box in |\dotfill| originally contained (in plain.tex): +% |\mkern 1.5mu .\mkern 1.5mu|; the width of .44em differs from this +% by .04pt which is probably an acceptable difference within leaders. +% \changes{v1.1u}{1996/10/28}{Removed math mode} +% \changes{v1.1v}{1996/10/29}{Got arithmetic correct (CAR)} +% \changes{v1.1w}{1996/11/03}{Saved tokens by using \cs{hb@xt@}} +% \begin{macrocode} +\def\dotfill{% + \leavevmode + \cleaders \hb@xt@ .44em{\hss.\hss}\hfill + \kern\z@} +% \end{macrocode} +% \end{macro} +% \end{macro} +% +% INITEX sets |\sfcode x=1000| for all x, except that |\sfcode`X=999| +% for uppercase letters. The following changes are needed: +% \begin{macrocode} +\sfcode`\)=0 \sfcode`\'=0 \sfcode`\]=0 +% \end{macrocode} +% The |\nonfrenchspacing| macro will make further changes to +% |\sfcode| values. +% +% +% Definitions related to output +% +% +% \changes{v1.1k}{1995/05/22}{Definitions of \cs{footins} and +% \cs{footnoterule} moved to ltfloat.} +% +% +% |\magnification| doesn't work in \LaTeX. +%\begin{verbatim} +%\def\magnification{\afterassignment\m@g\count@} +%\def\m@g{\mag\count@ +% \hsize6.5truein\vsize8.9truein\dimen\footins8truein} +%\end{verbatim} +% +% \begin{macro}{\showoverfull} +% \changes{v0.1k ltfinal}{1994/05/19}{used \cs{@ne} not 1} +% The following commands are used in debugging: +% \begin{macrocode} +\def\showoverfull{\tracingonline\@ne} +% \end{macrocode} +% \end{macro} +% +% \begin{macro}{\showoutput} +% \changes{v0.1k ltfinal}{1994/05/19} +% {used \cs{maxdimen} not 99999} +% \changes{v1.1n}{1995/07/02}{Use \cs{showoverfull} to save space} +% \changes{v1.1x}{2002/02/24}{Use newly added \cs{loggingoutput}} +% \begin{macro}{\loggingoutput} +% \changes{v1.1x}{2002/02/24}{Macro added} +% \begin{macrocode} +% +%<*2ekernel|autoerr> +\gdef\loggingoutput{\tracingoutput\@ne + \showboxbreadth\maxdimen\showboxdepth\maxdimen\errorstopmode} +\gdef\showoutput{\loggingoutput\showoverfull} +% +%\def\showoutput{\@autoerr\showoutput} +% \end{macrocode} +% \end{macro} +% \end{macro} +% +% +% \begin{macro}{\tracingall} +% \changes{LaTeX209}{1991/08/26}{Added +% \cs{errorcontextlines}!=\cs{maxdimen}, suggested by J. Schrod} +% \changes{v1.1n}{1995/07/02}{Use \cs{showoutput} to save space} +% \changes{v1.1x}{2002/02/24}{Use newly added \cs{loggingoutput}} +% \begin{macro}{\loggingall} +% \changes{v1.1x}{2002/02/24}{Macro added} +% \begin{macrocode} +%<*2ekernel|autoerr> +\gdef\loggingall{\tracingcommands\tw@\tracingstats\tw@ + \tracingpages\@ne\tracinglostchars\@ne + \tracingmacros\tw@\tracingparagraphs\@ne\tracingrestores\@ne + \errorcontextlines\maxdimen\loggingoutput} +\gdef\tracingall{\loggingall\showoverfull} +% +%\def\tracingall{\@autoerr\tracingall} +% \end{macrocode} +% \end{macro} +% \end{macro} +% +% \LaTeX\ change: |\showhyphens| Defined later. +% +% Punctuation affects the spacing. +% \begin{macrocode} +%<*2ekernel|autoload> +\nonfrenchspacing +% +% \end{macrocode} +% +% +% \Finale +% diff --git a/Master/texmf-dist/source/latex/base/ltsect.dtx b/Master/texmf-dist/source/latex/base/ltsect.dtx new file mode 100644 index 00000000000..6f66a92755b --- /dev/null +++ b/Master/texmf-dist/source/latex/base/ltsect.dtx @@ -0,0 +1,866 @@ +% \iffalse meta-comment +% +% Copyright 1993 1994 1995 1996 1997 1998 1999 2000 2001 2002 2003 2004 +% The LaTeX3 Project and any individual authors listed elsewhere +% in this file. +% +% This file is part of the LaTeX base system. +% ------------------------------------------- +% +% It may be distributed and/or modified under the +% conditions of the LaTeX Project Public License, either version 1.3 +% of this license or (at your option) any later version. +% The latest version of this license is in +% http://www.latex-project.org/lppl.txt +% and version 1.3 or later is part of all distributions of LaTeX +% version 2003/12/01 or later. +% +% This file has the LPPL maintenance status "maintained". +% +% The list of all files belonging to the LaTeX base distribution is +% given in the file `manifest.txt'. See also `legal.txt' for additional +% information. +% +% The list of derived (unpacked) files belonging to the distribution +% and covered by LPPL is defined by the unpacking scripts (with +% extension .ins) which are part of the distribution. +% +% \fi +% +% \iffalse +%%% From File: ltsect.dtx +%<*driver> +% \fi +\ProvidesFile{ltsect.dtx}[1996/12/20 v1.0z LaTeX Kernel (Sectioning)] +% \iffalse +\documentclass{ltxdoc} +\GetFileInfo{ltsect.dtx} +\title{\filename} +\date{\filedate} + \author{% + Johannes Braams\and + David Carlisle\and + Alan Jeffrey\and + Leslie Lamport\and + Frank Mittelbach\and + Chris Rowley\and + Tobias Oetiker\thanks{Tobi updated + the comments to `doc' conventions}\and + Rainer Sch\"opf} + +\begin{document} +\maketitle + \DocInput{\filename} +\end{document} +% +% \fi +% +% \CheckSum{363} +% +% \changes{v1.0o}{1995/05/07}{Use \cs{hb@xt@}} +% \changes{v1.0y}{1996/10/31}{Corrected and tidied documentation; +% removed long lines} +% +% +% \section{Sectioning Commands} +% +% This file defines the declarations such as |\author| which are used +% by |\maketitle|. |\maketitle| itself is defined by each class, not +% in the \LaTeX{} kernel. +% +% The second part of the file defines the generic commands used for +% defining sectioning commands such as |\chapter|. Again the actual +% document level commands are defined in the class files, in terms of +% these commands. +% +% \StopEventually{} +% +% +% \changes{v1.0a}{1994/03/04}{Initial version, split from latex.dtx} +% \changes{v1.0b}{1994/03/28}{Split further from ltherest.dtx} +% \changes{v1.0d}{1994/05/21}{Use new error commands} +% \changes{v1.0f}{1994/10/12}{Doc. typos} +% \changes{v1.0g}{1994/10/18}{Added \cs{normalcolor}} +% \changes{v1.0i}{1994/11/17} +% {\cs{@tempa} to \cs{reserved@a}} +% \changes{v1.0m}{1995/05/03}{TO: Promoted documentation to doc.sty +% standard} +% +% \begin{macrocode} +%<*2ekernel> +\message{title,} +% \end{macrocode} +% +% \subsection{The Title} +% +% \DescribeMacro{\title} +% The user defines the title and author by the declarations +% |\title|\marg{name}, +% \DescribeMacro{\author} +% |\author|\marg{name} +% +% \DescribeMacro{\date} +% Similarly the date is declared with +% |\date|\marg{date}. +% +% \DescribeMacro{\thanks} +% Inside these, the |\thanks|\marg{footnote text} command may be used +% to make acknowledgements, notice of address, etc.\ in a footnote. +% \DescribeMacro{\and} +% If there are multiple authors, they have to be separated with the +% |\and| command. +% +% \DescribeMacro{\maketitle} +% And finally, the |\maketitle| command produces the actual title, +% using the information previously saved with the other commands. +% +% \begin{macro}{\title} +% \begin{macro}{\@title} +% \changes{LaTeX2e}{1993/12/11}{Added default} +% |\title| for use in |\maketitle|. If not given |\maketitle| will +% produce an error message. +% \begin{macrocode} +\def\title#1{\gdef\@title{#1}} +\def\@title{\@latex@error{No \noexpand\title given}\@ehc} +% \end{macrocode} +% \end{macro} +% \end{macro} +% +% \begin{macro}{\author} +% \begin{macro}{\@author} +% \changes{LaTeX2e}{1993/12/11}{Added default} +% +% |\author| for use in |\maketitle|. If not given |\maketitle| will +% produce a warning message. +% +% \begin{macrocode} +\def\author#1{\gdef\@author{#1}} +\def\@author{\@latex@warning@no@line{No \noexpand\author given}} +% \end{macrocode} +% \end{macro} +% \end{macro} +% +% \begin{macro}{\date} +% \begin{macro}{\@date} +% |\date| for use in |\maketitle|. If not given |\maketitle| will +% produce |\today| as the default. +% \begin{macrocode} +\def\date#1{\gdef\@date{#1}} +\gdef\@date{\today} +% \end{macrocode} +% \end{macro} +% \end{macro} +% +% \changes{1.0h}{1994/11/04}{(ASAJ) Added \cs{protected@xdef} to +% \cs{thanks}.} +% \begin{macro}{\thanks} +% \begin{macrocode} +\def\thanks#1{\footnotemark + \protected@xdef\@thanks{\@thanks + \protect\footnotetext[\the\c@footnote]{#1}}% +} +% \end{macrocode} +% \end{macro} +% +% \begin{macro}{\@thanks} +% \begin{macrocode} +\let\@thanks\@empty +% \end{macrocode} +% \end{macro} +% \begin{macro}{\and} +% \begin{macrocode} +\def\and{% % \begin{tabular} + \end{tabular}% + \hskip 1em \@plus.17fil% + \begin{tabular}[t]{c}}% % \end{tabular} +% \end{macrocode} +% \end{macro} +% +% \begin{macrocode} +\message{sectioning,} +% \end{macrocode} +% \subsection{Sectioning} +% +% +% \begin{macro}{\@secpenalty} +% \begin{macrocode} +\newcount\@secpenalty +\@secpenalty = -300 +% \end{macrocode} +% \end{macro} +% +% \begin{macro}{\if@noskipsec} +% \begin{macro}{\@noskipsectrue} +% \changes{1.0w}{1996/09/29}{Added documentation} +% Way back in 1991 (08/26) FMi \& RmS set the |\@noskipsec| switch +% to true for the preamble and to false in |\document|. +% This was done to trap lists and related text in the preamble but it +% does not catch everything. +% \begin{macrocode} +\newif\if@noskipsec \@noskipsectrue +% \end{macrocode} +% \end{macro} +% \end{macro} +% +% \begin{macro}{\@startsection} +% +% The |\@startsection{|\meta{name}|}{|\meta{level}|}{|% +% \meta{indent}|}{|\meta{beforeskip}|}|\\ +% |{|\meta{afterskip}|}{|\meta{style}|}*[|\meta{altheading}% +% |]{|\meta{heading}|}| +% command is the mother of all the user level sectioning commands. +% The part after the |*|, including the |*| is optional. +% +% \begin{description} +% \item[name:] e.g., 'subsection' +% \item[level:] a number, denoting depth of section -- e.g., chapter=1, +% section = 2, etc. +% \item[indent:] Indentation of heading from left margin +% \item[beforeskip:] Absolute value = skip to leave above the heading. +% If negative, then paragraph indent of text following +% heading is suppressed. +% \item[afterskip:] if positive, then skip to leave below heading, else +% negative of skip to leave to right of run-in heading. +% \item[style:] Commands to set style. Since June 1996 release the +% \emph{last} command in this argument may be a command +% such as |\MakeUppercase| or |\fbox| that takes an +% argument. The section heading will be supplied as the +% argument to this command. So setting |#6| to, say, +% |\bfseries\MakeUppercase| would produce bold, +% uppercase headings. +% \end{description} +% +% If `|*|' is missing, then increment the counter. If it is +% present, then there should be no |[|\meta{altheading}|]| argument. +% The command uses the counter 'secnumdepth'. It contains a pointer +% to the highest section level that is to be numbered. +% +% \textbf{Warning:} +% The |\@startsection| command should be at the same or higher +% grouping level as the text that follows it. For example, you should +% \emph{not} do something like +% \begin{verbatim} +% \def\foo{ \begingroup ... +% \paragraph{...} +% \endgroup} +% \end{verbatim} +% +% Pseudocode for the |\@startsection| command +% \begin{oldcomments} +% \@startsection {NAME}{LEVEL}{INDENT}{BEFORESKIP}{AFTERSKIP}{STYLE} == +% BEGIN +% IF @noskipsec = T THEN \leavevmode FI +% % true if previous section had no body. +% +% \par +% \@tempskipa := BEFORESKIP +% @afterindent := T +% IF \@tempskipa < 0 THEN \@tempskipa := -\@tempskipa +% @afterindent := F +% FI +% IF @nobreak = true +% THEN \everypar == null +% ELSE \addpenalty{\@secpenalty} +% \addvspace{\@tempskipa} +% FI +% IF * next +% THEN \@ssect{INDENT}{BEFORESKIP}{AFTERSKIP}{STYLE} +% ELSE \@dblarg{\@sect +% {NAME}{LEVEL}{INDENT} +% {BEFORESKIP}{AFTERSKIP}{STYLE}} +% FI +% END +% \end{oldcomments} +% +% \begin{macrocode} +\def\@startsection#1#2#3#4#5#6{% + \if@noskipsec \leavevmode \fi + \par + \@tempskipa #4\relax + \@afterindenttrue + \ifdim \@tempskipa <\z@ + \@tempskipa -\@tempskipa \@afterindentfalse + \fi + \if@nobreak + \everypar{}% + \else + \addpenalty\@secpenalty\addvspace\@tempskipa + \fi + \@ifstar + {\@ssect{#3}{#4}{#5}{#6}}% + {\@dblarg{\@sect{#1}{#2}{#3}{#4}{#5}{#6}}}} +% \end{macrocode} +% \end{macro} +% +% \begin{macro}{\@sect} +% Pseudocode for the |\@sect| command +% \begin{oldcomments} +% \@sect{NAME}{LEVEL}{INDENT}{BEFORESKIP}{AFTERSKIP}{STYLE}[ARG1]{ARG2} +% == +% BEGIN +% IF LEVEL > \c@secnumdepth +% THEN \@svsec :=L null +% ELSE \refstepcounter{NAME} +% \@svsec :=L BEGIN \@seccntformat{#1}\relax END +% FI +% IF AFTERSKIP > 0 +% THEN \begingroup +% STYLE +% \@hangfrom{\hskip INDENT\@svsec} +% {\interlinepenalty 10000 ARG2\par} +% \endgroup +% \NAMEmark{ARG1} +% \addcontentsline{toc}{NAME} +% { IF LEVEL > \c@secnumdepth +% ELSE \protect\numberline{\theNAME} FI +% ARG1 } +% ELSE \@svsechd == BEGIN STYLE +% \hskip INDENT\@svsec +% ARG2 +% \NAMEmark{ARG1} +% \addcontentsline{toc}{NAME} +% { IF LEVEL > \c@secnumdepth +% ELSE +% \protect\numberline{\theNAME} +% FI +% ARG1 } +% END +% FI +% \@xsect{AFTERSKIP} +% END +% \end{oldcomments} +% +% \changes{LaTeX2.09}{1992/08/25} +% {(FMi) replaced explicit setting of \cs{@svsec} +% by call to \cs{@seccntformat}} +% \changes{LaTeX2.09}{1993/08/05} +% {(RmS) Made sure that \cs{protect} works correctly in +% expansion of \cs{the} counter} +% \changes{1.0h}{1994/11/04} +% {(ASAJ) Added \cs{protected@edef}.} +% \begin{macrocode} +\def\@sect#1#2#3#4#5#6[#7]#8{% + \ifnum #2>\c@secnumdepth + \let\@svsec\@empty + \else + \refstepcounter{#1}% +% \end{macrocode} +% Since |\@seccntformat| might end with an improper |\hskip| which +% is scanning forward for |plus| or |minus| we end the definition +% of |\@svsec| with |\relax| as a precaution. +% \changes{1.0n}{1995/05/06}{Added \cs{relax} after +% \cs{@seccntformat} just in case} +% \begin{macrocode} + \protected@edef\@svsec{\@seccntformat{#1}\relax}% + \fi + \@tempskipa #5\relax + \ifdim \@tempskipa>\z@ + \begingroup +% \end{macrocode} +% \changes{v1.0s}{1996/05/21} +% {(DPC) Moved brace to allow commands like +% \cs{MakeUppercase} in 6th argument. +% Changed \cs{par} to \cs{endgraf} to allow non-long +% commands. internal/2148} +% \changes{v1.0t}{1996/06/10} +% {(DPC) Changed \cs{endgraf} to \cs{@@par}} +% This |{| used to be after the argument to |\@hangfrom| but was moved +% here to allow commands such as |\MakeUppercase| to be used at the end +% of |#6|. +% \begin{macrocode} + #6{% + \@hangfrom{\hskip #3\relax\@svsec}% + \interlinepenalty \@M #8\@@par}% + \endgroup + \csname #1mark\endcsname{#7}% + \addcontentsline{toc}{#1}{% + \ifnum #2>\c@secnumdepth \else + \protect\numberline{\csname the#1\endcsname}% + \fi + #7}% + \else +% \end{macrocode} +% |\relax| added 2 May 90 +% \changes{v1.0s}{1996/05/21} +% {(DPC) Added extra braces for internal/2148} +% \begin{macrocode} + \def\@svsechd{% + #6{\hskip #3\relax + \@svsec #8}% + \csname #1mark\endcsname{#7}% + \addcontentsline{toc}{#1}{% + \ifnum #2>\c@secnumdepth \else + \protect\numberline{\csname the#1\endcsname}% + \fi + #7}}% + \fi + \@xsect{#5}} +% \end{macrocode} +% \end{macro} +% +% \begin{macro}{\@xsect}% +% Pseudocode for the |\@xsect| command +% \begin{oldcomments} +% \@xsect{AFTERSKIP} == +% BEGIN +% IF AFTERSKIP > 0 +% THEN \par \nobreak +% \vskip AFTERSKIP +% \@afterheading +% ELSE @nobreak :=G F +% @noskipsec :=G T +% \everypar{ IF @noskipsec = T +% THEN @noskipsec :=G F +% \clubpenalty :=G 10000 +% \hskip -\parindent +% \begingroup +% \@svsechd +% \endgroup +% \unskip +% \hskip -AFTERSKIP \relax +% %% relax added 14 Jan 91 +% ELSE \clubpenalty :=G \@clubpenalty +% \everypar := NULL +% FI +% } +% FI +% +% END +% \end{oldcomments} +% +% \changes{0.0}{1992/08/19} +% {(RmS) corrected bug: stretch and shrink in argument to +% \cs{hskip} previously not negated} +% \begin{macrocode} +\def\@xsect#1{% + \@tempskipa #1\relax + \ifdim \@tempskipa>\z@ +% \end{macrocode} +% Why not combine |\@sect| and |\@xsect| and save doing the +% same test twice? It is not possible to change this now as these +% have become hooks! +% +% This |\par| seems unnecessary. +% \begin{macrocode} + \par \nobreak + \vskip \@tempskipa + \@afterheading + \else +% \end{macrocode} +% \changes{v1.0u}{1996/07/26}{Removed \cs{global} before +% \cs{@nobreak...}} +% \changes{v1.0x}{1996/10/23}{Replaced \cs{hskip...} with \cs{setbox...} +% as used in \cs{@afterheading}} +% \begin{macrocode} + \@nobreakfalse + \global\@noskipsectrue + \everypar{% + \if@noskipsec + \global\@noskipsecfalse + {\setbox\z@\lastbox}% + \clubpenalty\@M + \begingroup \@svsechd \endgroup + \unskip + \@tempskipa #1\relax + \hskip -\@tempskipa + \else + \clubpenalty \@clubpenalty + \everypar{}% + \fi}% + \fi + \ignorespaces} +% \end{macrocode} +% \end{macro} +% +% \begin{macro}{\@seccntformat} +% This command formats the section number including the space +% following it. +% \changes{1.0n}{1995/05/06}{Use \cs{quad} instead of \cs{hskip}} +% \begin{macrocode} +\def\@seccntformat#1{\csname the#1\endcsname\quad} +% \end{macrocode} +% \end{macro} +% +% Pseudocode for the |\@ssect| command +% \begin{oldcomments} +% \@ssect{INDENT}{BEFORESKIP}{AFTERSKIP}{STYLE}{ARG} == +% BEGIN +% IF AFTERSKIP > 0 +% THEN \begingroup +% STYLE +% \@hangfrom{\hskip INDENT}{\interlinepenalty 10000 ARG\par} +% \endgroup +% ELSE \@svsechd == BEGIN STYLE +% \hskip INDENT +% ARG +% END +% FI +% \@xsect{AFTERSKIP} +% END +% \end{oldcomments} +% +% Pseudocode for the |\@afterheading| command +% \begin{oldcomments} +% \@afterheading == +% BEGIN +% @nobreak :=G true +% \everypar := BEGIN IF @nobreak = T +% THEN @nobreak :=G false +% \clubpenalty :=G 10000 +% IF @afterindent = F +% THEN remove \lastbox +% FI +% ELSE \clubpenalty :=G \@clubpenalty +% \everypar := NULL +% FI +% END +% END +% \end{oldcomments} +% +% +% \begin{macro}{\@ssect} +% \begin{macrocode} +\def\@ssect#1#2#3#4#5{% + \@tempskipa #3\relax + \ifdim \@tempskipa>\z@ + \begingroup +% \end{macrocode} +% \changes{v1.0s}{1996/05/21} +% {(DPC) Moved brace to allow commands like +% \cs{MakeUppercase} in 4th argument. +% Changed \cs{par} to \cs{endgraf} to allow non-long +% commands. internal/2148} +% \changes{v1.0t}{1996/06/10} +% {(DPC) Changed \cs{endgraf} to \cs{@@par}} +% This |{| used to be after the argument to |\@hangfrom| but was moved +% here to allow commands such as |\MakeUppercase| to be used at the end +% of |#4|. +% \begin{macrocode} + #4{% + \@hangfrom{\hskip #1}% + \interlinepenalty \@M #5\@@par}% + \endgroup + \else +% \end{macrocode} +% \changes{v1.0s}{1996/05/21} +% {(DPC) Added extra braces for internal/2148} +% \begin{macrocode} + \def\@svsechd{#4{\hskip #1\relax #5}}% + \fi + \@xsect{#3}} +% \end{macrocode} +% \end{macro} +% +% \begin{macro}{\if@afterindent} +% \begin{macro}{\@afterindenttrue} +% \begin{macrocode} +\newif\if@afterindent \@afterindenttrue +% \end{macrocode} +% \end{macro}\end{macro} +% +% \begin{macro}{\@afterheading} +% \changes{v1.0v}{1996/08/02}{Removed \cs{global} +% before \cs{@nobreak...}} +% +% This hook is used in setting up custom-built headings in classes.dtx. +% +% \begin{macrocode} +\def\@afterheading{% + \@nobreaktrue + \everypar{% + \if@nobreak + \@nobreakfalse + \clubpenalty \@M + \if@afterindent \else + {\setbox\z@\lastbox}% + \fi + \else + \clubpenalty \@clubpenalty + \everypar{}% + \fi}} +% \end{macrocode} +% \end{macro} +% +% +% \begin{macro}{\@hangfrom} +% +% |\@hangfrom{|\meta{text}|}| : Puts \meta{text} in a box, and makes a +% hanging indentation of the following material up to the first +% |\par|. Should be used in vertical mode. +% +% \changes{v1.0a}{1994/03/07}{(DPC)Extra groups for colour} +% \begin{macrocode} +\def\@hangfrom#1{\setbox\@tempboxa\hbox{{#1}}% + \hangindent \wd\@tempboxa\noindent\box\@tempboxa} +% \end{macrocode} +% \end{macro} +% +% \begin{macro}{\c@secnumdepth} +% \begin{macro}{\c@tocdepth} +% \begin{macrocode} +\newcount\c@secnumdepth +\newcount\c@tocdepth +% \end{macrocode} +% \end{macro}\end{macro} +% +% \begin{macro}{\secdef} +% +% |\secdef{|\meta{unstarcmds}|}{|\meta{unstarcmds}|}{|% +% \meta{starcmds}|}|\\ +% When defining a |\chapter| or |\section| command without using +% |\@startsection|, you can use |\secdef| as follows: +% \begin{enumerate} +% \item |\def\chapter{| \ldots |\secdef| +% |\|\meta{starcmd} |\|\meta{unstarcmd} |}| +% \item |\def\|\meta{starcmd}|[#1]#2{| \ldots |}| +% |%| Command to define |\chapter[|\ldots|]{|\ldots|}| +% \item |\def\|\meta{unstarcmd}|#1{| \ldots |}| +% |%| Command to define |\chapter*{|\ldots|}| +% \end{enumerate} +% +% \begin{macrocode} +\def\secdef#1#2{\@ifstar{#2}{\@dblarg{#1}}} +% \end{macrocode} +% \end{macro} +% +% \subsubsection{Initializations} +% \begin{macro}{\sectionmark} +% \begin{macro}{\subsectionmark} +% \begin{macro}{\subsubsectionmark} +% \begin{macro}{\paragraphmark} +% \begin{macro}{\subparagraphmark} +% \changes{v1.0q}{1995/10/25}{Use \cs{let} not \cs{def} to save space.} +% \begin{macrocode} +\let\sectionmark\@gobble +\let\subsectionmark\@gobble +\let\subsubsectionmark\@gobble +\let\paragraphmark\@gobble +\let\subparagraphmark\@gobble +% \end{macrocode} +% \end{macro} +% \end{macro} +% \end{macro} +% \end{macro} +% \end{macro} +% +% \begin{macrocode} +\message{contents,} +% \end{macrocode} +% +% \subsection{Table of Contents etc.} +% +% \subsubsection{Convention} +% |\tf@|\meta{foo} = file number for output for table foo. +% The file is opened only if |@filesw| = |true|. +% +% \subsubsection{Commands} +% +% +% A |\l@|\meta{type}|{|\meta{entry}|}{|\meta{page}|}| Macro needs to +% defined by document style for making an entry of type \meta{type} +% in a table of contents, etc. E.g., the document style +% should define |\l@chapter|, |\l@section|, etc. +% +% \textbf{Note:} When the |\protect| command is +% used in the \meta{entry} or \meta{text} of one of the commands +% below, it causes the following control sequence to be written on +% the file without being expanded. The sequence will be expanded +% when the table of contents entry is processed. +% +% \textbf{Surprise:} Inside an |\addcontentsline| or |\addtocontents| +% command argument, the commands: |\index|, |\glossary|, and |\label| +% are no-ops . This could cause a problem if the user puts an +% |\index| or |\label| into one of the commands he writes, or into the +% optional `short version' argument of a |\section| or |\caption| +% command. +% +% \begin{macro}{\@starttoc} +% The |\@starttoc|\marg{ext} command is used to define the commands:\\ +% |\tableofcontents|, |\listoffigures|, etc. +% +% For example: +% |\@starttoc{lof}| is used in |\listoffigures|. This command +% reads the |.|\meta{ext} file and sets up to write the new +% |.|\meta{ext} file. +% +% \begin{oldcomments} +% \@starttoc{EXT} == +% BEGIN +% \begingroup +% \makeatletter +% read file \jobname.EXT +% IF @filesw = true +% THEN open \jobname.EXT as file \tf@EXT +% FI +% @nobreak :=G FALSE %% added 24 May 89 +% \endgroup +% END +% \end{oldcomments} +% +% \changes{0.0}{1992/01/14}{(RmS) added \cs{immediate} to \cs{openout} +% as all \cs{write} commands +% are also executed \cs{immediate}} +% \changes{v1.0u}{1996/07/26}{removed \cs{global} +% before \cs{@nobreak...}} +% \begin{macrocode} +\def\@starttoc#1{% + \begingroup + \makeatletter + \@input{\jobname.#1}% + \if@filesw + \expandafter\newwrite\csname tf@#1\endcsname + \immediate\openout \csname tf@#1\endcsname \jobname.#1\relax + \fi + \@nobreakfalse + \endgroup} +% \end{macrocode} +% \end{macro} +% +% \begin{macro}{\addcontentsline} +% The |\addcontentsline{|\meta{table}|}{|\meta{type}|}{|% +% \meta{entry}|}| command allows the user to add +% his/her own entry to a table of contents, etc. The command adds the +% entry |\contentsline{|\meta{type}|}{|\meta{entry}|}{|\meta{page}|}| +% to the |.|\meta{table} file. +% +% This macro is implemented as an aplication of |\addtocontents|. +% Note that |\thepage| is not expandable during |\protected@write| +% therefore one gets the page number at the time of the |\shipout|. +% +% \changes{v1.0c}{1994/05/20}{Correct setting of \cs{protect}.} +% \changes{v1.0j}{1995/04/23}{Use \cs{contentsline} internally.} +% \changes{v1.0h}{1994/11/04}{Added \cs{protected@write} to +% \cs{addcontentsline}. ASAJ.} +% \begin{macrocode} +\def\addcontentsline#1#2#3{% + \addtocontents{#1}{\protect\contentsline{#2}{#3}{\thepage}}} +% \end{macrocode} +% \end{macro} +% +% \changes{v1.0c}{1994/05/20}{Correct setting of \cs{protect}.} +% \changes{v1.0h}{1994/11/04}{Added \cs{protected@write} to +% \cs{addtocontents}. ASAJ.} +% \begin{macro}{\addtocontents} +% +% The |\addtocontents{|\meta{table}|}{|\meta{text}|}| command +% adds \meta{text} to the |.|\meta{table} file, with no +% page number. +% +% \begin{macrocode} +\long\def\addtocontents#1#2{% + \protected@write\@auxout + {\let\label\@gobble \let\index\@gobble \let\glossary\@gobble}% + {\string\@writefile{#1}{#2}}} +% \end{macrocode} +% \end{macro} +% +% \begin{macro}{\contentsline} +% The |\contentsline{|\meta{type}|}{|\meta{entry}|}{|\meta{page}|}| +% macro produces a \meta{type} entry in a table of contents, etc. +% It will appear in the |.toc| or other file. For example, +% The entry for subsection 1.4.3 in the table of contents for +% example, might be produced by: +% +% \begin{verbatim} +% \contentsline{subsection} +% {\makebox{30pt}[r]{1.4.3} Gnats and Gnus}{22} +% \end{verbatim} +% +% The |\protect| command causes command sequences to be written +% without expanding them. +% +% \begin{macrocode} +\def\contentsline#1{\csname l@#1\endcsname} +% \end{macrocode} +% \end{macro} +% +% |\@dottedtocline{|\meta{level}|}{|\meta{indent}|}{|\meta{numwidth}% +% |}{|\meta{title}|}{|\meta{page}|}|: +% Macro to produce a table of contents line with the following +% parameters: +% \begin{description} +% \item[level] If \meta{level} $>$ |\c@tocdepth|, then no line +% produced. +% \item[indent] Total indentation from the left margin. +% \item[numwidth] Width of box for number if the \meta{title} has a +% |\numberline| command. +% As of 25 Jan 1988, this is also the amount of extra +% indentation added to second and later lines of a +% multiple line entry. +% \item[title] Contents of entry. +% \item[page] Page number. +% \end{description} +% +% Uses the following parameters, which must be set by the document +% style. They should be defined with |\def|'s. +% \begin{description} +% \item[|\@pnumwidth|] Width of box in which page number is set. +% \item[|\@tocrmarg|] Right margin indentation for all but last line +% of multiple-line entries. +% \item[|\@dotsep|] Separation between dots, in mu units. +% Should be |\def|'d to a number like 2 or 1.7 +% \end{description} +% +% \begin{macro}{\@dottedtocline} +% \changes{LaTeX2.09}{1991/09/29} +% {(RmS) added \cs{reset@font} for page number} +% \changes{v1.0e}{1994/05/25}{Put braces around argument 4 +% (the actual toc entry) to avoid font (and possibly other) +% changes leaking out to the leaders.} +% \changes{v1.0g}{1994/10/18}{Added \cs{normalcolor} for page number} +% \changes{v1.0z}{1996/12/20}{Added \cs{nobreak} for latex/2343} +% \begin{macrocode} +\def\@dottedtocline#1#2#3#4#5{% + \ifnum #1>\c@tocdepth \else + \vskip \z@ \@plus.2\p@ + {\leftskip #2\relax \rightskip \@tocrmarg \parfillskip -\rightskip + \parindent #2\relax\@afterindenttrue + \interlinepenalty\@M + \leavevmode + \@tempdima #3\relax +% \end{macrocode} +% \changes{v1.0z}{1996/12/20}{Added \cs{nobreak} for latex/2343} +% \begin{macrocode} + \advance\leftskip \@tempdima \null\nobreak\hskip -\leftskip + {#4}\nobreak + \leaders\hbox{$\m@th +% \end{macrocode} +% If a document uses fonts other than computer modern, the use of a +% dot from math can be very disturbing despite the fact that this +% might be the only place in a document that then uses computer +% modern. +% Therefore we surround the dot with an |\hbox| to escape to the +% surrounding text font. +% \changes{v1.0k}{1995/04/25}{Added \cs{hbox} around dots.} +% \changes{v1.0l}{1995/05/02}{Don't reset to \cs{rmfamily}} +% \begin{macrocode} + \mkern \@dotsep mu\hbox{.}\mkern \@dotsep + mu$}\hfill + \nobreak + \hb@xt@\@pnumwidth{\hfil\normalfont \normalcolor #5}% + \par}% + \fi} +% \end{macrocode} +% \end{macro} +% +% \textbf{Note:} |\nobreak|'s added 7 Jan 86 to prevent bad line break +% that left the page number dangling by itself at left edge of a new +% line. +% +% Changed 25 Jan 88 to use |\leftskip| instead of |\hangindent| so +% leaders of multiple-line contents entries would line up properly. +% \begin{macro}{\numberline} +% |\numberline{|\meta{number}|}|: For use in a |\contentsline| command. +% It puts \meta{number} flushleft in a box of width |\@tempdima| +% (Before 25 +% Jan 88 change, it also added |\@tempdima| to the hanging +% indentation.) +% +% \begin{macrocode} +\def\numberline#1{\hb@xt@\@tempdima{#1\hfil}} +% +% \end{macrocode} +% \end{macro} +% +% \Finale +% diff --git a/Master/texmf-dist/source/latex/base/ltspace.dtx b/Master/texmf-dist/source/latex/base/ltspace.dtx new file mode 100644 index 00000000000..e455958dc24 --- /dev/null +++ b/Master/texmf-dist/source/latex/base/ltspace.dtx @@ -0,0 +1,1000 @@ +% \iffalse meta-comment +% +% Copyright 1993 1994 1995 1996 1997 1998 1999 2000 2001 2002 2003 2004 +% The LaTeX3 Project and any individual authors listed elsewhere +% in this file. +% +% This file is part of the LaTeX base system. +% ------------------------------------------- +% +% It may be distributed and/or modified under the +% conditions of the LaTeX Project Public License, either version 1.3 +% of this license or (at your option) any later version. +% The latest version of this license is in +% http://www.latex-project.org/lppl.txt +% and version 1.3 or later is part of all distributions of LaTeX +% version 2003/12/01 or later. +% +% This file has the LPPL maintenance status "maintained". +% +% The list of all files belonging to the LaTeX base distribution is +% given in the file `manifest.txt'. See also `legal.txt' for additional +% information. +% +% The list of derived (unpacked) files belonging to the distribution +% and covered by LPPL is defined by the unpacking scripts (with +% extension .ins) which are part of the distribution. +% +% \fi +% +% \iffalse +%%% From File: ltspace.dtx +%<*driver> +% \fi +\ProvidesFile{ltspace.dtx} + [2004/02/15 v1.3a LaTeX Kernel (spacing)] +% \iffalse +\documentclass{ltxdoc} +\GetFileInfo{ltspace.dtx} +\title{\filename} +\date{\filedate} + \author{% + Johannes Braams\and + David Carlisle\and + Alan Jeffrey\and + Leslie Lamport\and + Frank Mittelbach\and + Chris Rowley\and + Rainer Sch\"opf} +\begin{document} +\maketitle + \DocInput{\filename} +\end{document} +% +% \fi +% +% \CheckSum{459} +% +% \changes{v1.1a}{1994/05/16}{(ASAJ) Split from ltinit.dtx.} +% \changes{v1.2f}{1995/05/25}{Macros moved to ltlists.dtx} +% \changes{v1.2n}{1996/04/22}{Documentation Improvements} +% \changes{v1.2o}{1996/06/22}{Documentation of problems added} +% \changes{v1.2q}{1996/07/27}{Further documentation of problems} +% \changes{v1.2r}{1996/07/27}{Correct documentation of problems} +% \changes{v1.2w}{1998/08/17}{Documentation fixes.} +% +% +% \section{Spacing} +% +% This section deals with spacing, and line- and page-breaking. +% +% \subsection{User Commands} +% +% \DescribeMacro\nopagebreak\oarg{i} : \meta{i} = 0,...,4. +% +% Default argument = 4. Puts a penalty into the vertical list +% output as follows:\\ +% 0 : penalty = 0\\ +% 1 : penalty = |\@lowpenalty|\\ +% 2 : penalty = |\@medpenalty|\\ +% 3 : penalty = |\@highpenalty|\\ +% 4 : penalty = 10000 +% +% \DescribeMacro\pagebreak\oarg{i} : +% same as \nopagebreak except negatives of its penalty +% +% \DescribeMacro\linebreak\oarg{i} : analog of the above +% +% \DescribeMacro\nolinebreak\oarg{i} : analog of the above +% +% \DescribeMacro\samepage : +% inhibits page breaking most places by setting the +% following penalties to 10000:\\ +% |\interlinepenalty|\\ +% |\postdisplaypenalty|\\ +% |\interdisplaylinepenalty|\\ +% |\@beginparpenalty|\\ +% |\@endparpenalty|\\ +% |\@itempenalty|\\ +% |\@secpenalty|\\ +% |\interfootnotelinepenalty| +% +% \DescribeMacro{\\} : initially defined to be |\newline| +% +% |\\|\oarg{length} : initially defined to be +% |\vspace|\marg{length}|\newline|\\ +% Note: |\\*| adds a |\vadjust{\penalty 10000}| +% +% OBSOLETE COMMANDS (which never made it into the manual): +% +% |\obeycr| : defines == |\\\relax|\\ +% |\restorecr| : restores to its usual meaning. +% +% +% \StopEventually{} +% +% \subsection{Chris' comments} +% +% There are several aspects of the handling of space in horizontal +% mode that are inconsistent or do not work well in some cases. +% These are largely concerned with ignoring the effect of space +% tokens that would otherwise typeset an inter-word space. +% +% Negating the effect of such space tokens is achieved by two +% mechanisms: +% \begin{itemize} +% \item |\unskip| is used to remove the glue just added by +% a space that has already had its effect; it is sometimes +% invoked after an |\ifdim| test on |\lastskip| (see below); +% \item |\ignorespaces| is used to ignore space-tokens yet to come. +% \end{itemize} +% +% The test done on |\lastskip| is sometimes for equality with zero and +% sometimes for being positive. Recall also that the test is only on +% the natural length of the glue and that no glue cannot be +% distinguished from glue whose natural length is zero: to summarise, +% a pretty awful test. It is not clear why these tests are not all +% the same; I think that they should all be for equality. One place +% where |\unskip| is often used is just before a |\par| (which itself +% internally does an |\unskip|) and one bit of code (in |\@item|) even +% has two |\unskips| before a |\par|. These uses may be fossil code +% but if they are necessary, maybe |\@killglue| would be even safer. +% +% Such removal of glue by |\unskip| may sometimes have the wrong result, +% removing not the glue from a space-token but other explicit glue; +% this is sometimes not what is intended. +% +% A common way to prevent such removal is to add an |\hskip\z@| after +% the glue that should not be removed. This protects that glue +% against one |\unskip| with no test but not against more than one. +% It does work for `tested |\unskip|s'. This is used +% by |\hspace*| but not by |\hspace|; this is inconsistent as the star +% is supposed to prevent removal only at the beginning of a line, not +% at the end, or in a tabular, etc. +% +% If this reason for removing glue were the only consideration then a +% tested-|\unskip| and protection by |\hskip\z@| would suffice but +% would need to be consistently implemented. +% +% However, the class of invisibles, commands and environments tries to +% be even cleverer: one of these tries to leave only one inter-word +% space whenever there is one before it and one after it; and it does +% this quite well. +% +% But problems can arise when there is not a space-token on +% both sides of it; in particular, when an invisible appears at the +% beginning or end of a piece of text the method still leaves one space +% token whereas usually in these cases it should leave none. +% +% Also, the current rules do not work well when more than one such +% command appears consecutively, separated by space-tokens; it leaves +% glue between every other invisible. +% +% There is also a question about what these commands should do when +% they occur next to spaces that do not come from space tokens but, +% for example, from |\hspace|. Should they still produce `just one +% space'? If so, which one? It is good to note that the manual +% is sufficiently cautious about invisibles that we are not obliged to +% make anything work. +% +% Another interesting side-road to explore is whether the space-tokens +% either side of an |\hspace{...}| should be ignored. +% +% One alternative to the current algorithm that is often suggested is +% that all glue around the invisible should be consolidated into a +% space after it (usually without stating how much glue should be put +% there). The command |\nolinebreak| is implemented this way (and +% |\linebreak| should also be). This does not work correctly for the +% following common case: +% \begin{verbatim} +% ... some text +% \index{some-word} +% some-word and more text. +% \end{verbatim} +% This is optimal coding since it is normal to index a word that gets +% split across a page-break on its starting page. This would, on the +% other hand, fix another common (and documented) failure of the +% current system: when the invisible is the last thing in a paragraph +% the space before it is not removed and, worse, it is also hidden +% from the paragraph-ending mechanism so that an `empty' line can be +% created at the end of the paragraph. +% +% Another deficiency (I think) of the current system is that the +% following is treated as having the |\index| command between the +% paragraphs, which is probably not what the author intended (since +% there is no empty line after it). +% \begin{verbatim} +% +% \index{beginnings} +% Beginnings of paragraphs ... +% \end{verbatim} +% +% I know of no algorithm that will handle satisfactorily even +% all the most common cases; note that it could be that the best +% algorithm may be different for different invisibles since, +% for example, the common uses and expected behaviour of +% |\index|, |\marginpar|, |\linebreak|, |\pagebreak| and +% |\vspace| are somewhat different. [For example, is +% |\vspace| ever used in the middle of a paragraph?] +% +% One method that can (and is) used to make invisible commands produce +% no space when used at the beginning of text is to put in some glue +% that is nearly enough the same as no glue or glue of zero length in +% all respects except for the precise test for not being exactly equal +% to zero; examples of such glue are |\hskip 1sp| and, possibly better +% but more complex, |\hskip -1sp \hskip 1sp|. However, this only works +% when it is known that user-supplied text is about to start. +% +% Some similar concerns apply to the handling of space and penalties +% in vertical mode; there is an extra hurdle here as |\unskip| does +% not work on the main vertical list. The complexity of the tests done +% by |\addvspace| have never been explained. +% +% The implementation of space hacks etc for vertical mode is another +% major area that needs further attention; my earlier experiments +% did not produce much improvement over the current unsatisfactory +% situation. +% +% One particular problem is what happens when the following very +% natural coding is used (part of the problem here is that this looks +% like an hmode problem, but it is not): +% \begin{verbatim} +% ... end of text. +% +% \begin{enumerate} +% \item \label{item:xxx} Item text. +% \end{enumerate} +% \end{verbatim} +% +% \subsection{Some immediate actions} +% +% \begin{itemize} +% \item Fix bug in |\linebreak|. +% \item Fix bug in |\\*|. +% \item Reimplement |\\|, etc, removing extra |\vadjust|s and getting +% better error trapping (this seems to involve a lot more tokens). +% \item Investigate whether |\\|, etc need to be errors in vmode; I +% think that they could be noops (maybe with a warning). +% \item Make all(?) |\unskips| include test for zero skip (rather than +% other tests or no test). +% \item Consider replacing |\hskip 1sp| by something better (here +% called an `infinitesimal' skip). +% \item Look at all |\hskip\z@| (or similar) to see if they should be +% changed to an `infinitesimal' skip. +% \item Resolve the inconsistency between |\hspace| and |\hspace*|. +% \item Remove unnecessary |\unskips|. +% \item Investigate and rationalise the `newline' code. +% \item Find better algorithms for all sorts of things or, easier(?), +% fix \TeX{} itself. +% \end{itemize} +% +% \subsection{The code} +% +% \begin{macrocode} +%<*2ekernel> +\message{spacing,} +% \end{macrocode} +% +% \begin{macro}{\pagebreak} +% \begin{macro}{\nopagebreak} +% \changes{v1.2h}{1995/07/05}{Reimplemented both using \cs{@no@pgbk}} +% \changes{v1.2j}{1995/10/16}{(DPC) Use \cs{@testopt} /1911} +% \begin{macrocode} +\def\pagebreak{\@testopt{\@no@pgbk-}4} +\def\nopagebreak{\@testopt\@no@pgbk4} +% \end{macrocode} +% \end{macro} +% \end{macro} +% +% +% \begin{macro}{\@no@pgbk} +% \changes{v1.2h}{1995/07/05}{Macro replaces \cs{@pgbk} +% and \cs{@nopgbk}} +% \begin{macrocode} +\def\@no@pgbk #1[#2]{% + \ifvmode + \penalty #1\@getpen{#2}% + \else + \@bsphack + \vadjust{\penalty #1\@getpen{#2}}% + \@esphack + \fi} +% \end{macrocode} +% \end{macro} +% +% \begin{macro}{\linebreak} +% \begin{macro}{\nolinebreak} +% \changes{v1.2u}{1996/10/29}{Reimplemented both using \cs{@no@lnbk}} +% \changes{v1.2j}{1995/10/16}{(DPC) Use \cs{@testopt} /1911} +% \begin{macrocode} +\def\linebreak{\@testopt{\@no@lnbk-}4} +\def\nolinebreak{\@testopt\@no@lnbk4} +% \end{macrocode} +% \end{macro} +% \end{macro} +% \begin{macro}{\@no@lnbk} +% \changes{v1.2u}{1996/10/29}{Macro replaces \cs{@lnbk} +% and \cs{@nolnbk}} +% \begin{macrocode} +\def\@no@lnbk #1[#2]{% + \ifvmode + \@nolnerr + \else + \@tempskipa\lastskip + \unskip + \penalty #1\@getpen{#2}% + \ifdim\@tempskipa>\z@ + \hskip\@tempskipa + \ignorespaces + \fi + \fi} +% \end{macrocode} +% \end{macro} +% +% \begin{macro}{\samepage} +% \begin{macrocode} +\def\samepage{\interlinepenalty\@M + \postdisplaypenalty\@M + \interdisplaylinepenalty\@M + \@beginparpenalty\@M + \@endparpenalty\@M + \@itempenalty\@M + \@secpenalty\@M + \interfootnotelinepenalty\@M} +% \end{macrocode} +% \end{macro} +% +% +% \begin{macro}{\\} +% \changes{v1.2a}{1994/11/11}{(DPC) Make robust} +% \changes{v1.2d}{1994/11/14}{(DPC) Macro modified} +% +% \changes{v1.2u}{1996/10/29}{Corrected and rationalised code} +% The purpose of the new code is to fix a few bugs; however, it also +% attempts to optimize the following, in order of priority: +% \begin{enumerate} +% \item efficient execution of plain |\\|; +% \item efficient execution of |\\[...]|; +% \item memory use; +% \item name-space use. +% \end{enumerate} +% The changes should make no difference to the typeset output. +% It appears to be safe to use |\reserved@e| and |\reserved@f| here +% (other reserved macros are somewhat disastrous). +% +% These changes made |\newline| even less robust than it had been, +% so now it is explicitly robust, like |\\|. +% \begin{macro}{\@normalcr} +% The internal definition of the `normal' definition of |\\|. +% \begin{macrocode} +\DeclareRobustCommand\\{% + \let \reserved@e \relax + \let \reserved@f \relax + \@ifstar{\let \reserved@e \vadjust \let \reserved@f \nobreak + \@xnewline}% + \@xnewline} +\expandafter\let\expandafter\@normalcr + \csname\expandafter\@gobble\string\\ \endcsname +% \end{macrocode} +% \end{macro} +% \end{macro} +% \begin{macro}{\newline} +% A simple form of the `normal' definition of |\\|. +% \changes{v1.2v}{1997/05/07}{Made completely robust.} +% \begin{macrocode} +\DeclareRobustCommand\newline{\@normalcr\relax} +% \end{macrocode} +% \end{macro} +% +% \begin{macro}{\@xnewline} +% \begin{macrocode} +\def\@xnewline{\@ifnextchar[% ] bracket matching + \@newline + {\@gnewline\relax}} +% \end{macrocode} +% \end{macro} +% +% \begin{macro}{\@newline} +% \begin{macrocode} +\def\@newline[#1]{\let \reserved@e \vadjust + \@gnewline {\vskip #1}} +% \end{macrocode} +% \end{macro} +% +% \begin{macro}{\@gnewline} +% \changes{v1.2u}{1996/10/29}{Added macro} +% The |\nobreak| added to prevent null lines when |\\| +% ends an overfull line. Change made 24 May 89 as suggested by +% Frank Mittelbach and Rainer Sch\"opf +% \changes{v1.2h}{1995/07/05}{Use \cs{break}} +% \begin{macrocode} +\def\@gnewline #1{% + \ifvmode + \@nolnerr + \else + \unskip \reserved@e {\reserved@f#1}\nobreak \hfil \break + \fi} +% \end{macrocode} +% \end{macro} +% +% +% \begin{macro}{\@getpen} +% \begin{macrocode} +\def\@getpen#1{\ifcase #1 \z@ \or \@lowpenalty\or + \@medpenalty \or \@highpenalty + \else \@M \fi} +% \end{macrocode} +% \end{macro} +% +% +% \begin{macro}{\if@nobreak} +% \changes{v1.2p}{1996/07/26}{put \cs{global} inside definition} +% Switch used to avoid page breaks caused by |\label| after a +% section heading, etc. It should be \textbf{GLOBALLY} set true +% after the |\nobreak| and \textbf{globally} set false by the +% next invocation of |\everypar|. +% +% Commands that reset |\everypar| should globally set it false if +% appropriate. +% \begin{macrocode} +\def\@nobreakfalse{\global\let\if@nobreak\iffalse} +\def\@nobreaktrue {\global\let\if@nobreak\iftrue} +\@nobreakfalse +% \end{macrocode} +% \end{macro} +% +% +% +% \begin{macro}{\@savsk} +% \begin{macro}{\@savsf} +% Registers used to save the space factor and last skip. +% \begin{macrocode} +\newdimen\@savsk +\newcount\@savsf +% \end{macrocode} +% \end{macro} +% \end{macro} +% +% +% +% +% \begin{macro}{\@bsphack} +% \changes{LaTeX2e}{1993/12/08} +% {Command reimplemented; late birthday present for Chris} +% \changes{LaTeX2e}{1993/12/08}{Command reimplemented} +% \changes{LaTeX2e}{1993/12/16}{Corrected optimisation :-)} +% |\@bsphack| and |\@esphack| +% used by macros such as |\index| and +% |\begin{@float}| \ldots |\end{@float}| +% that want to be invisible --- i.e., +% not leave any extra space when used in the middle of text. Such +% a macro should begin with |\@bsphack| and end with |\@esphack| +% The macro in question should not create any text, nor change the +% mode. +% +% Before giving the current definition we give an extended definition +% that is currently not used (because it doesnt work as advertised:-) +% +% These are generalised hacks which attempt to do sensible things +% when `invisible commands' appear in vmode too. +% +% They need to cope with space in both hmode (plus spacefactor) and +% vmode, and also cope with breaks etc. In vmode this means +% ensuring that any following |\addvspace|, etc sees the correct +% glue in |\lastskip|. +% +% In fact, these improved versions should be used for other cases +% of `whatsits, thingies etc' which should be invisible. They are +% only for commands, not environments (see notes on |\@Esphack|). +% +% BTW, anyone know why the standard hacks are surrounded by +% |\ifmmode\else| rather than simply |\ifhmode|? +% +% And are there any cases where saving the spacefactor is +% essential? I have some extensions where it is, but it does not +% appear to be so in the standard uses. +%\begin{verbatim} +%\def \@bsphack{% +% \relax \ifvmode +% \@savsk \lastskip +% \ifdim \lastskip=\z@ +% \else +% \vskip -\lastskip +% \fi +% \else +% \ifhmode +% \@savsk \lastskip +% \@savsf \spacefactor +% \fi +% \fi +%} +%\end{verbatim} +% I think that, in vmode, it is the safest to put +% in a |\nobreak| immediately after such things since writes, +% inserts etc followed by glue give valid breakpoints and, in +% general, it is possible to create breaks but impossible to +% destroy them. +%\begin{verbatim} +%\def \@esphack{% +% \relax \ifvmode +% \nobreak +% \ifdim \@savsk=\z@ +% \else +% \vskip\@savsk +% \fi +% \else +% \ifhmode +% \spacefactor \@savsf +% \ifdim \@savsk>\z@ +% \ignorespaces +% \fi +% \fi +% \fi +%} +%\end{verbatim} +% For the moment we are going to ignore the vertical versions until +% they are correct. +% \changes{LaTeX2e}{1993/12/19}{There seem to be problems with selfmade +% birthday presents} +% \begin{macrocode} +\def\@bsphack{% + \relax + \ifhmode + \@savsk\lastskip + \@savsf\spacefactor + \fi} +% \end{macrocode} +% \end{macro} +% +% \begin{macro}{\@esphack} +% Companion to |\@bsphack|. +% \begin{macrocode} +\def\@esphack{% + \relax + \ifhmode + \spacefactor\@savsf + \ifdim\@savsk>\z@ + \ignorespaces + \fi + \fi} +% \end{macrocode} +% \end{macro} +% +% \begin{macro}{\@Esphack} +% A variant of |\@esphack| that sets the |@ignore| switch to +% true (as |\@esphack| used to do previously). +% This is currently used only for floats and similar environments. +% \changes{v1.2s}{1996/08/02}{Remove \cs{global} before \cs{@ignore...}} +% \begin{macrocode} +\def\@Esphack{% + \relax + \ifhmode + \spacefactor\@savsf + \ifdim\@savsk>\z@ + \@ignoretrue + \ignorespaces + \fi + \fi} +% \end{macrocode} +% \end{macro} +% +% +% \begin{macro}{\@vbsphack} +% \changes{LaTeX2e}{1993/12/08}{Command added} +% Another variant which is useful for invisible things which should +% not live in vmode (this is how some people feel about marginals). +% +% If it occurs in vmode then it enters hmode and ensures that +% |\@savsk| is nonzero so that the |\ignorespaces| is put in later. +% It is not used at present. +% \changes{v1.2f}{1995/05/25}{(CAR) not used so `removed'.} +%\begin{verbatim} +% \def \@vbsphack{ % +% \relax \ifvmode +% \leavevmode +% \@savsk 1sp +% \@savsf \spacefactor +% \else +% \ifhmode +% \@savsk \lastskip +% \@savsf \spacefactor +% \fi +% \fi +% } +%\end{verbatim} +% \end{macro} +% +% +% \subsection{Vertical spacing} +% +% +% \LaTeX\ supports the plain \TeX\ commands +% |\smallskip|, |\medskip| and |\bigskip|. +% However, it redefines them using |\vspace| instead of |\vskip|. +% +% Extra vertical space is added by the command +% |\addvspace|\marg{skip}, +% which adds a vertical skip of \meta{skip} to the document. +% The sequence\\ +% |\addvspace|\marg{s1} |\addvspace|\marg{s2} +% is equivalent to\\ +% |\addvspace|\marg{maximum of s1, s2}. +% +% |\addvspace| should be used only in vertical mode, and gives an +% error if it's not. The |\addvspace| command does \emph{not} add +% vertical space if |@minipage| is true. The minipage environment uses +% this to inhibit the addition of extra vertical space at the beginning. +% +% Penalties are put into the vertical list with the +% |\addpenalty|\marg{penalty} +% command. It works properly when |\addpenalty| and |\addvspace| +% commands are mixed. +% +% The |@nobreak| switch is set true used when in vertical mode and no +% page break should occur. (Right now, it is used only by the section +% heading commands to inhibit page breaking after a heading.) +% +% +%\begin{verbatim} +% \addvspace{SKIP} == +% BEGIN +% if vmode +% then if @minipage +% else if \lastskip =0 +% then \vskip SKIP +% else if \lastskip < SKIP +% then \vskip -\lastskip +% \vskip SKIP +% else if SKIP < 0 and \lastskip >= 0 +% then \vskip -\lastskip +% \vskip \lastskip + SKIP +% fi fi fi fi +% else useful error message (CAR). +% fi +% END +%\end{verbatim} +% +% \begin{macro}{\@xaddvskip} +% Internal macro for |\vspace| handling the case that space has +% previously been added. +% \begin{macrocode} +\def\@xaddvskip{% + \ifdim\lastskip<\@tempskipb + \vskip-\lastskip + \vskip\@tempskipb + \else + \ifdim\@tempskipb<\z@ + \ifdim\lastskip<\z@ + \else + \advance\@tempskipb\lastskip + \vskip-\lastskip + \vskip \@tempskipb + \fi + \fi + \fi} +% \end{macrocode} +% \end{macro} +% +% +% \begin{macro}{\addvspace} +% \changes{v1.2b}{1994/11/12}{Corrected error message} +% \changes{v1.2c}{1994/11/13}{Recorrected error message} +% Add vertical space taking into account space already added, as +% described above. +% \begin{macrocode} +\def\addvspace#1{% + \ifvmode + \if@minipage\else + \ifdim \lastskip =\z@ + \vskip #1\relax + \else + \@tempskipb#1\relax + \@xaddvskip + \fi + \fi + \else + \@noitemerr + \fi} +% \end{macrocode} +% \end{macro} +% +% \begin{macro}{\addpenalty} +% \changes{v1.2b}{1994/11/12}{Corrected error message} +% \changes{v1.2c}{1994/11/13}{Recorrected error message} +% \begin{macrocode} +\def\addpenalty#1{% + \ifvmode + \if@minipage + \else + \if@nobreak + \else + \ifdim\lastskip=\z@ + \penalty#1\relax + \else + \@tempskipb\lastskip + \vskip -\lastskip + \penalty#1% + \vskip\@tempskipb + \fi + \fi + \fi + \else + \@noitemerr + \fi} +% \end{macrocode} +% \end{macro} +% +% \begin{macro}{\vspace} +% \changes{v1.2m}{1996/01/20}{Made robust} +% \begin{macro}{\@vspace} +% \begin{macro}{\@vspacer} +% \changes{v1.2f}{1995/05/25} +% {(CAR) macros modified to be more efficient} +% \changes{v1.2f}{1995/05/25}{(CAR) \cs{@restorepar} added to avoid +% possible infinite tail recursion caused by a typo in the argument.} +% The new code for these commands depends on the following facts: +% \begin{itemize} +% \item The value of prevdepth is changed only when a box or rule +% is created and added to a vertical list; +% \item The value of prevdepth is used only when a box is created +% and added to a vertical list; +% \item The value of prevdepth is always local to the building of +% one vertical list. +% \end{itemize} +% \begin{macrocode} +\DeclareRobustCommand\vspace{\@ifstar\@vspacer\@vspace} +\def\@vspace #1{% + \ifvmode + \vskip #1 + \vskip\z@skip + \else + \@bsphack + \vadjust{\@restorepar + \vskip #1 + \vskip\z@skip + }% + \@esphack + \fi} +% \end{macrocode} +% +% \begin{macrocode} +\def\@vspacer#1{% + \ifvmode + \dimen@\prevdepth + \hrule \@height\z@ + \nobreak + \vskip #1 + \vskip\z@skip + \prevdepth\dimen@ + \else + \@bsphack + \vadjust{\@restorepar + \hrule \@height\z@ + \nobreak + \vskip #1 + \vskip\z@skip}% + \@esphack + \fi} +% \end{macrocode} +% \end{macro} +% \end{macro} +% \end{macro} +% +% \begin{macro}{\smallskip} +% \begin{macro}{\medskip} +% \begin{macro}{\bigskip} +% \begin{macrocode} +\def\smallskip{\vspace\smallskipamount} +\def\medskip{\vspace\medskipamount} +\def\bigskip{\vspace\bigskipamount} +% \end{macrocode} +% \end{macro} +% \end{macro} +% \end{macro} +% +% \begin{macro}{\smallskipamount} +% \begin{macro}{\medskipamount} +% \begin{macro}{\bigskipamount} +% \begin{macrocode} +\newskip\smallskipamount \smallskipamount=3pt plus 1pt minus 1pt +\newskip\medskipamount \medskipamount =6pt plus 2pt minus 2pt +\newskip\bigskipamount \bigskipamount =12pt plus 4pt minus 4pt +% \end{macrocode} +% \end{macro} +% \end{macro} +% \end{macro} +% +% +% +% \subsection{Horizontal space (and breaks)} +% +% \begin{macro}{\nobreakdashes} +% \changes{v1.3}{2004/02/04}{(Macro added} +% \changes{v1.3a}{2004/02/15}{(Added spacefactor setting} +% This idea is borrowed from the \textsf{amsmath} package but +% here we define a robust command. +% +% This command is a low-level command designed for use only before +% hyphens or dashes (such as |-|, |--|, or |---|). +% +% It could probably be better implemented: it may need its own +% private token register and temporary commmand. +% +% Setting the hyphen in a box and then unboxing it means that the +% normal penalty will not be added after it---and if the penalty is +% not there a break will not be taken (unless an explicit penalty +% or glue follows, thus the final \verb=\nobreak=). +% +% Note that even if it is not followed by a `-', it still leaves +% vmode and sets the spacefactor; so use it carefully! +% +% \begin{macrocode} +\DeclareRobustCommand{\nobreakdashes}{% + \leavevmode + \toks@{}% + \def\reserved@a##1{\toks@\expandafter{\the\toks@-}% + \futurelet\@let@token \reserved@b}% + \def\reserved@b {\ifx\@let@token -% + \expandafter\reserved@a + \else + \setbox\z@ \hbox{\the\toks@\nobreak}% + \unhbox\z@ + \spacefactor\sfcode`\- + \fi}% + \futurelet\@let@token \reserved@b +} +% \end{macrocode} +% \end{macro} +% +% \begin{macro}{\nobreakspace} +% \changes{v1.2k}{1995/12/04}{(Macro added} +% \begin{macro}{\@xobeysp} +% \changes{v1.2t}{1996/09/28}{Moved from ltmiscen.dtx and redefined to +% use \cs{nobreakspace }} +% +% This is a robust command that produces a horizontal space at +% which, in paragraph-mode, a line-break is not possible. We then +% define an active |~| to expand to it since this is the documented +% behaviour of |~|. One reason for introducing this is that some +% 8-bit input encodings have a slot for such a space and we do not +% want to use active characters as the \LaTeX{} internal commands. +% +% The braces in the definition of |~| are needed to ensure that a +% following space is preserved when reading to/from internal files. +% \changes{v1.2l}{1995/12/04}{(braces added to definition of tilde} +% +% We need to keep \cs{@xobeysp} as it is widely used; so here it is +% let to the non-robust command \cs{nobreakspace }. +% +% \begin{macrocode} +\DeclareRobustCommand{\nobreakspace}{% + \leavevmode\nobreak\ } +\catcode `\~=13 +\def~{\nobreakspace{}} +\expandafter\let\expandafter\@xobeysp\csname nobreakspace \endcsname +% \end{macrocode} +% \end{macro} +% \end{macro} +% +% \begin{macrocode} +% \end{macrocode} +% +% +% \begin{macro}{\,} +% Used in paragraph mode produces a |\thinspace|. It has the +% ordinary definition in math mode. Useful for quotes inside quotes, +% as in |``\,`Foo', he said.''| +% \changes{v1.0o}{1994/05/11}{Use \cs{DeclareRobustCommand}. ASAJ.} +% \begin{macrocode} +\DeclareRobustCommand{\,}{% + \relax\ifmmode\mskip\thinmuskip\else\thinspace\fi +} +% \end{macrocode} +% \end{macro} +% +% \begin{macro}{\@} +% Placed before a '.', makes it a sentence-ending period. Does the +% right thing for other punctuation marks as well. Does this by +% setting spacefactor to 1000. +% \begin{macrocode} +\def\@{\spacefactor\@m} +% \end{macrocode} +% \end{macro} +% +% +% \begin{macro}{\hspace} +% \changes{v1.0o}{1994/05/11}{Use \cs{DeclareRobustCommand}. ASAJ.} +% \begin{macrocode} +\DeclareRobustCommand\hspace{\@ifstar\@hspacer\@hspace} +% \end{macrocode} +% \end{macro} +% +% \begin{macro}{\@hspace} +% \changes{LaTeX2e}{1993/08/05} +% {(RmS) Removed superfluous \cs{leavevmode} in \cs{@hspace} and +% \cs{@hspacer}, as suggested by CAR.} +% \begin{macrocode} +\def\@hspace#1{\hskip #1\relax} +% \end{macrocode} +% \end{macro} +% +% +% \begin{macro}{\@hspacer} +% extra |\hskip 0pt| added 1985/17/12 to guard +% against a following |\unskip| +% |\relax| added 13 Oct 88 for usual \TeX\ lossage +% replaced both changes by |\hskip\z@skip| 27 Nov 91 +% \begin{macrocode} +\def\@hspacer#1{\vrule \@width\z@\nobreak + \hskip #1\hskip \z@skip} +% \end{macrocode} +% \end{macro} +% +% +% +% \begin{macro}{\fill} +% \begin{macrocode} +\newskip\fill +\fill = 0pt plus 1fill +% \end{macrocode} +% \end{macro} +% +% +% +% \begin{macro}{\stretch} +% \begin{macrocode} +\def\stretch#1{\z@ \@plus #1fill\relax} +% \end{macrocode} +% \end{macro} +% +% +% +% +% \begin{macro}{\thinspace} +% \begin{macro}{\negthinspace} +% \begin{macro}{\enspace} +% \begin{macrocode} +\def\thinspace{\kern .16667em } +\def\negthinspace{\kern-.16667em } +\def\enspace{\kern.5em } +% \end{macrocode} +% \end{macro} +% \end{macro} +% \end{macro} +% +% \begin{macro}{\enskip} +% \begin{macro}{\quad} +% \begin{macro}{\qquad} +% \begin{macrocode} +\def\enskip{\hskip.5em\relax} +\def\quad{\hskip1em\relax} +\def\qquad{\hskip2em\relax} +% \end{macrocode} +% \end{macro} +% \end{macro} +% \end{macro} +% +% \begin{macro}{\obeycr} +% \begin{macro}{\restorecr} +% The following definitions will probably get deleted or moved to +% compatibility mode soon. +% +% \changes{v1.2g}{1995/06/11} +% {(CAR) \cs{relax} added to stop silent eating of *.} +% \begin{macrocode} +{\catcode`\^^M=13 \gdef\obeycr{\catcode`\^^M13 \def^^M{\\\relax}% + \@gobblecr}% +{\catcode`\^^M=13 \gdef\@gobblecr{\@ifnextchar +\@gobble\ignorespaces}} +\gdef\restorecr{\catcode`\^^M5 }} +% \end{macrocode} +% \end{macro} +% \end{macro} +% +% \begin{macrocode} +% +% \end{macrocode} +% +% \Finale +\endinput + diff --git a/Master/texmf-dist/source/latex/base/lttab.dtx b/Master/texmf-dist/source/latex/base/lttab.dtx new file mode 100644 index 00000000000..501e9455faa --- /dev/null +++ b/Master/texmf-dist/source/latex/base/lttab.dtx @@ -0,0 +1,1621 @@ +% \iffalse meta-comment +% +% Copyright 1993 1994 1995 1996 1997 1998 1999 2000 2001 2002 2003 2004 +% The LaTeX3 Project and any individual authors listed elsewhere +% in this file. +% +% This file is part of the LaTeX base system. +% ------------------------------------------- +% +% It may be distributed and/or modified under the +% conditions of the LaTeX Project Public License, either version 1.3 +% of this license or (at your option) any later version. +% The latest version of this license is in +% http://www.latex-project.org/lppl.txt +% and version 1.3 or later is part of all distributions of LaTeX +% version 2003/12/01 or later. +% +% This file has the LPPL maintenance status "maintained". +% +% The list of all files belonging to the LaTeX base distribution is +% given in the file `manifest.txt'. See also `legal.txt' for additional +% information. +% +% The list of derived (unpacked) files belonging to the distribution +% and covered by LPPL is defined by the unpacking scripts (with +% extension .ins) which are part of the distribution. +% +% \fi +% +% \iffalse +%%% From File: lttab.dtx +%\ProvidesFile{autotabg.sty} +% [1998/11/13 v1.1m tabbing autoload file] +%<*driver> +% \fi +\ProvidesFile{lttab.dtx}[1998/11/13 v1.1m LaTeX Kernel (Columns)] +% \iffalse +\documentclass{ltxdoc} +\GetFileInfo{lttab.dtx} +\title{\filename} +\date{\filedate} + \author{% + Johannes Braams\and + David Carlisle\and + Alan Jeffrey\and + Leslie Lamport\and + Frank Mittelbach\and + Chris Rowley\and + Rainer Sch\"opf} + +\begin{document} +\maketitle + \DocInput{\filename} +\end{document} +% +% \fi +% +% +% \CheckSum{1131} +% +% \changes{v1.0l}{1995/05/07}{Use \cs{hb@xt@}} +% \changes{v1.1a}{1995/05/22}{Support autoloading feature} +% \changes{v1.1b}{1995/06/14}{Use \cs{ProvidesFile} in autoload} +% \changes{v1.1d}{1995/10/04}{Modify autoload support} +% \changes{v1.1k}{1998/06/18}{Small addition to documentation} +% \changes{v1.1l}{1998/07/06}{Small correction to documentation} +% +% \section{Tabbing, Tabular and Array Environments} +% This section deals with `Lining It Up in Columns'. First the +% |tabbing| environment is defined, and then in second part, |tabular| +% together with its variants, |tabular*| and |array|. +% +% Note that the |tabular| defined here is essentially the original +% \LaTeX~2.09 version, not the extended version described in \emph{The +% \LaTeX\ Companion}. Use the |array| package to obtain the extended +% version. +% +% \StopEventually{} +% +% +% \changes{v1.0a}{1994/03/04}{Initial version, split from latex.dtx} +% \changes{v1.0a}{1994/03/07}{Long lines wrapped to 72 columns} +% \changes{v1.0b}{1994/03/28}{Improve documentation} +% \changes{v1.0c}{1994/05/07}{Removed definition of \cs{+}} +% \changes{v1.0c}{1994/05/07}{Removed surplus braces from +% \cs{@ifnextchar} constructs} +% \changes{v1.0f}{1994/05/21}{Use new error commands} +% \changes{v1.0j}{1994/11/17} +% {\cs{@tempa} to \cs{reserved@a}} +% +% \subsection{tabbing} +% +% \begin{oldcomments} +% +% \dimen(\@firsttab + i) = distance of tab stop i from left margin +% 0 <= i <= 15 (?). +% +% \dimen\@firsttab is initialized to \@totalleftmargin, so it starts +% at the prevailing left margin. +% +% \@maxtab = number of highest defined tab register +% probably = \@firsttab + 12 +% \@nxttabmar = tab stop number of next line's left margin +% \@curtabmar = tab stop number of current line's left margin +% \@curtab = number of the current tab. At start of line, +% it equals \@curtabmar +% \@hightab = largest tab number currently defined. +% \@tabpush = depth of \pushtab's +% +% \box\@curline = contents of current line, excluding left margin +% skip, and excluding contents of current field +% \box\@curfield = contents of current field +% +% @rjfield = switch: T iff the last field of the line should +% be right-justified at the right margin. +% +% \tabbingsep = distance left by the \' command between the +% current position and the field that is +% ``left-shifted''. +% +% UTILITY MACROS +% \@stopfield : closes the current field +% \@addfield : adds the current field to the current line. +% \@contfield : continues the current field +% \@startfield : begins the next field +% \@stopline : closes the current line and outputs it +% \@startline : starts the next line +% \@ifatmargin : an \if that is true iff the current line. +% has width zero +% +% \@startline == +% BEGIN +% \@curtabmar :=G \@nxttabmar +% \@curtab :=G \@curtabmar +% \box\@curline :=G null +% \@startfield +% \strut +% END +% +% \@stopline == +% BEGIN +% \unskip +% \@stopfield +% if @rjfield = T +% then @rjfield :=G F +% \@tempdima := \@totalleftmargin + \linewidth +% \hb@xt@ \@tempdima{\@itemfudge +% \hskip \dimen\@curtabmar +% \box\@curline +% \hfil +% \box\@curfield} +% else \@addfield +% \hbox {\@itemfudge +% \hskip \dimen\@curtabmar +% \box\@curline} +% fi +% END +% +% \@startfield == +% BEGIN +% \box\@curfield :=G \hbox { +% END +% +% \@stopfield == +% BEGIN +% } +% END +% +% \@contfield == +% BEGIN +% \box\@curfield :=G \hbox { \unhbox\@currfield %%} brace matching +% END +% \@addfield == +% BEGIN +% \box\@curline :=G \unbox\@curline * \unbox\@curfield +% END +% +% \@ifatmargin == +% BEGIN +% if dim of box\@curline = 0pt then +% END +% +% +% \tabbing == +% BEGIN +% \lineskip :=L 0pt +% \> == \@rtab +% \< == \@ltab +% \= == \@settab +% \+ == \@tabplus +% \- == \@tabminus +% \` == \@tabrj +% \' == \@tablab +% \\ == BEGIN \@stopline \@startline END +% \\[DIST] == BEGIN +% \@stopline \vskip DIST \@startline\ignorespaces END +% \\* == BEGIN \@stopline \penalty 10000 \@startline END +% \\*[DIST] == BEGIN \@stopline \penalty 10000 \vskip DIST +% \@startline\ignorespaces END +% \@hightab := \@nxttabmar :=G \@firsttab +% \@tabpush :=G 0 +% \dimen\@firsttab := \@totalleftmargin +% @rjfield :=G F +% \trivlist \item\relax +% if @minipage = F then \vskip \parskip fi +% \box\@tabfbox = \rlap{\indent\the\everypar} +% % note: \the\everypar sets @inlabel :=G F +% \@itemfudge == BEGIN \box\@tabfbox END +% \@startline +% \ignorespaces +% END +% +% \@endtabbing == +% BEGIN +% \@stopline +% if \@tabpush > 0 then error message: ''unmatched \poptabs'' fi +% \endtrivlist +% END +% +% \@rtab == +% BEGIN +% \@stopfield +% \@addfield +% if \@curtab < \@hightab +% then \@curtab :=G \@curtab + 1 +% else error message ``Undefined Tab'' fi +% \@tempdima := \dimen\@curtab - \dimen\@curtabmar +% - width of box \@curline +% \box\@curline :=G \hbox{\unhbox\@curline + \hskip\@tempdima} +% \@startfield +% END +% +% \@settab == +% BEGIN +% \@stopfield +% \@addfield +% if \@curtab < \@maxtab +% then \@curtab :=G \@curtab+1 +% else error message: ``Too many tabs'' fi +% if \@curtab > \@hightab +% then \@hightab :=L \@curtab fi +% \dimen\@curtab :=L \dimen\@curtabmar + width of \box\@curline +% \@startfield +% END +% +% \@ltab == +% BEGIN +% \@ifatmargin +% then if \@curtabmar > \@firsttab +% then \@curtab :=G \@curtab - 1 +% \@curtabmar :=G \@curtabmar - 1 +% else error message ``Too many untabs'' fi +% else error message ``Left tab in middle of line'' +% fi +% END +% +% \@tabplus == +% BEGIN +% if \@nxttabmar < \@hightab +% then \@nxttabmar :=G \@nxttabmar+1 +% else error message ``Undefined tab'' +% fi +% END +% +% \@tabminus == +% BEGIN +% if \@nxttabmar > \@firsttab +% then \@nxttabmar :=G \@nxttabmar-1 +% else error message ``Too many untabs'' +% fi +% END +% +% \@tabrj == +% BEGIN \@stopfield +% \@addfield +% @rjfield :=G T +% \@startfield +% END +% +% \@tablab == +% BEGIN \@stopfield +% \box\@curline G:= \hbox{\box\@curline %% `G' added 17 Jun 86 +% \hskip - width of \box\@curfield +% \hskip -\tabbingsep +% \box\@curfield +% \hskip \tabbingsep } +% \@startfield +% END +% +% \pushtabs == +% BEGIN +% \@stopfield +% \@tabpush :=G \@tabpush + 1 +% \begingroup +% \@contfield +% END +% +% \poptabs == +% BEGIN +% \@stopfield +% if \@tabpush > 0 +% then \endgroup +% \@tabpush :=G \@tabpush - 1 +% else error message: ``Too many \poptabs'' +% fi +% \@contfield +% END +% +% \end{oldcomments} +% +% \begin{macro}{\a} +% The accents |\`| , |\'| , and |\=| that have been redefined inside a +% tabbing environment can be called by typing |\a`| , |\a'| , and |\a=|. +% The macro |\a| is defined in |ltoutenc.dtx|. +% \changes{v1.0d}{1994/05/13} +% {moved to ltoutenc} +% \end{macro} +% +% +% The `2ekernel' code ensures that a |\usepackage{autotabg}| is +% essentially ignored if a `full' format is being used that has +% picture mode already in the format. +% \begin{macrocode} +%<2ekernel>\expandafter\let\csname ver@autotabg.sty\endcsname\fmtversion +% \end{macrocode} +% +% \begin{macro}{\@firsttab} +% \begin{macro}{\@maxtab} +% \changes{v1.0c}{1994/05/07}{Changed \cs{@firsttab} to \cs{chardef}} +% \changes{v1.0c}{1994/05/07}{Changed \cs{@maxtab} to \cs{chardef}} +% \begin{macrocode} +%<*2ekernel|autoload> +\newdimen\@gtempa +\chardef\@firsttab=\the\allocationnumber +\newdimen\@gtempa\newdimen\@gtempa\newdimen\@gtempa\newdimen\@gtempa +\newdimen\@gtempa\newdimen\@gtempa\newdimen\@gtempa\newdimen\@gtempa +\newdimen\@gtempa\newdimen\@gtempa\newdimen\@gtempa\newdimen\@gtempa +\newdimen\@gtempa +\chardef\@maxtab=\the\allocationnumber +\dimen\@firsttab=0pt +% \end{macrocode} +% \end{macro} +% \end{macro} +% +% \begin{macro}{\@nxttabmar} +% \begin{macro}{\@curtabmar} +% \begin{macro}{\@curtab} +% \begin{macro}{\@hightab} +% \begin{macro}{\@tabpush} +% \begin{macrocode} +\newcount\@nxttabmar +\newcount\@curtabmar +\newcount\@curtab +\newcount\@hightab +\newcount\@tabpush +% \end{macrocode} +% \end{macro} +% \end{macro} +% \end{macro} +% \end{macro} +% \end{macro} +% +% \begin{macro}{\@curline} +% \begin{macro}{\@curfield} +% \begin{macro}{\@tabfbox} +% \begin{macrocode} +\newbox\@curline +\newbox\@curfield +\newbox\@tabfbox +% \end{macrocode} +% \end{macro} +% \end{macro} +% \end{macro} +% +% \begin{macrocode} +% +%<*2ekernel|def> +% \end{macrocode} +% +% \begin{macro}{\if@rjfield} +% \begin{macrocode} +\newif\if@rjfield +% \end{macrocode} +% \end{macro} +% +% \begin{macro}{\@startline} +% \changes{v1.1f}{1995/10/23}{(CAR)Ensure that \cs{@nxttabmar} is never +% larger than \cs{@hightab}} +% It is, in some sense, an error if the current margin +% tab setting is higher than the value of |\@hightab| (which is +% a local variable). That this is allowed is a fundamental design +% flaw which is not going to be corrected now. +% \begin{macrocode} +\gdef\@startline{% + \ifnum \@nxttabmar >\@hightab + \@badtab + \global\@nxttabmar \@hightab + \fi + \global\@curtabmar \@nxttabmar + \global\@curtab \@curtabmar + \global\setbox\@curline \hbox {}% + \@startfield + \strut} +% \end{macrocode} +% \end{macro} +% +% \begin{macro}{\@stopline} +% \begin{macrocode} +\gdef\@stopline{% + \unskip + \@stopfield + \if@rjfield + \global\@rjfieldfalse + \@tempdima\@totalleftmargin + \advance\@tempdima\linewidth + \hb@xt@\@tempdima{% + \@itemfudge\hskip\dimen\@curtabmar + \box\@curline + \hfil + \box\@curfield}% + \else + \@addfield + \hbox{\@itemfudge\hskip\dimen\@curtabmar\box\@curline}% + \fi} +% \end{macrocode} +% \end{macro} +% +% \begin{macro}{\@startfield} +% \changes{v1.0d}{1994/05/13} +% {Colour support} +% \begin{macrocode} +\gdef\@startfield{% + \global\setbox\@curfield\hbox\bgroup\color@begingroup} +% \end{macrocode} +% \end{macro} +% +% \begin{macro}{\@stopfield} +% \changes{v1.0d}{1994/05/13} +% {Colour support} +% \begin{macrocode} +\gdef\@stopfield{% + \color@endgroup\egroup} +% \end{macrocode} +% \end{macro} +% +% \begin{macro}{\@contfield} +% \changes{v1.0d}{1994/05/13} +% {Colour support} +% \begin{macrocode} +\gdef\@contfield{% + \global\setbox\@curfield\hbox\bgroup\color@begingroup + \unhbox\@curfield} +% \end{macrocode} +% \end{macro} +% +% \begin{macro}{\@addfield} +% \begin{macrocode} +\gdef\@addfield{\global\setbox\@curline\hbox{\unhbox + \@curline\unhbox\@curfield}} +% \end{macrocode} +% \end{macro} +% +% \begin{macro}{\@ifatmargin} +% \begin{macrocode} +\gdef\@ifatmargin{\ifdim \wd\@curline =\z@} +% \end{macrocode} +% \end{macro} +% +% \begin{macro}{\@tabcr} +% \begin{macrocode} +\gdef\@tabcr{\@stopline \@ifstar{\penalty \@M \@xtabcr}\@xtabcr} +% \end{macrocode} +% \end{macro} +% +% \begin{macro}{\@xtabcr} +% \begin{macrocode} +\gdef\@xtabcr{\@ifnextchar[\@itabcr{\@startline\ignorespaces}} +% \end{macrocode} +% \end{macro} +% +% \begin{macro}{\@itabcr} +% \begin{macrocode} +\gdef\@itabcr[#1]{\vskip #1\@startline\ignorespaces} +% \end{macrocode} +% +% \begin{macrocode} +\gdef\kill{\@stopfield\@startline\ignorespaces} +% \end{macrocode} +% \end{macro} +% +% \begin{macro}{\tabbing} +% \changes{v1.1f}{1995/10/23}{(CAR)Make \cs{@hightab} consistently a +% local variable} +% \changes{latex2e}{1993/12/13}{Removed optional argument of \cs{item}} +% We use |\relax| to prevent |\item| from scanning too far. +% \begin{macrocode} +\gdef\tabbing{\lineskip \z@skip\let\>\@rtab\let\<\@ltab\let\=\@settab + \let\+\@tabplus\let\-\@tabminus\let\`\@tabrj\let\'\@tablab + \let\\=\@tabcr + \@hightab\@firsttab + \global\@nxttabmar\@firsttab + \dimen\@firsttab\@totalleftmargin + \global\@tabpush\z@ \global\@rjfieldfalse + \trivlist \item\relax + \if@minipage\else\vskip\parskip\fi +% \end{macrocode} +% \changes{v1.1i}{1996/10/21}{Moved the \cs{indent} so that the +% \cs{everypar} can remove it when necessary; this is needed because +% the code for items in lists has changed (see pr/22111)} +% \begin{macrocode} + \setbox\@tabfbox\hbox{% + \rlap{\hskip\@totalleftmargin\indent\the\everypar}}% + \def\@itemfudge{\box\@tabfbox}% + \@startline\ignorespaces} +% \end{macrocode} +% \end{macro} +% +% \begin{macro}{\endtabbing} +% \begin{macrocode} +\gdef\endtabbing{% + \@stopline\ifnum\@tabpush >\z@ \@badpoptabs \fi\endtrivlist} +% \end{macrocode} +% \end{macro} +% +% \begin{macro}{\@rtab} +% Omitted |\global| added to |\@rtab| 17 Jun 86 +% \begin{macrocode} +\gdef\@rtab{\@stopfield\@addfield\ifnum \@curtab<\@hightab + \global\advance\@curtab \@ne \else\@badtab\fi + \@tempdima\dimen\@curtab + \advance\@tempdima -\dimen\@curtabmar + \advance\@tempdima -\wd\@curline + \global\setbox\@curline\hbox{\unhbox\@curline\hskip\@tempdima}% + \@startfield\ignorespaces} +% \end{macrocode} +% \end{macro} +% +% \begin{macro}{\@settab} +% \changes{v1.1f}{1995/10/23}{(CAR)Ensure that \cs{@hightab} increases +% by at most one} +% \begin{macrocode} +\gdef\@settab{\@stopfield\@addfield + \ifnum \@curtab <\@maxtab + \ifnum\@curtab =\@hightab + \advance\@hightab \@ne + \fi + \global\advance\@curtab \@ne + \else + \@latex@error{Tab overflow}\@ehd + \fi + \dimen\@curtab \dimen\@curtabmar + \advance\dimen\@curtab \wd\@curline + \@startfield + \ignorespaces} +% \end{macrocode} +% \end{macro} +% +% \begin{macro}{\@ltab} +% \begin{macrocode} +\gdef\@ltab{\@ifatmargin\ifnum\@curtabmar >\@firsttab + \global\advance\@curtab \m@ne \global\advance\@curtabmar\m@ne\else + \@badtab\fi\else + \@latex@error{\string\<\space in mid line}\@ehd\fi\ignorespaces} +% \end{macrocode} +% \end{macro} +% +% \begin{macro}{\@tabplus} +% \begin{macrocode} +\gdef\@tabplus{% + \ifnum\@nxttabmar<\@hightab + \global\advance\@nxttabmar\@ne + \else + \@badtab + \fi + \ignorespaces} +% \end{macrocode} +% \end{macro} +% +% \begin{macro}{\@tabminus} +% \begin{macrocode} +\gdef\@tabminus{% + \ifnum\@nxttabmar>\@firsttab + \global\advance\@nxttabmar\m@ne + \else + \@badtab + \fi + \ignorespaces} +% \end{macrocode} +% \end{macro} +% +% \begin{macro}{\@tabrj} +% \begin{macrocode} +\gdef\@tabrj{% + \@stopfield\@addfield\global\@rjfieldtrue\@startfield\ignorespaces} +% \end{macrocode} +% \end{macro} +% +% \begin{macro}{\@tablab} +% |\setbox\@curline| made |\global| in |\@tablab|. 17 Jun 86 +% \begin{macrocode} +\gdef\@tablab{% + \@stopfield + \global\setbox\@curline\hbox{% + \box\@curline + \hskip-\wd\@curfield \hskip-\tabbingsep + \box\@curfield + \hskip\tabbingsep}% + \@startfield + \ignorespaces} +% \end{macrocode} +% \end{macro} +% +% \begin{macro}{\pushtabs} +% \begin{macrocode} +\gdef\pushtabs{% + \@stopfield\@addfield\global\advance\@tabpush \@ne \begingroup + \@contfield} +% \end{macrocode} +% \end{macro} +% +% \begin{macro}{\poptabs} +% \changes{v1.1f}{1995/10/23}{(CAR)Ensure that \cs{@curtab} is never +% larger than \cs{@hightab}} +% It is, in some sense, an error if, after the endgroup, the current +% tab setting is higher than the new value of |\@hightab| (which is +% a local variable). That this is allowed is a fundamental design +% flaw which is not going to be corrected now. +% \begin{macrocode} +\gdef\poptabs{\@stopfield\@addfield + \ifnum \@tabpush >\z@ + \endgroup + \global\advance\@tabpush \m@ne + \ifnum \@curtab >\@hightab + \global \@curtab \@hightab + \@badtab + \fi + \else + \@badpoptabs + \fi + \@contfield} +% \end{macrocode} +% \end{macro} +% +% \begin{macrocode} +% +% \end{macrocode} +% +% \begin{macro}{\tabbingsep} +% \begin{macrocode} +%<*2ekernel|autoload> +\newdimen\tabbingsep +% +% \end{macrocode} +% \end{macro} +% +% \begin{macro}{\tabbing} +% \begin{macrocode} +%<*autoload> +\def\tabbing{\@autoload{tabg}\tabbing} +% +% \end{macrocode} +% \end{macro} +% +% +% \subsection{array and tabular environments} +% +% \begin{oldcomments} +% +% ARRAY PARMETERS: +% \arraycolsep +% : half the width separating columns in an array environment +% \tabcolsep +% : half the width separating columns in a tabular environment +% \arrayrulewidth +% : width of rules +% \doublerulesep +% : space between adjacent rules in array or tabular +% \arraystretch +% : line spacing in array and tabular environments is done by +% placing a strut in every row of height and depth +% \arraystretch times the height and depth of the strut +% produced by an ordinary \strut commmand. +% +% PREAMBLE: +% The PREAMBLE argument of an array or tabular environment can +% contain the following: +% l,r,c : indicate where entry is to be placed. +% | : for vertical rule +% @{EXP} : inserts the text EXP in every column. +% \arraycolsep or \tabcolsep spacing is suppressed. +% *{N}{PRE} : equivalent to writing N copies of PRE in the preamble. +% PRE may contain *{N'}{EXP'} expressions. +% p{LEN} : makes entry in parbox of width LEN. +% +% SPECIAL ARRAY COMMANDS: +% \multicolumn{N}{FORMAT}{ITEM} : replaces the next N column +% items by ITEM, formatted according to FORMAT. +% FORMAT should contain at most one l,r or c. +% If it contains none, then ITEM is ignored. +% +% \vline : draws a vertical line the height of the current row. May +% appear in an array element entry. +% \hline : draws a horizontal line between rows. Must appear either +% before the first entry (to appear above the first row) or +% right after a \\ command. If followed by another \hline, +% then adds a \vskip of \doublerulesep. +% +% \cline[i-j] : draws horizontal lines between rows covering columns +% i through j, inclusive. Multiple commands may follow +% one another to provide lines covering several disjoint +% columns +% \extracolsep{WIDTH} : for use inside an @ in the preamble. Causes +% a WIDTH space to be added between columns for the rest +% of the columns. This is in addition to the ordinary +% intercolumn space. +% +% \array == +% BEGIN +% \@acol == \@arrayacol +% \@classz == \@arrayclassz +% \@classiv == \@arrayclassiv +% \\ == \@arraycr +% \@halignto == NULL +% \@tabarray +% END +% +% \endarray{NAME} == BEGIN \crcr }} END +% +% \tabular == +% BEGIN +% \@halignto == NULL +% \@tabular +% END +% +% \tabular*{WIDTH} == +% BEGIN +% \@halignto == to WIDTH +% \@tabular +% END +% +% \@tabular == +% BEGIN +% \leavevmode +% \hbox { $ +% \@acol == \@tabacol +% \@classz == \@tabclassz +% \@classiv == \@tabclassiv +% \\ == \@tabularcr +% \@tabarray +% END +% +% \endtabular == BEGIN \crcr}} $} END +% +% \@tabarray == if next char = [ then \@array else \@array[c] fi +% +% \@array[POS]{PREAMBLE} == +% BEGIN +% define \@arstrutbox to make \@arstrut produce strut of height +% and depth \arraystretch times the height and +% depth of a normal strut. +% \@mkpream{PREAMBLE} +% \@preamble == \halign \@halignto {\tabskip=0pt\@arstrut +% eval{\@preamble}\tabskip = 0pt\cr %%} +% \@startpbox == \@@startpbox +% \@endpbox == \@@endpbox +% if POS = t then \vtop +% else if POS = b then \vbox +% else \vcenter +% fi fi +% { +% \par ==L {} % changed 92/09/18 +% \@sharp == # +% \protect == \relax +% \lineskip :=L 0pt +% \baselineskip :=L 0pt +% \@preamble +% END +% +% +% \@arraycr == +% BEGIN +% $ %% Prevents extra space at end of row's last entry. +% if next char = [ +% then \@argarraycr +% else $ \cr %% Needed to balance $ +% END +% +% \@argarraycr[LENGTH] == +% BEGIN +% $ %% Needed to balance $ of \@arraycr +% if LENGTH > 0 +% then \@tempdima := depth of \@arstrutbox + LENGTH +% \vrule height 0pt width 0pt depth \@tempdima +% \cr +% else \cr \noalign{\vskip LENGTH} +% END +% +% \@tabularcr and \@argtabularcr same as \@arraycr and \@argarraycr +% except without the extra $'s. +% \end{oldcomments} +% +% \begin{macrocode} +%<*2ekernel|autoload> +% \end{macrocode} +% +% \begin{macro}{\extracolsep} +% \begin{macrocode} +\def\extracolsep#1{\tabskip #1\relax} +% \end{macrocode} +% \end{macro} +% +% \begin{macro}{\array} +% \begin{macrocode} +\def\array{\let\@acol\@arrayacol \let\@classz\@arrayclassz + \let\@classiv\@arrayclassiv + \let\\\@arraycr\let\@halignto\@empty\@tabarray} +% \end{macrocode} +% \end{macro} +% +% \begin{macro}{\endarray} +% \begin{macro}{\endtabular} +% \begin{macro}{\endtabular*} +% \begin{macrocode} +\def\endarray{\crcr\egroup\egroup} +\def\endtabular{\crcr\egroup\egroup $\egroup} +\expandafter \let \csname endtabular*\endcsname = \endtabular +% \end{macrocode} +% \end{macro} +% \end{macro} +% \end{macro} +% +% \begin{macro}{\tabular} +% \begin{macrocode} +\def\tabular{\let\@halignto\@empty\@tabular} +% \end{macrocode} +% \end{macro} +% +% \begin{macro}{\tabular*} +% \changes{v1.1j}{1998/05/18}{Use \cs{setlength}, so that +% calc extensions apply.} +% Note that the change to use |\setlength| slightly alters the +% timing of the expansion and use of the length in |#1| but this is +% very unlikely to have any practical effect. +% \changes{latex2e}{1993/08/05}{Replaced \cs{expandafter}\cs{def} +% by \cs{@namedef}.} +% \begin{macrocode} +\@namedef{tabular*}#1{% + \setlength\dimen@{#1}% + \edef\@halignto{to\the\dimen@}\@tabular} +% \end{macrocode} +% \end{macro} +% +% \begin{macro}{\@tabular} +% \begin{macrocode} +\def\@tabular{\leavevmode \hbox \bgroup $\let\@acol\@tabacol + \let\@classz\@tabclassz + \let\@classiv\@tabclassiv \let\\\@tabularcr\@tabarray} +% \end{macrocode} +% \end{macro} +% +% \begin{macro}{\@tabarray} +% RmS 91/11/04 added |\m@th|. +% \begin{macrocode} +\def\@tabarray{\m@th\@ifnextchar[\@array{\@array[c]}} +% \end{macrocode} +% \end{macro} +% +% RmS 1993/11/03 changed |\halign| to |\ialign| and removed superfluous +% |\tabskip| assignment +% +% +% \changes{v1.1i}{1996/10/21}{Moved the code associated with +% \cs{@mkpream} into the group provided by the box, for robustness +% (latex/2183)} +% \begin{macro}{\@array} +% \begin{macrocode} +\def\@array[#1]#2{% + \if #1t\vtop \else \if#1b\vbox \else \vcenter \fi\fi +% \end{macrocode} +% \changes{LaTeX2.09}{1992/09/18} +% {Changed \cs{par} to \cs{@empty} to avoid starting new row +% e.g. after \cs{hline}} +% \begin{macrocode} + \bgroup +% \end{macrocode} +% This next bit of code sets up the strut and then builds the halign +% and its preamble according to the specification in the second +% argument. +% +% This code has been moved inside the box. +% A side effect of this has been to expose what was a buglet in the +% previous version: since the |\@arstrut| below is expanded and +% contains an |\ifmmode| then it could produce an unnecessary extra +% box in every row, thus wasting `lots of' main memory. +% \begin{macrocode} + \setbox\@arstrutbox\hbox{% + \vrule \@height\arraystretch\ht\strutbox + \@depth\arraystretch \dp\strutbox + \@width\z@}% + \@mkpream{#2}% + \edef\@preamble{% + \ialign \noexpand\@halignto + \bgroup \@arstrut \@preamble \tabskip\z@skip \cr}% +% \end{macrocode} +% That is the end of setting up the preamble; now we reset +% things before executing the halign built-up in |\@preamble|. +% The restorations could be done by introducing an extra group, +% thus saving tokens. +% \changes{v1.0k}{1994/12/08}{Add \cs{tabularnewline}} +% \changes{v1.1i}{1996/10/21}{Use \cs{set@typeset@protect}} +% \begin{macrocode} + \let\@startpbox\@@startpbox \let\@endpbox\@@endpbox + \let\tabularnewline\\% + \let\par\@empty + \let\@sharp##% + \set@typeset@protect + \lineskip\z@skip\baselineskip\z@skip +% \end{macrocode} +% If the parsing of the preamble goes wrong there my be some +% characters left which \TeX{} then tries to typeset, i.e., we +% would be in horizontal mode. That would produce an endless loop +% because the |\halign| expects vertical mode thus issues a |\par| +% but that is a no-op at this point. So we better test this case +% issue some error message and make a crude recovery by ending that +% horizontal mode with force. +% A better fix would be to ensure that we never pick up more than a +% single character token (not done). +% \changes{v1.1m}{1998/11/13}{Check for hmode to see if something +% went wrong during parsing (pr/2884)} +% \begin{macrocode} + \ifhmode \@preamerr\z@ \@@par\fi + \@preamble} +% \end{macrocode} +% \end{macro} +% +% \begin{macro}{\@arraycr} +% Array version of |\\|. +% \begin{macrocode} +\def\@arraycr{% + ${\ifnum0=`}\fi\@ifstar\@xarraycr\@xarraycr} +% \end{macrocode} +% \end{macro} +% +% \begin{macro}{\@arraycr} +% \begin{macrocode} +\def\@xarraycr{\@ifnextchar[\@argarraycr{\ifnum0=`{\fi}${}\cr}} +% \end{macrocode} +% \end{macro} +% +% \begin{macro}{\@argarraycr} +% \begin{macrocode} +\def\@argarraycr[#1]{% + \ifnum0=`{\fi}${}\ifdim #1>\z@ \@xargarraycr{#1}\else + \@yargarraycr{#1}\fi} +% \end{macrocode} +% \end{macro} +% +% \begin{macro}{\tabularnewline} +% \changes{v1.0i}{1994/11/14}{(DPC) Macro added} +% \changes{v1.0k}{1994/12/08}{(DPC) Made it \cs{relax}} +% Tabular version of |\\|. +% \begin{macrocode} +\let\tabularnewline\relax +% \end{macrocode} +% \end{macro} +% +% \begin{macro}{\@tabularcr} +% \begin{macrocode} +\def\@tabularcr{% + {\ifnum0=`}\fi\@ifstar\@xtabularcr\@xtabularcr} +% \end{macrocode} +% \end{macro} +% +% \begin{macro}{\@xtabularcr} +% \begin{macrocode} +\def\@xtabularcr{\@ifnextchar[\@argtabularcr{\ifnum0=`{\fi}\cr}} +% \end{macrocode} +% \end{macro} +% +% \begin{macro}{\@argtabularcr} +% \begin{macrocode} +\def\@argtabularcr[#1]{% + \ifnum0=`{\fi}% + \ifdim #1>\z@ + \unskip\@xargarraycr{#1}% + \else + \@yargarraycr{#1}% + \fi} +% \end{macrocode} +% \end{macro} +% +% \begin{macro}{\@xargarraycr} +% \begin{macrocode} +\def\@xargarraycr#1{\@tempdima #1\advance\@tempdima \dp \@arstrutbox + \vrule \@height\z@ \@depth\@tempdima \@width\z@ \cr} +% \end{macrocode} +% \end{macro} +% +% \begin{macro}{\@yargarraycr} +% \begin{macrocode} +\def\@yargarraycr#1{\cr\noalign{\vskip #1}} +% \end{macrocode} +% \end{macro} +% +% \begin{macro}{\multicolumn} +% \begin{oldcomments} +% \multicolumn{NUMBER}{FORMAT}{ITEM} == +% BEGIN +% \multispan{NUMBER} +% \begingroup +% \@addamp == null +% \@mkpream{FORMAT} +% \@sharp == ITEM +% \protect == \relax +% \@startpbox == \@@startpbox +% \@endpbox == \@@endpbox +% \@arstrut +% \@preamble +% \endgroup +% END +% \end{oldcomments} +% +% The command |\def\@addamp{}| was removed from |\multicolumn| on +% 6 Dec 86 because it caused embedded array environments not to work. I +% think that it was included originally to prevent an error message if +% the 2nd argument to the |\multicolumn| command had two column +% specifiers. +% +% 8 Feb 89 --- |\hbox{}| added after |\@preamble| to correct bug that +% occurred if |\multicolumn| preceded |\\[D]| with |D > 0|, +% caused by |\\[]| command doing an |\unskip|, which removed +% |\tabcolsep| glue inserted by |\multicolumn|. +% +% +% \changes{v1.0h}{1994/11/04}{(ASAJ) added \cs{set@typeset@protect}.} +% \changes{v1.1i}{1996/10/21}{Make \cs{multicolumn} long (latex/2180)} +% This has been made long so that, for example, a |p|-column can +% contain multiple paragraphs; maybe the arguments of |@|-expressions +% should also be able to contain multiple paragraphs. +% \begin{macrocode} +\long\def\multicolumn#1#2#3{\multispan{#1}\begingroup + \@mkpream{#2}% + \def\@sharp{#3}\set@typeset@protect + \let\@startpbox\@@startpbox\let\@endpbox\@@endpbox + \@arstrut \@preamble\hbox{}\endgroup\ignorespaces} +% \end{macrocode} +% \end{macro} +% +% \begin{oldcomments} +% Codes for classes and character numbers of array, tabular and +% multicolumn arguments. +% +% Character Class Number +% --------- ----- ------ +% c 0 0 +% l 0 1 +% r 0 2 +% +% | 1 - +% @ 2 - +% p 3 - +% {@-exp} 4 - +% {p-arg} 5 - +% +% \@testpach \foo : expands \foo, which should be an array parameter +% token, and sets \@chclass and \@chnum to its class and +% number. Uses \@lastchclass to distinguish 4 and 5 +% +% Preamble error codes +% 0: 'illegal character' +% 1: 'Missing @-exp' +% 2: 'Missing p-arg' +% +% \@addamp == +% BEGIN if @firstamp = true then @firstamp := false +% else & fi +% END +% +% \@mkpream TOKENLIST == +% BEGIN +% @firstamp := T +% \@lastchclass := 6 +% \@preamble == null +% \@sharp == \relax +% \protect == BEGIN \noexpand\protect\noexpand END +% \@startpbox == \relax +% \@endpbox == \relax +% \@expast{TOKENLIST} +% for \@nextchar := expand(\reserved@a) +% do \@testpach{\@nextchar} +% case of \@chclass +% 0 -> \@classz +% 1 -> \@classi +% ... +% 5 -> \@classv +% end case +% \@lastchclass := \@chclass +% od +% case of \@lastchclass +% 0 -> \hskip \arraycolsep % lrc +% 1 -> % | +% 2 -> \@preamerr1 % 'Missing @-exp' % @ +% 3 -> \@preamerr2 % 'Missing p-arg' % p +% 4 -> % @-exp +% 5 -> \hskip \arraycolsep % p-exp +% end case +% END +% +% \@arrayclassz == +% BEGIN +% \@preamble := \@preamble * +% case of \@lastchclass +% 0 -> \hskip \arraycolsep \@addamp \hskip \arraycolsep +% 1 -> \@addamp \hskip \arraycolsep +% 2 -> % impossible +% 3 -> % impossible +% 4 -> \@addamp +% 5 -> \hskip \arraycolsep \@addamp \hskip \arraycolsep +% 6 -> \@addamp \hskip \arraycolsep +% end case +% * case of \@chnum +% 0 -> \hfil$\relax\@sharp$\hfil +% 1 -> $\relax\@sharp$\hfil +% 2 -> \hfil$\relax\@sharp$ +% end case +% END +% +% \@tabclassz == similar to \@arrayclassz +% +% \@classi == +% BEGIN +% \@preamble := \@preamble * +% case of \@lastchclass +% 0 -> \hskip \arraycolsep \@arrayrule +% 1 -> \hskip \doublerulesep \@arrayrule +% 2 -> % impossible +% 3 -> % impossible +% 4 -> \@arrayrule +% 5 -> \hskip \arraycolsep \@arrayrule +% 6 -> \@arrayrule +% end case +% END +% +% \@classii == +% BEGIN +% \@preamble := \@preamble * +% case of \@lastchclass +% 0 -> +% 1 -> \hskip .5\arrayrulewidth +% 2 -> % impossible +% else -> +% end case +% END +% +% \@classiii == +% BEGIN +% \@preamble := \@preamble * +% case of \@lastchclass +% 0 -> \hskip \arraycolsep \@addamp \hskip \arraycolsep +% 1 -> \@addamp \hskip \arraycolsep +% 2 -> % impossible +% 3 -> % impossible +% 4 -> \@addamp +% 5 -> \hskip \arraycolsep \@addamp \hskip \arraycolsep +% 6 -> \@addamp \hskip \arraycolsep +% end case +% END +% +% \@arrayclassiv == +% BEGIN \@preamble := \@preamble * $ \@nextchar$ END +% +% \@tabclassiv == same as \@arrayclassv except without the $ ... $ +% +% \@classv == +% BEGIN +% \@preamble := +% \@preamble * \@startpbox{\@nextchar}\ignorespaces\@sharp +% \@endpbox +% END +% +% \@expast{S}: +% Sets \reserved@a := S with all instances of *{N}{STRING} +% replaced by N copies of STRING, where N > 0. An * +% appearing inside braces is ignored, but *-expressions +% inside STRING are expanded, so nested *-expressions are +% handled properly. +% +% \@expast{S} == BEGIN \@xexpast S *0x\@@ END +% +% \@xexpast S1 *{N}{S2} S3 \@@ == +% BEGIN +% \reserved@a := S1 +% \@tempcnta := N +% if \@tempcnta > 0 +% then while \@tempcnta > 0 do \reserved@a := \reserved@a S2 +% \@tempcnta := \@tempcnta - 1 od +% \reserved@b == \@xexpast +% else \reserved@b == \@xexnoop +% fi +% \expandafter \reserved@b \reserved@a S3 \@@ +% END +% \end{oldcomments} +% +% +% \begin{macro}{\@xexnoop} +% \begin{macrocode} +\def\@xexnoop #1\@@{} +% \end{macrocode} +% \end{macro} +% +% \begin{macro}{\@expast} +% \begin{macrocode} +\def\@expast#1{\@xexpast #1*0x\@@} +% \end{macrocode} +% \end{macro} +% +% \begin{macro}{\@xexpast} +% \begin{macrocode} +\def\@xexpast#1*#2#3#4\@@{% + \edef\reserved@a{#1}% + \@tempcnta#2\relax + \ifnum\@tempcnta>\z@ + \@whilenum\@tempcnta>\z@\do + {\edef\reserved@a{\reserved@a#3}\advance\@tempcnta \m@ne}% + \let\reserved@b\@xexpast + \else + \let\reserved@b\@xexnoop + \fi + \expandafter\reserved@b\reserved@a #4\@@} +% \end{macrocode} +% \end{macro} +% +% \begin{macro}{\if@firstamp} +% \begin{macro}{\@addamp} +% \begin{macrocode} +\newif\if@firstamp +% \end{macrocode} +% +% \begin{macrocode} +\def\@addamp{% + \if@firstamp + \@firstampfalse + \else + \edef\@preamble{\@preamble &}% + \fi} +% \end{macrocode} +% \end{macro} +% \end{macro} +% +% \begin{macro}{\@arrayacol} +% \begin{macro}{\@tabacol} +% \begin{macro}{\@ampacol} +% \begin{macro}{\@acolampacol} +% \begin{macrocode} +\def\@arrayacol{\edef\@preamble{\@preamble \hskip \arraycolsep}} +\def\@tabacol{\edef\@preamble{\@preamble \hskip \tabcolsep}} +\def\@ampacol{\@addamp \@acol} +\def\@acolampacol{\@acol\@addamp\@acol} +% \end{macrocode} +% \end{macro} +% \end{macro} +% \end{macro} +% \end{macro} +% +% \begin{macro}{\@mkpream} +% \changes{v1.0h}{1994/11/04}{(ASAJ) Added \cs{@unexpandable@protect} +% to \cs{@mkpream}.} +% \begin{macrocode} +\def\@mkpream#1{\@firstamptrue\@lastchclass6 + \let\@preamble\@empty + \let\protect\@unexpandable@protect + \let\@sharp\relax + \let\@startpbox\relax\let\@endpbox\relax + \@expast{#1}% + \expandafter\@tfor \expandafter + \@nextchar \expandafter:\expandafter=\reserved@a\do + {\@testpach\@nextchar + \ifcase \@chclass \@classz \or \@classi \or \@classii \or \@classiii + \or \@classiv \or\@classv \fi\@lastchclass\@chclass}% + \ifcase \@lastchclass \@acol + \or \or \@preamerr \@ne\or \@preamerr \tw@\or \or \@acol \fi} +% \end{macrocode} +% \end{macro} +% +% \begin{macro}{\@arrayclassz} +% \begin{macrocode} +\def\@arrayclassz{\ifcase \@lastchclass \@acolampacol \or \@ampacol \or + \or \or \@addamp \or + \@acolampacol \or \@firstampfalse \@acol \fi +\edef\@preamble{\@preamble + \ifcase \@chnum + \hfil$\relax\@sharp$\hfil \or $\relax\@sharp$\hfil + \or \hfil$\relax\@sharp$\fi}} +% \end{macrocode} +% \end{macro} +% +% \begin{macro}{\@tabclassz} +% RmS 91/08/14 inserted extra braces around entry for NFSS +% \begin{macrocode} +\def\@tabclassz{% + \ifcase\@lastchclass + \@acolampacol + \or + \@ampacol + \or + \or + \or + \@addamp + \or + \@acolampacol + \or + \@firstampfalse\@acol + \fi + \edef\@preamble{% + \@preamble{% + \ifcase\@chnum + \hfil\ignorespaces\@sharp\unskip\hfil + \or +% \end{macrocode} +% \changes{v1.1g}{1996/04/22} +% {(DPC) Extra \cs{hskip} keeps tabcolsep in empty columns +% internal/2122} +% \changes{v1.1h}{1996/06/14} +% {(DPC) Change both\cs{z@skip} to 1sp for latex/2160} +% \begin{macrocode} + \hskip1sp\ignorespaces\@sharp\unskip\hfil + \or + \hfil\hskip1sp\ignorespaces\@sharp\unskip + \fi}}} +% \end{macrocode} +% \end{macro} +% +% \begin{macro}{\@classi} +% \begin{macrocode} +\def\@classi{% + \ifcase\@lastchclass + \@acol\@arrayrule + \or + \@addtopreamble{\hskip \doublerulesep}\@arrayrule + \or + \or + \or + \@arrayrule + \or + \@acol\@arrayrule + \or + \@arrayrule + \fi} +% \end{macrocode} +% \end{macro} +% +% \begin{macro}{\@classii} +% \begin{macrocode} +\def\@classii{% + \ifcase\@lastchclass + \or + \@addtopreamble{\hskip .5\arrayrulewidth}% + \fi} +% \end{macrocode} +% \end{macro} +% +% \begin{macro}{\@classiii} +% \begin{macrocode} +\def\@classiii{\ifcase \@lastchclass \@acolampacol \or + \@addamp\@acol \or + \or \or \@addamp \or + \@acolampacol \or \@ampacol \fi} +% \end{macrocode} +% \end{macro} +% +% \begin{macro}{\@tabclassiv} +% \begin{macrocode} +\def\@tabclassiv{\@addtopreamble\@nextchar} +% \end{macrocode} +% \end{macro} +% +% \begin{macro}{\@arrayclassiv} +% \begin{macrocode} +\def\@arrayclassiv{\@addtopreamble{$\@nextchar$}} +% \end{macrocode} +% \end{macro} +% +% \begin{macro}{\@classv} +% \begin{macrocode} +\def\@classv{\@addtopreamble{\@startpbox{\@nextchar}\ignorespaces +\@sharp\@endpbox}} +% \end{macrocode} +% \end{macro} +% +% \begin{macro}{\@addtopreamble} +% \begin{macrocode} +\def\@addtopreamble#1{\edef\@preamble{\@preamble #1}} +% \end{macrocode} +% \end{macro} +% +% \begin{macro}{\@chclass} +% \begin{macro}{\@lastchclass} +% \begin{macro}{\@chnum} +% \begin{macrocode} +\newcount\@chclass +\newcount\@lastchclass +\newcount\@chnum +% \end{macrocode} +% \end{macro} +% \end{macro} +% \end{macro} +% +% \begin{macro}{\arraycolsep} +% \begin{macro}{\tabcolsep} +% \begin{macro}{\arrayrulewidth} +% \begin{macro}{\doublerulesep} +% \begin{macrocode} +\newdimen\arraycolsep +\newdimen\tabcolsep +\newdimen\arrayrulewidth +\newdimen\doublerulesep +% \end{macrocode} +% \end{macro} +% \end{macro} +% \end{macro} +% \end{macro} +% +% \begin{macro}{\arraystretch} +% \begin{macrocode} +\def\arraystretch{1} % Default value. +% \end{macrocode} +% \end{macro} +% +% \begin{macro}{\@arstrutbox} +% \begin{macro}{\@arstrut} +% \begin{macrocode} +\newbox\@arstrutbox +% \end{macrocode} +% +% \begin{macrocode} +\def\@arstrut{% + \relax\ifmmode\copy\@arstrutbox\else\unhcopy\@arstrutbox\fi} +% \end{macrocode} +% \end{macro} +% \end{macro} +% +% \begin{macro}{\@arrayrule} +% \begin{macrocode} +\def\@arrayrule{\@addtopreamble{\hskip -.5\arrayrulewidth + \vrule \@width \arrayrulewidth\hskip -.5\arrayrulewidth}} +% \end{macrocode} +% \end{macro} +% +% \begin{macro}{\@testpatch} +% \begin{macrocode} +\def\@testpach#1{\@chclass \ifnum \@lastchclass=\tw@ 4 \else + \ifnum \@lastchclass=3 5 \else + \z@ \if #1c\@chnum \z@ \else + \if #1l\@chnum \@ne \else + \if #1r\@chnum \tw@ \else + \@chclass \if #1|\@ne \else + \if #1@\tw@ \else + \if #1p3 \else \z@ \@preamerr 0\fi + \fi \fi \fi \fi \fi \fi +\fi} +% \end{macrocode} +% \end{macro} +% +% \begin{macro}{\hline} +% \begin{macrocode} +\def\hline{% + \noalign{\ifnum0=`}\fi\hrule \@height \arrayrulewidth \futurelet + \reserved@a\@xhline} +% \end{macrocode} +% \end{macro} +% +% \begin{macro}{\@xhline} +% \begin{macrocode} +\def\@xhline{\ifx\reserved@a\hline + \vskip\doublerulesep +% \end{macrocode} +% Measure from the middle of the rules. +% \changes{latex2e}{1993/12/16}{Measure from middle of vertical rules} +% \begin{macrocode} + \vskip-\arrayrulewidth + \fi + \ifnum0=`{\fi}} +% \end{macrocode} +% \end{macro} +% +% \begin{macro}{\vline} +% \begin{macrocode} +\def\vline{\vrule \@width \arrayrulewidth} +% \end{macrocode} +% \end{macro} +% +% \begin{macro}{\cline} +% \changes{v1.1c}{1995/09/14} +% {(DPC) New implementation} +% \begin{macro}{\@cline} +% The old \LaTeX2.09 implementation of |\cline| used up quite +% a lot of memory and two precious count registers. +% This new (1995/09/14) implementation does not use any count registers. +% It is coded in a way that depends heavily on the definition of +% |\multispan| so that command has been moved here from the file +% |ltplain.dtx|. +% +% These counters are no longer declared. +%\begin{verbatim} +% \newcount\@cla +% \newcount\@clb +%\end{verbatim} +% +% \begin{macrocode} +\def\cline#1{\@cline#1\@nil} +% \end{macrocode} +% +% \changes{v1.1e}{1995/10/17} +% {(DPC) Use \cs{@multicnt}} +% \begin{macrocode} +\def\@cline#1-#2\@nil{% + \omit +% \end{macrocode} +% Use the counter from |\multispan|. +% \begin{macrocode} + \@multicnt#1% + \advance\@multispan\m@ne + \ifnum\@multicnt=\@ne\@firstofone{&\omit}\fi + \@multicnt#2% + \advance\@multicnt-#1% + \advance\@multispan\@ne +% \end{macrocode} +% The original had |\unskip| at this point, +% but how could a skip get here ??? +% \begin{macrocode} + \leaders\hrule\@height\arrayrulewidth\hfill + \cr +% \end{macrocode} +% This is back spacing is fairly horrible, +% but it is what happened in the old version\ldots\ +% An alternative would be to make |\cline| look ahead for a following +% |\cline| as does |\hline|. This would alter the spacing in existing +% documents so keep the old version in the kernel. Perhaps a package +% should do this differently. +% \begin{macrocode} + \noalign{\vskip-\arrayrulewidth}} +% \end{macrocode} +% \end{macro} +% \end{macro} +% +% \begin{macro}{\mscount} +% The |\mscount| counter is no longer declared, saving a csname and a +% register. It is declared in compatibility mode. +% \end{macro} +% +% \begin{macro}{\multispan} +% \begin{macro}{\@multispan} +% \changes{v1.1e}{1995/10/17} +% {(DPC) Macro added.} +% \begin{macro}{\sp@n} +% Modify |\multispan| slightly from its plain \TeX\ definition +% to allow more efficient code sharing with |\multicolumn|. +% Also share a count register with |\multiput|. +% \begin{macrocode} +\def\multispan{\omit\@multispan} +% \end{macrocode} +% +% \begin{macrocode} +\def\@multispan#1{% + \@multicnt#1\relax + \loop\ifnum\@multicnt>\@ne \sp@n\repeat} +% \end{macrocode} +% +% \begin{macrocode} +\def\sp@n{\span\omit\advance\@multicnt\m@ne} +% \end{macrocode} +% \end{macro} +% \end{macro} +% \end{macro} +% +% +% \begin{macro}{\@startpbox} +% \begin{macro}{\@endpbox} +% Helper macros for `p' columns. +% +% |\@startpbox|\marg{width} \emph{text} |\egroup| is essentially +% |\parbox|\marg{width}\marg{text} +% +% |\@endpbox| is essentially |\unskip \strut \par \egroup\hfil| +% (Changed 14 Jan 89) (changed again 1994/05/13) +% +% \changes{v1.0d}{1994/05/03} +% {Use \cs{@finalstrut} based on depth of \cs{@arstrutbox}} + +% \changes{v1.1j}{1998/05/18}{Use \cs{setlength} to set \cs{hsize}, +% so that the changes in the calc package apply here.} +% \begin{macrocode} +\def\@startpbox#1{\vtop\bgroup \setlength\hsize{#1}\@arrayparboxrestore} +% \end{macrocode} +% +% \begin{macrocode} +\def\@endpbox{\@finalstrut\@arstrutbox\par\egroup\hfil} +% \end{macrocode} +% +% 14 Jan 89: Def of |\@endpbox| changed from\\ +% |\def\@endpbox{\par\vskip\dp\@arstrutbox\egroup\hfil}|\\ +% so vertical spacing works out right if the last line of a `p' entry +% has a descender. +% \end{macro} +% \end{macro} +% +% \begin{macro}{\@@startpbox} +% \begin{macro}{\@@endpbox} +% \begin{macrocode} +\let\@@startpbox=\@startpbox +\let\@@endpbox=\@endpbox +% \end{macrocode} +% \end{macro} +% \end{macro} +% +% \begin{macrocode} +% +% \end{macrocode} +% +% \Finale +% diff --git a/Master/texmf-dist/source/latex/base/ltthm.dtx b/Master/texmf-dist/source/latex/base/ltthm.dtx new file mode 100644 index 00000000000..5290fea8bd5 --- /dev/null +++ b/Master/texmf-dist/source/latex/base/ltthm.dtx @@ -0,0 +1,289 @@ +% \iffalse meta-comment +% +% Copyright 1993 1994 1995 1996 1997 1998 1999 2000 2001 2002 2003 2004 +% The LaTeX3 Project and any individual authors listed elsewhere +% in this file. +% +% This file is part of the LaTeX base system. +% ------------------------------------------- +% +% It may be distributed and/or modified under the +% conditions of the LaTeX Project Public License, either version 1.3 +% of this license or (at your option) any later version. +% The latest version of this license is in +% http://www.latex-project.org/lppl.txt +% and version 1.3 or later is part of all distributions of LaTeX +% version 2003/12/01 or later. +% +% This file has the LPPL maintenance status "maintained". +% +% The list of all files belonging to the LaTeX base distribution is +% given in the file `manifest.txt'. See also `legal.txt' for additional +% information. +% +% The list of derived (unpacked) files belonging to the distribution +% and covered by LPPL is defined by the unpacking scripts (with +% extension .ins) which are part of the distribution. +% +% \fi +% +% \iffalse +%%% From File: ltthm.dtx +%<*driver> +% \fi +\ProvidesFile{ltthm.dtx} + [1995/10/10 v1.0f LaTeX Kernel (Theorems)] +% \iffalse +\documentclass{ltxdoc} +\GetFileInfo{ltthm.dtx} +\title{\filename} +\date{\filedate} + \author{% + Johannes Braams\and + David Carlisle\and + Alan Jeffrey\and + Leslie Lamport\and + Frank Mittelbach\and + Chris Rowley\and + Rainer Sch\"opf} + +\begin{document} +\maketitle + \DocInput{\filename} +\end{document} +% +% \fi +% +% \CheckSum{115} +% +% \section{Theorem Environments} +% +% +% The user creates his own theorem-like environments with the command\\ +% |\newtheorem|\marg{name}\marg{text}\oarg{counter} or\\ +% |\newtheorem|\marg{name}\oarg{oldname}\marg{text}\\ +% This defines the environment \meta{name} to be just as one would +% expect a theorem environment to be, except that it prints \meta{text} +% instead of ``Theorem''. +% +% If \meta{oldname} is given, then environments \meta{name} and +% \meta{oldname} use the same counter, so using a \meta{name} +% environment advances the number of the next \meta{name} environment, +% and vice-versa. +% +% If \meta{counter} is given, then environment \meta{name} is numbered +% within \meta{counter}. +% +% E.g., if \meta{counter} = |subsection|, then the first \meta{name} in +% subsection 7.2 is numbered \meta{text} 7.2.1. +% +% The way \meta{name} environments are numbered can be changed by +% redefining |\the|\meta{name}. +% +% \StopEventually{} +% +% +% \changes{v1.0a}{1994/03/28}{Initial version, split from latex.dtx} +% \changes{v1.0c}{1994/05/25}{Modify documentation} +% \changes{v1.0f}{1995/10/10}{Make \cs{newtheorem} `only preamble'} +% \changes{v1.0g}{1995/10/16} +% {Revert to previous \cs{newtheorem} behaviour} +% +% \begin{oldcomments} +% +% DOCUMENT STYLE PARAMETERS +% +% \@thmcounter{COUNTER} : A command such that +% \edef\theCOUNTER{\@thmcounter{COUNTER}} +% defines \theCOUNTER to produce a number for a theorem environment. +% The default is: +% BEGIN \noexpand\arabic{COUNTER} END +% +% \@thmcountersep : A separator placed between a theorem number and +% the number of the counter within which it is numbered. +% E.g., to make the third theorem of section 7.2 be numbered +% 7.2-3, \@thmcountersep should be \def'ed to '-'. Its +% default is '.'. +% +% \@begintheorem{NAME}{NUMBER} : A command that begins a theorem +% environment for a 'theorem' named 'NAME NUMBER' -- +% e.g., \@begintheorem{Lemma}{3.7} starts Lemma 3.7. +% +% \@opargbegintheorem{NAME}{NUMBER}{OPARG} : +% A command that begins a theorem +% environment for a 'theorem' named 'NAME NUMBER' with optional +% argument OPARG -- e.g., \@begintheorem{Lemma}{3.7}{Jones} +% starts `Lemma 3.7 (Jones):'. +% +% \@endtheorem : A command that ends a theorem environment. +% +% \newtheorem{NAME}{TEXT}[COUNTER] == +% BEGIN +% if \NAME is definable +% then \@definecounter{NAME} +% if COUNTER present +% then \@newctr{NAME}[COUNTER] fi +% \theNAME == BEGIN \theCOUNTER \@thmcountersep +% eval\@thmcounter{NAME} END +% else \theNAME == BEGIN eval\@thmcounter{NAME} END +% \NAME == \@thm{NAME}{TEXT} +% \endNAME == \@endtheorem +% else error +% fi +% END +% +% \newtheorem{NAME}[OLDNAME]{TEXT}== +% BEGIN +% if counter OLDNAME nonexistant +% then ERROR +% else +% if \NAME is definable +% then BEGIN +% \theNAME == \theOLDNAME +% \NAME == \@thm{OLDNAME}{TEXT} +% \endNAME == \@endtheorem +% END +% else error +% fi +% fi +% END +% +% \@thm{NAME}{TEXT} == +% BEGIN +% \refstepcounter{NAME} +% if next char = [ +% then \@ythm{NAME}{TEXT} +% else \@xthm{NAME}{TEXT} +% fi +% END +% +% \@xthm{NAME}{TEXT} == +% BEGIN +% \@begintheorem{TEXT}{\theNAME} +% \ignorespaces +% END +% +% \@ythm{NAME}{TEXT}[OPARG] == +% BEGIN +% \@opargbegintheorem{TEXT}{\theNAME}{OPARG} +% \ignorespaces +% END +% \end{oldcomments} +% +% \begin{macro}{\newtheorem} +% |\newtheorem| ought really be allowed only in the preamble +% Which would be good document style, and allow some main memory to be +% saved by declaring these commands to be +% |\@onlypreamble|. Unfortunately the \LaTeX\ book indicates that +% |\newtheorem| may be used anywhere in the document\ldots +% \begin{macrocode} +%<*2ekernel> +\def\newtheorem#1{% + \@ifnextchar[{\@othm{#1}}{\@nthm{#1}}} +% \end{macrocode} +% \end{macro} +% +% \begin{macro}{\@nthm} +% \begin{macrocode} +\def\@nthm#1#2{% + \@ifnextchar[{\@xnthm{#1}{#2}}{\@ynthm{#1}{#2}}} +% \end{macrocode} +% \end{macro} +% +% \begin{macro}{\@xnthm} +% +% 92/09/18 RmS: Changed |\@addtoreset| to |\@newctr| to produce error +% message if counter |#3| does not exist (to be +% consistent with behaviour of |\newcounter|) +% \begin{macrocode} +\def\@xnthm#1#2[#3]{% + \expandafter\@ifdefinable\csname #1\endcsname + {\@definecounter{#1}\@newctr{#1}[#3]% + \expandafter\xdef\csname the#1\endcsname{% + \expandafter\noexpand\csname the#3\endcsname \@thmcountersep + \@thmcounter{#1}}% + \global\@namedef{#1}{\@thm{#1}{#2}}% + \global\@namedef{end#1}{\@endtheorem}}} +% \end{macrocode} +% \end{macro} +% +% \begin{macro}{\@ynthm} +% \begin{macrocode} +\def\@ynthm#1#2{% + \expandafter\@ifdefinable\csname #1\endcsname + {\@definecounter{#1}% + \expandafter\xdef\csname the#1\endcsname{\@thmcounter{#1}}% + \global\@namedef{#1}{\@thm{#1}{#2}}% + \global\@namedef{end#1}{\@endtheorem}}} +% \end{macrocode} +% \end{macro} +% +% \begin{macro}{\@othm} +% \changes{LaTeX2.09}{1992/01/10} +% {(RmS) Check for existence of theorem environment} +% \changes{LaTeX2.09}{1992/08/19} +% {(RmS) Changed error message to complain about undefined +% counter} +% \changes{v1.0b}{1994/04/09}{Use standard counter error message (FMi)} +% \changes{v1.0c}{1994/04/17}{Use new std counter error message (FMi)} +% \begin{macrocode} +\def\@othm#1[#2]#3{% + \@ifundefined{c@#2}{\@nocounterr{#2}}% + {\expandafter\@ifdefinable\csname #1\endcsname + {\global\@namedef{the#1}{\@nameuse{the#2}}% + \global\@namedef{#1}{\@thm{#2}{#3}}% + \global\@namedef{end#1}{\@endtheorem}}}} +% \end{macrocode} +% \end{macro} +% +% \begin{macro}{\@thm} +% \begin{macrocode} +\def\@thm#1#2{% + \refstepcounter{#1}% + \@ifnextchar[{\@ythm{#1}{#2}}{\@xthm{#1}{#2}}} +% \end{macrocode} +% \end{macro} +% +% \begin{macro}{\@xthm} +% \begin{macro}{\@ythm} +% \begin{macrocode} +\def\@xthm#1#2{% + \@begintheorem{#2}{\csname the#1\endcsname}\ignorespaces} +\def\@ythm#1#2[#3]{% + \@opargbegintheorem{#2}{\csname the#1\endcsname}{#3}\ignorespaces} +% \end{macrocode} +% \end{macro} +% \end{macro} +% +% Default values +% \begin{macro}{\@thmcounter} +% \begin{macro}{\@thmcountersep} +% \begin{macrocode} +\def\@thmcounter#1{\noexpand\arabic{#1}} +\def\@thmcountersep{.} +% \end{macrocode} +% \end{macro} +% \end{macro} +% +% \begin{macro}{\@begintheorem} +% \begin{macro}{\@opargbegintheorem} +% \begin{macro}{\@endtheorem} +% \changes{LaTeX2.09}{1991/08/14} +% {Moved \cs{itshape} after \cs{item} to make it work with +% NFSS} +% Providing theorem defaults. +% \task{???}{add `reset@font?} +% \begin{macrocode} +\def\@begintheorem#1#2{\trivlist + \item[\hskip \labelsep{\bfseries #1\ #2}]\itshape} +\def\@opargbegintheorem#1#2#3{\trivlist + \item[\hskip \labelsep{\bfseries #1\ #2\ (#3)}]\itshape} +\def\@endtheorem{\endtrivlist} +% +% \end{macrocode} +% \end{macro} +% \end{macro} +% \end{macro} +% +% \Finale +% diff --git a/Master/texmf-dist/source/latex/base/ltvers.dtx b/Master/texmf-dist/source/latex/base/ltvers.dtx new file mode 100644 index 00000000000..d4ad7af5f8b --- /dev/null +++ b/Master/texmf-dist/source/latex/base/ltvers.dtx @@ -0,0 +1,146 @@ +% \iffalse meta-comment +% +% Copyright 1993 1994 1995 1996 1997 1998 1999 2000 2001 2002 2003 2004 +% The LaTeX3 Project and any individual authors listed elsewhere +% in this file. +% +% This file is part of the LaTeX base system. +% ------------------------------------------- +% +% It may be distributed and/or modified under the +% conditions of the LaTeX Project Public License, either version 1.3 +% of this license or (at your option) any later version. +% The latest version of this license is in +% http://www.latex-project.org/lppl.txt +% and version 1.3 or later is part of all distributions of LaTeX +% version 2003/12/01 or later. +% +% This file has the LPPL maintenance status "maintained". +% +% The list of all files belonging to the LaTeX base distribution is +% given in the file `manifest.txt'. See also `legal.txt' for additional +% information. +% +% The list of derived (unpacked) files belonging to the distribution +% and covered by LPPL is defined by the unpacking scripts (with +% extension .ins) which are part of the distribution. +% +% \fi +% +% \iffalse +%%% From File: ltvers.dtx +% +%<*driver> +% \fi +\ProvidesFile{ltvers.dtx} + [2004/01/28 v1.0k LaTeX Kernel (Version Info)] +% \iffalse +\documentclass{ltxdoc} +\GetFileInfo{ltvers.dtx} +\title{\filename} +\date{\filedate} + \author{% + Johannes Braams\and + David Carlisle\and + Alan Jeffrey\and + Leslie Lamport\and + Frank Mittelbach\and + Chris Rowley\and + Rainer Sch\"opf} +\begin{document} +\maketitle + \DocInput{\filename} +\end{document} +% +% \fi +% +% \CheckSum{48} +% +% \section{Version Identification} +% First we identify the date and version number of this release of +% \LaTeX, and set |\everyjob| so that it is printed at the start of +% every \LaTeX\ run. +% +% \StopEventually{} +% +% \changes{v1.0g}{1996/11/28} +% {Check for old format modified /2319} +% \changes{v1.0f}{1996/11/20} +% {Check for old format modified /2319} +% \changes{v1.0e}{1995/05/12} +% {Add autoload docstrip guards} +% \changes{v1.0e}{1995/05/12} +% {Check for format older than 1 year} +% \changes{v1.0d}{1994/05/25} +% {Remove PRELIMINARY TEST RELEASE from startup banner +% (spring is here)} +% \changes{v1.0b}{1994/04/12} +% {Have version info generated automatically.} +% \changes{v1.0a}{1994/03/04} +% {Initial version, split from latex.dtx} +% +% \begin{macro}{\fmtname} +% \begin{macro}{\fmtversion} +% \begin{macrocode} +%<*2ekernel> +\def\fmtname{LaTeX2e} +\edef\fmtversion{2003/12/01} +% \end{macrocode} +% \end{macro} +% \end{macro} +% +% Check that the format being made is not too old. +% The error message complains about `more than 5 years' +% but in fact the error is not triggered until 65 months. +% +% This code is currently not activated as we don't know if we already +% got to the last official 2e version (due to staff shortage or due to +% a successor (think positive:-)). +% \changes{v1.0i}{2001/06/04}{Check for old format disabled} +% \changes{v1.0k}{2004/01/28}{Check for old format made 5 years (pr/3601)} +% \begin{macrocode} +\iftrue +\def\reserved@a#1/#2/#3\@nil{% + \count@\year + \advance\count@-#1\relax + \multiply\count@ by 12\relax + \advance\count@\month + \advance\count@-#2\relax} +\expandafter\reserved@a\fmtversion\@nil +% \end{macrocode} +% |\count@| is now the age of this file in months. Take a generous +% definition of `year' so this message is not generated too often. +% \begin{macrocode} +\ifnum\count@>65 + \typeout{^^J% +!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!^^J% +! You are attempting to make a LaTeX format from a source file^^J% +! That is more than five years old.^^J% +!^^J% +! If you enter to scroll past this message then the format^^J% +! will be built, but please consider obtaining newer source files^^J% +! before continuing to build LaTeX.^^J% +!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!^^J% +} + \errhelp{To avoid this error message, obtain new LaTeX sources.} + \errmessage{LaTeX source files more than 5 years old!} +\fi +\let\reserved@a\relax +\fi +% \end{macrocode} +% +% This startup banner may be further modified by the code in +% |ltfinal.dtx| if a patch file is present. +% \begin{macrocode} +\everyjob{\typeout{\fmtname +%\space(autoload version)% + \space<\fmtversion>}} +\immediate\write16{\fmtname +%\space(autoload version)% + \space<\fmtversion>} +% +% \end{macrocode} +% +% \Finale +% +\endinput diff --git a/Master/texmf-dist/source/latex/base/ltxdoc.dtx b/Master/texmf-dist/source/latex/base/ltxdoc.dtx new file mode 100644 index 00000000000..80390a76fcf --- /dev/null +++ b/Master/texmf-dist/source/latex/base/ltxdoc.dtx @@ -0,0 +1,518 @@ +% \iffalse meta-comment +% +% Copyright 1993 1994 1995 1996 1997 1998 1999 2000 2001 2002 2003 2004 +% The LaTeX3 Project and any individual authors listed elsewhere +% in this file. +% +% This file is part of the LaTeX base system. +% ------------------------------------------- +% +% It may be distributed and/or modified under the +% conditions of the LaTeX Project Public License, either version 1.3 +% of this license or (at your option) any later version. +% The latest version of this license is in +% http://www.latex-project.org/lppl.txt +% and version 1.3 or later is part of all distributions of LaTeX +% version 2003/12/01 or later. +% +% This file has the LPPL maintenance status "maintained". +% +% The list of all files belonging to the LaTeX base distribution is +% given in the file `manifest.txt'. See also `legal.txt' for additional +% information. +% +% The list of derived (unpacked) files belonging to the distribution +% and covered by LPPL is defined by the unpacking scripts (with +% extension .ins) which are part of the distribution. +% +% \fi +% \iffalse +% +%\NeedsTeXFormat{LaTeX2e} +%\ProvidesClass{ltxdoc} +% [1999/08/08 v2.0u Standard LaTeX documentation class] +% +%<*driver> +\documentclass{ltxdoc} +\GetFileInfo{ltxdoc.cls} +\providecommand\dst{\expandafter{\normalfont\scshape docstrip}} +\title{The file \texttt{ltxdoc.dtx} for use with + \LaTeXe.\thanks{This file has version + number \fileversion, dated \filedate.}\\[2pt] + It contains the code for \texttt{ltxdoc.cls}} +\date{\filedate} +\author{David Carlisle} +\begin{document} +\maketitle + \DocInput{ltxdoc.dtx} +\end{document} +% +% +% \fi +% +% \CheckSum{415} +% +% \changes{v2.0i}{1994/04/29}{Update the documentation.} +% \changes{v2.0s}{1998/08/17}{(RmS) Documentation fixes.} +% +% \section{Documentation of the \LaTeX\ sources} +% +% This class file is designed for documenting the \LaTeX\ source files. +% You may however find it generally useful as a class for typesetting +% the documentation of files produced in `doc' format. +% +% Each documented file in the standard distribution comes with extension +% |dtx|. The appropriate class package or initex file will be extracted +% from the source by the docstrip system. Each |dtx| file may be +% directly processed with \LaTeXe, for example +%\begin{verbatim} +% latex2e docclass.dtx +%\end{verbatim} +% would produce the documentation of the Class and package interface. +% +% Each file that is used in producing the \LaTeXe\ format (ie not +% including the standard class and packages) will be printed together in +% one document if you \LaTeX\ the file |sources2e.tex|. This has the +% advantage that one can produce a full index of macro usage across all +% the source files. +% +% If you need to customise the typesetting of any of these files, there +% are two options: +% \begin{itemize} +% \item You can use \dst\ with the module `driver' to extract a small +% \LaTeX\ file that you may edit to use whatever class or package +% options you require, before inputting the source file. +% \item You can create a file |ltxdoc.cfg|. This configuration file will +% be read whenever the |ltxdoc| class is used, and so can be used to +% customise the typesetting of all the source files, without having to +% edit lots of small driver files. +%\end{itemize} +% +% The second option is usually more convenient. Various possibilities +% are discussed in the next section. +% +% \section{Customisation} +% +% The simplest form of customisation is to pass more options to the +% |article| class which is loaded by |ltxdoc|. For instance if you wish +% all the documentation to be formated for A4 paper, add the following +% line to |ltxdoc.cfg|: +%\begin{verbatim} +% \PassOptionsToClass{a4paper}{article} +%\end{verbatim} +% +% All the source files are in two parts, separated by |\StopEventually|. +% The first part (should) contain `user' documentation. The second part +% is a full documented listing of the source code. The |doc| package +% provides the command |\OnlyDescription| which suppresses the code +% listings. This may also be used in the configuration file, but as the +% |doc| package is read later, you must delay the execution of +% |\OnlyDescription| until after the |doc| package has been read. The +% simplest way is to use |\AtBeginDocument|. Thus you could put the +% following in your |ltxdoc.cfg|. +%\begin{verbatim} +% \AtBeginDocument{\OnlyDescription} +%\end{verbatim} +% +% +% If the full source listing |sources2e.tex| is processed, then an index +% and change history are produced by default, however indices are not +% normally produced for individual files. +% +% As an example, consider |ltclass.dtx|, which contains the sources for +% the new class and package interface commands. With no |cfg| +% file, a 19~page document is produced. With the above configuration +% a slightly more readable document (4~pages) is produced. +% +% Conversely, if you really want to read the source listings in detail, +% you will want to have an index. Again the index commands provided by +% the doc package may be used, but their execution must be delayed. +%\begin{verbatim} +% \AtBeginDocument{\CodelineIndex\EnableCrossrefs} +% \AtEndDocument{\PrintIndex} +%\end{verbatim} +% +% The |doc| package writes index files to be sorted using MakeIndex with +% the |gind| style, so one would then use a command such as +%\begin{verbatim} +% makeindex -s gind.ist ltclass.idx +%\end{verbatim} +% and re-run \LaTeX. +% +% Similarly to print a Change history, you would add +%\begin{verbatim} +% \AtBeginDocument{\RecordChanges} +% \AtEndDocument{\PrintChanges} +%\end{verbatim} +% to |ltxdoc.cfg|, and use MakeIndex with a comand such as +%\begin{verbatim} +% makeindex -s gglo.ist -o ltclass.gls ltclass.glo +%\end{verbatim} +% +% Finally if you do not want to list all the sections of |source2e.tex|, +% you can use |\includeonly| in the |cfg| file: +%\begin{verbatim} +% \includeonly{ltvers,ltboxes} +%\end{verbatim} +% +% \StopEventually{} +% +% +% \section{Options} +% +% \begin{macrocode} +%<*class> +\DeclareOption{a5paper}{\@latexerr{Option not supported}% + {}} +% \end{macrocode} +% +% \begin{macrocode} +\DeclareOption*{% + \PassOptionsToClass {\CurrentOption}{article}} +% \end{macrocode} +% +% \section{Configuration} +% Input a local configuration file, if it exists. +% \begin{macrocode} +\InputIfFileExists{ltxdoc.cfg} + {\typeout{*************************************^^J% + * Local config file ltxdoc.cfg used^^J% + *************************************}} + {} +% \end{macrocode} +% +% +% \section{Option Processing} +% +% \begin{macrocode} +\ProcessOptions +% \end{macrocode} +% +% \section{Loading article and doc} +% +% \begin{macrocode} +\LoadClass{article} +% \end{macrocode} +% +% \begin{macrocode} +\RequirePackage{doc} +% \end{macrocode} +% +% Make \verb+|+ be a `short verb' character, but not in the document +% preamble, where an active character may interfere with packages that +% are loaded. +% \begin{macrocode} +\AtBeginDocument{\MakeShortVerb{\|}} +% \end{macrocode} +% +% As `doc' documents tend to have a lot of monospaced material, +% Set up some |tt| substitutions to occur silently. +% \changes{v2.0p}{1995/11/02}{Add font substitutions} +% \changes{v2.0t}{1999/04/17}{Replaced octal number, CAR} +% \begin{macrocode} +\DeclareFontShape{OT1}{cmtt}{bx}{n}{<-> ssub * cmtt/m/n}{} +\DeclareFontFamily{OMS}{cmtt}{\skewchar\font 48} % '60 +\DeclareFontShape{OMS}{cmtt}{m}{n}{<-> ssub * cmsy/m/n}{} +\DeclareFontShape{OMS}{cmtt}{bx}{n}{<-> ssub * cmsy/b/n}{} +% \end{macrocode} +% This substitution is in the standard fd file, but not silent. +% \begin{macrocode} +\DeclareFontShape{OT1}{cmss}{m}{it}{<->ssub*cmss/m/sl}{} +% \end{macrocode} +% +% \begin{macrocode} +\CodelineNumbered +\DisableCrossrefs +% \end{macrocode} +% +% Increase the text width slightly so that width the standard fonts +% 72 columns of code may appear in a |macrocode| environment. +% \changes{v2.0c}{1994/03/15}{Set \cs{textwidth}.} +% \begin{macrocode} +\setlength{\textwidth}{355pt} +% \end{macrocode} +% +% Increase the marginpar width slightly, for long command names. +% And increase the left margin by a similar amount +% \changes{v2.0l} +% {1994/05/25}{Increase \cs{marginparwidth}} +% \changes{v2.0q}{1995/11/28} +% {Increase \cs{marginparwidth} and page margin.} +% \begin{macrocode} +\addtolength\marginparwidth{30pt} +\addtolength\oddsidemargin{20pt} +\addtolength\evensidemargin{20pt} +% \end{macrocode} +% +% +% \begin{macrocode} +\setcounter{StandardModuleDepth}{1} +% \end{macrocode} +% +% \section{Useful abbreviations} +% +% |\cmd{\foo}| Prints |\foo| verbatim. It may be used inside moving +% arguments. |\cs{foo}| also prints |\foo|, for those who prefer that +% syntax. (This second form may even be used when |\foo| is |\outer|). +% \begin{macro}{\cmd} +% \changes{v2.0k}{1994/05/21}{New definition, so \cmd\{ works.} +% \begin{macro}{\cs} +% \changes{v2.0d}{1994/03/17}{Add \cs{cs}} +% \begin{macrocode} +\def\cmd#1{\cs{\expandafter\cmd@to@cs\string#1}} +\def\cmd@to@cs#1#2{\char\number`#2\relax} +\DeclareRobustCommand\cs[1]{\texttt{\char`\\#1}} +% \end{macrocode} +% \end{macro} +% \end{macro} +% +% \changes{v2.0r}{1996/01/11}{Removed \cs{star} since useless pr/2039} +% +% \begin{macro}{\marg} +% \changes{v2.0d}{1994/03/17}{Add \cs{marg}} +% |\marg{text}| prints \marg{text}, `mandatory argument'. +% \begin{macrocode} +\providecommand\marg[1]{% + {\ttfamily\char`\{}\meta{#1}{\ttfamily\char`\}}} +% \end{macrocode} +% \end{macro} +% +% \begin{macro}{\oarg} +% |\oarg{text}| prints \oarg{text}, `optional argument'. +% \begin{macrocode} +\providecommand\oarg[1]{% + {\ttfamily[}\meta{#1}{\ttfamily]}} +% \end{macrocode} +% \end{macro} +% +% \begin{macro}{\parg} +% |\parg{te,xt}| prints \parg{te,xt}, `picture mode argument'. +% \changes{v2.0h}{1994/04/28}{Add \cs{parg}} +% \changes{v2.0o}{1995/08/09}{Use \cs{meta} when showing arguments} +% \begin{macrocode} +\providecommand\parg[1]{% + {\ttfamily(}\meta{#1}{\ttfamily)}} +% \end{macrocode} +% \end{macro} +% +% +% \section{Old Comments} +% +% The \LaTeXe\ sources contain a lot of code inherited from +% \LaTeX2.09. The comments in this code were not designed to be +% typeset, and do not contain the necessary \LaTeX\ markup. The +% \texttt{oldcomments} environment typesets these comments, +% automatically sensing when any control sequence appears, and +% implicitly adding the |\verb|. This procedure does not produce +% particularly beautiful pages, but it allows us to fully document new +% sections, and have some form of typeset comments on all the old +% code. +% \changes{v2.0e}{1994/03/18}{Use a fixed font.} +% +% Scan control names and put them in tt. +% will actually (incorrectly) scan past |\\| but this does not matter as +% this is almost never followed by a letter in practice. +% (ie |\\foo|) would put |foo| in |\ttfamily|. +% \begin{macrocode} +\def\oc@scan#1{% + \ifx\oc@bslash#1% + \egroup\let\next\oc@bslash\else + \ifcat a\noexpand#1% + #1\let\next\oc@scan\else + \ifx\oc@percent#1% + \def\next{\char`\%\egroup}% + \else + #1\let\next\egroup + \fi\fi\fi\next} +% \end{macrocode} +% +% \begin{macrocode} +\def\oc@bslash{\bgroup\oc@ttf\char`\\\oc@scan}% +% \end{macrocode} +% +% \begin{macrocode} +\def\oc@verb#1{% + \catcode`#1\active + \uccode`\~`#1% + \uppercase{\def~{{\oc@ttf\char`#1}}}} +% \end{macrocode} +% +% \begin{macrocode} +\begingroup + \obeyspaces% + \catcode`\/=\catcode`\\ + /catcode`/\/active + /catcode`<=/catcode`{% + /catcode`>=/catcode`}% + /catcode`/{/active% + /catcode`/}/active% + /gdef/oldc< \end{oldcomments}>% + /gdef/begmac< \begin{macrocode}>% + /gdef/obs>>% +/endgroup% +% \end{macrocode} +% +% \begin{macrocode} +\begingroup + \catcode`\/=\catcode`\\ + \catcode`\\=13 + /catcode`/|=/catcode`/% + /catcode`/%=13 + /gdef/oldcomments{| + /makeatletter + /let/do/oc@verb/dospecials + /frenchspacing/@vobeyspaces/obs + /raggedright + /oc@verb/>| + /oc@verb/<| + /let\/oc@bslash + /let%/oc@percent + /obeylines + /parindent/z@ + /ttfamily/expandafter/let/expandafter/oc@ttf/the/font + /rmfamily + /hfuzz/maxdimen + } +/endgroup +% \end{macrocode} +% +% \begin{macrocode} +\begingroup + \sloppy% + \obeylines% + \gdef\oc@percent#1^^M{% + \ifvmode% + \def\commentline{#1}% + \ifx\commentline\oldc% + \end{oldcomments}% + \else% + \ifx\commentline\begmac% + \begin{macrocode}% + \else% + \leavevmode% + #1^^M% + \fi\fi% + \else% + {\oc@ttf\char`\%}#1^^M% + \fi}% +\endgroup% +% \end{macrocode} +% +% +% \section{DocInclude} +% +% \begin{macrocode} +\@addtoreset{CodelineNo}{part} +% \end{macrocode} +% +% \begin{macro}{\DocInclude} +% More or less exactly the same as |\include|, but uses |\DocInput| +% on a |dtx| file, not |\input| on a |tex| file. +% \changes{v2.0b}{1994/03/14}{Rename from \cs{docinclude}} +% \changes{v2.0f}{1994/03/25}{Use \cs{part}} +% \changes{v2.0u}{1999/08/08}{Also works for .fdd (M. Schroeder)} +% \begin{macrocode} +\def\partname{File} +% \end{macrocode} +% +% \begin{macrocode} +\newcommand*{\DocInclude}[1]{% + \relax + \clearpage + \docincludeaux + \IfFileExists{#1.fdd}{\def\currentfile{#1.fdd}}{\def\currentfile{#1.dtx}}% + \ifnum\@auxout=\@partaux + \@latexerr{\string\include\space cannot be nested}\@eha + \else \@docinclude#1 \fi} +\def\@docinclude#1 {\clearpage +\if@filesw \immediate\write\@mainaux{\string\@input{#1.aux}}\fi +\@tempswatrue\if@partsw \@tempswafalse\edef\@tempb{#1}\@for +\@tempa:=\@partlist\do{\ifx\@tempa\@tempb\@tempswatrue\fi}\fi +\if@tempswa \let\@auxout\@partaux \if@filesw +\immediate\openout\@partaux #1.aux +\immediate\write\@partaux{\relax}\fi +% \end{macrocode} +% We need to save (and later restore) various index-related +% commands which might be changed by the included file. +% \begin{macrocode} +\let\@ltxdoc@PrintIndex\PrintIndex +\let\PrintIndex\relax +\let\@ltxdoc@PrintChanges\PrintChanges +\let\PrintChanges\relax +\let\@ltxdoc@theglossary\theglossary +\let\@ltxdoc@endtheglossary\endtheglossary +\part{\currentfile}% + {\let\ttfamily\relax + \xdef\filekey{\filekey, \thepart={\ttfamily\currentfile}}}% +\DocInput{\currentfile}% +\let\PrintIndex\@ltxdoc@PrintIndex +\let\PrintChanges\@ltxdoc@PrintChanges +\let\theglossary\@ltxdoc@theglossary +\let\endtheglossary\@ltxdoc@endtheglossary +\clearpage +\@writeckpt{#1}\if@filesw \immediate\closeout\@partaux \fi +\else\@nameuse{cp@#1}\fi\let\@auxout\@mainaux} +% \end{macrocode} +% +% \begin{macrocode} +\gdef\codeline@wrindex#1{\if@filesw + \immediate\write\@indexfile + {\string\indexentry{#1}% + {\filesep\number\c@CodelineNo}}\fi}% +% \end{macrocode} +% \end{macro} +% +% \begin{macrocode} +\let\filesep\@empty +% \end{macrocode} +% +% +% \begin{macro}{\aalph} +% Special form of |\alph| as currently |source2e.tex| +% includes more than 26 files +% \changes{v2.0n}{1994/05/27}{Use uppercase letters, for makeindex}. +% \begin{macrocode} +\def\aalph#1{\@aalph{\csname c@#1\endcsname}} +\def\@aalph#1{% + \ifcase#1\or a\or b\or c\or d\or e\or f\or g\or h\or i\or + j\or k\or l\or m\or n\or o\or p\or q\or r\or s\or + t\or u\or v\or w\or x\or y\or z\or A\or B\or C\or + D\or E\or F\or G\or H\or I\or J\or K\or L\or M\or + N\or O\or P\or Q\or R\or S\or T\or U\or V\or W\or + X\or Y\or Z\else\@ctrerr\fi} +% \end{macrocode} +% \end{macro} +% +% \begin{macro}{\docincludeaux} +% \changes{v2.06}{1994/03/31}{Use \cs{footnotesize} in file key.} +% \changes{v2.0k}{1994/05/21}{Use \cs{aalph}} +% \begin{macrocode} +\def\docincludeaux{% + \def\thepart{\aalph{part}}\def\filesep{\thepart-}% + \let\filekey\@gobble + \g@addto@macro\index@prologue{% + \gdef\@oddfoot{\parbox{\textwidth}{\strut\footnotesize + \raggedright{\bfseries File Key:} \filekey}}% + \let\@evenfoot\@oddfoot}% + \global\let\docincludeaux\relax + \gdef\@oddfoot{% + \expandafter\ifx\csname ver@\currentfile\endcsname\relax + File \thepart: {\ttfamily\currentfile} % + \else + \GetFileInfo{\currentfile}% + File \thepart: {\ttfamily\filename} % + Date: \filedate\ % + Version \fileversion + \fi + \hfill\thepage}% + \let\@evenfoot\@oddfoot}% +% \end{macrocode} +% \end{macro} +% +% +% \begin{macrocode} +\def\task#1#2{} +% +% \end{macrocode} +% \Finale +% diff --git a/Master/texmf-dist/source/latex/base/ltxref.dtx b/Master/texmf-dist/source/latex/base/ltxref.dtx new file mode 100644 index 00000000000..f0435c49261 --- /dev/null +++ b/Master/texmf-dist/source/latex/base/ltxref.dtx @@ -0,0 +1,341 @@ +% \iffalse meta-comment +% +% Copyright 1993 1994 1995 1996 1997 1998 1999 2000 2001 2002 2003 2004 +% The LaTeX3 Project and any individual authors listed elsewhere +% in this file. +% +% This file is part of the LaTeX base system. +% ------------------------------------------- +% +% It may be distributed and/or modified under the +% conditions of the LaTeX Project Public License, either version 1.3 +% of this license or (at your option) any later version. +% The latest version of this license is in +% http://www.latex-project.org/lppl.txt +% and version 1.3 or later is part of all distributions of LaTeX +% version 2003/12/01 or later. +% +% This file has the LPPL maintenance status "maintained". +% +% The list of all files belonging to the LaTeX base distribution is +% given in the file `manifest.txt'. See also `legal.txt' for additional +% information. +% +% The list of derived (unpacked) files belonging to the distribution +% and covered by LPPL is defined by the unpacking scripts (with +% extension .ins) which are part of the distribution. +% +% \fi +% +% \iffalse +%%% From File: ltxref.dtx +% +%<*driver> +% \fi +\ProvidesFile{ltxref.dtx} + [2001/02/16 v1.1k LaTeX Kernel (Cross Referencing)] +% \iffalse +\documentclass{ltxdoc} +\GetFileInfo{ltxref.dtx} +\title{\filename} +\date{\filedate} + \author{% + Johannes Braams\and + David Carlisle\and + Alan Jeffrey\and + Leslie Lamport\and + Frank Mittelbach\and + Chris Rowley\and + Rainer Sch\"opf} + +\begin{document} +\maketitle + \DocInput{\filename} +\end{document} +% +% \fi +% +% \CheckSum{92} +% +% \changes{v1.0c}{1994/03/29} +% {Create file ltcntlen from parts of ltmiscen and ltherest.} +% \changes{v1.1a}{1994/05/19} +% {Extract file ltxref from ltcntlen.} +% \changes{v1.1b}{1994/05/21}{Use new warning commands} +% \changes{v1.1c}{1994/05/25}{Modify documentation} +% +% \section{Cross Referencing} +% The user writes |\label|\marg{foo} to define the following +% cross-references: +% +% |\ref|\marg{foo}: value of most recently incremented referencable +% counter. in the current environment. (Chapter, section, +% theorem and enumeration counters counters are +% referencable, footnote counters are not.) +% +% |\pageref|\marg{foo}: page number at which |\label{foo}| command +% appeared. where foo can be any string of characters not +% containing `|\|', `|{|' or `|}|'. +% +% Note: The scope of the |\label| command is delimited by environments, +% so\\ +% |\begin{theorem} \label{foo} ... \end{theorem} \label{bar}|\\ +% defines |\ref{foo}| to be the theorem number and |\ref{bar}| to be +% the current section number. +% +% Note: |\label| does the right thing in terms of spacing -- i.e., +% leaving a space on both sides of it is equivalent to leaving +% a space on either side. +% +% +% \StopEventually{} +% +% \subsection{Cross Referencing} +% +% \begin{oldcomments} +% \begin{macrocode} +%<*2ekernel> +\message{x-ref,} +% \end{macrocode} +% +% This is implemented as follows. A referencable counter CNT is +% incremented by the command \refstepcounter{CNT} , which sets +% \@currentlabel == {CNT}{eval(\p@cnt\theCNT)}. The command +% \label{FOO} then writes the following on file \@auxout : +% \newlabel{FOO}{{eval(\@currentlabel)}{eval(\thepage)}} +% +% \ref{FOO} == +% BEGIN +% if \r@foo undefined +% then @refundefined := G T +% ?? +% Warning: 'reference foo on page ... undefined' +% else \@car \eval(\r@FOO)\@nil +% fi +% END +% +% \pageref{foo} = +% BEGIN +% if \r@foo undefined +% then @refundefined := G T +% ?? +% Warning: 'reference foo on page ... undefined' +% else \@cdr \eval(\r@FOO)\@nil +% fi +% END +% +% \end{oldcomments} +% +% \begin{macro}{\G@refundefinedtrue} +% \changes{v1.1i}{1995/12/07}{Renamed (back) from \cs{G@refundefined}} +% \begin{macro}{\@refundefined} +% \changes{v1.1h}{1995/10/24}{Switch for refundefined replaced} +% This does not save on name-space (since \cs{G@refundefinedfalse} +% was never needed) but it does make the implmentation of such +% one-way switches more consistent. The extra macro to make the +% change is used since this change appears several times. +% +% \textbf{Note} despite its name, |\G@refundefinedtrue| does +% \emph{not} correspnd to an |\if| command, and there is no +% matching \ldots|false|. It would be more natural to call the +% command |\G@refundefined| (as inspection of the change log will +% reveal) but unfortunately such a change would break any package +% that had defined a |\ref|-like command that mimicked the +% definition of |\ref|, calling |\G@refundefinedtrue|. Inspection +% of the \TeX\ archives revealed several such packages, and so this +% command has been named \ldots|true| so that the definition of +% |\ref| need not be changed, and the packages will work without +% change. +% \begin{macrocode} +% \newif\ifG@refundefined +% \def\G@refundefinedtrue{\global\let\ifG@refundefined\iftrue} +% \def\G@refundefinedfalse{\global\let\ifG@refundefined\iffalse} +\def\G@refundefinedtrue{% + \gdef\@refundefined{% + \@latex@warning@no@line{There were undefined references}}} +\let\@refundefined\relax +% \end{macrocode} +% \end{macro} +% \end{macro} +% +% \begin{macrocode} +% \end{macrocode} +% \begin{macro}{\ref} +% \changes{LaTeX2e}{1993/12/11}{Macro reimplemented} +% \begin{macro}{\pageref} +% \changes{LaTeX2e}{1993/12/11}{Macro reimplemented} +% \begin{macro}{\@setref} +% \changes{LaTeX2e}{1993/12/11}{Macro added} +% \changes{v1.1h}{1995/10/24}{Switch for refundefined renamed} +% \changes{v1.1i}{1995/12/07}{Switch for refundefined restored} +% Referencing a |\label|. +% RmS 91/10/25: added a few extra |\reset@font|, +% as suggested by Bernd Raichle +% +% RmS 92/08/14: made |\ref| and |\pageref| robust +% +% RmS 93/09/08: Added setting of refundefined switch. +% \begin{macrocode} +\def\@setref#1#2#3{% + \ifx#1\relax + \protect\G@refundefinedtrue + \nfss@text{\reset@font\bfseries ??}% + \@latex@warning{Reference `#3' on page \thepage \space + undefined}% + \else + \expandafter#2#1\null + \fi} +\def\ref#1{\expandafter\@setref\csname r@#1\endcsname\@firstoftwo{#1}} +\def\pageref#1{\expandafter\@setref\csname r@#1\endcsname + \@secondoftwo{#1}} +% \end{macrocode} +% \end{macro} +% \end{macro} +% \end{macro} +% +% +% \begin{macro}{\newlabel} +% \changes{v1.1b}{1994/05/21}{Use new warning commands} +% \changes{v1.1e}{1995/04/24}{Make \cs{@onlypreamble} for /1388.} +% \changes{v1.1e}{1995/06/19} +% {Use \cs{@newl@bel} to share code with \cs{bibcite}} +% \changes{v1.1g}{1995/07/14} +% {Remove \cs{@onlypreamble} so still defined in new \cs{enddocument}} +% This command will be written to the \texttt{.aux} file to +% pass label information from one run to another. +% \begin{macro}{\@newl@bel} +% The internal form of |\newlabel| and |\bibcite|. Note that this +% macro does it's work inside a group. That way the local +% assignments it needs to do don't clutter the save stack. This +% prevents large documents with many labels to run out of save +% stack. +% \changes{v1.1h}{1995/10/24}{Switch for multiplelabels replaced by +% inline code} +% \changes{v1.1k}{2001/02/16}{Added an extra grouplevel (PR3250), jlb} +% \begin{macrocode} +\def\@newl@bel#1#2#3{{% + \@ifundefined{#1@#2}% + \relax + {\gdef \@multiplelabels {% + \@latex@warning@no@line{There were multiply-defined labels}}% + \@latex@warning@no@line{Label `#2' multiply defined}}% + \global\@namedef{#1@#2}{#3}}} +% \end{macrocode} +% +% \begin{macrocode} +\def\newlabel{\@newl@bel r} +% \end{macrocode} +% +% \begin{macrocode} +\@onlypreamble\@newl@bel +% \end{macrocode} +% \end{macro} +% \end{macro} +% +% \begin{macro}{\if@multiplelabels} +% \changes{v1.1h}{1995/10/24}{Macro removed} +% \begin{macro}{\@multiplelabels} +% \changes{v1.1h}{1995/10/24}{Switch for multiplelabels removed} +% This is redefined to produce a warning if at least one label is +% defined more than once. It is executed by the |\enddocument| +% command. +% \begin{macrocode} +\let \@multiplelabels \relax +% \end{macrocode} +% \end{macro} +% \end{macro} +% +% \begin{macro}{\label} +% \changes{v1.1d}{1994/11/04}{(ASAJ)Added \cs{protected@write}} +% \begin{macro}{\refstepcounter} +% \changes{v1.1d}{1994/11/04}{(ASAJ)Added \cs{protected@edef}} +% The commands |\label| and |\refstepcounter| have been changed to +% allow |\protect|'ed commands to work properly. For example, +%\begin{verbatim} +% \def\thechapter{\protect\foo{\arabic{chapter}.\roman{section}}} +%\end{verbatim} +% will cause a |\label{bar}| command to define |\ref{bar}| to expand +% to something like |\foo{4.d}|. Change made 20 Jul 88. +% +% \begin{macrocode} +\def\label#1{\@bsphack + \protected@write\@auxout{}% + {\string\newlabel{#1}{{\@currentlabel}{\thepage}}}% + \@esphack} +% \end{macrocode} +% +% \begin{macrocode} +\def\refstepcounter#1{\stepcounter{#1}% + \protected@edef\@currentlabel + {\csname p@#1\endcsname\csname the#1\endcsname}% +} +% \end{macrocode} +% \end{macro} +% \end{macro} +% +% +% \begin{macro}{\@currentlabel} +% For |\label| commands that come before any environment +% +% \begin{macrocode} +\def\@currentlabel{} +% \end{macrocode} +% \end{macro} +% +% \begin{macrocode} +% +% \end{macrocode} +% +% \subsection{An extension of counter referencing} +% +% +% At the moment a reference to a counter |foo| will generate the +% equivalent of |\p@foo\thefoo| although not quite in this form. For +% some applications it would be nice of one could have |\thefoo| being +% an argument to |\p@foo| to be able to put material before and after +% the number generated by |\thefoo|. This can be easily achieved with +% a small change to one of the kernel commands as follows: +% +%\begin{verbatim} +%\def\refstepcounter#1{\stepcounter{#1}% +% \protected@edef\@currentlabel +% {\csname p@#1\expandafter\endcsname\csname the#1\endcsname}% +%} +%\end{verbatim} +% +% The trick is to ensure that |\csname the#1\endcsname| is turned into +% a single token before |\p@...| is expanded further. This way, if the +% |\p@...| command is a macro with one argument it will receive +% |\the...|. With the kernel code (i.e., without the |\expandafter|) +% it will instead pick up |\csname| which would be disastrous. +% +% Using |\expandafter| instead of braces delimiting the argument is +% better because, assuming that the |\p@...| command is not defined as +% a macro with one argument, the braces will stay and prohibit kerning +% that might otherwise happen between the glyphs generated by +% |\the...| and surrounding glyphs. +% +% We have refrained from making this change in the kernel code +% although for exisiting documents it would be 100\% backward +% compatible. The reason being that any class or package making use of +% this functionality would then horribly fail with older \LaTeX{} +% installations. +% +% Instead we suggest that people who are interested in using this +% functionality in a document class or package add the redefinition to +% the class file. To ensure that this redefinition is properly applied +% they might want to test for the original definition first, e.g. +% +%\begin{verbatim} +%\CheckCommand*\refstepcounter[1]{\stepcounter{#1}% +% \protected@edef\@currentlabel +% {\csname p@#1\endcsname\csname the#1\endcsname}% +%} +%\renewcommand*\refstepcounter[1]{\stepcounter{#1}% +% \protected@edef\@currentlabel +% {\csname p@#1\expandafter\endcsname\csname the#1\endcsname}% +%} +%\end{verbatim} +% +% \Finale +% diff --git a/Master/texmf-dist/source/latex/base/makeindx.dtx b/Master/texmf-dist/source/latex/base/makeindx.dtx new file mode 100644 index 00000000000..563058817f2 --- /dev/null +++ b/Master/texmf-dist/source/latex/base/makeindx.dtx @@ -0,0 +1,313 @@ +% \iffalse meta-comment +% +% Copyright 1993 1994 1995 1996 1997 1998 1999 2000 2001 2002 2003 2004 +% The LaTeX3 Project and any individual authors listed elsewhere +% in this file. +% +% This file is part of the LaTeX base system. +% ------------------------------------------- +% +% It may be distributed and/or modified under the +% conditions of the LaTeX Project Public License, either version 1.3 +% of this license or (at your option) any later version. +% The latest version of this license is in +% http://www.latex-project.org/lppl.txt +% and version 1.3 or later is part of all distributions of LaTeX +% version 2003/12/01 or later. +% +% This file has the LPPL maintenance status "maintained". +% +% The list of all files belonging to the LaTeX base distribution is +% given in the file `manifest.txt'. See also `legal.txt' for additional +% information. +% +% The list of derived (unpacked) files belonging to the distribution +% and covered by LPPL is defined by the unpacking scripts (with +% extension .ins) which are part of the distribution. +% +% \fi +%\CheckSum{178} +%\iffalse +% Copyright (C) 1985 by Leslie Lamport +% Copyright (C) 1994-98 by \LaTeX3 Project and Johannes Braams +%\fi +% +% \changes{1.0b}{1994/01/21}{added a missing \cs{end\{macro\}}, a +% missing docstrip end of module and corrected a few typos} +% \changes{1.0d}{1994/02/11}{Corrected a few documentation errors; +% added \cs{Checksum}} +% \changes{1.0e}{1994/02/22}{Another documentation flaw fixed} +% \changes{1.0f}{1994/03/01}{Moved driver further up; corrected a few +% errors} +% \changes{1.0f}{1994/03/01}{Added overview of {\sc docstrip} modules} +% \changes{1.0i}{1994/11/11}{(DPC) Removed spurious \cs{wlog}} +% \changes{1.0k}{1998/08/17}{(RmS) Minor documentation corrections.} +% \changes{1.0m}{2000/03/29}{(RmS) Added macros \cs{seealso} and \cs{alsoname}.} +% +%\title{Standard \LaTeXe\ packages \texttt{makeidx} and +% \texttt{showidx}} +% +% \author{% +% Johannes Braams\and +% David Carlisle\and +% Alan Jeffrey\and +% Leslie Lamport\and +% Frank Mittelbach\and +% Chris Rowley\and +% Rainer Sch\"opf} +% +% \date{1994/11/11} +% \maketitle +% +% \section{Description} +% +% \subsection{Makeidx} +% +% The package \texttt{makeidx} provides two new commands, |\see| +% and |\printindex|. +% +% \DescribeMacro\see +% The command |\see| can used in the index to cross reference to +% other items. +% +% \DescribeMacro\printindex +% This command can be used to include the sorted and formatted +% index in the document. +% +% \subsection{Showidx} +% +% The package \texttt{showidx} changes a number of internal +% \LaTeXe\ commands in such a way that each index entry is shown in +% the margin on the page where the entry appears. This package was +% originally meant to be used with the \texttt{report} and +% \texttt{book} document classes, but works with other classes as +% well. It makes |\flushbottom| the default. +% +% \StopEventually{} +% +% \section{The {\sc docstrip} modules} +% +% The following modules are used in the implementation to direct +% {\sc docstrip} in generating the external files: +% \begin{center} +% \begin{tabular}{ll} +% makeidx & produce makeidx.sty\\ +% showidx & produce showidx.sty\\ +% driver & produce a documentation driver file \\ +% \end{tabular} +% \end{center} +% +% \section{The documentation driver file} +% +% The next bit of code contains the documentation driver file for +% \TeX{}, i.e., the file that will produce the documentation you are +% currently reading. It can be extracted from this file by the +% {\sc docstrip} program. +% \begin{macrocode} +%<*driver> +\documentclass{ltxdoc} +\begin{document} +\DocInput{makeindx.dtx} +\end{document} +% +% \end{macrocode} +% +% \section{Implementation} +% +% \subsection{Identification} +% +% Announce the package and its version: +% \changes{v1.0h}{1994/05/01}{Removed use of variables} +% \begin{macrocode} +%\ProvidesPackage{makeidx} +%\ProvidesPackage{showidx} + [2000/03/29 v1.0m Standard LaTeX package] +% \end{macrocode} +% +% \subsection{Makeidx} +% +% \begin{macro}{\see} +% This macro discards its second argument (typically a page number) +% and just prints |\seename| together with the entry the reader is +% pointed to. +% \changes{v1.0j}{1995/04/19}{Use \cs{emph} instead of \cs{em}} +% \changes{v1.0j}{1995/04/19}{Disallow \cs{par} in argument} +% \begin{macrocode} +%<*makeidx> +\newcommand*\see[2]{\emph{\seename} #1} +% \end{macrocode} +% \end{macro} +% +% \begin{macro}{\seealso} +% \changes{v1.0m}{2000/03/29}{Macro added (see PR 3133).} +% This macro discards its second argument (typically a page number) +% and just prints |\alsoname| together with the entry the reader is +% pointed to. We use |\providecommand| to retain compatibility with +% existing files that define this macro. +% \begin{macrocode} +\providecommand*\seealso[2]{\emph{\alsoname} #1} +% \end{macrocode} +% \end{macro} +% +% \begin{macro}{\printindex} +% This command simply inputs the (formatted) index if it exists, +% otherwise a warning is issued. +% \changes{1.0c}{1994/02/08}{Use \cs{@input@} instead of \cs{@input} to +% get the index listed by \cs{listfiles}} +% \begin{macrocode} +\newcommand\printindex{\@input@{\jobname.ind}} +% \end{macrocode} +% \end{macro} +% +% \begin{macro}{\seename} +% This package is for documents prepared in the English language. +% To prepare a version for another language, various English words +% must be replaced. All the English words that require replacement +% are% defined below in command names. +% \changes{1.0g}{1994/03/07}{Replaced \cs{newcommand} by \cs{providecommand}.} +% \begin{macrocode} +\providecommand\seename{see} +% \end{macrocode} +% We used |\providecommand| in case the command is already defined +% by a package loaded earlier. +% \end{macro} +% +% \begin{macro}{\alsoname} +% \changes{v1.0m}{2000/03/29}{Macro added (see PR 3133).} +% This macro discards its second argument (typically a page number) +% and just prints |\alsoname| together with the entry the reader is +% pointed to. We use |\providecommand| to retain compatibility with +% existing files that define this macro. +% \begin{macrocode} +\providecommand*\alsoname{see also} +% +% \end{macrocode} +% \end{macro} +% +% \subsection{showidx} +% +% \begin{macro}{\indexbox} +% This package uses \TeX's insert mechanism, therefore it needs to +% allocate an insert register. +% \begin{macrocode} +%<*showidx> +\newinsert\indexbox +\dimen\indexbox=\maxdimen +% \end{macrocode} +% \end{macro} +% +% \begin{macro}{\index} +% This is a modified default definition for the user level |\index| +% command. The difference is the change of the category code of the +% space character. +% \begin{macrocode} +\renewcommand\index{\@bsphack\begingroup + \@sanitize\catcode32=10\relax\@index} +% \end{macrocode} +% \end{macro} +% +% \begin{macro}{\makeindex} +% The same change has to be included in the user level |\makeindex| +% command, which changes the definition of |\index| to actually +% write index entries to an external file. +% \begin{macrocode} +\renewcommand\makeindex{\if@filesw \newwrite\@indexfile + \immediate\openout\@indexfile=\jobname.idx + \def\index{\@bsphack\begingroup + \def\protect####1{\string####1\space}\@sanitize + \catcode32=10 \@wrindex\@indexfile}\typeout + {Writing index file \jobname.idx }\fi} +% \end{macrocode} +% \end{macro} +% +% \begin{macro}{\@wrindex} +% This macro takes care of writing the index entries to a file. The +% definition is modified to call |\@showidx|. +% \begin{macrocode} +\def\@wrindex#1#2{\let\thepage\relax + \xdef\@gtempa{\write#1{\string + \indexentry{#2}{\thepage}}}\endgroup\@gtempa + \@showidx{#2}\if@nobreak \ifvmode\nobreak\fi\fi\@esphack} +% \end{macrocode} +% \end{macro} +% +% \begin{macro}{\@index} +% When the user didn't use the |\makeindex| command, the |\index| +% macro calls |\@index|, which normally does basically nothing. +% This package changes the definition to call |\@showidx|, which +% includes the entry in the list of indexentries on the current page. +% \begin{macrocode} +\def\@index#1{\@showidx{#1}\endgroup\@esphack} +% \end{macrocode} +% \end{macro} +% +% \begin{macro}{\@showidx} +% This macro adds the current index entry to the insert +% |\indexbox|. The |\indexbox| is typeset as a flushleft paragraph. +% \begin{macrocode} +\def\@showidx#1{% + \insert\indexbox{\small + \hsize\marginparwidth + \hangindent\marginparsep \parindent\z@ + \everypar{}\let\par\@@par \parfillskip\@flushglue + \lineskip\normallineskip + \baselineskip .8\normalbaselineskip\sloppy + \raggedright \leavevmode + \vrule \@height .7\normalbaselineskip \@width \z@\relax + #1\relax + \vrule \@height \z@ \@depth .3\normalbaselineskip \@width \z@}} +% \end{macrocode} +% \end{macro} +% +% \begin{macro}{\raggedbottom} +% \begin{macro}{\flushbottom} +% The definition of these macros from \texttt{latex.dtx} is changed +% here to add the execution of |\@mkidx| to |\@texttop|, which is +% executed at the top of each page. +% \begin{macrocode} +\renewcommand\raggedbottom{\def\@textbottom{\vskip + \z@ plus.0001fil}\let\@texttop\@mkidx} +\renewcommand\flushbottom{\let\@textbottom\relax + \let\@texttop\@mkidx} +% \end{macrocode} +% \end{macro} +% \end{macro} +% +% \begin{macro}{\@mkidx} +% This macro actually typesets the box containing all the index +% entries on the current page. They will occur on the left or the +% right side of the text, or both, depending on the setting of the +% switches |\if@twocolumn| and |\if@twoside|. +% \begin{macrocode} +\def\@mkidx{\vbox to \z@{\hbox{\if@twocolumn + \if@firstcolumn \@leftidx \else \@rightidx \fi + \else \if@twoside \ifodd\c@page \@rightidx + \else \@leftidx \fi + \else \@rightidx \fi + \fi + \box\indexbox}\vss}} +% \end{macrocode} +% \end{macro} +% +% \begin{macro}{\@leftidx} +% \begin{macro}{\@rightidx} +% These macros give the amount of displacemant for the |\indexbox|. +% \begin{macrocode} +\def\@leftidx{\hskip-\marginparsep \hskip-\marginparwidth} +\def\@rightidx{\hskip\columnwidth \hskip\marginparsep} +% \end{macrocode} +% \end{macro} +% \end{macro} +% +% To make this work we have to execute either |\raggedbottom| or +% |\flushbottom|. Assuming this package is used most often with the +% document classes \texttt{report} and \texttt{book}, we execute +% |\flushbottom|. +% \begin{macrocode} +\flushbottom +% +% \end{macrocode} +% +% \Finale +% +\endinput diff --git a/Master/texmf-dist/source/latex/base/makeindx.ins b/Master/texmf-dist/source/latex/base/makeindx.ins new file mode 100644 index 00000000000..73e45c3f7c4 --- /dev/null +++ b/Master/texmf-dist/source/latex/base/makeindx.ins @@ -0,0 +1,96 @@ +%% +%% This file will generate fast loadable files and documentation +%% driver files from the doc files in this package when run through +%% LaTeX or TeX. +%% +%% Copyright 1993 1994 1995 1996 1997 1998 1999 2000 2001 2002 2003 2004 +%% The LaTeX3 Project and any individual authors listed elsewhere +%% in this file. +%% +%% This file is part of the LaTeX base system. +%% ------------------------------------------- +%% +%% It may be distributed and/or modified under the +%% conditions of the LaTeX Project Public License, either version 1.3 +%% of this license or (at your option) any later version. +%% The latest version of this license is in +%% http://www.latex-project.org/lppl.txt +%% and version 1.3 or later is part of all distributions of LaTeX +%% version 2003/12/01 or later. +%% +%% This file has the LPPL maintenance status "maintained". +%% +%% In particular, NO PERMISSION is granted to modify the contents of this +%% file since it contains the legal notices that are placed in the files +%% it generates. +%% +%% The list of all files belonging to the LaTeX base distribution is +%% given in the file `manifest.txt'. See also `legal.txt' for additional +%% information. +%% +%% +%% +%% +%% --------------- start of docstrip commands ------------------ +%% + +\input docstrip + +\preamble + +This is a generated file. + +Copyright 1993 1994 1995 1996 1997 1998 1999 2000 2001 2002 2003 2004 +The LaTeX3 Project and any individual authors listed elsewhere +in this file. + +This file was generated from file(s) of the LaTeX base system. +-------------------------------------------------------------- + +It may be distributed and/or modified under the +conditions of the LaTeX Project Public License, either version 1.3 +of this license or (at your option) any later version. +The latest version of this license is in + http://www.latex-project.org/lppl.txt +and version 1.3 or later is part of all distributions of LaTeX +version 2003/12/01 or later. + +This file has the LPPL maintenance status "maintained". + +This file may only be distributed together with a copy of the LaTeX +base system. You may however distribute the LaTeX base system without +such generated files. + +The list of all files belonging to the LaTeX base distribution is +given in the file `manifest.txt'. See also `legal.txt' for additional +information. + +The list of derived (unpacked) files belonging to the distribution +and covered by LPPL is defined by the unpacking scripts (with +extension .ins) which are part of the distribution. +\endpreamble + +\keepsilent +\usedir{tex/latex/base} + +\generate{\file{makeidx.sty}{\from{makeindx.dtx}{makeidx}} + \file{showidx.sty}{\from{makeindx.dtx}{showidx}} + } + +\ifToplevel{ +\Msg{***********************************************************} +\Msg{*} +\Msg{* To finish the installation you have to move the following} +\Msg{* files into a directory searched by TeX:} +\Msg{*} +\Msg{* \space\space makeidx.sty} +\Msg{* \space\space showidx.sty} +\Msg{*} +\Msg{* To produce the documentation run the files ending with} +\Msg{* `.dtx' through LaTeX.} +\Msg{*} +\Msg{* Happy TeXing} +\Msg{***********************************************************} +} + +\endbatchfile diff --git a/Master/texmf-dist/source/latex/base/newdc.ins b/Master/texmf-dist/source/latex/base/newdc.ins new file mode 100644 index 00000000000..1e02efda6f7 --- /dev/null +++ b/Master/texmf-dist/source/latex/base/newdc.ins @@ -0,0 +1,122 @@ +%% +%% This file will generate fast loadable files and documentation +%% driver files from the doc files in this package when run through +%% LaTeX or TeX. +%% +%% Copyright 1993 1994 1995 1996 1997 1998 1999 2000 2001 2002 2003 2004 +%% The LaTeX3 Project and any individual authors listed elsewhere +%% in this file. +%% +%% This file is part of the LaTeX base system. +%% ------------------------------------------- +%% +%% It may be distributed and/or modified under the +%% conditions of the LaTeX Project Public License, either version 1.3 +%% of this license or (at your option) any later version. +%% The latest version of this license is in +%% http://www.latex-project.org/lppl.txt +%% and version 1.3 or later is part of all distributions of LaTeX +%% version 2003/12/01 or later. +%% +%% This file has the LPPL maintenance status "maintained". +%% +%% In particular, NO PERMISSION is granted to modify the contents of this +%% file since it contains the legal notices that are placed in the files +%% it generates. +%% +%% The list of all files belonging to the LaTeX base distribution is +%% given in the file `manifest.txt'. See also `legal.txt' for additional +%% information. +%% +%% +%% +%% +%% --------------- start of docstrip commands ------------------ +%% + +\input docstrip + +\preamble + +This is a generated file. + +Copyright 1993 1994 1995 1996 1997 1998 1999 2000 2001 2002 2003 2004 +The LaTeX3 Project and any individual authors listed elsewhere +in this file. + +This file was generated from file(s) of the LaTeX base system. +-------------------------------------------------------------- + +It may be distributed and/or modified under the +conditions of the LaTeX Project Public License, either version 1.3 +of this license or (at your option) any later version. +The latest version of this license is in + http://www.latex-project.org/lppl.txt +and version 1.3 or later is part of all distributions of LaTeX +version 2003/12/01 or later. + +This file may only be distributed together with a copy of the LaTeX +base system. You may however distribute the LaTeX base system without +such generated files. + +The list of all files belonging to the LaTeX base distribution is +given in the file `manifest.txt'. See also `legal.txt' for additional +information. + +In particular, permission is granted to customize the declarations in +this file to serve the needs of your installation. + +However, NO PERMISSION is granted to distribute a modified version +of this file under its original name. + +\endpreamble + +\keepsilent +\usedir{tex/latex/base} + +\Msg{*** Generating font defs for Cork encoded + and Text Companion fonts ***} + +\generate{ + \file{t1cmfib.fd}{ + \from{cmfonts.fdd}{fd,T1cmfib,new}} + \file{t1cmfr.fd}{ + \from{cmfonts.fdd}{fd,T1cmfr,new}} + \file{t1cmdh.fd}{ + \from{cmfonts.fdd}{fd,T1cmdh,new}} + \file{t1cmr.fd}{ + \from{cmfonts.fdd}{fd,T1cmr,new}} + \file{t1cmss.fd}{ + \from{cmfonts.fdd}{fd,T1cmss,new}} + \file{t1cmtt.fd}{ + \from{cmfonts.fdd}{fd,T1cmtt,tt,new,nowarn}} + \file{t1cmvtt.fd}{ + \from{cmfonts.fdd}{fd,T1cmvtt,tt,new}} + \file{ts1cmr.fd}{ + \from{cmfonts.fdd}{fd,TS1cmr,new}} + \file{ts1cmss.fd}{ + \from{cmfonts.fdd}{fd,TS1cmss,new}} + \file{ts1cmtt.fd}{ + \from{cmfonts.fdd}{fd,TS1cmtt,new,tt}} + \file{ts1cmvtt.fd}{ + \from{cmfonts.fdd}{fd,TS1cmvtt,new,tt}} +} + + +\ifToplevel{ +\Msg{***********************************************************} +\Msg{*} +\Msg{* To finish the installation you have to move the following} +\Msg{* files into a directory searched by TeX:} +\Msg{*} +\Msg{* \space\space All *.fd} +\Msg{*} +\Msg{* To produce the documentation run the files ending with} +\Msg{* `.fdd' through LaTeX.} +\Msg{*} +\Msg{* Happy TeXing} +\Msg{***********************************************************} +} + +\endbatchfile + diff --git a/Master/texmf-dist/source/latex/base/newlfont.dtx b/Master/texmf-dist/source/latex/base/newlfont.dtx new file mode 100644 index 00000000000..e400850f680 --- /dev/null +++ b/Master/texmf-dist/source/latex/base/newlfont.dtx @@ -0,0 +1,219 @@ +% \iffalse meta-comment +% +% Copyright 1993 1994 1995 1996 1997 1998 1999 2000 2001 2002 2003 2004 +% The LaTeX3 Project and any individual authors listed elsewhere +% in this file. +% +% This file is part of the LaTeX base system. +% ------------------------------------------- +% +% It may be distributed and/or modified under the +% conditions of the LaTeX Project Public License, either version 1.3 +% of this license or (at your option) any later version. +% The latest version of this license is in +% http://www.latex-project.org/lppl.txt +% and version 1.3 or later is part of all distributions of LaTeX +% version 2003/12/01 or later. +% +% This file has the LPPL maintenance status "maintained". +% +% The list of all files belonging to the LaTeX base distribution is +% given in the file `manifest.txt'. See also `legal.txt' for additional +% information. +% +% The list of derived (unpacked) files belonging to the distribution +% and covered by LPPL is defined by the unpacking scripts (with +% extension .ins) which are part of the distribution. +% +% \fi +%\iffalse % this is a METACOMMENT ! +% +%% File `newlfont.dtx'. +%% Copyright (C) 1989-1998 Frank Mittelbach and Rainer Sch\"opf, +%% all rights reserved. +% +%<*dtx> + \ProvidesFile{newlfont.dtx} +% +%\NeedsTeXFormat{LaTeX2e} +%\ProvidesPackage{newlfont} +% \ProvidesFile{newlfont.drv} +% \fi +% \ProvidesFile{newlfont.dtx} + [1998/08/17 v2.2m Standard LaTeX package] +% +% \iffalse +%<*driver> +\documentclass{ltxdoc} +\begin{document} +\DocInput{newlfont.dtx} +\end{document} +% +% \fi +% +% \CheckSum{88} +% +%% \CharacterTable +%% {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 +%% 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 +%% Digits \0\1\2\3\4\5\6\7\8\9 +%% Exclamation \! Double quote \" Hash (number) \# +%% Dollar \$ Percent \% Ampersand \& +%% Acute accent \' Left paren \( Right paren \) +%% Asterisk \* Plus \+ Comma \, +%% Minus \- Point \. Solidus \/ +%% Colon \: Semicolon \; Less than \< +%% Equals \= Greater than \> Question mark \? +%% Commercial at \@ Left bracket \[ Backslash \\ +%% Right bracket \] Circumflex \^ Underscore \_ +%% Grave accent \` Left brace \{ Vertical bar \| +%% Right brace \} Tilde \~} +% +% +% \changes{v2.2a}{1994/01/17}{Added missing definitions to support +% newlfont in compat mode} +% \changes{v2.2b}{1994/01/27}{Removed if@compat test since +% these settings need also be executed in 2e mode.} +% \changes{v2.2c}{1994/03/06}{Added def for \cs{cal} and \cs{mit}} +% \changes{v2.2l}{1995/11/29}{Remove duplicate driver code.} +% \changes{v2.2m}{1998/08/17}{(RmS) Minor documentation fixes.} +% +% \providecommand\dst{\expandafter{\normalfont\scshape docstrip}} +% +% +% \GetFileInfo{newlfont.dtx} +% +% \title{The file \texttt{newlfont.dtx} for use with +% \LaTeXe.\thanks{This file has version +% number \fileversion, dated \filedate.}\\[2pt] +% It contains the code for \texttt{newlfont.sty}} +% +% \author{Frank Mittelbach} +% +% \maketitle +% +% \section{Introduction} +% +% This file contains the code for the \texttt{newlfont} package +% which provides defines commands like |\rm| to behave as with +% NFSS1, i.e., to change one font attribute without resetting the +% other attributes. +% +% \StopEventually{} +% +% +% \section{The Code} +% +% \begin{macrocode} +%<*package> +% \end{macrocode} +% +% We define the font commands for selecting the typeface. They are +% probably defined by the document class/style but we want to force +% the old meaning from NFSS1. +% +% \changes{v2.2g}{1994/05/11}{DPC Remove definitions of \cs{prm} etc.} +% \begin{macrocode} +\let\rm\rmfamily +\let\sf\sffamily +\let\tt\ttfamily +\let\bf\bfseries +\let\sl\slshape +\let\sc\scshape +\let\it\itshape +% \end{macrocode} +% We also have to define the \emph{emphasize} font change command +% (i.e.\ |\em|). This command will look whether the current font is +% sloped (i.e.\ has a positive |\fontdimen1|) and will then select +% either an upright or italic font. +% \changes{v2.2g}{1994/05/11}{DPC use \cs{DeclareProtectedCommand}} +% \changes{v2.2h}{1994/05/13}{DPC renamed to \cs{DeclareRobustCommand}} +% \begin{macrocode} +\DeclareRobustCommand\em{% + \@nomath\em + \ifdim \fontdimen\@ne\font >\z@\upshape \else \itshape \fi} +% \end{macrocode} +% +% For compatibility with old sources we should define the following +% commands although their use in new documents is discouraged. +% \begin{macrocode} +\let\mediumseries\mdseries +\let\normalshape\upshape +% \end{macrocode} +% +% In case \texttt{newlfont} is used in compatibility mode, eg +%\begin{verbatim} +% \documentstyle[newlfont]{article} +%\end{verbatim} +% or with the \texttt{oldlfont} package already loaded +% we have to undo a number of settings changed by the compatibility +% mode for \LaTeX~2.09 documents. +% +% |\@setfontsize| should not have a |\reset@font| included. +% \changes{v2.2j}{1994/11/06}{Use \cs{@typeset@protect}} +% \begin{macrocode} +\def\@setfontsize#1#2#3{\@nomath#1% + \ifx\protect\@typeset@protect + \let\@currsize#1% + \fi + \fontsize{#2}{#3}\selectfont} +% \end{macrocode} +% Math alphabet identifiers should have an argument. +% \changes{v2.2d}{1994/03/10}{Changed \cs{begingroup}/\cs{endgroup} to +% \cs{bgroup}/\cs{egroup}.} +% \changes{v2.2f}{1994/05/05}{Added saved versions of the +% math-groupers, CAR} +% \begin{macrocode} +\let\math@bgroup\bgroup +\def\math@egroup#1{#1\egroup} +\let \@@math@bgroup \math@bgroup +\let \@@math@egroup \math@egroup +% \end{macrocode} +% Warn again, if text font commands are used in math +% (same macro as in \texttt{lfonts.dtx}). +% \changes{v2.2e}{1994/04/21}{Changed error message} +% \changes{v2.2k}{1995/04/02}{add \cs{noexpand} to second part of message} +% \begin{macrocode} +\def\not@math@alphabet#1#2{% + \relax + \ifmmode + \@latex@error{Command \noexpand#1invalid in math mode}% + {% + Please + \ifx#2\relax + define a new math alphabet^^J% + if you want to use a special font in math mode% + \else +% \end{macrocode} +% We have to add |\noexpand| below to prevent expansion of |#2|. In +% case of |#1| we can omit this (due to the current definition of +% robust commands since they do come out right there :-). +% \begin{macrocode} + use the math alphabet \noexpand#2instead of + the #1command% + \fi + . + }% + \fi} +% \end{macrocode} +% +% In NFSS1 math alphabets had arguments so we have to change |\cal| +% and |\mit| which by default are defined to behave like in +% \LaTeX209. +% \begin{macrocode} +\let\pcal\@undefined +\let\cal\mathcal +\let\pmit\@undefined +\let\mit\mathnormal +% \end{macrocode} +% +% The NFSS1 version of \texttt{newlfont} included the \LaTeX{} +% symbols. And that is probably all there is. +% \begin{macrocode} +\RequirePackage{latexsym} +% +% \end{macrocode} +% +% +% \Finale +\endinput diff --git a/Master/texmf-dist/source/latex/base/nfssfont.dtx b/Master/texmf-dist/source/latex/base/nfssfont.dtx new file mode 100644 index 00000000000..02da5a8db9d --- /dev/null +++ b/Master/texmf-dist/source/latex/base/nfssfont.dtx @@ -0,0 +1,445 @@ +% \iffalse meta-comment +% +% Copyright 1993 1994 1995 1996 1997 1998 1999 2000 2001 2002 2003 2004 +% The LaTeX3 Project and any individual authors listed elsewhere +% in this file. +% +% This file is part of the LaTeX base system. +% ------------------------------------------- +% +% It may be distributed and/or modified under the +% conditions of the LaTeX Project Public License, either version 1.3 +% of this license or (at your option) any later version. +% The latest version of this license is in +% http://www.latex-project.org/lppl.txt +% and version 1.3 or later is part of all distributions of LaTeX +% version 2003/12/01 or later. +% +% This file has the LPPL maintenance status "maintained". +% +% The list of all files belonging to the LaTeX base distribution is +% given in the file `manifest.txt'. See also `legal.txt' for additional +% information. +% +% The list of derived (unpacked) files belonging to the distribution +% and covered by LPPL is defined by the unpacking scripts (with +% extension .ins) which are part of the distribution. +% +% \fi +\def\nfssfontfileversion{v2.1a} +\def\nfssfontfiledate{2003/01/12} + +% \CheckSum{1182} +%% \CharacterTable +%% {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 +%% 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 +%% Digits \0\1\2\3\4\5\6\7\8\9 +%% Exclamation \! Double quote \" Hash (number) \# +%% Dollar \$ Percent \% Ampersand \& +%% Acute accent \' Left paren \( Right paren \) +%% Asterisk \* Plus \+ Comma \, +%% Minus \- Point \. Solidus \/ +%% Colon \: Semicolon \; Less than \< +%% Equals \= Greater than \> Question mark \? +%% Commercial at \@ Left bracket \[ Backslash \\ +%% Right bracket \] Circumflex \^ Underscore \_ +%% Grave accent \` Left brace \{ Vertical bar \| +%% Right brace \} Tilde \~} +% +% \iffalse +% Copyright (C) 1994 Donald E. Knuth +% Copyright (C) 1994-94,2003 Frank Mittelbach, +% all rights reserved. +% \fi +% +% +% \title{The program \texttt{nfssfont}} +% \author{Frank Mittelbach\thanks{Adapted from code written +% by Donald E.~Knuth}} +% \date{\nfssfontfiledate} +% +% +% \def\dst{{\normalfont\scshape docstrip}} +% \def\NFSS{\textsf{NFSS}} +% \setcounter{StandardModuleDepth}{1} +% +% +% \maketitle +% +% \section{Introduction} +% +% Within the \NFSS{} distribution there is a \LaTeX{} file +% \texttt{nfssfont.tex} which can be used to test new fonts, produce +% font tables showing all characters, etc. This is an addaption of a +% program originally written by Don Knuth. + +% When you run this file through \LaTeX{} you will be asked to enter +% the name of the font to test. Your answer should be the external +% font name without any extension, e.g.\ \texttt{cmr10} (Computer +% Modern Roman 10pt) or \texttt{yinit} (Yannis Haralambous' Initial +% font). +% +% Alternatively (since version 2.1), you can press \meta{return} at +% this point. In that case a dialog is started that asks you for the +% font characteristics in \NFSS{} notation, i.e., first for the +% encoding scheme (default \texttt{T1}), then for the family name +% (default \texttt{cmr}), then for the series (default \texttt{m}), +% then for the shape (default \texttt{n}), and finally for the size +% (default \texttt{10pt}). +% +% You are then requested to enter a command. Probably the most +% important one is |\table|, which will produce a font chart. To +% switch to a new test font, type |\init|; to finish the test, type +% |\bye|; and to learn about all the other possible tests type +% |\help|. +% +% This is at +% the moment only a crude addaption of the test program for the +% Computer Modern fonts by Donald Knuth. +% +% \StopEventually{} +% +% \section{A driver for this document} +% +% The next bit of code contains the documentation driver file for +% \TeX{}, i.e., the file that will produce the documentation you are +% currently reading. It will be extracted from this file by the +% \dst{} program. +% \begin{macrocode} +%<*driver> +\documentclass{ltxdoc} + % \OnlyDescription % comment out for implementation details +\begin{document} + \DocInput{nfssfont.dtx} +\end{document} +% +% \end{macrocode} +% +% \section{The code} +% +% A testbed for font evaluation (see The METAFONTbook, Appendix H) +% changed for \LaTeX{} with \NFSS. +% +% This program should get a complete rewrite some day or at least some +% code documentation. Any volunteers? +% \begin{macrocode} +%<*code> +\documentclass{article} %FMi +\nofiles %FMi +\textwidth=470pt %FMi +\oddsidemargin=0pt %FMi +\textheight=1000pt %FMi +\def\sevenrm{\fontsize{7}{9pt}\rmfamily} %FMi + +\typeout{**********************************************} +\typeout{* NFSS font test program version <\nfssfontfileversion>} +\typeout{*} +\typeout{* Follow the instructions} +\typeout{**********************************************} +\typeout{} + +\tracinglostchars=0 +\tolerance=1000 +\raggedbottom +\parindent=0pt +%\newlinechar=`@ %FMi +\hyphenpenalty=200 +\doublehyphendemerits=30000 +% \end{macrocode} +% +% \begin{macrocode} +\newcount\m \newcount\n \newcount\p \newdimen\dim +\chardef\other=12 + +\def\today{\ifcase\month\or + January\or February\or March\or April\or May\or June\or + July\or August\or September\or October\or November\or December\fi + \space\number\day, \number\year} +\def\hours{\n=\time \divide\n 60 + \m=-\n \multiply\m 60 \advance\m \time + \twodigits\n\twodigits\m} +\def\twodigits#1{\ifnum #1<10 0\fi \number#1} +% \end{macrocode} +% +% We first ask for a real external font name\ldots +% \begin{macrocode} +\def\init{% + \typein[\currfontname]% + {Input external font name, e.g., cmr10^^J% + (or for NFSS classification of font):}% +% \end{macrocode} +% If the user answers with ``return'' we ask for the \NFSS{} +% classification of the font in form of encoding, family, series, +% shape, and size offering a default each time. +% \begin{macrocode} + \ifx\currfontname\empty + \begingroup + \typein[\encoding]{^^J^^J*** NFSS classification + ***^^J^^JFont encoding [T1]:}% + \ifx\encoding\empty + \fontencoding{T1}% + \else +% \end{macrocode} +% The requested encoding might not be loaded, so we pretend that it +% was loaded here to avoid an error, after all we only need it to +% find out the external font name. +% \begin{macrocode} + \expandafter\let\csname T@\encoding\endcsname\empty + \fontencoding\encoding + \fi + \typein[\family]{Font family [cmr]:}% + \relax + \ifx\family\empty + \fontfamily{cmr}% + \else + \fontfamily\family + \fi + \typein[\series]{Font series [m]:}% + \ifx\series\empty + \fontseries{m}% + \else + \fontseries\series + \fi + \typein[\shape]{Font shape [n]:}% + \ifx\shape\empty + \fontshape{n}% + \else + \fontshape\shape + \fi + \typein[\size]{Font size [10pt]:}% + \ifx\size\empty + \fontsize{10}{10}% + \else + \fontsize\size\size + \fi +% \end{macrocode} +% Finally select the font and globally assign it to |\currfontname|. +% \begin{macrocode} + \selectfont\xdef\currfontname{\fontname\font}% + \endgroup + \fi + \startfont + \message{Now type a test command (\string\help\space for help):}} +% \end{macrocode} +% +% \begin{macrocode} +\def\startfont{\font\testfont=\currfontname + \leftline{\sevenrm Test of \currfontname\unskip\ on \today\ at \hours} + \medskip + \testfont \setbaselineskip + \ifdim\fontdimen6\testfont<10pt \rightskip=0pt plus 20pt + \else\rightskip=0pt plus 2em \fi + \spaceskip=\fontdimen2\testfont % space between words (\raggedright) + \xspaceskip=\fontdimen2\testfont \advance\xspaceskip + by\fontdimen7\testfont} +% \end{macrocode} +% +% \begin{macrocode} +{\catcode`\|=0 \catcode`\\=\other +|gdef|help{|message{% +\init switches to another font;^^J% +\stop or \bye finishes the run;^^J% +\table prints the font layout in tabular format;^^J% +\text prints a sample text, assuming TeX text font conventions;^^J% +\sample combines \table and \text;^^J% +\mixture mixes a background character with a series of others;^^J% +\alternation interleaves a background character with a series;^^J% +\alphabet prints all lowercase letters within a given background;^^J% +\ALPHABET prints all uppercase letters within a given background;^^J% +\series prints a series of letters within a given background;^^J% +\lowers prints a comprehensive test of lowercase;^^J% +\uppers prints a comprehensive test of uppercase;^^J% +\digits prints a comprehensive test of numerals;^^J% +\math prints a comprehensive test of TeX math italic;^^J% +\names prints a text that mixes upper and lower case;^^J% +\punct prints a punctuation test;^^J% +\bigtest combines many of the above routines;^^J% +\help repeats this message;^^J% +and you can use ordinary TeX commands (e.g., to \input a file).}}} + +\def\setbaselineskip{\setbox0=\hbox{\n=0 +\loop\char\n \ifnum \n<255 \advance\n 1 \repeat} +\baselineskip=6pt \advance\baselineskip\ht0 \advance\baselineskip\dp0 } +% \end{macrocode} +% +% \begin{macrocode} +\def\setchar#1{{\escapechar-1\message{\string#1 character = }% + \def\do##1{\catcode`##1=\other}\dospecials + \read-1 to\next + \expandafter\finsetchar\next\next#1}} +\def\finsetchar#1#2\next#3{\global\chardef#3=`#1 + \ifnum #3=`\# \global\chardef#3=#2 \fi} +\def\promptthree{\setchar\background + \setchar\starting \setchar\ending} + +\def\mixture{\promptthree \domix\mixpattern} +\def\alternation{\promptthree \domix\altpattern} +\def\mixpattern{\0\1\0\0\1\1\0\0\0\1\1\1\0\1} +\def\altpattern{\0\1\0\1\0\1\0\1\0\1\0\1\0\1\0\1\0} +\def\domix#1{\par\chardef\0=\background \n=\starting + \loop \chardef\1=\n #1\endgraf + \ifnum \n<\ending \advance\n 1 \repeat} + +\def\!{\discretionary{\background}{\background}{\background}} +\def\series{\promptthree \!\doseries\starting\ending\par} +\def\doseries#1#2{\n=#1\loop\char\n\!\ifnum\n<#2\advance\n 1 \repeat} +\def\complower{\!\doseries{`a}{`z}\doseries{'31}{'34}\par} +\def\compupper{\!\doseries{`A}{`Z}\doseries{'35}{'37}\par} +\def\compdigs{\!\doseries{`0}{`9}\par} +\def\alphabet{\setchar\background\complower} +\def\ALPHABET{\setchar\background\compupper} + +\def\lowers{\docomprehensive\complower{`a}{`z}{'31}{'34}} +\def\uppers{\docomprehensive\compupper{`A}{`Z}{'35}{'37}} +\def\digits{\docomprehensive\compdigs{`0}{`4}{`5}{`9}} +\def\docomprehensive#1#2#3#4#5{\par\chardef\background=#2 + \loop{#1} \ifnum\background<#3\m=\background\advance\m 1 + \chardef\background=\m \repeat \chardef\background=#4 + \loop{#1} \ifnum\background<#5\m=\background\advance\m 1 + \chardef\background=\m \repeat} +% \end{macrocode} +% +% \begin{macrocode} +\def\names{ {\AA}ngel\aa\ Beatrice Claire + Diana \'Erica Fran\c{c}oise Ginette H\'el\`ene Iris + Jackie K\=aren {\L}au\.ra Mar{\'\i}a N\H{a}ta{\l}{\u\i}e {\O}ctave + Pauline Qu\^eneau Roxanne Sabine T\~a{\'\j}a Ur\v{s}ula + Vivian Wendy Xanthippe Yv{\o}nne Z\"azilie\par} +\def\punct{\par\dopunct{min}\dopunct{pig}\dopunct{hid} + \dopunct{HIE}\dopunct{TIP}\dopunct{fluff} + \$1,234.56 + 7/8 = 9\% @ \#0\par} +\def\dopunct#1{#1,\ #1:\ #1;\ `#1'\ ?`#1?\ !`#1!\ (#1)\ [#1]\ + #1*\ #1.\par} + +\def\bigtest{\sample + hamburgefonstiv HAMBURGEFONSTIV\par + \names \punct \lowers \uppers \digits} + +\def\math{\textfont1=\testfont \skewchar\testfont=\skewtrial + \mathchardef\Gamma="100 \mathchardef\Delta="101 + \mathchardef\Theta="102 \mathchardef\Lambda="103 \mathchardef\Xi="104 + \mathchardef\Pi="105 \mathchardef\Sigma="106 \mathchardef\Upsilon="107 + \mathchardef\Phi="108 \mathchardef\Psi="109 \mathchardef\Omega="10A + \def\ii{i} \def\jj{j} + \def\\##1{|##1|+}\mathtrial + \def\\##1{##1_2+}\mathtrial + \def\\##1{##1^2+}\mathtrial + \def\\##1{##1/2+}\mathtrial + \def\\##1{2/##1+}\mathtrial + \def\\##1{##1,{}+}\mathtrial + \def\\##1{d##1+}\mathtrial + \let\ii=\imath \let\jj=\jmath \def\\##1{\hat##1+}\mathtrial} +\newcount\skewtrial \skewtrial='177 +\def\mathtrial{$\\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 \\a \\b \\c \\d \\e \\f + \\g \\h \\\ii \\\jj \\k \\l \\m \\n \\o \\p \\q \\r \\s \\t \\u \\v \\w + \\x \\y \\z \\\alpha \\\beta \\\gamma \\\delta \\\epsilon \\\zeta + \\\eta \\\theta \\\iota \\\kappa \\\lambda \\\mu \\\nu \\\xi \\\pi + \\\rho \\\sigma \\\tau \\\upsilon \\\phi \\\chi \\\psi \\\omega + \\\vartheta \\\varpi \\\varphi \\\Gamma \\\Delta \\\Theta \\\Lambda + \\\Xi \\\Pi \\\Sigma \\\Upsilon \\\Phi \\\Psi \\\Omega \\\partial + \\\ell \\\wp$\par} +\def\mathsy{\begingroup\skewtrial='060 % for math symbol font tests + \def\mathtrial{$\\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$\par} + \math\endgroup} +% \end{macrocode} +% +% \begin{macrocode} +\def\oct#1{\hbox{\rmfamily\'{}\kern-.2em\itshape + #1\/\kern.05em}} % octal constant +\def\hex#1{\hbox{\rmfamily\H{}\ttfamily#1}} % hexadecimal constant +\def\setdigs#1"#2{\gdef\h{#2}% \h=hex prefix; \0\1=corresponding octal + \m=\n \divide\m by 64 \xdef\0{\the\m}% + \multiply\m by-64 \advance\m by\n \divide\m by 8 \xdef\1{\the\m}} +\def\testrow{\setbox0=\hbox{\penalty 1\def\\{\char"\h}% + \\0\\1\\2\\3\\4\\5\\6\\7\\8\\9\\A\\B\\C\\D\\E\\F% + \global\p=\lastpenalty}} % \p=1 if none of the characters exist +\def\oddline{\cr + \noalign{\nointerlineskip} + \multispan{19}\hrulefill& + \setbox0=\hbox{\lower 2.3pt\hbox{\hex{\h x}}}\smash{\box0}\cr + \noalign{\nointerlineskip}} +\newif\ifskipping +\def\evenline{\loop\skippingfalse + \ifnum\n<256 \m=\n \divide\m 16 \chardef\next=\m + \expandafter\setdigs\meaning\next \testrow + \ifnum\p=1 \skippingtrue \fi\fi + \ifskipping \global\advance\n 16 \repeat + \ifnum\n=256 \let\next=\endchart\else\let\next=\morechart\fi + \next} +\def\morechart{\cr\noalign{\hrule\penalty5000} + \chartline \oddline \m=\1 \advance\m 1 \xdef\1{\the\m} + \chartline \evenline} +\def\chartline{&\oct{\0\1x}&&\:&&\:&&\:&&\:&&\:&&\:&&\:&&\:&&} +\def\chartstrut{\lower4.5pt\vbox to14pt{}} +\def\table{$$\global\n=0 + \halign to\hsize\bgroup + \chartstrut##\tabskip0pt plus10pt& + &\hfil##\hfil&\vrule##\cr + \lower6.5pt\null + &&&\oct0&&\oct1&&\oct2&&\oct3&&\oct4&&\oct5&&\oct6&&\oct7&\evenline} +\def\endchart{\cr\noalign{\hrule} + \raise11.5pt\null&&&\hex 8&&\hex 9&&\hex A&&\hex B& + &\hex C&&\hex D&&\hex E&&\hex F&\cr\egroup$$\par} +\def\:{\setbox0=\hbox{\char\n}% + \ifdim\ht0>7.5pt\reposition + \else\ifdim\dp0>2.5pt\reposition\fi\fi + \box0\global\advance\n 1 } +\def\reposition{\setbox0=\vbox{\kern2pt\box0}\dim=\dp0 + \advance\dim 2pt \dp0=\dim} +\def\centerlargechars{ + \def\reposition{\setbox0=\hbox{$\vcenter{\kern2pt\box0\kern2pt}$}}} +% \end{macrocode} +% +% \begin{macrocode} +\def\text{{\advance\baselineskip-4pt +\setbox0=\hbox{abcdefghijklmnopqrstuvwxyz} +\ifdim\hsize>2\wd0 + \ifdim 15pc>2\wd0 \hsize=15pc \else \hsize=2\wd0 \fi +\fi +On November 14, 1885, Senator \& Mrs.~Leland Stanford called together +at their San Francisco mansion the 24~prominent men who had been +chosen as the first trustees of The Leland Stanford Junior University. +They handed to the board the Founding Grant of the University, which +they had executed three days before. This document---with various +amendments, legislative acts, and court decrees---remains as the +University's charter. In bold, sweeping language it stipulates that +the objectives of the University are ``to qualify students for +personal success and direct usefulness in life; and to promote the +publick welfare by exercising an influence in behalf of humanity and +civilization, teaching the blessings of liberty regulated by law, and +inculcating love and reverence for the great principles of government +as derived from the inalienable rights of man to life, liberty, and +the pursuit of happiness.'' \moretext +(!`THE DAZED BROWN FOX QUICKLY GAVE 12345--67890 JUMPS!)\par}} +\def\moretext{?`But aren't Kafka's Schlo{\ss} and {\AE}sop's +{\OE}uvres often na{\"\i}ve vis-\`a-vis the d{\ae}monic ph{\oe}nix's +official r\^ole in fluffy souffl\'es? } +\def\omitaccents{\let\moretext=\relax} + +\def\sample{\table\text} +% \end{macrocode} +% +% \begin{macrocode} +\def\bye{\end{document}} %FMi +% \end{macrocode} +% +% The redefinition of |\typeout| around the |\begin{document}| +% prevents \LaTeX{} from reporting that there is no |.aux| file. +% This is a bad hack, I agree :-) +% \begin{macrocode} +\let\oldtypeout\typeout %FMi +\def\typeout#1{} %FMi +\begin{document} %FMi +\let\typeout\oldtypeout %FMi + +\ifx\noinit!\else\init\fi +% +% \end{macrocode} +% +% +% \DeleteShortVerb{\|} +% \Finale +% +\endinput diff --git a/Master/texmf-dist/source/latex/base/nfssfont.ins b/Master/texmf-dist/source/latex/base/nfssfont.ins new file mode 100644 index 00000000000..1c08e06029b --- /dev/null +++ b/Master/texmf-dist/source/latex/base/nfssfont.ins @@ -0,0 +1,79 @@ +%% +%% This file will generate fast loadable files and documentation +%% driver files from the doc files in this package when run through +%% LaTeX or TeX. +%% +%% Copyright 1993 1994 1995 1996 1997 1998 1999 2000 2001 2002 2003 2004 +%% The LaTeX3 Project and any individual authors listed elsewhere +%% in this file. +%% +%% This file is part of the LaTeX base system. +%% ------------------------------------------- +%% +%% It may be distributed and/or modified under the +%% conditions of the LaTeX Project Public License, either version 1.3 +%% of this license or (at your option) any later version. +%% The latest version of this license is in +%% http://www.latex-project.org/lppl.txt +%% and version 1.3 or later is part of all distributions of LaTeX +%% version 2003/12/01 or later. +%% +%% This file has the LPPL maintenance status "maintained". +%% +%% In particular, NO PERMISSION is granted to modify the contents of this +%% file since it contains the legal notices that are placed in the files +%% it generates. +%% +%% The list of all files belonging to the LaTeX base distribution is +%% given in the file `manifest.txt'. See also `legal.txt' for additional +%% information. +%% +%% +%% +%% +%% --------------- start of docstrip commands ------------------ +%% + +\input docstrip + +\preamble + +This is a generated file. + +Copyright 1993 1994 1995 1996 1997 1998 1999 2000 2001 2002 2003 2004 +The LaTeX3 Project and any individual authors listed elsewhere +in this file. + +This file was generated from file(s) of the LaTeX base system. +-------------------------------------------------------------- + +It may be distributed and/or modified under the +conditions of the LaTeX Project Public License, either version 1.3 +of this license or (at your option) any later version. +The latest version of this license is in + http://www.latex-project.org/lppl.txt +and version 1.3 or later is part of all distributions of LaTeX +version 2003/12/01 or later. + +This file has the LPPL maintenance status "maintained". + +This file may only be distributed together with a copy of the LaTeX +base system. You may however distribute the LaTeX base system without +such generated files. + +The list of all files belonging to the LaTeX base distribution is +given in the file `manifest.txt'. See also `legal.txt' for additional +information. + +The list of derived (unpacked) files belonging to the distribution +and covered by LPPL is defined by the unpacking scripts (with +extension .ins) which are part of the distribution. +\endpreamble + +\keepsilent +\usedir{tex/latex/base} + +\generateFile{nfssfont.tex}{t}{% + \from{nfssfont.dtx}{code}} + +\endbatchfile diff --git a/Master/texmf-dist/source/latex/base/olddc.ins b/Master/texmf-dist/source/latex/base/olddc.ins new file mode 100644 index 00000000000..fb79a18f460 --- /dev/null +++ b/Master/texmf-dist/source/latex/base/olddc.ins @@ -0,0 +1,113 @@ +%% +%% This file will generate fast loadable files and documentation +%% driver files from the doc files in this package when run through +%% LaTeX or TeX. +%% +%% Copyright 1993 1994 1995 1996 1997 1998 1999 2000 2001 2002 2003 2004 +%% The LaTeX3 Project and any individual authors listed elsewhere +%% in this file. +%% +%% This file is part of the LaTeX base system. +%% ------------------------------------------- +%% +%% It may be distributed and/or modified under the +%% conditions of the LaTeX Project Public License, either version 1.3 +%% of this license or (at your option) any later version. +%% The latest version of this license is in +%% http://www.latex-project.org/lppl.txt +%% and version 1.3 or later is part of all distributions of LaTeX +%% version 2003/12/01 or later. +%% +%% This file has the LPPL maintenance status "maintained". +%% +%% In particular, NO PERMISSION is granted to modify the contents of this +%% file since it contains the legal notices that are placed in the files +%% it generates. +%% +%% The list of all files belonging to the LaTeX base distribution is +%% given in the file `manifest.txt'. See also `legal.txt' for additional +%% information. +%% +%% +%% +%% +%% --------------- start of docstrip commands ------------------ +%% + +\input docstrip + +\preamble + +This is a generated file. + +Copyright 1993 1994 1995 1996 1997 1998 1999 2000 2001 2002 2003 2004 +The LaTeX3 Project and any individual authors listed elsewhere +in this file. + +This file was generated from file(s) of the LaTeX base system. +-------------------------------------------------------------- + +It may be distributed and/or modified under the +conditions of the LaTeX Project Public License, either version 1.3 +of this license or (at your option) any later version. +The latest version of this license is in + http://www.latex-project.org/lppl.txt +and version 1.3 or later is part of all distributions of LaTeX +version 2003/12/01 or later. + +This file may only be distributed together with a copy of the LaTeX +base system. You may however distribute the LaTeX base system without +such generated files. + +The list of all files belonging to the LaTeX base distribution is +given in the file `manifest.txt'. See also `legal.txt' for additional +information. + +In particular, permission is granted to customize the declarations in +this file to serve the needs of your installation. + +However, NO PERMISSION is granted to distribute a modified version +of this file under its original name. + +\endpreamble + +\keepsilent +\usedir{tex/latex/base} + +\Msg{*** Generating font defs for Cork encoded fonts ***} + +\generate{ + \file{t1cmfib.fd}{ + \from{cmfonts.fdd}{fd,T1cmfib,old}} + \file{t1cmfr.fd}{ + \from{cmfonts.fdd}{fd,T1cmfr,old}} + \file{t1cmdh.fd}{ + \from{cmfonts.fdd}{fd,T1cmdh,old}} + \file{t1cmr.fd}{ + \from{cmfonts.fdd}{fd,T1cmr,old}} + \file{t1cmss.fd}{ + \from{cmfonts.fdd}{fd,T1cmss,old}} + \file{t1cmtt.fd}{ + \from{cmfonts.fdd}{fd,T1cmtt,old}} + \file{t1cmvtt.fd}{ + \from{cmfonts.fdd}{fd,T1cmvtt,old}} +} + + + +\ifToplevel{ +\Msg{***********************************************************} +\Msg{*} +\Msg{* To finish the installation you have to move the following} +\Msg{* files into a directory searched by TeX:} +\Msg{*} +\Msg{* \space\space All *.fd} +\Msg{*} +\Msg{* To produce the documentation run the files ending with} +\Msg{* `.fdd' through LaTeX.} +\Msg{*} +\Msg{* Happy TeXing} +\Msg{***********************************************************} +} + +\endbatchfile diff --git a/Master/texmf-dist/source/latex/base/oldlfont.dtx b/Master/texmf-dist/source/latex/base/oldlfont.dtx new file mode 100644 index 00000000000..08856eac7f7 --- /dev/null +++ b/Master/texmf-dist/source/latex/base/oldlfont.dtx @@ -0,0 +1,267 @@ +% \iffalse meta-comment +% +% Copyright 1993 1994 1995 1996 1997 1998 1999 2000 2001 2002 2003 2004 +% The LaTeX3 Project and any individual authors listed elsewhere +% in this file. +% +% This file is part of the LaTeX base system. +% ------------------------------------------- +% +% It may be distributed and/or modified under the +% conditions of the LaTeX Project Public License, either version 1.3 +% of this license or (at your option) any later version. +% The latest version of this license is in +% http://www.latex-project.org/lppl.txt +% and version 1.3 or later is part of all distributions of LaTeX +% version 2003/12/01 or later. +% +% This file has the LPPL maintenance status "maintained". +% +% The list of all files belonging to the LaTeX base distribution is +% given in the file `manifest.txt'. See also `legal.txt' for additional +% information. +% +% The list of derived (unpacked) files belonging to the distribution +% and covered by LPPL is defined by the unpacking scripts (with +% extension .ins) which are part of the distribution. +% +% \fi +%\iffalse % this is a METACOMMENT ! +% +%% File `oldlfont.dtx'. +%% Copyright (C) 1989-1995 Frank Mittelbach and Rainer Sch\"opf, +%% all rights reserved. +% +%<*dtx> + \ProvidesFile{oldlfont.dtx} +% +%\NeedsTeXFormat{LaTeX2e} +%\ProvidesPackage{oldlfont} +% \ProvidesFile{oldlfont.drv} +%<*!latex209> +% \fi +% \ProvidesFile{oldlfont.dtx} + [1994/11/29 v2.2k Standard LaTeX package] +% +% \iffalse +% +%<*driver> +\documentclass{ltxdoc} +\begin{document} +\DocInput{oldlfont.dtx} +\end{document} +% +% \fi +% +% \CheckSum{117} +% +%% \CharacterTable +%% {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 +%% 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 +%% Digits \0\1\2\3\4\5\6\7\8\9 +%% Exclamation \! Double quote \" Hash (number) \# +%% Dollar \$ Percent \% Ampersand \& +%% Acute accent \' Left paren \( Right paren \) +%% Asterisk \* Plus \+ Comma \, +%% Minus \- Point \. Solidus \/ +%% Colon \: Semicolon \; Less than \< +%% Equals \= Greater than \> Question mark \? +%% Commercial at \@ Left bracket \[ Backslash \\ +%% Right bracket \] Circumflex \^ Underscore \_ +%% Grave accent \` Left brace \{ Vertical bar \| +%% Right brace \} Tilde \~} +% +% +% +% \providecommand\dst{\expandafter{\normalfont\scshape docstrip}} +% +% \GetFileInfo{oldlfont.dtx} +% +% \title{The file \texttt{oldlfont.dtx} for use with +% \LaTeXe.\thanks{This file has version +% number \fileversion, dated \filedate.}\\[2pt] +% It contains the code for \texttt{oldlfont.sty}} +% +% \author{Frank Mittelbach} +% +% \maketitle +% +% \section{Introduction} +% +% This file contains the code for the \texttt{oldlfont} package +% which emulates the following \LaTeX~2.09 font commands: +% \begin{itemize} +% \item The two-letter font-changing commands |\rm|, etc.~are +% defined to cancel each other out as they did in \LaTeX~2.09. +% \item The two-letter font-changing commands are allowed in math +% mode. +% \item The |latexsym| package is loaded. +% \end{itemize} +% For full compatibility mode, the file |latex209.def| is loaded by +% |\documentstyle|. +% +% The following modules are used in the implementation to direct +% \dst{} in generating the external files: +% \begin{center} +% \begin{tabular}{ll} +% driver & produce a documentation driver file \\ +% package & produce |oldlfont.sty| \\ +% latex209 & produce part of |latex209.def| +% \end{tabular} +% \end{center} +% +% \StopEventually{} +% +% \changes{v2.2k}{1995/11/29}{Remove duplicate driver code.} +% +% \section{The Code} +% +% +% \begin{macro}{\math@bgroup} +% \begin{macro}{\math@egroup} +% To make \meta{math alphabet identifier} work like simple font +% switches we change the meaning of |\math@bgroup| and +% |\math@egroup| to |\@empty|. This emulates the behavior of +% \texttt{oldlfont.sty} in NFSS1 setups. These definitions are not +% part of \texttt{latex209} automatically, since to emulate 2.09 +% they are not necessary (all standard fonts are declared as math +% symbol fonts). +% \changes{v2.2f}{1994/05/05}{Added saved versions of the +% math-groupers, CAR} +% \changes{v2.2g}{1994/05/09}{Moved outside latex209 part} +% \begin{macrocode} +\let\math@bgroup\@empty +\let\math@egroup\@empty +\let \@@math@bgroup \math@bgroup +\let \@@math@egroup \math@egroup +% \end{macrocode} +% \end{macro} +% \end{macro} +% +% +% The rest of this document describes code that is used in +% |oldlfont.sty| and |latex209.def|. +% \begin{macrocode} +%<*package|latex209> +% \end{macrocode} +% +% When emulating the old settings we don't want a lot of NFSS +% information being displayed. Thus we required that the +% \texttt{tracefnt} package is loaded with the option +% \texttt{errorshow}. +% \begin{macrocode} +\RequirePackage[errorshow]{tracefnt} +% \end{macrocode} +% +% We define math \emph{alphabet} identifiers for the typefaces +% described in the \LaTeX{} manual. This is straightforward. Some +% are already defined by the kernel code. +% And here are the other ones defined by the old \LaTeX{}. They all +% get declared as math symbol font alphabets. Thus we first +% allocate the additional symbol fonts. +% \begin{macrocode} +\DeclareSymbolFont{bold}{OT1}{cmr}{bx}{n} +\DeclareSymbolFont{sans}{OT1}{cmss}{m}{n} +\DeclareSymbolFont{typewriter}{OT1}{cmtt}{m}{n} +\DeclareSymbolFont{italic}{OT1}{cmr}{m}{it} +\DeclareSymbolFont{smallcaps}{OT1}{cmr}{m}{sc} +\DeclareSymbolFont{slanted}{OT1}{cmr}{m}{sl} +% \end{macrocode} +% And here are the corresponding math identifiers. +% \begin{macrocode} +\DeclareSymbolFontAlphabet\mathbf{bold} +\DeclareSymbolFontAlphabet\mathsf{sans} +\DeclareSymbolFontAlphabet\mathtt{typewriter} +\DeclareSymbolFontAlphabet\mathsc{smallcaps} +\DeclareSymbolFontAlphabet\mathsl{slanted} +% \end{macrocode} +% We undefine the old |\mit| and |\cal| macros (whatever meaning +% they have) and reallocate them as symbol font alphabets. +% \begin{macrocode} +\let\mit\undefined +\let\cal\undefined +\let\mathit\undefined +\DeclareSymbolFontAlphabet\mathit{italic} +\DeclareSymbolFontAlphabet{\mit}{letters} +\DeclareSymbolFontAlphabet{\cal}{symbols} +% \end{macrocode} +% +% We define the font commands for selecting the typeface. They are +% probably defined by the document class/style but we want to force +% the old meaning. +% +% And here are the definition as they were in \LaTeX~2.09 but +% translated into NFSS2 language. +% \changes{v2.2h}{1994/05/11}{DPC use \cs{DeclareProtectedCommand}} +% \changes{v2.2i}{1994/05/13}{DPC renamed to \cs{DeclareRobustCommand}} +% \begin{macrocode} +\DeclareRobustCommand\rm{\normalfont\rmfamily\mathgroup\symoperators} +\DeclareRobustCommand\sf{\normalfont\sffamily\mathgroup\symsans} +\DeclareRobustCommand\sl{\normalfont\slshape\mathgroup\symslanted} +\DeclareRobustCommand\bf{\normalfont\bfseries\mathgroup\symbold} +\DeclareRobustCommand\sc{\normalfont\scshape\mathgroup\symsmallcaps} +\DeclareRobustCommand\it{\normalfont\itshape\mathgroup\symitalic} +\DeclareRobustCommand\tt{\normalfont\ttfamily\mathgroup\symtypewriter} +% \end{macrocode} +% We also have to define the \emph{emphasize} font change command +% (i.e.\ |\em|). This command will look whether the current font is +% sloped (i.e.\ has a positive |\fontdimen1|) and will then select +% either |\rm| or |\it|. +% \begin{macrocode} +\DeclareRobustCommand\em{% + \@nomath\em + \ifdim \fontdimen\@ne\font>\z@\rm\else\it\fi} +% \end{macrocode} +% +% \begin{macro}{\@setfontsize} +% Font size changes are handled using the |\@setfontsize| command +% (in new class files) or by the |@setsize| command in old document +% style files. The latter is now defined to call |\@setfontsize| in +% the NFSS2 kernel code. +% Thus to make all size changing commands automatically return to +% the normal font of the document we only have to slightly modify +% the definition of |\@setfontsize| by adding a |\normalfont| +% command to it. +% \changes{v2.2j}{1994/11/06}{Use \cs{@typeset@protect}} +% \begin{macrocode} +\def\@setfontsize#1#2#3{\@nomath#1% + \ifx\protect\@typeset@protect + \let\@currsize#1% + \fi + \fontsize{#2}{#3}\normalfont} +% \end{macrocode} +% \end{macro} +% +% +% \begin{macro}{\non@alpherr} +% Since we emulate the old syntax we also have to silently ignore +% uses of a math alphabet outside math mode. Since we now use the +% |\sym...| switches the following setting is not longer necessary. +% \begin{macrocode} +%\let\non@alpherr\@gobble +% \end{macrocode} +% \end{macro} +% +% \begin{macro}{\not@math@alphabet} +% But we need to disable the error message that is generated from +% |\bfseries| etc. +% \begin{macrocode} +\let\not@math@alphabet\@gobbletwo +% \end{macrocode} +% \end{macro} +% +% +% We left out the special \LaTeX{} fonts which are not automaticly +% included in the base version of the font selection since these +% fonts contain only a few characters which are also included in +% the AMS fonts so anybody who is using these fonts doesn't need +% them. But for compatiblity reasons we will define these symbols. +% +% \begin{macrocode} +\RequirePackage{latexsym} +% +% \end{macrocode} +% +% \DeleteShortVerb{\|} +% \Finale +\endinput diff --git a/Master/texmf-dist/source/latex/base/preload.dtx b/Master/texmf-dist/source/latex/base/preload.dtx new file mode 100644 index 00000000000..20415b73b4d --- /dev/null +++ b/Master/texmf-dist/source/latex/base/preload.dtx @@ -0,0 +1,284 @@ +% \iffalse meta-comment +% +% Copyright 1993 1994 1995 1996 1997 1998 1999 2000 2001 2002 2003 2004 +% The LaTeX3 Project and any individual authors listed elsewhere +% in this file. +% +% This file is part of the LaTeX base system. +% ------------------------------------------- +% +% It may be distributed and/or modified under the +% conditions of the LaTeX Project Public License, either version 1.3 +% of this license or (at your option) any later version. +% The latest version of this license is in +% http://www.latex-project.org/lppl.txt +% and version 1.3 or later is part of all distributions of LaTeX +% version 2003/12/01 or later. +% +% This file has the LPPL maintenance status "maintained". +% +% The list of all files belonging to the LaTeX base distribution is +% given in the file `manifest.txt'. See also `legal.txt' for additional +% information. +% +% The list of derived (unpacked) files belonging to the distribution +% and covered by LPPL is defined by the unpacking scripts (with +% extension .ins) which are part of the distribution. +% +% \fi +% +% \iffalse +%%% From File: preload.dtx +%<*dtx> + \ProvidesFile{preload.dtx} +% +%<*preload> +%<*!tex> +%<+cm> \ProvidesFile{cmpreloa.% +%<+dc> \ProvidesFile{dcpreloa.% +%<+xpt> xpt} +%<+xipt> xip} +%<+xiipt> xii} +%<+min> \ProvidesFile{preload.min} +%<+ori> \ProvidesFile{preload.ori} +% +%<+tex> \ProvidesFile{preload.ltx} +% \fi +% \ProvidesFile{preload.dtx} + [1998/08/17 v2.1g LaTeX Kernel (Font Preloading)] +% +% \CheckSum{41} +% +%% \CharacterTable +%% {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 +%% 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 +%% Digits \0\1\2\3\4\5\6\7\8\9 +%% Exclamation \! Double quote \" Hash (number) \# +%% Dollar \$ Percent \% Ampersand \& +%% Acute accent \' Left paren \( Right paren \) +%% Asterisk \* Plus \+ Comma \, +%% Minus \- Point \. Solidus \/ +%% Colon \: Semicolon \; Less than \< +%% Equals \= Greater than \> Question mark \? +%% Commercial at \@ Left bracket \[ Backslash \\ +%% Right bracket \] Circumflex \^ Underscore \_ +%% Grave accent \` Left brace \{ Vertical bar \| +%% Right brace \} Tilde \~} +% +%\iffalse This is a META comment +% +% File `preload.dtx'. +% Copyright (C) 1989-1994 Frank Mittelbach and Rainer Sch\"opf, +% all rights reserved. +% +% \fi +% +% \GetFileInfo{preload.dtx} +% \title{The \texttt{preload.dtx} file\thanks {This file has version +% number \fileversion, dated \filedate}\\ for use with \LaTeXe} +% \date{\filedate} +% \author{Frank Mittelbach \and Rainer Sch\"opf} +% +% \changes{v2.0b}{1993/03/08}{Added 12pt preloads} +% \changes{v2.1e}{1994/11/07}{(DPC) Updated to use \cs{ProvidesFile}} +% \changes{v2.1g}{1998/08/17}{(RmS) Minor documentation fixes.} +% +% \def\dst{\expandafter{\normalfont\scshape docstrip}} +% +% \setcounter{StandardModuleDepth}{1} +% +% \maketitle +% +% \section{Overview} +% +% This file contains an number of possible settings for preloading +% fonts during installation of NFSS2 (which is used by \LaTeXe). It +% will be used to generate the following files: +% \begin{center} +% \begin{tabular}{ll} +% preload.min & minimal subset of fonts necessary to run NFSS2 \\ +% preload.ori & preload of CM fonts similar to the old +% \texttt{lfonts.tex} \\ +% preload.ltx & The standard selection of preloads \\ +% cmpreloa.xpt & preload of CM fonts for 10pt document size\\ +% cmpreloa.xip & preload of CM fonts for 11pt document size\\ +% cmpreloa.xii & preload of CM fonts for 12pt document size\\ +% dcpreloa.xpt & preload of DC fonts for 10pt size \\ +% dcpreloa.xip & preload of DC fonts for 11pt size \\ +% dcpreloa.xii & preload of DC fonts for 12pt size \\ +% \end{tabular} +% \end{center} +% +% These files are for installations that make use of Computer +% Modern fonts either old encoding (OT1) or Cork encoding (T1). The +% Computer Modern fonts with Cork encoding are known as DC-fonts. +% +% Most important is \texttt{preload.ltx} which is used during +% format generation. You are \emph{not} allowed to change this file. +% +% \section{Customization} +% +% You can customize the preloaded fonts in your \LaTeXe{} system by +% installing a file with the name \texttt{preload.cfg}. If this +% file exists it will be used in place of the system file +% \texttt{preload.ltx}. You can, for example, copy one of the +% files mentioned above (that can be generated from this source) to +% \texttt{preload.cfg}. +% +% Or you can define completely other preloads. In that case start +% from \texttt{preload.min} since that contains the fonts that have +% to be preloaded by *all* \LaTeXe{} sytems. +% +% Avoid using \texttt{preload.ori}, it will load so many fonts that +% on most installations it is nearly impossible to load other font +% families afterwards. This file is only generated to show what +% fonts have been preloaded by \LaTeX~2.09. +% +% If you normally use other fonts than Computer Modern +% \texttt{preload.min} might be best. +% +% \begin{quote} \textbf{Warning:} If you preload fonts with +% encodings other than the normally supported encodings you have to +% declare that encoding in a \texttt{fontdef.cfg} configuration +% file (see the documentation in the file \texttt{fontdef.dtx}). +% Adding an extra encoding to the format might produce non-portable +% documents, thus this should be avoided if possible. +% \end{quote} +% +% +% \StopEventually{} +% +% \section{Module switches for the \dst{} program} +% +% The \dst{} will generate the above file from this source using the +% following module directives: +% \begin{center} +% \begin{tabular}{ll} +% driver & produce a documentation driver file \\ +% preload& produce a preload\ldots file \\[2pt] +% cm & for OT1 encoded Computer Modern \\ +% dc & for T1 encoded Computer Modern \\[2pt] +% min & produce minimal subset \\ +% xpt & produce 10pt preloads \\ +% xipt & produce 11pt preloads \\ +% xiipt & produce 12pt preloads \\ +% ori & produce preloads similar to old \texttt{lfonts.tex}\\ +% tex & produce preload.ltx\\ +% \end{tabular} +% \end{center} +% A typical \dst{} command file would then have entries like: +% \begin{verbatim} +%\generateFile{preload.min}{t}{\from{preload.dtx}{preload,min}} +%\end{verbatim} +% for generating preload files. +% +% \section{A driver for this document} +% +% The next bit of code contains the documentation driver file for +% \TeX{}, i.e., the file that will produce the documentation you +% are currently reading. It will be extracted from this file by the +% \dst{} program. +% \begin{macrocode} +%<*driver> +\documentclass{ltxdoc} +%\OnlyDescription % comment out for implementation details +\begin{document} + \DocInput{preload.dtx} +\end{document} +% +% \end{macrocode} +% +% +% \section{The code} +% +% We begin by loading the math extension font (cmex10) +% and the \LaTeX{} line and circle fonts. +% It is necessary to do this explicitly since these are +% used by \texttt{lplain.tex} and \texttt{latex.tex}. +% Since the internal font name contains |/| characters +% and digits we construct the name via |\csname|. +% These are the only fonts (!) that must be loaded in this file. +% +% All |\DeclarePreloadSizes| can be removed or others can be added, +% they only influence the processing speed. +% \changes{v2.0c}{1993/08/13}{Added \cs{relax} at end of font names.} +% \begin{macrocode} +\expandafter\font\csname OMX/cmex/m/n/10\endcsname=cmex10\relax +\font\tenln =line10 \font\tenlnw =linew10\relax +\font\tencirc=lcircle10 \font\tencircw=lcirclew10\relax +% \end{macrocode} +% The above fonts should not be touched but anything below this +% point here in the preload suggestions can be modified without any +% problems. +% \begin{macrocode} +%<-tex>%******************************************* +%<-tex>% Start any modification below this point ** +%<-tex>%******************************************* +%<-tex> +%% +%% Computer Modern Roman: +%%----------------------- +%<*ori> +\DeclarePreloadSizes{OT1}{cmr}{m}{n} + {5,6,7,8,9,10,10.95,12,14.4,17.28,20.74,24.88} +\DeclarePreloadSizes{OT1}{cmr}{bx}{n}{9,10,10.95,12,14.4,17.28} +\DeclarePreloadSizes{OT1}{cmr}{m}{sl}{10,10.95,12} +\DeclarePreloadSizes{OT1}{cmr}{m}{it}{7,8,9,10,10.95,12} +% +%<+xpt&cm> \DeclarePreloadSizes{OT1}{cmr}{m}{n}{5,7,10} +%<+xpt&dc> \DeclarePreloadSizes{T1}{cmr}{m}{n}{5,7,10} +%<+xipt&cm> \DeclarePreloadSizes{OT1}{cmr}{m}{n}{6,8,10.95} +%<+xipt&dc> \DeclarePreloadSizes{T1}{cmr}{m}{n}{6,8,10.95} +%<+xiipt&cm> \DeclarePreloadSizes{OT1}{cmr}{m}{n}{6,8,12} +%<+xiipt&dc> \DeclarePreloadSizes{T1}{cmr}{m}{n}{6,8,12} +%% +%% Computer Modern Sans: +%%---------------------- +%<+ori> \DeclarePreloadSizes{OT1}{cmss}{m}{n}{10,10.95,12} +%% +%% Computer Modern Typewriter: +%%---------------------------- +%<+ori> \DeclarePreloadSizes{OT1}{cmtt}{m}{n}{9,10,10.95,12} +%% +%% Computer Modern Math: +%%---------------------- +%<*ori> +\DeclarePreloadSizes{OML}{cmm}{m}{it} + {5,6,7,8,9,10,10.95,12,14.4,17.28,20.74} +\DeclarePreloadSizes{OMS}{cmsy}{m}{n} + {5,6,7,8,9,10,10.95,12,14.4,17.28,20.74} +% +% \end{macrocode} +% +% The math fonts are the same for both DC and CM fonts. So far +% there isn't an agreed on standard. +% \changes{v2.4e}{1995/12/04} +% {Ulrik Vieth. added 12pt OMS and OML preloads /1989} +% \begin{macrocode} +%<*xpt> +\DeclarePreloadSizes{OML}{cmm}{m}{it}{5,7,10} +\DeclarePreloadSizes{OMS}{cmsy}{m}{n}{5,7,10} +% +%<*xipt> +\DeclarePreloadSizes{OML}{cmm}{m}{it}{6,8,10.95} +\DeclarePreloadSizes{OMS}{cmsy}{m}{n}{6,8,10.95} +% +%<*xiipt> +\DeclarePreloadSizes{OML}{cmm}{m}{it}{6,8,12} +\DeclarePreloadSizes{OMS}{cmsy}{m}{n}{6,8,12} +% +%% +%% LaTeX symbol fonts: +%%-------------------- +%<*ori> +\DeclarePreloadSizes{U}{lasy}{m}{n} + {5,6,7,8,9,10,10.95,12,14.4,17.28,20.74} +% +% +% \end{macrocode} +% +% +% +% \Finale +% +\endinput diff --git a/Master/texmf-dist/source/latex/base/proc.dtx b/Master/texmf-dist/source/latex/base/proc.dtx new file mode 100644 index 00000000000..9ecc070aa7b --- /dev/null +++ b/Master/texmf-dist/source/latex/base/proc.dtx @@ -0,0 +1,456 @@ +% \iffalse meta-comment +% +% Copyright 1993 1994 1995 1996 1997 1998 1999 2000 2001 2002 2003 2004 +% The LaTeX3 Project and any individual authors listed elsewhere +% in this file. +% +% This file is part of the LaTeX base system. +% ------------------------------------------- +% +% It may be distributed and/or modified under the +% conditions of the LaTeX Project Public License, either version 1.3 +% of this license or (at your option) any later version. +% The latest version of this license is in +% http://www.latex-project.org/lppl.txt +% and version 1.3 or later is part of all distributions of LaTeX +% version 2003/12/01 or later. +% +% This file has the LPPL maintenance status "maintained". +% +% The list of all files belonging to the LaTeX base distribution is +% given in the file `manifest.txt'. See also `legal.txt' for additional +% information. +% +% The list of derived (unpacked) files belonging to the distribution +% and covered by LPPL is defined by the unpacking scripts (with +% extension .ins) which are part of the distribution. +% +% \fi +% \CheckSum{173} +%% \CharacterTable +%% {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 +%% 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 +%% Digits \0\1\2\3\4\5\6\7\8\9 +%% Exclamation \! Double quote \" Hash (number) \# +%% Dollar \$ Percent \% Ampersand \& +%% Acute accent \' Left paren \( Right paren \) +%% Asterisk \* Plus \+ Comma \, +%% Minus \- Point \. Solidus \/ +%% Colon \: Semicolon \; Less than \< +%% Equals \= Greater than \> Question mark \? +%% Commercial at \@ Left bracket \[ Backslash \\ +%% Right bracket \] Circumflex \^ Underscore \_ +%% Grave accent \` Left brace \{ Vertical bar \| +%% Right brace \} Tilde \~} +% +% \iffalse +% Copyright (C) 1991,1992 by Leslie Lamport \and +% Copyright (C) 1994,1995 by the \LaTeX3 project \and Johannes Braams +% +% \changes{v1.1}{1994/01/25}{Made `proc' a document class and provide +% a .sty file for compatibility mode} +% \changes{v1.2}{1994/01/26}{Removed the setting of a number of +% variables that became superfluous by passing the twocolumn option +% to the article class} +% \changes{v1.3}{1994/03/01}{Moved driver further up; added overview +% of docstrip modules; added \cs{CheckSum}, \cs{StopEventually} and +% \cs{Finale}} +% \changes{v1.3e}{1994/05/22}{Use new warning and error commands} +% \changes{v1.3f}{1994/05/26}{Inserted missing 'v's in \cs{changes} +% entries} +% \changes{v1.3f}{1994/05/26}{Moved identification and driver to the +% front of the file; these sections now no longer print} +% +% \subsection{Identification} +% +% This document class can only be used with \LaTeXe, so it is made +% sure that an appropiate message is displayed when another \TeX{} +% format is used. +% \changes{v1.3l}{1995/11/30}{Added date of \LaTeX\ format to argument +% of \cs{NeedsTeXFormat}} +% \begin{macrocode} +%<+class|style>\NeedsTeXFormat{LaTeX2e}[1995/12/01] +% \end{macrocode} +% +% Announce the document class and its version. +% \changes{v1.3c}{1994/04/15}{Added missing / guard} +% \changes{v1.3d}{1994/05/01}{Removed the use of variables such as +% \cs{fileversion}} +% \changes{v1.3b}{1994/03/16}{Removed use of \cs{wlog}, no longer +% needed} +% \changes{v1.3f}{1994/05/26}{Removed \cs{typeout} from .sty file; +% changed description} +% \changes{v1.3h}{1994/05/26}{The second argument to \cs{ProvidesFile} +% wasn't closed in the driver and the style file} +% +% \begin{macrocode} +%<*driver> +\ProvidesFile{proc.drv} +% +%<+class>\ProvidesClass{proc} +%<+style>\ProvidesFile{proc.sty} + [1995/11/30 v1.3l +%<+class> Standard LaTeX document class] +%<+style> LaTeX 2.09 compatibility style option `proc'] +% \end{macrocode} +% +% \subsection{The documentation driver file} +% +% This bit of code contains the documentation driver file for +% \TeX{}, i.e., the file that will produce the documentation you +% are currently reading. It can be extracted from this file by the +% {\sc docstrip} program. +% \begin{macrocode} +%<*driver> +] +\documentclass{ltxdoc} +\GetFileInfo{proc.drv} +\begin{document} +\newcommand\Lopt[1]{\textsf {#1}} +\DocInput{proc.dtx} +\end{document} +% +% \end{macrocode} +% \fi +% +% \title{Producing proceedings articles with \LaTeXe\thanks +% {File version \fileversion, dated \filedate}} +% +% \author{% +% Johannes Braams\and +% David Carlisle\and +% Alan Jeffrey\and +% Leslie Lamport\and +% Frank Mittelbach\and +% Chris Rowley\and +% Rainer Sch\"opf} +% +% \date{\filedate} +% +% \maketitle +% +% \section{Description} +% +% This \LaTeXe\ document class is designed to produce camera-ready +% conference proceedings. It is based upon the document class +% \texttt{article}, but modifies some of its layout decisions. +% It also adds one command. +% +% For compatibility with \LaTeX2.09 a \texttt{.sty} version is +% provided because \texttt{proc} used to be a style file. The +% \texttt{.sty} file can \emph{not} be used as a package however. +% +% \DescribeMacro\copyrightspace +% The |\copyrightspace| command is used to produce a blank space in +% the first column where a copyright notice belongs. Note that it +% should appear after any |\footnote| commands that produce +% footnotes for the first column. +% +% \StopEventually{} +% +% \section{The {\sc docstrip} modules} +% +% The following modules are used in the implementation to direct +% {\sc docstrip} in generating the external files: +% \begin{center} +% \begin{tabular}{ll} +% class & produce the proc document class\\ +% sty & produce proc.sty for compatibility mode\\ +% driver & produce a documentation driver file \\ +% \end{tabular} +% \end{center} +% +% \section{Implementation} +% +% In this case a check is needed to see wether \LaTeXe\ runs in +% compatibility mode. +% \changes{v1.3i}{1994/05/27}{Added missing docstrip guard} +% \begin{macrocode} +%<*style> +\if@compatibility +% \end{macrocode} +% In this case processing silently continues, but in the |\else| +% case a warning is issued and reading of this file stops. +% \begin{macrocode} +\else + \ClassWarningNoLine{proc}{^^J\@spaces% + You requested the use of `proc' as a package^^J\@spaces% + but it has been turned into a document class.^^J\@spaces% + Please change your file to use `proc' as a class.^^J} + \expandafter\endinput +\fi +% +% \end{macrocode} +% +% Paper sizes smaller than A4 are not supported. +% \begin{macrocode} +%<*class> +\DeclareOption{a5paper} + {\ClassError{proc}{Option `a5paper' not supported}{}} +\DeclareOption{b5paper} + {\ClassError{proc}{Option `b5paper' not supported}{}} +% \end{macrocode} +% +% Also the \Lopt{onecolumn} option is disabled in this document +% class. +% \begin{macrocode} +\DeclareOption{onecolumn}% + {\ClassError{proc}{Option `onecolumn' not supported}{}} +% \end{macrocode} +% +% Proceedings articles never have separate titlepages, therefore +% this option is disabled. +% \begin{macrocode} +\DeclareOption{titlepage}% + {\ClassError{proc}{Option `titlepage' not supported}{}} +% \end{macrocode} +% +% Always print in two column mode. +% \begin{macrocode} +\PassOptionsToClass{twocolumn}{article} +% \end{macrocode} +% +% Any other options are passed on to the article class on which +% this document class is based. +% \begin{macrocode} +\DeclareOption*{\PassOptionsToClass{\CurrentOption}{article}} +% \end{macrocode} +% +% Now we can process the options +% \begin{macrocode} +\ProcessOptions +% \end{macrocode} +% +% and load the article document class. +% \begin{macrocode} +\LoadClass{article} +% +% \end{macrocode} +% +% \section{Document Layout} +% +% Proceedings articles have a different layout than normal +% articles. Therefore some of the layout parameters are given +% different values here. +% +% \subsection{Page Layout} +% +% \subsubsection{Vertical spacing} +% +% \begin{macro}{\footskip} +% The distance from the baseline of the box which contains the +% running footer to the baseline of last line of text is controlled +% by the |\footskip|. +% \begin{macrocode} +%<*class|style> +\setlength\footskip{75\p@} +% \end{macrocode} +% \end{macro} +% +% \subsubsection{The dimension of text} +% +% \begin{macro}{\textwidth} +% When \LaTeXe\ runs in compatibility mode it has to be made sure +% that the dimensions of the printed area are not different from +% what the user was used to see. +% +% \begin{macrocode} +\if@compatibility + \setlength\textwidth{6.75in} +\else + \setlength\textwidth{\paperwidth} + \addtolength\textwidth{-126\p@} + \@settopoint\textwidth +\fi +% \end{macrocode} +% +% Here the width of the text a little is modified to be a whole +% number of points. +% \begin{macrocode} +\if@compatibility +\else + \@settopoint\textwidth +\fi +% \end{macrocode} +% \end{macro} +% +% \begin{macro}{\textheight} +% Now that we have computed the width of the text, we have to take +% care of the height. The |\textheight| is the height of text +% (including footnotes and figures, excluding running head and +% foot). +% +% \begin{macrocode} +\if@compatibility + \setlength\textheight{9in} +\else + \ifcase\@ptsize + \setlength\textheight{53\baselineskip} + \or + \setlength\textheight{47\baselineskip} + \or + \setlength\textheight{44\baselineskip} + \fi +\fi +% \end{macrocode} +% +% The first line on the page has a height of |\topskip|. +% \begin{macrocode} +\advance\textheight by \topskip +% \end{macrocode} +% \end{macro} +% +% \subsubsection{Margins} +% +% \begin{macro}{\oddsidemargin} +% \begin{macro}{\evensidemargin} +% The width of the text is quite large, therefore the margins +% have a negative width. +% \begin{macrocode} +\setlength\oddsidemargin{-10\p@} +\setlength\evensidemargin{-10\p@} +% \end{macrocode} +% \end{macro} +% \end{macro} +% +% \begin{macro}{\marginparwidth} +% Because we have such a large |\textwidth| there is no real room +% for notes in the margins. +% \begin{macrocode} +\setlength\marginparwidth {\z@} +% \end{macrocode} +% \end{macro} +% +% \begin{macro}{\topmargin} +% The |\topmargin| is the distance between the top of `the +% printable area' --which is 1 inch below the top of the paper-- +% and the top of the box which contains the running head. +% \begin{macrocode} +\setlength\topmargin{-47\p@} +% \end{macrocode} +% \end{macro} +% +% \begin{macro}{\columnsep} +% Proceedings articles are always set in |\twocolumn| mode, +% therefore the distance between the two columns (|\columnsep|)is +% set to a non zero value. +% \begin{macrocode} +\setlength\columnsep{.375in} +% \end{macrocode} +% \end{macro} +% +% \subsection{The page style} +% +% The user can use |\markright| (or |\markboth|) to put an +% identification in the lower left side of the page. The page +% number is printed in the lower right side of the page. +% +% This works as long as he doesn't use either |\pagestyle| or +% |\thispagestyle| comands. +% \changes{v1.3f}{1994/05/26}{changed \cs{rm} to +% \cs{normalfont}\cs{rmfamily}} +% \changes{v1.3j}{1995/05/26}{Removed \cs{rmfamily} (PR 1578)} +% \begin{macrocode} +\let\@oddhead\@empty +\let\@evenhead\@empty +\def\@oddfoot{\normalfont\rightmark \hfil + \pagename{} \thepage} +\def\@evenfoot{\@oddfoot} +% \end{macrocode} +% +% +% \section{Document Markup} +% +% \subsection{The title} +% +% \begin{macro}{\maketitle} +% \changes{v1.3k}{1995/07/18}{Modify footnote handling (PR 1735)} +% The defintion of |\maketitle| here is basically the same as the +% one in the document class \texttt{article}, but the pagestyle is +% \emph{not} set to \texttt{plain}. +% +% \begin{macrocode} +\def\maketitle{\par + \begingroup + \renewcommand\thefootnote{\fnsymbol{footnote}}% + \def\@makefnmark{\rlap{\@textsuperscript{\normalfont\@thefnmark}}}% + \long\def\@makefntext##1{\parindent 1em\noindent + \hb@xt@1.8em{% + \hss\@textsuperscript{\normalfont\@thefnmark}}##1}% +% \end{macrocode} +% This document class always uses two column mode but the title is +% set to the full width of the text. +% \begin{macrocode} + \twocolumn[\@maketitle]% + \@thanks + \endgroup + \setcounter{footnote}{0}% + \let\maketitle\relax + \let\@maketitle\relax + \gdef\@thanks{}\gdef\@author{}\gdef\@title{}\let\thanks\relax} +% \end{macrocode} +% \end{macro} +% +% \begin{macro}{\@maketitle} +% This macro takes care of formatting the title information. +% +% The information is set inside |\vbox| with a width of +% |\textwidth| and a hight of 2.25in. The text is vertically and +% hirizontally centered. +% \begin{macrocode} +\def\@maketitle{% + \vbox to 2.25in{% + \hsize\textwidth + \linewidth\hsize + \vfil + \centering + {\LARGE \@title \par} + \vskip 2em + {\large \begin{tabular}[t]{c}\@author \end{tabular}\par} + \vfil}} +% \end{macrocode} +% \end{macro} +% +% \begin{macro}{\copyrightspace} +% The |\copyrightspace| command is used to produce a blank space in +% the first column where a copyright notice belongs. It works by +% producing a blank footnote of the appropriate size. +% +% \begin{macrocode} +\def\copyrightspace{% + \footnotetext[0]{\mbox{}\vrule \@height 97\p@ \@width \z@}} +% \end{macrocode} +% \end{macro} +% +% \subsection{Modifying environments} +% +% \subsubsection{Abstract} +% +% \begin{macro}{\abstract} +% For this document class the definition of the abstract +% environment is quit simple. +% +% \begin{macrocode} +\renewenvironment{abstract}% + {\section*{\abstractname}} + {\par} +% \end{macrocode} +% \end{macro} +% +% \section{Initialization} +% +% \subsection{Words} +% +% \begin{macro}{\pagename} +% This document class is for documents prepared in the English +% language. To prepare a version for another language, one English +% word must be replaced. It is defined below in a command name. +% \begin{macrocode} +\newcommand\pagename{Page} +% +% \end{macrocode} +% \end{macro} +% +% \Finale +% +\endinput diff --git a/Master/texmf-dist/source/latex/base/proc.ins b/Master/texmf-dist/source/latex/base/proc.ins new file mode 100644 index 00000000000..38d5985202c --- /dev/null +++ b/Master/texmf-dist/source/latex/base/proc.ins @@ -0,0 +1,97 @@ +%% +%% This file will generate fast loadable files and documentation +%% driver files from the doc files in this package when run through +%% LaTeX or TeX. +%% +%% Copyright 1993 1994 1995 1996 1997 1998 1999 2000 2001 2002 2003 2004 +%% The LaTeX3 Project and any individual authors listed elsewhere +%% in this file. +%% +%% This file is part of the LaTeX base system. +%% ------------------------------------------- +%% +%% It may be distributed and/or modified under the +%% conditions of the LaTeX Project Public License, either version 1.3 +%% of this license or (at your option) any later version. +%% The latest version of this license is in +%% http://www.latex-project.org/lppl.txt +%% and version 1.3 or later is part of all distributions of LaTeX +%% version 2003/12/01 or later. +%% +%% This file has the LPPL maintenance status "maintained". +%% +%% In particular, NO PERMISSION is granted to modify the contents of this +%% file since it contains the legal notices that are placed in the files +%% it generates. +%% +%% The list of all files belonging to the LaTeX base distribution is +%% given in the file `manifest.txt'. See also `legal.txt' for additional +%% information. +%% +%% +%% +%% +%% --------------- start of docstrip commands ------------------ +%% + +\input docstrip + +\preamble + +This is a generated file. + +Copyright 1993 1994 1995 1996 1997 1998 1999 2000 2001 2002 2003 2004 +The LaTeX3 Project and any individual authors listed elsewhere +in this file. + +This file was generated from file(s) of the LaTeX base system. +-------------------------------------------------------------- + +It may be distributed and/or modified under the +conditions of the LaTeX Project Public License, either version 1.3 +of this license or (at your option) any later version. +The latest version of this license is in + http://www.latex-project.org/lppl.txt +and version 1.3 or later is part of all distributions of LaTeX +version 2003/12/01 or later. + +This file has the LPPL maintenance status "maintained". + +This file may only be distributed together with a copy of the LaTeX +base system. You may however distribute the LaTeX base system without +such generated files. + +The list of all files belonging to the LaTeX base distribution is +given in the file `manifest.txt'. See also `legal.txt' for additional +information. + +The list of derived (unpacked) files belonging to the distribution +and covered by LPPL is defined by the unpacking scripts (with +extension .ins) which are part of the distribution. +\endpreamble + +\keepsilent +\usedir{tex/latex/base} + +\generate{ + \file{proc.cls}{\from{proc.dtx}{class}} + \file{proc.sty}{\from{proc.dtx}{style}} + } + +\ifToplevel{ +\Msg{***********************************************************} +\Msg{*} +\Msg{* To finish the installation you have to move the following} +\Msg{* files into a directory searched by TeX:} +\Msg{*} +\Msg{* \space\space proc.cls} +\Msg{* \space\space proc.sty} +\Msg{*} +\Msg{* To produce the documentation run the files ending with} +\Msg{* `.dtx' through LaTeX.} +\Msg{*} +\Msg{* Happy TeXing} +\Msg{***********************************************************} +} + +\endbatchfile diff --git a/Master/texmf-dist/source/latex/base/slides.dtx b/Master/texmf-dist/source/latex/base/slides.dtx new file mode 100644 index 00000000000..2582a414d83 --- /dev/null +++ b/Master/texmf-dist/source/latex/base/slides.dtx @@ -0,0 +1,2724 @@ +% \iffalse meta-comment +% +% Copyright 1993 1994 1995 1996 1997 1998 1999 2000 2001 2002 2003 2004 +% The LaTeX3 Project and any individual authors listed elsewhere +% in this file. +% +% This file is part of the LaTeX base system. +% ------------------------------------------- +% +% It may be distributed and/or modified under the +% conditions of the LaTeX Project Public License, either version 1.3 +% of this license or (at your option) any later version. +% The latest version of this license is in +% http://www.latex-project.org/lppl.txt +% and version 1.3 or later is part of all distributions of LaTeX +% version 2003/12/01 or later. +% +% This file has the LPPL maintenance status "maintained". +% +% The list of all files belonging to the LaTeX base distribution is +% given in the file `manifest.txt'. See also `legal.txt' for additional +% information. +% +% The list of derived (unpacked) files belonging to the distribution +% and covered by LPPL is defined by the unpacking scripts (with +% extension .ins) which are part of the distribution. +% +% \fi +% \CheckSum{2704} +%% \CharacterTable +%% {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 +%% 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 +%% Digits \0\1\2\3\4\5\6\7\8\9 +%% Exclamation \! Double quote \" Hash (number) \# +%% Dollar \$ Percent \% Ampersand \& +%% Acute accent \' Left paren \( Right paren \) +%% Asterisk \* Plus \+ Comma \, +%% Minus \- Point \. Solidus \/ +%% Colon \: Semicolon \; Less than \< +%% Equals \= Greater than \> Question mark \? +%% Commercial at \@ Left bracket \[ Backslash \\ +%% Right bracket \] Circumflex \^ Underscore \_ +%% Grave accent \` Left brace \{ Vertical bar \| +%% Right brace \} Tilde \~} +% +% \iffalse +% Copyright (C) 1994-97 LaTeX3 project, Frank Mittelbach +% and Rainer Sch\"opf, all rights reserved. +% +% \begin{macrocode} +%<+class>\NeedsTeXFormat{LaTeX2e}[1997/06/01] +% \end{macrocode} +% +% Announce the Class name and its version: +% \changes{v2.3b}{1994/05/01}{Removed the use of \cs{fileversion} +% c.s.} +% \changes{v2.3b}{1994/05/01}{Added \cs{ProvidesFile} to slides.def.} +% \changes{v2.3o}{1995/05/17}{Replaced all \cs{hbox to} with +% \cs{hb@xt@}.} +% \changes{v2.3o}{1995/05/17}{Cleaned up the \cs{changes} entries.} +% \changes{v2.3p}{1995/05/23}{Corrected some brace mismatches.} +% \changes{v2.3q}{1995/09/20}{Replaced \cs{@tempa} by \cs{reserved@a}.} +% \changes{v2.3r}{1995/09/27}{Globally replaced scale factor 19.91 by +% 19.907 in \cs{DeclareFontShape}, as this gives better +% rounded font sizes at 600dpi (suggested by Denis Roegel).} +% \begin{macrocode} +%<+class>\ProvidesClass{slides} +%<+cmd>\ProvidesFile{slides.def} +%<*driver> + \ProvidesFile{slides.drv} +% + [1997/08/15 v2.3z +%<+class> Standard LaTeX document class] +%<+cmd> SLiTeX definitions] +% \end{macrocode} +% +% \section{A driver for this document} +% +% \changes{v2.3f}{1994/05/26}{Moved the driver to the front of the +% file; it doesn't print any longer} +% +% The next bit of code contains the documentation driver file for +% \TeX{}, i.e., the file that will produce the documentation you are +% currently reading. It can be extracted from this file by the +% \dst{} program. +% \begin{macrocode} +%<*driver> +] +\documentclass{ltxdoc} +% \end{macrocode} +% The following command retrieves the date and version information +% from the file. +% \begin{macrocode} +\GetFileInfo{slides.drv} +% \end{macrocode} +% Some commonly used abbreviations: +% \changes{v2.3h}{1994/06/01}{Added definition of \cs{SLiTeX}.} +% \begin{macrocode} +\DeclareRobustCommand{\SLiTeX}{{% + \normalfont S\kern -.06em + {\scshape l\kern -.035emi}\kern -.06em + \TeX +}} +\newcommand*{\Lopt}[1]{\textsf {#1}} +\newcommand*{\file}[1]{\texttt {#1}} +\newcommand*{\Lcount}[1]{\textsl {\small#1}} +\newcommand*{\pstyle}[1]{\textsl {#1}} +\newcommand*{\dst}{{\normalfont\scshape docstrip}} +% +% \end{macrocode} +% Now start the document and input this file. +% \changes{v2.3d}{1994/05/12}{Added a missing \cs{begin\{macrocode\}}} +% \begin{macrocode} +\begin{document} + \DocInput{slides.dtx} +\end{document} +% +% \end{macrocode} +%\fi +% +% +% \changes{v2.1b}{1993/12/13}{Removed \cs{CodelineIndex} from the +% driver code.} +% \changes{v2.1e}{1993/12/16}{Removed again different definitions for +% font commands font commands in non-compatibility mode.} +% +% \changes{v2.2}{1993/12/18}{Changes to make it work with +% compatibility mode.} +% \changes{v2.2a}{1993/12/19}{Removed float parms} +% \changes{v2.2d}{1994/01/31}{Removed \cs{@normalsize definition}} +% \changes{v2.2g}{1994/03/01}{Removed option makeidx.} +% \changes{v2.2g}{1994/03/01}{Moved driver up front.} +% \changes{v2.2g}{1994/03/01}{Renamed files \file{slides.ltx} and +% \file{sfontdef.ltx} to \file{slides.def} and \file{sfonts.def}.} +% \changes{v2.2l}{1994/03/16}{Removed \cs{typeouts}} +% \changes{v2.3}{1994/03/16}{Removed root/slide-file structure except +% for compatibility mode. (LL)} +% \changes{v2.3}{1994/03/16}{Added clock option (LL)} +% \changes{v2.3}{1994/03/16}{Modified slide, overlay, note +% environments. (LL)} +% \changes{v2.3}{1994/03/16}{Added titlepage option and +% \cs{maketitle}. (LL)} +% \changes{v2.3c}{1994/05/06}{Changed documentation to use +% `environment' instead of `macro' environment for environments} +% \changes{v2.3f}{1994/05/26}{Wrapped two long lines} +% \changes{v2.3l}{1994/12/16}{Use \cs{newcommand*} to define commands +% with an argument} +% \changes{v2.3n}{1995/04/02}{a slight documentation fix (PR 1517)} +% +% \title{Producing slides with \LaTeXe{}} +% \author{Frank Mittelbach} +% \date{\filedate} +% +% \maketitle +% +% \section{Introduction} +% +% With \LaTeXe{} it is now no longer necessary to maintain a special +% format for producing overhead slides. Instead the standard format +% may be used and internally only different font definition files come +% into play. +% +% \section{Usage} +% +% For producing slides you have to use |slides| as the +% document class. This class is very similar to the |slides| style +% that came with \SliTeX{}, in fact it is basically a copy changed to +% work under \LaTeXe{}.\footnote{Therefore you should compare the +% new class with old \SliTeX{} styles +% in case you have local slide classes to see what you have to change +% in order to use them with \LaTeXe{}.} Thus you have to say something +% like +% \begin{verbatim} +% \documentclass[...]{slides} +% \end{verbatim} +% and process this with \LaTeXe. +% +% \section{Fonts} +% +% Note, that that with NFSS you can easily produce slides with special +% fonts just by calling an appropriate style file (like |times|) in a +% |\usepackage| command. This works, for example, with all +% fonts that are defined to be scaleable (e.g., PostScript fonts) since +% they can be used at any size by NFSS. +% +% However, packages like |pandora| won't work because the standard +% |.fd| files shipped with NFSS only contain small sizes. You can, of +% course, produce additional sizes and change the |.fd| files +% accordingly so that they would be useable for slides as well. +% +% \section{Invisible text and color separation} +% +% In the original \SliTeX{} it was possible to produce invisible text +% using the |\invisible| command, so that one was able to put several +% slides on top of each other (with each slides showing additional +% details, etc.). It was also possible to produce `color' slides. This +% was done by producing individual slides one for each color and +% placing them on top of each other. +% +% The availability of color printers and the |color| package make +% color separation obsolete, so it has been removed. Although the +% |color| has also made |\invisible| obsolete, the command is +% retained in the \LaTeXe{} implementation, but there +% are a few restrictions. Invisible fonts are implemented as special +% shapes where the shape names are build by prefixing the normal shape +% name with an uppercase |I|. For example, the `normal invisible +% shape' would be |In|. When \LaTeX{} is requested to typeset +% invisible it will thus change the current shape attribute in this +% manner. To make this work it is necessary that the resulting font +% shape group is defined. If not, the normal font substitution +% mechanism of \LaTeXe{} will change the attribute until it finds a +% usable font shape group with the result that the text may become +% visible. +% +% As long as you use the standard fonts for slides this is not a +% problem because all the visible font shape groups have invisible +% counterparts. However, if you decide on using special fonts, e.g., +% PostScript fonts, your |\DeclareFontShape| settings may not contain +% invisible font shape groups and thus you may be unable to use these +% features without adding additional |\DeclareFontShape| commands to +% your |.fd| files or the preamble of your document. +% +% \StopEventually{} +% +% +% \section{The Implementation} +% +% \begin{quote} +% \textbf{Warning:} The implementation is still very experimental and +% may change internally very much. It currently basically consists of a +% slightly modified copy of |slides.sty| (which then forms +% |slides.cls|) followed by a slightly changed copy of |slitex.tex|. +% Documentation is practically +% non-existing. Everybody is invited to help changing this! +% \end{quote} +% +% The code is divided into two parts, we first implement the class +% related functions and declarations and then define lowlevel stuff +% that is necessary within every class. By placing such commands into +% a separate file it will be possible to share it with other slide +% classes. +% +% \subsection{The class code} +% +% At this point we input the redefinitions that are necessary for +% \SLiTeX. +% \changes{v2.3g}{1994/05/26}{Use \cs{input} instead of \cs{@@input}} +% \begin{macrocode} +%<*class> +\input{slides.def} +% \end{macrocode} +% +% +% Now we are ready for setting up the font tables. As usual, we first +% look for a local configuration file |sfonts.cfg|. If there isn't +% one, we fall back to the default one (|sfonts.def|). +% \changes{v2.2i}{1994/03/08}{Corrected first argument of +% \cs{IfFileExists}: \file{sfonts.def} to \file{sfonts.cfg}.} +% \changes{v2.3g}{1994/05/26}{Use \cs{InputIfFileExists} instead of +% \cs{IfFileExists} and \cs{input} instead of \cs{@@input}} +% \begin{macrocode} +\InputIfFileExists{sfonts.cfg} + {\typeout{**************************************^^J% + *^^J% + * Local config file sfonts.cfg used^^J% + *^^J% + **************************************}}% + {\input{sfonts.def}} +% \end{macrocode} +% +% \section{Declaration of Options} +% +% We declare a few options as illegal. +% +% +% \subsection{Setting Paper Sizes} +% +% The variables |\paperwidth| and |\paperheight| should reflect the +% physical paper size after trimming. For desk printer output this +% is usually the real paper size since there is no post-processing. +% Classes for real book production will probably add other paper +% sizes and additionally the production of crop marks for trimming. +% \changes{v2.1d}{1993/12/14}{Corrected typo, A4 is not 279 mm high} +% \begin{macrocode} +\DeclareOption{a4paper} + {\setlength\paperheight {297mm}% + \setlength\paperwidth {210mm}} +\DeclareOption{a5paper} + {\setlength\paperheight {210mm}% + \setlength\paperwidth {148mm}} +\DeclareOption{b5paper} + {\setlength\paperheight {250mm}% + \setlength\paperwidth {176mm}} +\DeclareOption{letterpaper} + {\setlength\paperheight {11in}% + \setlength\paperwidth {8.5in}} +\DeclareOption{legalpaper} + {\setlength\paperheight {14in}% + \setlength\paperwidth {8.5in}} +\DeclareOption{executivepaper} + {\setlength\paperheight {10.5in}% + \setlength\paperwidth {7.25in}} +% \end{macrocode} +% +% The option \Lopt{landscape} switches the values of |\paperheight| +% and |\paperwidth|, assuming the dimensions wer given for portrait +% paper. +% \begin{macrocode} +\DeclareOption{landscape} + {\setlength\@tempdima {\paperheight}% + \setlength\paperheight {\paperwidth}% + \setlength\paperwidth {\@tempdima}} +% \end{macrocode} +% +% \subsection{The clock option} + +% The option \Lopt{clock} prints the time at the bottom of each note. +% We also define here the commands and counters used to keep track of +% time. +% \begin{macrocode} +\newif\if@clock \@clockfalse +\DeclareOption{clock}{\@clocktrue + \AtEndDocument{\typeout{\@arabic\c@minutes\space minutes}} +}% +\newcounter{minutes}% +\newcounter{seconds}% +\newcommand*{\settime}[1]{\setcounter{seconds}{0}\addtime{#1}}% +\newcommand*{\addtime}[1]{\addtocounter{seconds}{#1}% + \setcounter{minutes}{\value{seconds}}% + \global \divide \value{minutes} by 60\relax} + +% \end{macrocode} +% +% \subsection{Two-side or one-side printing} +% +% Two-sided printing is not allowed, so don't declare an option. +% But it is necessary to initialize the switch. +% \changes{v2.2h}{1994/03/07}{Removed declared option twoside.} +% \begin{macrocode} +\@twosidefalse +% \end{macrocode} +% +% +% \subsection{Draft option} +% +% If the user requests \Lopt{draft} we show any overfull boxes. +% We could probably add some more interesting stuff to this option. +% \begin{macrocode} +\DeclareOption{draft}{\setlength\overfullrule{5pt}} +\DeclareOption{final}{\setlength\overfullrule{0pt}} +% \end{macrocode} +% +% \subsection{Titlepage option} +% The default is for a |\maketitle| command to make a new page. +% \begin{macrocode} +\newif\if@titlepage +\@titlepagetrue +\DeclareOption{titlepage}{\@titlepagetrue} +\DeclareOption{notitlepage}{\@titlepagefalse} +% \end{macrocode} +% +% \subsection{Twocolumn printing} +% +% Two-column printing is again forbidden. +% \changes{v2.3e}{1994/05/22}{twocolumn produces only a warning} +% \begin{macrocode} +\DeclareOption{onecolumn}{} +\DeclareOption{twocolumn}{% + \ClassWarning{slides}{No 'twocolumn' layout for slides}} +% \end{macrocode} +% +% \subsection{Equation numbering on the left} +% +% The option \Lopt{leqno} can be used to get the equation numbers +% on the left side of the equation. +% \changes{v2.2g}{1994/03/01}{Option leqno loads \file{leqno.clo} +% file.} +% \begin{macrocode} +\DeclareOption{leqno}{\input{leqno.clo}} +% \end{macrocode} +% +% \subsection{Flush left displays} +% +% The option \Lopt{fleqn} redefines the displayed math environmens +% in such a way that they come out flush left, with an indentation +% of |\mathindent| from the prevailing left margin. +% \changes{v2.2g}{1994/03/01}{Added fleqn option.} +% \begin{macrocode} +\DeclareOption{fleqn}{\input{fleqn.clo}} +% \end{macrocode} +% +% +% \section{Executing Options} +% +% Here we execute the default options to initialize certain +% variables. +% \begin{macrocode} +\ExecuteOptions{letterpaper,final} +% \end{macrocode} +% +% The |\ProcessOptions| command causes the execution of the code +% for every option \Lopt{FOO} +% which is declared and for which the user typed +% the \Lopt{FOO} option in his +% |\documentclass| command. For every option \Lopt{BAR} he typed, +% which is not declared, the option is assumed to be a global option. +% All options will be passed as document options to any +% |\usepackage| command in the document preamble. +% \begin{macrocode} +\ProcessOptions +% \end{macrocode} +% +% \section{Loading Packages} +% +% The standard class files do not load additional packages. +% +% +% \section{Document Layout} +% +% +% In this section we are finally dealing with the nasty typographical +% details. +% +% +% +% \subsection{Fonts} +% +% \begin{macrocode} +% FMi: +\def\rmdefault{lcmss} % no roman +\def\sfdefault{lcmss} +\def\ttdefault{lcmtt} +\def\itdefault{sl} +\def\sldefault{sl} +\def\bfdefault{bx} +% \end{macrocode} +% +% +% Since the number of parameters to set are very large it seems +% reasonable to set up one command |\@setfontsize@parms| which will +% do the work for us. +% +% \LaTeX\ offers the user commands to change the size of the font, +% relative to the `main' size. Each relative size changing command +% |\size| executes the command +% |\@setfontsize||\size|\meta{font-size}\meta{baselineskip} where: +% +% \begin{description} +% \item[\meta{font-size}] The absolute size of the font to use from +% now on. +% +% \item[\meta{baselineskip}] The normal value of |\baselineskip| +% for the size of the font selected. (The actual value will be +% |\baselinestretch| * \meta{baselineskip}.) +% \end{description} +% +% A number of commands, defined in the \LaTeX{} kernel, shorten the +% following definitions and are used throughout. They are: +% \begin{center} +% \begin{tabular}{ll@{\qquad}ll@{\qquad}ll} +% \verb=\@vpt= & 5 & \verb=\@vipt= & 6 & \verb=\@viipt= & 7 \\ +% \verb=\@viiipt= & 8 & \verb=\@ixpt= & 9 & \verb=\@xpt= & 10 \\ +% \verb=\@xipt= & 10.95 & \verb=\@xiipt= & 12 & \verb=\@xivpt= & 14.4\\ +% ... +% \end{tabular} +% \end{center} +% +% \begin{macro}{\ifourteenpt} +% \begin{macro}{\iseventeenpt} +% \begin{macro}{\itwentypt} +% \begin{macro}{\itwentyfourpt} +% \begin{macro}{\itwentyninept} +% \begin{macro}{\ithirtyfourpt} +% \begin{macro}{\ifortyonept} +% For \SLiTeX{}, however, these are not sufficient, and we therefore +% need to add a few extra, larger, sizes. +% \begin{macrocode} +\def\ifourteenpt{13.82} +\def\iseventeenpt{16.59} +\def\itwentypt{19.907} +\def\itwentyfourpt{23.89} +\def\itwentyninept{28.66} +\def\ithirtyfourpt{34.4} +\def\ifortyonept{41.28} +% \end{macrocode} +% \end{macro} +% \end{macro} +% \end{macro} +% \end{macro} +% \end{macro} +% \end{macro} +% \end{macro} +% +% \begin{macro}{\@setfontsize@parms} +% This routine is used in \SliTeX{} to interface font size setting +% it is modeled after the settings I found in \texttt{slides.sty}, so +% it probably needs an update. But any class is free to redefine +% it, as it is used only as an abbreviation. +% It's syntax is: +% \begin{quote} +% |\@setfontsize@parms| \\ +% | |\meta{lineskip} \\ +% | |\meta{parskip} \\ +% | |\meta{abovedisplayskip} \\ +% | |\meta{belowdisplayskip} \\ +% | |\meta{abovedisplayshortskip} \\ +% | |\meta{belowdisplayshortskip} \\ +% | |\meta{strut ht} \meta{strut dp} (without pt) +% \end{quote} +% +% For NFSS1 a similar style existed which did run both with a +% \SliTeX{} with old font selection or with NFSS1. But when no +% separate format is made this doesn't make much sense. +% So the following note is history and would only be true if all NFSS +% stuff would be removed from the file and placed into the format. +% \begin{quote}\small +% Note: To interface the old \texttt{sfonts.tex} the \meta{size} must be +% hidden in commands denoting the size by its name prefixed with +% `i', i.e.\ 20pt size is called |\itwentypt| at this point. The +% NFSS interface will define those sizes to expand to the internal +% size, e.g.\ 20 but for the old sfonts the command name, e.g. +% |\itwentypt|, will be used to construct the name |\twentypt| etc. +% +% This is a crude interface to the old \texttt{sfonts.tex}. It will +% be a bit slower than the old one because it must define |\@tiny| +% etc.\ every time a size changes. +% \end{quote} +% +% If classes are set up that are only for use with NFSS then the second +% argument may be an ordinary font size! +% \changes{v2.0d}{1993/11/12}{Replaced all pt by \cs{p@}, corrected +% definition for \cs{tiny}.} +% +% \begin{macrocode} +\def\@setfontsize@parms#1#2#3#4#5#6#7#8{% + \lineskip #1\relax% + \parskip #2\relax + \abovedisplayskip #3\relax + \belowdisplayskip #4\relax + \abovedisplayshortskip #5\relax + \belowdisplayshortskip #6\relax +% +% \end{macrocode} +% I don't see a reason why the |\strutbox| has a dim different from +% |\baselineskip| but we will leave it for the moment +% \begin{macrocode} + \setbox\strutbox=\hbox{\vrule \@height#7\p@\@depth#8\p@\@width\z@}% + \baselineskip\baselinestretch\baselineskip + \normalbaselineskip\baselineskip} +% \end{macrocode} +% \end{macro} +% +% Setting size relations for math scripts: +% \changes{v2.2e}{1994/02/07}{Corrected entry for size 23.89.} +% \begin{macrocode} +\DeclareMathSizes{13.82}{13.82}{10}{7} +\DeclareMathSizes{16.59}{16.59}{12}{7} +\DeclareMathSizes{19.907}{19.907}{16.59}{13.82} +\DeclareMathSizes{23.89}{23.89}{19.907}{16.59} +\DeclareMathSizes{28.66}{28.66}{23.89}{19.907} +\DeclareMathSizes{34.4}{34.4}{28.66}{23.89} +\DeclareMathSizes{41.28}{41.28}{34.4}{28.66} +% \end{macrocode} +% +% \begin{macro}{\normalsize} +% \begin{macrocode} +\def\normalsize{% + \@setfontsize\normalsize\itwentypt{28\p@ plus3\p@ minus4\p@}% +% {20}{30\p@ plus3\p@ minus3\p@}% made a bit shorter + \@setfontsize@parms + {2pt}% + {30\p@ plus18\p@ minus9\p@}% + {15\p@ plus3\p@ minus3\p@}% + {10\p@ plus3\p@ minus3\p@}% + {10\p@ plus3\p@} + \abovedisplayshortskip + {17}{7}} +% \end{macrocode} +% \end{macro} +% +% +% We initially choose the normalsize font. +% \begin{macrocode} +\normalsize +% \end{macrocode} +% +% \begin{macro}{\small} +% \begin{macrocode} +\def\small{\@setfontsize\small\iseventeenpt{19\p@ plus3\p@ minus\p@}% + \@setfontsize@parms + {2\p@}% + {15\p@ plus15\p@ minus7\p@}% + {12\p@ plus3\p@ minus3\p@}% + {9\p@ plus3\p@ minus3\p@}% + {6\p@ plus3\p@}% + \abovedisplayshortskip + {13.5}{5.6}} +% \end{macrocode} +% \end{macro} +% +% \begin{macro}{\footnotesize} +% \begin{macro}{\scriptsize} +% \begin{macrocode} +\let\footnotesize=\small +\let\scriptsize=\small +% \end{macrocode} +% \end{macro} +% \end{macro} +% +% \begin{macro}{\tiny} +% \begin{macrocode} +\def\tiny{\@setfontsize\tiny\ifourteenpt{16\p@ plus2\p@ minus\p@}% + \@setfontsize@parms + {2pt}% + {14\p@ plus3\p@ minus10\p@}% + {11\p@ plus3\p@ minus10\p@}% + \abovedisplayskip + {8\p@ plus3\p@ minus5\p@}% + {\z@ plus3\p@}% + {10}{4}} +% \end{macrocode} +% \end{macro} +% +% Actually copying the code above would be better because this would +% correct the error message. Maybe one should remove the first +% argument of |\set@font@size@parms|. +% +% \begin{macro}{\large} +% \begin{macro}{\Large} +% \begin{macro}{\LARGE} +% \begin{macro}{\huge} +% \begin{macro}{\Huge} +% \begin{macrocode} +\def\large{\@setfontsize\large\itwentyfourpt{42\p@ plus8\p@ minus5\p@}% + \@setfontsize@parms + {2\p@}% + {40\p@ plus20\p@ minus4\p@}% + {20\p@ plus8\p@ minus3\p@}% + \abovedisplayskip + {10\p@ plus5\p@}% + \abovedisplayshortskip + {20}{8.5}} + +\def\Large{\@setfontsize\Large\itwentyninept{48\p@ plus10\p@ minus6\p@}% + \@setfontsize@parms + {2\p@}% + {48\p@ plus30\p@ minus6\p@}% + {24\p@ plus10\p@ minus6\p@}% + \abovedisplayskip + {12\p@ plus8\p@}% + \abovedisplayshortskip + {27}{11}} + +\def\LARGE{\@setfontsize\LARGE\ithirtyfourpt{52\p@ plus10\p@ minus6\p@}% + \@setfontsize@parms + {2\p@}% + {52\p@ plus30\p@ minus6\p@}% + {24\p@ plus10\p@ minus6\p@}% + \abovedisplayskip + {12\p@ plus8\p@}% + \abovedisplayshortskip + {27}{11}} + +\def\huge{\@setfontsize\huge\ifortyonept{60\p@ plus10\p@ minus6\p@}% + \@setfontsize@parms + {2\p@}% + {60\p@ plus30\p@ minus6\p@}% + {24\p@ plus10\p@ minus6\p@}% + \abovedisplayskip + {12\p@ plus8\p@}% + \abovedisplayshortskip + {27}{11}} + +\let\Huge\huge +% \end{macrocode} +% \end{macro} +% \end{macro} +% \end{macro} +% \end{macro} +% \end{macro} +% +% \subsection{Paragraphing} +% +% \begin{macro}{\baselinestretch} +% This is used as a multiplier for |\baselineskip|. The default is +% to {\em not\/} stretch the baselines. +% \begin{macrocode} +\renewcommand\baselinestretch{} +% \end{macrocode} +% \end{macro} +% +% \begin{macro}{\parindent} +% |\parindent| is the width of the paragraph indentation. +% \begin{macrocode} +\setlength\parindent{\z@} +% \end{macrocode} +% \end{macro} +% +% \begin{macro}{\@lowpenalty} +% \begin{macro}{\@medpenalty} +% \begin{macro}{\@highpenalty}% +% The commands |\nopagebreak| and |\nolinebreak| put in penalties +% to discourage these breaks at the point they are put in. +% They use |\@lowpenalty|, |\@medpenalty| or |\@highpenalty|, +% dependant on their argument. +% \begin{macrocode} +\@lowpenalty 51 +\@medpenalty 151 +\@highpenalty 301 +% \end{macrocode} +% \end{macro} +% \end{macro} +% \end{macro} +% +% \begin{macro}{\clubpenalty} +% \begin{macro}{\widowpenalty} +% These penalties are use to discourrage club and widow lines. +% Because we use their default values we only show them here, +% commented out. +% \begin{macrocode} +% \clubpenalty 150 +% \widowpenalty 150 +% \end{macrocode} +% \end{macro} +% \end{macro} +% +% \begin{macro}{\displaywidowpenalty} +% \begin{macro}{\predisplaypenalty} +% \begin{macro}{\postdisplaypenalty} +% Discourrage (but not so much) widows in front of a math display +% and forbid breaking directly in front of a display. Allow break +% after a display without a penalty. Again the default values are +% used, therefore we only show them here. +% \begin{macrocode} +% \displaywidowpenalty 50 +% \predisplaypenalty 10000 +% \postdisplaypenalty 0 +% \end{macrocode} +% \end{macro} +% \end{macro} +% \end{macro} +% +% \begin{macro}{\interlinepenalty} +% Allow the breaking of a page in the middle of a paragraph. +% \begin{macrocode} +% \interlinepenalty 0 +% \end{macrocode} +% \end{macro} +% +% +% \begin{macro}{\brokenpenalty} +% We allow the breaking of a page after a hyphenated line. +% \begin{macrocode} +% \brokenpenalty 0 +% \end{macrocode} +% \end{macro} +% +% +% \subsection{Page Layout} +% +% All margin dimensions are measured from a point one inch from the +% top and lefthand side of the page. +% +% \subsubsection{Vertical spacing} +% +% \begin{macro}{\headheight} +% \begin{macro}{\headsep} +% \begin{macro}{\topskip} +% The |\headheight| is the height of the box that will contain the +% running head. The |\headsep| is the distance between the bottom +% of the running head and the top of the text. |\topskip| is the +% |\baselineskip| for the first line on a page. +% \begin{macrocode} +\setlength\headheight{14\p@} +\setlength\headsep {15\p@} +\setlength\topskip {30\p@} +% \end{macrocode} +% \end{macro} +% \end{macro} +% \end{macro} +% +% \begin{macro}{\footskip} +% The distance from the baseline of the box which contains the +% running footer to the baseline of last line of text is controlled +% by the |\footskip|. +% Bottom of page: +% \begin{macrocode} +\setlength\footskip{25\p@} % +% \end{macrocode} +% \end{macro} +% +% \begin{macro}{\maxdepth} +% \begin{macro}{\@maxdepth} +% \changes{v2.3c}{1994/05/06}{Added setting of \cs{maxdepth} and +% \cs{@maxdepth}} +% The \TeX\ primitive register |\maxdepth| has a function that is +% similar to that of |\topskip|. The register |\@maxdepth| should +% always contain a copy of |\maxdepth|. In both plain \TeX\ and +% \LaTeX~2.09 |\maxdepth| had a fixed value of \texttt{4pt}; in +% native \LaTeX2e\ mode we let the value depend on the typesize. We +% set it so that |\maxdepth| $+$ |\topskip| $=$ typesize $\times +% 1.5$. As it happens, in these classes |\topskip| is equal to the +% typesize, therefor we set |\maxdepth| to half the value of +% |\topskip|. +% \begin{macrocode} +\if@compatibility + \setlength\maxdepth{4\p@} +\else + \setlength\maxdepth{.5\topskip} +\fi +\setlength\@maxdepth\maxdepth +% \end{macrocode} +% \end{macro} +% \end{macro} +% +% \subsubsection{The dimension of text} +% +% \begin{macro}{\textwidth} +% When we are in compatibility mode we have to make sure that the +% dimensions of the printed area are not different from what the +% user was used to see. +% +% \begin{macrocode} +\if@compatibility + \setlength\textwidth{460\p@} +% \end{macrocode} +% When we are not in compatibility mode we can set some of the +% dimensions differently, taking into account the paper size for +% instance. +% \begin{macrocode} +\else +% \end{macrocode} +% First, we calculate the maximum textwidth, which depends on the +% papersize. Then we calculate the approximate length of 65 +% characters, which should be the maximum length of a line of text. +% The calculated values are stored in |\@tempdima| and |\@tempdimb|. +% \begin{macrocode} + \setlength\@tempdima{\paperwidth} + \addtolength\@tempdima{-2in} + \setbox\@tempboxa\hbox{\rmfamily im} + \setlength\@tempdimb{.5\wd\@tempboxa} + \setlength\@tempdimb{65\@tempdimb} +% \end{macrocode} +% +% Now we can set the |\textwidth|, depending on whether we will be +% setting one or two columns. +% +% The text should not be wider than the minimum +% of the paperwidth (minus 2 inches for the margins) and the +% maximum length of a line as defined by the number of characters. +% \begin{macrocode} + \ifdim\@tempdima>\@tempdimb\relax + \setlength\textwidth{\@tempdimb} + \else + \setlength\textwidth{\@tempdima} + \fi +\fi +% \end{macrocode} +% +% Here we modify the width of the text a little to be a whole +% number of points. +% \begin{macrocode} +\@settopoint\textwidth +% \end{macrocode} +% \end{macro} +% +% \begin{macro}{\columnwidth} +% \begin{macro}{\columnsep} +% \begin{macro}{\columnseprule} +% \begin{macrocode} +\columnwidth \textwidth +\columnsep 10pt +\columnseprule \z@ +% \end{macrocode} +% \end{macro} +% \end{macro} +% \end{macro} +% \begin{macro}{\textheight} +% Now that we have computed the width of the text, we have to take +% care of the height. The |\textheight| is the height of text +% (including footnotes and figures, excluding running head and +% foot). +% +% First make sure that the compatibility mode gets the same +% dimensions as we had with \LaTeX2.09. The number of lines was +% calculated as the floor of the old |\textheight| minus +% |\topskip|, divided by |\baselineskip| for |\normalsize|. The +% old value of |\textheight| was 528pt. +% +% \begin{macrocode} +\if@compatibility + \setlength\textheight{600\p@} +% \end{macrocode} +% +% Again we compute this, depending on the papersize and depending +% on the baselineskip that is used, in order to have a whole number +% of lines on the page. +% \begin{macrocode} +\else + \setlength\@tempdima{\paperheight} +% \end{macrocode} +% +% We leave at least a 1 inch margin on the top and the bottom of +% the page. +% \begin{macrocode} + \addtolength\@tempdima{-2in} +% \end{macrocode} +% +% We also have to leave room for the running headers and footers. +% \begin{macrocode} + \addtolength\@tempdima{-1in} +% \end{macrocode} +% +% Then we divide the result by the current |\baselineskip| and +% store this in the count register |\@tempcnta|, which then +% contains the number of lines that fit on this page. +% \begin{macrocode} + \divide\@tempdima\baselineskip + \@tempcnta=\@tempdima +% \end{macrocode} +% +% From this we can calculate the height of the text. +% \begin{macrocode} + \setlength\textheight{\@tempcnta\baselineskip} +\fi +% \end{macrocode} +% +% The first line on the page has a height of |\topskip|. +% \begin{macrocode} +\advance\textheight by \topskip +% \end{macrocode} +% \end{macro} +% +% \subsubsection{Margins} +% +% \begin{macro}{\oddsidemargin} +% \begin{macro}{\evensidemargin} +% \begin{macro}{\marginparwidth} +% First we give the values for the compatibility mode. +% +% Values for two-sided printing: +% \begin{macrocode} +\if@compatibility + \setlength\oddsidemargin {17\p@} + \setlength\evensidemargin {17\p@} + \setlength\marginparwidth {20\p@} +\else +% \end{macrocode} +% +% When we are not in compatibility mode we can take the dimensions +% of the selected paper into account. +% +% We center the text on the page, by +% calculating the difference between |textwidth| and +% |\paperwidth|$-$|2in|. Half of that difference is then used for +% the margin. The amount of space that can be used for marginal +% notes is at least 0.8~inch, to which we add any `leftover' space. +% \begin{macrocode} + \setlength\@tempdima {\paperwidth} + \addtolength\@tempdima {-2in} + \addtolength\@tempdima {-\textwidth} + \setlength\oddsidemargin {.5\@tempdima} + \setlength\marginparwidth {.8in} + \addtolength\marginparwidth {.5\@tempdima} +% \end{macrocode} +% +% The |\evensidemargin| can now be computed from the values set +% above. +% \begin{macrocode} +\setlength\evensidemargin {\paperwidth} +\addtolength\evensidemargin{-2in} +\addtolength\evensidemargin{-\textwidth} +\addtolength\evensidemargin{-\oddsidemargin} +\fi +% \end{macrocode} +% \end{macro} +% \end{macro} +% \end{macro} +% +% \begin{macro}{\marginparsep} +% \begin{macro}{\marginparpush} +% The horizontal space between the main text and marginal notes is +% determined by |\marginparsep|, the minimum vertical separation +% between two marginal notes is controlled by |\marginparpush|. +% \begin{macrocode} +\setlength\marginparsep {5\p@} +\setlength\marginparpush{5\p@} +% \end{macrocode} +% \end{macro} +% \end{macro} +% +% \begin{macro}{\topmargin} +% The |\topmargin| is the distance between the top of `the +% printable area' --which is 1 inch below the top of the paper-- +% and the top of the box which contains the running head. +% +% It can now be computed from the values set above. +% \begin{macrocode} +\if@compatibility + \setlength\topmargin{-10pt} +\else + \setlength\topmargin{\paperheight} + \addtolength\topmargin{-2in} + \addtolength\topmargin{-\headheight} + \addtolength\topmargin{-\headsep} + \addtolength\topmargin{-\textheight} + \addtolength\topmargin{-\footskip} % this might be wrong! +% \end{macrocode} +% By changing the factor in the next line the complete page +% can be shifted vertically. +% \begin{macrocode} + \addtolength\topmargin{-.5\topmargin} +\fi +\@settopoint\topmargin +% \end{macrocode} +% \end{macro} +% +% +% \subsubsection{Footnotes} +% +% \begin{macro}{\footnotesep} +% |\footnotesep| is the height of the strut placed at the beginning +% of every footnote. It equals the height of a normal +% |\footnotesize| strut in this +% class, thus no extra space occurs between footnotes. +% \begin{macrocode} +\setlength\footnotesep{20\p@} +% \end{macrocode} +% \end{macro} +% +% \begin{macro}{\footins} +% |\skip\footins| is the space between the last line of the main +% text and the top of the first footnote. +% \begin{macrocode} +\setlength{\skip\footins}{10\p@ \@plus 2\p@ \@minus 4\p@} +% \end{macrocode} +% \end{macro} +% +% +% \subsection{Page Styles} +% +% The page style \pstyle{foo} is defined by defining the command +% |\ps@foo|. This command should make only local definitions. +% There should be no stray spaces in the definition, since they +% could lead to mysterious extra spaces in the output (well, that's +% something that should be always avoided). +% +% \begin{macro}{\@evenhead} +% \begin{macro}{\@oddhead} +% \begin{macro}{\@evenfoot} +% \begin{macro}{\@oddfoot} +% The |\ps@...| command defines the macros |\@oddhead|, +% |\@oddfoot|, |\@evenhead|, and |\@evenfoot| to define the running +% heads and feet---e.g., |\@oddhead| is the macro to produce the +% contents of the heading box for odd-numbered pages. It is called +% inside an |\hbox| of width |\textwidth|. +% \end{macro} +% \end{macro} +% \end{macro} +% \end{macro} +% +% +% The page styles of slides is determined by the 'slide' page style, +% the slide environment executing a |\thispagestyle{slide}| command. +% The page styles of overlays and notes are similarly determined by +% 'overlay' and 'note' page styles. The command standard 'headings', +% 'plain' and 'empty' page styles work by redefining the 'slide', +% 'overlay', and 'note' styles. +% +% \changes{v2.3q}{1995/09/20}{Wrap some long lines, and use \cs{null}.} +% \begin{macro}{\ps@headings} +% \begin{macrocode} +\if@compatibility +\def\ps@headings{% +\def\ps@slide{\def\@oddfoot{\@mainsize +\hfil\hb@xt@3em{\theslide + \hss}}% + \def\@oddhead{\@mainsize +\hfil +}% + \def\@evenfoot{\@mainsize +\hfil\hb@xt@3em{\theslide\hss}}% + \def\@evenhead{\@mainsize +\hfil +}} + +\def\ps@overlay{\def\@oddfoot{\@mainsize +\hfil\hb@xt@3em{\theoverlay + \hss}}% + \def\@oddhead{\@mainsize +\hfil +}% + \def\@evenfoot{\@mainsize +\hfil\hb@xt@3em{\theoverlay\hss}}% + \def\@evenhead{\@mainsize +\hfil +}} +\def\ps@note{\def\@oddfoot{\@mainsize \hbox{}\hfil\thenote}% + \def\@oddhead{}% + \def\@evenfoot{\@mainsize \hbox{}\hfil\thenote}% + \def\@evenhead{}}} +% +\else %%if@compatibility +% +\def\ps@headings{% + \def\ps@slide{% + \def\@oddfoot{\@mainsize \mbox{}\hfil\hb@xt@3em{\theslide\hss}}% + \def\@oddhead{}% + \def\@evenfoot{\@mainsize \mbox{}\hfil\hb@xt@3em{\theslide\hss}}% + \def\@evenhead{}} + + \def\ps@overlay{% + \def\@oddfoot{\@mainsize \mbox{}\hfil\hb@xt@3em{\theoverlay\hss}}% + \def\@oddhead{}% + \def\@evenfoot{\@mainsize \mbox{}\hfil\hb@xt@3em{\theoverlay\hss}}% + \def\@evenhead{}} + + \def\ps@note{% + \def\@oddfoot{% + \@mainsize + \if@clock + \fbox{\large \@arabic\c@minutes\space min}% + \else + \null + \fi + \hfil\thenote}% + \def\@oddhead{}% + \def\@evenfoot{% + \@mainsize + \if@clock + \fbox{\large \@arabic\c@minutes\space min}% + \else + \null + \fi + \hfil\thenote}% + \def\@evenhead{}}} +\fi %% if@compatibility +% \end{macrocode} +% \end{macro} +% +% \begin{macro}{\ps@plain} +% \begin{macrocode} +\def\ps@plain{\def\ps@slide{% + \def\@oddfoot{\@mainsize \mbox{}\hfil\hb@xt@3em{\theslide\hss}}% + \def\@oddhead{}% + \def\@evenfoot{\@mainsize \mbox{}\hfil\hb@xt@3em{\theslide\hss}}% + \def\@evenhead{}} +\def\ps@overlay{\def\@oddfoot{\@mainsize + \mbox{}\hfil\hb@xt@3em{\theoverlay\hss}}% + \def\@oddhead{}% + \def\@evenfoot{\@mainsize \mbox{}\hfil\hb@xt@3em{\theoverlay\hss}}% + \def\@evenhead{}} +\def\ps@note{\def\@oddfoot{\@mainsize \hbox{}\hfil\thenote}% + \def\@oddhead{}% + \def\@evenfoot{\@mainsize \hbox{}\hfil\thenote}% + \def\@evenhead{}}} +% \end{macrocode} +% \end{macro} +% +% \begin{macro}{\ps@empty} +% \begin{macrocode} +\def\ps@empty{% +\def\ps@slide{\def\@oddhead{}\def\@oddfoot{}% +\def\@evenhead{}\def\@evenfoot{}}% +\def\ps@overlay{\def\@oddhead{}\def\@oddfoot{}% +\def\@evenhead{}\def\@evenfoot{}}% +\def\ps@note{\def\@oddhead{}\def\@oddfoot{}% +\def\@evenhead{}\def\@evenfoot{}}} +% \end{macrocode} +% \end{macro} +% +% Default definition the 'slide', 'overlay', and 'note' page styles. +% \begin{macrocode} +\ps@headings +% \end{macrocode} +% Set ordinary page style to 'empty' +% \begin{macrocode} +\let\@oddhead\@empty\let\@oddfoot\@empty +\let\@evenhead\@empty\let\@evenfoot\@empty +% \end{macrocode} +% +% +% \subsection{Providing math {\em versions}} +% +% \LaTeX{} provides two {\em versions\/}. We call them +% \textsf{normal} and \textsf{bold}, respectively. +% \SliTeX{} does not have a \textsf{bold} version. But we treat the +% invisible characters as a version. The only thing we have to take +% care of is to ensure that we have exactly the same fonts in both +% versions available. +% +% \begin{macrocode} +\DeclareMathVersion{invisible} +% \end{macrocode} +% +% Now we define the basic {\em math groups\/} used by \LaTeX{}. Later +% on, in packages some other {\em math groups}, e.g., the AMS +% symbol fonts, will be defined. +% +% As a default I used serif fonts for mathgroup 0 to get things like +% \verb+\log+ look right. +% \begin{macrocode} +\SetSymbolFont{operators}{normal} + {OT1}{lcmss}{m}{n} + +\SetSymbolFont{letters}{normal} + {OML}{lcmm}{m}{it} +\SetSymbolFont{symbols}{normal} + {OMS}{lcmsy}{m}{n} +\SetSymbolFont{largesymbols}{normal} + {OMX}{lcmex}{m}{n} + +\SetSymbolFont{operators}{invisible} + {OT1}{lcmss}{m}{In} +\SetSymbolFont{letters}{invisible} + {OML}{lcmm}{m}{Iit} +\SetSymbolFont{symbols}{invisible} + {OMS}{lcmsy}{m}{In} +\SetSymbolFont{largesymbols}{invisible} + {OMX}{lcmex}{m}{In} + + +\def\@mainsize{\visible\tiny} +% \end{macrocode} +% +% +% \subsection{Environments} +% +% \begin{environment}{titlepage} +% This environment starts a new page, with pagestyle \pstyle{empty} +% and sets the page counter to 0. +% \begin{macrocode} +\newenvironment{titlepage} + {\newpage + \thispagestyle{empty}% + \setcounter{page}{\z@}} + {\newpage} +% \end{macrocode} +% \end{environment} +% +% \subsubsection{General List Parameters} +% +% The following commands are used to set the default values for the +% list environment's parameters. See the \LaTeX{} manual for an +% explanation of the meaning of the parameters. +% +% \begin{macro}{\leftmargini} +% \begin{macro}{\leftmarginii} +% \begin{macro}{\leftmarginiii} +% \begin{macro}{\leftmarginiv} +% \begin{macro}{\leftmarginv} +% \begin{macro}{\leftmarginvi} +% \begin{macrocode} +\setlength\leftmargini {38\p@} +\setlength\leftmarginii {30\p@} +\setlength\leftmarginiii {20\p@} +\setlength\leftmarginiv {15\p@} +\setlength\leftmarginv {15\p@} +\setlength\leftmarginvi {10\p@} +% \end{macrocode} +% \end{macro} +% \end{macro} +% \end{macro} +% \end{macro} +% \end{macro} +% \end{macro} +% +% \begin{macro}{\@listi} +% \begin{macro}{\@listii} +% \begin{macro}{\@listiii} +% \begin{macro}{\@listiv} +% \begin{macro}{\@listv} +% \begin{macro}{\@listvi} +% These commands set the values of |\leftmargin|, |\parsep|, +% |\topsep|, and |\itemsep| for the various levels of lists. +% \changes{v2.3z}{1997/08/15}{Add initialization of \cs{leftmargin} to +% \cs@listi.} +% It is even necessary to initialize |\leftmargin| in |\@listi|, +% i.e. for a level one list, as a list environment may appear +% inside a \texttt{trivlist}, for example inside a \texttt{theorem} +% environment. +% \begin{macrocode} +\def\@listi{\leftmargin\leftmargini + \parsep .5\parskip + \topsep \parsep + \itemsep\parskip + \partopsep \z@} + +\def\@listii{\leftmargin\leftmarginii + \labelwidth\leftmarginii + \advance\labelwidth-\labelsep + \parsep .5\parskip + \topsep \parsep + \itemsep\parskip} +\def\@listiii{\leftmargin\leftmarginiii + \labelwidth\leftmarginiii + \advance\labelwidth-\labelsep} +\def\@listiv{\leftmargin\leftmarginiv + \labelwidth\leftmarginiv + \advance\labelwidth-\labelsep} +\def\@listv{\leftmargin\leftmarginv + \labelwidth\leftmarginv + \advance\labelwidth-\labelsep} +\def\@listvi{\leftmargin\leftmarginvi + \labelwidth\leftmarginvi + \advance\labelwidth-\labelsep} +% \end{macrocode} +% \end{macro} +% \end{macro} +% \end{macro} +% \end{macro} +% \end{macro} +% \end{macro} +% +% Here we initialize |\leftmargin| and |\labelwidth|. +% \begin{macrocode} +\leftmargin\leftmargini +\labelwidth\leftmargini\advance\labelwidth-\labelsep +% \end{macrocode} +% +% +% \subsubsection{Paragraph-formatting environments} +% +% \begin{environment}{verse} +% Inside a |verse| environment, |\\| ends a line, and +% line continuations are indented further. +% A blank line makes new paragraph with |\parskip| space. +% \begin{macrocode} +\newenvironment{verse}{\let\\=\@centercr + \list{}{\itemsep \z@ + \itemindent -15\p@ + \listparindent \itemindent + \rightmargin \leftmargin + \advance\leftmargin 15\p@}% + \item[]} + {\endlist} +% \end{macrocode} +% \end{environment} +% +% \begin{environment}{quotation} +% The |quotation| environment fills lines, indents paragraphs. +% \begin{macrocode} +\newenvironment{quotation}{\list{}{\listparindent 20\p@ + \itemindent\listparindent + \rightmargin\leftmargin}% + \item[]} + {\endlist} +% \end{macrocode} +% \end{environment} +% +% \begin{environment}{quote} +% The |quote| environment is the same as the |quotation| environment, +% except that there is no paragraph indentation. +% \begin{macrocode} +\newenvironment{quote}{\list{}{\rightmargin\leftmargin}\item[]} + {\endlist} +% \end{macrocode} +% \end{environment} +% +% +% \subsubsection{List-making environments} +% +% +% \begin{environment}{description} +% The description environment is defined here -- while the itemize +% and enumerate environments are defined in \file{latex.dtx}. +% +% \begin{macrocode} +\newenvironment{description}{\list{}{\labelwidth\z@ + \itemindent-\leftmargin + \let\makelabel\descriptionlabel}} + {\endlist} +% \end{macrocode} +% \end{environment} +% +% \begin{macro}{\descriptionlabel} +% To change the formatting of the label, you must redefine +% |\descriptionlabel|. +% \begin{macrocode} +\newcommand*{\descriptionlabel}[1]{\hspace\labelsep + \normalfont\bfseries #1} + +% \end{macrocode} +% \end{macro} +% +% \subsubsection{Enumerate} +% +% The enumerate environment uses four counters: \Lcount{enumi}, +% \Lcount{enumii}, \Lcount{enumiii} and \Lcount{enumiv}, where +% \Lcount{enumN} controls the numbering of the Nth level +% enumeration. +% +% \begin{macro}{\theenumi} +% \begin{macro}{\theenumii} +% \begin{macro}{\theenumiii} +% \begin{macro}{\theenumiv} +% The counters are already defined in \file{latex.dtx}, but their +% representation is changed here. +% +% \begin{macrocode} +\renewcommand\theenumi{\@arabic\c@enumi} +\renewcommand\theenumii{\@alph\c@enumii} +\renewcommand\theenumiii{\@roman\c@enumiii} +\renewcommand\theenumiv{\@Alph\c@enumiv} +% \end{macrocode} +% \end{macro} +% \end{macro} +% \end{macro} +% \end{macro} +% +% \begin{macro}{\labelenumi} +% \begin{macro}{\labelenumii} +% \begin{macro}{\labelenumiii} +% \begin{macro}{\labelenumiv} +% The label for each item is generated by the four commands +% |\labelenumi| \ldots\ |\labelenumiv|. +% \changes{v2.3k}{1994/12/12}{Handle the \cs{label...} commands as in +% the other class files} +% \begin{macrocode} +\newcommand\labelenumi{\theenumi.} +\newcommand\labelenumii{(\theenumii)} +\newcommand\labelenumiii{\theenumiii.} +\newcommand\labelenumiv{\theenumiv.} +% \end{macrocode} +% \end{macro} +% \end{macro} +% \end{macro} +% \end{macro} +% +% \begin{macro}{\p@enumii} +% \begin{macro}{\p@enumiii} +% \begin{macro}{\p@enumiv} +% The expansion of |\p@enumN||\theenumN| defines the output of a +% |\ref| command when referencing an item of the Nth level of an +% enumerated list. +% \begin{macrocode} +\renewcommand\p@enumii{\theenumi} +\renewcommand\p@enumiii{\theenumi(\theenumii)} +\renewcommand\p@enumiv{\p@enumiii\theenumiii} +% \end{macrocode} +% \end{macro} +% \end{macro} +% \end{macro} +% +% \subsubsection{Itemize} +% +% +% \begin{macro}{\labelitemi} +% \begin{macro}{\labelitemii} +% \changes{v2.3x}{1996/08/25}{replaced -{}- with \cs{textendash}} +% \begin{macro}{\labelitemiii} +% \begin{macro}{\labelitemiv} +% Itemization is controlled by four commands: |\labelitemi|, +% |\labelitemii|, |\labelitemiii|, and |\labelitemiv|, which\ +% define the labels of the various itemization levels. +% \begin{macrocode} +\newcommand\labelitemi{$\m@th\bullet$} +\newcommand\labelitemii{\normalfont\bfseries \textendash} +\newcommand\labelitemiii{$\m@th\ast$} +\newcommand\labelitemiv{$\m@th\cdot$} +% \end{macrocode} +% \end{macro} +% \end{macro} +% \end{macro} +% \end{macro} +% +% \subsection{Setting parameters for existing environments} +% +% \subsubsection{Array and tabular} +% +% \begin{macro}{\arraycolsep} +% The columns in an array environment are separated by +% 2|\arraycolsep|.% Array and tabular environment parameters +% \begin{macrocode} +\setlength\arraycolsep{8\p@} +% \end{macrocode} +% \end{macro} +% +% \begin{macro}{\tabcolsep} +% The columns in an tabular environment are separated by +% 2|\tabcolsep|. +% \begin{macrocode} +\setlength\tabcolsep{10\p@} +% \end{macrocode} +% \end{macro} +% +% \begin{macro}{\arrayrulewidth} +% The width of rules in the array and tabular environments is given +% by the length parameter|\arrayrulewidth|. +% \begin{macrocode} +\setlength\arrayrulewidth{.6\p@} +% \end{macrocode} +% \end{macro} +% +% \begin{macro}{\doublerulesep} +% The space between adjacent rules in the array and tabular +% environments is given by |\doublerulesep|. +% \begin{macrocode} +\setlength\doublerulesep{3\p@} +% \end{macrocode} +% \end{macro} +% +% \subsubsection{Tabbing} +% +% \begin{macro}{\tabbingsep} +% This controls the space that the |\'| command puts in. (See +% \LaTeX{} manual for an explanation.) +% \begin{macrocode} +\labelsep 10pt +\setlength\tabbingsep{\labelsep} +% \end{macrocode} +% \end{macro} +% +% \subsubsection{Minipage} +% +% \begin{macro}{\@minipagerestore} +% The macro |\@minipagerestore| is called upon entry to a minipage +% environment to set up things that are to be handled differently +% inside a minipage environment. In the current styles, it does +% nothing. +% \end{macro} +% +% \begin{macro}{\@mpfootins} +% Minipages have their own footnotes; |\skip||\@mpfootins| plays +% same r\^ole for footnotes in a minipage as |\skip||\footins| does +% for ordinary footnotes. +% +% \begin{macrocode} +\skip\@mpfootins = \skip\footins +% \end{macrocode} +% \end{macro} +% +% \subsubsection{Framed boxes} +% +% \begin{macro}{\fboxsep} +% The space left by |\fbox| and |\framebox| between the box and the +% text in it. +% \begin{macro}{\fboxrule} +% The width of the rules in the box made by |\fbox| and |\framebox|. +% \begin{macrocode} +\setlength\fboxsep{5\p@} +\setlength\fboxrule{.6\p@} +% \end{macrocode} +% \end{macro} +% \end{macro} +% +% \begin{macro}{\theequation} +% The equation number will be typeset as arabic numerals. +% \begin{macrocode} +\def\theequation{\@arabic\c@equation} +% \end{macrocode} +% \end{macro} +% +% +% \begin{macro}{\jot} +% |\jot| is the extra space added between lines of an eqnarray +% environment. The default value is used. +% \begin{macrocode} +% \setlength\jot{3pt} +% \end{macrocode} +% \end{macro} +% +% \begin{macro}{\@eqnnum} +% The macro |\@eqnnum| defines how equation numbers are to appear in +% equations. Again the default is used. +% +% \begin{macrocode} +% \def\@eqnnum{(\theequation)} +% \end{macrocode} +% \end{macro} +% +% +% \subsection{Font changing} +% +% \changes{v2.3j}{1994/11/10}{fixed a few typos} +% +% Here we supply the declarative font changing commands that were +% common in \LaTeX\ version 2.09 and earlier. These commands work +% in text mode \emph{and} in math mode. They are provided for +% compatiblity, but one should start using the |\text...| and +% |\math...| commands instead. These commands are redefined using +% |\DeclareOldFontCommand|, a command with three arguments: the +% user command to be defined, \LaTeX\ commands to execute in text +% mode and \LaTeX\ commands to execute in math mode. +% +% \begin{macro}{\rm} +% \begin{macro}{\tt} +% \begin{macro}{\sf} +% \changes{v2.2}{1993/12/18}{Changed \cs{@newfontswitch} to +% \cs{@renewfontswitch}.} +% \changes{v2.3a}{1994/04/14}{\cs{@renewfontswitch} has become +% \cs{DeclareOldFontCommand}} +% +% The commands to change the family. When in compatibility mode we +% select the `default' font first, to get \LaTeX2.09 behaviour. +% \begin{macrocode} +\DeclareOldFontCommand{\rm}{\normalfont\rmfamily}{\mathrm} +\DeclareOldFontCommand{\sf}{\normalfont\sffamily}{\mathsf} +\DeclareOldFontCommand{\tt}{\normalfont\ttfamily}{\mathtt} +% \end{macrocode} +% \end{macro} +% \end{macro} +% \end{macro} +% +% \begin{macro}{\bf} +% The command to change to the bold series. One should use +% |\mdseries| to explicitly switch back to medium series. +% \changes{v2.2}{1993/12/18}{Changed \cs{@newfontswitch} to +% \cs{@renewfontswitch}.} +% \begin{macrocode} +\DeclareOldFontCommand{\bf}{\normalfont\bfseries}{\mathbf} +% \end{macrocode} +% \end{macro} +% +% \begin{macro}{\sl} +% \begin{macro}{\it} +% \begin{macro}{\sc} +% \changes{v2.2}{1993/12/18}{Changed \cs{@newfontswitch} to +% \cs{@renewfontswitch}.} +% And the commands to change the shape of the font. The slanted and +% small caps shapes are not available by default as math alphabets, +% so those changes do nothing in math mode. One should use +% |\upshape| to explicitly change back to the upright shape. +% \begin{macrocode} +\DeclareOldFontCommand{\it}{\normalfont\itshape}{\mathit} +\DeclareOldFontCommand{\sl}{\normalfont\slshape}{\relax} +\DeclareOldFontCommand{\sc}{\normalfont\scshape}{\relax} +% \end{macrocode} +% \end{macro} +% \end{macro} +% \end{macro} +% +% \begin{macro}{\cal} +% \changes{v2.1d}{1993/12/14}{Macro added} +% \begin{macro}{\mit} +% \changes{v2.1d}{1993/12/14}{Macro added} +% +% The commands |\cal| and |\mit| should only be used in math mode, +% outside math mode they have no effect. Currently the New Font +% Selection Scheme defines these commands to generate warning +% messages. Therefore we have to define them `by hand'. +% \changes{v2.3k}{1994/12/12}{Now define \cs{cal} and \cs{mit} using +% \cs{DeclareRobustCommand*}} +% \begin{macrocode} +\DeclareRobustCommand*{\cal}{\@fontswitch{\relax}{\mathcal}} +\DeclareRobustCommand*{\mit}{\@fontswitch{\relax}{\mathnormal}} +% \end{macrocode} +% \end{macro} +% \end{macro} +% +% \subsection{Footnotes} +% +% +% \begin{macro}{\footnoterule} +% Usually, footnotes are separated from the main body of the text +% by a small rule. This rule is drawn by the macro |\footnoterule|. +% We have to make sure that the rule takes no vertical space (see +% \file{plain.tex}). The resulting rule will appear on all color +% layers, so it's best not to draw a rule. +% \begin{macrocode} +\renewcommand\footnoterule{} +% \let \footnoterule = \relax +% \end{macrocode} +% \end{macro} +% +% \begin{macro}{\c@footnote} +% \begin{macro}{\thefootnote} +% Footnotes are numbered within slides, overlays, and notes and +% numbered with $\ast$, $\dagger$, etc. +% \begin{macrocode} +% \newcounter{footnote} +\def\thefootnote{\fnsymbol{footnote}} +\@addtoreset{footnote}{slide} +\@addtoreset{footnote}{overlay} +\@addtoreset{footnote}{note} +% \end{macrocode} +% \end{macro} +% \end{macro} +% +% +% \begin{macro}{\@makefntext} +% \changes{v2.2i}{1994/03/08}{Always call \cs{@makefnmark}.} +% The footnote mechanism of \LaTeX{} calls the macro |\@makefntext| +% to produce the actual footnote. The macro gets the text of the +% footnote as its argument and should use |\@makefnmark| to produce +% the mark of the footnote. The macro |\@makefntext| is called when +% effectively inside a |\parbox| of width |\columnwidth| (i.e., +% with |\hsize| = |\columnwidth|). +% +% An example of what can be achieved is given by the following piece +% of \TeX\ code. +% \begin{verbatim} +% \long\def\@makefntext#1{% +% \@setpar{\@@par +% \@tempdima = \hsize +% \advance\@tempdima-10pt +% \parshape \@ne 10pt \@tempdima}% +% \par +% \parindent 1em\noindent +% \hbox to \z@{\hss\@makefnmark}#1} +% \end{verbatim} +% The effect of this definition is that all lines of the footnote +% are indented by 10pt, while the first line of a new paragraph is +% indented by 1em. To change these dimensions, just substitute the +% desired value for `10pt' (in both places) or `1em'. The mark is +% flushright against the footnote. +% +% In these document classes we use a simpler macro, in which the +% footnote text is set like an ordinary text paragraph, with no +% indentation except on the first line of a paragraph, and the +% first line of the footnote. Thus, all the macro must do is set +% |\parindent| to the appropriate value for succeeding paragraphs +% and put the proper indentation before the mark. +% +% \begin{macrocode} +\long\def\@makefntext#1{ + \noindent + \hangindent 10\p@ + \hb@xt@10\p@{\hss\@makefnmark}#1} +% \end{macrocode} +% \end{macro} +% +% \begin{macro}{\@makefnmark} +% The footnote markers that are printed in the text to point to the +% footnotes should be produced by the macro |\@makefnmark|. We use +% the default definition for it. +% \begin{macrocode} +%\def\@makefnmark{\hbox{$^{\@thefnmark}\m@th$}} +% \end{macrocode} +% \end{macro} +% +% +% \subsection{The title} +% The commands |\title|, |\author|, and |\date| are already +% defined, so here we just define |\maketitle|. +% +% \changes{v2.3s}{1995/10/10}{Move \cs{par} inside the scope of +% \cs{Large}, to get even line spacing.} +% \begin{macrocode} +\newcommand\maketitle{{\centering {\Large \@title \par}% + \@author \par \@date\par}% + \if@titlepage \break \fi} +% \end{macrocode} + +% \section{Initialisation} +% +% \subsection{Date} +% +% \begin{macro}{\today} +% This macro uses the \TeX\ primitives |\month|, |\day| and |\year| +% to provide the date of the \LaTeX-run. +% \begin{macrocode} +\newcommand\today{\ifcase\month\or + January\or February\or March\or April\or May\or June\or + July\or August\or September\or October\or November\or December\fi + \space\number\day, \number\year} +% \end{macrocode} +% \end{macro} +% +% +% Default initializations +% +% \begin{macrocode} +\pagenumbering{arabic} +\onecolumn +% +% \end{macrocode} +% +% \subsection{Basic code} +% +% The code below is basically a copy of |slitex.tex| with some +% changes. +% +% Global changes so far: +% +% \changes{FMi}{1990/06/01}{\cs{gdef}\cs{@slidesw} ... replaced by a +% \cs{newifG} which is similar to \cs{newif} but uses \cs{global} +% inside.} +% +% +% \subsubsection{Hacks for slide macros} +% +% \begin{macrocode} +%<*cmd> +\message{hacks,} + +\outer\def\newifG#1{\count@\escapechar \escapechar\m@ne + \expandafter\expandafter\expandafter + \edef\@ifG#1{true}{\global\let\noexpand#1\noexpand\iftrue}% + \expandafter\expandafter\expandafter + \edef\@ifG#1{false}{\global\let\noexpand#1\noexpand\iffalse}% + \@ifG#1{false}\escapechar\count@} % the condition starts out false +\def\@ifG#1#2{\csname\expandafter\ifG@\string#1#2\endcsname} +{\uccode`1=`i \uccode`2=`f \uccode`3=`G \uppercase{\gdef\ifG@123{G}}} + % `ifG' is required + +\def\@gobbletoend#1{\def\@argend{#1}\@ggobtoend} + +\long\def\@ggobtoend#1\end#2{\fi\def\reserved@a{#2}% +\ifx\reserved@a\@argend\else\@ggobtoend\fi} +% \end{macrocode} +% FMi: I don't see any reason for this command since |\fi| is hidden +% anyway in the replacement text +% |\def\@xfi{\fi}| +% \begin{macrocode} + \message{slides,} +% \end{macrocode} +% +% \subsubsection{Slide macros} +% +% +% Switches:\\ +% \begin{tabular}{ll} +% |@bw| & true if making black and white slides \\ +% |@visible| & true if visible output to be produced.\\ +% |@makingslides| & true if making a slide/overlay/note +% \end{tabular} +% +% \begin{macrocode} +\newif\if@bw +\newif\if@visible +\newif\if@onlyslidesw \@onlyslideswfalse +\newif\if@onlynotesw \@onlynoteswfalse +\newif\if@makingslides +% \end{macrocode} +% FMi: |\newifG| replaces |\gdef\@slidesw{T}| stuff +% \begin{macrocode} +\newifG\ifG@slidesw +% \end{macrocode} +% Counters\\ +% \begin{tabular}{ll} +% slide & slide number\\ +% overlay & overlay number for a slide\\ +% note & note number for a slide +% \end{tabular} +% +% \begin{macrocode} +\countdef\c@slide=0 \c@slide=0 +\def\cl@slide{} +\countdef\c@overlay=1 \c@overlay=0 +\def\cl@overlay{} +\countdef\c@note=2 \c@note=0 +\def\cl@note{} +% \end{macrocode} +% Add these counters explicitly to the `ckpt list' so that the +% |\include| mechanism works. +% \changes{v2.3u}{1996/05/09}{Make include work: pr/2140(CAR)} +% \changes{v2.3y}{1997/05/09}{Make include work properly: add the +% counters in case some are already in there: pr/2140+2474(CAR)} +% \changes{v2.3v}{1996/05/11}{Do not add page counter here as it is +% added below(CAR)} +% \begin{macrocode} +\g@addto@macro\cl@@ckpt{\@elt{slide}\@elt{overlay}\@elt{note}} +\@addtoreset{overlay}{slide} +\@addtoreset{note}{slide} +% \end{macrocode} +% Redefine page counter to some other number. +% The page counter will always be zero except when putting out an +% extra page for a slide, note or overlay. +% \begin{macrocode} +\@definecounter{page} +\@addtoreset{page}{slide} +\@addtoreset{page}{note} +\@addtoreset{page}{overlay} + +\def\theslide{\@arabic\c@slide} +\def\theoverlay{\theslide-\@alph\c@overlay} +\def\thenote{\theslide-\@arabic\c@note} +% \end{macrocode} +% \begin{verbatim} +% \@setlimits \LIST \LOW \HIGH +% +% Assumes that \LIST = RANGE1,RANGE2,...,RANGEn (n>0) +% Where RANGEi = j or j-k. +% +% Then \@setlimits globally sets +% (i) \LIST := RANGE2, ... , RANGEn +% (ii) \LOW := p +% (iii) \HIGH := q +% where either RANGE1 = p-q or RANGE1 = p and q=p. +%\end{verbatim} +% \begin{macrocode} +\def\@sl@getargs#1-#2-#3\relax#4#5{\xdef#4{#1}\xdef#5{#2}} +\def\@sl@ccdr#1,#2\relax#3#4{\xdef#3{#1-#1-}\xdef#4{#2}} + +\def\@setlimits #1#2#3{\expandafter\@sl@ccdr#1\relax\@sl@gtmp #1% +\expandafter\@sl@getargs\@sl@gtmp\relax#2#3} +% \end{macrocode} +% \begin{verbatim} +% \onlyslides{LIST} ::= +% BEGIN +% @onlyslidesw := true +% \@doglslidelist :=G LIST,999999,999999 +% if @onlynotesw = true +% else @onlynotesw := true +% \@doglnotelist :=G LIST,999999,999999 +% fi +% message: Only Slides LIST +% END +%\end{verbatim} +% \begin{macrocode} +\def\onlyslides#1{\@onlyslideswtrue + \gdef\@doglslidelist{#1,999999,999999}% + \if@onlynotesw \else + \@onlynoteswtrue\gdef\@doglnotelist{999999,999999}\fi + \typeout{Only Slides #1}} +% \end{macrocode} +%\begin{verbatim} +% \onlynotes{LIST} ::= +% BEGIN +% @onlynotesw := true +% \@doglnotelist :=G LIST,999999,999999 +% if @onlyslidesw = true +% else \@onlyslidesw := true +% \@doglslidelist{999999,999999} +% fi +% message: Only Notes LIST +% END +%\end{verbatim} +% \begin{macrocode} +\def\onlynotes#1{\@onlynoteswtrue + \gdef\@doglnotelist{#1,999999,999999}% + \if@onlyslidesw \else + \@onlyslideswtrue\gdef\@doglslidelist{999999,999999}\fi + \typeout{Only Notes #1}} +% \end{macrocode} +%\begin{verbatim} +% \setupcounters ::= (similar to old \blackandwhite #1 ::= ) +% \newpage +% page counter := 0 +% @bw := T +% @visible := T +% if @onlyslidesw = true +% then \@doslidelist := \@doglslidelist +% \@setlimits\@doslidelist\@doslidelow\@doslidehigh +% fi +% if @onlynotesw = true +% then \@donotelist := \@doglnotelist +% \@setlimits\@donotelist\@donotelow\@donotehigh +% fi +% \normalsize % Note, this sets font to \rmfamily , which sets +% % \@currfont to \rmfamily +% counter slidenumber := 0 +% counter note := 0 +% counter overlay := 0 +% @makingslides := F %% \blackandwhite: @makingslides := T +% %% input #1 +% %% @makingslides := F +%\end{verbatim} +% \begin{macrocode} +\if@compatibility +% In compatibility mode, need to define \verb+\blackandwhite+, +% \verb+\colors+, \verb+\colorslides+, etc. +\def\blackandwhite#1{\newpage\setcounter{page}{0}\@bwtrue\@visibletrue +\if@onlyslidesw \xdef\@doslidelist{\@doglslidelist}% +\@setlimits\@doslidelist\@doslidelow\@doslidehigh\fi +\if@onlynotesw \xdef\@donotelist{\@doglnotelist}% +\@setlimits\@donotelist\@donotelow\@donotehigh\fi +\normalsize\setcounter{slide}{0}\setcounter{overlay}{0}% +\setcounter{note}{0}\@makingslidestrue\input #1\@makingslidesfalse} +% \end{macrocode} +%\begin{verbatim} +% \colors{COLORS} ::= +% for \@colortemp := COLORS +% do \csname \@colortemp \endcsname == \@color{\@colortemp} od +% if \@colorlist = empty +% then \@colorlist := COLORS +% else \@colorlist := \@colorlist , COLORS +% fi +%\end{verbatim} +% +% \begin{macrocode} +\def\colors#1{\@for\@colortemp:=#1\do{\expandafter + \xdef\csname\@colortemp\endcsname{\noexpand\@color{\@colortemp}}}\ifx + \@colorlist\@empty \gdef\@colorlist{#1}% + \else \xdef\@colorlist{\@colorlist,#1}\fi} + +\def\@colorlist{} +% \end{macrocode} +%\begin{verbatim} +% \colorslides{FILE} ::= +% \newpage +% page counter := 0 +% @bw := F +% for \@currcolor := \@colorlist +% do @visible := T +% if @onlyslidesw = true +% then \@doslidelist := \@doglslidelist +% \@setlimits\@doslidelist\@doslidelow\@doslidehigh +% fi +% if @onlynotesw = true +% then \@donotelist := \@doglnotelist +% \@setlimits\@donotelist\@donotelow\@donotehigh +% fi +% \normalsize +% counter slide := 0 +% counter overlay := 0 +% counter note := 0 +% type message +% generate color layer output page +% @makingslides := T +% input #1 +% @makingslides := F +% od +%\end{verbatim} +% \begin{macrocode} +\def\colorslides#1{\newpage\setcounter{page}{0}\@bwfalse +\@for\@currcolor:=\@colorlist\do +{\@visibletrue +\if@onlyslidesw \xdef\@doslidelist{\@doglslidelist}% +\@setlimits\@doslidelist\@doslidelow\@doslidehigh\fi +\if@onlynotesw \xdef\@donotelist{\@doglnotelist}% +\@setlimits\@donotelist\@donotelow\@donotehigh\fi +\normalsize\setcounter{slide}{0}\setcounter{overlay}{0}% +\setcounter{note}{0}\typeout{color \@currcolor}% +\newpage +\begin{huge}% +\begin{center}% +COLOR LAYER\\[.75in]% +\@currcolor +\end{center}% +\end{huge}% +\newpage +\@makingslidestrue +\input #1 +\@makingslidesfalse}} +% +\else %% if@compatibility +% +\def\setupcounters{\newpage\setcounter{page}{0}\@bwtrue\@visibletrue +\if@onlyslidesw \xdef\@doslidelist{\@doglslidelist}% +\@setlimits\@doslidelist\@doslidelow\@doslidehigh\fi +\if@onlynotesw \xdef\@donotelist{\@doglnotelist}% +\@setlimits\@donotelist\@donotelow\@donotehigh\fi +\normalsize\setcounter{slide}{0}\setcounter{overlay}{0}% +\setcounter{note}{0}\@makingslidesfalse} + +\AtBeginDocument{\setupcounters} +\fi %% if@compatibility +% \end{macrocode} +%\begin{verbatim} +% \slide COLORS ::= +% BEGIN +% \changes{v2.3}{1994/03/16}{Moved \cs{newpage} up front, here and in +% \cs{note} and \cs{overlay}} +% \par\break +% \stepcounter{slide} +% \setcounter{page}{0} % in case of non-slide pages +% \@slidesw :=G T +% if @onlyslidesw = true % set \@slidesw = T iff +% then % page to be output +% while \c@slide > \@doslidehigh +% do \@setlimits\@doslidelist\@doslidelow\@doslidehigh od +% if \c@slide < \@doslidelow +% then \@slidesw := F +% fi +% fi +% if \@slidesw = T +% then \@slidesw :=G F +% \begingroup +% if @bw = true +% then \@slidesw :=G T +% else \@color{COLORS} +% \if@visible then \@slidesw :=G T \fi +% fi +% \endgroup +% fi +% if \@slidesw = T +% then @makingslides := T +% \thispagestyle{slide} +% else \end{slide} +% \@gobbletoend{slide} +% fi +% END +% +% \endslide ::= +% BEGIN +% \par\break +% END +%\end{verbatim} +% \begin{macrocode} +\if@compatibility +\def\slide#1{\stepcounter{slide}\G@slideswtrue\if@onlyslidesw +\@whilenum \c@slide >\@doslidehigh\relax +\do{\@setlimits\@doslidelist\@doslidelow\@doslidehigh}\ifnum +\c@slide <\@doslidelow\relax\G@slideswfalse\fi\fi +\ifG@slidesw + \G@slideswfalse +% FMi this is only a hack at the moment to get things running. +% \begingroup + \if@bw\G@slideswtrue\else + \@color{#1}\if@visible \G@slideswtrue \fi + \fi +% \endgroup +\fi +\ifG@slidesw \newpage\thispagestyle{slide}% +% \end{macrocode} +% This will set up the last color specified in the argument to +% \verb+\slide+ as the current color. If only back and white slides +% are prepared \verb+\last@color+ will be empty and effectly +% \verb+\relax+ will be generated (hopefully). +% +% We need to reset to a default font at the beginning of a slide. +% (not done yet). +% \begin{macrocode} +\csname \last@color \endcsname +% \end{macrocode} +% \begin{macrocode} +\else\end{slide}\@gobbletoend{slide}\fi} +% +\else %% if@compatibility +% +\def\slide{\par\break +\stepcounter{slide}\setcounter{page}{0}\G@slideswtrue\if@onlyslidesw +\@whilenum \c@slide >\@doslidehigh\relax +\do{\@setlimits\@doslidelist\@doslidelow\@doslidehigh}\ifnum +\c@slide <\@doslidelow\relax\G@slideswfalse\fi\fi +\ifG@slidesw + \G@slideswfalse +% FMi this is only a hack at the moment to get things running. +% \begingroup + \if@bw\G@slideswtrue\else + \if@visible \G@slideswtrue \fi + \fi +% \endgroup +\fi +\ifG@slidesw \@makingslidestrue\thispagestyle{slide}% +% \end{macrocode} +% This will set up the last color specified in the argument to +% \verb+\slide+ as the current color. If only back and white slides +% are prepared \verb+\last@color+ will be empty and effectly +% \verb+\relax+ will be generated (hopefully). +% +% We need to reset to a default font at the beginning of a slide. +% (not done yet). +% \begin{macrocode} +\csname \last@color \endcsname +% \end{macrocode} +% \begin{macrocode} +\else\end{slide}\@gobbletoend{slide}\fi} +\fi %% if@compatibility + +\let\last@color\@empty + +\def\endslide{\par\break} +% \end{macrocode} +%\begin{verbatim} +% \overlay COLORS ::= +% BEGIN +% \par\break +% \stepcounter{overlay} +% \setcounter{page}{0} % in case of non-slide pages +% \@slidesw :=G T +% if @onlyslidesw = T % set \@slidesw = T iff +% then % page to be output +% if \c@slide < \@doslidelow +% then \@slidesw :=G F +% fi +% fi +% if \@slidesw = T +% \@slidesw :=G F +% \begingroup +% if @bw = true +% then \@slidesw :=G T +% else \@color{COLORS} +% \if@visible then \@slidesw :=G T \fi +% fi +% \endgroup +% fi +% if \@slidesw = T +% then @makingslides := T +% \thispagestyle{overlay} +% else \end{overlay} +% \@gobbletoend{overlay} +% fi +% END +% +% \endoverlay ::= +% BEGIN +% \par\break +% END +%\end{verbatim} +% \begin{macrocode} +\if@compatibility +\def\overlay#1{\stepcounter{overlay}\G@slideswtrue% +\if@onlyslidesw\ifnum \c@slide <\@doslidelow\relax +\G@slideswfalse\fi\fi +\ifG@slidesw \G@slideswfalse\begingroup\if@bw\G@slideswtrue% +\else\@color{#1}\if@visible \G@slideswtrue\fi\fi\endgroup\fi +\ifG@slidesw \newpage\thispagestyle{overlay}% +\else\end{overlay}\@gobbletoend{overlay}\fi} +% +\else %%if@compatibility +% +\def\overlay{\par\break + \stepcounter{overlay}% + \setcounter{page}{0}% + \G@slideswtrue% + \if@onlyslidesw\ifnum \c@slide <\@doslidelow\relax + \G@slideswfalse\fi\fi + \ifG@slidesw \G@slideswfalse + \begingroup\if@bw\G@slideswtrue% + \else\if@visible \G@slideswtrue\fi\fi + \endgroup\fi + \ifG@slidesw \@makingslidestrue\thispagestyle{overlay}% + \else\end{overlay}\@gobbletoend{overlay}\fi} +\fi %%if@compatibility + +\def\endoverlay{\par\break} +% \end{macrocode} +% +% \changes{v2.0d}{1993/11/12}{Removed extra blank.} +%\begin{verbatim} +% \note ::= +% BEGIN +% \par\break +% \stepcounter{note} +% \setcounter{page}{0} % in case of non-slide pages +% if @bw = T +% then +% \@slidesw :=G T +% if @onlynotesw = true % set \@notesw = T iff +% then % page to be output +% while \c@slide > \@donotehigh +% do \@setlimits\@donotelist\@donotelow\@donotehigh od +% if \c@slide < \@donotelow +% then \@slidesw :=G F +% fi +% fi +% else \@slidesw :=G F +% fi +% if \@slidesw = T +% then @makingslides := T +% \thispagestyle{note} +% else \end{note} +% \@gobbletoend{note} +% fi +% END +% +% \endnote ::= +% BEGIN +% \par\break +% END +%\end{verbatim} +% \begin{macrocode} +\if@compatibility +\def\note{\stepcounter{note}% + \if@bw + \G@slideswtrue + \if@onlynotesw\@whilenum \c@slide >\@donotehigh\relax + \do{\@setlimits\@donotelist\@donotelow\@donotehigh}\ifnum + \c@slide <\@donotelow\relax \G@slideswfalse\fi\fi + \else\G@slideswfalse\fi + \ifG@slidesw \newpage\thispagestyle{note}\else + \end{note}\@gobbletoend{note}\fi} +% +\else %%if@compatibility +% +\def\note{\par\break\stepcounter{note}\setcounter{page}{0}% + \if@bw + \G@slideswtrue + \if@onlynotesw\@whilenum \c@slide >\@donotehigh\relax + \do{\@setlimits\@donotelist\@donotelow\@donotehigh}\ifnum + \c@slide <\@donotelow\relax \G@slideswfalse\fi\fi + \else\G@slideswfalse\fi + \ifG@slidesw \@makingslidestrue\thispagestyle{note}\else + \end{note}\@gobbletoend{note}\fi} +\fi %%if@compatibility + +\def\endnote{\par\break} +% \end{macrocode} +%\begin{verbatim} +% \@color{COLORS} ::= +% BEGIN +% if math mode +% then type warning +% fi +% if @bw +% then \visible +% else \invisible +% for \last@color := COLORS +% do if \last@color = \@currcolor +% then \visible +% fi +% od +% fi +% \ignorespaces +% END +%\end{verbatim} +% FMi: |\last@color| will be used in |\slide| to set up first +% color if no color is given. +% I suppose that this is much too complicated. |\else\@tempswafalse| +% would produce the same effect I imagine. +% \begin{macrocode} +\def\@color#1{\@mmodetest + {\if@bw \@tempswatrue \else \@tempswafalse + \@for \reserved@a :=#1\do{\ifx\reserved@a\@currcolor\@tempswatrue\fi + \let\last@color\reserved@a}\fi + \if@tempswa \visible \else \invisible \fi + \ignorespaces}} + +\def\@mmodetest#1{\ifmmode\ClassWarning{slides}{Color-changing command + in math mode has been ignored}\else #1\fi} + +\def\invisible{\@mmodetest + {\if@visible + \@visiblefalse + \fontshape\f@shape\selectfont + \mathversion{invisible}% + \fi + \ignorespaces}} + +\def\visible{\@mmodetest + {\if@visible + \else + \@visibletrue +% \end{macrocode} +% Here is the \LaTeXe{} interface hidden. We use a trick to provide +% ourselves with a sort of additional attribute without making the +% current mechanism even larger. The trick is that we denote +% invisible by putting an uppercase |I| in front of the shape name +% for invisible shapes and remove it again if we want to become +% visible. +% \begin{macrocode} + \fontshape{\expandafter\@gobble\f@shape}\selectfont + \mathversion{normal}% + \fi + \ignorespaces}} + +\def\fontshape#1{\edef\f@shape{\if@visible \else I\fi #1}} +% \end{macrocode} +% +% \subsection{Macros for font handling} +% +% We let |\familydefault| point at |\sfdefault|, to make it easier +% to use the document class slides with packages that set up other +% fonts. +% \begin{macrocode} +\renewcommand{\familydefault}{\sfdefault} +% \end{macrocode} +% +% \changes{v2.3l}{1994/12/16}{Added the declaration of the lasy font +% family} +% The \texttt{latexsym} package, which is needed to be able to access +% the \LaTeX\ symbol fonts (lasy), sets things up so that for sizes +% larger then 10 point magnifications of \texttt{lasy10} are +% used. For slides we want to use magnifications of \texttt{lasy8}, +% so we set up the lasy family here to prevent \LaTeX\ from loading +% \texttt{Ulasy.fd}. +% \begin{macrocode} +\DeclareFontFamily{U}{lasy}{}{} +\DeclareFontShape{U}{lasy}{m}{n}{% + <12><13.82><16.59><19.907><23.89><28.66><34.4><41.28>lasy8 +}{} +\DeclareFontShape{U}{lasy}{m}{In}{% + <13.82><16.59><19.907><23.89><28.66><34.4><41.28>ilasy8 +}{} +% \end{macrocode} +% +% \begin{macrocode} +\message{picture,} +% \end{macrocode} +% +% \subsubsection{Modifications to the picture environment} +% +% Below are the new definitions of the picture-drawing macros +% required for SLiTeX. Only those commands that actually +% draw something must be changed so that they do not produce +% any output when the |@visible| switch is false. +% +% \changes{v2.2j}{1994/03/11}{Corrected \cs{@oval}, like previous +% change to \file{latex.dtx}.} +% \begin{macrocode} +\def\line(#1,#2)#3{\if@visible\@xarg #1\relax \@yarg #2\relax +\@linelen #3\unitlength +\ifnum\@xarg =\z@ \@vline + \else \ifnum\@yarg =\z@ \@hline \else \@sline\fi +\fi\fi} + +\def\vector(#1,#2)#3{\if@visible\@xarg #1\relax \@yarg #2\relax +\@linelen #3\unitlength +\ifnum\@xarg =\z@ \@vvector + \else \ifnum\@yarg =\z@ \@hvector \else \@svector\fi +\fi\fi} + +\def\dashbox#1(#2,#3){% +\leavevmode\if@visible\hb@xt@\z@{\baselineskip \z@ +\lineskip \z@ +\@dashdim #2\unitlength +\@dashcnt \@dashdim \advance\@dashcnt 200 +\@dashdim #1\unitlength\divide\@dashcnt \@dashdim +\ifodd\@dashcnt\@dashdim\z@ +\advance\@dashcnt \@ne \divide\@dashcnt \tw@ +\else \divide\@dashdim \tw@ \divide\@dashcnt \tw@ +\advance\@dashcnt \m@ne +\setbox\@dashbox \hbox{\vrule \@height \@halfwidth \@depth \@halfwidth +\@width \@dashdim}\put(0,0){\copy\@dashbox}% +\put(0,#3){\copy\@dashbox}% +\put(#2,0){\hskip-\@dashdim\copy\@dashbox}% +\put(#2,#3){\hskip-\@dashdim\box\@dashbox}% +\multiply\@dashdim \thr@@ +\fi +\setbox\@dashbox \hbox{\vrule \@height \@halfwidth \@depth \@halfwidth +\@width #1\unitlength\hskip #1\unitlength}\@tempcnta\z@ +\put(0,0){\hskip\@dashdim \@whilenum \@tempcnta <\@dashcnt +\do{\copy\@dashbox\advance\@tempcnta \@ne }}\@tempcnta\z@ +\put(0,#3){\hskip\@dashdim \@whilenum \@tempcnta <\@dashcnt +\do{\copy\@dashbox\advance\@tempcnta \@ne }}% +\@dashdim #3\unitlength +\@dashcnt=\@dashdim \advance\@dashcnt 200 +\@dashdim #1\unitlength\divide\@dashcnt \@dashdim +\ifodd\@dashcnt \@dashdim=\z@ +\advance\@dashcnt \@ne \divide\@dashcnt \tw@ +\else +\divide\@dashdim \tw@ \divide\@dashcnt \tw@ +\advance\@dashcnt \m@ne +\setbox\@dashbox\hbox{\hskip -\@halfwidth +\vrule \@width \@wholewidth +\@height \@dashdim}\put(0,0){\copy\@dashbox}% +\put(#2,0){\copy\@dashbox}% +\put(0,#3){\lower\@dashdim\copy\@dashbox}% +\put(#2,#3){\lower\@dashdim\copy\@dashbox}% +\multiply\@dashdim \thr@@ +\fi +\setbox\@dashbox\hbox{\vrule \@width \@wholewidth +\@height #1\unitlength}\@tempcnta\z@ +\put(0,0){\hskip -\@halfwidth \vbox{\@whilenum \@tempcnta <\@dashcnt +\do{\vskip #1\unitlength\copy\@dashbox\advance\@tempcnta \@ne }% +\vskip\@dashdim}}\@tempcnta\z@ +\put(#2,0){\hskip -\@halfwidth \vbox{\@whilenum \@tempcnta <\@dashcnt +\relax\do{\vskip #1\unitlength\copy\@dashbox\advance\@tempcnta \@ne }% +\vskip\@dashdim}}}\fi\@makepicbox(#2,#3)} + +\def\@oval(#1,#2)[#3]{\if@visible\begingroup \boxmaxdepth \maxdimen + \@ovttrue \@ovbtrue \@ovltrue \@ovrtrue + \@tfor\reserved@a :=#3\do + {\csname @ov\reserved@a false\endcsname}\@ovxx + #1\unitlength \@ovyy #2\unitlength + \@tempdimb \ifdim \@ovyy >\@ovxx \@ovxx\else \@ovyy \fi + \advance \@tempdimb -2\p@ + \@getcirc \@tempdimb + \@ovro \ht\@tempboxa \@ovri \dp\@tempboxa + \@ovdx\@ovxx \advance\@ovdx -\@tempdima \divide\@ovdx \tw@ + \@ovdy\@ovyy \advance\@ovdy -\@tempdima \divide\@ovdy \tw@ + \@circlefnt \setbox\@tempboxa + \hbox{\if@ovr \@ovvert32\kern -\@tempdima \fi + \if@ovl \kern \@ovxx \@ovvert01\kern -\@tempdima \kern -\@ovxx \fi + \if@ovt \@ovhorz \kern -\@ovxx \fi + \if@ovb \raise \@ovyy \@ovhorz \fi}\advance\@ovdx\@ovro + \advance\@ovdy\@ovro \ht\@tempboxa\z@ \dp\@tempboxa\z@ + \@put{-\@ovdx}{-\@ovdy}{\box\@tempboxa}% + \endgroup\fi} + +\def\@circle#1{\if@visible \begingroup \boxmaxdepth \maxdimen + \@tempdimb #1\unitlength + \ifdim \@tempdimb >15.5\p@\relax \@getcirc\@tempdimb + \@ovro\ht\@tempboxa + \setbox\@tempboxa\hbox{\@circlefnt + \advance\@tempcnta\tw@ \char \@tempcnta + \advance\@tempcnta\m@ne \char \@tempcnta \kern -2\@tempdima + \advance\@tempcnta\tw@ + \raise \@tempdima \hbox{\char\@tempcnta}\raise \@tempdima + \box\@tempboxa}\ht\@tempboxa\z@ \dp\@tempboxa\z@ + \@put{-\@ovro}{-\@ovro}{\box\@tempboxa}% + \else \@circ\@tempdimb{96}\fi\endgroup\fi} + +% \end{macrocode} +% +% \changes{v2.0d}{1993/11/12}{Removed extra blank.} +% \begin{macrocode} +\def\@dot#1{% + \if@visible\@tempdimb #1\unitlength \@circ\@tempdimb{112}\fi} +% \end{macrocode} +% \changes {v2.3m}{1994/03/20}{(DPC) Remove old \cs{@iframebox} and +% \cs{fbox} defn} +% \changes {v2.3m}{1994/03/20}{(DPC) Add \cs{@frameb@x} defn.} +% \begin{macrocode} +\def\@frameb@x#1{% + \@tempdima\fboxrule + \advance\@tempdima\fboxsep + \advance\@tempdima\dp\@tempboxa + \leavevmode + \hbox{% + \lower\@tempdima\hbox{% + \vbox{% + \if@visible\hrule\@height\else\vskip\fi\fboxrule + \hbox{% + \if@visible\vrule\@width\else\hskip\fi\fboxrule + #1% + \vbox{% + \vskip\fboxsep + \box\@tempboxa + \vskip\fboxsep}% + #1% + \if@visible\vrule\@width\else\hskip\fi\fboxrule}% + \if@visible\hrule\@height\else\vskip\fi\fboxrule}}}} + +% \end{macrocode} +% +% \begin{macrocode} +\long\def\frame#1{\if@visible\leavevmode +\vbox{\vskip-\@halfwidth\hrule \@height\@halfwidth \@depth \@halfwidth + \vskip-\@halfwidth\hbox{\hskip-\@halfwidth \vrule \@width\@wholewidth + \hskip-\@halfwidth #1\hskip-\@halfwidth \vrule \@width \@wholewidth + \hskip -\@halfwidth}\vskip -\@halfwidth\hrule \@height \@halfwidth + \@depth \@halfwidth\vskip -\@halfwidth}\else #1\fi} +% \end{macrocode} +% +% \changes{v2.0d}{1993/11/12}{Corrected \cs{@math} to \cs{m@th} in +% definition of \cs{underline}.} +% +% \begin{macrocode} +\message{mods,} +% \end{macrocode} +% +% +% \subsubsection{Other modifications to \TeX{} and \LaTeX{} commands} +% +% |\rule| +% \begin{macrocode} +\def\@rule[#1]#2#3{\@tempdima#3\advance\@tempdima #1\leavevmode + \hbox{\if@visible\vrule + \@width#2 \@height\@tempdima \@depth-#1\else +\vrule \@width \z@ \@height\@tempdima \@depth-#1\vrule + \@width#2 \@height\z@\fi}} + +% \_ (Added 10 Nov 86) + +\def\_{\leavevmode \kern.06em \if@visible\vbox{\hrule \@width.3em}\else + \vbox{\hrule \@height \z@ \@width.3em}\vbox{\hrule \@width \z@}\fi} +% \end{macrocode} +%\begin{verbatim} +% \overline, \underline, \frac and \sqrt +% +% \@mathbox{STYLE}{BOX}{MTEXT} : Called in math mode, typesets MTEXT and +% stores result in BOX, using style STYLE. +% +% \@bphant{BOX} : Creates a phantom with dimensions BOX. +% \@vbphant{BOX} : Creates a phantom with ht of BOX and zero width. +% \@hbphant{BOX} : Creates a phantom with width of BOX +% and zero ht & dp. +% \@hvsmash{STYLE}{MTEXT} : Creates a copy of MTEXT with zero height and +% width in style STYLE. +%\end{verbatim} +% \begin{macrocode} +\def\@mathbox#1#2#3{\setbox#2\hbox{$\m@th#1{#3}$}} + +\def\@vbphantom#1{\setbox\tw@\null \ht\tw@\ht #1\dp\tw@\dp #1% + \box\tw@} + +\def\@bphantom#1{\setbox\tw@\null + \wd\tw@\wd #1\ht\tw@\ht #1\dp\tw@\dp #1% + \box\tw@} + +\def\@hbphantom#1{\setbox\tw@\null \wd\tw@\wd #1\ht\tw@\z@ \dp\tw@\z@ + \box\tw@} + +\def\@hvsmash#1#2{\@mathbox#1\z@{#2}\ht\z@\z@ \dp\z@\z@ \wd\z@\z@ + \box\z@} + +\def\underline#1{\relax\ifmmode + \@xunderline{#1}\else $\m@th\@xunderline{\hbox{#1}}$\relax\fi} + +\def\@xunderline#1{\mathchoice{\@xyunderline\displaystyle{#1}}% + {\@xyunderline + \textstyle{#1}}{\@xyunderline\scriptstyle{#1}}{\@xyunderline + \scriptscriptstyle{#1}}} + +\def\@xyunderline#1#2{% + \@mathbox#1\@smashboxa{#2}\@hvsmash#1{\copy\@smashboxa}% + \if@visible \@hvsmash#1{\@@underline{\@bphantom\@smashboxa}}\fi + \@mathbox#1\@smashboxb{\@@underline{\box\@smashboxa}}% + \@bphantom\@smashboxb} + +\let\@@overline=\overline + +\def\overline#1{\mathchoice{\@xoverline\displaystyle{#1}}{\@xoverline + \textstyle{#1}}{\@xoverline\scriptstyle{#1}}{\@xoverline + \scriptscriptstyle{#1}}} + +\def\@xoverline#1#2{% + \@mathbox#1\@smashboxa{#2}\@hvsmash#1{\copy\@smashboxa}% + \if@visible \@hvsmash#1{\@@overline{\@bphantom\@smashboxa}}\fi + \@mathbox#1\@smashboxb{\@@overline{\box\@smashboxa}}% + \@bphantom\@smashboxb} +% \end{macrocode} +% +% \changes{v2.0b}{1993/04/14}{Corrected \cs{frac} command.} +% \changes{v2.0d}{1993/11/12}{Removed \cs{vcenter} in \cs{@frac}.} +% +%\begin{verbatim} +% \@frac {STYLE}{DENOMSTYLE}{NUM}{DEN}{FONTSIZE} : +% Creates \frac{NUM}{DENOM} +% in style STYLE with NUM and DENOM in style DENOMSTYLE +% FONTSIZE should be \textfont \scriptfont or \scriptscriptfont +%\end{verbatim} +% Added a group around the first argument of |\frac| to prevent +% changes (for example font changes) to modify the contents of the +% second argument. +% \changes{v2.1c}{1993/12/13}{Added group around first arg.} +% \begin{macrocode} +\def\frac#1#2{\mathchoice + {\@frac\displaystyle\textstyle{#1}{#2}\textfont}{\@frac + \textstyle\scriptstyle{#1}{#2}\textfont}{\@frac + \scriptstyle\scriptscriptstyle{#1}{#2}\scriptfont}{\@frac + \scriptscriptstyle\scriptscriptstyle{#1}{#2}\scriptscriptfont}} + +\def\@frac#1#2#3#4#5{% + \@mathbox#1\@smashboxc{{\begingroup#3\endgroup\over#4}}% + \setbox\tw@\null + \ht\tw@ \ht\@smashboxc + \dp\tw@ \dp\@smashboxc + \wd\tw@ \wd\@smashboxc + \box\if@visible\@smashboxc\else\tw@\fi} + +\def\r@@t#1#2{\setbox\z@\hbox{$\m@th#1\@xysqrt#1{#2}$}% + \dimen@\ht\z@ \advance\dimen@-\dp\z@ + \mskip5mu\raise.6\dimen@\copy\rootbox \mskip-10mu\box\z@} +% \end{macrocode} +% \changes{v2.3w}{1996/05/15}{Removed use of obsolete command +% \cs{@@sqrt} (CAR)} +% \begin{macrocode} +\def\sqrt{\@ifnextchar[{\@sqrt}{\@xsqrt}} +\def\@sqrt[#1]{\root #1\of} +\def\@xsqrt#1{\mathchoice{\@xysqrt\displaystyle{#1}}{\@xysqrt + \textstyle{#1}}{\@xysqrt\scriptstyle{#1}}{\@xysqrt + \scriptscriptstyle{#1}}} +\def\@xysqrt#1#2{\@mathbox#1\@smashboxa{#2}\if@visible + \@hvsmash#1{\sqrtsign{\@bphantom\@smashboxa}}\fi + \phantom{\sqrtsign{\@vbphantom\@smashboxa}}\box\@smashboxa} + +\newbox\@smashboxa +\newbox\@smashboxb +\newbox\@smashboxc +% \end{macrocode} +% +% array and tabular environments: changes to `\verb+|+', |\hline|, +% |\cline|, and |\vline|, +% added 8 Jun 88 +% \begin{macrocode} +\def\@arrayrule{\if@visible\@addtopreamble{\hskip -.5\arrayrulewidth + \vrule \@width \arrayrulewidth\hskip -.5\arrayrulewidth}\fi} +% \end{macrocode} +% +% \changes{v2.3t}{1996/01/31}{Change in \cs{cline} calling interface} +% \begin{macrocode} +\def\cline#1{\if@visible\@cline#1\@nil\fi} + +\def\hline{\noalign{\ifnum0=`}\fi + \if@visible \hrule \@height \arrayrulewidth + \else \hrule \@width \z@ + \fi + \futurelet \reserved@a\@xhline} + +\def\vline{\if@visible \vrule \@width \arrayrulewidth + \else \vrule \@width \arrayrulewidth \@height \z@ + \@depth \z@ \fi} +% \end{macrocode} +% +% \begin{macrocode} +\message{output,} +% \end{macrocode} +% +% \subsubsection{Changes to \LaTeX{} output routine} +% +%\begin{verbatim} +% \@makecol == +% BEGIN +% % Following test added for slides to check if extra page +% if @makingslides = T +% then if \c@page > 0 +% then if \c@note > 0 +% then type 'Note \thenote too long.' +% else if \c@overlay > 0 +% then type 'Overlay \theoverlay too long.' +% else type 'Slide \theslide too long' +% fi fi fi fi +% ifvoid \insert\footins +% then \@outputbox := \box255 +% else \@outputbox := \vbox {\unvbox255 +% \vskip \skip\footins +% \footnoterule +% \unvbox\@footinsert +% } +% fi +% \@freelist :=G \@freelist * \@midlist +% \@midlist :=G empty +% \@combinefloats +% \@outputbox := \vbox to \@colht{\boxmaxdepth := \maxdepth +% \vfil %%\vfil added for slides +% \unvbox\@outputbox +% \vfil } %%\vfil added for slides +% \maxdepth :=G \@maxdepth +% END +%\end{verbatim} +% FMi simple hack to allow none centered slides Should be revised +% of course. +% \begin{macrocode} +\let\@topfil\vfil + +\def\@makecol{\if@makingslides\ifnum\c@page>\z@ \@extraslide\fi\fi +\ifvoid\footins \setbox\@outputbox\box\@cclv \let\@botfil\vfil + \else\let\@botfil\relax\setbox\@outputbox + \vbox{\unvbox\@cclv\vfil + \vskip\skip\footins\footnoterule\unvbox\footins\vskip + \z@ plus.1fil\relax}\fi + \xdef\@freelist{\@freelist\@midlist}\gdef\@midlist{}\@combinefloats + \setbox\@outputbox\vbox to\@colht{\boxmaxdepth\maxdepth + \@topfil\unvbox\@outputbox\@botfil}\global\maxdepth\@maxdepth} + +\def\@extraslide{\ifnum\c@note>\z@ + \ClassWarning{slides}{Note \thenote\space too long}\else + \ifnum\c@overlay>\z@ + \ClassWarning{slides}{Overlay \theoverlay\space too long}\else + \ClassWarning{slides}{Slide \theslide\space too long}\fi\fi} +% \end{macrocode} +% +% \begin{macrocode} +\message{init} +% \end{macrocode} +% +% +% \subsubsection{Special \SLiTeX{} initializations} +% +%FMi why not allow for ref's ? +% \begin{macrocode} +% \nofiles + +\@visibletrue +% +% \end{macrocode} +% +% +% \Finale +% +\endinput diff --git a/Master/texmf-dist/source/latex/base/slides.ins b/Master/texmf-dist/source/latex/base/slides.ins new file mode 100644 index 00000000000..753528f9f29 --- /dev/null +++ b/Master/texmf-dist/source/latex/base/slides.ins @@ -0,0 +1,197 @@ +%% +%% This file will generate fast loadable files and documentation +%% driver files from the doc files in this package when run through +%% LaTeX or TeX. +%% +%% Copyright 1993 1994 1995 1996 1997 1998 1999 2000 2001 2002 2003 2004 +%% The LaTeX3 Project and any individual authors listed elsewhere +%% in this file. +%% +%% This file is part of the LaTeX base system. +%% ------------------------------------------- +%% +%% It may be distributed and/or modified under the +%% conditions of the LaTeX Project Public License, either version 1.3 +%% of this license or (at your option) any later version. +%% The latest version of this license is in +%% http://www.latex-project.org/lppl.txt +%% and version 1.3 or later is part of all distributions of LaTeX +%% version 2003/12/01 or later. +%% +%% This file has the LPPL maintenance status "maintained". +%% +%% In particular, NO PERMISSION is granted to modify the contents of this +%% file since it contains the legal notices that are placed in the files +%% it generates. +%% +%% The list of all files belonging to the LaTeX base distribution is +%% given in the file `manifest.txt'. See also `legal.txt' for additional +%% information. +%% +%% +%% +%% +%% --------------- start of docstrip commands ------------------ +%% + +\input docstrip + +\preamble + +This is a generated file. + +Copyright 1993 1994 1995 1996 1997 1998 1999 2000 2001 2002 2003 2004 +The LaTeX3 Project and any individual authors listed elsewhere +in this file. + +This file was generated from file(s) of the LaTeX base system. +-------------------------------------------------------------- + +It may be distributed and/or modified under the +conditions of the LaTeX Project Public License, either version 1.3 +of this license or (at your option) any later version. +The latest version of this license is in + http://www.latex-project.org/lppl.txt +and version 1.3 or later is part of all distributions of LaTeX +version 2003/12/01 or later. + +This file has the LPPL maintenance status "maintained". + +This file may only be distributed together with a copy of the LaTeX +base system. You may however distribute the LaTeX base system without +such generated files. + +The list of all files belonging to the LaTeX base distribution is +given in the file `manifest.txt'. See also `legal.txt' for additional +information. + +The list of derived (unpacked) files belonging to the distribution +and covered by LPPL is defined by the unpacking scripts (with +extension .ins) which are part of the distribution. +\endpreamble + +\keepsilent +\usedir{tex/latex/base} + +\Msg{*** Generating slide cmd files and styles ***} + +\generate{ + \file{slides.cls}{ + \from{slides.dtx}{class}} + \file{slides.def}{ + \from{slides.dtx}{cmd}} + } + +\Msg{*** Generating default fonts setup file for slides ***} + +\preamble + +This is a generated file. + +Copyright 1993 1994 1995 1996 1997 1998 1999 2000 2001 2002 2003 2004 +The LaTeX3 Project and any individual authors listed elsewhere +in this file. + +This file was generated from file(s) of the LaTeX base system. +-------------------------------------------------------------- + +It may be distributed and/or modified under the +conditions of the LaTeX Project Public License, either version 1.3 +of this license or (at your option) any later version. +The latest version of this license is in + http://www.latex-project.org/lppl.txt +and version 1.3 or later is part of all distributions of LaTeX +version 2003/12/01 or later. + +This file may only be distributed together with a copy of the LaTeX +base system. You may however distribute the LaTeX base system without +such generated files. + +The list of all files belonging to the LaTeX base distribution is +given in the file `manifest.txt'. See also `legal.txt' for additional +information. + +Details of how to use a configuration file to modify this part of +the system are in the document `cfgguide.tex'. + + +\endpreamble + + + +\Msg{*** Generating .fd files ***} + +\declarepreamble\fdpreamble + +This is a generated file. + +Copyright 1993 1994 1995 1996 1997 1998 1999 2000 2001 2002 2003 2004 +The LaTeX3 Project and any individual authors listed elsewhere +in this file. + +This file was generated from file(s) of the LaTeX base system. +-------------------------------------------------------------- + +It may be distributed and/or modified under the +conditions of the LaTeX Project Public License, either version 1.3 +of this license or (at your option) any later version. +The latest version of this license is in + http://www.latex-project.org/lppl.txt +and version 1.3 or later is part of all distributions of LaTeX +version 2003/12/01 or later. + +This file may only be distributed together with a copy of the LaTeX +base system. You may however distribute the LaTeX base system without +such generated files. + +The list of all files belonging to the LaTeX base distribution is +given in the file `manifest.txt'. See also `legal.txt' for additional +information. + +In particular, permission is granted to customize the declarations in +this file to serve the needs of your installation. + +However, NO PERMISSION is granted to distribute a modified version +of this file under its original name. + +\endpreamble + +\usedir{tex/latex/base} + +\generate{ + \file{sfonts.def}{ + \from{slifonts.fdd}{main}} + \usepreamble\fdpreamble % change of preamble ! + \file{ot1lcmss.fd}{ + \from{slifonts.fdd}{lcmss,fd}} + \file{ot1lcmtt.fd}{ + \from{slifonts.fdd}{lcmtt,fd}} + \file{omllcmm.fd}{ + \from{slifonts.fdd}{lcmm,fd}} + \file{omslcmsy.fd}{ + \from{slifonts.fdd}{lcmsy,fd}} + \file{omxlcmex.fd}{ + \from{slifonts.fdd}{lcmex,fd}} + \file{ullasy.fd}{ + \from{slifonts.fdd}{llasy,fd}} + } + + +\ifToplevel{ +\Msg{***********************************************************} +\Msg{*} +\Msg{* To finish the installation you have to move the following} +\Msg{* files into a directory searched by TeX:} +\Msg{*} +\Msg{* \space\space All *.fd} +\Msg{* \space\space All *.def} +\Msg{* \space\space slides.cls} +\Msg{*} +\Msg{* To produce the documentation run the files ending with} +\Msg{* `.drv' through LaTeX.} +\Msg{*} +\Msg{* Happy TeXing} +\Msg{***********************************************************} +} + +\endbatchfile diff --git a/Master/texmf-dist/source/latex/base/slifonts.fdd b/Master/texmf-dist/source/latex/base/slifonts.fdd new file mode 100644 index 00000000000..a3e3f3f1971 --- /dev/null +++ b/Master/texmf-dist/source/latex/base/slifonts.fdd @@ -0,0 +1,485 @@ +% \iffalse meta-comment +% +% Copyright 1993 1994 1995 1996 1997 1998 1999 2000 2001 2002 2003 2004 +% The LaTeX3 Project and any individual authors listed elsewhere +% in this file. +% +% This file is part of the LaTeX base system. +% ------------------------------------------- +% +% It may be distributed and/or modified under the +% conditions of the LaTeX Project Public License, either version 1.3 +% of this license or (at your option) any later version. +% The latest version of this license is in +% http://www.latex-project.org/lppl.txt +% and version 1.3 or later is part of all distributions of LaTeX +% version 2003/12/01 or later. +% +% This file has the LPPL maintenance status "maintained". +% +% The list of all files belonging to the LaTeX base distribution is +% given in the file `manifest.txt'. See also `legal.txt' for additional +% information. +% +% The list of derived (unpacked) files belonging to the distribution +% and covered by LPPL is defined by the unpacking scripts (with +% extension .ins) which are part of the distribution. +% +% \fi +% +%\iffalse This is a META comment +% +% File `slifonts.fdd'. +% Copyright (C) 1989-1998 LaTeX3 project, Frank Mittelbach and +% Rainer Sch\"opf, all rights reserved. +% +%\ProvidesFile{ot1lcmss.fd} +%\ProvidesFile{ot1lcmtt.fd} +%\ProvidesFile{t1lcmss.fd} +%\ProvidesFile{t1lcmtt.fd} +%\ProvidesFile{omllcmm.fd} +%\ProvidesFile{omslcmsy.fd} +%\ProvidesFile{omxlcmex.fd} +%\ProvidesFile{ullasy.fd} +%\ProvidesFile{sfonts.def} +%<*driver, > + \ProvidesFile{sfonts.drv} +% + [1998/06/12 v2.2e Standard LaTeX slide font definitions] +% +%<*driver> +\documentclass{ltxdoc} +\GetFileInfo{sfonts.drv} +\providecommand\dst{\expandafter{\normalfont\scshape docstrip}} +\title{The file \texttt{slifonts.fdd} for use with + \LaTeXe.\thanks{This file has version + number \fileversion, dated \filedate.}} +\date{\filedate} +\author{Frank Mittelbach \and Rainer Sch\"opf} +\begin{document} +\maketitle + \DocInput{slifonts.fdd} +\end{document} +% +% +%\fi +% +% \CheckSum{78} +% +% +% \changes{v2.2c}{1997/05/26}{Removed spaces in and around arguments +% to \cs{DeclareFontShape} and \cs{EC@family}.} +% \changes{v2.2a}{1997/01/15} +% {ec font support added} +% \changes{v2.1m}{1996/11/20} +% {lowercase fd filenames /1044} +% \changes{v2.1l}{1996/05/17} +% {Force \cs{hyphenchar} of OT1 fonts to 45, in case +% \cs{defaulthyphenchar} has changed.} +% \changes{v2.1l}{1996/05/17} +% {Remove some spurious extra empty arguments to +% \cs{DeclareFontFamily} calls} +% \changes{v2.1j}{1995/09/27}{Globally replaced scale factor 19.91 by +% 19.907 in \cs{DeclareFontShape}, as this gives better +% rounded font sizes at 600dpi (suggested by Denis Roegel).} +% \changes{v2.1i}{1995/09/19}{Corrected names of .fd files in argument +% to \cs{ProvidesFile} commands.} +% \changes{v2.1h}{1994/05/12}{Added \cs{ProvidesFile} commands.} +% \changes{v2.1c}{1993/12/17}{Added size 8 to allow for \cs{LaTeX} +% logo.} +% \changes{v2.1a}{1993/12/13}{Removed \cs{CodelineIndex} from the +% driver code.} +% \changes{v2.1e}{1994/01/31}{Corrected extension in typeout.} +% \changes{v2.1f}{1994/02/28}{Moved driver further up.} +% +% +% \section{Introduction} +% +% This file contains the external font information for special +% variants of the the Computer Modern fonts to be used for overhead +% slides. They allow to produce slides in a similar fashion as it was +% originally done by \SliTeX{}. +% +% With \LaTeXe{} it is now no longer necessary to maintain a special +% format. Instead the standard format may be used and internally only +% different font definition files come into play. +% +% Note, that that you therefore can easily produce slides in different +% fonts just by calling an appropriate package (like |times|) in +% your |\usepackage| command. This works, for example, with all +% fonts that are defined to be scalable (eg PostScript fonts) since +% they can be scaled to any size. +% +% However, minor styles like |pandora| won't work because the standard +% |.fd| files shipped with \LaTeXe{} only contain small sizes. You can, +% of course, produce additional sizes and change the |.fd| files +% accordingly, but in this case it might be better to distinguish +% |.fd| files for normal text and for slides by prefixing the family +% name with an |l| (see below). +% +% All the standard family names for \SliTeX{} fonts start out with +% with an |l| as the first character. This will distinguish them from +% text font families with similar names. +% +% In addition, we introduce an additional convention for shapes: if +% $x$ is a shape, then |I|$x$ represents the invisible form of the +% shape. This is used by the color separation macros and the +% |\invisible| command of the slides style file. +% +% +% \StopEventually{} +% +% \section{A driver for this document} +% +% The next bit of code contains the documentation driver file for +% \TeX{}, i.e., the file that will produce the documentation you are +% currently reading. It will be extracted from this file by the +% \dst{} program. +% \changes{v2.1b}{1993/12/14}{Corrected \cs{documentclass}.} +% \begin{macrocode} +%<*driver> +\documentclass{ltxdoc} +%\DisableCrossrefs % Say \DisableCrossrefs if index is ready +\RecordChanges % Gather update information +%\OnlyDescription % comment out for implementation details +%\OldMakeindex % use if your MakeIndex is pre-v2.9 +\begin{document} + \DocInput{slifonts.fdd} +\end{document} +% +% \end{macrocode} +% +% +% \section{The \dst{} modules} +% +% The following modules are used to direct \dst{} in +% generating external files: +% \begin{center} +% \begin{tabular}{ll} +% driver & produce a documentation driver file \\ +% main & generate \texttt{sfonts.def} \\ +% fd & produce a font definition file \\ +% ec & Use the extended EC font set rather than cm \\[2pt] +% lccr & Concrete Roman slide sizes \\ +% lcmss & Computer Modern Sans slide sizes \\ +% lcmtt & Computer Modern Typewriter slide sizes \\ +% lcmm & Computer Modern Math italic slide sizes \\ +% lcmm & Computer Modern Math symbols slide sizes \\ +% lcmex & Computer Modern Math extension symbols slide sizes \\ +% llasy & \LaTeX{} symbols slide sizes \\ +% \end{tabular} +% \end{center} +% A typical \dst{} command file would then have entries like: +% \begin{verbatim} +%\generateFile{OMSlcmsy.fd}{t}{\from{slifonts.fdd}{lcmsy,fd}} +%\end{verbatim} +% +% \section{The font definition files} +% +% +% \subsection{Concrete Roman} +% +% \changes{v2.2b}{1997/02/25} +% {typo fixed in cccsc10. latex/2395} +% \begin{macrocode} +%<*lccr> +\DeclareFontFamily{OT1}{lccr}{\hyphenchar\font45 } +\DeclareFontShape{OT1}{lccr}{m}{sc}{% + <7><8><10><12><13.82><16.59><19.907><23.89><28.66><34.4><41.28>cccsc10% + }{} +\DeclareFontShape{OT1}{lccr}{m}{sl}{% + <7><8><10><12><13.82><16.59><19.907><23.89><28.66><34.4><41.28>ccslc9% + }{} +\DeclareFontShape{OT1}{lccr}{m}{n}{% + <7><8><10><12><13.82><16.59><19.907><23.89><28.66><34.4><41.28>ccr8% + }{} +\DeclareFontShape{OT1}{lccr}{m}{In}{% + <7><8><10><12><13.82><16.59><19.907><23.89><28.66><34.4><41.28>iccr8% + }{} +% +% \end{macrocode} +% +% \subsection{Computer Modern Sans} +% +% \begin{macrocode} +%<*lcmss> +% \DeclareFontFamily{OT1}{lcmss}{\hyphenchar\font45 } +% \DeclareFontFamily{T1}{lcmss}{} +% \end{macrocode} +% +% \begin{macrocode} +% \DeclareFontShape{OT1}{lcmss}{m}{n}{% +% \DeclareFontShape{T1}{lcmss}{m}{n}{% + <7><8><10><12><13.82><16.59><19.907><23.89><28.66><34.4><41.28>% +% lcmss8% +% eclq8% + }{} +% \end{macrocode} +% +% \begin{macrocode} +% \DeclareFontShape{OT1}{lcmss}{m}{In}{% +% \DeclareFontShape{T1}{lcmss}{m}{In}{% + <7><8><10><12><13.82><16.59><19.907><23.89><28.66><34.4><41.28>% +% ilcmss8% +% ieclq8% + }{} +% \end{macrocode} +% +% \begin{macrocode} +% \DeclareFontShape{OT1}{lcmss}{m}{sl}{% +% \DeclareFontShape{T1}{lcmss}{m}{sl}{% + <13.82><16.59><19.907><23.89><28.66><34.4><41.28>% +% lcmssi8% +% ecli8% + }{} +% \end{macrocode} +% +% \begin{macrocode} +% \DeclareFontShape{OT1}{lcmss}{m}{Isl}{% +% \DeclareFontShape{T1}{lcmss}{m}{Isl}{% + <13.82><16.59><19.907><23.89><28.66><34.4><41.28>% +% ilcmssi8% +% iecli8% + }{} +% \end{macrocode} +% +% \begin{macrocode} +% \DeclareFontShape{OT1}{lcmss}{m}{it}{% +% \DeclareFontShape{T1}{lcmss}{m}{it}{% + <->sub*lcmss/m/sl}{} +% \end{macrocode} +% +% \begin{macrocode} +% \DeclareFontShape{OT1}{lcmss}{m}{Iit}{% +% \DeclareFontShape{T1}{lcmss}{m}{Iit}{% + <->sub*lcmss/m/Isl}{} +% \end{macrocode} +% +% \begin{macrocode} +% \DeclareFontShape{OT1}{lcmss}{bx}{n}{% +% \DeclareFontShape{T1}{lcmss}{bx}{n}{% + <13.82><16.59><19.907><23.89><28.66><34.4><41.28>% +% lcmssb8% +% eclb8% + }{} +% \end{macrocode} +% +% \begin{macrocode} +% \DeclareFontShape{OT1}{lcmss}{bx}{In}{% +% \DeclareFontShape{T1}{lcmss}{bx}{In}{% + <13.82><16.59><19.907><23.89><28.66><34.4><41.28>% +% ilcmssb8% +% ieclb8% + }{} +% \end{macrocode} +% +% EC fonts have a bold slanted font for the slides class. +% \begin{macrocode} +%<*ec> +\DeclareFontShape{T1}{lcmss}{bx}{sl}{% + <13.82><16.59><19.907><23.89><28.66><34.4><41.28>% + eclo8% + }{} +% \end{macrocode} +% +% \begin{macrocode} +\DeclareFontShape{T1}{lcmss}{bx}{Isl}{% + <13.82><16.59><19.907><23.89><28.66><34.4><41.28>% + ieclo8% + }{} +% \end{macrocode} +% \begin{macrocode} +\DeclareFontShape{T1}{lcmss}{bx}{it}{% + <->sub*lcmss/bx/sl}{} +% \end{macrocode} +% +% \begin{macrocode} +\DeclareFontShape{T1}{lcmss}{bx}{Iit}{% + <->sub*lcmss/bx/Isl}{} +% \end{macrocode} +% +% \begin{macrocode} +% +% \end{macrocode} +% +% There are extra substitutions for the shape |ui| which are needed +% for |\pounds| to not come out as a \$ sign (mostly). +% \changes{v2.1k}{1995/10/31}{Added substitutions to make \cs{pounds} +% work right in slides.} +% \begin{macrocode} +%<*!ec> +\DeclareFontShape{OT1}{lcmss}{m}{ui}{% + <->sub*cmr/m/ui}{} +\DeclareFontShape{OT1}{lcmss}{bx}{ui}{% + <->sub*cmr/m/ui}{} +% +% +% \end{macrocode} +% +% \subsection{Computer Modern Typewriter} +% +% \begin{macrocode} +%<*lcmtt> +% \DeclareFontFamily{OT1}{lcmtt}{\hyphenchar\font\m@ne} +% \DeclareFontFamily{T1}{lcmtt}{\hyphenchar\font\m@ne} +% \end{macrocode} +% +% \begin{macrocode} +% \DeclareFontShape{OT1}{lcmtt}{m}{n}{% +% \DeclareFontShape{T1}{lcmtt}{m}{n}{% + <13.82><16.59><19.907><23.89><28.66><34.4><41.28>% +% cmtt8% +% ecltt8% + }{} +% \end{macrocode} +% +% \begin{macrocode} +% \DeclareFontShape{OT1}{lcmtt}{m}{In}{% +% \DeclareFontShape{T1}{lcmtt}{m}{In}{% + <13.82><16.59><19.907><23.89><28.66><34.4><41.28>% +% icmtt8% +% iecltt8% + }{} +% \end{macrocode} +% +% \begin{macrocode} +% \DeclareFontShape{OT1}{lcmtt}{m}{it}{% +% \DeclareFontShape{T1}{lcmtt}{m}{it}{% + <13.82><16.59><19.907><23.89><28.66><34.4><41.28>% +% cmitt10% +% ecit1000% + }{} +% \end{macrocode} +% There are extra substitutions for the shape |ui| which are needed +% for |\pounds| to not come out as a \$ sign (mostly). +% \changes{v2.1k}{1995/10/31}{Added substitutions to make \cs{pounds} +% work right in slides.} +% \begin{macrocode} +%<*!ec> +\DeclareFontShape{OT1}{lcmtt}{m}{ui}{% + <->sub*cmtt/m/it}{} +\DeclareFontShape{OT1}{lcmtt}{bx}{ui}{% + <->sub*cmtt/m/it}{} +% +% +% \end{macrocode} +% +% \subsection{Computer Modern Math} +% +% \begin{macrocode} +%<*lcmm> +\DeclareFontFamily{OML}{lcmm}{\skewchar\font'177} +% \end{macrocode} +% +% \begin{macrocode} +\DeclareFontShape{OML}{lcmm}{m}{it}{% + <7><8><10><12><13.82><16.59><19.907><23.89><28.66><34.4><41.28>cmmi8% + }{} +% \end{macrocode} +% +% \begin{macrocode} +\DeclareFontShape{OML}{lcmm}{m}{Iit}{% + <7><8><10><12><13.82><16.59><19.907><23.89><28.66><34.4><41.28>icmmi8% + }{} +% +% \end{macrocode} +% +% \subsection{Computer Modern Symbol} +% +% \begin{macrocode} +%<*lcmsy> +\DeclareFontFamily{OMS}{lcmsy}{\skewchar\font'60} +% \end{macrocode} +% +% \begin{macrocode} +\DeclareFontShape{OMS}{lcmsy}{m}{n}{% + <7><8><10><12><13.82><16.59><19.907><23.89><28.66><34.4><41.28>cmsy8% + }{} +% \end{macrocode} +% +% \begin{macrocode} +\DeclareFontShape{OMS}{lcmsy}{m}{In}{% + <7><8><10><12><13.82><16.59><19.907><23.89><28.66><34.4><41.28>icmsy8% + }{} +% +% \end{macrocode} +% +% \subsection{Computer Modern large symbols} +% +% \changes{v2.1g}{1994/03/01}{Removed extra pair of curly braces +% at end of \cs{DeclareFontFamily} command.} +% \begin{macrocode} +%<*lcmex> +\DeclareFontFamily{OMX}{lcmex}{} +\DeclareFontShape{OMX}{lcmex}{m}{n}{% + <->sfixed*[17.28]cmex10% + }{} +% \end{macrocode} +% +% \begin{macrocode} +\DeclareFontShape{OMX}{lcmex}{m}{In}{% + <->sfixed*[17.28]icmex10% + }{} +% +% \end{macrocode} +% +% \subsection{\LaTeX{} symbols} +% +% \changes{v2.2d}{1997/10/20}{Removed superfluous pair of braces at +% end of \cs{DeclareFontFamily} command.} +% \begin{macrocode} +%<*llasy> +\DeclareFontFamily{U}{llasy}{} +\DeclareFontShape{U}{llasy}{m}{n}{% + <12><13.82><16.59><19.907><23.89><28.66><34.4><41.28>lasy8% +}{} +% \end{macrocode} +% +% \begin{macrocode} +\DeclareFontShape{U}{llasy}{m}{In}{% + <13.82><16.59><19.907><23.89><28.66><34.4><41.28>ilasy8% +}{} +% +% \end{macrocode} +% +% \section{Setting defaults} +% +% The following statements go into the file \texttt{sfonts.def} +% which plays a r\^ole similar to \texttt{fontdef.ltx}. Thus, you may +% want to produce your own local variant of it if you intend to use +% different fonts in your slides. +% \changes{v2.0b}{1993/03/09}{Added \cs{fd@prefix} for \cs{input}} +% \changes{v2.2a}{1997/01/15}{lowercase fd file} +% \begin{macrocode} +%<*main> +\DeclareErrorFont{OT1}{lcmss}{m}{n}{19.907} +\DeclareFontSubstitution{OT1}{lcmss}{m}{n} +\input ot1lcmss.fd +% +% \end{macrocode} +% +% +% The next line goes into all files and in addition prevents \dst{} +% from adding any further code from the main source file (such as a +% character table. +% \begin{macrocode} +\endinput +% \end{macrocode} +% +% \Finale +% +%% \CharacterTable +%% {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 +%% 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 +%% Digits \0\1\2\3\4\5\6\7\8\9 +%% Exclamation \! Double quote \" Hash (number) \# +%% Dollar \$ Percent \% Ampersand \& +%% Acute accent \' Left paren \( Right paren \) +%% Asterisk \* Plus \+ Comma \, +%% Minus \- Point \. Solidus \/ +%% Colon \: Semicolon \; Less than \< +%% Equals \= Greater than \> Question mark \? +%% Commercial at \@ Left bracket \[ Backslash \\ +%% Right bracket \] Circumflex \^ Underscore \_ +%% Grave accent \` Left brace \{ Vertical bar \| +%% Right brace \} Tilde \~} diff --git a/Master/texmf-dist/source/latex/base/source2e.tex b/Master/texmf-dist/source/latex/base/source2e.tex new file mode 100644 index 00000000000..facf8547381 --- /dev/null +++ b/Master/texmf-dist/source/latex/base/source2e.tex @@ -0,0 +1,477 @@ +% \iffalse meta-comment +% +% Copyright 1993 1994 1995 1996 1997 1998 1999 2000 2001 +% The LaTeX3 Project and any individual authors listed elsewhere +% in this file. +% +% This file is part of the LaTeX base system. +% ------------------------------------------- +% +% It may be distributed and/or modified under the +% conditions of the LaTeX Project Public License, either version 1.2 +% of this license or (at your option) any later version. +% The latest version of this license is in +% http://www.latex-project.org/lppl.txt +% and version 1.2 or later is part of all distributions of LaTeX +% version 1999/12/01 or later. +% +% The list of all files belonging to the LaTeX base distribution is +% given in the file `manifest.txt'. See also `legal.txt' for additional +% information. +% +% \fi + +% This document will typeset the LaTeX sources as a single document. +% This will produce quite a large file (roughly 555 pages) and may +% take a long time. +% +% Some notes on processing this document are contained at the end +% of this document, after \end{document} +% +% DPC 1997/11/17 +% +% First a special index style for makeindex +% + +\begin{filecontents}{source2e.ist} +actual '=' +quote '!' +level '>' +preamble +"\n \\begin{theindex} \n \\makeatletter\\scan@allowedfalse\n" +postamble +"\n\n \\end{theindex}\n" +item_x1 "\\efill \n \\subitem " +item_x2 "\\efill \n \\subsubitem " +delim_0 "\\pfill " +delim_1 "\\pfill " +delim_2 "\\pfill " +% The next lines will produce some warnings when +% running Makeindex as they try to cover two different +% versions of the program: +lethead_prefix "{\\bfseries\\hfil " +lethead_suffix "\\hfil}\\nopagebreak\n" +lethead_flag 1 +heading_prefix "{\\bfseries\\hfil " +heading_suffix "\\hfil}\\nopagebreak\n" +headings_flag 1 + +% and just for source2e: +% Remove R so I is treated in sequence I J K not I II III +page_precedence "rnaA" +\end{filecontents} + + + +\documentclass{ltxdoc} + +\listfiles + +% Do not index some TeX primitives, and some common plain TeX commands. + +\DoNotIndex{\def,\long,\edef,\xdef,\gdef,\let,\global} +\DoNotIndex{\if,\ifnum,\ifdim,\ifcat,\ifmmode,\ifvmode,\ifhmode,% + \iftrue,\iffalse,\ifvoid,\ifx,\ifeof,\ifcase,\else,\or,\fi} +\DoNotIndex{\box,\copy,\setbox,\unvbox,\unhbox,\hbox,% + \vbox,\vtop,\vcenter} +\DoNotIndex{\@empty,\immediate,\write} +\DoNotIndex{\egroup,\bgroup,\expandafter,\begingroup,\endgroup} +\DoNotIndex{\divide,\advance,\multiply,\count,\dimen} +\DoNotIndex{\relax,\space,\string} +\DoNotIndex{\csname,\endcsname,\@spaces,\openin,\openout,% + \closein,\closeout} +\DoNotIndex{\catcode,\endinput} +\DoNotIndex{\jobname,\message,\read,\the,\m@ne,\noexpand} +\DoNotIndex{\hsize,\vsize,\hskip,\vskip,\kern,\hfil,\hfill,\hss} +\DoNotIndex{\m@ne,\z@,\z@skip,\@ne,\tw@,\p@} +\DoNotIndex{\dp,\wd,\ht,\vss,\unskip} + +% Set up the Index and Change History to use \part +\IndexPrologue{\part*{Index}% + \markboth{Index}{Index}% + \addcontentsline{toc}{part}{Index}% + The italic numbers denote the pages where the + corresponding entry is described, + numbers underlined point to the definition, + all others indicate the places where it is used.} + +\GlossaryPrologue{\part*{Change History}% +% Allow control names to be hyphenated here... + {\GlossaryParms\ttfamily\hyphenchar\font=`\-}% + \markboth{Change History}{Change History}% + \addcontentsline{toc}{part}{Change History}} + +% The standard \changes command modified slightly to better cope with +% this multiple file document. +\makeatletter +\def\changes@#1#2#3{% + \let\protect\@unexpandable@protect + \edef\@tempa{\noexpand\glossary{#2\space\currentfile\space#1\levelchar + \ifx\saved@macroname\@empty + \space + \actualchar + \generalname + \else + \expandafter\@gobble + \saved@macroname + \actualchar + \string\verb\quotechar*% + \verbatimchar\saved@macroname + \verbatimchar + \fi + :\levelchar #3}}% + \@tempa\endgroup\@esphack} +\makeatother + +% Produce a Change Log and (2 column) Index. +\RecordChanges +\CodelineIndex +\EnableCrossrefs +\setcounter{IndexColumns}{2} + +% Needed for documentation in ltoutenc.dtx +\usepackage{textcomp} + +\begin{document} + \title{The \LaTeXe\ Sources} + \author{% + Johannes Braams\\ + David Carlisle\\ + Alan Jeffrey\\ + Leslie Lamport\\ + Frank Mittelbach\\ + Chris Rowley\\ + Rainer Sch\"opf} + +% This command will be used to input the patch file +% if that file exists. +\newcommand{\includeltpatch}{% + \def\currentfile{ltpatch.ltx} + \part{ltpatch} + {\let\ttfamily\relax + \xdef\filekey{\filekey, \thepart={\ttfamily\currentfile}}}% + Things we did wrong\ldots + \IndexInput{ltpatch.ltx}} + + + +% Get the date from ltvers.dtx +\makeatletter +\let\patchdate=\@empty +\begingroup + \def\ProvidesFile#1\fmtversion#2{\date{#2}\endinput} + \input{ltvers.dtx} +\global\let\X@date=\@date + +% Add the patch version if available. + \long\def\Xdef#1#2#3\def#4#5{% + \xdef\X@date{#2}% + \xdef\patchdate{#5}% + \endinput}% + \InputIfFileExists{ltpatch.ltx} + {\let\def\Xdef}{\global\let\includeltpatch\relax} +\endgroup + +\ifx\@date\X@date + \def\Xpatch{0} + \ifx\patchdate\Xpatch\else + \edef\@date{\@date\space Patch level \patchdate} + \fi +\else + \@warning{ltpatch.ltx does not match ltvers.dtx!} + \let\includeltpatch\relax +\fi +\makeatother + + \pagenumbering{roman} + \maketitle + \renewcommand\maketitle{} + + \tableofcontents + + \clearpage + + \pagenumbering{arabic} + +%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%% + +% Each of the following \DocInclude lines includes a file with extension +% .dtx. Each of these files may be typeset separately. For instance +% latex ltboxes.dtx +% will typeset the source of the LaTeX box commands. +% +% If this file is processed, each of these separate dtx files will be +% contained as a part of a single document. Using ltxdoc.cfg you can +% then optionally produce a combined index and/or change history for +% the entire source of the format file. Note that such a document will +% be quite large (about 555 pages). +% + + \DocInclude{ltdirchk} % System dependant initialisation + + \DocInclude{ltplain} % LaTeX version of Knuth's plain.tex + + \DocInclude{ltvers} % Current version date + + \DocInclude{ltdefns} % Initial definitions. + + \DocInclude{ltalloc} % Allocation of counters and others. + + \DocInclude{ltcntrl} % Program control macros. + + \DocInclude{lterror} % Error handling. + + \DocInclude{ltpar} % Paragraphs. + + \DocInclude{ltspace} % Spacing, line and page breaking. + + \DocInclude{ltlogos} % Logos. + + \DocInclude{ltfiles} % \input files and related commands + + \DocInclude{ltoutenc} % Output encoding interface + + \DocInclude{ltcounts} % Counters + + \DocInclude{ltlength} % Lengths + + \DocInclude{ltfssbas} % NFSS Base macros + + \DocInclude{ltfsstrc} % NFSS Tracing (and tracefnt.sty) + + \DocInclude{ltfsscmp} % NFSS1 Compatibility + + \DocInclude{ltfssdcl} % NFSS Declarative interface + + \DocInclude{ltfssini} % NFSS Initialisation + + \DocInclude{fontdef} % fonttext.ltx/fontmath.ltx + + \DocInclude{preload} % preload.ltx + + \DocInclude{ltfntcmd} % \textrm etc + + \DocInclude{ltpageno} % Page numbering + + \DocInclude{ltxref} % Cross referencing + + \DocInclude{ltmiscen} % Miscellaneous environment definitions. + + \DocInclude{ltmath} % Mathematics set up. + + \DocInclude{ltlists} % List and related environments + + \DocInclude{ltboxes} % Parbox and friends + + \DocInclude{lttab} % Tabbing tabular and array + + \DocInclude{ltpictur} % Picture mode + + \DocInclude{ltthm} % Theorem environments + + \DocInclude{ltsect} % Sectioning + + \DocInclude{ltfloat} % Floats + + \DocInclude{ltidxglo} % Index and Glossary + + \DocInclude{ltbibl} % Bibliography + + \DocInclude{ltpage} % \pagestyle \raggedbottom \sloppy + + \DocInclude{ltoutput} % Output routine + + \DocInclude{ltclass} % Package & Class interface + + \DocInclude{lthyphen} % Hyphenation (hyphen.ltx). + + \DocInclude{ltfinal} % Last minute initialisations and dump + + \includeltpatch % Corrections distributed after the full release + +% Stop here if ltxdoc.cfg says \AtEndOfClass{\OnlyDescription} +\StopEventually{\end{document}} + +\clearpage +\pagestyle{headings} + +% Make TeX shut up. +\hbadness=10000 +\newcount\hbadness +\hfuzz=\maxdimen + +\typeout{% + Produce change log with^^J% + makeindex -s gglo.ist -o source2e.gls source2e.glo} + + +\PrintChanges + +\clearpage + +% makeindex needs a symbol between the parts of composite page numbers +% but we dont want one, so: +\typeout{% + Produce index with^^J% + makeindex -s source2e.ist source2e.idx} + +\begingroup +\def\endash{--} +\catcode`\-\active +\def-{\futurelet\temp\indexdash} +\def\indexdash{\ifx\temp-\endash\fi} + +\PrintIndex +\endgroup + +% Make sure that the index is not printed twice +% (ltxdoc.cfg might have a second \PrintIndex command) +\let\PrintChanges\relax +\let\PrintIndex\relax + +\end{document} + + +%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%% + +To use this file to produce a fully indexed source code +you need to execute the following (or equivalent) commands: + + latex source2e.tex + + makeindex -s source2e.ist source2e.idx + makeindex -s gglo.ist -o source2e.gls source2e.glo + + latex source2e.tex + latex source2e.tex + + +The makeindex style source2e.ist is used in place of the usual +doc gind.ist to ensure that I is used in the sequence I J K +not I II II, which would be the default makeindex behaviour. + +The third run with latex is only required to get the table of +contents entries for the change log and index. You may speed things up +by using the \includeonly mechanism so as not to typeset the source +files on the second run. This involves changing the file +ltxdoc.cfg +between the latex runs. + +The following unix script automates this. + (It could easily be ported to scripts for DOS or VMS, + rm is ReMove a file, and echo "..." > file writes ... to "file".) + + +After this script (after the second ==============) is a similar script +that will produce the documentation for all the files in the base +distribution that are *not* included in source2e.dvi. This second script +was requested, but before using it, beware it will take a long time! +It may however be modified as required, eg to not typeset the fdd files +or whatever... + +============== +#!/bin/sh + +rm -f source2e.gls source2e.ind source2e.toc + +# First run: +# Create new standard ltxdoc.cfg file +# Pass the (possibly empty) list of arguments supplied on the +# command line to article class. +# +# If you use A4 paper, running this script with argument +# a4paper +# may save about 30 pages. +# +echo "\PassOptionsToClass{$*}{article}" > ltxdoc.cfg + + +# Now LaTeX the file with this cfg file. +# +latex source2e.tex + + +# Make the Change log and Glossary. +# +makeindex -s source2e.ist source2e.idx +makeindex -s gglo.ist -o source2e.gls source2e.glo + + +# Second run: append \includeonly{} to ltxdoc.cfg to speed up things +# (this run needed only to get changes and index listed in .toc file) +# +# Note that the index will not be made incorrect by the insertion +# of the table of contents as the front matter uses a diferent page +# numbering scheme. +# +echo "\includeonly{}" >> ltxdoc.cfg + +latex source2e.tex + + +# Third and final run, to put everything together. +# First restore the cfg file: +# +echo "\PassOptionsToClass{$*}{article}" > ltxdoc.cfg +latex source2e.tex + + +============== +#!/bin/sh + +# Running this script will process all the dtx fdd and *guide.tex +# and ltnews*.tex files in the LaTeX distribution, except the dtx +# files included in source2e.tex. +# (The shell first script in the comments of source2e.tex will +# process those.) + +# Any command line arguments (eg a4paper) are taken as options to the +# article class. + +# This script is likely to take ages! + +echo "\PassOptionsToClass{$*}{article}" > ltxdoc.cfg +echo "\batchmode" >> ltxdoc.cfg + +# The next four lines produce full indexes and change logs +# you may not want those. +echo "\AtBeginDocument{\RecordChanges}" >> ltxdoc.cfg +echo "\AtEndDocument{\PrintChanges}" >> ltxdoc.cfg +echo "\AtBeginDocument{\CodelineIndex\EnableCrossrefs}" >> ltxdoc.cfg +echo "\AtEndDocument{\PrintIndex}" >> ltxdoc.cfg + +# If you do not want any code listings, just documentation, then instead +# of the above four lines, uncomment the following: +# echo "\AtBeginDocument{\OnlyDescription}" >> ltxdoc.cfg + +echo "\PassOptionsToClass{$*}{article}" > ltxguide.cfg +echo "\batchmode" >> ltxguide.cfg + +cp ltxguide.cfg ltnews.cfg + + +for i in *dtx *fdd *guide.tex ltnews*.tex +do +B=`basename $i .dtx` + +if (grep "Include{$B}" source2e.tex >/dev/null ; ) +then +echo In source2e: $i +else +echo latex $i + if (latex $i > /dev/null) + then + echo latex $i + latex $i > /dev/null + echo makeindex -s gind.ist $B.idx + makeindex -s gind.ist $B.idx > /dev/null 2> /dev/null + echo makeindex -s gglo.ist -o $B.gls $B.glo + makeindex -s gglo.ist -o $B.gls $B.glo > /dev/null 2> /dev/null + echo latex $i + latex $i > /dev/null + else + echo "!!! LaTeX ERROR: $i. (See $B.log.)" + fi +fi + +done diff --git a/Master/texmf-dist/source/latex/base/syntonly.dtx b/Master/texmf-dist/source/latex/base/syntonly.dtx new file mode 100644 index 00000000000..3f549590488 --- /dev/null +++ b/Master/texmf-dist/source/latex/base/syntonly.dtx @@ -0,0 +1,289 @@ +% \iffalse meta-comment +% +% Copyright 1993 1994 1995 1996 1997 1998 1999 2000 2001 2002 2003 2004 +% The LaTeX3 Project and any individual authors listed elsewhere +% in this file. +% +% This file is part of the LaTeX base system. +% ------------------------------------------- +% +% It may be distributed and/or modified under the +% conditions of the LaTeX Project Public License, either version 1.3 +% of this license or (at your option) any later version. +% The latest version of this license is in +% http://www.latex-project.org/lppl.txt +% and version 1.3 or later is part of all distributions of LaTeX +% version 2003/12/01 or later. +% +% This file has the LPPL maintenance status "maintained". +% +% The list of all files belonging to the LaTeX base distribution is +% given in the file `manifest.txt'. See also `legal.txt' for additional +% information. +% +% The list of derived (unpacked) files belonging to the distribution +% and covered by LPPL is defined by the unpacking scripts (with +% extension .ins) which are part of the distribution. +% +% \fi +%% \CheckSum{110} +%% \CharacterTable +%% {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 +%% 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 +%% Digits \0\1\2\3\4\5\6\7\8\9 +%% Exclamation \! Double quote \" Hash (number) \# +%% Dollar \$ Percent \% Ampersand \& +%% Acute accent \' Left paren \( Right paren \) +%% Asterisk \* Plus \+ Comma \, +%% Minus \- Point \. Solidus \/ +%% Colon \: Semicolon \; Less than \< +%% Equals \= Greater than \> Question mark \? +%% Commercial at \@ Left bracket \[ Backslash \\ +%% Right bracket \] Circumflex \^ Underscore \_ +%% Grave accent \` Left brace \{ Vertical bar \| +%% Right brace \} Tilde \~} +%% +% +% +% \changes{v2.1a}{1994/03/10}{Update for \LaTeXe} +% +% \DoNotIndex{\@cclvi,\@cclv,\@gobble,\@gobbletwo,\@ifnextchar} +% \DoNotIndex{\@M,\@tempboxa,\advance,\alloc,\begingroup,\bgroup} +% \DoNotIndex{\box,\count@,\def,\do,\docdate,\egroup,\endgroup} +% \DoNotIndex{\fi,\filedate,\fileversion,\font,\fontdimen,\global} +% \DoNotIndex{\ifinner,\ifnum,\immediate,\let,\long,\loop,\m@ne} +% \DoNotIndex{\noexpand,\relax,\repeat,\scriptfont} +% \DoNotIndex{\scriptscriptfont,\setbox,\sixt@@n,\space,\textfont} +% \DoNotIndex{\toks,\toksdef,\write,\xdef,\z@}% +% +% +%\title{The file \texttt{syntonly.dtx} for use with +% \LaTeXe.\thanks{This file has version +% number \fileversion, dated \filedate.}\\[2pt] +% It contains the code for \texttt{syntonly.sty}} +% \author{Frank Mittelbach \and Rainer Sch\"opf} +% +% +% \maketitle +% +% This package implements the |\syntaxonly| declaration for \LaTeXe. +% This command can be used in the preamble for running a document +% through \LaTeX{} without actually getting any output. +% +% \StopEventually{} +% +% +% \section{Identification} +% +% We identify the package and its current version. +% \changes{v2.1b}{1995/04/22}{Removed surplus \cs{typeout} lines} +% \changes{v2.1c}{1996/06/14}{Rearange \cs{GetFileInfo} useage.} +% \changes{v2.1d}{1998/08/17}{(RmS) Minor documentation fixes.} +% +% \begin{macrocode} +%\ProvidesPackage{syntonly} +%<*dtx> + \ProvidesFile{syntonly.dtx} +% +%<*package|dtx> + [1999/09/17 v2.1e Standard LaTeX2e package] +% +% \end{macrocode} +% +%\iffalse +% +% \section{The documentation driver file} +% +% The next bit of code contains the documentation driver file for +% \TeX{}, i.e., the file that will produce the documentation you are +% currently reading. It will be extracted from this file by the \dst{} +% program. +% \begin{macrocode} +%<*driver> +\documentclass{ltxdoc} +\GetFileInfo{syntonly.dtx} +\providecommand\dst{\expandafter{\normalfont\scshape docstrip}} +\begin{document} + \DocInput{syntonly.dtx} +\end{document} +% +% \end{macrocode} +%\fi +% +% +% \section{Implementation} +% +% \begin{macrocode} +%<*package> +% \end{macrocode} +% +% \begin{macro}{\dummyft@} +% First of all we need to define the `dummy' font. +% \begin{macrocode} +\font\dummyft@=dummy \relax +% \end{macrocode} +% \end{macro} +% \changes{v2.1b}{1995/05/25}{Removed unneeded fontdimen settings for +% dummyft@} +% +% \begin{macro}{\ifsyntax@} +% Now we can define the `syntax only' feature. We define a switch +% |\if@syntax| so that any macro can always find out if it +% is really supposed to typeset text. Its default is to run in +% normal mode. +% \begin{macrocode} +\newif\ifsyntax@ +\syntax@false +% \end{macrocode} +% \end{macro} +% +% \begin{macro}{\syntaxonly} +% The |\syntaxonly| macro sets up everything for syntax +% checking. +% \begin{macrocode} +\def\syntaxonly{% +% \end{macrocode} +% First of all it sets the |syntax@| switch to \texttt{true}. +% \begin{macrocode} + \syntax@true +% \end{macrocode} +% Then it globally sets all fonts to the dummy font. These are: +% the current font outside math mode, +% \begin{macrocode} + \global\dummyft@ +% \end{macrocode} +% and the $3\times16$ math fonts for the $16$ math \emph{groups}. +% We use a loop to set these. +% \begin{macrocode} + \count@\sixt@@n + \loop + \ifnum\count@ >\z@ + \advance\count@\m@ne + \global\textfont\count@\dummyft@ + \global\scriptfont\count@\dummyft@ + \global\scriptscriptfont\count@\dummyft@ + \repeat +% \end{macrocode} +% Since all font changes occur either via |\selectfont| (in +% text or |\mathversion| (for math mode) it is sufficient +% to change these to no-ops. In addition we must prevent +% the loading of math fonts, this is done by making +% |\getanddefine@fonts| a no-op. +% \begin{macrocode} + \global\let\selectfont\relax + \global\let\mathversion\@gobble + \global\let\getanddefine@fonts\@gobbletwo +% \end{macrocode} +% We prevent \TeX{} from complaining about the dummy font +% having no characters. +% \begin{macrocode} + \tracinglostchars\z@ +% \end{macrocode} +% Then we disable the output routine, and set |\frenchspacing| +% (which is slightly faster than |\nonfrenchspacing|). +% Finally we set |\hbadness| to $10000$ to avoid overfull box +% messages. +% \begin{macrocode} + \nopages@ + \frenchspacing + \hbadness\@M} +% \end{macrocode} +% \end{macro} +% +% \changes{v2.1b}{1995/05/25}{Removed non-outer newtoks@: newtoks is no +% longer outer} +% +% \begin{macro}{\nopages@} +% \changes{v1.0b}{1990/01/14}{Rewrite of the \cs{nopages@} macro to +% correctly handle footnote insertions, floats and marginpars.} +% The |\nopages@| macro disables the \LaTeX{} output routine. +% To this end we define a very simple output routine that empties +% the output \emph{and} footnote boxes (remember that the latter +% are insertions. +% \begin{macrocode} +\def\nopages@{% + \output {\setbox\z@\box\@cclv + \setbox\z@\box\footins + \deadcycles\z@}% +% \end{macrocode} +% Then we protect it against definition by a style file. +% \changes{v2.1b}{1995/05/25}{newtoks is no longer outer} +% \begin{macrocode} + \newtoks\output +% \end{macrocode} +% But this is not enough: normally the \LaTeX{} output routine +% is responsible for dealing with floating objects. +% We therefore also redefine the internal macros for handling +% floats and marginpars. +% \begin{macrocode} + \def\@xfloat##1[##2]{% +% \end{macrocode} +% There are a few things that have to be retained: +% the definition of |\@captype| since it is used by the +% |\caption| command, +% \changes{v1.0c}{1990/01/16}{Definition of \cs{@captype} added.} +% \begin{macrocode} + \def\@captype{##1}% +% \end{macrocode} +% the error message issued when not in outer paragraph mode, +% \begin{macrocode} + \ifinner\@parmoderr\fi +% \end{macrocode} +% and the |\@parboxrestore| command for the body of the +% float. This is necessary since it restores the original +% definitions of important commands like |\par| or |\\|. +% \begin{macrocode} + \setbox\@tempboxa\vbox\bgroup\@parboxrestore}% +% \end{macrocode} +% |\end@float| must now only close the brace: +% \begin{macrocode} + \let\end@float\egroup +% \end{macrocode} +% The redefinition of the |\marginpar| command is a bit more +% complicated since we have to check for the optional argument. +% First we redefine the command itself: +% \begin{macrocode} + \def\marginpar{\ifinner\@parmoderr\fi +% \end{macrocode} +% We open a group so that everything gathered in a temporary box +% can easily be thrown away by closing it again (see below). +% \begin{macrocode} + \begingroup \@ifnextchar [\@xmpar\@ympar} +% \end{macrocode} +% |\@xmpar| and |\@ympar| are now defined similar to +% |\@xfloat| above. +% If an optional argument is present |\@xmpar| typesets +% it in a temporary box that is thrown away later. +% Then it calls up |\@ympar| to process |\marginpar|'s +% argument. +% \changes{v1.0d}{1990/01/21}{Added forgotten \cs{vbox}.} +% \begin{macrocode} + \long\def\@xmpar[##1]{% + \setbox\@tempboxa\vbox{\@parboxrestore ##1}\@ympar}% +% \end{macrocode} +% |\@ympar| gathers its argument in the same temporary box +% and throws away its contents by closing the group opened up in +% |\marginpar| above. +% \changes{v1.0d}{1990/01/21}{Added forgotten \cs{vbox}.} +% \begin{macrocode} + \long\def\@ympar##1{% + \setbox\@tempboxa\vbox{\@parboxrestore ##1}\endgroup}% +% \end{macrocode} +% And that's all we had to do. +% \begin{macrocode} +} +% \end{macrocode} +% \end{macro} +% +% \begin{macro}{\@preamblecmds} +% We disable the use of the |\syntaxonly| command after +% |\begin{document}| +% \begin{macrocode} +\@onlypreamble\syntaxonly +% +% \end{macrocode} +% \end{macro} +% +% \Finale + +\endinput diff --git a/Master/texmf-dist/source/latex/base/syntonly.ins b/Master/texmf-dist/source/latex/base/syntonly.ins new file mode 100644 index 00000000000..b4aaa71c761 --- /dev/null +++ b/Master/texmf-dist/source/latex/base/syntonly.ins @@ -0,0 +1,80 @@ +%% +%% This file will generate fast loadable files and documentation +%% driver files from the doc files in this package when run through +%% LaTeX or TeX. +%% +%% Copyright 1993 1994 1995 1996 1997 1998 1999 2000 2001 2002 2003 2004 +%% The LaTeX3 Project and any individual authors listed elsewhere +%% in this file. +%% +%% This file is part of the LaTeX base system. +%% ------------------------------------------- +%% +%% It may be distributed and/or modified under the +%% conditions of the LaTeX Project Public License, either version 1.3 +%% of this license or (at your option) any later version. +%% The latest version of this license is in +%% http://www.latex-project.org/lppl.txt +%% and version 1.3 or later is part of all distributions of LaTeX +%% version 2003/12/01 or later. +%% +%% This file has the LPPL maintenance status "maintained". +%% +%% In particular, NO PERMISSION is granted to modify the contents of this +%% file since it contains the legal notices that are placed in the files +%% it generates. +%% +%% The list of all files belonging to the LaTeX base distribution is +%% given in the file `manifest.txt'. See also `legal.txt' for additional +%% information. +%% +%% +%% +%% +%% --------------- start of docstrip commands ------------------ +%% + +\input docstrip + +\preamble + +This is a generated file. + +Copyright 1993 1994 1995 1996 1997 1998 1999 2000 2001 2002 2003 2004 +The LaTeX3 Project and any individual authors listed elsewhere +in this file. + +This file was generated from file(s) of the LaTeX base system. +-------------------------------------------------------------- + +It may be distributed and/or modified under the +conditions of the LaTeX Project Public License, either version 1.3 +of this license or (at your option) any later version. +The latest version of this license is in + http://www.latex-project.org/lppl.txt +and version 1.3 or later is part of all distributions of LaTeX +version 2003/12/01 or later. + +This file has the LPPL maintenance status "maintained". + +This file may only be distributed together with a copy of the LaTeX +base system. You may however distribute the LaTeX base system without +such generated files. + +The list of all files belonging to the LaTeX base distribution is +given in the file `manifest.txt'. See also `legal.txt' for additional +information. + +The list of derived (unpacked) files belonging to the distribution +and covered by LPPL is defined by the unpacking scripts (with +extension .ins) which are part of the distribution. +\endpreamble + +\keepsilent +\usedir{tex/latex/base} + +\generateFile{syntonly.sty}{t}{% + \from{syntonly.dtx}{package}} + +\endbatchfile + diff --git a/Master/texmf-dist/source/latex/base/unpack.ins b/Master/texmf-dist/source/latex/base/unpack.ins new file mode 100644 index 00000000000..e2e47214875 --- /dev/null +++ b/Master/texmf-dist/source/latex/base/unpack.ins @@ -0,0 +1,128 @@ +%% +%% This file will generate fast loadable files and documentation +%% driver files from the doc files in this package when run through +%% LaTeX or TeX. +%% +%% Copyright 1993 1994 1995 1996 1997 1998 1999 2000 2001 2002 2003 2004 +%% The LaTeX3 Project and any individual authors listed elsewhere +%% in this file. +%% +%% This file is part of the LaTeX base system. +%% ------------------------------------------- +%% +%% It may be distributed and/or modified under the +%% conditions of the LaTeX Project Public License, either version 1.3 +%% of this license or (at your option) any later version. +%% The latest version of this license is in +%% http://www.latex-project.org/lppl.txt +%% and version 1.3 or later is part of all distributions of LaTeX +%% version 2003/12/01 or later. +%% +%% This file has the LPPL maintenance status "maintained". +%% +%% In particular, NO PERMISSION is granted to modify the contents of this +%% file since it contains the legal notices that are placed in the files +%% it generates. +%% +%% The list of all files belonging to the LaTeX base distribution is +%% given in the file `manifest.txt'. See also `legal.txt' for additional +%% information. +%% +%% +%% +%% +%% --------------- start of bootstrap commands ------------------ +%% +%% +%% LaTeX 2e installation script (concurrent version) +\let\documentclass\undefined +\input ltdirchk.dtx +\input docstrip.dtx + +{ +\def\ProvidesFile#1\end#2{} +\def\everyjob#1\endinput{} +\@@input ltvers.dtx +\Msg{**********************************************} +\Msg{*} +\Msg{* Welcome to the Installation routine of} +\Msg{*} +\Msg{* \space\space\space\space\fmtname\space <\fmtversion>} +\Msg{*} +\Msg{* Depending on your machine the installation} +\Msg{* might take a long time --- this is the} +\Msg{* price for being able to run on all platforms.} +\Msg{* So please be patient :-)} +\Msg{*} +\Msg{**********************************************} +\Msg{} +\Msg{} +} + + +\askonceonly + +\keepsilent + + +%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%% +%%% generate main kernel file +%%% and the .ltx files that set up the default settings +%%% that may be changed by the use of .cfg files. + +\batchinput{format.ins} + +%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%% +%%% generate .def files for encoding support + +\batchinput{inputenc.ins} +\batchinput{ltoutenc.ins} + + +%%%%%%%%%%%%%%%%%%%%%%%%%%%% +%%% other classes and packages + +\batchinput{classes.ins} + +\batchinput{letter.ins} + +\batchinput{slides.ins} + +\batchinput{proc.ins} + +\batchinput{latexsym.ins} + +\batchinput{cmfonts.ins} + +\batchinput{ec.ins} + +\batchinput{latex209.ins} + +\batchinput{docstrip.ins} + +\batchinput{ifthen.ins} + +\batchinput{graphpap.ins} + +\batchinput{makeindx.ins} + +\batchinput{syntonly.ins} + +\batchinput{exscale.ins} + +\batchinput{alltt.ins} + +\batchinput{nfssfont.ins} + +\batchinput{fixltx2e.ins} + + +\Msg{} +\Msg{***********************************} +\Msg{*} +\Msg{* Now run INITEX on latex.ltx} +\Msg{*} +\Msg{***********************************} +\Msg{} + +\endbatchfile diff --git a/Master/texmf-dist/source/latex/base/utf8ienc.dtx b/Master/texmf-dist/source/latex/base/utf8ienc.dtx new file mode 100644 index 00000000000..f0c3e434ccb --- /dev/null +++ b/Master/texmf-dist/source/latex/base/utf8ienc.dtx @@ -0,0 +1,1221 @@ +% \iffalse meta-comment +% +% Copyright 1993 1994 1995 1996 1997 1998 1999 2000 2001 2002 2003 2004 +% The LaTeX3 Project and any individual authors listed elsewhere +% in this file. +% +% This file is part of the LaTeX base system. +% ------------------------------------------- +% +% It may be distributed and/or modified under the +% conditions of the LaTeX Project Public License, either version 1.3 +% of this license or (at your option) any later version. +% The latest version of this license is in +% http://www.latex-project.org/lppl.txt +% and version 1.3 or later is part of all distributions of LaTeX +% version 2003/12/01 or later. +% +% This file has the LPPL maintenance status "maintained". +% +% The list of all files belonging to the LaTeX base distribution is +% given in the file `manifest.txt'. See also `legal.txt' for additional +% information. +% +% The list of derived (unpacked) files belonging to the distribution +% and covered by LPPL is defined by the unpacking scripts (with +% extension .ins) which are part of the distribution. +% +% \fi +% +% \iffalse +%<*driver> +\documentclass{ltxdoc} +%% \usepackage[utf8]{inputenc} %% That looked wrong to Chris. +\GetFileInfo{utf8.def} +\title{Providing some UTF-8 support via \texttt{inputenc}} +\date{\fileversion\space\filedate{} printed \today} + \author{% + Frank Mittelbach \and Chris Rowley\thanks{Borrowing heavily from + code by David Carlisle and tables by Sebastian Rahtz; some table + and code cleanup by Javier Bezos}} +\begin{document} + \maketitle + \tableofcontents + \DocInput{utf8ienc.dtx} +\end{document} +% +% \fi +% +% \CheckSum{1068} +% +% \newpage +% +% \section{Introduction} +% +% [The whole section is rather unfinished \ldots\ just like the code, sorry!] +% +% \subsection{Background and general stuff} +% +% For many reasons what this package provides is a long way from any +% type of `Unicode compliance'. +% +% In stark contrast to 8-bit character sets, with 16 or more bits it can +% easily be very inefficient to support the full range.\footnote{In +% fact, \LaTeX's current 8-bit support does not go so far as to make +% all 8-bit characters into valid input.} Moreover, useful support of +% character input by a typesetting system overwhelmingly means finding +% an acceptable visual representation of a sequence of characters and +% this, for \LaTeX{}, means having available a suitably encoded 8-bit +% font. +% +% Unfortunately it is not possible to predict exactly what valid UTF-8 +% octet sequences will appear in a particular file so it is best to +% make all the unsupported but valid sequences produce a reasonably +% clear and noticeable error message. +% +% There are two directions from which to approach the question of what +% to load. One is to specify the ranges of Unicode characters that will +% result in some sensible typesetting; this requires the provider to +% ensure that suitable fonts are loaded and that these input characters +% generate the correct typesetting via the encodings of those fonts. The +% other is to inspect the font encodings to be used and use these to +% define which input Unicode characters should be supported. +% +% For Western European languages, at least, going in either direction +% leads to many straightforward decisions and a few that are more +% subjective. In both cases some of the specifications are \TeX{} +% specific whilst most are independent of the particular typesetting +% software in use. +% +% As we have argued elsewhere, \LaTeX{} needs to refer to characters via +% `seven-bit-text' names and, so far, these have been chosen by +% reference to historical sources such as Plain \TeX{} or Adobe encoding +% descriptions. It is unclear whether this ad hoc naming structure should +% simply be extended or whether it would be useful to +% supplement it with standardised internal Unicode character names such as +% one or more of the following:\footnote{Burkhard und Holger Mittelbach +% spielen mit mir! Sie haben etwas hier geschrieben.} +% +% \begin{verbatim} +% \ltxutwochar <4 hex digits> +% +% \ltxuchar {} +% B H U R R R +% +% \ltxueightchartwo <2 utf8 octets as 8-bit char tokens> +% \ltxueightcharthree <3 utf8 octets ...> +% \ltxueightcharfour <4 utf8 octets ...> +% \end{verbatim} +% +% +% \subsection{More specific stuff} +% +% In addition to setting up the mechanism for reading UTF-8 characters +% and specifying the \LaTeX-level support available, this package +% contains support for some default historically expected \TeX-related +% characters and some example `Unicode definition files' for standard +% font encodings. +% +% +% \subsection{Notes} +% +% This package does not support Unicode combining characters as \TeX{} +% is not really equipped to make this possible. +% +% No attempt is made to be useful beyond Latin, and maybe Cyrillic, +% for European languages (as of now). +% +% +% \subsection{Basic operation of the code} +% +% The \texttt{inputenc} package makes the upper 8-bit characters active and +% assigns to all of them an error message. It then waits for the +% input encoding files to change this set-up. Similarly, whenever +% |\inputencoding| is encountered in a document, first the upper +% 8-bit characters are set back to produce an error and then the +% definitions for the new input encoding are loaded, changing some of the +% previous settings. +% +% The 8-bit input encodings currently supported by \texttt{inputenc} +% all use declarations such as |\DeclareInputText| and the like to map an +% 8-bit number to some \LaTeX{} internal form, e.g.~to |\"a|. +% +% The situation when supporting UTF-8 as the input encoding is +% different, however. Here we only have to set up the actions of +% those 8-bit numbers that can be the first octet in a UTF-8 +% representation of a Unicode character. But we cannot simply set +% this to some internal \LaTeX{} form since the Unicode character +% consists of more than one octet; instead we have to define this +% starting octet to parse the right number of further octets that +% together form the UTF-8 representation of some Unicode character. +% +% Therefore when switching to \texttt{utf8} within the +% \texttt{inputenc} framework the characters with numbers (hex) +% from \texttt{"C2} to \texttt{"DF} are defined to parse for a +% second octet following, the characters from \texttt{"E0} to +% \texttt{"EF} are defined to parse for two more octets and finally +% the characters from \texttt{"F0} to \texttt{"F3} are defined to +% parse for three additional octets. These additional octets are +% always in the range \texttt{"80} to \texttt{"B9}. +% +% Thus, when such a character is encountered in the document (so +% long as expansion is not prohibited) a defined number of +% additional octets (8-bit characters) are read and from them a +% unique control sequence name is immediately constructed. +% +% This control sequence is either defined (good) or undefined +% (likely); in the latter case the user gets an error message +% saying that this UTF-8 sequence (or, better, Unicode character) +% is not supported. +% +% If the control sequence is set up to do something useful then it will +% expand to a \LaTeX{} internal form: e.g.~for the utf8 sequence of +% two octets \texttt{"C3 "A4} we get |\"a| as the +% internal form which then, depending on the font encoding, +% eventually resolves to the single glyph `latin-a-umlaut' or to +% the composite glyph `latin-a with an umlaut accent'. +% +% These mappings from (UTF-8 encoded) Unicode characters to \LaTeX{} +% internal forms are made indirectly. The code below provides a +% declaration |\DeclareUnicodeCharacter| which maps Unicode numbers +% (as hexadecimal) to \LaTeX{} internal forms. +% +% This mapping needs to be set up only once so here it is done at +% |\begin{document}| by looking at the list of font encodings that +% are loaded by the document and providing mappings related to +% those font encodings whenever these are available. Thus at most +% only those Unicode characters that can be represented by the glyphs +% available in these encodings will be defined. +% +% Technically this is done by loading one file per encoding, +% if available, that is supposed to provide the necessary mapping +% information. +% +% +% \StopEventually{} +% +% +% +% +% \section{Coding} +% +% \subsection{Housekeeping} +% +% The usual introductory bits and pieces: +% +% \begin{macrocode} +%\ProvidesFile{utf8.def} +%\ProvidesFile{utf8-test.tex} +%<+lcy> \ProvidesFile{lcyenc.dfu} +%<+ly1> \ProvidesFile{lcyenc.dfu} +%<+oms> \ProvidesFile{omsenc.dfu} +%<+ot1> \ProvidesFile{ot1enc.dfu} +%<+ot2> \ProvidesFile{ot2enc.dfu} +%<+t1> \ProvidesFile{t1enc.dfu} +%<+t2a> \ProvidesFile{t2aenc.dfu} +%<+t2b> \ProvidesFile{t2benc.dfu} +%<+t2c> \ProvidesFile{t2cenc.dfu} +%<+ts1> \ProvidesFile{ts1enc.dfu} +%<+x2> \ProvidesFile{x2enc.dfu} +%<+all> \ProvidesFile{utf8enc.dfu} + [2004/02/09 v1.1b UTF-8 support for inputenc] +% \end{macrocode} +% +% \begin{macrocode} +%<*utf8> +\makeatletter +% \end{macrocode} +% +% +% +% \subsection{Parsing UTF-8 input} +% +% \begin{macro}{\UTFviii@two@octets} +% \begin{macro}{\UTFviii@three@octets} +% \begin{macro}{\UTFviii@four@octets} +% A UTF-8 char (that is not actually a 7-bit char, i.e.~a single +% octet) is parsed as follows: each starting octet is an active +% \TeX{} character token; each of these is defined below to be a +% macro with one to three arguments nominally (depending on the +% starting octet). It calls one of |\UTFviii@two@octets|, +% |\UTFviii@three@octets|, or |\UTFviii@four@octets| which then +% actually picks up the argument(s). +% +% From the arguments a control sequence with a name of the form +% \verb=u8:#1#2...= is constructed where the |#i| ($i>1$) are the +% arguments and |#1| is the starting octet (as a \TeX{} character +% token). Since some or even all of these characters are active +% (when inputenc is loaded) we need to use |\string| when building +% the csname. +% +% The csname thus constructed can of course be undefined but to +% avoid producing an unhelpful low-level undefined command error we +% pass it to |\UTFviii@defined| which is responsible for producing +% a more sensible error message (not yet done!!). If, however, it is +% defined we simply execute the thing (which should then expand to +% an encoding specific internal \LaTeX{} form). +% \begin{macrocode} +\def\UTFviii@two@octets#1#2{\expandafter + \UTFviii@defined\csname u8:#1\string#2\endcsname} +% \end{macrocode} +% \end{macro} +% +% \begin{macrocode} +\def\UTFviii@three@octets#1#2#3{\expandafter + \UTFviii@defined\csname u8:#1\string#2\string#3\endcsname} +% \end{macrocode} +% \end{macro} +% +% \begin{macrocode} +\def\UTFviii@four@octets#1#2#3#4{\expandafter + \UTFviii@defined\csname u8:#1\string#2\string#3\string#4\endcsname} +% \end{macrocode} +% \end{macro} +% +% \begin{macro}{\UTFviii@defined} +% This tests whether its argument is different from |\relax|: it +% either calls for a sensible error message (not done), or it gets +% the |\fi| out of the way (in case the command has arguments) and +% executes it. +% \begin{macrocode} +\def\UTFviii@defined#1{% + \ifx#1\relax +% \end{macrocode} +% The endline character has a special definition within the +% inputenc package (it is gobbling spaces). For this reason we +% can't produce multiline strings without some precaution. +% \changes{v1.1b}{2004/02/09}{no newlines in error messages allowed} +% \begin{macrocode} + \PackageError{inputenc}{Unicode char \string#1 not set up\space + for use with LaTeX}\@eha + \else\expandafter + #1% + \fi +} +% \end{macrocode} +% \end{macro} +% +% \begin{macro}{\UTFviii@loop} +% This wonderful bit of code from Dr Carlisle defines the starting +% octets to call |\UTFviii@two@octets| etc as appropriate. The starting +% octet itself is passed directly as the first argument, the others +% are picked up later en route. +% +% The |\UTFviii@loop| loops through the numbers starting at +% |\count@| and ending at |\@tempcnta|${} - 1$, each time executing +% the code in |\UTFviii@tmp|. +% +% All this is done in a group so that temporary catcode changes +% etc.~vanish after everything is set up. +% +% It may be a good idea to add code to deal with `illegal utf8 octets': +% at present these will be handled by whatever code was in use for 8-bit +% input before this code is executed. +% +% \begin{macrocode} +\begingroup +\catcode`\~13 +\catcode`\"12 +% \end{macrocode} +% +% \begin{macrocode} +\def\UTFviii@loop{% + \uccode`\~\count@ + \uppercase\expandafter{\UTFviii@tmp}% + \advance\count@\@ne + \ifnum\count@<\@tempcnta + \expandafter\UTFviii@loop + \fi} +% \end{macrocode} +% +% Setting up 2-byte UTF-8: +% \begin{macrocode} + \count@"C2 + \@tempcnta"E0 + \def\UTFviii@tmp{\xdef~{\noexpand\UTFviii@two@octets\string~}} +\UTFviii@loop +% \end{macrocode} +% Setting up 3-byte UTF-8: +% \begin{macrocode} + \count@"E0 + \@tempcnta"F0 + \def\UTFviii@tmp{\xdef~{\noexpand\UTFviii@three@octets\string~}} +\UTFviii@loop +% \end{macrocode} +% +% Setting up 4-byte UTF-8: +% \begin{macrocode} + \count@"F0 + \@tempcnta"F4 + \def\UTFviii@tmp{\xdef~{\noexpand\UTFviii@four@octets\string~}} +\UTFviii@loop +\endgroup +% \end{macrocode} +% \end{macro} +% +% For this case we must disable the warning generated by +% \texttt{inputenc} if it doesn't see any new |\DeclareInputText| +% commands. +% \begin{macrocode} +\@inpenc@test +% \end{macrocode} +% +% +% If this file (\texttt{utf8.def}) is not being read while setting +% up \texttt{inputenc}, i.e.~in the preamble, but when +% |\inputencoding| is called somewhere within the document, we do not +% need to input the specific Unicode mappings again. We therefore +% stop reading the file at this point. +% \begin{macrocode} +\ifx\@begindocumenthook\@undefined + \makeatother +% \end{macrocode} +% The |\fi| must be on the same line as |\endinput| or else it will +% never be seen! +% \begin{macrocode} + \endinput \fi +% \end{macrocode} +% +% +% \subsection{Mapping Unicode codes to \LaTeX{} internal forms} +% +% +% \begin{macro}{\DeclareUnicodeCharacter} +% The |\DeclareUnicodeCharacter| declaration defines a mapping from +% a Unicode character code point to a \LaTeX{} internal form. The first +% argument is the Unicode number as hexadecimal digits and the second is +% the actual \LaTeX{} internal form. +% +% We start by making sure that some characters have the right +% |\catcode| when they are used in the definitions below. +% \begin{macrocode} +\begingroup +\catcode`\"=12 +\catcode`\<=12 +\catcode`\.=12 +\catcode`\,=12 +\catcode`\;=12 +\catcode`\!=12 +\catcode`\~=13 +% \end{macrocode} +% +% \begin{macrocode} +\gdef\DeclareUnicodeCharacter#1#2{% + \count@"#1\relax + \wlog{ \space\space defining Unicode char U+#1 (decimal \the\count@)}% + \begingroup +% \end{macrocode} +% Next we do the parsing of the number stored in |\count@| and assign the +% result to |\UTFviii@tmp|. Actually all this could be done in-line, +% the macro |\parse@XML@charref| is only there to extend this code +% to parsing Unicode numbers in other contexts one day (perhaps). +% \begin{macrocode} + \parse@XML@charref +% \end{macrocode} +% +% Here is an example of what is happening, for the pair \texttt{"C2 "A3} +% (which is the utf8 represenation for the character \textsterling{}). +% After |\parse@XML@charref| we have, stored in |\UTFviii@tmp|, a +% single command with two character tokens as arguments: +% \begin{quote} +% [$t_{C2}$ and $t_{A3}$ are the characters corresponding to these +% two octets]\\ +% |\UTFviii@two@octets| $t_{\rm C2}t_{\rm A3}$ +% \end{quote} +% what we actually need to produce is a definition of the form +% \begin{quote} +% |\def\u8:|$t_{\rm C2}$$t_{\rm A3}$ |{|\textit{\LaTeX{} internal form}|}|\,. +% \end{quote} +% So here we temporarily redefine the prefix commands +% |\UTFviii@two@octets|, etc.~to +% generate the csname that we wish to define> the |\string|s are +% added in case these tokens are still active. +% \begin{macrocode} + \def\UTFviii@two@octets##1##2{\csname u8:##1\string##2\endcsname}% + \def\UTFviii@three@octets##1##2##3{\csname u8:##1% + \string##2\string##3\endcsname}% + \def\UTFviii@four@octets##1##2##3##4{\csname u8:##1% + \string##2\string##3\string##4\endcsname}% +% \end{macrocode} +% Now we simply:-) need to use the right number of |\expandafter|s to +% finally construct the definition: expanding |\UTFviii@tmp| once to get +% its contents, a second time to replace the prefix command by its +% |\csname| expansion, and a third time to turn the expansion into +% a csname after which the |\gdef| finally gets applied. +% We add an irrelevant |\IeC| and braces around the definition, in +% order to avoid any space after the command being gobbled up +% when the text is written out to an auxiliary file (see +% \texttt{inputenc} for further details +% \begin{macrocode} + \expandafter\expandafter\expandafter + \expandafter\expandafter\expandafter + \expandafter + \gdef\UTFviii@tmp{\IeC{#2}}% + \endgroup +} +% \end{macrocode} +% \end{macro} +% +% +% \begin{macro}{\parse@XML@charref} +% This macro parses a Unicode number (decimal) and returns its +% UTF-8 representation as a sequence of non-active \TeX{} character +% tokens. In the +% original code it had two arguments delimited by \texttt{;} here, +% however, we supply the Unicode number implicitly. +% \begin{macrocode} +\gdef\parse@XML@charref{% +% \end{macrocode} +% We need to keep a few things local, mainly the |\uccode|'s that +% are set up below. However, the group originally used here is +% actually unnecessary since we call this macro only within another +% group; but it will be important to restore the group if this +% macro gets used for other purposes. +% \begin{macrocode} +% \begingroup +% \end{macrocode} +% The original code from David supported the convention that a +% Unicode slot number could be given either as a decimal or as a +% hexadecimal (by starting with \texttt{x}). We do not do this so +% this code is also removed. This could be reactivated if one +% wants to support document commands that accept Unicode numbers +% (but then the first case needs to be changed from an error +% message back to something more useful again). +% \begin{macrocode} +% \uppercase{\count@\if x\noexpand#1"\else#1\fi#2}\relax +% \end{macrocode} +% As |\count@| already contains the right value we make +% |\parse@XML@charref| work without arguments. +% \begin{macrocode} + \ifnum\count@<"A0\relax + \PackageError{inputenc}{Cannot define Unicode char value < 00A0}\@eha +% \end{macrocode} +% Do not ask us to provide an explanation for the code below, it is +% borrowed straight from \texttt{xmltex} by David and we trust him +% totally (and we are too lazy to reread the Unicode book to see if +% this is the correct algorithm).\footnote{We were hoping to also +% find in his work the \TeX{} code for going the other way: from +% UTF-8 octets to Unicode slot number, but no luck!} +% \begin{macrocode} + \else\ifnum\count@<"800\relax + \parse@UTFviii@a,% + \parse@UTFviii@b C\UTFviii@two@octets.,% + \else\ifnum\count@<"10000\relax + \parse@UTFviii@a;% + \parse@UTFviii@a,% + \parse@UTFviii@b E\UTFviii@three@octets.{,;}% + \else + \parse@UTFviii@a;% + \parse@UTFviii@a,% + \parse@UTFviii@a!% + \parse@UTFviii@b F\UTFviii@four@octets.{!,;}% + \fi + \fi + \fi +% \endgroup +} +% \end{macrocode} +% \end{macro} +% +% \begin{macro}{\parse@UTFviii@a} +% \ldots so somebody else can document this part :-) \ldots~David?:-))))! +% \changes{v1.1b}{2004/02/09}{space in the wrong place \cs{count @64}} +% \begin{macrocode} +\gdef\parse@UTFviii@a#1{% + \@tempcnta\count@ + \divide\count@ 64 + \@tempcntb\count@ + \multiply\count@ 64 + \advance\@tempcnta-\count@ + \advance\@tempcnta 128 + \uccode`#1\@tempcnta + \count@\@tempcntb} +% \end{macrocode} +% \end{macro} +% +% \begin{macro}{\parse@UTFviii@b} +% \ldots same here +% \begin{macrocode} +\gdef\parse@UTFviii@b#1#2#3#4{% + \advance\count@ "#10\relax + \uccode`#3\count@ + \uppercase{\gdef\UTFviii@tmp{#2#3#4}}} +% \end{macrocode} +% +% \begin{macrocode} +\endgroup +% \end{macrocode} +% \end{macro} +% +% \begin{macrocode} +\@onlypreamble\DeclareUnicodeCharacter +% \end{macrocode} +% These are preamble only as long as we don't support Unicode +% charrefs in documents. +% \begin{macrocode} +\@onlypreamble\parse@XML@charref +\@onlypreamble\parse@UTFviii@a +\@onlypreamble\parse@UTFviii@b +% \end{macrocode} +% +% +% \subsection{Loading Unicode mappings at begin document} +% +% The original plan was to set up the UTF-8 support at +% |\begin{document}|; but then any text characters used in the preamble +% (as people do even though advised against it) would fail in one way or +% the other. +% So the implementation was changed and the Unicode definition files +% for already defined encodings are loaded here. +% +% We loop through all defined font encodings +% (stored in |\cdp@list|) and for each load a file +% \textit{name}\texttt{enc.dfu} if it exist. That file is then +% supposed to contain |\DeclareUnicodeCharacter| declarations. +% \begin{macrocode} +\begingroup + \def\cdp@elt#1#2#3#4{% + \wlog{Now handling font encoding #1 ...}% + \lowercase{% + \InputIfFileExists{#1enc.dfu}} + {\wlog{... processing UTF-8 mapping file for font encoding #1}}% + {\wlog{... no UTF-8 mapping file for font encoding #1}}% + } + \cdp@list +\endgroup +% \end{macrocode} +% However, we don't know if there are font encodings still to be +% loaded (either with \texttt{fontenc} or directly with |\input| by +% some some package). Font enconding files are loaded only if the +% corresponding encoding has not been loaded yet, and they always +% begin with |\DeclareFontEncoding|. We now redefine the internal +% kernel version of the latter to load the Unicode file if available. +% +% \begin{macrocode} +\def\DeclareFontEncoding@#1#2#3{% + \expandafter + \ifx\csname T@#1\endcsname\relax + \def\cdp@elt{\noexpand\cdp@elt}% + \xdef\cdp@list{\cdp@list\cdp@elt{#1}% + {\default@family}{\default@series}% + {\default@shape}}% + \expandafter\let\csname#1-cmd\endcsname\@changed@cmd + \begingroup + \wlog{Now handling font encoding #1 ...}% + \lowercase{% + \InputIfFileExists{#1enc.dfu}}% + {\wlog{... processing UTF-8 mapping file for font encoding #1}}% + {\wlog{... no UTF-8 mapping file for font encoding #1}}% + \endgroup + \else + \@font@info{Redeclaring font encoding #1}% + \fi + \global\@namedef{T@#1}{#2}% + \global\@namedef{M@#1}{\default@M#3}% + \xdef\LastDeclaredEncoding{#1}% + } +% +% \end{macrocode} +% +% +% +% \section{Mapping characters ---\newline based on font (glyph) encodings} +% +% This section is a first attempt to provide Unicode definitions for +% characters whose standard glyphs are currently provided by the +% standard \LaTeX{} font-encodings |T1|, |OT1|, etc. They are by +% no means completed and need checking. +% +% For example, one should check the already existing input encodings +% for glyphs that may in fact be available and required, +% e.g.~\texttt{latin4} has a number of glyphs with the |\=| +% accent. Since the |T1| encoding does not provide such glyphs, +% these characters are not listed below (yet). +% +% The list below was generated by looking at the current \LaTeX{} font +% encoding files, e.g., \texttt{t1enc.def} and using the work by +% Sebastian Rahtz in (\texttt{ucharacters.sty}), with a few +% modifications. In combinations such as |\^\i| the preferred form +% is that and not |\^i|. +% +% This list has been built from several sources, obviously including +% the Unicode Standard itself. These sources include Passive \TeX{} by +% Sebastian Rahtz, the \texttt{unicode} +% package by Dominique P. G. Unruh (mainly for Latin encodings) and +% \texttt{text4ht} by Eitan Gurari (for Cyrillic ones). +% +% Note that it strictly follows the Mittelbach principles for +% input character encodings: thus it offers no support for using utf8 +% representations of math symbols such as $\times$ or $\div$ (in math mode). +% +% +% \subsection{About the table itself} +% +% In addition to generating indivdual files, the table below is, at present, +% a one-one (we think) partial relationship between the (ill-defined) set +% of LICRs and the Unicode slots "0080 to "FFFF. At present these entries +% are used only to define a collection of partial mappings from Unicode +% slots to LICRs; each of these mappings becomes full if we add an exception +% value (`not defined') to the set of LICRs. +% +% It is probably not essential for the relationship in the full table to be +% one-one; this raises questions suach as: the exact role of LICRs; +% the formal relationships on the set of LICRs; the (non-mathematical) +% relationship between +% LICRs and Unicode (which has its own somewhat fuzzy equivalences); +% and ultimately what a character is and what a character representation +% and/or name is. +% +% Viewed this a way, the result has, perhaps puzzingly, just two (we think) +% gaps in the second 128 `Unicode slots' (00A0 and 00AD): neither of these +% is really a character, of course. +% +% It is unclear the extent to which entries in this table should +% resemble the closely related ones in the 8-bit \texttt{inputenc} files. +% The Unicode standard claims that the first 256 slots `are' ASCII and +% Latin-1. +% +% Of course, \TeX{} itself typically does not treat even many perfectly +% `normal text' 7-bit slots as text characters, so it is unclear +% whether \LaTeX{} should even attempt to deal in any consistent way with +% those Unicode slots that are not definitive text characters. +% +% +% \subsection{The mapping table} +% +% Note that the first argument must be a 4-hex-digit number greater +% than \texttt{00BF}. +% +% \begin{macrocode} +%\DeclareUnicodeCharacter{00A1}{\textexclamdown} +%\DeclareUnicodeCharacter{00A2}{\textcent} +%\DeclareUnicodeCharacter{00A3}{\textsterling} +%\DeclareUnicodeCharacter{00A4}{\textcurrency} +%\DeclareUnicodeCharacter{00A5}{\textyen} +%\DeclareUnicodeCharacter{00A6}{\textbrokenbar} +%\DeclareUnicodeCharacter{00A7}{\textsection} +%\DeclareUnicodeCharacter{00A8}{\textasciidieresis} +%\DeclareUnicodeCharacter{00A9}{\textcopyright} +%\DeclareUnicodeCharacter{00AA}{\textordfeminine} +%\DeclareUnicodeCharacter{00AB}{\guillemotleft} +%\DeclareUnicodeCharacter{00AC}{\textlnot} +%\DeclareUnicodeCharacter{00AE}{\textregistered} +%\DeclareUnicodeCharacter{00AF}{\textasciimacron} +%\DeclareUnicodeCharacter{00B0}{\textdegree} +%\DeclareUnicodeCharacter{00B1}{\textpm} +%\DeclareUnicodeCharacter{00B2}{\texttwosuperior} +%\DeclareUnicodeCharacter{00B3}{\textthreesuperior} +%\DeclareUnicodeCharacter{00B4}{\textasciiacute} +%\DeclareUnicodeCharacter{00B5}{\textmu} % micro sign +%\DeclareUnicodeCharacter{00B6}{\textparagraph} +%\DeclareUnicodeCharacter{00B7}{\textperiodcentered} +%\DeclareUnicodeCharacter{00B8}{\c\ } +%\DeclareUnicodeCharacter{00B9}{\textonesuperior} +%\DeclareUnicodeCharacter{00BA}{\textordmasculine} +%\DeclareUnicodeCharacter{00BB}{\guillemotright} +%\DeclareUnicodeCharacter{00BC}{\textonequarter} +%\DeclareUnicodeCharacter{00BD}{\textonehalf} +%\DeclareUnicodeCharacter{00BE}{\textthreequarters} +%\DeclareUnicodeCharacter{00BF}{\textquestiondown} +%\DeclareUnicodeCharacter{00C0}{\@tabacckludge`A} +%\DeclareUnicodeCharacter{00C1}{\@tabacckludge'A} +%\DeclareUnicodeCharacter{00C2}{\^A} +%\DeclareUnicodeCharacter{00C3}{\~A} +%\DeclareUnicodeCharacter{00C4}{\"A} +%\DeclareUnicodeCharacter{00C5}{\r A} +%\DeclareUnicodeCharacter{00C6}{\AE} +%\DeclareUnicodeCharacter{00C7}{\c C} +%\DeclareUnicodeCharacter{00C8}{\@tabacckludge`E} +%\DeclareUnicodeCharacter{00C9}{\@tabacckludge'E} +%\DeclareUnicodeCharacter{00CA}{\^E} +%\DeclareUnicodeCharacter{00CB}{\"E} +%\DeclareUnicodeCharacter{00CC}{\@tabacckludge`I} +%\DeclareUnicodeCharacter{00CD}{\@tabacckludge'I} +%\DeclareUnicodeCharacter{00CE}{\^I} +%\DeclareUnicodeCharacter{00CF}{\"I} +%\DeclareUnicodeCharacter{00D0}{\DH} +%\DeclareUnicodeCharacter{00D1}{\~N} +%\DeclareUnicodeCharacter{00D2}{\@tabacckludge`O} +%\DeclareUnicodeCharacter{00D3}{\@tabacckludge'O} +%\DeclareUnicodeCharacter{00D4}{\^O} +%\DeclareUnicodeCharacter{00D5}{\~O} +%\DeclareUnicodeCharacter{00D6}{\"O} +%\DeclareUnicodeCharacter{00D7}{\texttimes} +%\DeclareUnicodeCharacter{00D8}{\O} +%\DeclareUnicodeCharacter{00D9}{\@tabacckludge`U} +%\DeclareUnicodeCharacter{00DA}{\@tabacckludge'U} +%\DeclareUnicodeCharacter{00DB}{\^U} +%\DeclareUnicodeCharacter{00DC}{\"U} +%\DeclareUnicodeCharacter{00DD}{\@tabacckludge'Y} +%\DeclareUnicodeCharacter{00DE}{\TH} +%\DeclareUnicodeCharacter{00DF}{\ss} +%\DeclareUnicodeCharacter{00E0}{\@tabacckludge`a} +%\DeclareUnicodeCharacter{00E1}{\@tabacckludge'a} +%\DeclareUnicodeCharacter{00E2}{\^a} +%\DeclareUnicodeCharacter{00E3}{\~a} +%\DeclareUnicodeCharacter{00E4}{\"a} +%\DeclareUnicodeCharacter{00E5}{\r a} +%\DeclareUnicodeCharacter{00E6}{\ae} +%\DeclareUnicodeCharacter{00E7}{\c c} +%\DeclareUnicodeCharacter{00E8}{\@tabacckludge`e} +%\DeclareUnicodeCharacter{00E9}{\@tabacckludge'e} +%\DeclareUnicodeCharacter{00EA}{\^e} +%\DeclareUnicodeCharacter{00EB}{\"e} +%\DeclareUnicodeCharacter{00EC}{\@tabacckludge`\i} +%\DeclareUnicodeCharacter{00ED}{\@tabacckludge'\i} +%\DeclareUnicodeCharacter{00EE}{\^\i} +%\DeclareUnicodeCharacter{00EF}{\"\i} +%\DeclareUnicodeCharacter{00F0}{\dh} +%\DeclareUnicodeCharacter{00F1}{\~n} +%\DeclareUnicodeCharacter{00F2}{\@tabacckludge`o} +%\DeclareUnicodeCharacter{00F3}{\@tabacckludge'o} +%\DeclareUnicodeCharacter{00F4}{\^o} +%\DeclareUnicodeCharacter{00F5}{\~o} +%\DeclareUnicodeCharacter{00F6}{\"o} +%\DeclareUnicodeCharacter{00F7}{\textdiv} +%\DeclareUnicodeCharacter{00F8}{\o} +%\DeclareUnicodeCharacter{00F9}{\@tabacckludge`u} +%\DeclareUnicodeCharacter{00FA}{\@tabacckludge'u} +%\DeclareUnicodeCharacter{00FB}{\^u} +%\DeclareUnicodeCharacter{00FC}{\"u} +%\DeclareUnicodeCharacter{00FD}{\@tabacckludge'y} +%\DeclareUnicodeCharacter{00FE}{\th} +%\DeclareUnicodeCharacter{00FF}{\"y} +%\DeclareUnicodeCharacter{0102}{\u A} +%\DeclareUnicodeCharacter{0103}{\u a} +%\DeclareUnicodeCharacter{0104}{\k A} +%\DeclareUnicodeCharacter{0105}{\k a} +%\DeclareUnicodeCharacter{0106}{\@tabacckludge'C} +%\DeclareUnicodeCharacter{0107}{\@tabacckludge'c} +%\DeclareUnicodeCharacter{010C}{\v C} +%\DeclareUnicodeCharacter{010D}{\v c} +%\DeclareUnicodeCharacter{010E}{\v D} +%\DeclareUnicodeCharacter{010F}{\v d} +%\DeclareUnicodeCharacter{0110}{\DJ} +%\DeclareUnicodeCharacter{0111}{\dj} +%\DeclareUnicodeCharacter{0118}{\k E} +%\DeclareUnicodeCharacter{0119}{\k e} +%\DeclareUnicodeCharacter{011A}{\v E} +%\DeclareUnicodeCharacter{011B}{\v e} +%\DeclareUnicodeCharacter{011E}{\u G} +%\DeclareUnicodeCharacter{011F}{\u g} +%\DeclareUnicodeCharacter{0130}{\.I} +%\DeclareUnicodeCharacter{0131}{\i} +%\DeclareUnicodeCharacter{0139}{\@tabacckludge'L} +%\DeclareUnicodeCharacter{013A}{\@tabacckludge'l} +%\DeclareUnicodeCharacter{013D}{\v L} +%\DeclareUnicodeCharacter{013E}{\v l} +%\DeclareUnicodeCharacter{0141}{\L} +%\DeclareUnicodeCharacter{0142}{\l} +%\DeclareUnicodeCharacter{0143}{\@tabacckludge'N} +%\DeclareUnicodeCharacter{0144}{\@tabacckludge'n} +%\DeclareUnicodeCharacter{0147}{\v N} +%\DeclareUnicodeCharacter{0148}{\v n} +%\DeclareUnicodeCharacter{014A}{\NG} +%\DeclareUnicodeCharacter{014B}{\ng} +%\DeclareUnicodeCharacter{0150}{\H O} +%\DeclareUnicodeCharacter{0151}{\H o} +%\DeclareUnicodeCharacter{0152}{\OE} +%\DeclareUnicodeCharacter{0153}{\oe} +%\DeclareUnicodeCharacter{0154}{\@tabacckludge'R} +%\DeclareUnicodeCharacter{0155}{\@tabacckludge'r} +%\DeclareUnicodeCharacter{0158}{\v R} +%\DeclareUnicodeCharacter{0159}{\v r} +%\DeclareUnicodeCharacter{015A}{\@tabacckludge'S} +%\DeclareUnicodeCharacter{015B}{\@tabacckludge's} +%\DeclareUnicodeCharacter{015E}{\c S} +%\DeclareUnicodeCharacter{015F}{\c s} +%\DeclareUnicodeCharacter{0160}{\v S} +%\DeclareUnicodeCharacter{0161}{\v s} +%\DeclareUnicodeCharacter{0162}{\c T} +%\DeclareUnicodeCharacter{0163}{\c t} +%\DeclareUnicodeCharacter{0164}{\v T} +%\DeclareUnicodeCharacter{0165}{\v t} +%\DeclareUnicodeCharacter{016E}{\r U} +%\DeclareUnicodeCharacter{016F}{\r u} +%\DeclareUnicodeCharacter{0170}{\H U} +%\DeclareUnicodeCharacter{0171}{\H u} +%\DeclareUnicodeCharacter{0178}{\"Y} +%\DeclareUnicodeCharacter{0179}{\@tabacckludge'Z} +%\DeclareUnicodeCharacter{017A}{\@tabacckludge'z} +%\DeclareUnicodeCharacter{017B}{\.Z} +%\DeclareUnicodeCharacter{017C}{\.z} +%\DeclareUnicodeCharacter{017D}{\v Z} +%\DeclareUnicodeCharacter{017E}{\v z} +%\DeclareUnicodeCharacter{0192}{\textflorin} +%\DeclareUnicodeCharacter{02C6}{\textasciicircum} +%\DeclareUnicodeCharacter{02C7}{\textasciicaron} +%\DeclareUnicodeCharacter{02CA}{\textasciitilde} +%\DeclareUnicodeCharacter{02D8}{\textasciibreve} +%\DeclareUnicodeCharacter{02D9}{\textperiodcentered} +%\DeclareUnicodeCharacter{02DD}{\textacutedbl} +%\DeclareUnicodeCharacter{0401}{\CYRYO} +%\DeclareUnicodeCharacter{0402}{\CYRDJE} +%\DeclareUnicodeCharacter{0404}{\CYRIE} +%\DeclareUnicodeCharacter{0405}{\CYRDZE} +%\DeclareUnicodeCharacter{0406}{\CYRII} +%\DeclareUnicodeCharacter{0407}{\CYRYI} +%\DeclareUnicodeCharacter{0408}{\CYRJE} +%\DeclareUnicodeCharacter{0409}{\CYRLJE} +%\DeclareUnicodeCharacter{040A}{\CYRNJE} +%\DeclareUnicodeCharacter{040B}{\CYRTSHE} +%\DeclareUnicodeCharacter{040E}{\CYRUSHRT} +%\DeclareUnicodeCharacter{040F}{\CYRDZHE} +%\DeclareUnicodeCharacter{0410}{\CYRA} +%\DeclareUnicodeCharacter{0411}{\CYRB} +%\DeclareUnicodeCharacter{0412}{\CYRV} +%\DeclareUnicodeCharacter{0413}{\CYRG} +%\DeclareUnicodeCharacter{0414}{\CYRD} +%\DeclareUnicodeCharacter{0415}{\CYRE} +%\DeclareUnicodeCharacter{0416}{\CYRZH} +%\DeclareUnicodeCharacter{0417}{\CYRZ} +%\DeclareUnicodeCharacter{0418}{\CYRI} +%\DeclareUnicodeCharacter{0419}{\CYRISHRT} +%\DeclareUnicodeCharacter{041A}{\CYRK} +%\DeclareUnicodeCharacter{041B}{\CYRL} +%\DeclareUnicodeCharacter{041C}{\CYRM} +%\DeclareUnicodeCharacter{041D}{\CYRN} +%\DeclareUnicodeCharacter{041E}{\CYRO} +%\DeclareUnicodeCharacter{041F}{\CYRP} +%\DeclareUnicodeCharacter{0420}{\CYRR} +%\DeclareUnicodeCharacter{0421}{\CYRS} +%\DeclareUnicodeCharacter{0422}{\CYRT} +%\DeclareUnicodeCharacter{0423}{\CYRU} +%\DeclareUnicodeCharacter{0424}{\CYRF} +%\DeclareUnicodeCharacter{0425}{\CYRH} +%\DeclareUnicodeCharacter{0426}{\CYRC} +%\DeclareUnicodeCharacter{0427}{\CYRCH} +%\DeclareUnicodeCharacter{0428}{\CYRSH} +%\DeclareUnicodeCharacter{0429}{\CYRSHCH} +%\DeclareUnicodeCharacter{042A}{\CYRHRDSN} +%\DeclareUnicodeCharacter{042B}{\CYRERY} +%\DeclareUnicodeCharacter{042C}{\CYRSFTSN} +%\DeclareUnicodeCharacter{042D}{\CYREREV} +%\DeclareUnicodeCharacter{042E}{\CYRYU} +%\DeclareUnicodeCharacter{042F}{\CYRYA} +%\DeclareUnicodeCharacter{0430}{\cyra} +%\DeclareUnicodeCharacter{0431}{\cyrb} +%\DeclareUnicodeCharacter{0432}{\cyrv} +%\DeclareUnicodeCharacter{0433}{\cyrg} +%\DeclareUnicodeCharacter{0434}{\cyrd} +%\DeclareUnicodeCharacter{0435}{\cyre} +%\DeclareUnicodeCharacter{0436}{\cyrzh} +%\DeclareUnicodeCharacter{0437}{\cyrz} +%\DeclareUnicodeCharacter{0438}{\cyri} +%\DeclareUnicodeCharacter{0439}{\cyrishrt} +%\DeclareUnicodeCharacter{043A}{\cyrk} +%\DeclareUnicodeCharacter{043B}{\cyrl} +%\DeclareUnicodeCharacter{043C}{\cyrm} +%\DeclareUnicodeCharacter{043D}{\cyrn} +%\DeclareUnicodeCharacter{043E}{\cyro} +%\DeclareUnicodeCharacter{043F}{\cyrp} +%\DeclareUnicodeCharacter{0440}{\cyrr} +%\DeclareUnicodeCharacter{0441}{\cyrs} +%\DeclareUnicodeCharacter{0442}{\cyrt} +%\DeclareUnicodeCharacter{0443}{\cyru} +%\DeclareUnicodeCharacter{0444}{\cyrf} +%\DeclareUnicodeCharacter{0445}{\cyrh} +%\DeclareUnicodeCharacter{0446}{\cyrc} +%\DeclareUnicodeCharacter{0447}{\cyrch} +%\DeclareUnicodeCharacter{0448}{\cyrsh} +%\DeclareUnicodeCharacter{0449}{\cyrshch} +%\DeclareUnicodeCharacter{044A}{\cyrhrdsn} +%\DeclareUnicodeCharacter{044B}{\cyrery} +%\DeclareUnicodeCharacter{044C}{\cyrsftsn} +%\DeclareUnicodeCharacter{044D}{\cyrerev} +%\DeclareUnicodeCharacter{044E}{\cyryu} +%\DeclareUnicodeCharacter{044F}{\cyrya} +%\DeclareUnicodeCharacter{0451}{\cyryo} +%\DeclareUnicodeCharacter{0452}{\cyrdje} +%\DeclareUnicodeCharacter{0454}{\cyrie} +%\DeclareUnicodeCharacter{0455}{\cyrdze} +%\DeclareUnicodeCharacter{0456}{\cyrii} +%\DeclareUnicodeCharacter{0457}{\cyryi} +%\DeclareUnicodeCharacter{0458}{\cyrje} +%\DeclareUnicodeCharacter{0459}{\cyrlje} +%\DeclareUnicodeCharacter{045A}{\cyrnje} +%\DeclareUnicodeCharacter{045B}{\cyrtshe} +%\DeclareUnicodeCharacter{045E}{\cyrushrt} +%\DeclareUnicodeCharacter{045F}{\cyrdzhe} +%\DeclareUnicodeCharacter{0462}{\CYRYAT} +%\DeclareUnicodeCharacter{0463}{\cyryat} +%\DeclareUnicodeCharacter{046A}{\CYRBYUS} +%\DeclareUnicodeCharacter{046B}{\cyrbyus} +%\DeclareUnicodeCharacter{0472}{\CYRFITA} +%\DeclareUnicodeCharacter{0473}{\cyrfita} +%\DeclareUnicodeCharacter{0474}{\CYRIZH} +%\DeclareUnicodeCharacter{0475}{\cyrizh} +%\DeclareUnicodeCharacter{048C}{\CYRSEMISFTSN} +%\DeclareUnicodeCharacter{048D}{\cyrsemisftsn} +%\DeclareUnicodeCharacter{048E}{\CYRRTICK} +%\DeclareUnicodeCharacter{048F}{\cyrrtick} +%\DeclareUnicodeCharacter{0490}{\CYRGUP} +%\DeclareUnicodeCharacter{0491}{\cyrgup} +%\DeclareUnicodeCharacter{0492}{\CYRGHCRS} +%\DeclareUnicodeCharacter{0493}{\cyrghcrs} +%\DeclareUnicodeCharacter{0494}{\CYRGHK} +%\DeclareUnicodeCharacter{0495}{\cyrghk} +%\DeclareUnicodeCharacter{0496}{\CYRZHDSC} +%\DeclareUnicodeCharacter{0497}{\cyrzhdsc} +%\DeclareUnicodeCharacter{0498}{\CYRZDSC} +%\DeclareUnicodeCharacter{0499}{\cyrzdsc} +%\DeclareUnicodeCharacter{049A}{\CYRKDSC} +%\DeclareUnicodeCharacter{049B}{\cyrkdsc} +%\DeclareUnicodeCharacter{049C}{\CYRKVCRS} +%\DeclareUnicodeCharacter{049D}{\cyrkvcrs} +%\DeclareUnicodeCharacter{049E}{\CYRKHCRS} +%\DeclareUnicodeCharacter{049F}{\cyrkhcrs} +%\DeclareUnicodeCharacter{04A0}{\CYRKBEAK} +%\DeclareUnicodeCharacter{04A1}{\cyrkbeak} +%\DeclareUnicodeCharacter{04A2}{\CYRNDSC} +%\DeclareUnicodeCharacter{04A3}{\cyrndsc} +%\DeclareUnicodeCharacter{04A4}{\CYRNG} +%\DeclareUnicodeCharacter{04A5}{\cyrng} +%\DeclareUnicodeCharacter{04A6}{\CYRPHK} +%\DeclareUnicodeCharacter{04A7}{\cyrphk} +%\DeclareUnicodeCharacter{04A8}{\CYRABHHA} +%\DeclareUnicodeCharacter{04A9}{\cyrabhha} +%\DeclareUnicodeCharacter{04AA}{\CYRSDSC} +%\DeclareUnicodeCharacter{04AB}{\cyrsdsc} +%\DeclareUnicodeCharacter{04AC}{\CYRTDSC} +%\DeclareUnicodeCharacter{04AD}{\cyrtdsc} +%\DeclareUnicodeCharacter{04AE}{\CYRY} +%\DeclareUnicodeCharacter{04AF}{\cyry} +%\DeclareUnicodeCharacter{04B0}{\CYRYHCRS} +%\DeclareUnicodeCharacter{04B1}{\cyryhcrs} +%\DeclareUnicodeCharacter{04B2}{\CYRHDSC} +%\DeclareUnicodeCharacter{04B3}{\cyrhdsc} +%\DeclareUnicodeCharacter{04B4}{\CYRTETSE} +%\DeclareUnicodeCharacter{04B5}{\cyrtetse} +%\DeclareUnicodeCharacter{04B6}{\CYRCHRDSC} +%\DeclareUnicodeCharacter{04B7}{\cyrchrdsc} +%\DeclareUnicodeCharacter{04B8}{\CYRCHVCRS} +%\DeclareUnicodeCharacter{04B9}{\cyrchvcrs} +%\DeclareUnicodeCharacter{04BA}{\CYRSHHA} +%\DeclareUnicodeCharacter{04BB}{\cyrshha} +%\DeclareUnicodeCharacter{04BC}{\CYRABHCH} +%\DeclareUnicodeCharacter{04BD}{\cyrabhch} +%\DeclareUnicodeCharacter{04BE}{\CYRABHCHDSC} +%\DeclareUnicodeCharacter{04BF}{\cyrabhchdsc} +%\DeclareUnicodeCharacter{04C0}{\CYRpalochka} +%\DeclareUnicodeCharacter{04C3}{\CYRKHK} +%\DeclareUnicodeCharacter{04C4}{\cyrkhk} +%\DeclareUnicodeCharacter{04C5}{\CYRLDSC} +%\DeclareUnicodeCharacter{04C6}{\cyrldsc} +%\DeclareUnicodeCharacter{04C7}{\CYRNHK} +%\DeclareUnicodeCharacter{04C8}{\cyrnhk} +%\DeclareUnicodeCharacter{04CB}{\CYRCHLDSC} +%\DeclareUnicodeCharacter{04CC}{\cyrchldsc} +%\DeclareUnicodeCharacter{04CD}{\CYRMDSC} +%\DeclareUnicodeCharacter{04CE}{\cyrmdsc} +%\DeclareUnicodeCharacter{04D4}{\CYRAE} +%\DeclareUnicodeCharacter{04D5}{\cyrae} +%\DeclareUnicodeCharacter{04D8}{\CYRSCHWA} +%\DeclareUnicodeCharacter{04D9}{\cyrschwa} +%\DeclareUnicodeCharacter{04E0}{\CYRABHDZE} +%\DeclareUnicodeCharacter{04E1}{\cyrabhdze} +%\DeclareUnicodeCharacter{04E8}{\CYROTLD} +%\DeclareUnicodeCharacter{04E9}{\cyrotld} +%\DeclareUnicodeCharacter{0E37}{\textbaht} +%\DeclareUnicodeCharacter{200C}{\textcompwordmark} +%\DeclareUnicodeCharacter{2013}{\textendash} +%\DeclareUnicodeCharacter{2014}{\textemdash} +%\DeclareUnicodeCharacter{2016}{\textbardbl} +%\DeclareUnicodeCharacter{2018}{\textquoteleft} +%\DeclareUnicodeCharacter{2019}{\textquoteright} +%\DeclareUnicodeCharacter{201A}{\quotesinglbase} +%\DeclareUnicodeCharacter{201C}{\textquotedblleft} +%\DeclareUnicodeCharacter{201D}{\textquotedblright} +%\DeclareUnicodeCharacter{201E}{\quotedblbase} +%\DeclareUnicodeCharacter{2020}{\textdagger} +%\DeclareUnicodeCharacter{2021}{\textdaggerdbl} +%\DeclareUnicodeCharacter{2022}{\textbullet} +%\DeclareUnicodeCharacter{2026}{\textellipsis} +%\DeclareUnicodeCharacter{2030}{\textperthousand} +%\DeclareUnicodeCharacter{2031}{\textpertenthousand} +%\DeclareUnicodeCharacter{2039}{\guilsinglleft} +%\DeclareUnicodeCharacter{203A}{\guilsinglright} +%\DeclareUnicodeCharacter{203B}{\textreferencemark} +%\DeclareUnicodeCharacter{203D}{\textinterrobang} +%\DeclareUnicodeCharacter{2044}{\textfractionsolidus} +%\DeclareUnicodeCharacter{204E}{\textasteriskcentered} % LOW ASTERISK +%\DeclareUnicodeCharacter{2052}{\textdiscount} +%\DeclareUnicodeCharacter{20A1}{\textcolonmonetary} +%\DeclareUnicodeCharacter{20A4}{\textlira} +%\DeclareUnicodeCharacter{20A6}{\textnaira} +%\DeclareUnicodeCharacter{20A9}{\textwon} +%\DeclareUnicodeCharacter{20AB}{\textdong} +%\DeclareUnicodeCharacter{20AC}{\texteuro} +%\DeclareUnicodeCharacter{20B1}{\textpeso} +%\DeclareUnicodeCharacter{2103}{\textcelsius} +%\DeclareUnicodeCharacter{2116}{\textnumero} +%\DeclareUnicodeCharacter{2117}{\textcircledP} +%\DeclareUnicodeCharacter{211E}{\textrecipe} +%\DeclareUnicodeCharacter{2120}{\textservicemark} +%\DeclareUnicodeCharacter{2122}{\texttrademark} +%\DeclareUnicodeCharacter{2126}{\textohm} +%\DeclareUnicodeCharacter{2127}{\textmho} +%\DeclareUnicodeCharacter{212E}{\textestimated} +%\DeclareUnicodeCharacter{2190}{\textleftarrow} +%\DeclareUnicodeCharacter{2191}{\textuparrow} +%\DeclareUnicodeCharacter{2192}{\textrightarrow} +%\DeclareUnicodeCharacter{2193}{\textdownarrow} +%\DeclareUnicodeCharacter{2329}{\textlangle} +%\DeclareUnicodeCharacter{232A}{\textrangle} +%\DeclareUnicodeCharacter{2422}{\textblank} +%\DeclareUnicodeCharacter{2423}{\textvisiblespace} +%\DeclareUnicodeCharacter{25E6}{\textopenbullet} +%\DeclareUnicodeCharacter{25EF}{\textbigcircle} +%\DeclareUnicodeCharacter{266A}{\textmusicalnote} +% \end{macrocode} +% The following definitions are in the encoding file but have no +% direct equivalent in Unicode or simply do not make sense in that +% context (or we have not yet found anything or \ldots :-). For +% example, the non-combining accent charcaters are certainly +% available somehwere but these are not equivalent to a \TeX{} +% accent command. +%\begin{verbatim} +%\DeclareTextSymbol{\j}{OT1}{17} +%\DeclareTextSymbol{\SS}{T1}{223} +%\DeclareTextSymbol{\textcompwordmark}{T1}{23} +% +%\DeclareTextAccent{\"}{OT1}{127} +%\DeclareTextAccent{\'}{OT1}{19} +%\DeclareTextAccent{\.}{OT1}{95} +%\DeclareTextAccent{\=}{OT1}{22} +%\DeclareTextAccent{\H}{OT1}{125} +%\DeclareTextAccent{\^}{OT1}{94} +%\DeclareTextAccent{\`}{OT1}{18} +%\DeclareTextAccent{\r}{OT1}{23} +%\DeclareTextAccent{\u}{OT1}{21} +%\DeclareTextAccent{\v}{OT1}{20} +%\DeclareTextAccent{\~}{OT1}{126} +%\DeclareTextCommand{\b}{OT1}[1] +%\DeclareTextCommand{\c}{OT1}[1] +%\DeclareTextCommand{\d}{OT1}[1] +%\DeclareTextCommand{\k}{T1}[1] +%\end{verbatim} +% +% +% +% \subsection{Mappings for OT1 glyphs} +% +% This is even more incomplete as again it covers only the single +% glyphs from |OT1| plus some that have been explicitly defined for +% this encoding. Everything that is provided in |T1|, and that +% could be provided as composite glyphs via |OT1|, could and +% probably should be set up as well. Which leaves the many things +% that are not provided in |T1| but can be provided in |OT1| (and +% in |T1|) by composite glyphs. + +% \begin{macrocode} +% \end{macrocode} +% Stuff not mapped (note that |\j| ($\jmath$) is not equivalent to any +% Unicode character): +%\begin{verbatim} +%\DeclareTextSymbol{\j}{OT1}{17} +%\DeclareTextAccent{\"}{OT1}{127} +%\DeclareTextAccent{\'}{OT1}{19} +%\DeclareTextAccent{\.}{OT1}{95} +%\DeclareTextAccent{\=}{OT1}{22} +%\DeclareTextAccent{\^}{OT1}{94} +%\DeclareTextAccent{\`}{OT1}{18} +%\DeclareTextAccent{\~}{OT1}{126} +%\DeclareTextAccent{\H}{OT1}{125} +%\DeclareTextAccent{\u}{OT1}{21} +%\DeclareTextAccent{\v}{OT1}{20} +%\DeclareTextAccent{\r}{OT1}{23} +%\DeclareTextCommand{\b}{OT1}[1] +%\DeclareTextCommand{\c}{OT1}[1] +%\DeclareTextCommand{\d}{OT1}[1] +%\end{verbatim} +% +% +% +% \subsection{Mappings for OMS glyphs} +% +% Characters like |\textbackslash| are not mapped as they are +% (primarily) only in the lower 127 and the code here only sets up +% mappings for UTF-8 characters that are at least 2 octets long. +%\begin{verbatim} +%\DeclareTextSymbol{\textbackslash}{OMS}{110} % "6E +%\DeclareTextSymbol{\textbar}{OMS}{106} % "6A +%\DeclareTextSymbol{\textbraceleft}{OMS}{102} % "66 +%\DeclareTextSymbol{\textbraceright}{OMS}{103} % "67 +%\end{verbatim} +% +% But the following (and some others) might actually lurk in Unicode +% somewhere\ldots +%\begin{verbatim} +%\DeclareTextSymbol{\textasteriskcentered}{OMS}{3} % "03 +%\DeclareTextCommand{\textcircled}{OMS} +%\end{verbatim} +% +% +% +% +% \subsection{Mappings for TS1 glyphs} +% +% Exercise for somebody else. +% +% +% \subsection{Mappings for \texttt{latex.ltx} glyphs} +% +% There is also a collection of characters already set up in the kernel, +% one way or the other. Since these do not clearly relate to any +% particular font encoding they are mapped when the +% \texttt{utf8} support is first set up. +% +% Also there are a number of |\providecommand|s in the various input +% encoding files which may or may not go into this part. +% \changes{v1.1b}{2004/02/09}{added commands already defined in the kernel} +% \begin{macrocode} +%<*utf8> +% This space is intentionally empty ... +% +% \end{macrocode} +% +% +% \section{A test document} +% +% Here is a very small test document which may or may not survive +% if the current document is transfered from one place to the +% other. +% \begin{macrocode} +%<*test> +\documentclass{article} + +\usepackage[latin1,utf8]{inputenc} +\usepackage[T1]{fontenc} +\usepackage{trace} + +\scrollmode % to run past the error below + +\begin{document} + + German umlauts in UTF-8: ^^c3^^a4^^c3^^b6^^c3^^bc %%% äöü + +\inputencoding{latin1} % switch to latin1 + + German umlauts in UTF-8 but read by latin1 (and will produce one + error since \verb=\textcurrency= is not provided): ^^c3^^a4^^c3^^b6^^c3^^bc + +\inputencoding{utf8} % switch back to utf8 + + German umlauts in UTF-8: ^^c3^^a4^^c3^^b6^^c3^^bc + + +Some codes that should produce errors as nothing is set up +for them: ^^c3F ^^e1^^a4^^b6 + +And some that are not legal utf8 sequences: ^^c3X ^^e1XY + +\showoutput +\tracingstats=2 +\stop +% +% \end{macrocode} +% +% \Finale +% +\endinput -- cgit v1.2.3