diff options
Diffstat (limited to 'Master/texmf-dist/tex')
29 files changed, 13546 insertions, 0 deletions
diff --git a/Master/texmf-dist/tex/latex/frankenstein/abbrevs.cfg b/Master/texmf-dist/tex/latex/frankenstein/abbrevs.cfg new file mode 100644 index 00000000000..7c3143045c2 --- /dev/null +++ b/Master/texmf-dist/tex/latex/frankenstein/abbrevs.cfg @@ -0,0 +1,290 @@ +% \iffalse +%% +% Even if you don't want any code in this file, leave the empty file, or else +% loading the \package{abbrevs} package will consume extra time as it searches +% for this file. +%% +% \fi +% \begin{macrocode} +\def\fileinfo{Abbrevs package configuration} +\def\fileversion{v1.2} +\def\filedate{2001/08/31} +\def\docdate{1997/10/18} +% \end{macrocode} +% +% \begin{macrocode} +\ProvidesFile{abbrevs.cfg} +% \end{macrocode} +% +% \AddToCheckSum{25} +% +% \section{\cname{DateMarkSize}} +% +% \begin{macro}{\DateMarkSize} +% I like to use this definition instead of the one in the main file, but I +% didn't want to require \package{abbrevs} to depend on \package{relsize}. +% \begin{macrocode} +\RequirePackage{relsize} +\def\DateMarkSize {% + \relsize{-1}% +} +% \end{macrocode} +% \end{macro} +% +% \section{Backwards compatibility} +% +% \begin{macro}{\TMNewCategory} +% \begin{macro}{\TMDefineAbbrevPlain} +% This can be uncommented to deal with anything you might have written that +% referred to these variables before I changed their names. +% \begin{macrocode} +% \newlet\TMNewCategory\NewAbbrevCategory +% \newlet\TMDefineAbbrevPlain\TMDefineAbbrevStandard +% \end{macrocode} +% \end{macro} +% \end{macro} +% +% \section{Suggestions} +% +% Here are ideas commented out that you might want to try. +% +% You can learn a helpful general strategy about how to work with hooks in +% \LaTeX{} from this example. If you put the inhibitor directly into +% \cs\PreFootnote, you could never take it out without either losing whatever +% else had been put into \cs\PreFootnote, or using some thorny procedure that +% stepped through the macro and removed just the inhibitor (you don't want to +% try that). If you add a ``subhook'' to \cs\PreFootnote, you can turn the +% subhook on or off without even knowing what else in in \cs\PreFootnote. You +% can't redefine \cs\TMInhibitSwitchingtrue. A \cs\newcommand would work as +% well as the \cs\newlet here, a tad less efficient. +% \begin{macrocode} +% \newlet\FootnoteTMHook\TMInhibitSwitchingtrue +% \addto@macro\PreFootnote {% +% \FootnoteTMHook +% } +% \end{macrocode} +% To undo the effect later, say \code{\let\FootnoteTMHook\relax} or +% \code{\global\let}\lips as appropriate. +% +% \part{Testing} +% +% \ResetAbbrevs{All} +% +% I'm presently writing a dissertation on \beckett. Although there is +% comparatively little biographical material available, it is well known that +% he spent several years under the wing of \joyce, another of the great writers +% in English this century. \joyce and \beckett, it is curious, like other +% great writers, both had trouble with their vision, and both were exiles in +% some sense. One of my favorite pieces by \beckett is \worst, a short work +% written in the 1980's not long before his death: ``Fail again. Fail +% better.'' \worst is lyric and exalting to me. A work I feel is underrated +% is the radio play \fall (all but his three long plays are collected in \csp). +% It's extremely funny, and very touchingly compassionate. Because it is a +% radio play, it loses less from performance to reading. I would recommend +% \fall to anyone. His later plays (and fiction) are famously enigmatic, but +% with a little practice, it is not hard to see the same lyric beauty and +% compassion. Take the brief television play \nacht (in \csp of course), which +% has no dialogue, only a few murmured bars of the Schubert song, also brief, +% and also called \nacht---it's one of the most hauntingly beautiful few +% minutes of music I've ever heard, and I particularly recommend Cheryl +% Studer's recording on Deutsche Grammophone. Every other recording I've heard +% plays too fast. +% +% \ResetAbbrevs{All} +% +% \joyceshort is short for \joyce, not \joyce Smith. +% +% \ResetAbbrevs{All} +% +% Now some more rigious and boring testing. Each pair should be identical. +% +% \newbook\aaa{initial}[subsequent] +% \newname\www{tmacro}[tmacro-subsequent] +% +% {\parindent0pt +% +% ^^A\def\ldebug#1{\tracingmacros#1\tracingcommands#1\VerboseErrors\relax} +% \let\ldebug\Gobble +% +% \textit{\textitswitch{initial} hello}\\ +% \ldebug1\relax +% \textit{\aaa hello} +% \ldebug0\relax +% +% \textup{\textitswitch{subsequent} hello}\\ +% \ldebug1\relax +% \textup{\aaa hello} +% \ldebug0\relax +% +% \textit{subsequent}~tie\\ +% \ldebug1\relax +% \aaa~tie +% \ldebug0\relax +% +% \textit{subsequent} regular text\\ +% \ldebug1\relax +% \aaa regular text +% \ldebug0\relax +% +% \textit{subsequent}: colon\\ +% \ldebug1\relax +% \aaa: colon +% \ldebug0\relax +% +% \textit{subsequent}; semicolon\\ +% \ldebug1\relax +% \aaa; semicolon +% \ldebug0\relax +% +% \textit{subsequent}. Period.\\ +% \ldebug1\relax +% \aaa. Period. +% \ldebug0\relax +% +% \textit{subsequent}! Exclamation point.\\ +% \ldebug1\relax +% \aaa! Exclamation point. +% \ldebug0\relax +% +% \textit{subsequent}? Question mark.\\ +% \ldebug1\relax +% \aaa? Question mark. +% \ldebug0\relax +% +% \textit{subsequent}-hyphen.\\ +% \ldebug1\relax +% \aaa-hyphen. +% \ldebug0\relax +% +% \textit{subsequent} \texttt{texttt}\\ +% \ldebug1\relax +% \aaa \texttt{texttt} +% \ldebug0\relax +% +% \textit{subsequent} (leftparen)\\ +% \ldebug1\relax +% \aaa (leftparen) +% \ldebug0\relax +% +% (\textit{subsequent}) rightparen\\ +% \ldebug1\relax +% (\aaa) rightparen +% \ldebug0\relax +% +% \textit{subsequent}, comma\\ +% \ldebug1\relax +% \aaa, comma. +% \ldebug0\relax +% +% \textit{subsequent} tmacro\\ +% \ldebug1\relax +% \aaa \www +% \ldebug0\relax +% +% \textit{subsequent}'s face\\ +% \ldebug1\relax +% \aaa's face +% \ldebug0\relax +% +% \textit{subsequent} ``quote''\\ +% \ldebug1\relax +% \aaa ``quote'' +% \ldebug0\relax +% +% \textit{subsequent} [leftbracket]\\ +% \ldebug1\relax +% \aaa [leftbracket] +% \ldebug0\relax +% +% [\textit{subsequent}] rightbracket\\ +% \ldebug1\relax +% [\aaa] rightbracket +% \ldebug0\relax +% +% \textit{subsequent}{open group}\\ +% \ldebug1\relax +% \aaa {opengroup} +% \ldebug0\relax +% +% {\textit{subsequent}} close group\\ +% \ldebug1\relax +% {\aaa} close group +% \ldebug0\relax +% +% \textit{subsequent} \{realbrace\}\\ +% \ldebug1\relax +% \aaa \{realbrace\} +% \ldebug0\relax +% +% \textit{subsequent} 666 number\\ +% \ldebug1\relax +% \aaa 666 number +% \ldebug0\relax +% +% \textit{subsequent} $x=y^2$ math\\ +% \ldebug1\relax +% \aaa $x=y^2$ math +% \ldebug0\relax +% +% \textit{subsequent} \$realdollar\\ +% \ldebug1\relax +% \aaa \$realdollar +% \ldebug0\relax +% +% \textit{subsequent} \#numbersign\\ +% \ldebug1\relax +% \aaa \#numbersign +% \ldebug0\relax +% +% \textit{subsequent}/slash\\ +% \ldebug1\relax +% \aaa /slash +% \ldebug0\relax +% +% \textit{subsequent}\/ italic correction\\ +% \ldebug1\relax +% \aaa \/ italic correction +% \ldebug0\relax +% +% \textit{subsequent}\ explicit space\\ +% \ldebug1\relax +% \aaa \ explicit space +% \ldebug0\relax +% +% \textit{subsequent}\space \cs\space\\ +% \ldebug1\relax +% \aaa \space \cs\space +% \ldebug0\relax +% +% \makeatletter +% +% \textit{subsequent}\@xobeysp \cname{@xobeysp}\\ +% \ldebug1\relax +% \aaa \@xobeysp \cname{@xobeysp} +% \ldebug0\relax +% +% \def\ACRcnta{1} +% \def\ACRcntb{3} +% \acromake{CIA}{{\ttfamily CIA}}{Central Intelligence Agency} +% \newcommand\TMacromakebugit {% +% \Debug1 +% \typeout{CIA \expandafter\meaning\csname CIA\endcsname} +% \typeout{LONG \expandafter\meaning\csname CIAlong \endcsname} +% \typeout{SHORT \expandafter\meaning\csname CIAshort \endcsname} +% \typeout{secondary \expandafter\meaning\csname CIAsecondary \endcsname} +% } +% +% The \CIA is overthrowing Nigeria. +% +% The \CIA is watching in your window right now. +% +% The \CIA will stop that missile. +% +% The \CIA! The \CIA! The \CIA. The \CIA guys. +% +% Resetting Acromake abbrevs. +% \TMResetAcromake +% +% The \CIA! The \CIA! The \CIA. The \CIA guys. +% +% } ^^A closes testing group? diff --git a/Master/texmf-dist/tex/latex/frankenstein/abbrevs.stq b/Master/texmf-dist/tex/latex/frankenstein/abbrevs.stq new file mode 100644 index 00000000000..668013e4133 --- /dev/null +++ b/Master/texmf-dist/tex/latex/frankenstein/abbrevs.stq @@ -0,0 +1,403 @@ +%% +%% This is file `abbrevs.stq', +%% generated with the docstrip utility. +%% +%% The original source files were: +%% +%% abbrevs.sty +%% +%% This program is part of the Frankenstein bundle for LaTeX. +%% +%% Copyright (C) 1995-2001 Matthew Swift <swift@alum.mit.edu> +%% +%% This file may have one of TWO names, either +%% abbrevs.sty or abbrevs.stq. This +%% LaTeX package will work ONLY if it is called abbrevs.sty +%% and placed in a proper directory. This file should have been +%% distributed to you with a DIFFERENT file (also) called +%% abbrevs.sty which functions identically to this one +%% but contains documentation in comments. This file works faster, +%% but the other should be kept because it contains the documentation +%% for this LaTeX package. Files called README and INSTALL should have +%% also been distributed to you with this file; see them for more +%% information. +%% +%% This program is free software; you may redistribute it and/or +%% modify it under the conditions of the LaTeX Project Public +%% License, either version 1.2 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. +%% +%% This program is distributed in the hope that it will be useful, +%% but WITHOUT ANY WARRANTY; without even the implied warranty of +%% MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the +%% LaTeX Project Public License for more details. +%% +%% \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 \~} +\def\fileinfo{abbreviation macros (Frankenstein's briefs)} +\def\DoXPackageS {abbrevs} +\def\fileversion{v1.4} +\def\filedate{2001/09/08} +\def\docdate{2001/09/08} +\edef\PPOptArg {% + \filedate\space \fileversion\space \fileinfo +} +\makeatletter% A special comment to help create bst files. Don't change! +\@ifundefined{JusTLoaDInformatioN} {% + }{% ELSE (we know the compsci package is already loaded, too) + \UndefineCS\JusTLoaDInformatioN + \SaveDoXVarS + \eExpand\csname DoXPackageS\endcsname\In {%use \csname in case it's undefined + \usepackage{#1}% + }% + \RestoreDoXVarS + \makeatother + \endinput +}% A special comment to help create bst files. Don't change! +\NeedsTeXFormat{LaTeX2e} +\ProvidesPackage{abbrevs}[\PPOptArg] +%% +\NeedsTeXFormat{LaTeX2e}[1995/12/01] +\RequirePackage{moredefs,slemph} +\requirecommand\nospacelist {% + ,.':;?-/\slash~!)]\bgroup\egroup\@sptoken\ \space\/\@xobeysp +} +\newcommand\maybe@ic@space {% + \futurelet\@let@token\maybe@ic@space@ +} +\newcommand\maybe@ic@space@ {% + \maybe@ic@ + \maybe@space@ +} +\newcommand\maybe@space {% + \futurelet\@let@token\maybe@space@ +} +\newcommand\maybe@space@ {% + \@tempswatrue + \expandafter \@tfor + \expandafter \reserved@a + \expandafter :% + \expandafter =% + \nospacelist + \do \t@st@ic + \if@tempswa + \space + \fi +} +\ReserveCS\TMResetAll +\ReserveCS\TMHookAll +\ReserveCS\TMFontAll + +\newcommand\NewAbbrevCategory [1] {% args: category + \expandafter\ReserveCS\csname TMReset#1\endcsname + \expandafter\ReserveCS\csname TMFont#1\endcsname + \expandafter\ReserveCS\csname TMHook#1\endcsname + \expandafter\g@addto@macro + \expandafter\TMResetAll\csname TMReset#1\endcsname +} +\newcommand\ResetAbbrevs [1] {% args: category-list + \@for\sc@t@a:=#1\do {% + \@ifundefined{TMReset\sc@t@a} {% + \FrankenWarning{abbrevs}{The abbreviation category \sc@t@a\space + is not defined!}% + }{% ELSE + \@nameuse{TMReset\sc@t@a}% + }% + }% +} +\newcommand\TMInitialSuffix {% + long% +} +\newcommand{\TMSubsequentSuffix} {% + short% +} +\ReserveCS\TMCurrentMacro +\newcommand\TMNewAbbrevPlain [3] {% args: \csname category body + \NewRobustCommand #1 {% + \@bsphack + \TMHookAll + \@nameuse{TMHook#2}% + \@esphack + \ifmmode + \def\sc@t@a {% + \nfss@text{\@nameuse{TMFont#2}#3}% + }% + \else + \def\sc@t@a {% + \leavevmode + \begingroup + \tm@check@nocorr #3\nocorr\@nil + \TMFontAll + \@nameuse{TMFont#2}% + \tm@check@left + #3% + \tm@check@right + \endgroup + }% + \fi + \sc@t@a + }% +} +\NewName{tm@check@nocorr} {#1#2\nocorr#3\@nil} {% + \let\tm@check@left\maybe@ic + \def\tm@check@right {\aftergroup\maybe@ic@space}% + \def\reserved@a {\nocorr}% + \def\reserved@b {#1}% + \def\reserved@c {#3}% + \ifx\reserved@a\reserved@b + \ifx\reserved@c\@empty + \let\check@icl\@empty + \else + \let\check@icl\@empty + \def\check@icr {\aftergroup\maybe@space}% + \fi + \else + \ifx\reserved@c\@empty\else + \def\tm@check@right {\aftergroup\maybe@space}% + \fi + \fi +} +\newboolean{TMInhibitSwitching} % initially false +\newboolean{TMAlwaysLong} % initially false +\newcommand\TMNewAbbrevSwitcher [5] {% args: definer category csname + \expandafter#1\csname #3\TMInitialSuffix\endcsname{#2}{#4} + \expandafter#1\csname #3\TMSubsequentSuffix\endcsname{#2}{#5} + \newboolean{@#3@mentioned} + \expandafter\g@addto@macro\csname TMReset#2\endcsname {% + \global\csname @#3@mentionedfalse\endcsname + } + \expandafter\@ifdefinable\csname #3\endcsname {% + \EExpand\csname #3\endcsname\In {% + \EExpand\csname if@#3@mentioned\endcsname\In {% + \EExpand\csname #3\TMSubsequentSuffix\endcsname\In {% + \EExpand\csname @#3@mentionedtrue\endcsname\In {% + \EExpand\csname #3\TMInitialSuffix\endcsname\In {% + \gdef ##1{% must be NO SPACE before `{' ! + \@tempswafalse + ####1% + \ifTMAlwaysLong\else + \@tempswatrue + \fi + \fi + \if@tempswa + \def\sc@t@a {########1}% + \else + \ifTMInhibitSwitching\else + \global ################1% + \fi + \def\sc@t@a {################################1}% + \fi + \sc@t@a + }% close \gdef + }}}}}% close \EExpand...\In's + }% close \@ifdefinable +} +\newcommand\TMDefineAbbrevStandard [3] {% args: category \csname + % initial [subsequent] + \@ifnextchar [ {% + \tm@defineabbrevstandard{#1}{#2}{#3}% + }{% ELSE + \TMNewAbbrevPlain{#2}{#1}{#3}% + }% +} +\NewName{tm@defineabbrevstandard} {#1#2#3[#4]} {% args: category \csname + % initial subsequent + \eExpand\expandafter\Gobble\string#2\In {% + \TMNewAbbrevSwitcher\TMNewAbbrevPlain{#1}{##1}{#3}{#4}% + }% +} +\newcommand\NewUserAbbrevDefiner [2] {% args: \csname category [definer] + \@ifnextchar [ {% + \tm@newuserabbrevdefiner{#1}{#2}% + }{% ELSE + \tm@newuserabbrevdefiner{#1}{#2}[\TMDefineAbbrevStandard]% + }% +} +\NewName{tm@newuserabbrevdefiner}{#1#2[#3]} {% args: \csname category definer + \newcommand #1 {% + #3{#2}% + }% +} +\NewAbbrevCategory{Generic} +\NewAbbrevCategory{Name} +\NewAbbrevCategory{Book} +\NewAbbrevCategory{Work} +\NewUserAbbrevDefiner{\newabbrev}{Generic} +\NewUserAbbrevDefiner{\newname}{Name} +\NewUserAbbrevDefiner{\newbook}{Book} +\NewUserAbbrevDefiner{\newwork}{Work} + +\def\TMFontBook {% + \itswitch +} +\def\TMFontWork {% + \itswitch +} +\newcommand\DateMark [1] {% + \hspace{.2em}{\DateMarkSize\scshape #1}% + \@ifnextchar. {% + \spacefactor\@m + }{% ELSE + .\maybe@ic@space + }% +} +\newlet\DateMarkSize\small +\newcommand{\PM} {% + \DateMark{p.m}% +} +\newcommand{\AM} {% + \DateMark{a.m}% +} +\newcommand{\BC} {% + \DateMark{b.c}% +} +\newcommand{\AD} {% + \DateMark{a.d}% +} +\@ifpackageloaded{acromake}{% + \FrankenWarning{abbrevs}{LaTeX is about to fail because \protect\acromake +is already defined.\MessageBreak Probably you have loaded acromake.sty, and if +so,\MessageBreak you should simply not load it, since abbrevs.sty +emulates\MessageBreak acromake.sty.} + }{%ELSE +} +\NewAbbrevCategory{Acromake} +\NewUserAbbrevDefiner{\acromake}{Acromake}[\TMAcromakeDefiner] + +\newcommand\TMAcromakeSecondarySuffix {secondary} + +\ReserveCS\tm@acromake@pageref +\ReserveCS\TMHookAcromakeHook +\newcommand\TMNewAbbrevSwitcherAcromake [5] {% args: definer category csname + #1{#3}{\TMInitialSuffix}{#2}{#4} + #1{#3}{\TMSubsequentSuffix}{#2}{#5} + \newboolean{@#3@mentioned} + \expandafter\g@addto@macro\csname TMReset#2\endcsname {% + \global\csname @#3@mentionedfalse\endcsname + } + \expandafter\@ifdefinable\csname #3\endcsname {% + \EExpand\csname #3\endcsname\In {% + \EExpand\csname if@#3@mentioned\endcsname\In {% + \EExpand\csname #3\TMSubsequentSuffix\endcsname\In {% + \EExpand\csname @#3@mentionedtrue\endcsname\In {% + \EExpand\csname #3\TMInitialSuffix\endcsname\In {% + \gdef ##1{% must be NO SPACE before `{' ! + \@tempswafalse + ####1% + \ifTMAlwaysLong\else + \@tempswatrue + \fi + \fi + \if@tempswa + \def\sc@t@a {########1}% + \else + \ifTMInhibitSwitching\else + \global ################1% + \fi + \def\sc@t@a {################################1}% + \fi + \sc@t@a + }% close \gdef + }}}}}% close \EExpand...\In's + }% close \@ifdefinable +} +\newcommand\TMAcromakeDefiner [4] {% args: category csname acronym fulltext + \ifnum \ACRcnta < 1\relax + \def\ACRcnta {1}% + \fi% + \Global\NewName{tm@acromake@#2}{} {-1}% macro for counting occurrences + \TMNewAbbrevSwitcherAcromake\TMNewAbbrevAcromake{#1}{#2}{#4 (#3)}{#3}% + \expandafter\g@addto@macro\csname TMReset#1\endcsname {% + \global\DefName{tm@acromake@#2}{} {-1}% + }% + \TMNewAbbrevAcromake{#2}{\TMAcromakeSecondarySuffix} + {Acromake} + {#3\ (see Page \pageref{TMacromake:#2})}% +} +\ReserveCS\TMCurrentMacroRootname +\newcommand\TMNewAbbrevAcromake [4] {% args: csname-root csname-suffix category body + \expandafter\NewRobustCommand\csname #1#2\endcsname {% + \gdef\TMCurrentMacroRootname {#1}% + \@bsphack + \TMHookAll + \@nameuse{TMHook#3}% + \@esphack + \ifmmode + \def\sc@t@a {% + \nfss@text{\@nameuse{TMFont#3}#4}% + }% + \else + \def\sc@t@a {% + \leavevmode + \begingroup + \tm@check@nocorr #4\nocorr\@nil + \TMFontAll + \@nameuse{TMFont#3}% + \tm@check@left + #4% + \tm@check@right + \endgroup + }% + \fi + \sc@t@a + }% +} + +\ReserveCS\tm@t % temp +\def\TMHookAcromake {% + \edef\tm@t{\TMCurrentMacroRootname}% + \ifnum\csname tm@acromake@\tm@t\endcsname = -1\relax + \eExpand\tm@t\In{% + \label{TMacromake:##1}% + }% + \tm@incmacro{\tm@t}% + \fi + \ifTMInhibitSwitching\else + \tm@incmacro{\tm@t}% + \fi + \ifnum\csname tm@acromake@\tm@t\endcsname < \ACRcnta\relax + \expandafter\global\csname @\tm@t@mentionedfalse\endcsname + \else + \ifnum\csname tm@acromake@\tm@t\endcsname = \ACRcnta\relax + \ifTMInhibitSwitching\else +\SaveName{\tm@t\TMSubsequentSuffix}% +\global\EElet\csname \tm@t\TMSubsequentSuffix\endcsname + \csname \tm@t\TMAcromakeSecondarySuffix\endcsname + \fi + \fi + \ifnum\csname tm@acromake@\tm@t\endcsname = \ACRcntb\relax + \RestoreName{\tm@t\TMSubsequentSuffix}% + \fi + \fi + \TMHookAcromakeHook +} +\newcounter{tm@util} +\newcommand{\tm@incmacro} [1] {% arg: acroabbrev + \eExpand\csname tm@acromake@#1\endcsname\In {% + \setcounter{tm@util}{##1}% + }% + \stepcounter{tm@util}% + \expandafter\xdef\csname tm@acromake@#1\endcsname {\thetm@util}% +} +\newcommand\ACRcnta {1} +\newcommand\ACRcntb {2} +\newcommand\AcromakePageref {(see Page ##1)} +\InputIfFileExists{abbrevs.cfg}{}{} +\endinput +%% +%% End of file `abbrevs.stq'. diff --git a/Master/texmf-dist/tex/latex/frankenstein/abbrevs.sty b/Master/texmf-dist/tex/latex/frankenstein/abbrevs.sty new file mode 100644 index 00000000000..8e325c698b6 --- /dev/null +++ b/Master/texmf-dist/tex/latex/frankenstein/abbrevs.sty @@ -0,0 +1,1299 @@ +%^^A* legal notices +% \iffalse +% +% This program is part of the Frankenstein bundle for LaTeX. +% +% Copyright 1995-2001 Matt Swift <swift@alum.mit.edu>. +% +% This file contains both the code and documentation for the +% abbrevs LaTeX package. It will work ONLY if it is placed in a +% proper directory. Files called README, INSTALL, abbrevs.tex +% and abbrevs.ins should have also been distributed to you +% with this file. See them for more information on how to typeset +% the documentation with LaTeX and how to generate a version of this +% file that will work faster than this one. +% +% This program is free software; you may redistribute it and/or +% modify it under the conditions of the LaTeX Project Public +% License, either version 1.2 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. +% +% This program is distributed in the hope that it will be useful, +% but without any warranty; without even the implied warranty of +% merchantability or fitness for a particular purpose. See the +% LaTeX Project Public License for more details. +% +% \fi +% +%^^A* checks +% +%^^A NOTE: The character table, with two %'s, will get written to all files. +%% \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 \~} +% +% \CheckSum{683} +% +% \begin{abstract} +% ``Abbreviation macros'' expand to defined text and insert following space +% intelligently, based on context. They can also expand to one thing the first +% time they are used and another thing on subsequent invocations. Thus they +% can be abbreviations in two senses, in the source and in the document. +% Useful applications include the abstraction of textual elements such as names +% without fussing over spacing and the automatic expansion of abbreviations and +% acronyms at their first use. The initial and subsequent expansions of an +% abbreviation macro are available at any time via explicit commands. +% Abbreviation macros are grouped into categories; there are hooks applicable +% to each category. Categories can be reset so that subsequent abbreviation +% macros in that category behave as if used for the first time again. +% +% A generic facility is also provided for suffixes like 1900\BC and 6:00\PM, +% which correctly handles following periods. +% \end{abstract} +% \tableofcontents +% +% \part{Discussion} +% +% \section{General} +% +% \DescribeMacro{\nospacelist} +% An abbreviation macro \cs\foo that expands to \meta{text} is robust; +% \cs\foo can be used in place of \meta{text} almost anywhere. A space is +% inserted following an abbreviation macro when the first non-white character +% following it is \emph{not} in the set \cs\nospacelist, whose default value +% is \verb*|,.':;?-/~!)]{}\ \/\@xobeysp|. +% +% When an abbreviation macro has different initial and subsequent expansions, +% either may be explicitly requested by adding a suffix to the abbreviation +% macro. The commands |\|\meta{command}|short| and |\|\meta{command}|long| +% are also defined whenever an abbreviation macro |\|\meta{command} is +% defined. Using the |\|\meta{command}|long| command does not affect what +% the next abbreviation macros expands to. +% +% All abbreviation macros are assigned categories, identified by a string. +% Four categories are defined by the package, and it is easy to add more. +% Categories facilitate handling different groups of abbreviation macros in +% different ways. +% +% \caveat{Regarding CJK macros and probably other 8-bit input. If you use +% the \package{abbrevs} package with the CJK macros for typesetting Chinese, +% Japanese, and Korean text, you must define your abbreviations within the +% CJK environment. I believe that the CJK macros work by interpreting 8-bit +% input in the source file. But this input is only interpreted properly +% within the CJK environment. If you define the abbrevs outside, such as in +% the preamble, you will just get a bunch of numbers when your abbreviation +% expands.} +% +% I would use capital letters for the name of this macro, since it doesn't +% seem like a user command to me, but I'm modelling after the kernel's +% \cs\nocorrlist. +% +% \section{Usage} +% +% \newbook\worst{Worstward Ho} +% \newbook\fall{All That Fall} +% \newbook\nacht{Nacht und Tr\"aume} +% \newbook\csp{Collected Shorter Plays \emph{(}CSP\emph{)}}[CSP] +% \newname\joyce{James Joyce}[Joyce] +% \newname\nixon{Richard Milhous Nixon}[Nixon] +% \newname\ww{Wordsworth} +% \newname\beckett{Samuel Beckett}[Beckett] +% \newwork\godot{Waiting for Godot}[Godot] +% \newbook\prelude{The Prelude} +% \newabbrev\ART{American Repetrory Theater (ART)}[ART] +%^^A FIX -- reduce, move +% Examples of how to define abbreviation macros: +% \begin{codeexample} +% \newbook\worst{Worstward Ho} +% \newbook\fall{All That Fall} +% \newbook\nacht{Nacht und Tr\"aume} +% \newbook\csp{Collected Shorter Plays \emph{(}CSP\emph{)}}[CSP] +% \newname\joyce{James Joyce}[Joyce] +% \newname\nixon{Richard Milhous Nixon}[Nixon] +% \newname\ww{Wordsworth} +% \newname\beckett{Samuel Beckett}[Beckett] +% \newwork\godot{Waiting for Godot}[Godot] +% \newbook\prelude{The Prelude} +% \newabbrev\ART{American Repetrory Theater (ART)}[ART] +% \end{codeexample} +% +% \todo{Give example of using |short| or |long|.} +% +% Examples of how to use the macros, and how they are typeset:\relax +% \footnote{\cs\lips is defined in the \package{lips} package, part of the +% \Frankenstein bundle.} +% \begin{bothexample} +% The manuscripts of \ww's \prelude differ. \lips Before he began \prelude, +% \ww wrote \lips +% \end{bothexample} +% \begin{bothexample} +% \nixon was the 37st American President. \lips Many Americans like my uncle +% Norm voted for \nixon enthusiastically in both 1968 and 1972. +% \end{bothexample} +% \begin{bothexample} +% \beckett gained international noteriety with the play \godot in the early +% 1950s. \beckett wrote \godot, he said, as a diversion from the novels he +% was then writing. I have seen this play at the \ART in Cambridge, +% Massachusetts. The \ART is often disappointing, but I liked their +% production of \godot. +% \end{bothexample} +% +% \DescribeMacro{\newabbrev} +% \cs\newabbrev\marg{\\command}\marg{initial}\oarg{subsequent} defines an +% abbreviation macro \meta{\\command} of category \cat{Generic}. +% +% \DescribeMacro{\newname} +% \cs\newname\marg{\\command}\marg{initial}\oarg{subsequent} defines an +% abbreviation macro \meta{\\command} of category \cat{Name}. +% +% \DescribeMacro{\newbook} +% \cs\newbook\marg{\\command}\marg{initial}\oarg{subsequent} defines an +% abbreviation macro \meta{\\command} of category \cat{Book}. +% +% \DescribeMacro{\newwork} +% \cs\newwork\marg{\\command}\marg{bibliography +% key}\marg{initial}\oarg{subsequent} defines an abbreviation macro +% \meta{\\command} of category \cat{Work}. Works can be distinguished from +% books by being listed in a separate bibliography, e.g., of primary works +% referred to by short titles in the main text. The defining command +% therefore requires a \BibTeX{} key as an argument. The first use of the +% work serves as a citation to that bibliography, and all uses of the work +% generate an index entry. +% +% \todo{\cat{Work}s are not yet fully implemented. Presently they are the same +% as \cat{Book}s.} +% +% \section{Date Marks} +% \DescribeMacro{\PM} +% \DescribeMacro{\AM} +% \DescribeMacro{\BC} +% \DescribeMacro{\AD} +% These variants of abbreviation macros correctly handle following periods. +% \begin{bothexample} +% She left for work before 6\AM, but +% did not arrive until 12\PM. The +% interval 5\BC--5\AD is one year +% shorter than the interval +% 95\AD--105\AD. +% \end{bothexample} +% +% \section{Emulation of \package{acromake}} +% We emulate the \package{acromake} package by Paul A.~Thompson (version of +% 1995/7/16 at \url{CTAN:/macros/latex/contrib/other/misc/acromake.sty}). +% \package{Abbrevs} will issue an informative warning when it guesses it is +% about to fail because \package{acromake} is already loaded (we cannot know +% for certain if it is). I will add an option so that \package{abbrevs} and +% \package{acromake} can both be loaded if anyone persuades me it will be +% useful. +% +% One reason to emulate \package{acromake} with \package{abbrevs} is that it +% can be done easily and by doing so we can avoid keeping two packages around +% when one will do. Another is that \package{abbrevs} is a more general and +% powerful package which adds value to \package{acromake} functionality. +% \package{Abbrevs} should be a drop-in replacement for \package{acromake}, but +% you can also take advantage of features of \package{abbrevs}: acromake-style +% abbreviations obey \cs\TMInhibitSwitching, and they are defined as their own +% category of abbreviations, \cat{Acromake}, so that \package{acromake}-style +% abbreviations can be manipulated with the general mechanisms available to any +% category. +% +% The following three \package{acromake} user commands are implemented in +% \package{abbrevs}. +% +% \DescribeMacro{\acromake} +% \cs\acromake \marg{csname}\marg{initial text}\marg{final text} FIX dox +% +% \DescribeMacro{\ACRcnta} +% The macro \cs\ACRcnta contains the number of times (default 1) the initial +% text (full text) is given. Use \cs\renewcommand to redefine it. +% +% \DescribeMacro{\ACRcntb} +% The macro \cs\ACRcntb contains the number of iterations (default 2) before +% the final text is given. The intermediate text (final text plus page +% reference) is therefore given $\mbox{|ACRcntb|} - \mbox{|ACRcnta|}$ times. +% +% \DescribeMacro{\AcromakePageref} +% Define the macro \cs\AcromakePageref to contain the text that expresses the +% page reference. \package{Abbrevs} will replace the string |##1| in the +% definition of this macro with the page number where the abbreviation was +% first used (more precisely, with |\pageref{|\meta{label}|}|). The default +% value is |(see Page ##1)| for compatibility with \package{acromake}. The +% styles I am familiar with would call for a lowercase ``page.'' +% +% \caveat{\cs\AcromakePageref not implemented yet} +% +% \subsection{Possible discrepancies} +% The counter |util| and the macros \cs\pv and \cs\addtomacro are used +% internally by \package{acromake} and are not defined in \package{abbrevs}. +% (If you managed to find some use for \cs\addtomacro, you will probably see +% easily how to redefine it in this context---and if not, write me.) +% +% The emulation may behave slightly differently due to the difference beteween +% the way the \package{xspace} package handles following punctuation and space +% and the way \package{abbrevs} does. I think \package{abbrevs} is very +% likely to be as good or better than \package{xspace} at making these +% decisions. Let me know if you think otherwise. +% +% \section{Programmers' interface} +% +% \DescribeMacro{\ResetAbbrevs} +% When abbreviation macros are reset, their next invocation will expand to +% the initial text. Subsequent occurrences will expand to the subsequent +% text again. For exmaple, using \cs\ResetAbbrevs|{Name}| at the beginning +% of chapters will cause the full name to be used only for the first +% occurrence in each chapter. \cs\ResetAbbrevs\marg{category list} resets +% all abbreviation macros of the listed categories. The list is +% comma-separated, and the category \cat{All} is a shorthand for all defined +% categories. Example: +% \begin{codeexample} +% \SaveCS\chapter +% \renewcommand\chapter {% +% \ResetAbbrevs{All}% +% \MDSavedchapter +% } +% \end{codeexample} +% +% \DescribeMacro{\NewAbbrevCategory} +% \DescribeMacro{\TMFontAll} +% \DescribeMacro{\TMHookAll} +% \DescribeMacro{\TMResetAll} +% \DescribeMacro{\TMFont<category>} +% \DescribeMacro{\TMHook<category>} +% \DescribeMacro{\TMReset<category>} +% To create new categories of abbreviation, use +% \cs\NewAbbrevCategory\marg{category name}. Macros +% \cs\TMFont\meta{category}, \cs\TMHook\meta{category}, and +% \cs\TMReset{}\meta{category} are all reserved. The hook and font slots +% start empty. The virtual category \cat{All} is predefined and refers to +% all defined categories. \cs\TMHookAll and \cs\TMFontAll are called +% \emph{before} the respective category-specific commands. +% +% \DescribeMacro{\NewUserAbbrevDefiner} +% \cs\NewUserAbbrevDefiner\marg{defining +% command}\marg{category}\oarg{definer} defines a user command \meta{defining +% command}. With the default \meta{definer}, \cs\TMDefineAbbrevStandard, +% the \meta{defining command} will take the arguments \marg{abbrev +% command}\marg{initial text}\oarg{subsequent text} and defines +% \meta{abbrev command} to be a plain or switching abbreviation macro as +% appropriate. If given, the optional argument \meta{definer} should be a +% macro name, which will be first be passed a \marg{category}, then will +% read user arguments (e.g., in the case of \cs\TMDefineAbbrevStandard, +% \marg{cs}\marg{initial}\oarg{subsequent}). The \meta{definer} is +% expected of course to do something like define \marg{cs}. +% +% \DescribeMacro{\TMInitialSuffix} +% \DescribeMacro{\TMSubsequentSuffix} +% The factory default suffixes ``short'' and ``long'' may be changed by +% changing the definitions of \cs\TMSubsequentSuffix and +% \cs\TMInitialSuffix. The change should be made after the package is +% loaded but before any abbreviation macros have been defined. +% +% \DescribeMacro{\DateMark} +% Abbreviation macros like \cs\PM are defined as \cs\DateMark{}s, like this, +% without the final period: +% \begin{codeexample} +% \newcommand\PM {% +% \DateMark{p.m}% +% } +% \end{codeexample} +% +% \DescribeMacro{\ifTMInhibitSwitching} +% \DescribeMacro{\TMInhibitSwitchingfalse} +% \DescribeMacro{\TMInhibitSwitchingtrue} +% \DescribeMacro{\ifTMAlwaysLong} +% \DescribeMacro{\TMAlwaysLongtrue} +% \DescribeMacro{\TMAlwaysLongfalse} +% When \cname{ifTMInhibitSwitching} is true, first occurrences of an +% abbreviation macro will expand to the initial expansion as usual, but they +% will not trigger the change to subsequent expansions. Example: inhibit +% switching inside footnotes, and abbreviations will not be spelled out for the +% first and only time in a footnote. That is, if their first appearance is in a +% footnote, their first appearance in the main text will also expand to the +% long version. See the configuration file for how to do this. +% +% When \cs\TMAlwaysLong is true, every abbreviation macro expands to its +% initial expansion. +% +% \StopEventually{} +% +% \part{Implementation} +% +% \section{Version control} +% +% \begin{macro}{\fileinfo} +% \begin{macro}{\DoXUsepackagE} +% \begin{macro}{\HaveECitationS} +% \begin{macro}{\fileversion} +% \begin{macro}{\filedate} +% \begin{macro}{\docdate} +% \begin{macro}{\PPOptArg} +% These definitions must be the first ones in the file. +% \begin{macrocode} +\def\fileinfo{abbreviation macros (Frankenstein's briefs)} +\def\DoXPackageS {abbrevs} +\def\fileversion{v1.4} +\def\filedate{2001/09/08} +\def\docdate{2001/09/08} +\edef\PPOptArg {% + \filedate\space \fileversion\space \fileinfo +} +% \end{macrocode} +% \end{macro} +% \end{macro} +% \end{macro} +% \end{macro} +% \end{macro} +% \end{macro} +% \end{macro} +% +% If we're loading this file from a \cs\ProcessDTXFile command (see the +% \package{compsci} package), then \cs\JusTLoaDInformatioN will be defined; +% othewise we assume it is not (that's why the FunkY NamE). +% +% If we're loading from \cs\ProcessDTXFile, we want to load the packages listed +% in \cs\DoXPackageS (needed to typeset the documentation for this file) and +% then bail out. Otherwise, we're using this file in a normal way as a +% package, so do nothing. \cs\DoXPackageS, if there are any, are declared in +% the \ext{dtx} file, and, if you're reading the typeset documentation of this +% package, would appear just above. (It's OK to call \cs\usepackage with an +% empty argument or \cs\relax, by the way.) +% \begin{macrocode} +\makeatletter% A special comment to help create bst files. Don't change! +\@ifundefined{JusTLoaDInformatioN} {% + }{% ELSE (we know the compsci package is already loaded, too) + \UndefineCS\JusTLoaDInformatioN + \SaveDoXVarS + \eExpand\csname DoXPackageS\endcsname\In {%use \csname in case it's undefined + \usepackage{#1}% + }% + \RestoreDoXVarS + \makeatother + \endinput +}% A special comment to help create bst files. Don't change! +% \end{macrocode} +% +% Now we check for \LaTeX2e and declare the LaTeX package. +% \begin{macrocode} +\NeedsTeXFormat{LaTeX2e} +\ProvidesPackage{abbrevs}[\PPOptArg] +% \end{macrocode}^^A special comment to help create bst files. Don't change! +% +% ^^A NOTE: We have to compensate for the above backslashes, which are not +% ^^A actually in the .dtx file the author works on, by adding to the +% ^^A CheckSum. +%% +% \AddToCheckSum{17}^^A `dtx-update-checksum' automatically handles this. +% \AddToCheckSum{7}^^A The half a macrocode env. at the top is missed, however... +% \AddToCheckSum{10}^^A ... and so are the 5 \defs from the .dtx file +% ^^A that precede it. +% \IfCitations {% +% \AddToCheckSum{2}^^A When \initelyHavECitationS is defined in +% } ^^A the .dtx file, we need 2 more in the CheckSum. +% +% +% \section{Requirements} +% +% \begin{macrocode} +\NeedsTeXFormat{LaTeX2e}[1995/12/01] +\RequirePackage{moredefs,slemph} +% \end{macrocode} +% +% \caveat{These docs could be much improved. There are far too many things +% called ``definers.'' Cleaning up the basic code concepts wouldn't hurt either.} +% +% \section{Basics} +% +% Let's begin with the tricky part of inserting space based on context. The +% strategy is: first, if the following character is not in \cs\nocorr and the +% current font is not slanted, insert an italic correction with +% \cname{sw@slant}; second, if the following character is not in +% \cs\nospacelist, insert a space. +% +% Again, in pseudocode: +% \begin{codeexample} +% LET T = the next token +% IF (slanted font is current AND T NOT IN \nocorrlist) +% \sw@slant +% FI +% IF T NOT IN \nospacelist +% \space +% FI +% \end{codeexample} +% +% \begin{macro}{\nospacelist} +% Put these in the order of their frequency. Anything in \cs\nocorrlist +% should also be in here, most likely. I'm putting in \cname{@xobeysp} +% because it's in the \package{xspace} package, but I can't tell you when it +% would come up. +% \begin{macrocode} +\requirecommand\nospacelist {% + ,.':;?-/\slash~!)]\bgroup\egroup\@sptoken\ \space\/\@xobeysp +} +% \end{macrocode} +% \end{macro} +% +% \begin{macro}{\maybe@ic@space} +% \begin{macro}{\maybe@ic@space@} +% \cname{maybe@ic@space} checks the next character and inserts an italic +% correction and space as appropriate. +% \begin{macrocode} +\newcommand\maybe@ic@space {% + \futurelet\@let@token\maybe@ic@space@ +} +% \end{macrocode} +% We first call the kernel's \cname{maybe@ic@}, then our own +% \cname{maybe@space@}. +% \begin{macrocode} +\newcommand\maybe@ic@space@ {% + \maybe@ic@ + \maybe@space@ +} +% \end{macrocode} +% \end{macro} +% \end{macro} +% +% \begin{macro}{\maybe@space} +% \begin{macro}{\maybe@space@} +% \cname{maybe@space} and \cname{maybe@space@} are very similar to the +% kernel's analogs \cname{maybe@ic} and \cname{maybe@ic@}, but they check +% \cs\nospacelist instead of \cs\nocorr. \cname{t@st@ic} sets +% \cname{@tempswa} false if \cname{@let@token} is in \cs\nospacelist. +% \begin{macrocode} +\newcommand\maybe@space {% + \futurelet\@let@token\maybe@space@ +} +\newcommand\maybe@space@ {% + \@tempswatrue +% \DTypeout{In maybe@space@ my lettoken is [\meaning\@let@token]}% + \expandafter \@tfor + \expandafter \reserved@a + \expandafter :% + \expandafter =% + \nospacelist + \do \t@st@ic + \if@tempswa + \space + \fi +} +% \end{macrocode} +% \end{macro} +% \end{macro} +% +% \section{Categories} +% +% \begin{macro}{\ResetAbbrevs} +% \begin{macro}{\NewAbbrevCategory} +% \begin{macro}{\TMResetAll} +% \begin{macro}{\TMHookAll} +% \begin{macro}{\TMFontAll} +% Each time an abbreviation of category \cat{C} is defined, some tokens are +% added to the contents of |\TMReset|\meta{C}. +% \begin{macrocode} +\ReserveCS\TMResetAll +\ReserveCS\TMHookAll +\ReserveCS\TMFontAll + +\newcommand\NewAbbrevCategory [1] {% args: category + \expandafter\ReserveCS\csname TMReset#1\endcsname + \expandafter\ReserveCS\csname TMFont#1\endcsname + \expandafter\ReserveCS\csname TMHook#1\endcsname + \expandafter\g@addto@macro + \expandafter\TMResetAll\csname TMReset#1\endcsname +} +\newcommand\ResetAbbrevs [1] {% args: category-list + \@for\sc@t@a:=#1\do {% + \@ifundefined{TMReset\sc@t@a} {% + \FrankenWarning{abbrevs}{The abbreviation category \sc@t@a\space + is not defined!}% + }{% ELSE + \@nameuse{TMReset\sc@t@a}% + }% + }% +} +% \end{macrocode} +% \end{macro} +% \end{macro} +% \end{macro} +% \end{macro} +% \end{macro} +% +% \section{Suffixes} +% +% \begin{macro}{\TMInitialSuffix} +% \begin{macro}{\TMSubsequentSuffix} +% When an abbreviation macro is created, two additional commands with these +% suffixes are also created. For example, \cs\foo, \cs\foolong, and +% \cs\fooshort. When abbrevs are used in such a way that ``long'' and +% ``short'' don't make sense, it would make sense to change these to +% something more descriptive. +% \begin{macrocode} +\newcommand\TMInitialSuffix {% + long% +} +\newcommand{\TMSubsequentSuffix} {% + short% +} +% \end{macrocode} +% \end{macro} +% \end{macro} +% +% \section{Plain abbreviations} +% +% The checking that \cname{sw@slant} does for skips and penalties on the list +% is going to be superfluous for the applications I imagine. But we trade that +% for a more flexible macro. +% +% We don't check for \cs\nocorr or an empty body; maybe we should when it's +% first defined; but I ran into really hairy expansion troubles trying to do +% that and use \cs\DeclareRobustCommand. FIX. +% +% \begin{macro}{\TMNewAbbrevPlain} +% Things are easy when the abbreviation doesn't switch between initial and +% subsequent expansions. +% \todo{pass root and suffix instead of \code{\csname} so that we don't have to parse +% it out again later from tmcurrentmacro} +% \begin{macrocode} +\ReserveCS\TMCurrentMacro +\newcommand\TMNewAbbrevPlain [3] {% args: \csname category body + \NewRobustCommand #1 {% +% \xdef\TMCurrentMacro {\expandafter\Gobble\string#1}% + \@bsphack + \TMHookAll + \@nameuse{TMHook#2}% + \@esphack + \ifmmode + \def\sc@t@a {% + \nfss@text{\@nameuse{TMFont#2}#3}% + }% + \else + \def\sc@t@a {% + \leavevmode + \begingroup +% \end{macrocode} +% We can skip the check for emptiness and containing just a space, since those +% won't occur with abbreviation macros except by accident, I think. We proceed +% straight to a check for \cs\nocorr{}s. +% \begin{macrocode} + \tm@check@nocorr #3\nocorr\@nil + \TMFontAll + \@nameuse{TMFont#2}% + \tm@check@left + #3% + \tm@check@right + \endgroup + }% + \fi + \sc@t@a + }% +} +% \end{macrocode} +% \end{macro} +% +% \begin{macro}{\tm@check@nocorr} +% This corresponds to the kernel's \cname{check@nocorr@}. We simply +% substitute \cname{maybe@ic@space} and \cname{maybe@space} in where +% necessary. We also use \cname{tm@check@left} and \cname{tm@check@right} +% instead of \cname{check@icl} and \cname{check@icr}. +% \begin{macrocode} +\NewName{tm@check@nocorr} {#1#2\nocorr#3\@nil} {% + \let\tm@check@left\maybe@ic + \def\tm@check@right {\aftergroup\maybe@ic@space}% + \def\reserved@a {\nocorr}% + \def\reserved@b {#1}% + \def\reserved@c {#3}% + \ifx\reserved@a\reserved@b + \ifx\reserved@c\@empty + \let\check@icl\@empty + \else + \let\check@icl\@empty + \def\check@icr {\aftergroup\maybe@space}% + \fi + \else + \ifx\reserved@c\@empty\else + \def\tm@check@right {\aftergroup\maybe@space}% + \fi + \fi +} +% \end{macrocode} +% \end{macro} +% +% \section{Control booleans} +% +% \begin{macro}{\ifTMInhibitSwitching} +% \begin{macro}{\TMInhibitSwitchingtrue} +% \begin{macro}{\TMInhibitSwitchingfalse} +% \begin{macro}{\ifTMAlwaysLong} +% \begin{macro}{\TMAlwaysLongtrue} +% \begin{macro}{\TMAlwaysLongfalse} +% Control booleans. +% \begin{macrocode} +\newboolean{TMInhibitSwitching} % initially false +\newboolean{TMAlwaysLong} % initially false +% \end{macrocode} +% \end{macro} +% \end{macro} +% \end{macro} +% \end{macro} +% \end{macro} +% \end{macro} +% +% \section{Switching abbreviations} +% +% \vspace{7ex}^^A kludge to handle all those macro names +% \begin{macro}{\TMNewAbbrevSwitcher} +% Here is the main abbreviation macro definer. It works by defining two +% macros, one for the initial text and one for the subsequent text, and +% setting up a third user command to choose between the two as appropriate. +% (The first two are made available to the user by explicit call as well.) +% The function used to define the two macros is passed as the first argument +% to this function. Supplied definers are \cs\TMNewAbbrevPlain (I will +% write \cs\TMNewAbbrevWork and \cs\TMNewAbbrevDotclose soon FIX). The +% second argument is the category---each definer takes at least three +% arguments: a command name, a category, and the content. The third argument +% is the user macro name to be created, and the fourth and fifth arguments +% are the initial and subsequent expansion texts. +% +% The first part sets three token variables to the three command sequences +% that this macro is going to define---the user, initial, and subsequent +% commands. The user command checks its associated boolean variable to see +% whether it has been called before. If so, it calls the ``subsequent'' +% macro; if not, the ``initial'' macro. +% +% \begin{macrocode} +\newcommand\TMNewAbbrevSwitcher [5] {% args: definer category csname +% % initial subseq. + \expandafter#1\csname #3\TMInitialSuffix\endcsname{#2}{#4} + \expandafter#1\csname #3\TMSubsequentSuffix\endcsname{#2}{#5} + \newboolean{@#3@mentioned} + \expandafter\g@addto@macro\csname TMReset#2\endcsname {% + \global\csname @#3@mentionedfalse\endcsname + } +% \end{macrocode} +% We've created the initial and subsequent macros, and the boolean. Now we +% define the user macro. This definition is tricky. In pseudocode, it looks +% like this: +% \begin{codeexample} +% if #3 definable then +% #3 := { if (#3-mentioned AND NOT TMAlwaysLong) then +% #3-short +% else +% if NOT TMInhibitSwitching then #3-mentioned := (global) true +% #3-long +% fi } +% fi +% \end{codeexample} +% Hmm, I'm not sure this is any more readable than a sea of +% \cs\expandafter\cs\noexpand{}s. +% +% Notice that in a switching abbrev, the -mentioned boolean is set to true +% \emph{before} calling the macro itself, so that the hook can check and +% possibly alter the value. The \package{acromake} emulation takes advantage +% of this. +% \begin{macrocode} + \expandafter\@ifdefinable\csname #3\endcsname {% +% is ##1 below: + \EExpand\csname #3\endcsname\In {% +% ####1: + \EExpand\csname if@#3@mentioned\endcsname\In {% +% ########1: + \EExpand\csname #3\TMSubsequentSuffix\endcsname\In {% +% ################1: + \EExpand\csname @#3@mentionedtrue\endcsname\In {% +% ################################1: + \EExpand\csname #3\TMInitialSuffix\endcsname\In {% +% \gdef\<csname>{% + \gdef ##1{% must be NO SPACE before `{' ! + \@tempswafalse +% \if@<csname>mentioned + ####1% + \ifTMAlwaysLong\else + \@tempswatrue + \fi + \fi + \if@tempswa +% \def\sc@t@a {\<csname>\TMSubsequentSuffix}% + \def\sc@t@a {########1}% + \else + \ifTMInhibitSwitching\else +% \global\@<csname>@mentionedtrue + \global ################1% + \fi +% \def\sc@t@a {\<csname>\TMInitialSuffix}% + \def\sc@t@a {################################1}% + \fi +% \expandafter \gdef +% \expandafter\TMCurrentMacro +% \expandafter{\sc@t@a}% + \sc@t@a + }% close \gdef + }}}}}% close \EExpand...\In's + }% close \@ifdefinable +} +% \end{macrocode} +% \caveat{The \cs\csname{}s (e.g., either \cs\foolong or \cs\fooshort) +% \emph{must} be the very last thing to occur in the definitions, or the +% \cs\futurelet that checks following spacing in, e.g., \cs\TMNewAbbrevPlain +% will break. This is why we use the construction with \cname{sc@t@a}. No +% space must sneak into the macros, either!} +% \end{macro} +% +% The hard work is done. Now we define some macros to help create new +% categories. +% +% \section{Defining commands} +% +% A \meta{definer} is always called with a category as a first argument. The +% only definers in this version of this package are this one and the one that +% emulates the \package{acromake} package. More later! +% +% \begin{macro}{\TMDefineAbbrevStandard} +% \begin{macro}{\tm@defineabbrevstandard} +% \cs\TMDefineAbbrevStandard is the standard \meta{definer} that makes the +% choice between defining an switching or a plain abbreviation, depending on +% whether the user supplies a subsequent text. +% \begin{macrocode} +\newcommand\TMDefineAbbrevStandard [3] {% args: category \csname + % initial [subsequent] + \@ifnextchar [ {% + \tm@defineabbrevstandard{#1}{#2}{#3}% + }{% ELSE + \TMNewAbbrevPlain{#2}{#1}{#3}% + }% +} +\NewName{tm@defineabbrevstandard} {#1#2#3[#4]} {% args: category \csname + % initial subsequent + \eExpand\expandafter\Gobble\string#2\In {% + \TMNewAbbrevSwitcher\TMNewAbbrevPlain{#1}{##1}{#3}{#4}% + }% +} +% \end{macrocode} +% \end{macro} +% \end{macro} +% +% \begin{macro}{\NewUserAbbrevDefiner} +% \begin{macro}{\tm@newuserabbrevdefiner} +% \mbox{} +% \begin{macrocode} +\newcommand\NewUserAbbrevDefiner [2] {% args: \csname category [definer] + \@ifnextchar [ {% + \tm@newuserabbrevdefiner{#1}{#2}% + }{% ELSE + \tm@newuserabbrevdefiner{#1}{#2}[\TMDefineAbbrevStandard]% + }% +} +\NewName{tm@newuserabbrevdefiner}{#1#2[#3]} {% args: \csname category definer + \newcommand #1 {% + #3{#2}% + }% +} +% \end{macrocode} +% \end{macro} +% \end{macro} +% +% \section{Basic categories} +% +% \begin{macro}{\TMResetGeneric} +% \begin{macro}{\TMResetName} +% \begin{macro}{\TMResetBook} +% \begin{macro}{\TMResetWork} +% \begin{macro}{\TMHookGeneric} +% \begin{macro}{\TMHookName} +% \begin{macro}{\TMHookBook} +% \begin{macro}{\TMHookWork} +% \begin{macro}{\TMFontGeneric} +% \begin{macro}{\TMFontName} +% \begin{macro}{\TMFontBook} +% \begin{macro}{\TMFontWork} +% \begin{macro}{\newabbrev} +% \begin{macro}{\newname} +% \begin{macro}{\newbook} +% \begin{macro}{\newwork} +% Right now, the \cat{Book} and \cat{Work} categories are separate but +% equal. A future revision will distinguish them by keeping track of more +% information about \cat{Work}s, with the idea of using them to generate a +% separate bibliography and index in a long document that refers to a +% certain list of books by short titles. E.g., my thesis is on Samuel +% Beckett, and I want to refer to his works by short titles, and +% automatically generate a Beckett bibliography of only the ones I use, +% listed by title. +% \begin{macrocode} +\NewAbbrevCategory{Generic} +\NewAbbrevCategory{Name} +\NewAbbrevCategory{Book} +\NewAbbrevCategory{Work} +\NewUserAbbrevDefiner{\newabbrev}{Generic} +\NewUserAbbrevDefiner{\newname}{Name} +\NewUserAbbrevDefiner{\newbook}{Book} +\NewUserAbbrevDefiner{\newwork}{Work} + +\def\TMFontBook {% + \itswitch +} +\def\TMFontWork {% + \itswitch +} +% \end{macrocode} +% \end{macro} +% \end{macro} +% \end{macro} +% \end{macro} +% \end{macro} +% \end{macro} +% \end{macro} +% \end{macro} +% \end{macro} +% \end{macro} +% \end{macro} +% \end{macro} +% \end{macro} +% \end{macro} +% \end{macro} +% \end{macro} +% +% \section{Date marks} +% +% \begin{macro}{\DateMark} +% \begin{macro}{\DateMarkSize} +% \mbox{} +% \begin{macrocode} +\newcommand\DateMark [1] {% + \hspace{.2em}{\DateMarkSize\scshape #1}% + \@ifnextchar. {% + \spacefactor\@m + }{% ELSE + .\maybe@ic@space + }% +} +\newlet\DateMarkSize\small +% \end{macrocode} +% \end{macro} +% \end{macro} +% +% \begin{macro}{\PM} +% \begin{macro}{\AM} +% \begin{macro}{\BC} +% \begin{macro}{\AD} +% Some common time abbreviations. +% \begin{macrocode} +\newcommand{\PM} {% + \DateMark{p.m}% +} +\newcommand{\AM} {% + \DateMark{a.m}% +} +\newcommand{\BC} {% + \DateMark{b.c}% +} +\newcommand{\AD} {% + \DateMark{a.d}% +} +% \end{macrocode} +% \end{macro} +% \end{macro} +% \end{macro} +% \end{macro} +% +% \section{Emulation of \package{Acromake}} +% +% \caveat{This code is a \emph{mess!} Consider all but the user functions +% ``internal.'' I will reimplement it all another time. Meanwhile it works, +% and the user interface is \package{acromake}'s anyway, so it won't change.} +% +% \begin{macro}{\TMResetAcromake} +% \begin{macro}{\TMFontAcromake} +% \begin{macro}{\TMHookAcromake} +% \begin{macro}{\TMHookAcromakeHook} +% \begin{macro}{\TMAcromakeSecondarySuffix} +% \begin{macro}{\acromake} +% \begin{macro}{\tm@acromake@pageref} +% Define the category \cat{Acromake} and declare its user defining +% command to be \cs\acromake. Create a suffix \TMAcromakeSecondarySuffix +% analogous to \cs\TMInitialSuffix and \cs\TMSubsequentSuffix. +% +% Instead of building more generality into \package{abbrevs}, I emulate +% \package{acromake} with a few hacks, since I don't see a \emph{general} need +% for more than two expansions. Counting iterations, on the other hand, is +% something I would like to do for all abbrevs. Doing so is tantamount to +% replacing the present |-mentioned| booleans with ``counter'' macros. +% +% The emulation is done in the following way. Let's call the three expansions +% of an \package{acromake} macro the \meta{am-initial}, \meta{am-secondary}, +% and \meta{am-subsequent} expansions, in order. These must be mapped onto the +% \package{abbrevs} concepts of \term{inital} and \term{subsequent} expansions. +% The \cs\acromake command as I define it here defines a switching abbrev whose +% initial text contains \meta{am-initial} and subsequent text contains +% \meta{am-subsequent}. It also defines a plain abbrev with a suffix +% \cs\TMAcroSecondarySuffix (analogous to \cs\TMInitialSuffix and +% \cs\TMSubsequentSuffix) that expands to \meta{am-secondary}. In a switching +% abbrev, the associated |-mentioned| boolean is set to |true| \emph{before} +% calling the macro itself (and therefore its hook). The hook can therefore +% reset the boolean to |false|, and I do this in \cs\TMHookAcromake until it is +% time to go from the \meta{am-initial} to the \meta{am-secondary} expansions. +% \cs\TMInhibitSwitching affects the \cat{Acromake} category like all others, +% and \cs\TMResetAcromake behaves as expected. +% +% \begin{macrocode} +\@ifpackageloaded{acromake}{% + \FrankenWarning{abbrevs}{LaTeX is about to fail because \protect\acromake +is already defined.\MessageBreak Probably you have loaded acromake.sty, and if +so,\MessageBreak you should simply not load it, since abbrevs.sty +emulates\MessageBreak acromake.sty.} + }{%ELSE +} +\NewAbbrevCategory{Acromake} +\NewUserAbbrevDefiner{\acromake}{Acromake}[\TMAcromakeDefiner] + +\newcommand\TMAcromakeSecondarySuffix {secondary} + +\ReserveCS\tm@acromake@pageref +% \end{macrocode} +% We're going to use the main hook, so provide another free one. +% \begin{macrocode} +\ReserveCS\TMHookAcromakeHook +% \end{macrocode} +% I'm not sure why \package{acromake} does this check for odd values of +% \cs\ACRcnta. I use logic below that I think does reasonable things with odd +% values. +% +% I think \package{acromake} tried to inhibit using \meta{am-secondary} when it +% appeared on the same page as the (first!)\ \meta{am-initial} instance, but I +% also think there was a spurious $0$ in the source that broke this feature. +% I've emulated the working feature. +% \begin{macrocode} +% consider these acromake functions internal for now! +% differs from regular version in passing args to definer +\newcommand\TMNewAbbrevSwitcherAcromake [5] {% args: definer category csname +% % initial subseq. + #1{#3}{\TMInitialSuffix}{#2}{#4} + #1{#3}{\TMSubsequentSuffix}{#2}{#5} + \newboolean{@#3@mentioned} + \expandafter\g@addto@macro\csname TMReset#2\endcsname {% + \global\csname @#3@mentionedfalse\endcsname + } + \expandafter\@ifdefinable\csname #3\endcsname {% +% is ##1 below: + \EExpand\csname #3\endcsname\In {% +% ####1: + \EExpand\csname if@#3@mentioned\endcsname\In {% +% ########1: + \EExpand\csname #3\TMSubsequentSuffix\endcsname\In {% +% ################1: + \EExpand\csname @#3@mentionedtrue\endcsname\In {% +% ################################1: + \EExpand\csname #3\TMInitialSuffix\endcsname\In {% +% \gdef\<csname>{% + \gdef ##1{% must be NO SPACE before `{' ! + \@tempswafalse +% \if@<csname>mentioned + ####1% + \ifTMAlwaysLong\else + \@tempswatrue + \fi + \fi + \if@tempswa +% \def\sc@t@a {\<csname>\TMSubsequentSuffix}% + \def\sc@t@a {########1}% + \else + \ifTMInhibitSwitching\else +% \global\@<csname>@mentionedtrue + \global ################1% + \fi +% \def\sc@t@a {\<csname>\TMInitialSuffix}% + \def\sc@t@a {################################1}% + \fi +% \expandafter \gdef +% \expandafter\TMCurrentMacro +% \expandafter{\sc@t@a}% + \sc@t@a + }% close \gdef + }}}}}% close \EExpand...\In's + }% close \@ifdefinable +} +\newcommand\TMAcromakeDefiner [4] {% args: category csname acronym fulltext + \ifnum \ACRcnta < 1\relax + \def\ACRcnta {1}% + \fi% +% \end{macrocode} +% \package{Acromake} uses a suffix of |z| here, which IMHO is a bad idea, so +% I use something a user will not put in a source file: a prefix of |tm@acromake@|. +% See below for why we start at $-1$. +% \begin{macrocode} + \Global\NewName{tm@acromake@#2}{} {-1}% macro for counting occurrences +% \end{macrocode} +% Define an abbrev that switches from \meta{am-initial} to +% \meta{am-subsequent}. Hack the resetting macro to reset the count as well as +% the |-mentioned| boolean. Reset to $0$ not $-1$ so that we only label once! +% Is this an argument for having the ``mentioned'' boolean switch at the +% transition from \meta{am-secondary} to \meta{am-subsequent}? (so that +% resetting goes back to \meta{am-secondary} instead of \meta{am-initial}.) I +% think so; or, better, define a \emph{new} label each time we reset. +% \begin{macrocode} + \TMNewAbbrevSwitcherAcromake\TMNewAbbrevAcromake{#1}{#2}{#4 (#3)}{#3}% + \expandafter\g@addto@macro\csname TMReset#1\endcsname {% + \global\DefName{tm@acromake@#2}{} {-1}% + }% +% \end{macrocode} +% Define an additional abbrev that expands to \meta{am-secondary}. In the code +% below, Fred replaces the |#1| with something else with |#1| in it; Ethel +% replaces the new |#1| with the contents of \cname{sc@toks@a}. (The |#| is +% quoted with more |#|'s below.) Hmm, this expansion business could probably +% be simplified by thinking it through from the beginning. +% \begin{macrocode} +% \def\tm@acromake@pageref {% +% \sc@toks@a={\noexpand\pageref{TMacromake:#2}}% +% \EExpand\AcromakePageref\In {% ``Fred'' +% \EExpand\sc@toks@a\In {% ``Ethel'' +% ####1% +% }% +% }% +% }% +% \eExpand\tm@acromake@pageref\In {% + \TMNewAbbrevAcromake{#2}{\TMAcromakeSecondarySuffix} + {Acromake} + {#3\ (see Page \pageref{TMacromake:#2})}% +% {#3\ ##1}% +% }% +} +% \end{macrocode} +% Now define \cs\TMHookAcromake. +% Arg, first have to define an alternative of \cs\TMNewAbbrevPlain because of +% the odd problem described above. Same as \cs\TMNewAbbrevPlain except takes +% first argument in two parts and defines \TMCurrentMacroRootname, which will +% be used in the hook. +% \begin{macrocode} +\ReserveCS\TMCurrentMacroRootname +% plain's args: csname category body +\newcommand\TMNewAbbrevAcromake [4] {% args: csname-root csname-suffix category body + \expandafter\NewRobustCommand\csname #1#2\endcsname {% + \gdef\TMCurrentMacroRootname {#1}% + \@bsphack + \TMHookAll + \@nameuse{TMHook#3}% + \@esphack + \ifmmode + \def\sc@t@a {% + \nfss@text{\@nameuse{TMFont#3}#4}% + }% + \else + \def\sc@t@a {% + \leavevmode + \begingroup +% \end{macrocode} +% We can skip the check for emptiness and containing just a space, since those +% won't occur with abbreviation macros except by accident, I think. We proceed +% straight to a check for \cs\nocorr{}s. +% \begin{macrocode} + \tm@check@nocorr #4\nocorr\@nil + \TMFontAll + \@nameuse{TMFont#3}% + \tm@check@left + #4% + \tm@check@right + \endgroup + }% + \fi + \sc@t@a + }% +} +%\def\tm@chop#1 {#1}% +%\def\tm@choplong#1long{#1} + +\ReserveCS\tm@t % temp +\def\TMHookAcromake {% +% \end{macrocode} +% We handle inhibition of switching as follows. If the count is $-1$, this is +% the first iteration, so make the \cs\label, increment the count to $0$, and +% proceed. If switching is not inhibited, increment the counter. Then proceed +% with choosing the right expansion based on the counter. A first iteration in +% the normal case will therefore increment the counter twice from $-1$ to $1$. +% A first iteration in the case that switching is inhibited will advance the +% counter once to $0$, where it will stay until switching is permitted. +% +% I need to extract the root name from the three suffixed names -- why can't I +% do that?! +% \begin{codeexample} +% \documentclass{minimal} +% \begin{document} +% \def\gobble#1{} +% \def\one{j} +% \edef\two{\expandafter\gobble\string\j} +% %\edef\two{\two} % doesn't help +% \edef\three{\two} +% \typeout{one: [\meaning\one]} +% \typeout{two: [\meaning\two]} +% [\one] [\two] +% \typeout{\ifx\one\two ifx same\else ifx different -- WHY?!\fi} +% \typeout{\if\one\two if same\else if different\fi} +% \end{codeexample} +% +% +% \begin{macrocode} +% \edef\tm@t{\expandafter\strip@prefix\meaning\TMCurrentMacro}% +% \edef\tm@t{\E@cdr\tm@t\@nil}% +% \edef\tm@t{\expandafter\tm@choplong\TMCurrentMacro}% + \edef\tm@t{\TMCurrentMacroRootname}% + \ifnum\csname tm@acromake@\tm@t\endcsname = -1\relax + \eExpand\tm@t\In{% +% \typeout{initial: labeling ##1}% + \label{TMacromake:##1}% + }% + \tm@incmacro{\tm@t}% + \fi + \ifTMInhibitSwitching\else + \tm@incmacro{\tm@t}% + \fi +% \typeout{BEGIN: count is \csname tm@acromake@\tm@t\endcsname}% +% \end{macrocode} +% When the count is $< \mbox{|ACRcnta|}$, reset the |-mentioned| boolean so +% that the expansion will be the initial text i.e., \meta{am-initial}, again +% the next time. +% \begin{macrocode} +% doesn't work: +% \ifnum\csname tm@acromake@\tm@t\endcsname < \ACRcnta% +% doesn't work: +% \ifnum\csname tm@acromake@\tm@t\endcsname < \ACRcnta % +% works: I have no clue why... + \ifnum\csname tm@acromake@\tm@t\endcsname < \ACRcnta\relax +% \typeout{use before cnta}% + \expandafter\global\csname @\tm@t@mentionedfalse\endcsname + \else +% \end{macrocode} +% When the count is $= \mbox{|ACRcnta|}$, use the initial text (i.e., +% \meta{am-initial}) one last time and switch to using \meta{am secondary} next +% time. We allow the |-mentioned| boolean to become |true| by refraining from +% resetting it. We save the existing subsequent macro (which expands to +% \meta{am-subsequent}) and substitute the abbrev that expands to +% \meta{am-secondary}. The bounds check on \cs\ACRcnta at the beginning +% guarantees that we execute this clause once. +% \begin{macrocode} + \ifnum\csname tm@acromake@\tm@t\endcsname = \ACRcnta\relax + \ifTMInhibitSwitching\else +% \typeout{use at cnta A}% + \SaveName{\tm@t\TMSubsequentSuffix}% +% \typeout{use at cnta B}% + \global\EElet\csname \tm@t\TMSubsequentSuffix\endcsname + \csname \tm@t\TMAcromakeSecondarySuffix\endcsname +% \typeout{use at cnta C}% + \fi + \fi +% \end{macrocode} +% When the count is $> \mbox{|ACRcnta|}$ and $<= \mbox{|ACRcntb|}$, +% the expansion is \meta{am-secondary}, we only check whether we are currently +% on the page of the original use of the \meta{am-initial} text and in this +% case use \meta{am-subsequent}. +% \begin{macrocode} +% \@tempswafalse +% \ifnum\csname tm@acromake@\tm@t\endcsname < \ACRcntb\relax +% \ifnum\csname tm@acromake@\tm@t\endcsname > \ACRcnta\relax +% \@tempswatrue +% \fi +% \else +% \ifnum\csname tm@acromake@\tm@t\endcsname = \ACRcntb\relax +% \@tempswatrue +% \fi +% \fi +% % ie cnta < count <= cntb +% \if@tempswa +% % \typeout{use between cnta and cntb}% +% \eExpand\tm@t\In{% +% \typeout{page [\thepage] ref [\r@TMacromake:##1]}% +% \expandafter\ifnum\expandafter\thepage\expandafter=\csname r@TMacromake:##1\endcsname\relax +% % \typeout{this instance should be subsequent instead of secondary}% +% % insert a * to signal where: +% % *% +% % FIX how to do it?? I leave it broken for now, as it is broken in acromake +% % itself, +% \fi +% }% +% \fi +% \end{macrocode} +% When the count is $= \mbox{|ACRcntb|}$, we want to restore the definition of +% the subsequent macro. This test is not in an \cs\else clause to handle the +% case where $\mbox{|ACRcnta|} = \mbox{|ACRcntb|}$. +% \begin{macrocode} +% \ifnum\csname tm@acromake@\tm@t\endcsname < \ACRcntb\relax +% \ifnum\csname tm@acromake@\tm@t\endcsname > \ACRcnta\relax +% \typeout{use between cnta and cntb}% +% \fi +% \fi + \ifnum\csname tm@acromake@\tm@t\endcsname = \ACRcntb\relax +% \typeout{use at cntb}% + \RestoreName{\tm@t\TMSubsequentSuffix}% + \fi + \fi + \TMHookAcromakeHook +} +% \end{macrocode} +% \end{macro} +% \end{macro} +% \end{macro} +% \end{macro} +% \end{macro} +% \end{macro} +% \end{macro} +% +% \begin{macro}{\tm@incmacro} +% \begin{macro}{\c@tm@util} +% This is Paul's trick for using a macro like a counter. I reduce the command +% to its essential function in this context. It looks like Paul wanted a more +% general command. I think if you define such a command (or set of commands +% that emulate counters with macros) they do not belong here but in +% \package{moredefs} or their own package. I also +% \begin{macrocode} +\newcounter{tm@util} +\newcommand{\tm@incmacro} [1] {% arg: acroabbrev + \eExpand\csname tm@acromake@#1\endcsname\In {% + \setcounter{tm@util}{##1}% + }% + \stepcounter{tm@util}% + \expandafter\xdef\csname tm@acromake@#1\endcsname {\thetm@util}% +} +% \end{macrocode} +% \end{macro} +% \end{macro} +% +% \begin{macro}{\ACRcnta} +% \mbox{} +% \begin{macrocode} +\newcommand\ACRcnta {1} +\newcommand\ACRcntb {2} +% \end{macrocode} +% \end{macro} +% +% \begin{macro}{\AcromakePageref} +% The string |#1| will make it into the macro, which will in another +% context be replaced with a \cs\pageref. +% \begin{macrocode} +\newcommand\AcromakePageref {(see Page ##1)} +% suggestion: +% \renewcommand\AcromakePageref {(see page ##1)} +% \end{macrocode} +% \end{macro} +% +% \part{Configuration} +% +% We've built up the groundwork and leave the definitions of useful things to +% the configuration file. +% \begin{macrocode} +\InputIfFileExists{abbrevs.cfg}{}{} +% \end{macrocode} +% +% The contents of the distributed configuration file are below. +% +% \InputIfFileExists{abbrevs.cfg}{}{} +% +% \Finale diff --git a/Master/texmf-dist/tex/latex/frankenstein/achicago.stq b/Master/texmf-dist/tex/latex/frankenstein/achicago.stq new file mode 100644 index 00000000000..853e2c2b3c3 --- /dev/null +++ b/Master/texmf-dist/tex/latex/frankenstein/achicago.stq @@ -0,0 +1,263 @@ +%% +%% This is file `achicago.stq', +%% generated with the docstrip utility. +%% +%% The original source files were: +%% +%% achicago.sty +%% +%% This program is part of the Frankenstein bundle for LaTeX. +%% +%% Copyright (C) 1995-2001 Matthew Swift <swift@alum.mit.edu> +%% +%% This file may have one of TWO names, either +%% achicago.sty or achicago.stq. This +%% LaTeX package will work ONLY if it is called achicago.sty +%% and placed in a proper directory. This file should have been +%% distributed to you with a DIFFERENT file (also) called +%% achicago.sty which functions identically to this one +%% but contains documentation in comments. This file works faster, +%% but the other should be kept because it contains the documentation +%% for this LaTeX package. Files called README and INSTALL should have +%% also been distributed to you with this file; see them for more +%% information. +%% +%% This program is free software; you may redistribute it and/or +%% modify it under the conditions of the LaTeX Project Public +%% License, either version 1.2 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. +%% +%% This program is distributed in the hope that it will be useful, +%% but WITHOUT ANY WARRANTY; without even the implied warranty of +%% MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the +%% LaTeX Project Public License for more details. +%% +%% \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 \~} + +%% +\def\fileinfo{Chicago Manual author-date citations} +\def\DoXPackageS {achicago} +\def\initelyHavECitationS {} +\def\fileversion{v1.2} +\def\filedate{2001/08/31} +\def\docdate{2001/08/31} +\edef\PPOptArg {% + \filedate\space \fileversion\space \fileinfo +} +\makeatletter% A special comment to help create bst files. Don't change! +\@ifundefined{JusTLoaDInformatioN} {% + }{% ELSE (we know the compsci package is already loaded, too) + \UndefineCS\JusTLoaDInformatioN + \SaveDoXVarS + \eExpand\csname DoXPackageS\endcsname\In {%use \csname in case it's undefined + \usepackage{#1}% + }% + \RestoreDoXVarS + \makeatother + \endinput +}% A special comment to help create bst files. Don't change! +\NeedsTeXFormat{LaTeX2e} +\ProvidesPackage{achicago}[\PPOptArg] +%% +\RequirePackage{blkcntrl,moredefs,slemph,titles,verbatim} +\newboolean{Annotate} +\newcommand\annotate {% + \Annotatetrue +} +\newcommand\noannotate {% + \Annotatefalse +} +\providesavebox\sc@box@a +\newcommand\PreCiteWork {% + (\csname% +} +\newcommand\PostCiteWork {% + \end{lrbox}\usebox{\sc@box@a})% +} +\newcommand\MidCiteWork {% + \endcsname,\penalty9000\ \begin{lrbox}{\sc@box@a}% +} +\newcommand\citework [2] {% + \PreCiteWork #2\MidCiteWork #1\PostCiteWork +} +\newcommand\PreAnnotation {% + \PreChunk +} +\defcommand\@openbib@code {% + \advance\leftmargin\bibindent + \itemindent -\bibindent + \listparindent \itemindent + \parsep \z@ +} +\let\newblock\relax +\newcommand\ac@mmmdash {% + \rule[.6ex]{3em}{.03ex}% +} +\newcommand*\SCduplicate [1] {% + \ac@mmmdash +} +\newlet\ac@begingobble\comment +\newlet\ac@endgobble\endcomment +\newenvironment{SCannotation} {% + \ifAnnotate + \let\PreQuotation\PreAnnotation + \relax\quotation + \else + \expandafter\ac@begingobble + \fi + }{% + \ifAnnotate + \relax\endquotation + \else + \expandafter\ac@endgobble + \fi +} +\ReserveCS\SCcite +\newlet\UnexpandableProtect\@unexpandable@protect + +\newcommand*\ac@firstoftwo [2] {#1} +\newcommand*\ac@secondoftwo [2] {#2} +\newcommand*\ac@onespacetwo [2] {#1\ #2} +\newcommand*\ac@onespacepretwo [2] {#1\ \PreCite #2} + +\newcommand*\ac@cite@preonecommatwopost [2] {% + \PreCite #1\if@tempswa , #2\fi\PostCite +} +\newcommand*\ac@cite@onecommatwo [2] {% + #1\if@tempswa , #2\fi +} +\newcommand*\ac@cite@onecommatwopost [2] {% + #1\if@tempswa , #2\fi \PostCite +} + +\newlet\PreCite ( +\newlet\PostCite ) +\def\cite {% + \let\@cite\ac@cite@preonecommatwopost + \let\SCcite\ac@onespacetwo + \ac@cite@sc +} +\newcommand*\citeNP {% + \let\@cite\ac@cite@onecommatwo + \let\SCcite\ac@onespacetwo + \ac@cite@sc +} +\newcommand*\citeN {% + \let\@cite\ac@cite@onecommatwopost + \let\SCcite\ac@onespacepretwo + \ac@cite@comma +} +\newcommand*\citeA {% + \let\@cite\ac@cite@preonecommatwopost + \let\SCcite\ac@firstoftwo + \ac@cite@sc +} +\newcommand*\citeANP {% + \let\@cite\ac@cite@onecommatwo + \let\SCcite\ac@firstoftwo + \ac@cite@sc +} +\newlet\shortcite\cite +\newlet\shortciteNP\citeNP +\newlet\shortciteN\citeN +\newlet\shortciteA\citeA +\newlet\shortciteANP\citeANP +\newcommand*\citeyear {% + \let\@cite\ac@cite@preonecommatwopost + \let\SCcite\ac@secondoftwo + \ac@cite@comma +} +\newcommand*\citeyearNP {% + \let\@cite\ac@cite@onecommatwo + \let\SCcite\ac@secondoftwo + \ac@cite@comma +} +\ReserveCS\ac@citesep +\newcommand\ac@cite@sc {% + \let\ac@citesep ;% + \ac@cite +} +\newcommand*\ac@cite@comma {% + \let\ac@citesep ,% + \ac@cite +} +\newcommand*\ac@cite {% + \@ifnextchar [ {% + \@tempswatrue + \ac@@cite + }{% ELSE + \@tempswafalse + \ac@@cite[]% + }% +} +\providecommand\@writeaux {% + \immediate\write\@auxout +} +\NewName*{ac@@cite} {[#1]#2} {% args: [optarg] label % optarg MANDATORY + \if@filesw + \@writeaux{\string\citation{#2}}% + \fi + \@cite{% + \InitCS\sc@t@a + \@for\ac@label:=#2\do {% + \sc@t@a + \def\sc@t@a {\ac@citesep\ }% add space + \@ifundefined{b@\ac@label} {% + {\bfseries ?}% + \@warning{Citation `\ac@label' on page \thepage\space undefined}% + }{% ELSE + \@nameuse{b@\ac@label}% + }% + }% + }{#1}% +} +\setlength\bibindent{1.5em} +\newcommand\ac@defbib [2] {% + \renewenvironment*{thebibliography} [1] {% + #1*{#2\@mkboth{#2}{#2}}% + \list{}{% + \leftmargin\z@ + \advance\leftmargin\labelsep + \advance\leftmargin\bibindent + \itemindent -\bibindent + \listparindent \itemindent + \parsep \z@}% + \sfcode`\.=\@m + \def\newblock {% + \hskip .11em \@plus.33em \@minus.07em% + }% + \let\@biblabel\Gobble + \sloppy + \clubpenalty4000\widowpenalty4000% + }{% + \def\@noitemerr {% + \@latex@warning{Empty `thebibliography' environment}% + }% + \relax\endlist + }% +} +\@ifclassloaded{article} {% + \ac@defbib{\section}{\refname}% + }{% ELSE + \ac@defbib{\chapter}{\bibname}% +} +\InitCS\ac@defbib % FIX -- where else can I do this? +\endinput +%% +%% End of file `achicago.stq'. diff --git a/Master/texmf-dist/tex/latex/frankenstein/achicago.sty b/Master/texmf-dist/tex/latex/frankenstein/achicago.sty new file mode 100644 index 00000000000..28bb4254297 --- /dev/null +++ b/Master/texmf-dist/tex/latex/frankenstein/achicago.sty @@ -0,0 +1,711 @@ +%^^A* legal notices +% \iffalse +% +% This program is part of the Frankenstein bundle for LaTeX. +% +% Copyright 1995-2001 Matt Swift <swift@alum.mit.edu>. +% +% This file contains both the code and documentation for the +% achicago LaTeX package. It will work ONLY if it is placed in a +% proper directory. Files called README, INSTALL, achicago.tex +% and achicago.ins should have also been distributed to you +% with this file. See them for more information on how to typeset +% the documentation with LaTeX and how to generate a version of this +% file that will work faster than this one. +% +% This program is free software; you may redistribute it and/or +% modify it under the conditions of the LaTeX Project Public +% License, either version 1.2 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. +% +% This program is distributed in the hope that it will be useful, +% but without any warranty; without even the implied warranty of +% merchantability or fitness for a particular purpose. See the +% LaTeX Project Public License for more details. +% +% \fi +% +%^^A* checks +% +%^^A NOTE: The character table, with two %'s, will get written to all files. +%% \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 \~} +% +% \CheckSum{284} +% +%^^A** abstract +% \begin{abstract} +% \package{Achicago} provides a documentation style for \LaTeX{} that aims +% for compliance with the \manual. It uses author-date citations (per +% ch.~16), but bibliography entries contain unabbreviated information (per +% ch.~15). Requires accompanying \BibTeX{} bibliography style, +% \bst{achicago}. +% \end{abstract} +% \tableofcontents +% +% \part{Discussion} +% \AddToCheckSum{10}^^A FIX no idea why I have to do this. +% +% \section{General} +% +% This package is a companion to the \bst{achicago} \BibTeX{} bibliography +% style. The set of citation commands offered by \package{achicago} is +% unfortunately shared only with an early implementation of a \manual-compliant +% documentation style, \package{achicago} and \bst{achicago}. FIX: any others? +% In the future, I hope to make \package{achicago} compatible with the most +% common +% +% have to commit to using this bibstyle-package combination when you write your +% sources. This needn't be true, and one day I am going to create a series of +% mappings from other common bibstyles that are conceptually similar, such as +% the \bst{harvard} styles. The user commands are slightly different, but it +% should be the case that either set of user commands can be the front end for +% either bibstyle. +% +% Here in this documentation you will read about the commands you will use in +% your \LaTeX{} source file to make citations, and what the citations look +% like. Documentation of the \bst{achicago} bibstyle itself is in the file +% \file{achicago-bst.dvi}. There you can read about what the References +% section, the actual book list, looks like. There are also some new fields +% recognized and other information you might want to know that relates to your +% \BibTeX{} bibliography database file (\ext{bib} file). You may also wish to +% look at the \package{titles} package (also in the \Frankenstein bundle), +% which can be very helpful in typesetting various styles of titles properly, +% even when nested. The \package{achicago} package already requires the +% \package{titles} package, so those commands are always there if you want to +% use them. +% +% \caveat{This documentation is sparse but should be accurrate. I will improve +% it in the future.} +% +% \section{Notes on the future of this package and bibstyle} +% +% \manualref{16.25} permits this combination. +% +% In the future I hope to document more closely \manual's principles wrt each +% entry type, the many choices given by \manual. +% +% Untested and indeed hardly testable nature of the subject, with all its many +% permutations and difficult special bibliographic cases. Feedback is very +% welcome, especially with citations from \manual. +% +% FUTURE One thing I realize now is that I've kept the same user interface I +% inherited, which I don't think corresponds with any other popular style. +% Besides refinement, this is the next major step in the future of this +% bibstyle-package. +% +% \section{Pros and cons of this style} +% +% FIX: terminology: reference style, citation style, bibstyle, bibliography style +% +% When you are required to use a certain reference style, your judgment is not +% called for. In the cases where it is, here are some considerations. +% +% \begin{description} +% \item[citations are verbose] + +% Sometimes this information is useful to the reader, sometimes not. If in +% most citations it is not useful, consider a style with briefer citations. +% \item[citation style and quality of writing] +%% +% FIX cite btxdoc Oren Patashnik argues that ``encourages the passive +% voice and vague writing.'' I'm not sure. Even if it's true, an author can +% surely resist this ``encouragement.'' To encourage is not to require. Do +% consider how well \emph{you} write using different citation styles. If the +% document is already written, realize that if you change the citation style +% to one different than the author had in mind while writing, you may make +% reading it more awkward. Then again, maybe you will improve it. +% \item[ease of locating references] +% +% The entry for (Benson et~al. 1980) will appear any number of entries +% \emph{after} the entry for (Benson et~al. 1999) when the former was written +% by Benson, Zymursky, Wheeler, and Flynn and the latter by Benson (i.e., the +% same Benson), Floyd, Wheeler, and Flynn, since Zymursky compares greater +% than Floyd. +% +% This is an issue to consider if you have a large number of entries with the +% same initial author (or editor) and often with different sets of 3 or more +% subsequent authors. This is, in general, very unlikely. +% +% The entry for (Gr\"uber 1990b) may not follow the entry for (Gr\"uber +% 1990a) immediately. When (the same) Gr\"uber has authored +% Any number of entries may intervene, but their +% principals will all be exactly Gr\"uber. Entries will intervene only in +% the case when Gr\"uber both authored and edited a work in the same year, +% and authored one a work with a later date. +% \end{description} +% +% \section{Usage} +% +% Here are the various citing commands, and examples of the citations they produce. +% +% \todo{What about the situation when you end a sentence with something ending +% with ``et~al.''---in this case you don't want to reproduce the period.} +% +% Distinct examples are \typeset{distinguished this way}. +% +% \begin{tabular}{*{3}{p{.33\textwidth}}} +% \cs\cite\marg{key} +% & parenthesized list of up to 3 principals or one ``et~al.'' plus a year label +% & \typeset{(Brown 1978)} \typeset{(Jarke, Turner, and Stohl 1985)} \\ +% \cs\cite\oarg{spec}\marg{key1} +% & +% & \typeset{(Brown 1978, 17)} \typeset{Jarke, Turner, and Stohl 1985, \S 3.3)} \\ +% \cs\cite\marg{key1,key2} +% & +% & \typeset{(Brown 1978; Jarke, Turner, and Stohl 1985)} \\ +% \cs\cite\oarg{spec}\marg{key1,key2} FIX: how does this work? +% & +% & \typeset{(Brown 1978; Jarke, Turner, and Stohl 1985)} \\ +% \cs\citeNP\meta{key} +% & as \cs\cite but without enclosing parentheses +% & \typeset{Brown 1978} \typeset{Jarke, Turner, and Stohl 1985} \\ +% \cs\citeA\marg{key} +% & as \cs\cite but without year label(s) +% & \typeset{(Brown)} \typeset{(Jarke, Turner, and Stohl)} \\ +% \cs\citeANP\marg{key} +% & as \cs\citeA but without enclosing parentheses +% & \typeset{Brown} \typeset{Jarke, Turner, and Stohl} \\ +% \cs\citeyear\marg{key} +% & as \cs\cite but without principal list +% & \typeset{(1978} \typeset{1985} \\ +% \cs\citeyearNP\marg{key} +% & as \cs\citeyear but without enclosing parentheses +% & \typeset{1978} \typeset{1985} \\ +% \cs\citeN\marg{key}\footnotemark +% & principal list and parenthesized year label (i.e., a noun phrase) +% & FIX: referring to author instead of paper? need good example \\ +% \end{tabular} +% \footnotetext{This command should only be used for one key.} +% \todo{Should I use a warning in case more than one key is given to a command +% that shouldn't have them?} +% +% \subsection{Short citation labels} +% +% Previous versions of \package{achicago} offered a parallel set of citation +% commands with the prefix |short| that created citations with abbreviated +% labels (\cs\shortcite, \cs\shortciteNP, \cs\shortciteA, \cs\shortciteANP, +% \cs\shortciteN). \package{Achicago} now offers only one kind of label, which +% is abbreviated according to principles in the \manual as much as possible. +% For backwards compatibility, the |short| citation commands still function, +% but they are identical to their non-|short|, and will produce a warning that +% this syntax is deprecated. Do not use the |short| commands in new documents. +% +% \section{Some technical notes} +% +% \todo{See \manualref{16.14} for issues to do with multiple citations.} +% +% \section{History} +% +% I wrote this package incorporating \file{chicago\{,a\}.bst} and +% file{chicago.sty} (v4, 92/8). By now I've almost totally rewritten it. It +% was a great mess because it had been based on \file{newapa.bst} which had +% been based on several other bibstyles, and each author had really just hacked +% up what was there in the previous bibstyle apparently without fully +% understanding it. Now, of course, it is a shining example of clarity and +% efficiency. +% +% \StopEventually{} +% +% \part{Implementation} +% +% \section{Version control} +% +% \begin{macro}{\fileinfo} +% \begin{macro}{\DoXUsepackagE} +% \begin{macro}{\HaveECitationS} +% \begin{macro}{\fileversion} +% \begin{macro}{\filedate} +% \begin{macro}{\docdate} +% \begin{macro}{\PPOptArg} +% These definitions must be the first ones in the file. +% \begin{macrocode} +\def\fileinfo{Chicago Manual author-date citations} +\def\DoXPackageS {achicago} +\def\initelyHavECitationS {} +\def\fileversion{v1.2} +\def\filedate{2001/08/31} +\def\docdate{2001/08/31} +\edef\PPOptArg {% + \filedate\space \fileversion\space \fileinfo +} +% \end{macrocode} +% \end{macro} +% \end{macro} +% \end{macro} +% \end{macro} +% \end{macro} +% \end{macro} +% \end{macro} +% +% If we're loading this file from a \cs\ProcessDTXFile command (see the +% \package{compsci} package), then \cs\JusTLoaDInformatioN will be defined; +% othewise we assume it is not (that's why the FunkY NamE). +% +% If we're loading from \cs\ProcessDTXFile, we want to load the packages listed +% in \cs\DoXPackageS (needed to typeset the documentation for this file) and +% then bail out. Otherwise, we're using this file in a normal way as a +% package, so do nothing. \cs\DoXPackageS, if there are any, are declared in +% the \ext{dtx} file, and, if you're reading the typeset documentation of this +% package, would appear just above. (It's OK to call \cs\usepackage with an +% empty argument or \cs\relax, by the way.) +% \begin{macrocode} +\makeatletter% A special comment to help create bst files. Don't change! +\@ifundefined{JusTLoaDInformatioN} {% + }{% ELSE (we know the compsci package is already loaded, too) + \UndefineCS\JusTLoaDInformatioN + \SaveDoXVarS + \eExpand\csname DoXPackageS\endcsname\In {%use \csname in case it's undefined + \usepackage{#1}% + }% + \RestoreDoXVarS + \makeatother + \endinput +}% A special comment to help create bst files. Don't change! +% \end{macrocode} +% +% Now we check for \LaTeX2e and declare the LaTeX package. +% \begin{macrocode} +\NeedsTeXFormat{LaTeX2e} +\ProvidesPackage{achicago}[\PPOptArg] +% \end{macrocode}^^A special comment to help create bst files. Don't change! +% +% ^^A NOTE: We have to compensate for the above backslashes, which are not +% ^^A actually in the .dtx file the author works on, by adding to the +% ^^A CheckSum. +%% +% \AddToCheckSum{17}^^A `dtx-update-checksum' automatically handles this. +% \AddToCheckSum{7}^^A The half a macrocode env. at the top is missed, however... +% \AddToCheckSum{10}^^A ... and so are the 5 \defs from the .dtx file +% ^^A that precede it. +% \IfCitations {% +% \AddToCheckSum{2}^^A When \initelyHavECitationS is defined in +% } ^^A the .dtx file, we need 2 more in the CheckSum. +% +% +% \begin{macrocode} +\RequirePackage{blkcntrl,moredefs,slemph,titles,verbatim} +% \end{macrocode} +% +% \begin{macrocode} +\newboolean{Annotate} +\newcommand\annotate {% + \Annotatetrue +} +\newcommand\noannotate {% + \Annotatefalse +} +% \end{macrocode} +% +% \cs\citework is supposed to be a general command for citing things declared +% with \cs\newwork in the \package{abbrevs} package. It has one optional and +% one required argument so that it is parallel with the other citing commands, +% but I cannot see any use for it without the optional argument. Environments +% can exert complete control over how this macro looks by resetting the three +% parameters. The default will look good outside all environments, in running +% text. +% +% The second argument is expected to be something defined with \cs\newwork. +% +% Needs modification to handle the empty optional arg. Watch interfering with +% things surrounding macros might have set. \cs\relax's are intentionally left +% out to let constructions like \cs\csname\lips\cs\endcsname [eh? FIX] work on +% the arguments. +% +% \begin{macro}{\PreCiteWork} +% \begin{macro}{\PostCiteWork} +% \begin{macrocode} +\providesavebox\sc@box@a +\newcommand\PreCiteWork {% + (\csname% +} +\newcommand\PostCiteWork {% + \end{lrbox}\usebox{\sc@box@a})% +} +% \end{macrocode} +% \end{macro} +% \end{macro} +% +% We don't want to be unbreakable here, but we want a high penalty. We +% absolutely do not want to break the number range, so we put it in an lrbox. +% +% I think comma is better, even though it might seem fussy, because it is +% better parallel with the way \cs\cite works with an optional page argument: the +% convention is that page numbers come after commas. +% +% \begin{macrocode} +\newcommand\MidCiteWork {% + \endcsname,\penalty9000\ \begin{lrbox}{\sc@box@a}% +} +\newcommand\citework [2] {% + \PreCiteWork #2\MidCiteWork #1\PostCiteWork +} +% \end{macrocode} +% +% \begin{verbatim} +% The {} fools abbrevs.dtx into not adding an extra space +% \newcommand\MidCiteWork {% +% \endcsname{}\penalty9000\ \begin{lrbox}{\sc@box@a}% +% } +% \end{verbatim} +% +% \todo{Make citework* with no parentheses, or other alternative.} +% +% FIX: When the ? is placed there, there are two left parens, one right. +% +% We want the remaining macros in this section to be available in their own +% piece. +% +% \todo{is \cs\PreChunk the only dependence on blkcntrl? Should make this not +% necessary if so.} +% +% \begin{macrocode} +\newcommand\PreAnnotation {% + \PreChunk +} +% \end{macrocode} +% +% This will make the definition of the \env{thebibliography} environment in +% \file{classes.dtx} do the right thing. FIX: not defined in letter class? +% \begin{macrocode} +\defcommand\@openbib@code {% + \advance\leftmargin\bibindent + \itemindent -\bibindent + \listparindent \itemindent + \parsep \z@ +} +\let\newblock\relax +% \end{macrocode} +% This doesn't work at the beginning, for some reason. The auxfiles are not +% set up right? URK: don't do this. Confuses users and also prevents anyone +% from using achicago.sty with another bibstyle, such as a modified achicago.bst. +% Is there a way I can provide a useful warning message for those who might +% have been using this before, without a \cs\bibliographystyle +% \begin{macrocode} +%\AtEndDocument {% +% \bibliographystyle{achicago}% +%} +% \end{macrocode} +% +% The \bst{achicago} bibliography style will insert some macros that are not +% defined by \LaTeX, and some that must have new meanings. They are: +% \cs\citeN, \cs\SCcite, \cs\SCduplicate, \code{\begin{SCannotation}}, +% \code{\end{SCannotation}}. +% +% Some of these commands should properly have |@| in their names, but +% |@|-commands cannot appear in the \ext{bbl} file. As a compromise, the names +% have the prefix |SC|. +% +% \begin{macro}{\SCduplicate} +% \begin{macro}{\ac@mmmdash} +% The argument will contain the `label' that is a duplicate, in case it might +% ever be of use. But for now, we just want to replace duplicates with 3-em +% dashes. +% +% \todo{provide option to spell out the duplicate when it is the first entry on +% a page (oneside) or verso page (twosided)} +% +% A 3em-dash. +% \begin{macrocode} +\newcommand\ac@mmmdash {% + \rule[.6ex]{3em}{.03ex}% +} +\newcommand*\SCduplicate [1] {% + \ac@mmmdash +} +% \end{macrocode} +% \end{macro} +% \end{macro} +% +% \begin{macro}{\PreAnnotation} +% \begin{macro}{\ac@begingobble} +% \begin{macro}{\ac@endgobble} +% \begin{environment}{SCannotation} +% This sets up the \env{SCannotation} environment. When the boolean +% \cs\IfAnnotate is false, we gobble everything between \code{\begin{SCannotation}} +% and \code{\end{SCannotation}}. +% +% We require the \package{verbatim} package to do this. I used to put the text +% into an |lrbox| and just never use the box. This required balanced text +% inside (not a bad thing), but it also would process any \cs\cite-like +% commands that appeared in the gobbled text, which could lead to perpetual +% warnings about unresolved references. There were in fact no unresolved +% references, but the warnings were annoying. +% \begin{macrocode} +\newlet\ac@begingobble\comment +\newlet\ac@endgobble\endcomment +% \end{macrocode} +% \todo{I shouldn't define annote in terms of quotation, we should copy a +% standard one here; What is the point of the \cs\relax? I ended up removing +% them before the \cname{ac@begingobble} cases because I had to use the +% \cs\expandafter.} +% +% \begin{macrocode} +\newenvironment{SCannotation} {% + \ifAnnotate + \let\PreQuotation\PreAnnotation + \relax\quotation + \else + \expandafter\ac@begingobble + \fi + }{% + \ifAnnotate + \relax\endquotation + \else + \expandafter\ac@endgobble + \fi +} +% \end{macrocode} +% \end{environment} +% \end{macro} +% \end{macro} +% \end{macro} +% +% \begin{macro}{\SCcite} +% \begin{macro}{\ac@firstoftwo} +% \cs\SCcite is what \bst{achicago} produces. Its args are `label', +% and `year.label'. FIX: aak, plus tag. +% \begin{macrocode} +\ReserveCS\SCcite +\newlet\UnexpandableProtect\@unexpandable@protect + +\newcommand*\ac@firstoftwo [2] {#1} +\newcommand*\ac@secondoftwo [2] {#2} +\newcommand*\ac@onespacetwo [2] {#1\ #2} +\newcommand*\ac@onespacepretwo [2] {#1\ \PreCite #2} + +\newcommand*\ac@cite@preonecommatwopost [2] {% + \PreCite #1\if@tempswa , #2\fi\PostCite +} +\newcommand*\ac@cite@onecommatwo [2] {% + #1\if@tempswa , #2\fi +} +\newcommand*\ac@cite@onecommatwopost [2] {% + #1\if@tempswa , #2\fi \PostCite +} + +% \end{macrocode} +% \end{macro} +% \end{macro} +% +% \begin{macro}{\PreCite} +% \begin{macro}{\PostCite} +% \mbox{} +% \begin{macrocode} +\newlet\PreCite ( +\newlet\PostCite ) +% \end{macrocode} +% \end{macro} +% \end{macro} +% +% \begin{macro}{\cite} +% \begin{macro}{\citeNP} +% \begin{macro}{\citeA} +% \begin{macro}{\citeN} +% \begin{macro}{\citeANP} +% The way this works is: \cname{\@cite} is called once for each citing command, +% and \cs\SCcite is called once for each key. The results are spaced by either +% semicolons (\cname{\ac@cite@sc}) or commas (\cname{\ac@cite@comma}), and +% these become argument |#1| for \cname{\@cite}. +% \begin{macrocode} +\def\cite {% + \let\@cite\ac@cite@preonecommatwopost + \let\SCcite\ac@onespacetwo + \ac@cite@sc +} +\newcommand*\citeNP {% + \let\@cite\ac@cite@onecommatwo + \let\SCcite\ac@onespacetwo + \ac@cite@sc +} +\newcommand*\citeN {% + \let\@cite\ac@cite@onecommatwopost + \let\SCcite\ac@onespacepretwo + \ac@cite@comma +} +\newcommand*\citeA {% + \let\@cite\ac@cite@preonecommatwopost + \let\SCcite\ac@firstoftwo + \ac@cite@sc +} +\newcommand*\citeANP {% + \let\@cite\ac@cite@onecommatwo + \let\SCcite\ac@firstoftwo + \ac@cite@sc +} +% \end{macrocode} +% \end{macro} +% \end{macro} +% \end{macro} +% \end{macro} +% \end{macro} +% +% \begin{macro}{\shortcite} +% \begin{macro}{\shortciteNP} +% \begin{macro}{\shortciteN} +% \begin{macro}{\shortciteA} +% \begin{macro}{\shortciteANP} +% \begin{macrocode} +\newlet\shortcite\cite +\newlet\shortciteNP\citeNP +\newlet\shortciteN\citeN +\newlet\shortciteA\citeA +\newlet\shortciteANP\citeANP +% \end{macrocode} +% \end{macro} +% \end{macro} +% \end{macro} +% \end{macro} +% \end{macro} +% +% \begin{macro}{\citeyear} +% \begin{macro}{\citeyearNP} +% \mbox{} +% \begin{macrocode} +\newcommand*\citeyear {% + \let\@cite\ac@cite@preonecommatwopost + \let\SCcite\ac@secondoftwo + \ac@cite@comma +} +\newcommand*\citeyearNP {% + \let\@cite\ac@cite@onecommatwo + \let\SCcite\ac@secondoftwo + \ac@cite@comma +} +% \end{macrocode} +% \end{macro} +% \end{macro} +% +% \begin{macro}{\ac@citesep} +% \begin{macro}{\ac@cite@sc} +% \begin{macro}{\ac@cite@comma} +% \mbox{} +% \begin{macrocode} +\ReserveCS\ac@citesep +\newcommand\ac@cite@sc {% + \let\ac@citesep ;% + \ac@cite +} +\newcommand*\ac@cite@comma {% + \let\ac@citesep ,% + \ac@cite +} +% \end{macrocode} +% \end{macro} +% \end{macro} +% \end{macro} +% +% \begin{macro}{\ac@cite} +% This command executes \cname{\b@foo} for every \cs\foo in the list of cited +% labels, and separates them by arg |#1|. +% +% There has got to be a more elegant solution to this whole thing. FIX +% \begin{macrocode} +\newcommand*\ac@cite {% + \@ifnextchar [ {% + \@tempswatrue + \ac@@cite + }{% ELSE + \@tempswafalse + \ac@@cite[]% + }% +} +% \end{macrocode} +% \todo{handle reserving names} +% \begin{macrocode} +\providecommand\@writeaux {% + \immediate\write\@auxout +} +\NewName*{ac@@cite} {[#1]#2} {% args: [optarg] label % optarg MANDATORY + \if@filesw + \@writeaux{\string\citation{#2}}% + \fi + \@cite{% + \InitCS\sc@t@a + \@for\ac@label:=#2\do {% + \sc@t@a +% \let\sc@t@a\ac@citesep + \def\sc@t@a {\ac@citesep\ }% add space + \@ifundefined{b@\ac@label} {% + {\bfseries ?}% + \@warning{Citation `\ac@label' on page \thepage\space undefined}% + }{% ELSE + \@nameuse{b@\ac@label}% + }% + }% + }{#1}% +} +% \end{macrocode} +% \end{macro} +% +% \begin{macro}{\bibindent} +% Indent second and subsequent lines of bibliographic entries. +% \begin{macrocode} +\setlength\bibindent{1.5em} +% \end{macrocode} +% \end{macro} +% +% \begin{environment}{thebibliography} +% There is no \option{openbib} option. The definitions of \cs\newblock and +% \cname{@biblabel} are kept local in case something else weird is going on. +% \begin{macrocode} +\newcommand\ac@defbib [2] {% + \renewenvironment*{thebibliography} [1] {% + #1*{#2\@mkboth{#2}{#2}}% + \list{}{% + \leftmargin\z@ + \advance\leftmargin\labelsep + \advance\leftmargin\bibindent + \itemindent -\bibindent + \listparindent \itemindent + \parsep \z@}% +% \end{macrocode} +% \manual does not acknowledge different spacings after different marks of +% punctuation, distinguish interword from intersentence space, or give rules +% about where to break a line near an ellipsis. So we are on our own in the +% bibliography. I have chosen to leave things as they are done in the standard +% bibliography styles, because I haven't yet given it my close consideration. +% That is, we leave all the punctuation the same except for the period, which +% we set to~1000, I forget now whether that's a lower or upper case letter. +% Extending the space after a period when appropriate seems to be the purpose +% of using \cs\newblock, in this bibstyle. +% \begin{macrocode} + \sfcode`\.=\@m + \def\newblock {% + \hskip .11em \@plus.33em \@minus.07em% + }% + \let\@biblabel\Gobble + \sloppy + \clubpenalty4000\widowpenalty4000% + }{% + \def\@noitemerr {% + \@latex@warning{Empty `thebibliography' environment}% + }% + \relax\endlist + }% +} +\@ifclassloaded{article} {% + \ac@defbib{\section}{\refname}% + }{% ELSE + \ac@defbib{\chapter}{\bibname}% +} +\InitCS\ac@defbib % FIX -- where else can I do this? +% \end{macrocode} +% \end{environment} +% +% \Finale diff --git a/Master/texmf-dist/tex/latex/frankenstein/allocate.sto b/Master/texmf-dist/tex/latex/frankenstein/allocate.sto new file mode 100644 index 00000000000..d907cecec32 --- /dev/null +++ b/Master/texmf-dist/tex/latex/frankenstein/allocate.sto @@ -0,0 +1,442 @@ +% \AddToCheckSum{309} +% +% \begin{warning} +% This code has not been well tested yet. The output routine of \LaTeX{} is +% very complicated, and unforseen problems might arise. +% \end{warning} +% +% \DescribeMacro\NextAux +% \DescribeMacro\DynamicAux +% \DescribeMacro\StaticAux +% The macro \cs\NextAux changes \cname{@auxout} to a new stream if one is +% available, and gives an error otherwise. The macro is implemented in +% dynamic and static ways which can be selected with \cs\DynamicAux and +% \cs\StaticAux\marg{number of streams}. The number of streams can be from 2 +% to~16. The dynamic implementation is the default; I do not see much use +% for the static implementation at present. The \option{static} option is +% the equivalent of the declaration |\StaticAux{10}|. The \option{dynamic} +% selects the dynamic implementation. +% +% \cs\StaticAux can be invoked after \cs\DynamicAux, but not the other way +% around (at least, the streams allocated by \cs\StaticAux are not +% recovered). Macros which use \cs\NextAux do not have to know whether the +% implementation is static or dynamic. +% +% \subsubsection{Wheels} +% +% The output streams are manipulated with the help of a data structure I call a +% \word{wheel}. +% +% A \term{wheel} has 0 or more \term{spokes} and can be \term{rolled}. Each +% spoke is a \TeX{} token, probably a control sequence name, and has an +% internal name. You can access the spoke at the 12 o'clock or ``top'' +% position of a wheel. In computerese, a wheel is a circularly linked list of +% tokens, and the operation of rolling moves a pointer along it in a certain +% direction by one element. +% +% Wheels and operations on wheels are local. +% +% \DescribeMacro\InitWheel +% \DescribeMacro\DefWheel +% You make a wheel either with \cs\InitWheel\marg{\\csname}, which makes +% \meta{\\csname} a wheel with no spokes, or +% \cs\DefWheel\marg{\\csname}\marg{spokes}, which makes a wheel with +% \meta{spokes} for spokes. The first spoke in \meta{spokes} is the top, the +% second will be top after one roll, and the first will be top again after +% $n$ rolls, if there are $n$ spokes. +% +% \DescribeMacro\Roll +% \DescribeMacro\Top +% \DescribeMacro\AddSpokes +% Wheels are rolled by \cs\Roll\marg{wheel}. Spokes can be added to a +% wheel with \cs\AddSpokes\marg{wheel}\marg{spokes}. When $n$ spokes are +% added, the previous top will be at the top after $n$ rolls. +% \cs\Top\marg{wheel} expands eventually to the top spoke, which then can +% further expand, and so on. +% +% \DescribeMacro\IfTop +% \cs\IfTop\marg{wheel}\marg{spoke}\marg{true clause}\marg{false clause} +% compares the top of \meta{wheel} with \meta{spoke} using \cname{ifx}, and +% executes either \meta{true clause} or \meta{false clause} as appropriate. +% (The \package{newclude} package doesn't actually use this command; it's +% provided to ``round out'' the wheel data structure.) +% +% \caveat{Don't put more than one token as the second argument to \cs\IfTop.} +% +% \subsubsection{Preliminaries} +% +% We require the \package{afterpage} package. The intuitive justification is +% that \cs\write{}s are delayed until the current page is shipped out. We need +% to keep an output stream open until its last \cs\write has been actually +% handled; after that, the stream can be made available again. +% \begin{macrocode} +\RequirePackage{afterpage} +% \end{macrocode} +% +% \begin{macro}{\nc@aux@wheel} +% We use the wheel structure to handle both the static case and the dynamic +% case. The spokes of the wheel are macros |\nc@auxout@|\meta{n}. Their +% first-level expansion is \meta{n}, a positive integer from 0 to~15. Each +% spoke has two corresponding macros. |\nc@auxout@|\meta{n}|@stream| is a +% stream name allocated by \cs\newwrite. |\nc@auxout@|\meta{n}|@inuse| is a +% global boolean which is |true| iff the corresponding stream is currently in +% use. +% \begin{macrocode} +\InitWheel\nc@aux@wheel +% \end{macrocode} +% \end{macro} +% +% \begin{macro}{\nc@count} +% We need an internal counter. Notice that the stream numbers used in the +% auxwheel start at 0, so the stream associated with with the numeral 4 is +% the fifth stream. +% \begin{macrocode} +\newcounter{nc@count} +% \end{macrocode} +% \end{macro} +% +% \begin{macro}{\nc@aux@wheel@size} +% \cname{nc@aux@wheel@size} is a pseudo-counter that holds the present size +% of the aux wheel. In the static case it never changes and is set only for +% consistency. +% \begin{macrocode} +\ReserveCS\nc@aux@wheel@size +% \end{macrocode} +% \end{macro} +% +% \begin{macro}{\NextAux} +% \mbox{} +% \begin{macrocode} +\ReserveCS\NextAux +% \end{macrocode} +% \end{macro} +% +% The kernel allocates two streams for the include system, \cname{@mainaux} and +% \cname{@partaux}. The auxwheel is initialized with these two streams. The +% first, corresponding to the principle source, is always marked in use. +% +% \todo{Reserve the stream names.} +% \begin{macrocode} +\newboolean{@nc@auxout@1@inuse@} + +\ReserveName{nc@auxout@1} +\NewName*{nc@auxout@1} {} {1} + +\ReserveName{nc@auxout@1@stream} +\expandafter\let\csname nc@auxout@1@stream\endcsname\@partaux +% \end{macrocode} +% +% \begin{macro}{\nc@init@aux@wheel} +% We initialize the wheel with the first spoke. +% \begin{macrocode} +\newcommand\nc@init@aux@wheel {% + \EExpand\csname nc@auxout@1\endcsname\In {% + \AddSpokes\nc@aux@wheel##1% + } +} +% \end{macrocode} +% \end{macro} +% +% \subsubsection{Static allocation} +% +% \begin{macro}{\StaticAux} +% nonpositive numbers are treated the same as~1. \todo{bounds check; the +% counter's max should be one less than the number, since we have stream 0.} +% \begin{macrocode} +\newcommand\StaticAux [1] {% + \def\nc@aux@wheel@size {#1} + \setcounter{nc@count}{2} + \nc@init@aux@wheel + \@whilenum \value{nc@count} <= \nc@aux@wheel@size + \do {% +% \end{macrocode} +% First define the macros that make up the wheel itself to be their spoke +% numbers. +% \begin{macrocode} + \eExpand*\thenc@count\In {% + \NewName*{nc@auxout@\thenc@count} {} {% + ##1% + }% + } +% \end{macrocode} +% Next allocate the corresponding stream. +% \begin{macrocode} + \EExpand\csname nc@auxout@\thenc@count@stream\endcsname\In {% + \@nameuse{newwrite}##1% + } +% \end{macrocode} +% Next create the corresponding flag (they start |false|). +% \begin{macrocode} + \provideboolean{@nc@auxout@\thenc@count @inuse@} +% \end{macrocode} +% Now add the spoke itself. +% \begin{macrocode} + \EExpand\csname nc@auxout@\thenc@count\endcsname\In {% + \ReserveCS#1% + \AddSpokes\nc@aux@wheel##1% + } + \stepcounter{nc@count} + } + \def\NextAux {% + \Roll\nc@aux@wheel + \@nameuse{if@nc@auxout@\Top\nc@aux@wheel @inuse@}% + \MonsterError{newclude} {% + You can't nest \protect\include this deeply!% + }% + \else + \Elet\@auxout\csname nc@auxout@\Top\nc@aux@wheel @stream\endcsname + \fi + }% +} +% \end{macrocode} +% \end{macro} +% +% \subsubsection{Dynamic allocation} +% +% \begin{macro}{\DynamicAux} +% \begin{macro}{\nc@addnewauxstream} +% \mbox{} +% \begin{macrocode} +\newcommand\DynamicAux {% + \def\nc@aux@wheel@size {1} + \nc@init@aux@wheel + \def\NextAux {% + \Roll\nc@aux@wheel + \@nameuse{if@nc@auxout@\Top\nc@aux@wheel @inuse@}% + \nc@addnewauxstream + \fi +% \end{macrocode} +% Either the top spoke was not in use, or we have added a fresh spoke at the +% top -- so the top spoke represents what we want. +% \begin{macrocode} + \Elet\@auxout\csname nc@auxout@\Top\nc@aux@wheel @stream\endcsname + \typeout{NextAux has just set auxout to stream + \the\csname nc@auxout@\Top\nc@aux@wheel @stream\endcsname. + We are using spoke number + \csname nc@auxout@\Top\nc@aux@wheel\endcsname.} + }% +} +% \end{macrocode} +% It works out that the new spoke should have a spoke number one greater than +% the current wheel size. We use the |nc@count| counter to find this number. +% \begin{macrocode} +\newcommand\nc@addnewauxstream {% + \setcounter{nc@count}{\nc@aux@wheel@size}% + \stepcounter{nc@count}% + \typeout{Allocating another spoke (spoke number \thenc@count)}% +% \end{macrocode} +% First we add the spoke itself, then initialize the corresponding objects. +% \begin{macrocode} + \EExpand*\csname nc@auxout@\thenc@count\endcsname\In {% + \AddSpokes\nc@aux@wheel##1% + }% + \EExpand*\thenc@count\In {% + \DefName*{nc@auxout@##1} {} {##1}% + \provideboolean{@nc@auxout@##1@inuse@}% + \def\nc@aux@wheel@size {##1}% + \EExpand*\csname nc@auxout@##1@stream\endcsname\In {% + \@nameuse{newwrite}####1% + }% + }% +} +\DynamicAux +% \end{macrocode} +% \end{macro} +% \end{macro} +% +% \subsubsection{Including} +% +% \begin{macro}{\nc@include} +% The only way I see how to set the |inuse| flag to |false| at the proper +% time is to use the \package{afterpage} package. What I would really like +% is to \cs\write something with side effects. +% \begin{macrocode} +\newcommand\nc@include [2][] {% + \if@filesw + \immediate\write\@mainaux{\string\@input{#2.aux}}% + \fi + \@tempswatrue + \if@partsw + \@tempswafalse + \edef\reserved@b{#2}% + \@for\reserved@a:=\@partlist\do + {\ifx\reserved@a\reserved@b\@tempswatrue\fi}% + \fi + \if@tempswa + \stepcounter{IncludeDepth}% +% \end{macrocode} +% \cname{nc@t@c} is going to preserve the current \ext{aux} stream number to +% restore \cname{@auxout}, in case there is a nested \cs\include. +% \begin{macrocode} + \edef\nc@t@c {% + \the\@auxout + }% + \if@filesw + \NextAux + \openout\@auxout #2.aux + \write\@auxout{\relax}% + \expandafter\global + \csname @nc@auxout@\Top\nc@aux@wheel @inuse@true\endcsname +% \end{macrocode} +% \begin{macro}{\nc@include@finish@<N>} +% The next line defines the macro |\nc@include@finish@|\meta{n} to close the +% output stream that is presently open. We have an interesting task here of +% getting certain unique information to macros after the \cname{@input} when we +% might end up recursing during the \cname{@input}. To do this, we immediately +% expand the variables we need and store them in a macro which will \emph{not} +% be altered by a recursion of \cs\include. We have set up the |IncludeDepth| +% counter to allow us to define such a macro, which is unique to \emph{this} +% instance of \cs\include. +% +% \begin{warning} +% The macro names |\nc@include@finish@|\meta{n} where \meta{n} is an +% integer are overwritten, that is, they are not allocated in a safe way. +% \end{warning} +% +% The following lines are intended to make this definition, where |<D>| +% represents the current value of |IncludeDepth|, |<P>| represents the spoke +% number of the current top of \cname{nc@aux@wheel}, and |<S>| represents the +% stream number for the current part, i.e., the current value of +% \cname{@auxout}, and |<X>| represents the stream number that was current +% before \cs\include got called (this is saved in \cname{nc@t@c}). +% \begin{codeexample} +% \def\nc@include@finish@<D> {% +% \closeout<S>% +% \global\chardef\@auxout=<X>% +% \afterpage{\global\@nc@auxout@<P>@inuse@false} +% } +% \end{codeexample} +% \begin{macrocode} + \EExpand\theIncludeDepth\In {% ##1 + \EExpand\the\@auxout\In {% ####1 + \DefName{nc@include@finish@##1} {} {% + \closeout####1% + \global\chardef\@auxout=\nc@t@c + \typeout{Restored auxout to stream number + \nc@t@c \space (old: \the\@auxout)} + \typeout{executing afterpage}% + \EExpand\csname @nc@auxout@\Top\nc@aux@wheel + @inuse@false\endcsname\In {% ########1 + \afterpage{% + \typeout{Finishing. auxout is now \the\@auxout; current spoke + is \csname nc@auxout@\Top\nc@aux@wheel\endcsname\space + with stream number + \the\csname nc@auxout@\Top\nc@aux@wheel @stream\endcsname + }% + \global########1% + }% Afterpage + }% EExpand + }% DefName + }}% EExpand + \fi % \if@filesw + \nc@t@b % surround the \include with something +% \end{macrocode} +% Now execute the text of the optional argument to \cs\include. Notice that if +% we change to a new \ext{aux} file, we should do it before the optional +% argument. This is important so that sectioning commands will appear in the +% right order. If the sectioning command were to write to \cname{@mainaux}, +% then it would come \emph{after} the whole included \ext{aux} file, instead of +% before it. +% \begin{macrocode} + #1% + \@input@{#2.tex}% + \@writeckpt{#2}% + \if@filesw + \csname nc@include@finish@\theIncludeDepth\endcsname + \fi + \nc@t@b % surround the \include with something +% \end{macrocode} +% We mustn't restore the counter before we have finished using it. +% \begin{macrocode} + \addtocounter{IncludeDepth}{\m@ne}% +% \end{macrocode} +% If the file is excluded by the \cs\includeonly command, we don't load it and +% execute the file's checkpoint instead. +% \begin{macrocode} + \else + \@nameuse{cp@#2}% + \fi +} +% \end{macrocode} +% \end{macro} +% \end{macro} +% +% \subsubsection{Checkpoints} +% +% \begin{macro}{\@writeckpt} +% \begin{macro}{\@wckptelt} +% We must redefine the macros which write the checkpoints. \cname{@auxout} +% is substituted for \cname{@partaux}; I think this change should be in the +% kernel anyway! And we remove the \cs\immediate{}s. +% \begin{macrocode} +\defcommand\@writeckpt [1] {% + \if@filesw + \write\@auxout{\string\@setckpt{#1}\@charlb}% + \begingroup + \let\@elt\@wckptelt + \cl@@ckpt + \endgroup + \write\@auxout{\@charrb}% + \fi +} +\defcommand\@wckptelt [1] {% + \protected@write\@auxout{}{\string\setcounter{#1}{\the\@nameuse{c@#1}}}% +} +% \end{macrocode} +% \end{macro} +% \end{macro} +% +% \subsubsection{Wheels} +% +% \begin{macro}{\InitWheel} +% \begin{macro}{\Roll} +% \begin{macro}{\IfTop} +% \begin{macro}{\Top} +% \begin{macro}{\AddSpokes} +% A wheel is implemented as a macro. The tokens of its first-level expansion +% are the spokes, the top being the first. +% \begin{macrocode} +\newcommand\InitWheel [1] {% args: wheel + \InitCS#1% +} +\newcommand\Roll [1] {% args: wheel + \edef #1{% + \expandafter\nc@roll #1\nc@llor + }% +} +\ReserveCS\nc@llor +\NewNameDef{nc@roll} {#1\nc@llor} {% + \@cdr#1\@nil\@car#1\@nil +} +\newcommand\Top [1] {% args: wheel + \E@car #1\@nil +} +\newcommand\IfTop [4] {% args: wheel token true false + \EExpand#1\In {% + \edef\nc@t@b {% + \expandafter\noexpand\@car##1\@nil + }% + }% +% \end{macrocode} +% At this point, the first-level expansion of \cname{nc@t@b} is a single token, +% the top of the wheel. We \cs\let \cname{nc@t@a} to this token. +% \begin{macrocode} + \Elet\nc@t@a\nc@t@b + \let\nc@t@b #2% + \ifx\nc@t@a\nc@t@b + \expandafter\@firstoftwo + \else + \expandafter\@secondoftwo + \fi +} +\newcommand\AddSpokes [2] {% args: wheel spokes + \EExpand#1\In {% + \def #1{#2##1}% + }% +} +% \end{macrocode} +% \end{macro} +% \end{macro} +% \end{macro} +% \end{macro} +% \end{macro} diff --git a/Master/texmf-dist/tex/latex/frankenstein/attrib.stq b/Master/texmf-dist/tex/latex/frankenstein/attrib.stq new file mode 100644 index 00000000000..2c32786d2a7 --- /dev/null +++ b/Master/texmf-dist/tex/latex/frankenstein/attrib.stq @@ -0,0 +1,142 @@ +%% +%% This is file `attrib.stq', +%% generated with the docstrip utility. +%% +%% The original source files were: +%% +%% attrib.sty +%% +%% This program is part of the Frankenstein bundle for LaTeX. +%% +%% Copyright (C) 1995-2001 Matthew Swift <swift@alum.mit.edu> +%% +%% This file may have one of TWO names, either +%% attrib.sty or attrib.stq. This +%% LaTeX package will work ONLY if it is called attrib.sty +%% and placed in a proper directory. This file should have been +%% distributed to you with a DIFFERENT file (also) called +%% attrib.sty which functions identically to this one +%% but contains documentation in comments. This file works faster, +%% but the other should be kept because it contains the documentation +%% for this LaTeX package. Files called README and INSTALL should have +%% also been distributed to you with this file; see them for more +%% information. +%% +%% This program is free software; you may redistribute it and/or +%% modify it under the conditions of the LaTeX Project Public +%% License, either version 1.2 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. +%% +%% This program is distributed in the hope that it will be useful, +%% but WITHOUT ANY WARRANTY; without even the implied warranty of +%% MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the +%% LaTeX Project Public License for more details. +%% +%% \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 \~} +\def\fileinfo{attribution of block elements (Frankenstein's hat)} +\def\DoXPackageS {attrib,dialogue} +\def\initelyHavECitationS {} +\def\fileversion{v1.3} +\def\filedate{2001/08/31} +\def\docdate{2001/08/31} +\edef\PPOptArg {% + \filedate\space \fileversion\space \fileinfo +} +\makeatletter% A special comment to help create bst files. Don't change! +\@ifundefined{JusTLoaDInformatioN} {% + }{% ELSE (we know the compsci package is already loaded, too) + \UndefineCS\JusTLoaDInformatioN + \SaveDoXVarS + \eExpand\csname DoXPackageS\endcsname\In {%use \csname in case it's undefined + \usepackage{#1}% + }% + \RestoreDoXVarS + \makeatother + \endinput +}% A special comment to help create bst files. Don't change! +\NeedsTeXFormat{LaTeX2e} +\ProvidesPackage{attrib}[\PPOptArg] +%% +\RequirePackage{moredefs} +\newlength{\AttribMinSkip} + \setlength{\AttribMinSkip}{2em} +\newcommand\PreTrib {% + (% +} +\newcommand\PostTrib {% + )% +} +\ReserveCS\AttribInit +\newcommand\at@init {% + \SaveCS\footnote + \def\footnote {% + \normalcitations\MDSavedfootnote + }% + \attribcitations + \ifhmode + \unskip + \fi + \AttribInit +} +\newcommand\attribcitations {% + \SaveCS\PreCiteWork + \SaveCS\PostCiteWork + \def\PreCiteWork {% + \csname + }% + \def\PostCiteWork {% + \relax\end{lrbox}\usebox{\sc@box@a}% + }% + \SaveCS\PreCite + \SaveCS\PostCite + \let\PreCite\ShortEmpty + \let\PostCite\ShortEmpty +} +%% FIX +\newcommand* \normalcitations {% + \RestoreCS\PreCite + \RestoreCS\PostCite + \RestoreCS\PreCiteWork + \RestoreCS\PostCiteWork +} +\newcommand\attrib [1] {% + \begingroup + \at@init + \nobreak\hfil\penalty50% + \hskip\AttribMinSkip + \vadjust{}\nobreak\hfil + {\PreTrib\relax#1}{\PostTrib}% + \parfillskip\z@ + \nobreak + \finalhyphendemerits0% + \par + \endgroup +} +\newcommand\attribstar [2] {% + \begingroup + \addto@macro\PostTrib {% + \normalcitations + \starnote{#2}% + }% + \attrib{#1}% + \endgroup +} +\endinput +%% +%% End of file `attrib.stq'. diff --git a/Master/texmf-dist/tex/latex/frankenstein/attrib.sty b/Master/texmf-dist/tex/latex/frankenstein/attrib.sty new file mode 100644 index 00000000000..e840265b166 --- /dev/null +++ b/Master/texmf-dist/tex/latex/frankenstein/attrib.sty @@ -0,0 +1,549 @@ +%^^A* legal notices +% \iffalse +% +% This program is part of the Frankenstein bundle for LaTeX. +% +% Copyright 1995-2001 Matt Swift <swift@alum.mit.edu>. +% +% This file contains both the code and documentation for the +% attrib LaTeX package. It will work ONLY if it is placed in a +% proper directory. Files called README, INSTALL, attrib.tex +% and attrib.ins should have also been distributed to you +% with this file. See them for more information on how to typeset +% the documentation with LaTeX and how to generate a version of this +% file that will work faster than this one. +% +% This program is free software; you may redistribute it and/or +% modify it under the conditions of the LaTeX Project Public +% License, either version 1.2 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. +% +% This program is distributed in the hope that it will be useful, +% but without any warranty; without even the implied warranty of +% merchantability or fitness for a particular purpose. See the +% LaTeX Project Public License for more details. +% +% \fi +% +%^^A* checks +% +%^^A NOTE: The character table, with two %'s, will get written to all files. +%% \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 \~} +% +% \CheckSum{89} +% +% \begin{abstract} +% The \cs\attrib macro attributes block elements, for example when citing a +% reference after a block quotation. +% \end{abstract} +% \tableofcontents +% +% \part{Discussion} +% +% \section{Attributions} +% +% FIX: maybe \cs\attrib when not in a block environment should do this, with +% appropriate hooks added, etc.: use the blkcntrl hooks. and Pre stuff. +% \begin{codeexample} +% \def\attrib [1] {% +% (\begingroup +% \attribcitations +% #1% +% \endgroup +% )% +% } +% \end{codeexample} +% Here's an example of the kind that inspires the question: \code{({\attribcitations +% \citework{3}{unnam}, and see page~\pageref{q:aporia}})}. This way +% \cs\attribcitations and \cs\normalcitations could still be defined only +% within \cs\attrib, which seems the most sensible. +% +% \DescribeMacro\attrib +% I wrote \cs\attrib in order to have an abstract way to attribute the source +% of quotations of prose or verse in an academic style. The formatting is +% that recommended by the \manual, except that attributions of block +% quotations of prose are given flush right, to allow the reader to locate a +% quotation more quickly when returning to the text. +% +% Use \cs\attrib\marg{attribution} at the end of any block of text, +% such as the \env{quote}, \env{quotation}, \env{verse}, and \env{dialogue} +% environments (the last is defined in the \package{dialogue} package, also +% part of the \Frankenstein bundle). +% +% For \env{verse}, you ought to use either a blank line or a final \cs{\\} +% before your attribution. For \env{quote}, \env{quotation}, and +% \env{dialgoue}, don't leave a blank line. +% +% \cs\attrib will place the attribution flush right to the margins of the +% block. If there is enough room on the last line, the attribution will be +% given on the last line, otherwise it moves down to a line of its own. +% +% You can put pretty much anything as the text of the attribution, including +% citations and footnotes. +% +% For those using the \package{achicago} and \package{abbrevs} packages (also +% in the \Frankenstein bundle), \cs\citework works very well. If you're +% using regular \cs\cite or another package, I recommend using the FIX hook +% below to remove the usual parens or braces around citations that occur +% within the \cs\attrib argument. It makes more sense to me that way. +% +% \DescribeMacro\normalcitations +% If parens are normally around citations, they are removed when citations +% occur within attributions. The idea is that you can simply write +% \code{\attrib{\cite{key}}} and what normally surrounds the citation will be +% replaced with \cs\PreTrib and \cs\PostTrib (which of course could be the +% same thing, but doing it this way allows attributions to contain things +% \emph{other} than just a citation and still everything will look right). +% +% Whenever within an attribution you want the normal behavior of citations +% back, write \cs\normalcitations. \cs\normalcitations is automatically used +% within footnotes within attributions; it's used in the \package{epigraph} +% package; and occasionally a user will want to invoke it, when the +% attribution is unusual. I find that most attributions are either just a +% citation, or they do not have a citation at all. Sometimes I've wanted an +% attribution consisting of a citation plus some other text, for which cases +% I provided \cs\normalcitations as a user command. +% +% \todo{Right now the only time there is any concept of ``normal'' or +% altered behavior of \cs\cite commands is with the \package{achicago} +% package. I should make it so that \cs\attrib by default leaves off braces, +% brackets, etc, around citations, for the standard definition of \cs\cite also.} +% +% \DescribeMacro\attribcitations +% +% FIX: dox, example. +% +% \section{Examples} +% Following are several examples that use \cs\attrib. They should be +% self-explanatory. +% +% \begin{bothexample} +% \begin{quotation} +% [My plays] deal with distress. Some people object to this in my writing. +% +% At a party an English intellectual---so called---asked me why I write always +% about distress. As if it were perverse to do so! He wanted to know if my +% father had beaten me or my mother had run away from home to give me an +% unhappy childhood. I told him no, that I had had a very happy childhood. +% Then he thought me more perverse than ever. I left the party as soon as +% possible and got into a taxi. On the glass partition between me and the +% driver were three signs: one asked for help for the blind, another help for +% orphans, and the third for relief for the war refugees. One does not have to +% look for distress. It is screaming at you even in the taxis of London. +% \attrib{\cite[24]{driver:beckett:madeleine}} +% \end{quotation} +% \end{bothexample} +% +% \begin{bothexample} +% \providelength\mtslen +% \newcommand\makethisspace [1] {% +% \settowidth{\mtslen}{#1}% +% \hspace*{\mtslen}% +% } +% \begin{verse} +% \makethisspace{Where Joy for ever dwells:} Hail horrours, hail \\ +% Infernal World, and thou profoundest Hell \\ +% Receive thy new Possessor: One who brings \\ +% A mind not to be chang'd by Place or Time. \\ +% The mind is its own place, and in it self \\ +% Can make a Heav'n of Hell, a Hell of Heav'n. \\ +% What matter where, if I be still the same, \\ +% And what I should be, all but less then he \\ +% Whom Thunder hath made greater? Here at least \\ +% We shall be free; th' Almighty hath not built \\ +% Here for his envy, will not drive us hence: \\ +% Here we may reign secure, and in my choyce \\ +% To reign is worth ambition though in Hell: \\ +% Better to reign in Hell, then serve in Heav'n. +% +% \attrib{\book{Paradise Lost} 1.250--63, +% \cite{milton:riverside:paralost}} +% \end{verse} +% \end{bothexample} +% +% You can have a footnote inside the attribution. The boxed example below is +% meant to approximate a whole page (that is, the footnote appears at the +% bottom of the page, not directly underneath the quotation). +% \begin{bothexample} +% \begin{verse} +% Jacke boy, ho boy newes,\\ +% \quad the cat is in the well,\\ +% let us ring now for her Knell,\\ +% \quad ding dong ding dong Bell. +% +% \attrib{\cite[149]{opie:nursery}\footnote {% +% Perhaps more familiar is the nursery rhyme that begins ``Ding, +% dong, bell, / Pussy's in the well,'' which Opie and Opie also cite. It does +% not seem clear in that rhyme, however, without contextual knowledge, that the +% cat has died and the bell rings its knell.}} +% \end{verse} +% \end{bothexample} +% +% Here is a quotation from \citeNP{beckett:watt}: +% \begin{bothexample} +% \newwork\watt{Watt} +% \begin{quote} +% One day Watt, coming out from behind a bush, almost ran into Mr~Knott, +% which for an instant troubled Watt greatly, for he had not quite finished +% adjusting his dress. But he need not have been troubled. For Mr~Knott's +% hands were behind his back, and his head bowed down, towards the ground. +% Then Watt in his turn looking down at first saw nothing but the short green +% grass, but when he had looked a little longer he saw a little blue flower +% and close by a fat worm burrowing into the earth. So this was what had +% attracted Mr~Knott's attention, perhaps. So there for a short time they +% stood together, the master and the servant, the bowed heads almost touching +% \lips, until the worm was gone and only the flower remained. One day the +% flower would be gone and only the worm remain, but on this particular day +% it was the flower that remained, and the worm that went. And then Watt, +% looking up, saw that Mr~Knott's eyes were closed, and heard his breathing, +% soft and shallow, like the breathing of a child asleep. +% \attrib{\citework{145--46}{watt}} +% \end{quote} +% \end{bothexample} +% +% Finally, here's a very simple example from the same book. When the context +% is clear, you might just want page numbers in the attribution. +% \begin{bothexample} +% \begin{quote} +% For Watt now found himself in the midst of things which, if they +% consented to be named, did so as it were with reluctance.\lips Looking at +% a pot, for example, \lips it was in vain that Watt said, Pot, pot. Well, +% perhaps not quite in vain, but very nearly. \lips It resembled a pot, it +% was almost a pot, but it was not a pot of which one could say, Pot, pot, +% and be comforted. It was in vain that it answered, with unexceptionable +% adequacy, all the purposes, and performed all the offices, of a pot, it +% was not a pot. And it was just this hairbreadth departure from the +% nature of a true pot that so excruciated Watt\lips. For he could always +% hope, of a thing of which he had never known the name, that he would +% learn the name, some day, and so be tranquillized. +% +% \attrib{81--82} +% \end{quote} +% \end{bothexample} +% +% Here's an example of use with the \env{dialogue} environment. Not much +% different than the others, but the quotes are nice, and I'll demonstrate a +% use of \cs\normalcitations. \refer{b}'s speeches are interspersed through +% the play with \refer{a}'s and \refer{c}'s, but it's interesting to read them +% consecutively. +%\begin{bothexample} +% \begin{dialogue} +% \speak{b} on the stone together in the sun on the stone at the edge of the +% little wood and as far as eye could see the wheat turning yellow vowing every +% now and then you loved each other just a murmur not touching or anything of +% that nature you one end of the stone she the other long low stone like +% millstone no looks just there on the stone in the sun with the little wood +% behind gazing at the wheat or eyes closed all still no sign of life not a +% soul abroad no sound +% +% \speak{b} all still just leaves and ears and you too still on the stone in a +% daze no sound not a word only every now and then to vow you loved each other +% just a murmur one thing could ever bring tears till they dried up altogether +% that thought when it came up among the others floated up that scene +% +% \speak{b} on the stone in the sun gazing at the wheat or the sky or the eyes +% closed nothing to be seen but the wheat turning yellow and the blue sky +% vowing every now and then you loved each other just a murmur tears without +% fail till they dried up altogether suddenly there in whatever thoughts you +% might be having whatever scenes perhaps way back in childhood or the womb +% worst of all or that old Chinaman long before Christ born with long white +% hair +% +% \speak{b} no sight of the face or any other part never turned to her nor she to +% you always parallel like on an axle-tree never turned to each other just +% blurs on the fringes of the field no touching or anything of that nature +% always space between if only an inch no pawing in the manner of flesh and +% blood no better than shades no worse if it wasn't for the vows +% +% \speak{b} \lips on the fringe of the field and every now and then in the great +% peace like a whisper so faint she loved you +% +% \attrib{\play{That Time}{} \normalcitations\cite{beckett:csp:that}} +% \end{dialogue} +% \end{bothexample} +% +% \section{Programmer's Interface} +% +% You might want to use \cs\attrib as part of some other command you define. +% For example, I wrote a command for epigraphs, +% \cs\epigraph\marg{text}{attribution}, which used \cs\attrib internally. For +% this type of thing, and also in general I suppose, you might want to change +% the behavior of \cs\attrib. +% +% \DescribeMacro\AttribMinSkip +% \cs\AttribMinSkip is a length, the minimum amount of horizontal space that +% must come after any previous text and before the attribution. The default +% value is \code{2em}. +% +% \DescribeMacro\PreTrib +% \DescribeMacro\PostTrib +% When you write \cs\attrib{attribution}, \cs\PreTrib will immediately +% precede \meta{attribution} and \cs\PostTrib will immediately follow it. +% Notice how the attributions in the examples above were in parentheses, but +% we didn't have to write them. The default value of \cs\PreTrib is a left +% parenthesis and the default value of \cs\PostTrib is a right parenthesis. +% \cs\PreTrib and \meta{attribution} are executed inside a group that doesn't +% include \PostTrib, and \cs\PostTrib is executed in a group all by itself, +% like this: \code{{\PreTrib\relax#1}{\PostTrib}}. Honestly I can't tell +% you right now why it's done this way, but I'm sure I have some good reason +% for it! +% +% \DescribeMacro\AttribInit +% \cs\AttribInit is an hook, empty by default, that gets executed after some +% standard setup but before the core of the \cs\attrib macro. It is executed +% within a group that includes \cs\PreTrib, \meta{attribution}, and +% \cs\PostTrib, so perhaps it is appropriate for a font style change or +% something (I haven't made use of it myself). +% +% \StopEventually{} +% +% \part{Implementation} +% +% \section{Version control} +% +% \begin{macro}{\fileinfo} +% \begin{macro}{\DoXUsepackagE} +% \begin{macro}{\HaveECitationS} +% \begin{macro}{\fileversion} +% \begin{macro}{\filedate} +% \begin{macro}{\docdate} +% \begin{macro}{\PPOptArg} +% These definitions must be the first ones in the file. +% \begin{macrocode} +\def\fileinfo{attribution of block elements (Frankenstein's hat)} +\def\DoXPackageS {attrib,dialogue} +\def\initelyHavECitationS {} +\def\fileversion{v1.3} +\def\filedate{2001/08/31} +\def\docdate{2001/08/31} +\edef\PPOptArg {% + \filedate\space \fileversion\space \fileinfo +} +% \end{macrocode} +% \end{macro} +% \end{macro} +% \end{macro} +% \end{macro} +% \end{macro} +% \end{macro} +% \end{macro} +% +% If we're loading this file from a \cs\ProcessDTXFile command (see the +% \package{compsci} package), then \cs\JusTLoaDInformatioN will be defined; +% othewise we assume it is not (that's why the FunkY NamE). +% +% If we're loading from \cs\ProcessDTXFile, we want to load the packages listed +% in \cs\DoXPackageS (needed to typeset the documentation for this file) and +% then bail out. Otherwise, we're using this file in a normal way as a +% package, so do nothing. \cs\DoXPackageS, if there are any, are declared in +% the \ext{dtx} file, and, if you're reading the typeset documentation of this +% package, would appear just above. (It's OK to call \cs\usepackage with an +% empty argument or \cs\relax, by the way.) +% \begin{macrocode} +\makeatletter% A special comment to help create bst files. Don't change! +\@ifundefined{JusTLoaDInformatioN} {% + }{% ELSE (we know the compsci package is already loaded, too) + \UndefineCS\JusTLoaDInformatioN + \SaveDoXVarS + \eExpand\csname DoXPackageS\endcsname\In {%use \csname in case it's undefined + \usepackage{#1}% + }% + \RestoreDoXVarS + \makeatother + \endinput +}% A special comment to help create bst files. Don't change! +% \end{macrocode} +% +% Now we check for \LaTeX2e and declare the LaTeX package. +% \begin{macrocode} +\NeedsTeXFormat{LaTeX2e} +\ProvidesPackage{attrib}[\PPOptArg] +% \end{macrocode}^^A special comment to help create bst files. Don't change! +% +% ^^A NOTE: We have to compensate for the above backslashes, which are not +% ^^A actually in the .dtx file the author works on, by adding to the +% ^^A CheckSum. +%% +% \AddToCheckSum{17}^^A `dtx-update-checksum' automatically handles this. +% \AddToCheckSum{7}^^A The half a macrocode env. at the top is missed, however... +% \AddToCheckSum{10}^^A ... and so are the 5 \defs from the .dtx file +% ^^A that precede it. +% \IfCitations {% +% \AddToCheckSum{2}^^A When \initelyHavECitationS is defined in +% } ^^A the .dtx file, we need 2 more in the CheckSum. +% +% +% \begin{macrocode} +\RequirePackage{moredefs} +% \end{macrocode} +% +% \section{Macros} +% +% \begin{macro}{\AttribMinSkip} +% \begin{macro}{\PreTrib} +% \begin{macro}{\PostTrib} +% \mbox{} +% \begin{macrocode} +\newlength{\AttribMinSkip} + \setlength{\AttribMinSkip}{2em} +\newcommand\PreTrib {% + (% +} +\newcommand\PostTrib {% + )% +} +% \end{macrocode} +% \end{macro} +% \end{macro} +% \end{macro} +% +% \begin{macro}{\AttribInit} +% \begin{macro}{\at@init} +% This heart of this code is from the \TeX book \cite[106]{knuth:texbook}. +% If you contribute anything to the horizontal or vertical list before the +% \cs\unskip, it will cancel the effect of the \cs\unskip. You probably +% don't want to do that. +% \begin{macrocode} +\ReserveCS\AttribInit +\newcommand\at@init {% + \SaveCS\footnote + \def\footnote {% + \normalcitations\MDSavedfootnote + }% + \attribcitations +% \end{macrocode} +% If there's a blank line before the \cs\attrib, we want to leave \cs\parskip +% extra space above. +% \begin{macrocode} + \ifhmode + \unskip + \fi + \AttribInit +} +% \end{macrocode} +% \end{macro} +% \end{macro} +% +% \begin{macro}{\attribcitations} +% Sets up citations for within an attrib-like environment. Should probably +% be called within a group. +% \begin{macrocode} +\newcommand\attribcitations {% + \SaveCS\PreCiteWork + \SaveCS\PostCiteWork + \def\PreCiteWork {% + \csname + }% + \def\PostCiteWork {% + \relax\end{lrbox}\usebox{\sc@box@a}% + }% + \SaveCS\PreCite + \SaveCS\PostCite + \let\PreCite\ShortEmpty + \let\PostCite\ShortEmpty +} +% \end{macrocode} +% \end{macro} +% +% \begin{macro}{\normalcitations} +%% FIX +% Would you ever want this and \cs\attribcitations defined outside of the scope +% of an \cs\attrib? Perhaps \cs\let it to a warning outside of \cs\attrib. +% \begin{macrocode} +\newcommand* \normalcitations {% + \RestoreCS\PreCite + \RestoreCS\PostCite + \RestoreCS\PreCiteWork + \RestoreCS\PostCiteWork +} +% \end{macrocode} +% \end{macro} +% +% \begin{macro}{\attrib} +% Knuth says that \cs\vadjust is more efficient here than \cs\hbox, but I +% don't understand why: I guess it's simply a trivial non-discardable item on +% the horizontal list \cite[316]{knuth:texbook}. +% FIX: I can get a page break after the text and before the attribution; it's +% happening with attribstar and when the attribution is dropped to the next +% line, but not sure if that's the only case (first quote in ``impotence'' +% section of library copy of dissertation). Also pages 53, 57 of same. +% \begin{macrocode} +\newcommand\attrib [1] {% + \begingroup + \at@init + \nobreak\hfil\penalty50% + \hskip\AttribMinSkip + \vadjust{}\nobreak\hfil + {\PreTrib\relax#1}{\PostTrib}% + \parfillskip\z@ + \nobreak + \finalhyphendemerits0% + \par + \endgroup +} +% \end{macrocode} +% \end{macro} +% +% \part{Something you can't use} +% +% \begin{macro}{\attribstar} +% There is one macro, \cs\attribstar, in this package that you can't use +% because you don't have a package that I haven't released yet. I don't want +% to release it because it still has a couple of small but significant +% problems that can lead to mistakes. If I took \cs\attribstar out of this +% package, however, I'd have to maintain two different versions of +% \package{attrib}. So here is a glimpse of a future bright star. +% +% \code{\DescribeMacro\attribstar}\par +% Use this instead of a standard footnote in an attribution when you want the +% note to appear on the page of the quotation. That is, it is not a +% substantive note, but something like ``italics mine'' or ``ellipses in +% original'' which belongs there on the page, not in endnotes, in case +% footnotes are ever moved there. +% \begin{comment} +% \begin{bothexample} +% \begin{quote} +% My mother was deeply religious. So was my brother. He knelt down at his +% bed as long as he could kneel\lips. [They] got no value from their +% religion when they died. At the moment of crisis it had no more depth +% than an old-school tie\lips. When you pass a church on an Irish bus, all +% the hands flurry in the sign of the cross. One day the dogs of Ireland +% will do that too and perhaps also the pigs. +% +% \attribstar{\cite[25]{driver:beckett:madeleine}}{Driver ``reconstructs'' +% Beckett's words ``from notes made immediately after'' their conversation +% \cite[22]{driver:beckett:madeleine}.} +% \end{quote} +% \end{bothexample} +% \end{comment} +% +% \begin{macrocode} +\newcommand\attribstar [2] {% + \begingroup + \addto@macro\PostTrib {% + \normalcitations + \starnote{#2}% + }% + \attrib{#1}% + \endgroup +} +% \end{macrocode} +% \end{macro} +% +% \Finale diff --git a/Master/texmf-dist/tex/latex/frankenstein/blkcntrl.stq b/Master/texmf-dist/tex/latex/frankenstein/blkcntrl.stq new file mode 100644 index 00000000000..014d95cedab --- /dev/null +++ b/Master/texmf-dist/tex/latex/frankenstein/blkcntrl.stq @@ -0,0 +1,134 @@ +%% +%% This is file `blkcntrl.stq', +%% generated with the docstrip utility. +%% +%% The original source files were: +%% +%% blkcntrl.sty +%% +%% This program is part of the Frankenstein bundle for LaTeX. +%% +%% Copyright (C) 1995-2001 Matthew Swift <swift@alum.mit.edu> +%% +%% This file may have one of TWO names, either +%% blkcntrl.sty or blkcntrl.stq. This +%% LaTeX package will work ONLY if it is called blkcntrl.sty +%% and placed in a proper directory. This file should have been +%% distributed to you with a DIFFERENT file (also) called +%% blkcntrl.sty which functions identically to this one +%% but contains documentation in comments. This file works faster, +%% but the other should be kept because it contains the documentation +%% for this LaTeX package. Files called README and INSTALL should have +%% also been distributed to you with this file; see them for more +%% information. +%% +%% This program is free software; you may redistribute it and/or +%% modify it under the conditions of the LaTeX Project Public +%% License, either version 1.2 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. +%% +%% This program is distributed in the hope that it will be useful, +%% but WITHOUT ANY WARRANTY; without even the implied warranty of +%% MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the +%% LaTeX Project Public License for more details. +%% +%% \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 \~} +%% FIX; using smallblocks option gives option clash when other packages require +\def\fileinfo{block control} +\def\DoXPackageS {} +\def\fileversion{v1.2} +\def\filedate{2001/08/31} +\def\docdate{2001/08/31} +\edef\PPOptArg {% + \filedate\space \fileversion\space \fileinfo +} +\makeatletter% A special comment to help create bst files. Don't change! +\@ifundefined{JusTLoaDInformatioN} {% + }{% ELSE (we know the compsci package is already loaded, too) + \UndefineCS\JusTLoaDInformatioN + \SaveDoXVarS + \eExpand\csname DoXPackageS\endcsname\In {%use \csname in case it's undefined + \usepackage{#1}% + }% + \RestoreDoXVarS + \makeatother + \endinput +}% A special comment to help create bst files. Don't change! +\NeedsTeXFormat{LaTeX2e} +\ProvidesPackage{blkcntrl}[\PPOptArg] +%% +\RequirePackage{moredefs,relsize} +\DeclareBooleanUserOptions{smallblocks}{normalblocks} +\@onlypreamble\smallblocks +\@onlypreamble\normalblocks +\ExecuteOptions{normalblocks} +\ProcessOptions +\newboolean{@in@footnote@} +\newcommand\PreFootnote {% + \@in@footnote@true +} +\ReserveCS\PreChunk +\newcommand\PreQuote {% + \PreChunk +} +\newcommand\PreQuotation {% + \PreChunk +} +\newcommand\PreVerse {% + \PreChunk +} +\defcommand\@makefntext [1] {% + \setlength\parindent{\@ne em}% + \noindent + \hb@xt@ 1.8em{\hss\@makefnmark}% + {\PreFootnote #1}% +} +\renewenvironment{verse} + {\let\\\@centercr + \relax\list{}{\setlength{\itemsep}{\z@}% + \setlength{\itemindent}{-1.5em}% + \setlength{\listparindent}{\itemindent}% + \setlength{\rightmargin}{\leftmargin}% + \addtolength{\leftmargin}{1.5em}}% + \item\relax\PreVerse\relax} + {\endlist} +\renewenvironment{quotation} + {\list{}{\setlength{\listparindent}{1.5em}% + \setlength{\itemindent}{\listparindent}% + \setlength{\rightmargin}{\leftmargin}% + \setlength{\parsep}{\z@ \@plus\p@}}% + \item\relax\PreQuotation\relax} + {\endlist} +\renewenvironment{quote} + {\list{}{\setlength{\rightmargin}{\leftmargin}}% + \item\relax\PreQuote\relax} + {\endlist} +\AtBeginDocument {% + \if@smallblocks@ + \addto@macro\PreChunk {% + \if@in@footnote@ + \else + \relsize{-1}% + \fi + }% + \fi +} +\endinput +%% +%% End of file `blkcntrl.stq'. diff --git a/Master/texmf-dist/tex/latex/frankenstein/blkcntrl.sty b/Master/texmf-dist/tex/latex/frankenstein/blkcntrl.sty new file mode 100644 index 00000000000..b313925e20e --- /dev/null +++ b/Master/texmf-dist/tex/latex/frankenstein/blkcntrl.sty @@ -0,0 +1,298 @@ +%^^A* legal notices +% \iffalse +% +% This program is part of the Frankenstein bundle for LaTeX. +% +% Copyright 1995-2001 Matt Swift <swift@alum.mit.edu>. +% +% This file contains both the code and documentation for the +% blkcntrl LaTeX package. It will work ONLY if it is placed in a +% proper directory. Files called README, INSTALL, blkcntrl.tex +% and blkcntrl.ins should have also been distributed to you +% with this file. See them for more information on how to typeset +% the documentation with LaTeX and how to generate a version of this +% file that will work faster than this one. +% +% This program is free software; you may redistribute it and/or +% modify it under the conditions of the LaTeX Project Public +% License, either version 1.2 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. +% +% This program is distributed in the hope that it will be useful, +% but without any warranty; without even the implied warranty of +% merchantability or fitness for a particular purpose. See the +% LaTeX Project Public License for more details. +% +% \fi +% +%^^A* checks +% +%^^A NOTE: The character table, with two %'s, will get written to all files. +%% \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 \~} +% +% \CheckSum{97} +% +%^^A** abstract +% \begin{abstract} +% Inserts hooks into certain block elements and footnotes. Also provides a +% command to set block quotations one size smaller than the main text. +% \end{abstract} +% \tableofcontents +% +% \part{Discussion} +% +% \section{General} +% +% This package has two purposes. First, it inserts several hooks into +% constructs in the standard document classes so that other packages can use +% the hooks. The \package{achicago}, \package{attrib}, \package{dialogue}, and +% \package{bits} packages in the \Frankenstein bundle require +% \package{blkcntrl}. Second, \package{blkcntrl} offers one option itself that +% uses the hooks. The \option{smallblocks} option has the same effect as using +% \cs\smallblocks in the preamble, for which see below. The +% \option{normalblocks} option means no \cs\smallblocks, and is there simply +% for completeness. +% +%% FIX; using smallblocks option gives option clash when other packages require +% blkcntrl. Do thorough review of option passing. +% +% \DescribeMacro\smallblocks +% When \cs\smallblocks is declared in the preamble, footnotes and the block +% elements \env{quote}, \env{quotation}, and \env{verse} are set one size +% smaller (i.e., \code{\relsize{-1}}). +% +% \DescribeMacro\normalblocks +% +% \section{Programmers' interface} +% +% \DescribeMacro\PreChunk +% +% \DescribeMacro\PreQuote +% +% \DescribeMacro\PreQuotation +% +% \DescribeMacro\PreVerse +% +% \DescribeMacro\PreFootnote +% +% \StopEventually{} +% +% \part{Implementation} +% +% \section{Version control} +% +% \begin{macro}{\fileinfo} +% \begin{macro}{\DoXUsepackagE} +% \begin{macro}{\HaveECitationS} +% \begin{macro}{\fileversion} +% \begin{macro}{\filedate} +% \begin{macro}{\docdate} +% \begin{macro}{\PPOptArg} +% These definitions must be the first ones in the file. +% \begin{macrocode} +\def\fileinfo{block control} +\def\DoXPackageS {} +\def\fileversion{v1.2} +\def\filedate{2001/08/31} +\def\docdate{2001/08/31} +\edef\PPOptArg {% + \filedate\space \fileversion\space \fileinfo +} +% \end{macrocode} +% \end{macro} +% \end{macro} +% \end{macro} +% \end{macro} +% \end{macro} +% \end{macro} +% \end{macro} +% +% If we're loading this file from a \cs\ProcessDTXFile command (see the +% \package{compsci} package), then \cs\JusTLoaDInformatioN will be defined; +% othewise we assume it is not (that's why the FunkY NamE). +% +% If we're loading from \cs\ProcessDTXFile, we want to load the packages listed +% in \cs\DoXPackageS (needed to typeset the documentation for this file) and +% then bail out. Otherwise, we're using this file in a normal way as a +% package, so do nothing. \cs\DoXPackageS, if there are any, are declared in +% the \ext{dtx} file, and, if you're reading the typeset documentation of this +% package, would appear just above. (It's OK to call \cs\usepackage with an +% empty argument or \cs\relax, by the way.) +% \begin{macrocode} +\makeatletter% A special comment to help create bst files. Don't change! +\@ifundefined{JusTLoaDInformatioN} {% + }{% ELSE (we know the compsci package is already loaded, too) + \UndefineCS\JusTLoaDInformatioN + \SaveDoXVarS + \eExpand\csname DoXPackageS\endcsname\In {%use \csname in case it's undefined + \usepackage{#1}% + }% + \RestoreDoXVarS + \makeatother + \endinput +}% A special comment to help create bst files. Don't change! +% \end{macrocode} +% +% Now we check for \LaTeX2e and declare the LaTeX package. +% \begin{macrocode} +\NeedsTeXFormat{LaTeX2e} +\ProvidesPackage{blkcntrl}[\PPOptArg] +% \end{macrocode}^^A special comment to help create bst files. Don't change! +% +% ^^A NOTE: We have to compensate for the above backslashes, which are not +% ^^A actually in the .dtx file the author works on, by adding to the +% ^^A CheckSum. +%% +% \AddToCheckSum{17}^^A `dtx-update-checksum' automatically handles this. +% \AddToCheckSum{7}^^A The half a macrocode env. at the top is missed, however... +% \AddToCheckSum{10}^^A ... and so are the 5 \defs from the .dtx file +% ^^A that precede it. +% \IfCitations {% +% \AddToCheckSum{2}^^A When \initelyHavECitationS is defined in +% } ^^A the .dtx file, we need 2 more in the CheckSum. +% +% +% \section{Requirements} +% +% \begin{macrocode} +\RequirePackage{moredefs,relsize} +% \end{macrocode} +% +% \section{Options} +% +% \begin{macro}{\normalblocks} +% \begin{macro}{\smallblocks} +% \begin{macro}{\if@smallblocks@} +% \begin{macro}{\@smallblocks@true} +% \begin{macro}{\@smallblocks@false} +% \mbox{} +% \begin{macrocode} +\DeclareBooleanUserOptions{smallblocks}{normalblocks} +\@onlypreamble\smallblocks +\@onlypreamble\normalblocks +\ExecuteOptions{normalblocks} +\ProcessOptions +% \end{macrocode} +% \end{macro} +% \end{macro} +% \end{macro} +% \end{macro} +% \end{macro} +% +% \section{General get-control hook hacks} +% +% \begin{macro}{\if@in@footnote@} +% \begin{macro}{\@in@footnote@true} +% \begin{macro}{\@in@footnote@false} +% \begin{macro}{\PreFootnote} +% \begin{macro}{\PreChunk} +% \begin{macro}{\PreQuote} +% \begin{macro}{\PreQuotation} +% \begin{macro}{\PreVerse} +% Additions to these hooks should be made with \cname{\addto@macro}. +% Deletions should be accomplished by scoping. +% +% I think macros are much more convenient as hooks than tokens. I use the +% prefixes |Pre| or |Post|. We want to add a hook to the usual definition +% here, to gain some control over relative sizing in footnotes. +% \begin{macrocode} +\newboolean{@in@footnote@} +\newcommand\PreFootnote {% + \@in@footnote@true +} +\ReserveCS\PreChunk +\newcommand\PreQuote {% + \PreChunk +} +\newcommand\PreQuotation {% + \PreChunk +} +\newcommand\PreVerse {% + \PreChunk +} +% \end{macrocode} +% \end{macro} +% \end{macro} +% \end{macro} +% \end{macro} +% \end{macro} +% \end{macro} +% \end{macro} +% \end{macro} +% +% \begin{macro}{\@makefntext} +% All we're doing is adding the \cs\PreFootnote hook. +% \begin{macrocode} +\defcommand\@makefntext [1] {% + \setlength\parindent{\@ne em}% + \noindent + \hb@xt@ 1.8em{\hss\@makefnmark}% + {\PreFootnote #1}% +} +% \end{macrocode} +% \end{macro} +% +% \begin{environment}{verse} +% \begin{environment}{quotation} +% \begin{environment}{quote} +% Again all we're doing to these environments is adding the hooks. +% +% The hook cannot be put into the second argument, which is called before the +% paragraph preceding the environment has been ended (unless the environment +% started a new one). +% \begin{macrocode} +\renewenvironment{verse} + {\let\\\@centercr + \relax\list{}{\setlength{\itemsep}{\z@}% + \setlength{\itemindent}{-1.5em}% + \setlength{\listparindent}{\itemindent}% + \setlength{\rightmargin}{\leftmargin}% + \addtolength{\leftmargin}{1.5em}}% + \item\relax\PreVerse\relax} + {\endlist} +\renewenvironment{quotation} + {\list{}{\setlength{\listparindent}{1.5em}% + \setlength{\itemindent}{\listparindent}% + \setlength{\rightmargin}{\leftmargin}% + \setlength{\parsep}{\z@ \@plus\p@}}% + \item\relax\PreQuotation\relax} + {\endlist} +\renewenvironment{quote} + {\list{}{\setlength{\rightmargin}{\leftmargin}}% + \item\relax\PreQuote\relax} + {\endlist} +% \end{macrocode} +% \end{environment} +% \end{environment} +% \end{environment} +% +% \begin{macrocode} +\AtBeginDocument {% + \if@smallblocks@ + \addto@macro\PreChunk {% + \if@in@footnote@ + \else + \relsize{-1}% + \fi + }% + \fi +} +% \end{macrocode} +% +% \Finale diff --git a/Master/texmf-dist/tex/latex/frankenstein/compsci.cfg b/Master/texmf-dist/tex/latex/frankenstein/compsci.cfg new file mode 100644 index 00000000000..9cae918c1b6 --- /dev/null +++ b/Master/texmf-dist/tex/latex/frankenstein/compsci.cfg @@ -0,0 +1,66 @@ +% \iffalse +%% +% Even if you don't want any code in this file, leave the empty file, or else +% loading the \package{compsci} package will consume extra time as it searches +% for this file. +%% +% \fi +% \begin{macrocode} +\def\fileinfo{Compsci package configuration} +\def\fileversion{v1.2} +\def\filedate{2001/08/31} +\def\docdate{2001/08/31} +% \end{macrocode} +% +% \AddToCheckSum{45} +% +% \begin{macrocode} +\ProvidesFile{compsci.cfg} +% \end{macrocode} +% +% \begin{macro}{\ALaTeX} +% \begin{macro}{\Frankenstein} +% \begin{macro}{\monster} +% \begin{macro}{\CTAN} +% \begin{macro}{\kpse} +% \begin{macro}{\gemacs} +% \begin{macro}{\auctex} +% \begin{macro}{\nts} +% \begin{macro}{\MakeIndex} +% \begin{macro}{\etex} +% \begin{macro}{\LaTeXiii} +% \begin{macro}{\idvi} +% Various program names. +% \begin{macrocode} +\newprogram\Frankenstein{Frankenstein} +\newlet\monster\Frankenstein +% \end{macrocode} +% \todo{Hmm, \ALaTeX{} kernel uses \cs\DeclareRobustCommand. What does +% \LaTeX{} kernel do?} +% \begin{macrocode} +%\requirecommand\ALaTeX {% +\defcommand\ALaTeX {% + A\LaTeX% +} +\newabbrev\ctan{CTAN} +\newprogram\kpse{kpathsea} +\newprogram\gemacs{\textrm{GNU} Emacs} +\newprogram\auctex{AUC-\TeX} +\newprogram\nts{$\cal NTS$} +\newprogram\MakeIndex{{\normalshape\em Makeindex\/}} +\newprogram\etex{e-\TeX} +\newprogram\LaTeXiii{\LaTeX~3} +\newprogram\idvi{IDVI} +% \end{macrocode} +% \end{macro} +% \end{macro} +% \end{macro} +% \end{macro} +% \end{macro} +% \end{macro} +% \end{macro} +% \end{macro} +% \end{macro} +% \end{macro} +% \end{macro} +% \end{macro} diff --git a/Master/texmf-dist/tex/latex/frankenstein/compsci.stq b/Master/texmf-dist/tex/latex/frankenstein/compsci.stq new file mode 100644 index 00000000000..8bc92c4561d --- /dev/null +++ b/Master/texmf-dist/tex/latex/frankenstein/compsci.stq @@ -0,0 +1,459 @@ +%% +%% This is file `compsci.stq', +%% generated with the docstrip utility. +%% +%% The original source files were: +%% +%% compsci.sty +%% +%% This program is part of the Frankenstein bundle for LaTeX. +%% +%% Copyright (C) 1995-2001 Matthew Swift <swift@alum.mit.edu> +%% +%% This file may have one of TWO names, either +%% compsci.sty or compsci.stq. This +%% LaTeX package will work ONLY if it is called compsci.sty +%% and placed in a proper directory. This file should have been +%% distributed to you with a DIFFERENT file (also) called +%% compsci.sty which functions identically to this one +%% but contains documentation in comments. This file works faster, +%% but the other should be kept because it contains the documentation +%% for this LaTeX package. Files called README and INSTALL should have +%% also been distributed to you with this file; see them for more +%% information. +%% +%% This program is free software; you may redistribute it and/or +%% modify it under the conditions of the LaTeX Project Public +%% License, either version 1.2 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. +%% +%% This program is distributed in the hope that it will be useful, +%% but WITHOUT ANY WARRANTY; without even the implied warranty of +%% MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the +%% LaTeX Project Public License for more details. +%% +%% \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 \~} +\def\fileinfo{macros for writing about macros (Frankenstein's conscience)} +\def\DoXPackageS {} +\def\fileversion{v1.2} +\def\filedate{2001/08/31} +\def\docdate{2001/08/31} +\edef\PPOptArg {% + \filedate\space \fileversion\space \fileinfo +} +\makeatletter% A special comment to help create bst files. Don't change! +\@ifundefined{JusTLoaDInformatioN} {% + }{% ELSE (we know the compsci package is already loaded, too) + \UndefineCS\JusTLoaDInformatioN + \SaveDoXVarS + \eExpand\csname DoXPackageS\endcsname\In {%use \csname in case it's undefined + \usepackage{#1}% + }% + \RestoreDoXVarS + \makeatother + \endinput +}% A special comment to help create bst files. Don't change! +\NeedsTeXFormat{LaTeX2e} +\ProvidesPackage{compsci}[\PPOptArg] +%% +\RequirePackage{abbrevs,alltt,lips,moredefs,relsize,shortvrb,% + slemph,titles,url,verbatim} +\DeclareOption{hyperlatex} {% + \FrankenInfo{compsci}{hyperlatex} + \UndefineCS\code + \UndefineCS\file + \AtEndOfPackage { + \DeleteShortVerb{\|} + \newlet\cs@url\url + \renewcommand*\url [1][] {% + \def\sc@t@a{#1}% + \ifx\sc@t@a\ShortEmpty + \let\sc@t@a\cs@url + \else + \defcommand\sc@t@a [1] {% + #1\footnote{See \texttt{##1}.}% + }% + \fi + \sc@t@a + } + \renewcommand*\email [1][] {% + \def\sc@t@a{#1}% + \ifx\sc@t@a\ShortEmpty + \expandafter\cs@email + \else + #1 \expandafter\cs@email + \fi + } + } +} +\ProcessOptions +%% +%% +\MakeShortVerb{\|} +\newcommand*\code {% + \begingroup + \urlstyle{ttnobreak}% + \Url +} +\newcommand\url@ttnobreakstyle {% + \def\UrlFont {\ttfamily}% + \def\UrlSpecials {\do\ {\ }}% + \def\UrlOrds {\do\*\do\-}% +} +\begingroup + \catcode `|=0 + \catcode `[=1 + \catcode `]=2 + \catcode`\{=12 + \catcode`\}=12 + \catcode`\\=12 + |gdef|@xverbatim#1\end{codeexample}[#1|end[codeexample]] + |gdef|@sxverbatim#1\end{codeexample*}[#1|end[codeexample*]] +|endgroup +\newcommand\codeexample {% + \@beginparpenalty + \predisplaypenalty + \@docverbatim + \MacroFont + \frenchspacing + \@vobeyspaces + \@xverbatim +} +\NewName{codeexample*} {} {% + \@beginparpenalty + \predisplaypenalty + \@docverbatim + \MacroFont + \@sxverbatim +} +\newcommand\@docverbatim {% + \trivlist + \item[]% + \if@minipage\else + \vskip\parskip + \fi + \leftskip\@totalleftmargin + \rightskip\z@ + \parindent\z@ + \parfillskip\@flushglue + \parskip\z@ + \@@par + \@tempswafalse + \def\par {% + \if@tempswa + \hbox{}% + \fi + \@tempswatrue + \@@par + \penalty\interlinepenalty + \check@percent + }% + \obeylines + \let\do\do@noligs + \verbatim@nolig@list + \let\do\@makeother + \dospecials +} +\requirecommand*\MakePercentIgnore{\catcode`\%9\relax} +\requirecommand*\MakePercentComment{\catcode`\%14\relax} +\newenvironment{codeexamplex} {% + \alltt + \def\\{\char`\\}% + \MakePercentIgnore\relax + }{% + \endalltt +} +\newenvironment{typesetexample} {% + \quote + }{% + \endquote +} +\newwrite \verbatim@out +\DefName{end@cs@verbatim@write} {} {% + \immediate\closeout\verbatim@out + \@esphack +} +\defcommand\cs@verbatim@write [1] {% + \@bsphack + \immediate\openout \verbatim@out #1 + \let\do\@makeother\dospecials + \catcode`\^^M\active \catcode`\^^I=12 + \def\verbatim@processline {% + \if@cs@using@doc@ + \immediate\write\verbatim@out{\expandafter\GobbleM\the\verbatim@line}% + \else + \immediate\write\verbatim@out{\the\verbatim@line}% + \fi + }% + \verbatim@start +} +\newboolean{verbtab@ok} +\newboolean{@cs@first@line@} +\ReserveCS\cs@verbatim@input +\@cs@first@line@true +{\catcode`\~=\active \lccode`\~=`\^^M \lccode`\N=`\N + \lowercase{% + \gdef\cs@verbatim@input #1{% + \begingroup + \@verbatim\frenchspacing\@vobeyspaces + \def\verbatim@addtoline##1~{% + \verbatim@line\expandafter{\the\verbatim@line##1}% + }% + \openin\verbatim@in@stream=#1 + \ifeof\verbatim@in@stream + \FrankenError{compsci} + {Can't find file #1!}\@eha + \else + \verbtab@oktrue + \verbatim@line {}% + \def\verbtab@prev@line{PREVINIT~}% + \loop + \read\verbatim@in@stream to \verbtab@line + \ifeof\verbatim@in@stream + \verbtab@okfalse + \else + \if@cs@first@line@ + \@cs@first@line@false + \else + \expandafter\verbatim@addtoline\verbtab@prev@line + \the\verbatim@line + \par + \verbatim@line {}% + \fi + \let\verbtab@prev@line\verbtab@line + \fi + \ifverbtab@ok \repeat + \closein\verbatim@in@stream + \fi + \endtrivlist + \endgroup + \@doendpe + }% \gdef + }% \lowercase +}% catcodes +\newboolean{@cs@using@doc@} +\newenvironment{bothexample} {% + \@ifundefined{ver@doc.sty} {% + \@cs@using@doc@false + }{% ELSE + \@cs@using@doc@true + } + \par + \begingroup + \cs@verbatim@write{\jobname.vrb} + }{% + \end@cs@verbatim@write + \cs@verbatim@input{\jobname.vrb}% + \endgroup + \par\noindent{\sffamily\larger LOOKS LIKE:}% + \par\smallskip + \noindent\fbox{% + \minipage{\textwidth} + \MakePercentComment + \input{\jobname.vrb}% + \endminipage + }% + \par\medskip +} +\newenvironment{splitexample} [1] {% + \cs@verbatim@write{\jobname.vrb} + #1 + \end@cs@verbatim@write + \codeexample + }{% + \endcodeexample + \par\smallskip + \noindent\fbox{% + \minipage{\textwidth} + \input{\jobname.vrb}% + \endminipage + }% + \par\medskip +} +\newcommand\caveat [1] {% + \cs@caveat + #1% + \endgroup + \par +} +\newenvironment{warning} {% + \cs@caveat + }{% + \endgroup + \par +} +\newcommand\cs@caveat {% + \par + \begingroup + \em {\bfseries Warning:}\space +} +\newcommand\todo [1] {% + \cs@todo + #1% + \endgroup + \par +} +\newenvironment{todoenv} {% + \cs@todo + }{% + \endgroup + \par +} +\newcommand\cs@todo {% + \par + \begingroup + \em {\bfseries To do:}\space +} +\NewTextFontCommand \program \TMFontProgram % generic name of computer program +\NewTextFontCommand \bst \ttfamily % name of BibTeX bibliography style +\NewTextFontCommand \class \slshape % name of LaTeX class +\NewTextFontCommand \env \ttfamily % name of environment +\NewTextFontCommand \ext \ttfamily % name of file extension +\NewTextFontCommand \option \ttfamily % name of package or class option +\NewTextFontCommand \package \slshape % name of LaTeX package +\NewTextFontCommand \cat \sffamily % name of a category +\newlet \typeset \fbox % text as it appears when typeset +\newlet \file \path % name of disk file +\newcommand\cs@email {% + \begingroup + \def\UrlLeft{<}% + \def\UrlRight{>}% + \urlstyle{tt}% + \Url +} +\newcommand\cs@email@nobrace {% + \begingroup + \urlstyle{tt}% + \Url +} +\newcommand\email{\cs@email} +\begingroup +\obeyspaces% +\catcode`\^^M\active% +\gdef\meta{\begingroup\let\\\textbackslash\normalfont\obeyspaces\catcode`\^^M\active% +\let^^M\do@space\let \do@space% +\def\-{\egroup\discretionary{-}{}{}\hbox\bgroup\itshape}% +\m@ta}% +\endgroup +\defcommand\m@ta [1] {% + \leavevmode + \hbox\bgroup$\langle$\itshape#1\/$\rangle$\egroup + \endgroup +} +\def\do@space {% + \egroup + \space + \hbox\bgroup\itshape\futurelet\next\sp@ce +} +\def\sp@ce {% + \ifx\next\do@space + \expandafter\sp@@ce + \fi +} +\defcommand\sp@@ce [1] {% + \futurelet\next\sp@ce +} +\defcommand*\marg [1] {% + \penalty 9999% + {\ttfamily\char`\{\meta{#1}\char`\}}% +} +\defcommand*\oarg [1] {% + \penalty 9999% + {\ttfamily[\meta{#1}]}% +} +\NewRobustCommand*\cname [1] {% + \expandafter\code\expandafter{\bslash#1}% +} +\DeclareRobustCommand*\cmd {% + \leavevmode + \@ifnextchar \bgroup + \cs@cmd@grouped + \cs@cmd@ungrouped +} +\newcommand\cs@cmd@grouped [1] {% + \begingroup + \maybe@ic + \code{#1}% + \aftergroup\maybe@ic + \endgroup +} +\newcommand\cs@cmd@ungrouped [1] {% + \begingroup + \maybe@ic + \code{#1}% + \aftergroup\maybe@ic@space + \endgroup +} +\let\cs\cmd +%% +\def\partname {% + Part% +} +\newcommand*\ProcessDTXFile [1] {% + \def\filename {#1}% + \def\JusTLoaDInformatioN {}% + \UndefineCS\initelyHavECitationS + \input{#1}% + \UndefineCS\JusTLoaDInformatioN % not necessary in my usage, but safe +} +\newcommand*\IfCitations [1] {% + \@ifundefined{initelyHavECitationS} {% + }{% ELSE + #1\relax + }% +} +\newcommand*\IfJustLoadInformation [1] {% + \@ifundefined{JusTLoaDInformatioN} {% + }{% ELSE + #1\relax + }% +} +\newcommand*\SaveDoXVarS {% + \SaveCS\fileinfo \SaveCS\fileversion + \SaveCS\filedate \SaveCS\docdate + \SaveCS\DoXPackageS + \def\RestorECitationS {% + \UndefineCS\initelyHavECitationS + }% + \IfCitations {% + \let\RestorECitationS\relax + }% +} +\newcommand*\RestoreDoXVarS {% + \RestoreCS\fileinfo \RestoreCS\fileversion + \RestoreCS\filedate \RestoreCS\docdate + \RestoreCS\DoXPackageS + \RestorECitationS +} +\newcommand*\AddToCheckSum [1] {% + \global\advance\check@sum #1% +} +\NewAbbrevCategory{Program} +\NewUserAbbrevDefiner{\newprogram}{Program} +\def\TMFontProgram {% + \relsize{-1}\ttfamily +} +\providecommand\BibTeX {% + {\rmfamily B\kern-.05em{\scshape i\kern-.025em b}\kern-.08em + T\kern-.1667em\raisebox{-.7ex}{E}\kern-.125emX}% +} +\InputIfFileExists{compsci.cfg}{}{} +\endinput +%% +%% End of file `compsci.stq'. diff --git a/Master/texmf-dist/tex/latex/frankenstein/compsci.sty b/Master/texmf-dist/tex/latex/frankenstein/compsci.sty new file mode 100644 index 00000000000..f01f9523b1f --- /dev/null +++ b/Master/texmf-dist/tex/latex/frankenstein/compsci.sty @@ -0,0 +1,1124 @@ +%^^A* legal notices +% \iffalse +% +% This program is part of the Frankenstein bundle for LaTeX. +% +% Copyright 1995-2001 Matt Swift <swift@alum.mit.edu>. +% +% This file contains both the code and documentation for the +% compsci LaTeX package. It will work ONLY if it is placed in a +% proper directory. Files called README, INSTALL, compsci.tex +% and compsci.ins should have also been distributed to you +% with this file. See them for more information on how to typeset +% the documentation with LaTeX and how to generate a version of this +% file that will work faster than this one. +% +% This program is free software; you may redistribute it and/or +% modify it under the conditions of the LaTeX Project Public +% License, either version 1.2 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. +% +% This program is distributed in the hope that it will be useful, +% but without any warranty; without even the implied warranty of +% merchantability or fitness for a particular purpose. See the +% LaTeX Project Public License for more details. +% +% \fi +% +%^^A* checks +% +%^^A NOTE: The character table, with two %'s, will get written to all files. +%% \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 \~} +% +% \CheckSum{620} +% +% \begin{abstract} +% \package{Compsci} is useful whenever writing about programming, but +% especially when writing about \TeX{} and especially when used as a supplement +% to the \class{ltxdoc} class to document \LaTeX{} macros in a literate +% programming style with \ext{dtx} files. +% \end{abstract} +% \tableofcontents +% +% \part{Discussion} +% +% \section{Textual elements} +% +% \DescribeMacro{\env} +% \cs\env\marg{environment name} typesets the name of a \LaTeX{} environment. +% For example, the \env{enumerate} environment. +% \todo{Add \cs\bib how about?} +% +% \DescribeMacro{\bst} +% \cs\bst\marg{bibstyle name} typesets the name of a \BibTeX{} bibliography +% style. For example, the \bst{achicago} bibstyle. +% +% \DescribeMacro{\package} +% \cs\package\marg{package name} typesets the name of a \LaTeX{} package. +% For example, the \package{compsci} package. +% +% \DescribeMacro{\class} +% \cs\class\marg{class name} typesets the name of a \LaTeX{} class. For +% example, the \class{letter} class. +% +% \DescribeMacro{\file} +% \cs\file\marg{file name} typesets the name of a disk file. +% For example, the file \file{Makefile.in}. +% \todo{Should I use url.sty's \cs\path command for this?} +% +% \DescribeMacro{\ext} +% \cs\ext\marg{extension} typesets the name of a disk file extension. For +% example, the extension \ext{dvi}. The argument should not include the dot +% that separates the root name from the extension. The dot can be inserted +% by the macro if you want it. +% +% \DescribeMacro{\caveat} +% \DescribeEnv{warning} +% \cs\caveat\marg{warning text} typesets warning paragraphs. +% You can also enclose the \meta{warning text} in a \env{warning} +% environment. Using the \env{warning} environment is necessary if the +% \meta{warning text} is to include \code{|...|}s, a \env{codeexample} +% environment or other ``verbatim'' constructs. +% +% \caveat{This is an example \cs\caveat or \env{warning} environment.} +% +% \DescribeMacro\todo +% \DescribeEnv{todoenv} +% The \cs\todo\marg{text} command and the \env{todoenv} environment are +% analogous to \cs\caveat and \env{warning}, but they typeset paragraphs of a +% task ``to do''. +% +% \todo{This is an example \cs\todo or \env{todoenv} environment.} +% +% \DescribeMacro{\code} +% \DescribeMacro{\code*} +% \DeleteShortVerb{\|} +% \DescribeMacro{|...|} +% \cs\code\marg{verbatim text} and \code{|}\meta{verbatim text}\code{|} +% typeset short pieces of code verbatim. For example, +% \code+|{{+\code{@#%$^\|} looks like ^^A $}} for emacs +%^^A Dang tricky to give a tricky example! +% \begingroup +% \def~{\char`\\}% +% \makeatother +% \catcode`\[=1\catcode`\]=2\catcode`\{=12\relax +% \catcode`\#=12 +% \catcode`\+=14 + +% \catcode`\$=12 + +% \catcode`\^=12 + +% \catcode`\%=12 \fbox[\ttfamily {{@#%$^~]\endgroup. ^^A for emacs $ +% +% Instead of matching curly braces, any two identical characters, even a +% space, may be used to contain the \meta{verbatim} after the \cs\code +% command. +% +% \todo{Implement \cname{code*}. Like \cname{verb*}, \cname{code*} marks +% spaces explicitly. This is not an example todo, this is a real one for the +% \package{compsci} package!} +% \MakeShortVerb{\|} +% +% \DescribeMacro{\typeset} +% \cs\typeset\marg{text} typesets \meta{text} in a normal way, but indicates +% by boxing that the contents are an example of how some piece of code +% actually appears. For example, \code{this} looks like \typeset{this} when +% typeset. +% +% \DescribeEnv{typesetexample} +% These example environments may be used to present a piece of source code +% and what it looks like when typeset. The \env{typesetexample} environment +% typesets its contents like \cs\typeset except they are set off in their own +% indented block element instead of being boxed. +% +% \begin{typesetexample} +% This is an example of the \env{typesetexample} environment. +% \end{typesetexample} +% +% \DescribeEnv{codeexample} +% \DescribeEnv{codeexample*} +% \DescribeEnv{codeexamplex} +% \DescribeEnv{codeexamplex*} +% The \env{codeexample} and +% \env{codeexample*} environments are similar analogs of \cs\code and +% \cname{code*}. The \env{codeexamplex} environment is like the +% \env{codeexample} environment except that |\|, |{|, |}| have their usual +% meanings. Inside the argument, \cs\\ produces a typeset backslash. +% \begin{codeexample} +% This is a \env{codeexample} environment: \(\int e^x\,dx\) {}{{{!#@$%^&\ +% There is a percent sign in the source after the $. +% \end{codeexample} +% +% \begin{codeexample*} +% This is a \env{codexample*} environment: \(\int e^x\,dx\) {}{{{!#@$%^&\ +% Someday I would like to get rid of the leading spaces in a line. +% \end{codeexample*} +% +% \begin{codeexamplex} +% This is a \env{codeexamplex} environment: \(\int e^x\,dx\) {}{{{}}}!#@$%^&\\ +% The earlier examples had three unmatched open-braces which had to be +% closed in this environment. Also the backslash had to be doubled. +% Percent signs get ignored---a BUG. +% \end{codeexamplex} +% +% \begin{warning} +% The \env{codeexamplex} environment ideally should ignore \code{%}s in the +% first column and print all others. The best I can do for the moment is +% to ignore \emph{all} \code{%}s. +% \end{warning} +% +% \DescribeEnv{bothexample} +% \DescribeEnv{bothexample*} +% The \env{bothexample} and \env{bothexample*} environments typeset their +% contents two times, side by side. The left side is set like either a +% \env{codeexample} or \env{codeexample*} environment, and the right side is +% set like a \env{typesetexample} environment. +% +% I find setting a line width of 65 characters in your editor helps keep +% this kind of example from bleeding to the right. +% +% \begin{bothexample} +% This is one part of a \env{bothexample} environment: +% \(\int e^x\,dx\) \fbox{jub-jub} \par +% The contents must not contain any \LaTeX{} errors. +% +% There is an annoying \% plus three explicit spaces at the beginning of +% the first part. They are a bug! Also notice also the missing percent +% sign after the backslash after ``annoying''---another bug that affects +% the verbatim part only. +% \end{bothexample} +% +% \DescribeEnv{splitexample} +% \DescribeEnv{splitexample*} +% The \env{splitexample} environment takes an argument which is used on the +% right side (the typeset side) of an element that looks like +% \env{bothexample}. The contents of the environment are set on the left +% side. This is a way to cheat, making the right side something other than +% the strict tyepsetting of what's on the left. +% +% \begin{warning} +% The \env{splitexample} and \env{bothexample} environments \emph{execute} +% example code. The example code is executed in a group, but be careful +% with global assignments, and with assignments that might screw up the +% example environment itself before the group ends. Notice that +% \cs\setcounter is global. +% \end{warning} +% +% The \env{bothexample} and \env{splitexample} environments use an auxiliary +% file with extension \ext{vrb}, but a second pass with \LaTeX{} is not +% necessary. +% +% \todo {Implement \env{splitexample} and \env{splitexample*}.} +% +% \todo {Get the \env{bothexample} sub-environments side by side! Right now +% they are sequential. I recommend keeping line length inside this +% environment less than 40, however, in case the side-by-side presentation is +% ever possible. I have not followed this advice myself.} +% +% \todo {Implement \env{codeexamplex*}.} +% +% \caveat{The \env{bothexample} environment is working nicely now, but I have +% not even touched the other complicated verbatim-like environments, so they +% might be broken.} +% +% \DescribeMacro{\url} +% \DescribeMacro{\email} +% \DescribeMacro{\path} +% \DescribeMacro{\file} +% The \package{compsci} package uses the \package{url} package by Donald +% Arseneau to handle the typesetting of URLs, email addresses, and filesystem +% paths. See that package for details of how line breaks are handled within +% these elements. +% +% \DescribeMacro{\option} +% \cs\option\marg{option name} typesets the name of a package or class +% option. For example, the \option{landscape} option. +% +% \DescribeMacro{\program} +% \cs\program\marg{program name} typesets the name of a computer program. +% For example the \program{xdvi} program. See also \cs\newprogram below. +% +% \DescribeMacro{\lips} +% The \package{compsci} package uses the \package{lips} package, so you can +% use the \cs\lips command for text ellipses. My love is like a red red rose +% \lips. +% +% \DescribeMacro{\book} +% The \package{compsci} package uses the \package{titles} package, so several +% commands like \cs\book are available. +% +% \section{Referring to commands} +% +% \DeleteShortVerb{\|} +% \DescribeMacro{\cs} +% \DescribeMacro{\cmd} +% \cs\cs\marg{command sequence} typesets a command sequence, such as the one +% that starts this sentence. \cs\cmd does the same thing. For example, +% \code{\cs\foo} looks like \typeset{\cs\foo}. When writing, e.g., +% \code{\cs\foo} the following spacing is automatically handled. The result +% doesn't look different from using the \code{|...|} or \cs\code syntax, but +% the markup allows the parsing of the macro name itself for some future +% purpose such as indexing. +% +% \MakeShortVerb{\|} +% +% \begin{warning} +% You cannot say \code{\cs\foo@bar} when |@| is not a letter (category code +% 11), you must say \code{\cs{\foo@bar}} or \code{\cname{foo@bar}} instead. +% +% Nor can you say \code{\cs\par}. It trips on \cname{text@command}. +% +% Nor can you say \code{\cs\iffoo}. Use \code{\cname{iffoo}} instead. +% \end{warning} +% +% \DescribeMacro{\cname} +% \cs\cname\marg{command name} is like \cs\cs but its argument is evaluated +% and prefixed with a backslash character. For example, writing +% |\cname{@tfor}| gives you \typeset{\cname{@tfor}}. +% +% \DescribeMacro{\marg} +% \DescribeMacro{\oarg} +% \cs\marg\marg{mandatory argument} typesets a mandatory argument, and +% \cs\oarg\marg{optional argument} typesets an optional argument. For +% example, These macros are defined with \cs\meta, so you can use |\\| for a +% typeset backslash. +% \begin{bothexample} +% \cs\GobbleMOM\marg{first arg}\oarg{optional second arg}\marg{third arg} +% \end{bothexample} +% +% \DescribeMacro{\meta} +% \cs\meta\marg{text} refers to a syntactic placeholder. You would use this +% for example to talk about one of the arguments of a command you've +% introduced, like \meta{text} above, which can contain normal text but is +% broken across lines only at spaces. Within the argument |\\| is a typeset +% backslash. +% +% \section{Miscellaneous} +% +% \DescribeMacro{\newprogram} +% The \package{compsci} package uses the \package{abbrevs} package to define +% the |Program| category of abbreviation. Use +% \cs\newprogram\marg{\\csname}\marg{initial expansion}\oarg{subsequent +% expansion} to define a new abbreviation \marg{\\csname} for a program. +% +% \DescribeMacro{\ProcessDTXFile} +% \cs\ProcessDTXFile can be used by a documentation driver file of the kind +% you might be inclined to make using the \package{doc} package. Its purpose +% is to be able to load a package up to a certain point so that just +% descriptive information can be read without reading in the whole file. +% \cs\ProcessDTXFile\marg{filename} defines the variable +% \cs\JusTLoaDInformatioN and inputs the file \meta{filename}. To be useful, +% the file must have a statement that branches on whether +% \cs\JusTLoaDInformatioN is defined. For an example of its use, see the +% present package. +% +% \DescribeMacro{\MaybeBibliography} +% +% Sorry, you will need to look at the source below. +% +% \DescribeMacro{\AddToCheckSum} +% \cs\AddToCheckSum\marg{number} simply adds \meta{number} globally to the +% checksum counter implemented in the \package{doc} package. This macro +% finds applications when the sources of a package are spread over one or +% more files such as configuration files or files concatenated by a +% \program{Make} process. For an example of its use, see the present package. +% +% \DescribeMacro{\BibTeX} +% The \BibTeX{} logo is provided if it isn't already defined. +% +% \StopEventually{} +% +% \part{Implementation} +% +% \section{Version control} +% +% \begin{macro}{\fileinfo} +% \begin{macro}{\DoXUsepackagE} +% \begin{macro}{\HaveECitationS} +% \begin{macro}{\fileversion} +% \begin{macro}{\filedate} +% \begin{macro}{\docdate} +% \begin{macro}{\PPOptArg} +% These definitions must be the first ones in the file. +% \begin{macrocode} +\def\fileinfo{macros for writing about macros (Frankenstein's conscience)} +\def\DoXPackageS {} +\def\fileversion{v1.2} +\def\filedate{2001/08/31} +\def\docdate{2001/08/31} +\edef\PPOptArg {% + \filedate\space \fileversion\space \fileinfo +} +% \end{macrocode} +% \end{macro} +% \end{macro} +% \end{macro} +% \end{macro} +% \end{macro} +% \end{macro} +% \end{macro} +% +% If we're loading this file from a \cs\ProcessDTXFile command (see the +% \package{compsci} package), then \cs\JusTLoaDInformatioN will be defined; +% othewise we assume it is not (that's why the FunkY NamE). +% +% If we're loading from \cs\ProcessDTXFile, we want to load the packages listed +% in \cs\DoXPackageS (needed to typeset the documentation for this file) and +% then bail out. Otherwise, we're using this file in a normal way as a +% package, so do nothing. \cs\DoXPackageS, if there are any, are declared in +% the \ext{dtx} file, and, if you're reading the typeset documentation of this +% package, would appear just above. (It's OK to call \cs\usepackage with an +% empty argument or \cs\relax, by the way.) +% \begin{macrocode} +\makeatletter% A special comment to help create bst files. Don't change! +\@ifundefined{JusTLoaDInformatioN} {% + }{% ELSE (we know the compsci package is already loaded, too) + \UndefineCS\JusTLoaDInformatioN + \SaveDoXVarS + \eExpand\csname DoXPackageS\endcsname\In {%use \csname in case it's undefined + \usepackage{#1}% + }% + \RestoreDoXVarS + \makeatother + \endinput +}% A special comment to help create bst files. Don't change! +% \end{macrocode} +% +% Now we check for \LaTeX2e and declare the LaTeX package. +% \begin{macrocode} +\NeedsTeXFormat{LaTeX2e} +\ProvidesPackage{compsci}[\PPOptArg] +% \end{macrocode}^^A special comment to help create bst files. Don't change! +% +% ^^A NOTE: We have to compensate for the above backslashes, which are not +% ^^A actually in the .dtx file the author works on, by adding to the +% ^^A CheckSum. +%% +% \AddToCheckSum{17}^^A `dtx-update-checksum' automatically handles this. +% \AddToCheckSum{7}^^A The half a macrocode env. at the top is missed, however... +% \AddToCheckSum{10}^^A ... and so are the 5 \defs from the .dtx file +% ^^A that precede it. +% \IfCitations {% +% \AddToCheckSum{2}^^A When \initelyHavECitationS is defined in +% } ^^A the .dtx file, we need 2 more in the CheckSum. +% +% +% \section{Requirements and context} +% +% ^^A FIX do check and set boolean for being inside \Doc thing etc. have to +% ^^A branch on all verbatim-like stuff. +% \begin{macrocode} +\RequirePackage{abbrevs,alltt,lips,moredefs,relsize,shortvrb,% + slemph,titles,url,verbatim} +% \end{macrocode} +% +% \section{Hyperlatex option} +% Handle \option{hyperlatex} option here. \todo{Should this inherit globally?} +% Long URLs are so common and screw up LaTeX in the middle of a paragraph that +% a good scheme seems to be to relegate them to footnotes. Make option/switch +% for footnotes and inline. +% +% Actually, when it's a footnote, there's almost never going to be a linebreak, +% unless the url is longer than the textwidth of the footnote...so |\textt{}| +% is probably going to be fine. +% +% Could also use \code{\marginpar{\smaller\url{#1}}}---definitely would have to +% use \cs\url not \cs\textt there. +% +% We undefine \cs\code and \cs\file immediately because we want +% \package{compsci}'s versions not \package{hyperlatex}'s. +% \begin{macrocode} +\DeclareOption{hyperlatex} {% + \FrankenInfo{compsci}{hyperlatex} + \UndefineCS\code + \UndefineCS\file + \AtEndOfPackage { +% \UndefineCS\code hunh????? + \DeleteShortVerb{\|} + \newlet\cs@url\url + \renewcommand*\url [1][] {% + \def\sc@t@a{#1}% + \ifx\sc@t@a\ShortEmpty + \let\sc@t@a\cs@url + \else + \defcommand\sc@t@a [1] {% + #1\footnote{See \texttt{##1}.}% + }% + \fi + \sc@t@a + } + \renewcommand*\email [1][] {% + \def\sc@t@a{#1}% + \ifx\sc@t@a\ShortEmpty + \expandafter\cs@email + \else + #1 \expandafter\cs@email + \fi + } + } +} +\ProcessOptions +% \end{macrocode} +% \todo{Alternative ways to handle things} +% \begin{macrocode} +%% +% \def\sc@t@a {% +% #1% +% \begingroup +% \def\UrlLeft {( see}% +% \def\UrlRight {)}% +% \Url +% }% +%% +% \def\sc@t@a {% +% #1% +% \begingroup +% \def\UrlLeft{\footnote\bgroup}% +% \def\UrlRight {.\egroup}% +% See \Url +% }% +% \end{macrocode} +% +% \section{Textual elements} +% +% \DeleteShortVerb{\|} +% \begin{macro}{\code} +% \begin{macro}{|...|} +% \begin{macro}{\url@ttnobreakstyle} +% We use the \package{url} package to implement \cs\code and the +% \package{shortvrb} package to implement \code{|...|}. There are no +% linebreaks in either. See the respective packages for considerations of +% robustness. +% +% \todo {summarize robustness considerations here.} +% \begin{macrocode} +\MakeShortVerb{\|} +\newcommand*\code {% + \begingroup + \urlstyle{ttnobreak}% + \Url +} +\newcommand\url@ttnobreakstyle {% + \def\UrlFont {\ttfamily}% + \def\UrlSpecials {\do\ {\ }}% + \def\UrlOrds {\do\*\do\-}% +} +% \end{macrocode} +% \end{macro} +% \end{macro} +% \end{macro} +% \MakeShortVerb{\|} +% +% \begin{environment}{codeexample} +% \begin{environment}{codeexample*} +% What I'm doing here is defining \env{codeexample} and \env{codeexample*} to +% be just like the \package{doc} package's \env{verbatim} and +% \env{verbatim*}. That is, they ignore |%| +% characters at the beginning of lines. +% \begin{macrocode} +\begingroup + \catcode `|=0 + \catcode `[=1 + \catcode `]=2 + \catcode`\{=12 + \catcode`\}=12 + \catcode`\\=12 + |gdef|@xverbatim#1\end{codeexample}[#1|end[codeexample]] + |gdef|@sxverbatim#1\end{codeexample*}[#1|end[codeexample*]] +|endgroup +\newcommand\codeexample {% + \@beginparpenalty + \predisplaypenalty + \@docverbatim + \MacroFont + \frenchspacing + \@vobeyspaces + \@xverbatim +} +\NewName{codeexample*} {} {% + \@beginparpenalty + \predisplaypenalty + \@docverbatim + \MacroFont + \@sxverbatim +} +\newcommand\@docverbatim {% + \trivlist + \item[]% + \if@minipage\else + \vskip\parskip + \fi + \leftskip\@totalleftmargin + \rightskip\z@ + \parindent\z@ + \parfillskip\@flushglue + \parskip\z@ + \@@par + \@tempswafalse + \def\par {% + \if@tempswa + \hbox{}% + \fi + \@tempswatrue + \@@par + \penalty\interlinepenalty + \check@percent + }% + \obeylines + \let\do\do@noligs + \verbatim@nolig@list + \let\do\@makeother + \dospecials +} +% \end{macrocode} +% \end{environment} +% \end{environment} +% +% \begin{macro}{\MakePercentIgnore} +% \begin{macro}{\MakePercentComment} +% These are defined in the \package{doc} package, which may be loaded. +% \begin{macrocode} +\requirecommand*\MakePercentIgnore{\catcode`\%9\relax} +\requirecommand*\MakePercentComment{\catcode`\%14\relax} +% \end{macrocode} +% \end{macro} +% \end{macro} +% +% \begin{environment}{codeexamplex} +% The \env{codeexamplex} environment ideally should ignore |%|s in the +% first column and print all others. The best I can do for the moment is to +% ignore |%|s. \todo{use verbatim-write trick} +% \begin{macrocode} +\newenvironment{codeexamplex} {% + \alltt + \def\\{\char`\\}% + \MakePercentIgnore\relax + }{% + \endalltt +} +% \end{macrocode} +% \end{environment} +% +% \begin{environment}{typesetexample} +% The \env{typesetexample} environment is simple, it's just the \env{quote} environment. +% \begin{macrocode} +\newenvironment{typesetexample} {% + \quote + }{% + \endquote +} +% \end{macrocode} +% \end{environment} +% +% To implement the \env{bothexample} environments we write out the contents +% of the environment and read them in twice, typesetting them differently +% each time. The \env{verbatimwrite} environment comes from the +% \package{moreverb} package. Reading the text twice seems unavoidable +% because we want to read them with different catcodes each time. +% +% \todo {Figure whether the tab stuff here is going is a help or a +% hindrance.} +% +% \begin{macro}{\verbatim@out} +% \begin{macro}{\end@cs@verbatim@write} +% \begin{macro}{\cs@verbatim@write} +% \begin{macro}{\verbtab@oktrue} +% \begin{macro}{\verbtab@okfalse} +% \begin{macro}{\ifverbtab@ok} +% \begin{macro}{\if@cs@first@line@} +% \begin{macro}{\@cs@first@line@true} +% \begin{macro}{\@cs@first@line@false} +% \begin{macro}{\cs@verbatim@input} +% \begin{macrocode} +\newwrite \verbatim@out +\DefName{end@cs@verbatim@write} {} {% + \immediate\closeout\verbatim@out + \@esphack +} +\defcommand\cs@verbatim@write [1] {% + \@bsphack + \immediate\openout \verbatim@out #1 + \let\do\@makeother\dospecials + \catcode`\^^M\active \catcode`\^^I=12 + \def\verbatim@processline {% + \if@cs@using@doc@ + \immediate\write\verbatim@out{\expandafter\GobbleM\the\verbatim@line}% + \else + \immediate\write\verbatim@out{\the\verbatim@line}% + \fi + }% + \verbatim@start +} +\newboolean{verbtab@ok} +\newboolean{@cs@first@line@} +\ReserveCS\cs@verbatim@input +\@cs@first@line@true +{\catcode`\~=\active \lccode`\~=`\^^M \lccode`\N=`\N + \lowercase{% + \gdef\cs@verbatim@input #1{% + \begingroup + \@verbatim\frenchspacing\@vobeyspaces + \def\verbatim@addtoline##1~{% + \verbatim@line\expandafter{\the\verbatim@line##1}% + }% + \openin\verbatim@in@stream=#1 + \ifeof\verbatim@in@stream + \FrankenError{compsci} + {Can't find file #1!}\@eha + \else + \verbtab@oktrue + \verbatim@line {}% + \def\verbtab@prev@line{PREVINIT~}% + \loop + \read\verbatim@in@stream to \verbtab@line + \ifeof\verbatim@in@stream + \verbtab@okfalse + \else +% \DTypeout{My line is: [\meaning\verbtab@line]}% + \if@cs@first@line@ +% \DTypeout{I'm avoiding printing: [\meaning\verbtab@prev@line]}% + \@cs@first@line@false + \else +% \DTypeout{I'll print: [\meaning\verbtab@prev@line]}% + \expandafter\verbatim@addtoline\verbtab@prev@line + \the\verbatim@line + \par + \verbatim@line {}% + \fi + \let\verbtab@prev@line\verbtab@line + \fi + \ifverbtab@ok \repeat + \closein\verbatim@in@stream + \fi + \endtrivlist + \endgroup + \@doendpe + }% \gdef + }% \lowercase +}% catcodes +% \end{macrocode} +% \end{macro} +% \end{macro} +% \end{macro} +% \end{macro} +% \end{macro} +% \end{macro} +% \end{macro} +% \end{macro} +% \end{macro} +% \end{macro} +% +% \begin{environment}{bothexample} +% \begin{environment}{bothexample*} +% The first \cs\begingroup\lips{}\cs\endgroup I think is necessary to contain +% the verbatim activity. The second is necessary so that activity in the +% example environment does not effect anything outside it. Of course global +% activity will, so be careful! The \cs\minipage effects the second +% group. [Hmm, I don't see a ``second'' group\lips.] +% \begin{macrocode} +\newboolean{@cs@using@doc@} +\newenvironment{bothexample} {% + \@ifundefined{ver@doc.sty} {% + \@cs@using@doc@false + }{% ELSE + \@cs@using@doc@true + } + \par + \begingroup + \cs@verbatim@write{\jobname.vrb} + }{% + \end@cs@verbatim@write + \cs@verbatim@input{\jobname.vrb}% + \endgroup + \par\noindent{\sffamily\larger LOOKS LIKE:}% + \par\smallskip + \noindent\fbox{% + \minipage{\textwidth} + \MakePercentComment + \input{\jobname.vrb}% + \endminipage + }% + \par\medskip +} +% \end{macrocode} +% \end{environment} +% \end{environment} +% +% \begin{environment}{splitexample} +% \begin{environment}{splitexample*} +% We can't use |#1| in the end-environment part, so we write it out. Again +% we have the problem of |%|s. +% \caveat{This is broken!} ^^A FIX +% ^^A FIX: keep this in step with developments in the presentation of the +% ^^A botheexample stuff. +% \begin{macrocode} +% \newenvironment{gogog}[1] +% {\verbatimwrite{\jobname.vrb}#1} +% {\endverbatimwrite} +\newenvironment{splitexample} [1] {% + \cs@verbatim@write{\jobname.vrb} + #1 + \end@cs@verbatim@write + \codeexample + }{% + \endcodeexample + \par\smallskip + \noindent\fbox{% + \minipage{\textwidth} + \input{\jobname.vrb}% + \endminipage + }% + \par\medskip +} +% \end{macrocode} +% \end{environment} +% \end{environment} +% +% \begin{macro}{\caveat} +% \begin{environment}{warning} +% \begin{macro}{\cs@caveat} +% \begin{macro}{\todo} +% \begin{environment}{todoenv} +% \begin{macro}{\cs@todo} +% \mbox{} +% \begin{macrocode} +\newcommand\caveat [1] {% + \cs@caveat + #1% + \endgroup + \par +} +\newenvironment{warning} {% + \cs@caveat + }{% + \endgroup + \par +} +\newcommand\cs@caveat {% + \par + \begingroup + \em {\bfseries Warning:}\space +} +\newcommand\todo [1] {% + \cs@todo + #1% + \endgroup + \par +} +\newenvironment{todoenv} {% + \cs@todo + }{% + \endgroup + \par +} +\newcommand\cs@todo {% + \par + \begingroup + \em {\bfseries To do:}\space +} +% \end{macrocode} +% \end{macro} +% \end{environment} +% \end{macro} +% \end{macro} +% \end{environment} +% \end{macro} +% +% \begin{macro}{\program} +% \begin{macro}{\bst} +% \begin{macro}{\class} +% \begin{macro}{\env} +% \begin{macro}{\ext} +% \begin{macro}{\file} +% \begin{macro}{\option} +% \begin{macro}{\package} +% \begin{macro}{\cat} +% \begin{macro}{\typeset} +% Abstract markup of terms and objects. +% \begin{macrocode} +\NewTextFontCommand \program \TMFontProgram % generic name of computer program +\NewTextFontCommand \bst \ttfamily % name of BibTeX bibliography style +\NewTextFontCommand \class \slshape % name of LaTeX class +\NewTextFontCommand \env \ttfamily % name of environment +\NewTextFontCommand \ext \ttfamily % name of file extension +\NewTextFontCommand \option \ttfamily % name of package or class option +\NewTextFontCommand \package \slshape % name of LaTeX package +\NewTextFontCommand \cat \sffamily % name of a category +\newlet \typeset \fbox % text as it appears when typeset +\newlet \file \path % name of disk file +% \end{macrocode} +% \end{macro} +% \end{macro} +% \end{macro} +% \end{macro} +% \end{macro} +% \end{macro} +% \end{macro} +% \end{macro} +% \end{macro} +% \end{macro} +% +% \begin{macro}{\email} +% \begin{macro}{\cs@email@nobrace} +% \begin{macro}{\cs@email} +% The \option{hyperlatex} option will change \cs\email at the end of this +% package. +% \begin{macrocode} +\newcommand\cs@email {% + \begingroup + \def\UrlLeft{<}% + \def\UrlRight{>}% + \urlstyle{tt}% + \Url +} +\newcommand\cs@email@nobrace {% + \begingroup +% \def\UrlLeft{<}% +% \def\UrlRight{>}% + \urlstyle{tt}% + \Url +} +\newcommand\email{\cs@email} +% \end{macrocode} +% \end{macro} +% \end{macro} +% \end{macro} +% +% +% \section{Referring to commands} +% +% \begin{macro}{\meta} +% \begin{macro}{\m@ta} +% \begin{macro}{\do@space} +% \begin{macro}{\sp@ce} +% \begin{macro}{\sp@@ce} +% Here I redefine \cs\meta to include a \cs\normalfont right at the beginning +% inside a group, since the command was working strangely when \cs\ttfamily +% was in effect. Also, I redefine |\\| to be a typeset backslash. +% \begin{macrocode} +\begingroup +\obeyspaces% +\catcode`\^^M\active% +\gdef\meta{\begingroup\let\\\textbackslash\normalfont\obeyspaces\catcode`\^^M\active% +\let^^M\do@space\let \do@space% +\def\-{\egroup\discretionary{-}{}{}\hbox\bgroup\itshape}% +\m@ta}% +\endgroup +% \end{macrocode} +% These are simply from the \package{doc} package. +% \begin{macrocode} +\defcommand\m@ta [1] {% + \leavevmode + \hbox\bgroup$\langle$\itshape#1\/$\rangle$\egroup + \endgroup +} +\def\do@space {% + \egroup + \space + \hbox\bgroup\itshape\futurelet\next\sp@ce +} +\def\sp@ce {% + \ifx\next\do@space + \expandafter\sp@@ce + \fi +} +\defcommand\sp@@ce [1] {% + \futurelet\next\sp@ce +} +% \end{macrocode} +% \end{macro} +% \end{macro} +% \end{macro} +% \end{macro} +% \end{macro} +% +% \begin{macro}{\marg} +% \begin{macro}{\oarg} +% These use \cs\meta and are therefore slightly different than their +% counterparts in \class{ltxdoc}. A tiny bit of breakability is added at the +% beginning. +% \begin{macrocode} +\defcommand*\marg [1] {% + \penalty 9999% + {\ttfamily\char`\{\meta{#1}\char`\}}% +} +\defcommand*\oarg [1] {% + \penalty 9999% + {\ttfamily[\meta{#1}]}% +} +% \end{macrocode} +% \end{macro} +% \end{macro} +% +% \begin{macro}{\cname} +% \begin{macro}{\cmd} +% \begin{macro}{\cs} +% For referring to a \LaTeX{} macro. The code is a mix from the +% \class{ltxdoc} class and the \package{abbrevs} package. There is no need +% to check for \cs\nocorr commands inside the argument so we skip +% \cs{\text@command}. We might conceivably be in a typewriter slanted, so we +% do check for italic corrections. We don't handle the case of calling this +% in math mode (see the definition of \cs\DeclareTextFontCommand in the +% kernel). +% +% We handle the cases of |\cmd{\foo}| and \cmd\foo differently. The latter +% needs logic to determine the following space, whereas the former does not. +% They both need italic corrections. +% \begin{macrocode} +\NewRobustCommand*\cname [1] {% + \expandafter\code\expandafter{\bslash#1}% +} +\DeclareRobustCommand*\cmd {% + \leavevmode + \@ifnextchar \bgroup + \cs@cmd@grouped + \cs@cmd@ungrouped +} +\newcommand\cs@cmd@grouped [1] {% + \begingroup + \maybe@ic + \code{#1}% + \aftergroup\maybe@ic + \endgroup +} +\newcommand\cs@cmd@ungrouped [1] {% + \begingroup + \maybe@ic + \code{#1}% + \aftergroup\maybe@ic@space + \endgroup +} +\let\cs\cmd +% \end{macrocode} +% \end{macro} +% \end{macro} +% \end{macro} +% +% \section{Miscellaneous} +% +% \begin{macro}{\partname} +% \begin{macro}{\ProcessDTXFile} +% \begin{macro}{\IfJustLoadInformation} +% \begin{macro}{\JusTLoaDInformatioN} +% \begin{macro}{\IfCitations} +% \begin{macro}{\initelyHavECitationS} +% \begin{macro}{\SaveDoXVarS} +% \begin{macro}{\RestoreDoXVarS} +% \begin{macro}{\RestorECitationS} +% \begin{macro}{\AddToCheckSum} +% See the version control section above and all throughout the \Frankenstein +% bundle for examples of when you might want to use these commands. +%% +% ^^A FIX Add ltxdoc check for addtochecksum? +% \begin{macrocode} +\def\partname {% + Part% +} +% \end{macrocode} +% We make sure it's OK to use \cs\def\DoXPackageS multiple times. You might +% need to call packages with options. +% \begin{macrocode} +\newcommand*\ProcessDTXFile [1] {% + \def\filename {#1}% + \def\JusTLoaDInformatioN {}% + \UndefineCS\initelyHavECitationS + \input{#1}% + \UndefineCS\JusTLoaDInformatioN % not necessary in my usage, but safe +} +\newcommand*\IfCitations [1] {% + \@ifundefined{initelyHavECitationS} {% + }{% ELSE + #1\relax + }% +} +\newcommand*\IfJustLoadInformation [1] {% + \@ifundefined{JusTLoaDInformatioN} {% + }{% ELSE + #1\relax + }% +} +\newcommand*\SaveDoXVarS {% + \SaveCS\fileinfo \SaveCS\fileversion + \SaveCS\filedate \SaveCS\docdate + \SaveCS\DoXPackageS + \def\RestorECitationS {% + \UndefineCS\initelyHavECitationS + }% + \IfCitations {% + \let\RestorECitationS\relax + }% +} +\newcommand*\RestoreDoXVarS {% + \RestoreCS\fileinfo \RestoreCS\fileversion + \RestoreCS\filedate \RestoreCS\docdate + \RestoreCS\DoXPackageS + \RestorECitationS +} +\newcommand*\AddToCheckSum [1] {% + \global\advance\check@sum #1% +} +% \end{macrocode} +% \end{macro} +% \end{macro} +% \end{macro} +% \end{macro} +% \end{macro} +% \end{macro} +% \end{macro} +% \end{macro} +% \end{macro} +% \end{macro} +% +% \begin{macro}{\newprogram} +% \begin{macro}{\TMFontProgram} +% \begin{macro}{\TMHookProgram} +% \begin{macro}{\TMResetProgram} +% Provide for program abbreviations. +% \begin{macrocode} +\NewAbbrevCategory{Program} +\NewUserAbbrevDefiner{\newprogram}{Program} +\def\TMFontProgram {% + \relsize{-1}\ttfamily +} +% \end{macrocode} +% \end{macro} +% \end{macro} +% \end{macro} +% \end{macro} +% +% \begin{macro}{\BibTeX} +% The \BibTeX{} logo. +% \begin{macrocode} +\providecommand\BibTeX {% + {\rmfamily B\kern-.05em{\scshape i\kern-.025em b}\kern-.08em + T\kern-.1667em\raisebox{-.7ex}{E}\kern-.125emX}% +} +% \end{macrocode} +% \end{macro} +% +% \part{Configuration} +% +% Other things are deferred to a configuration file. +% \begin{macrocode} +\InputIfFileExists{compsci.cfg}{}{} +% \end{macrocode} +% +% The contents of the distributed configuration file are below. +% +% \InputIfFileExists{compsci.cfg}{}{} +% +% \Finale diff --git a/Master/texmf-dist/tex/latex/frankenstein/dialogue.stq b/Master/texmf-dist/tex/latex/frankenstein/dialogue.stq new file mode 100644 index 00000000000..898486702a3 --- /dev/null +++ b/Master/texmf-dist/tex/latex/frankenstein/dialogue.stq @@ -0,0 +1,109 @@ +%% +%% This is file `dialogue.stq', +%% generated with the docstrip utility. +%% +%% The original source files were: +%% +%% dialogue.sty +%% +%% This program is part of the Frankenstein bundle for LaTeX. +%% +%% Copyright (C) 1995-2001 Matthew Swift <swift@alum.mit.edu> +%% +%% This file may have one of TWO names, either +%% dialogue.sty or dialogue.stq. This +%% LaTeX package will work ONLY if it is called dialogue.sty +%% and placed in a proper directory. This file should have been +%% distributed to you with a DIFFERENT file (also) called +%% dialogue.sty which functions identically to this one +%% but contains documentation in comments. This file works faster, +%% but the other should be kept because it contains the documentation +%% for this LaTeX package. Files called README and INSTALL should have +%% also been distributed to you with this file; see them for more +%% information. +%% +%% This program is free software; you may redistribute it and/or +%% modify it under the conditions of the LaTeX Project Public +%% License, either version 1.2 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. +%% +%% This program is distributed in the hope that it will be useful, +%% but WITHOUT ANY WARRANTY; without even the implied warranty of +%% MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the +%% LaTeX Project Public License for more details. +%% +%% \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 \~} +\def\fileinfo{dialogue environment (Frankenstein's mouth)} +\def\DoXPackageS {dialogue,attrib} +\def\initelyHavECitationS {} +\def\fileversion{v1.1} +\def\filedate{1999/03/01} +\def\docdate{1996/04/11} +\edef\PPOptArg {% + \filedate\space \fileversion\space \fileinfo +} +\makeatletter% A special comment to help create bst files. Don't change! +\@ifundefined{JusTLoaDInformatioN} {% + }{% ELSE (we know the compsci package is already loaded, too) + \UndefineCS\JusTLoaDInformatioN + \SaveDoXVarS + \eExpand\csname DoXPackageS\endcsname\In {%use \csname in case it's undefined + \usepackage{#1}% + }% + \RestoreDoXVarS + \makeatother + \endinput +}% A special comment to help create bst files. Don't change! +\NeedsTeXFormat{LaTeX2e} +\ProvidesPackage{dialogue}[\PPOptArg] +%% +\RequirePackage{blkcntrl,moredefs,relsize} +\NewTextFontCommand\refer\ReferStyle + +\newcommand\ReferStyle {% + \scshape +} +\newcommand\direct [1] {% + [{\DirectStyle #1}]% +} +\newcommand\DirectStyle {% + \relsize{-1}% + \slshape +} +\newcommand*\DialogueLabel [1] {% + \scshape\lowercase{#1}:\hfil +} +\newcommand\PreDialogue {% + \PreChunk +} +\newenvironment{dialogue} {% + \begin{list}{} {% + \setlength\itemsep{\z@ \@plus .5ex}% + \setlength\parsep{\parskip}% + \setlength\rightmargin{\leftmargin}% + \defcommand\speak [1] {\item[{##1}]}% + \let\makelabel\DialogueLabel + }% + \PreDialogue\relax + }{% + \end{list}% + } +\endinput +%% +%% End of file `dialogue.stq'. diff --git a/Master/texmf-dist/tex/latex/frankenstein/dialogue.sty b/Master/texmf-dist/tex/latex/frankenstein/dialogue.sty new file mode 100644 index 00000000000..190b1be0b73 --- /dev/null +++ b/Master/texmf-dist/tex/latex/frankenstein/dialogue.sty @@ -0,0 +1,273 @@ +%^^A* legal notices +% \iffalse +% +% This program is part of the Frankenstein bundle for LaTeX. +% +% Copyright 1995-2001 Matt Swift <swift@alum.mit.edu>. +% +% This file contains both the code and documentation for the +% dialogue LaTeX package. It will work ONLY if it is placed in a +% proper directory. Files called README, INSTALL, dialogue.tex +% and dialogue.ins should have also been distributed to you +% with this file. See them for more information on how to typeset +% the documentation with LaTeX and how to generate a version of this +% file that will work faster than this one. +% +% This program is free software; you may redistribute it and/or +% modify it under the conditions of the LaTeX Project Public +% License, either version 1.2 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. +% +% This program is distributed in the hope that it will be useful, +% but without any warranty; without even the implied warranty of +% merchantability or fitness for a particular purpose. See the +% LaTeX Project Public License for more details. +% +% \fi +% +%^^A* checks +% +%^^A NOTE: The character table, with two %'s, will get written to all files. +%% \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 \~} +% +% \CheckSum{43} +% +%^^A** abstract +% \begin{abstract} +% The \env{dialogue} environment is for citing short passages of scripted +% dialogue. It is not for typsetting a long script. +% \end{abstract} +% \tableofcontents +% +% \part{Discussion} +% +% \section{Dialogue} +% +% An example will have to suffice for most documentation at the moment. +% \cs\attrib is defined in the \package{attrib} package, also in the +% \Frankenstein bundle. +% \begin{bothexample} +% \begin{dialogue} +% \speak{Vladimir} Whare are all these corpses from? +% \speak{Estragon} These skeletons. +% \par\lips\par +% \speak{Vladimir} A charnel-house! A charnel-house! +% +% \attrib{\play{Waiting for Godot}, 41 \normalcitations\cite{beckett:godot}} +% +% \medskip +% \direct{ +% Estragon has exited offstage to right and left and come ``panting'' back +% and fallen into Vladimir's arms. \emph{---Ed.} +% } +% \speak{Estragon} I'm in hell! +% \speak{Vladimir} Where were you? +% \speak{Estragon} They're coming there too! +% \speak{Vladimir} We're surrounded! \direct{\refer{Estragon} makes a rush +% towards back.} Imbecile! There's no way out there. +% \direct{\refer{He} takes \refer{Estragon} by the arms +% and drags him towards front. Gesture towards front.} +% There! Not a soul in sight! Off you go! Quick! +% \direct{\refer{He} pushes \refer{Estragon} towards +% auditorium. \refer{Estragon} recoils in horror.} You +% won't? \direct{\refer{He} contemplates auditorium.} +% Well I can understand that. Wait till I see. +% \direct{\refer{He} reflects.} Your only hope left is to +% disappear. +% +% \attrib{47} +% \end{dialogue} +% \end{bothexample} +% +% \DescribeMacro\direct +% \cs\direct\marg{directions} Inline stage directions. Can be used anywhere. +% +% \DescribeMacro\refer +% \cs\refer\marg{speaker} Refer to a character in a play. Can be used anywhere. +% +% \DescribeEnv{dialogue} +% Inside the \env{dialogue} environment, commands \cs\direct, and \cs\refer +% behave differently, but have the same function. +% +% \DescribeMacro\speak +% \cs\speak\marg{speaker} Introduce the speech of speaker \meta{speaker} +% within a \env{dialogue} environment. +% +% \section{Programmer's interface} +% +% \DescribeMacro\ReferStyle +% \DescribeMacro\DirectStyle +% \DescribeMacro\DialogueLabel +% \DescribeMacro\PreDialogue +% +% These macros are available for adjusting the behavior of the user +% commands. I'm afraid you'll have to read the (easy) code until I write +% better documentation. +% +% \StopEventually{} +% +% \part{Implementation} +% +% \section{Version control} +% +% \begin{macro}{\fileinfo} +% \begin{macro}{\DoXUsepackagE} +% \begin{macro}{\HaveECitationS} +% \begin{macro}{\fileversion} +% \begin{macro}{\filedate} +% \begin{macro}{\docdate} +% \begin{macro}{\PPOptArg} +% These definitions must be the first ones in the file. +% \begin{macrocode} +\def\fileinfo{dialogue environment (Frankenstein's mouth)} +\def\DoXPackageS {dialogue,attrib} +\def\initelyHavECitationS {} +\def\fileversion{v1.1} +\def\filedate{1999/03/01} +\def\docdate{1996/04/11} +\edef\PPOptArg {% + \filedate\space \fileversion\space \fileinfo +} +% \end{macrocode} +% \end{macro} +% \end{macro} +% \end{macro} +% \end{macro} +% \end{macro} +% \end{macro} +% \end{macro} +% +% If we're loading this file from a \cs\ProcessDTXFile command (see the +% \package{compsci} package), then \cs\JusTLoaDInformatioN will be defined; +% othewise we assume it is not (that's why the FunkY NamE). +% +% If we're loading from \cs\ProcessDTXFile, we want to load the packages listed +% in \cs\DoXPackageS (needed to typeset the documentation for this file) and +% then bail out. Otherwise, we're using this file in a normal way as a +% package, so do nothing. \cs\DoXPackageS, if there are any, are declared in +% the \ext{dtx} file, and, if you're reading the typeset documentation of this +% package, would appear just above. (It's OK to call \cs\usepackage with an +% empty argument or \cs\relax, by the way.) +% \begin{macrocode} +\makeatletter% A special comment to help create bst files. Don't change! +\@ifundefined{JusTLoaDInformatioN} {% + }{% ELSE (we know the compsci package is already loaded, too) + \UndefineCS\JusTLoaDInformatioN + \SaveDoXVarS + \eExpand\csname DoXPackageS\endcsname\In {%use \csname in case it's undefined + \usepackage{#1}% + }% + \RestoreDoXVarS + \makeatother + \endinput +}% A special comment to help create bst files. Don't change! +% \end{macrocode} +% +% Now we check for \LaTeX2e and declare the LaTeX package. +% \begin{macrocode} +\NeedsTeXFormat{LaTeX2e} +\ProvidesPackage{dialogue}[\PPOptArg] +% \end{macrocode}^^A special comment to help create bst files. Don't change! +% +% ^^A NOTE: We have to compensate for the above backslashes, which are not +% ^^A actually in the .dtx file the author works on, by adding to the +% ^^A CheckSum. +%% +% \AddToCheckSum{17}^^A `dtx-update-checksum' automatically handles this. +% \AddToCheckSum{7}^^A The half a macrocode env. at the top is missed, however... +% \AddToCheckSum{10}^^A ... and so are the 5 \defs from the .dtx file +% ^^A that precede it. +% \IfCitations {% +% \AddToCheckSum{2}^^A When \initelyHavECitationS is defined in +% } ^^A the .dtx file, we need 2 more in the CheckSum. +% +% +% \section{Requirements} +% +% \begin{macrocode} +\RequirePackage{blkcntrl,moredefs,relsize} +% \end{macrocode} +% +% \section{The macros} +% +% The standard classes set \cs\partopsep, \cs\parsep, \cs\topsep, and +% \cs\itemsep to positive values. \cs\leftmargin goes to |2.5em| in +% onecolumn. \cs\labelsep is |.5em|; \cs\labelwidth = \cs\leftmargin - +% \cs\labelsep. +% +% \begin{macro}{\refer} +% \begin{macro}{\ReferStyle} +% \begin{macro}{\direct} +% \begin{macro}{\DirectStyle} +% \mbox{} +% \begin{macrocode} +\NewTextFontCommand\refer\ReferStyle + +\newcommand\ReferStyle {% + \scshape +} +\newcommand\direct [1] {% + [{\DirectStyle #1}]% +} +\newcommand\DirectStyle {% + \relsize{-1}% + \slshape +} +% \end{macrocode} +% \end{macro} +% \end{macro} +% \end{macro} +% \end{macro} +% +% \begin{macro}{\DialogueLabel} +% \begin{macro}{\PreDialogue} +% \begin{environment}{dialogue} +% The first line of a new speaker has the speaker's name flush with the left +% margin of the surrounding text, then the default \cs\labelsep, then the +% first line of dialogue. Subsequent lines all begin |2.5em| in, and end +% |2.5em| before the surrounding text. Interparagraph space is the same as +% the surrounding text's. Extra positive stretchability of |.5ex| is added +% between speakers. \todo{Ensure that the units will be relative to the current +% size \emph{in} the environment, not the current size when the setting is +% done.} +% \begin{macrocode} +\newcommand*\DialogueLabel [1] {% + \scshape\lowercase{#1}:\hfil +} +\newcommand\PreDialogue {% + \PreChunk +} +\newenvironment{dialogue} {% + \begin{list}{} {% + \setlength\itemsep{\z@ \@plus .5ex}% + \setlength\parsep{\parskip}% + \setlength\rightmargin{\leftmargin}% + \defcommand\speak [1] {\item[{##1}]}% + \let\makelabel\DialogueLabel + }% + \PreDialogue\relax + }{% + \end{list}% + } +% \end{macrocode} +% \end{environment} +% \end{macro} +% \end{macro} +% +% \Finale diff --git a/Master/texmf-dist/tex/latex/frankenstein/lips.stq b/Master/texmf-dist/tex/latex/frankenstein/lips.stq new file mode 100644 index 00000000000..4c3133423f2 --- /dev/null +++ b/Master/texmf-dist/tex/latex/frankenstein/lips.stq @@ -0,0 +1,193 @@ +%% +%% This is file `lips.stq', +%% generated with the docstrip utility. +%% +%% The original source files were: +%% +%% lips.sty +%% +%% This program is part of the Frankenstein bundle for LaTeX. +%% +%% Copyright (C) 1995-2001 Matthew Swift <swift@alum.mit.edu> +%% +%% This file may have one of TWO names, either +%% lips.sty or lips.stq. This +%% LaTeX package will work ONLY if it is called lips.sty +%% and placed in a proper directory. This file should have been +%% distributed to you with a DIFFERENT file (also) called +%% lips.sty which functions identically to this one +%% but contains documentation in comments. This file works faster, +%% but the other should be kept because it contains the documentation +%% for this LaTeX package. Files called README and INSTALL should have +%% also been distributed to you with this file; see them for more +%% information. +%% +%% This program is free software; you may redistribute it and/or +%% modify it under the conditions of the LaTeX Project Public +%% License, either version 1.2 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. +%% +%% This program is distributed in the hope that it will be useful, +%% but WITHOUT ANY WARRANTY; without even the implied warranty of +%% MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the +%% LaTeX Project Public License for more details. +%% +%% \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 \~} +\def\fileinfo{Chicago Manual text ellipses (Frankenstein's lips)} +\def\DoXPackageS {} +\def\initelyHavECitationS {} +\def\fileversion{v2.1} +\def\filedate{2001/08/31} +\def\docdate{2001/08/31} +\edef\PPOptArg {% + \filedate\space \fileversion\space \fileinfo +} +\makeatletter% A special comment to help create bst files. Don't change! +\@ifundefined{JusTLoaDInformatioN} {% + }{% ELSE (we know the compsci package is already loaded, too) + \UndefineCS\JusTLoaDInformatioN + \SaveDoXVarS + \eExpand\csname DoXPackageS\endcsname\In {%use \csname in case it's undefined + \usepackage{#1}% + }% + \RestoreDoXVarS + \makeatother + \endinput +}% A special comment to help create bst files. Don't change! +\NeedsTeXFormat{LaTeX2e} +\ProvidesPackage{lips}[\PPOptArg] +%% +\newcommand*\Lips {} +\let\Lips\relax +\DeclareRobustCommand\Lips {% + \ifmmode + \def\sc@t@a {% + \PackageError{lips} + {Don't use \protect\lips \space in math mode; use \protect\dots.}\@ehc + }% + \else + \ifvmode + \def\sc@t@a {% + \leavevmode + .\nobreak\ .\nobreak\ .\nobreak\ % + }% + \else + \let\sc@t@a\lp@lips@hmode + \fi + \fi + \sc@t@a +} +\newcommand*\BracketedLips {} +\let\BracketedLips\relax +\DeclareRobustCommand\BracketedLips {% + \ifmmode + \def\sc@t@a {% + \PackageError{lips} + {Don't use \protect\lips \space in math mode; use \protect\dots.}\@ehc + }% + \else + \ifvmode + \def\sc@t@a {% + \leavevmode + [.\nobreak\ .\nobreak\ .]\nobreak\ % + }% + \else + \let\sc@t@a\lp@blips@hmode + \fi + \fi + \sc@t@a +} +\newlet\lips\Lips +\newlet\olips\lips +\DeclareOption{mla} {% + \let\lips\BracketedLips +} +\ProcessOptions +\newcommand\lp@lips@hmode {% + \unskip + \@ifnextchar . {% + .\penalty9999\ .\nobreak\ .\nobreak\ .\ % + \GobbleIgnoreSpaces + }{% ELSE + \penalty9999\ .\nobreak\ .\nobreak\ .% + \futurelet\sc@t@a\lp@lips@check@punct + }% +} +\newcommand\lp@blips@hmode {% + \unskip + \@ifnextchar . {% + \penalty9999\ [.\nobreak\ .\nobreak\ .]% + }{% ELSE + \penalty9999\ [.\nobreak\ .\nobreak\ .]% + \futurelet\sc@t@a\lp@lips@check@punct + }% +} +\newcommand\GobbleIgnoreSpaces [1] {% + \ignorespaces +} +\newcommand*\lp@bang {} +\newcommand*\lp@rparen {} +\newcommand*\lp@comma {} +\newcommand*\lp@slash {} +\newcommand*\lp@colon {} +\newcommand*\lp@semic {} +\newcommand*\lp@q {} +\newcommand*\lp@rbrack {} +\newcommand*\lp@rquote {} +\newcommand*\lp@tilde {} + +\let\lp@bang=! +\let\lp@rparen=) +\let\lp@comma=, +\let\lp@slash=/ +\let\lp@colon=: +\let\lp@semic=; +\let\lp@q=? +\let\lp@rbrack=] +\let\lp@rquote=' +\let\lp@tilde=~ + + +\newcommand \LPNobreakList {% + \lp@comma \lp@colon \lp@semic + \lp@q \lp@bang + \lp@rparen \lp@rquote \lp@rbrack \egroup + \lp@slash +} +\newcommand\lp@lips@check@punct {% + \ifx\sc@t@a\lp@tilde + \else + \@tempswatrue + \let\@fortmp\PunctList + \expandafter\@tforloop\LPNobreakList\@nil\@nil\@@\reserved@a {% + \ifx\sc@t@a\reserved@a +\@tempswafalse +\@break@tfor + \fi + }% + \if@tempswa + \ % + \else + \nobreak\ % + \fi + \fi +} +\endinput +%% +%% End of file `lips.stq'. diff --git a/Master/texmf-dist/tex/latex/frankenstein/lips.sty b/Master/texmf-dist/tex/latex/frankenstein/lips.sty new file mode 100644 index 00000000000..35b60029eff --- /dev/null +++ b/Master/texmf-dist/tex/latex/frankenstein/lips.sty @@ -0,0 +1,555 @@ +%^^A* legal notices +% \iffalse +% +% This program is part of the Frankenstein bundle for LaTeX. +% +% Copyright 1995-2001 Matt Swift <swift@alum.mit.edu>. +% +% This file contains both the code and documentation for the +% lips LaTeX package. It will work ONLY if it is placed in a +% proper directory. Files called README, INSTALL, lips.tex +% and lips.ins should have also been distributed to you +% with this file. See them for more information on how to typeset +% the documentation with LaTeX and how to generate a version of this +% file that will work faster than this one. +% +% This program is free software; you may redistribute it and/or +% modify it under the conditions of the LaTeX Project Public +% License, either version 1.2 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. +% +% This program is distributed in the hope that it will be useful, +% but without any warranty; without even the implied warranty of +% merchantability or fitness for a particular purpose. See the +% LaTeX Project Public License for more details. +% +% \fi +% +%^^A* checks +% +%^^A NOTE: The character table, with two %'s, will get written to all files. +%% \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 \~} +% +% \CheckSum{207} +% +% \begin{abstract} +% The \cs\lips command generates text ellipses that are closer to what +% \manual suggests than what \cs\dots produces. It does the right thing in +% most circumstances, and so is easy to use. +% \end{abstract} +% \tableofcontents +% +% \part{Discussion} +% +% \section{Text Ellipses} +% +% \DescribeMacro{\lips} +% The macro \cs\lips should be used for all text ellipses, that is, ellipses +% not part of a mathematical expression. +% +% \manual does not acknowledge different spacings after different marks of +% punctuation, distinguish interword from intersentence space, or give rules +% about where to break a line near an ellipsis. Given a context where such +% spaces do vary and rules for linebreaks can be given, I arrived at the +% following rules for handling them around ellipses. +% \begin{enumerate} +% \item Pre-, post-, and intra-ellipsis space is normal intra-word space, which +% should be 3-to-em. In \LaTeX{} there is also some glue (it's a +% ``rubber space''). +% \item When non-period punctuation $p$ follows \cs\lips, $p$ is followed by +% the space that normally follows $p$. +% \item A period following \cs\lips is treated as if the period preceded +% \cs\lips. Conceptually, an ellipsis never precedes a period, so +% conceptually there is only one case; but it is convenient to be able to +% type either \code{\lips.} or \code{.\lips}. +% \item Lines are a tiny bit breakable before ellipses and a tiny bit +% breakable after ellipses that are not followed by punctuation. +% \end{enumerate} +% +% In figure~\ref{fig:usage} are examples of correct usage and in +% figure~\ref{fig:comp} is a comparison of \cs\lips to \cs\dots. You can +% substitute any of the characters \code$!"()*+,-/:;=?@[]'`|<>~{}$ for the +% exclamation point in the examples. There can be additional contiguous spaces +% after \cs\lips, just like after any command name. There can also be +% contiguous spaces before \cs\lips. +% +% \begin{figure} +% \DeleteShortVerb{\|} +% \begin{center} +% \begin{tabular}{lc} +% \bfseries source & \bfseries \hspace*{4em} result +% \end{tabular}\par\nobreak +% \par\nobreak +% \begin{tabular}{|lp{1in}|} +% \hline +% \verb*|Hello\lips. And| & Hello\lips. And \\\hline +% \verb*|Hello \lips. And| & Hello \lips. And \\\hline +% \verb*|Hello.\lips And| & Hello.\lips And \\\hline +% \verb*|Hello. \lips And| & Hello. \lips And \\\hline +% \verb*|one,\lips, three| & one,\lips, three \\\hline +% \verb*|one, \lips, three| & one, \lips, three \\\hline +% \verb*|Hello\lips and| & Hello\lips and \\\hline +% \verb*|Hello \lips and| & Hello \lips and \\\hline +% \verb*|Hello!\lips And| & Hello!\lips And \\\hline +% \verb*|Hello! \lips And| & Hello! \lips And \\\hline +% \end{tabular} +% \end{center} +% \caption{\label{fig:usage}Examples of correct usage of \cs\lips.} +% \MakeShortVerb{\|} +% \end{figure} +% +% \begin{figure} +% \begin{center} +% \begin{tabular}{lc} +% \bfseries source & \bfseries \hspace*{4em} result +% \end{tabular}\par +% \par +% \DeleteShortVerb{\|} +% \begin{tabular}{|lp{1in}|} +% \hline +% \verb*|Hello\dots. And| & Hello\dots. And \\ +% \verb*|Hello\lips. And| & Hello\lips. And \\\hline +% \verb*|Hello \dots. And| & Hello \dots. And \\ +% \verb*|Hello \lips. And| & Hello \lips. And \\\hline +% \verb*|Hello.\dots And| & Hello.\dots And \\ +% \verb*|Hello.\lips And| & Hello.\lips And \\\hline +% \verb*|Hello. \dots And| & Hello. \dots And \\ +% \verb*|Hello. \lips And| & Hello. \lips And \\\hline +% \verb*|one,\dots, three| & one,\dots, three \\ +% \verb*|one,\lips, three| & one,\lips, three \\\hline +% \verb*|one, \dots, three| & one, \dots, three \\ +% \verb*|one, \lips, three| & one, \lips, three \\\hline +% \verb*|Hello\dots and| & Hello\dots and \\ +% \verb*|Hello\lips and| & Hello\lips and \\\hline +% \verb*|Hello \dots and| & Hello \dots and \\ +% \verb*|Hello \lips and| & Hello \lips and \\\hline +% \verb*|Hello!\dots And| & Hello!\dots And \\ +% \verb*|Hello!\lips And| & Hello!\lips And \\\hline +% \verb*|Hello! \dots And| & Hello! \dots And \\ +% \verb*|Hello! \lips And| & Hello! \lips And \\\hline +% \end{tabular} +% \end{center} +% \caption{\label{fig:comp}Comparison of \cs\lips with \cs\dots.} +% \MakeShortVerb{\|} +% \end{figure} +% +% \section{Line breaking considerations} +% +% \DescribeMacro\LPNobreakList +% When \cs\lips is followed by certain punctuation (\code|,:;?!)']}/| by +% default), we never want to break a line after the ellipsis and before that +% punctuation. For the other punctuation, such as open parenthesis and open +% quote, we want normally breakable space following the ellipsis. +% \cs\LPNobreakList is a list of those characters before which \cs\lips +% should \emph{never} break a line. To force unbreakable space following +% \cs\lips, follow \cs\lips with a tie (|~|). +% +% \section{Limitations} +% +% \cs\lips does the right thing after \cname{par}, but after \cs\indent or +% \cs\noindent there is an extra preceding space (see the final section on +% testing for an example). Suggestions on how to handle this problem are +% welcome. +% +% \StopEventually{} +% +% \part{Implementation} +% +% \section{Version control} +% +% \begin{macro}{\fileinfo} +% \begin{macro}{\DoXUsepackagE} +% \begin{macro}{\HaveECitationS} +% \begin{macro}{\fileversion} +% \begin{macro}{\filedate} +% \begin{macro}{\docdate} +% \begin{macro}{\PPOptArg} +% These definitions must be the first ones in the file. +% \begin{macrocode} +\def\fileinfo{Chicago Manual text ellipses (Frankenstein's lips)} +\def\DoXPackageS {} +\def\initelyHavECitationS {} +\def\fileversion{v2.1} +\def\filedate{2001/08/31} +\def\docdate{2001/08/31} +\edef\PPOptArg {% + \filedate\space \fileversion\space \fileinfo +} +% \end{macrocode} +% \end{macro} +% \end{macro} +% \end{macro} +% \end{macro} +% \end{macro} +% \end{macro} +% \end{macro} +% +% If we're loading this file from a \cs\ProcessDTXFile command (see the +% \package{compsci} package), then \cs\JusTLoaDInformatioN will be defined; +% othewise we assume it is not (that's why the FunkY NamE). +% +% If we're loading from \cs\ProcessDTXFile, we want to load the packages listed +% in \cs\DoXPackageS (needed to typeset the documentation for this file) and +% then bail out. Otherwise, we're using this file in a normal way as a +% package, so do nothing. \cs\DoXPackageS, if there are any, are declared in +% the \ext{dtx} file, and, if you're reading the typeset documentation of this +% package, would appear just above. (It's OK to call \cs\usepackage with an +% empty argument or \cs\relax, by the way.) +% \begin{macrocode} +\makeatletter% A special comment to help create bst files. Don't change! +\@ifundefined{JusTLoaDInformatioN} {% + }{% ELSE (we know the compsci package is already loaded, too) + \UndefineCS\JusTLoaDInformatioN + \SaveDoXVarS + \eExpand\csname DoXPackageS\endcsname\In {%use \csname in case it's undefined + \usepackage{#1}% + }% + \RestoreDoXVarS + \makeatother + \endinput +}% A special comment to help create bst files. Don't change! +% \end{macrocode} +% +% Now we check for \LaTeX2e and declare the LaTeX package. +% \begin{macrocode} +\NeedsTeXFormat{LaTeX2e} +\ProvidesPackage{lips}[\PPOptArg] +% \end{macrocode}^^A special comment to help create bst files. Don't change! +% +% ^^A NOTE: We have to compensate for the above backslashes, which are not +% ^^A actually in the .dtx file the author works on, by adding to the +% ^^A CheckSum. +%% +% \AddToCheckSum{17}^^A `dtx-update-checksum' automatically handles this. +% \AddToCheckSum{7}^^A The half a macrocode env. at the top is missed, however... +% \AddToCheckSum{10}^^A ... and so are the 5 \defs from the .dtx file +% ^^A that precede it. +% \IfCitations {% +% \AddToCheckSum{2}^^A When \initelyHavECitationS is defined in +% } ^^A the .dtx file, we need 2 more in the CheckSum. +% +% +% \section{The macro} +% +% \begin{macro}{\Lips} +% \begin{macro}{\BracketedLips} +% \begin{macro}{\lips} +% \begin{macro}{\olips} +% If we're in math mode, raise an error. If we're in vertical mode, leave it +% and do an ellipsis not breakable at the end. If we're in horizontal mode, +% call \cname{lp@lips@hmode}. +% +% Normally I would use \cs\NewRobustCommand, but this seems not enough reason +% to require the \package{moredefs} package. We reserve the name \cs\lips by +% hand. In the future, this package may require \package{moredefs}. +% \begin{macrocode} +\newcommand*\Lips {} +\let\Lips\relax +\DeclareRobustCommand\Lips {% + \ifmmode + \def\sc@t@a {% + \PackageError{lips} + {Don't use \protect\lips \space in math mode; use \protect\dots.}\@ehc + }% + \else + \ifvmode + \def\sc@t@a {% + \leavevmode + .\nobreak\ .\nobreak\ .\nobreak\ % + }% + \else + \let\sc@t@a\lp@lips@hmode + \fi + \fi + \sc@t@a +} +\newcommand*\BracketedLips {} +\let\BracketedLips\relax +\DeclareRobustCommand\BracketedLips {% + \ifmmode + \def\sc@t@a {% + \PackageError{lips} + {Don't use \protect\lips \space in math mode; use \protect\dots.}\@ehc + }% + \else + \ifvmode + \def\sc@t@a {% + \leavevmode + [.\nobreak\ .\nobreak\ .]\nobreak\ % + }% + \else + \let\sc@t@a\lp@blips@hmode + \fi + \fi + \sc@t@a +} +% \end{macrocode} +% \todo{need the relax to avoid mistaking as optarg in some +% contexts?} In MLA style, that is, with the \option{mla} option, \cs\lips +% gives you brackets, meaning you To get no brackets, use \cs\olips for +% ``original lips,'' that is, ellipses in the original document. \todo{Better +% dox here. Are options case sensitive? If so, make MLA=mla.} +% \begin{macrocode} +\newlet\lips\Lips +\newlet\olips\lips +\DeclareOption{mla} {% + \let\lips\BracketedLips +} +\ProcessOptions +% \end{macrocode} +% \end{macro} +% \end{macro} +% \end{macro} +% \end{macro} +% +% \begin{macro}{\lp@lips@hmode} +% \begin{macro}{\lp@blips@hmode} +% \begin{macro}{\GobbleIgnoreSpaces} +% The horizontal mode case. Then we remove the last skip on the horizontal +% list. If the next character is a period, we want to act as if the period +% preceded \cs\lips, so we plonk down a period, a minimally-breakable space, +% then an ellipsis ending with normally-breakable space. This keeps the +% ellipsis on the same line as the sentence it follows if at all possible, +% but allows it to spill onto the next line if there's no other way to avoid +% an overfull line. Then we want to gobble up the period that's about to +% come, and ignore any spaces after it, since we've already inserted proper +% space. +% +% If the next character is not a period, we output a minimally-breakable +% space and an ellipsis. To decide whether to follow it with unbreakable or +% normally-breakable space, we need to know more about the next character +% than just that it is not a period, so we \cs\let it to scratch |a| and call +% \cname{lp@lips@check@punct}. +% +% \todo{document different logic with bracketed lips; how the heck to handle +% greater inter-sentence space?} +% \begin{macrocode} +\newcommand\lp@lips@hmode {% + \unskip + \@ifnextchar . {% + .\penalty9999\ .\nobreak\ .\nobreak\ .\ % + \GobbleIgnoreSpaces + }{% ELSE + \penalty9999\ .\nobreak\ .\nobreak\ .% + \futurelet\sc@t@a\lp@lips@check@punct + }% +} +% hmm, have to keep the check for period i guess because i don't want it in +% nobreaklist? because the break/nobreak is different? because it's more efficient? +\newcommand\lp@blips@hmode {% + \unskip + \@ifnextchar . {% + \penalty9999\ [.\nobreak\ .\nobreak\ .]% + }{% ELSE + \penalty9999\ [.\nobreak\ .\nobreak\ .]% + \futurelet\sc@t@a\lp@lips@check@punct + }% +} +\newcommand\GobbleIgnoreSpaces [1] {% + \ignorespaces +} +% \end{macrocode} +% \end{macro} +% \end{macro} +% \end{macro} +% +% \begin{macro}{\LPNobreakList} +% \begin{macro}{\lp@<punctuation>} +% We'd like to use \code{\ifcat.\sc@t@a} for this, but that won't work when +% we get a command sequence in scratch |a|. Bummer. +% Do I really need to define all this punctuation now? It protects against +% something becoming an active char or otherwise changing catcodes after the +% \package{lips} package is loaded. +% \begin{macrocode} +\newcommand*\lp@bang {} +\newcommand*\lp@rparen {} +\newcommand*\lp@comma {} +\newcommand*\lp@slash {} +\newcommand*\lp@colon {} +\newcommand*\lp@semic {} +\newcommand*\lp@q {} +\newcommand*\lp@rbrack {} +\newcommand*\lp@rquote {} +\newcommand*\lp@tilde {} + +\let\lp@bang=! +\let\lp@rparen=) +\let\lp@comma=, +\let\lp@slash=/ +\let\lp@colon=: +\let\lp@semic=; +\let\lp@q=? +\let\lp@rbrack=] +\let\lp@rquote=' +\let\lp@tilde=~ + +% \egroup + +% \end{macrocode} +% I'm making an attempt to put these in order of expected frequency. A +% doublequote could be at the beginning or end of a quotation, so half the time +% you'll have to correct by adding |{}|, so let's leave it out +% so there's one less to check. +% \begin{macrocode} +\newcommand \LPNobreakList {% + \lp@comma \lp@colon \lp@semic + \lp@q \lp@bang + \lp@rparen \lp@rquote \lp@rbrack \egroup + \lp@slash +} +% \end{macrocode} +% \end{macro} +% \end{macro} +% +% \begin{macro}{\lp@lips@check@punct} +% Add nonbreakable space if scratch |a| is in \cs\LPNobreakList; add +% normally-breakable space otherwise. Add no space at all if scratch |a| is +% a tie---the tie will add nonbreakable space. We use just the guts of +% \cname{@tfor} for efficiency. +% \begin{macrocode} +\newcommand\lp@lips@check@punct {% + \ifx\sc@t@a\lp@tilde + \else + \@tempswatrue + \let\@fortmp\PunctList + \expandafter\@tforloop\LPNobreakList\@nil\@nil\@@\reserved@a {% + \ifx\sc@t@a\reserved@a + \@tempswafalse + \@break@tfor + \fi + }% + \if@tempswa + \ % + \else + \nobreak\ % + \fi + \fi +} +% \end{macrocode} +% \end{macro} +% +% You might want to compare the \LaTeX{} version (as of 95/12/01). +% \cname{fontdimen3} is the interword stretchability, not interword space. +% \begin{codeexample} +% \DeclareTextCommandDefault{\textellipsis}{% +% .\kern\fontdimen3\font +% .\kern\fontdimen3\font +% .\kern\fontdimen3\font +% } +% \def\mathellipsis{\mathinner{\ldotp\ldotp\ldotp}} +% \DeclareRobustCommand{\dots}{% +% \ifmmode\mathellipsis\else\textellipsis\fi +% } +% \let\ldots\dots +% \end{codeexample} +% +% \part{Testing} +% +% \section{Ante-\cs\lips} +% +% This is some testing. We need some text here as the first paragraph after +% the \cs\section. +% +% : \lips. +% +% : \lips text. +% +% : \lips) +% +% ; \lips. +% +% ; \lips text. +% +% ; \lips) +% +% ! \lips. +% +% ! \lips text. +% +% ! \lips) +% +% t \lips. +% +% t \lips text. +% +% t \lips) +% +% T \lips. +% +% T \lips text. +% +% T \lips) +% +% , \lips. +% +% , \lips text. +% +% , \lips) +% +% \par \lips and (|\par \lips and|) +% \par and (|\par and|) +% +% \par\indent \lips (|\par\indent \lips and|) +% \par\indent and (|\par\indent and|) +% +% \par\noindent \lips and (|\par\noindent \lips and|) +% \par\noindent and (|\par\noindent and|) +% +% \par And.\lips \par (|And.\lips \par|) +% \par And. \par (|And. \par|) +% +% \section{Post-\cs\lips} +% +% \cs\lips before a tie: One two three.\lips~tiedtolips (I doubt you'd want to +% do this.) +% +% \cs\lips before ), e.g., punctuation transparent to spacefactors: +% +% (One two three.\lips)\ This follows the ) with interword space, to compare. +% +% (One two three.\lips) This should follow the ) with intersentence space. +% +% (One two three.\lips\@) This should follow the ) with intersentence space. +% +% \cs\lips before shortverb: \lips |shortverb verbatim stuff| +% +% \cs\lips before \cs\textsf: \lips \textsf{sansserif} +% +% \begin{center} +% \cs\lips before |\\|: \lips \\ +% second line of a \env{center} environment +% \end{center} +% +% \cs\lips before \cs\#: \lips \# +% +% \cs\lips before |<|: \lips < +% +% \cs\lips before an abbrev: \lips \Frankenstein +% +% \cs\lips before \cs\cite: \lips \cite{chicago:14} +% +% \cs\lips before |$|: \lips $f=ma$ ^^A$ +% +%^^A \cs\lips in math mode (error!): $\lips^2$ +% +% \begin{tabular}{ll} +% \cs\lips before |&|: \lips & second column of a \env{tabular} +% \end{tabular} +% +% \Finale diff --git a/Master/texmf-dist/tex/latex/frankenstein/moredefs.stq b/Master/texmf-dist/tex/latex/frankenstein/moredefs.stq new file mode 100644 index 00000000000..81752d699c5 --- /dev/null +++ b/Master/texmf-dist/tex/latex/frankenstein/moredefs.stq @@ -0,0 +1,577 @@ +%% +%% This is file `moredefs.stq', +%% generated with the docstrip utility. +%% +%% The original source files were: +%% +%% moredefs.sty +%% +%% This program is part of the Frankenstein bundle for LaTeX. +%% +%% Copyright (C) 1995-2001 Matthew Swift <swift@alum.mit.edu> +%% +%% This file may have one of TWO names, either +%% moredefs.sty or moredefs.stq. This +%% LaTeX package will work ONLY if it is called moredefs.sty +%% and placed in a proper directory. This file should have been +%% distributed to you with a DIFFERENT file (also) called +%% moredefs.sty which functions identically to this one +%% but contains documentation in comments. This file works faster, +%% but the other should be kept because it contains the documentation +%% for this LaTeX package. Files called README and INSTALL should have +%% also been distributed to you with this file; see them for more +%% information. +%% +%% This program is free software; you may redistribute it and/or +%% modify it under the conditions of the LaTeX Project Public +%% License, either version 1.2 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. +%% +%% This program is distributed in the hope that it will be useful, +%% but WITHOUT ANY WARRANTY; without even the implied warranty of +%% MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the +%% LaTeX Project Public License for more details. +%% +%% \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 \~} +\def\fileinfo{more defining commands (Frankenstein's brain)} +\def\DoXPackageS {} +\def\fileversion{v1.8} +\def\filedate{2001/08/31} +\def\docdate{2001/08/31} +\edef\PPOptArg {% + \filedate\space \fileversion\space \fileinfo +} +\makeatletter% A special comment to help create bst files. Don't change! +\@ifundefined{JusTLoaDInformatioN} {% + }{% ELSE (we know the compsci package is already loaded, too) + \UndefineCS\JusTLoaDInformatioN + \SaveDoXVarS + \eExpand\csname DoXPackageS\endcsname\In {%use \csname in case it's undefined + \usepackage{#1}% + }% + \RestoreDoXVarS + \makeatother + \endinput +}% A special comment to help create bst files. Don't change! +\NeedsTeXFormat{LaTeX2e} +\ProvidesPackage{moredefs}[\PPOptArg] +%% +\newcommand*\@ifundefined@cs [1] {% + \edef\reserved@a{% + \expandafter\@gobble\string #1% + }% + \@ifundefined\reserved@a + \@firstoftwo + \@secondoftwo +} +\newcommand\IfElement{} +\def\IfElement #1\In#2{% + \@tempswafalse + \expandafter \@tfor + \expandafter \sc@t@a + \expandafter :% + \expandafter =#2\do {% + \ifx #1\sc@t@a + \@tempswatrue + \@break@tfor + \else + \fi + }% + \if@tempswa + \expandafter\@firstoftwo + \else + \expandafter\@secondoftwo + \fi +} +\newcommand*\sc@star@nothing{} +\newcommand*\sc@star@or@long [1] {% args: defining-command + \@ifstar {% + \let\l@ngrel@x\relax + \def\sc@star@nothing {*}% + #1% + }{% ELSE + \let\l@ngrel@x\long + \def\sc@star@nothing {}% + #1% + }% +} +\newcommand\md@check@star {% + \@ifstar {% + \def\sc@star@nothing {*}% + }{% ELSE + \let\sc@star@nothing \ShortEmpty + }% +} +\newcommand\requirecommand {% + \sc@star@or@long\require@command +} +\newcommand\require@command [1] {% args: \csname + \@ifundefined@cs{#1} {% + \expandafter\newcommand\sc@star@nothing + }{% ELSE + \expandafter\CheckCommand\sc@star@nothing + }% + {#1}% +} +\newcommand\InitCS {% + \@star@or@long\Init@CS +} +\newcommand\Init@CS [1] {% args: \csname + \l@ngrel@x\def#1{}% +} +\newcommand\InitName {% + \sc@star@or@long\Init@Name +} +\newcommand\Init@Name [1] {% args: csname + \expandafter\DefName\sc@star@nothing{#1}{}{}% +} +\newcommand\ReserveCS {% + \sc@star@or@long\Reserve@CS +} +\newcommand\Reserve@CS [1] {% args: \csname + \expandafter\newcommand\sc@star@nothing{#1} {}% +} +\newcommand\ReserveName {% + \sc@star@or@long\Reserve@Name +} +\newcommand\Reserve@Name [1] {% args: csname + \expandafter\NewName\sc@star@nothing{#1}{} {}% +} +\InitCS*\ShortEmpty +\InitCS\LongEmpty +\ReserveCS\sc@t@a +\ReserveCS\sc@t@b +\ReserveCS\sc@t@c +\ReserveCS\sc@t@d +\ReserveCS\sc@t@e +\ReserveCS\sc@t@f +\ReserveCS\sc@t@g +\newcommand\newtokens [1] {% args: \csname + \@ifdefinable #1 {% + \@nameuse{newtoks}#1% + }% +} +\newcommand*\newlet [2] {% args: \csname-a \csname-b + \@ifdefinable #1 {% + \let #1#2% + }% +} +\newcommand*\providetokens [1] {% args: \csname + \@ifundefined@cs{#1} {% + \@nameuse{newtokens}#1% + }{% ELSE + \FrankenInfo{moredefs}{\protect\providetokens\space is not reallocating + token variable \protect#1.\MessageBreak + The existing contents are [\the#1]}% + }% +} +\newcommand*\providelength [1] {% args: \csname + \@ifundefined@cs{#1} {% + \newlength{#1}% + }{% ELSE + \FrankenInfo{moredefs}{\protect\providelength\space is not reallocating + \protect#1.\MessageBreak + The existing value is [\the#1]}% + }% +} +\newcommand*\providesavebox [1] {% args: \csname + \@ifundefined@cs{#1} {% + \newsavebox{#1}% + }{% ELSE + \FrankenInfo{moredefs}{\protect\providesavebox\space is not reallocating + box \protect#1.}% + }% +} +\newcommand*\providecounter [1] {% args: string + \@ifundefined{c@#1} {% + \newcounter{#1}% + }{% ELSE + \FrankenInfo{moredefs}{\protect\providecounter\space is not reallocating + counter #1.\MessageBreak + The existing value is [\expandafter\number\csname c@#1\endcsname]}% + }% +} + + +\requirecommand*\newboolean [1] {% args: string + \expandafter + \@ifdefinable\csname if#1\endcsname {% + \expandafter\newif\csname if#1\endcsname + }% +} + +\@ifpackageloaded{ifthen} {% + }{% ELSE + \requirecommand*\provideboolean [1] {% args: string + \@ifundefined {if#1} {% + \newboolean{#1}% + }{% ELSE + \FrankenInfo{moredefs}{\protect\provideboolean\space is not reallocating + \protect#1.\MessageBreak + The value is [\@nameuse{if#1}TRUE\else FALSE\fi]}% + }% + }% +} +\newtokens\sc@toks@a +\newtokens\sc@toks@b + +\newcommand\addto@macro [2] {% + \sc@toks@a=\expandafter{#1#2}% + \edef#1{% + \the\sc@toks@a + }% +} +\newcommand\lg@addto@macro [2] {% + \sc@toks@a=\expandafter{#1#2}% + \long\xdef#1{% + \the\sc@toks@a + }% +} +\newcommand\prependto@macro [2] {% + \sc@toks@a={#2}% + \sc@toks@b=\expandafter{#1}% + \edef#1{% + \the\sc@toks@a\the\sc@toks@b + }% +} +\newcommand\g@prependto@macro [2] {% + \sc@toks@a={#2}% + \sc@toks@b=\expandafter{#1}% + \xdef#1{% + \the\sc@toks@a\the\sc@toks@b + }% +} +\newcommand\lg@prependto@macro [2] {% + \sc@toks@a={#2}% + \sc@toks@b=\expandafter{#1}% + \long\xdef#1{% + \the\sc@toks@a\the\sc@toks@b + }% +} +\newcommand\UndefineCS [1] {% args: \csname + \let#1\@undefined +} +\newcommand\UndefineName [1] {% args: csname + \expandafter\let\csname#1\endcsname\@undefined +} +\newcommand\defcommand {% + \@star@or@long\def@command +} +\newcommand\def@command {% + \let\@ifdefinable\@rc@ifdefinable + \new@command +} +\newcommand\DefName {% + \@star@or@long\def@name +} +\newcommand\def@name [3] {% args: arglist csname body + \sc@global\l@ngrel@x\@namedef{#1}#2{#3}% +} +\newcommand\NewName {% + \@star@or@long\new@name +} +\newcommand\new@name [3] {% args: arglist csname body + \@ifundefined{#1} {% + \sc@global\l@ngrel@x\@namedef{#1}#2{#3}% + }{% ELSE + \defcommand\reserved@a {% + #1% + }% + \@notdefinable + }% +} +\newcommand\sc@global {% + \relax +} +\newcommand\Global {% + \def\sc@global {% + \global\let\sc@global\relax\global + }% +} +\newcommand\CheckName {% + \@star@or@long\check@name +} +\newcommand\check@name [3] {% args: arglist csname body + \expandafter\DefName\sc@star@nothing{reserved@a}{#2}{#3}% + \expandafter\@check@eq\csname #1\endcsname\reserved@a +} +\newcommand\RequireName {% + \sc@star@or@long\require@name +} +\newcommand\require@name [3] {% args: arglist csname body + \@ifundefined{#1} {% + \expandafter\DefName\sc@star@nothing{#1}{#2}{#3}% + }{% ELSE + \expandafter \expandafter + \expandafter \CheckName + \expandafter \sc@star@nothing + \csname #1\endcsname + {#2}{#3}% + }% +} +\newcommand\NewTextFontCommand [2] {% args: \csname font-command + \NewRobustCommand#1[1]{% + \ifmmode + \nfss@text{#2##1}% + \else + \leavevmode + {\text@command{##1}% + #2\check@icl ##1\check@icr + \expandafter}% + \fi + }% +} +\newcommand\NewRobustCommand {% + \@star@or@long\new@robustcommand +} +\newcommand\new@robustcommand [1] {% + \let\sc@t@a\relax + \@ifdefinable #1 {% + \def\sc@t@a {% + \new@@robustcommand #1% + }% + }% + \sc@t@a +} +\newcommand\new@@robustcommand [1] {% + \edef\reserved@a {\string#1}% + \def\reserved@b {#1}% + \edef\reserved@b {% + \expandafter\strip@prefix\meaning\reserved@b + }% + \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 +} +\newcommand\Elet {% + \expandafter\let\expandafter +} +\newcommand*\EElet {% + \expandafter\expandafter\expandafter\let\expandafter\expandafter +} +\newcommand\NewUserInfo {% + \sc@star@or@long\new@userinfo +} +\newcommand*\new@userinfo [2][] {% args: [\csname] \csname + \expandafter\ReserveCS\sc@star@nothing{#2}% + \def\sc@t@b {#1}% + \ifx\sc@t@b\ShortEmpty + \edef\sc@t@a {% + \edef\noexpand\sc@t@b{% + \E@cdr\string#2\@nil + }% + }% + \lowercase\expandafter{\sc@t@a}% + \else + \edef\sc@t@b {\E@cdr\string#1\@nil}% + \fi + \edef\sc@t@a {% + \noexpand\NewName\sc@star@nothing{\sc@t@b}{####1} + {\noexpand\renewcommand\sc@star@nothing\noexpand#2{####1}} + }% + \sc@t@a +} +\newcommand\SaveCS [1] {% args: \csname + \expandafter\newlet\csname MDSaved\E@cdr\string#1\@nil\endcsname#1% +} +\newcommand\RestoreCS [1] {% args: \csname + \Elet#1\csname MDSaved\E@cdr\string#1\@nil\endcsname + \UndefineName{MDSaved\E@cdr\string#1\@nil}% +} +\newcommand\SaveName [1] {% args: csname + \ReserveName{MDSaved#1}% + \EElet\csname MDSaved#1\endcsname + \csname #1\endcsname +} +\newcommand\RestoreName [1] {% args: csname + \EElet\csname #1\endcsname + \csname MDSaved#1\endcsname + \UndefineName{MDSaved#1}% +} +\newcommand\eExpand {% + \sc@star@or@long\sc@eExpand +} +\NewName{sc@eExpand} {#1\In#2} {% args: object body + \l@ngrel@x\edef\sc@t@a{#1}% + \expandafter\defcommand\sc@star@nothing\sc@t@b [1] {#2}% + \expandafter \sc@t@b + \expandafter {\sc@t@a}% +} +\newcommand\EExpand {% + \sc@star@or@long\sc@EExpand +} +\NewName{sc@EExpand}{#1\In#2} {% args: object body + \let\sc@t@c\sc@star@nothing + \expandafter \expandafter + \expandafter \defcommand + \expandafter \sc@t@c + \expandafter \sc@t@a + \expandafter {#1}% + \expandafter\defcommand\sc@t@c\sc@t@b [1] {#2}% + \expandafter\sc@t@b + \expandafter{\sc@t@a}% +} +\newcommand\eExecute {% + \sc@star@or@long\sc@eExecute +} +\newcommand\sc@eExecute [1] {% args: body + \l@ngrel@x\edef\sc@t@a {#1}% + \sc@t@a +} +\NewName{E@cdr} {#1\@nil} {% + \expandafter\@cdr #1\@nil +} +\NewName{E@car} {#1\@nil} {% + \expandafter\@car #1\@nil +} +\newlet\Gobble\@gobble +\newlet\GobbleM\@gobble +\newcommand\GobbleO {% + \@ifnextchar [ + \sc@gobbleO + \relax +} +\newlet\GobbleMM\@gobbletwo +\newcommand\GobbleOM {% + \@ifnextchar [ + \sc@gobbleOM + \Gobble +} +\newcommand\GobbleMO [1] {% + \@ifnextchar [ + \sc@gobbleO + \relax +} +\NewName{sc@gobbleOM} {[#1]#2} + {} +\NewName{sc@gobbleO} {[#1]} + {} +\newcommand\DeclareBooleanOptions [2] {% args: on off + \newboolean{@#1@}% + \DeclareOption{#1} {% + \@nameuse{@#1@true} + }% + \DeclareOption{#2} {% + \@nameuse{@#1@false} + }% +} +\newcommand\DeclareBooleanUserOptions [2] {% args: on off + \DeclareBooleanOptions{#1}{#2}% + \ReserveName{#1}% + \ReserveName{#2}% + \EElet \csname#1\endcsname\csname @#1@true\endcsname + \EElet \csname#2\endcsname\csname @#1@false\endcsname +} +\newcommand\ToggleBoolean [1] {% arg: boolean + \csname if#1\endcsname + \sc@global\csname #1false\endcsname + \else + \sc@global\csname #1true\endcsname + \fi +} +\newcommand*\VerboseErrors [1][\@M] {% args: [number] + \c@errorcontextlines #1% + \showboxbreadth #1% + \showboxdepth #1% +} +\newcommand*\GVerboseErrors [1][\@M] {% args: [number] + \global\c@errorcontextlines #1% + \global\showboxbreadth #1% + \global\showboxdepth #1% +} +\ReserveCS\md@maybe@global +\newcommand*\Debug {% + \let\md@maybe@global\relax + \md@debug +} +\newcommand*\GDebug {% + \let\md@maybe@global\global + \md@debug +} +\newcommand*\md@debug [1] {% args: debug-level + \ifnum #1 > 0% + \let\sc@t@a\@M + \md@maybe@global\def\DTypeout ##1{% + \typeout{##1}% + }% + \md@maybe@global\def\DGobbleM ##1{% + \typeout{DGobbleM: [##1]}% + }% + \ifnum #1 > 1% + \md@maybe@global\def\DDTypeout ##1{% + \typeout{##1}% + }% + \ifnum #1 > 2% + \md@maybe@global\def\DDDTypeout ##1{% + \typeout{##1}% + }% + \fi + \fi + \else + \let\sc@t@a\m@ne + \md@maybe@global\let\DTypeout\GobbleM + \md@maybe@global\let\DDTypeout\GobbleM + \md@maybe@global\let\DDDTypeout\GobbleM + \md@maybe@global\let\DGobbleM\GobbleM + \fi + \md@maybe@global\tracingoutput#1 % + \md@maybe@global\tracingpages#1 % + \md@maybe@global\tracingmacros#1 % + \md@maybe@global\tracingcommands#1 % + \ifx\md@maybe@global\relax + \VerboseErrors[\sc@t@a]% + \typeout{++++ Debugging [#1]\on@line}% + \else + \GVerboseErrors[\sc@t@a]% + \typeout{++++ Global debugging [#1]\on@line}% + \fi +} +\newlet\DTypeout\GobbleM +\newlet\DDTypeout\GobbleM +\newlet\DDDTypeout\GobbleM +\newlet\DGobbleM\GobbleM +\newcommand\FrankenWarning [2] {% args: package warning + \GenericWarning % continuation message + {(#1)\@spaces\@spaces\@spaces\@spaces\@spaces} + {Frankenstein (#1) WARNING: #2}% +} +\newcommand\FrankenError [3] {% args: package error-message help-text + \GenericError % args: continuation message where-help what-help + {(#1)\@spaces\@spaces\@spaces\@spaces\@spaces} + {Frankenstein (#1) error: #2} + {See the documenation for the #1 package for more information.} + {#3}% +} +\newcommand\FrankenInfo [2] {% args: package info + \GenericInfo % continuation message + {(#1)\@spaces\@spaces\@spaces\@spaces\@spaces} + {Frankenstein (#1) says: #2}% +} +\endinput +%% +%% End of file `moredefs.stq'. diff --git a/Master/texmf-dist/tex/latex/frankenstein/moredefs.sty b/Master/texmf-dist/tex/latex/frankenstein/moredefs.sty new file mode 100644 index 00000000000..28c26446c3c --- /dev/null +++ b/Master/texmf-dist/tex/latex/frankenstein/moredefs.sty @@ -0,0 +1,1478 @@ +%^^A* legal notices +% \iffalse +% +% This program is part of the Frankenstein bundle for LaTeX. +% +% Copyright 1995-2001 Matt Swift <swift@alum.mit.edu>. +% +% This file contains both the code and documentation for the +% moredefs LaTeX package. It will work ONLY if it is placed in a +% proper directory. Files called README, INSTALL, moredefs.tex +% and moredefs.ins should have also been distributed to you +% with this file. See them for more information on how to typeset +% the documentation with LaTeX and how to generate a version of this +% file that will work faster than this one. +% +% This program is free software; you may redistribute it and/or +% modify it under the conditions of the LaTeX Project Public +% License, either version 1.2 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. +% +% This program is distributed in the hope that it will be useful, +% but without any warranty; without even the implied warranty of +% merchantability or fitness for a particular purpose. See the +% LaTeX Project Public License for more details. +% +% \fi +% +%^^A* checks +% +%^^A NOTE: The character table, with two %'s, will get written to all files. +%% \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 \~} +% +% \CheckSum{793} +% +% \begin{abstract} +% A delightful collection of defining, expansion, and debugging commands that +% make elegant programming in \LaTeX{} fun and easy. +% \end{abstract} +% \tableofcontents +% +% \part{Discussion} +% +% These macros were written in response to practical programming needs. Most +% of the packages I have written, whether distributed or not, depend on this +% package. Using these constructs has saved me a lot of time and made my code +% much more readable---that is, maintainable and improvable. For examples of +% these macros in useful applications, see the packages in the \Frankenstein +% bundle. +% +% \section{Naming conventions} +% +% The convention is that a capital \emph{E} means the macro expands something +% just once. A lowercase \emph{e}, as in \cs\edef, means the macro expands +% something all the way to unexpandable tokens. +% +% The specification \meta{\\csname} means a control sequence with a preceding +% backslash; the specification \meta{csname} means a control sequence without a +% preceding backslash. \meta{csname} arguments are expanded. Commands which +% take \meta{csname} arguments have |Name| in their names. +% +% When I write \word{package} in this documentation, I mean \LaTeX{} package or +% class. +% +% \section{Conditionals} +% +% \DescribeMacro{\@ifundefined@cs} +% \cname{@ifundefined@cs}\marg{\\csname}\marg{true}\marg{false} executes the +% \meta{true} clause if \meta{\\csname} is not defined, and the \meta{else} +% clause otherwise. +% +% \DescribeMacro{\IfElement...\string\In} +% To check whether a token \meta{thingma} is \cs\ifx-equal to any token in a +% list of tokens stored in a macro \meta{list}, use +% \cs\IfElement\meta{thingma}\cs\In\meta{list}\marg{true}\marg{false}. The +% top-level expansion of \meta{list} must be a list of tokens to compare with +% \meta{thingma} with \cs\ifx. If the \meta{thingma} is in the \meta{list}, +% the \meta{true} clause is executed; otherwise, the \meta{false} clause is +% executed. +% +% \section{Defining commands} +% \subsection{\protect\code{*} and no-\protect\code{*} forms} +% The naming convention of most defining commands in the \LaTeX{} kernel and +% in \package{moredefs} is that the no-|*| form of the command is |long| and +% the |*|-form is not |long|. +% +% \subsection{User commands} +% +% \DescribeMacro\InitCS +% \DescribeMacro{\InitCS*} +% \cs\InitCS and \cname{InitCS*} take one argument, \meta{\\csname}, and +% initialize it to |{}|. +% +% \DescribeMacro\InitName +% \DescribeMacro{\InitName*} +% \cs\InitName and \cname{InitName*} are the same but take an argument +% \meta{csname} without a backslash. +% +% \DescribeMacro\ShortEmpty +% \DescribeMacro\LongEmpty +% To make it easier to avoid the problem of comparing |long| and +% non-|long| macros with \cname{ifx}, compare macros with \cs\ShortEmpty +% and \cs\LongEmpty. +% +% \DescribeMacro\ReserveCS +% \DescribeMacro{\ReserveCS*} +% \cs\ReserveCS\marg{\\csname} reserves \meta{\\csname} for the current +% package's use. The variable is also initialized with the \cs\InitCS or +% \cs\InitCS* as appropriate. +% +% \DescribeMacro\ReserveName +% \DescribeMacro{\ReserveName*} +% \cs\ReserveName and \cname{ReserveName*} are the same but take an argument +% \meta{csname} without a backslash. +% +% \DescribeMacro\SaveCS +% \DescribeMacro\RestoreCS +% \cs\SaveCS\marg{\\csname} saves the present value of \meta{\\csname} in a +% macro (\cname{MDSaved}\meta{csname}). The saved value is restored to +% \meta{\\csname} by \cs\RestoreCS\marg{\\csname}. +% +% \DescribeMacro\SaveName +% \DescribeMacro\RestoreName +% \cs\SaveName and \cname{RestoreName} are the same but take an argument +% \meta{csname} without a backslash. +% +% \DescribeMacro\requirecommand +% \DescribeMacro{\requirecommand*} +% \cs\requirecommand takes arguments like \cs\newcommand and behaves like +% \cs\providecommand (defined in the kernel) with the following difference: +% if the control sequence is already defined, \cs\requirecommand calls +% \cs\CheckCommand to make sure that the new and existing definitions are +% identical, whereas \cs\providecommand assumes that if the control sequence +% is already defined, the existing definition is appropriate. +% \cs\requirecommand, like \cs\defcommand, \emph{guarantees} that a control +% sequence will have the given definition, but \cs\requirecommand also warns +% you if there was a previous and different existing definition. +% +% \DescribeMacro\newtokens +% \DescribeMacro\newlet +% \DescribeMacro\newboolean +% \cs\newtokens\marg{\\csname}, \cs\newlet\marg{\\csname}\marg{\\csname}, +% and \cs\newboolean\marg{csname} give an error if their control sequence +% argument is already defined. \cs\newtokens creates a token variable. +% \cs\newlet does a \cs\let assignment. \cs\newboolean\marg{csname} creates +% three new control sequences: two switches, |\csnametrue| and +% |\csnamefalse|, and a test, |\ifcsname|. \cs\newtokens is \emph{not} +% |outer|. Is there any reason this really matters? +% +% \begin{warning} +% Limitation: You can't use \cs\newlet to \cs\let a command sequence +% to a character with a catcode not equal to 10 (space), 11 (letter), 12 +% (other), or 13 (active). For example, you can't say |\newlet\foo#|. +% Also, you cannot use |=| with \cs\newlet like you can with \cs\let. +% \end{warning} +% +% \DescribeMacro\providetokens +% \DescribeMacro\provideboolean +% \DescribeMacro\providesavebox +% \DescribeMacro\providecounter +% \DescribeMacro\providelength +% Like the kernel's \cs\providecommand, the commands +% \cs\providetokens\marg{\\csname}, \cs\provideboolean\marg{csname}, +% \cs\providesavebox\marg{\\csname}, \cs\providecounter\marg{csname}, and +% \cs\providelength\marg{\\csname} will create a new object (or objects) +% based on the name \meta{\\csname} or \meta{csname} only if they are not +% already defined. See the corresponding commands that begin with |\new| +% instead of |\provide| for a description of what kind of object is created. +% In contrast with \cs\providecommand, however, these commands will write a +% record to the log file if their argument was already defined +% (\cs\providecommand does nothing at all in this case). +% +% \DescribeMacro\UndefineCS +% \DescribeMacro\UndefineName +% \cs\UndefineCS\marg{\\csname} causes \meta{\\csname} to be undefined. +% \cs\UndefineName does the same for a \meta{csname}. Use with caution. +% \cs\global works before them. +% +% \DescribeMacro\defcommand +% \DescribeMacro{\defcommand*} +% \cs\defcommand\marg{\\csname}\oarg{\# of args}\oarg{default for an optarg} +% defines \meta{\\csname} in the same manner as \cs\newcommand except no +% warning or error is issued if \meta{\\csname} is already defined. +% +% \cs\defcommand is very similar to the primitive \cs\def, so why would you +% want to use it? For one thing, the syntax is the same as all the other +% \LaTeX{} defining commands, so it is easier to read, and easier to change +% the word \code{defcommand} to one of the other defining commands. Second, +% \cs\defcommand{}s that take arguments have simpler syntax when defining +% commands are nested. You still have to double the |#| characters in the +% definition body, but the argument specification (e.g., |[n]|) is the same +% as if not nested. +% +% There is a performance-syntax tradeoff; I choose to use \cs\defcommand +% whenever the command to be defined is taking an argument. When it does not +% take an argument, there is no difference between \cs\def and \cs\defcommand +% except that \cs\def is faster. +% +% I see very little reason to ever use \cs\renewcommand. It causes an error +% when the control sequence is \emph{not} already defined. Conceivably this +% is useful during development to catch programming mistakes, but much more +% often I find that I don't care whether the control sequence was defined or +% not, and therefore the error \cs\renewcommand might raise is inappropriate +% and a problem. +% +% \DescribeMacro\NewName +% \DescribeMacro{\NewName*} +% \cs\NewName\marg{csname}\marg{template}\marg{body} defines \meta{csname} to +% expand to \meta{body} using a \TeX-style argument \meta{template}, +% e.g. |#1#2\@nil| or simply |#1#2|. +% If \meta{csname} is already defined, an error will be signalled. +% +% \DescribeMacro\DefName +% \DescribeMacro{\DefName*} +% \cs\DefName is like \cs\NewName but no error is signalled if \meta{csname} +% is already defined. +% +% \DescribeMacro\Global +% If the command \cs\Global immediately precedes \cs\NewName, \cs\DefName, or +% \cs\ToggleBoolean, then the definition will be global. +% +% \todo{Get something like \cs\Global going for all the new commands, not +% just \cs\DefName and \cs\NewName.} +% +% \DescribeMacro\CheckName +% \DescribeMacro{\CheckName*} +% \cs\CheckName is like \cs\NewName but instead of defining the control +% sequence, it checks whether the control sequence has the given definition. +% If so, no action is taken; if not, a warning is given. +% +% \DescribeMacro\RequireName +% \DescribeMacro{\RequireName*} +% \cs\RequireName is to \cs\requirecommand as \cs\NewName is to +% \cs\newcommand. The syntax is +% \cs\RequireName\marg{csname}\marg{template}\marg{body}. +% +% \DescribeMacro\NewTextFontCommand +% \DescribeMacro\NewRobustCommand +% \cs\NewTextFontCommand and \cs\NewRobustCommand are just like the kernel's +% \cs\DeclareTextFontCommand and \cs\DeclareRobustCommand, but they signal an +% error instead of just a warning if their first argument is already defined. +% +% \DescribeMacro\Elet +% \DescribeMacro\EElet +% \cs\Elet expands the second token after it once and then \cs\let{}s the +% first token to the second token. \cs\global works before it. \cs\EElet +% expands the two tokens that come after it once each, and then \cs\let{}s +% the first to the second. \cs\global works before it. +% +% \DescribeMacro\NewUserInfo +% \DescribeMacro{\NewUserInfo*} +% \cs\NewUserInfo\oarg{user-cmd}\marg{variable}, where \meta{variable} has +% some capital letters, will define the lowercase version of \meta{variable} +% to be a user command that redefines \meta{variable} to its argument. The +% argument \meta{user-cmd}, if supplied, is used for the user command, +% overriding the default of the lowercased \meta{variable}. +% +% For example, |\NewUserInfo*\Subtitle| defines a user command +% |\subtitle|\marg{text} which does the equivalent of +% |\defcommand\Subtitle{|\meta{text}|}|. +% +% \cs\NewUserInfo uses \cs\ReserveCS to initialize \meta{variable}; +% \cs\NewUserInfo** uses \cs\ReserveCS*. +% +% These have |@| in their names because they are modelled after kernel +% commands. \todo{Sort out naming comventions and write them down.} +% +% \DescribeMacro{\addto@macro} +% \DescribeMacro{\lg@addto@macro} +% \cname{addto@macro}\marg{\\csname}\marg{tokens} adds \meta{tokens} to the +% end of \marg{\\csname}. The redefinition of \marg{\\csname} is local. The +% kernel provides the global equivalent, \cname{g@addto@macro}. +% \cname{lg@addto@macro} is both |long| and global. +% \caveat{These commands won't work with a \meta{\\csname} that takes +% arguments.} +% \begin{todo} +% Probably it would not be too hard to handle that case. Here is how you would +% do it by hand for one example: +% \begin{codeexample} +% % something like: \def\@chapter[#1]#2{...} +% +% \typeout{\meaning\@chapter} +% +% \renewcommand\addto@macro [2] {% +% \sc@toks@a=\expandafter{#1[##1]{##2}#2}% +% \edef#1[##1]##2{% +% \the\sc@toks@a +% }% +% } +% +% \def\doodie#1{bobo \textsc{#1}} +% \tracingonline1 +% +% \Debug2 +% \addto@macro\@chapter {\doodie blorful} +% \Debug0 +% +% \typeout{\meaning\@chapter} +% \end{codeexample} +% \end{todo} +% +% \DescribeMacro{\prependto@macro} +% \DescribeMacro{\g@prependto@macro} +% \DescribeMacro{\lg@prependto@macro} +% \cname{prependto@macro}\marg{\\csname}\marg{tokens} adds \meta{tokens} to +% the beginning of \marg{\\csname}. The redefinition of \marg{\\csname} is +% local. The global equivalent is \cname{g@prependto@macro}. +% \cname{lg@prependto@macro} is both |long| and global. +% +% \section{Controlling expansion} +% +% \DescribeMacro{\EExpand...\string\In} +% \DescribeMacro{\EExpand*...\string\In} +% \DescribeMacro{\eExpand...\string\In} +% \DescribeMacro{\eExpand*...\string\In} +% \DescribeMacro\eExecute +% \DescribeMacro{\eExecute*} +% A common construction is to \cs\edef a scratch variable to something and +% then execute the scratch variable. The \cs\eExecute macro takes a single +% argument, expands it fully, then executes it. +% +% \cs\eExpand\marg{first tokens}\cs\In\marg{second tokens} expands the +% \meta{first tokens} inside \meta{second tokens} wherever |#1| occurs. +% \cs\EExpand expands the first token of \meta{first tokens} only once. +% These commands can nest. +% +% For example, +% \begin{bothexample} +% \def\a {\b} +% \def\b {Hello } +% \def\x {d} +% \eExpand\a worl\x\In {% +% \def\c {This is a good way to avoid lots of noexpands and +% expandafters. #1. And I continue.}% +% \def\x {boogaloo}% \x is already expanded in the def of \c +% \c +% } +% +% \EExpand\a BLOOB\x\In {% +% \def\x{avoid } +% \edef#1{\b world}% BLOOB\x is syntactic sugar +% This is a good way to \x lots of noexpands and +% expandafters. \a BLOOB\x. And I continue.% +% } +% \end{bothexample} +% The two commands expand to the same three sentences. Here is one more +% example, showing (again) how \cs\EExpand expands only the first token of its +% argument only once:: +% \begin{bothexample} +% \def\x{XXX} +% \def\a{AAA\x} +% \def\b{BBB} +% \EExpand\a\b\In{% +% \def\x{xxx} +% \def\a{aaa} +% \def\b{YYY} +% #1 +% } +% \end{bothexample} +% +% \begingroup +% \catcode`\ =11\relax +% \DescribeMacro{\E@car...\string\@nil } +% \DescribeMacro{\E@cdr...\string\@nil } +% \endgroup +% Let $T$ be the sequence of tokens between \cname{E@car} and \cname{@nil}. +% The first token of $T$ is expanded once, and \cs{\E@car...\@nil} +% expands to the first token of the result. +% +% \cname{E@cdr...\@nil} is similar, but expands to the entire result +% \emph{except} its first token. +% +% For example, after +% \begin{codeexample} +% \def\a {Hello} +% \def\b { world} +% \end{codeexample} +% |\E@car \a there\b.\@nil| would expand first of all to +% |H|\@. And |\E@cdr \a there\b.\@nil| would expand first of all to +% |ellothere\b.|, and then eventually expand fully to |ellothere world.|. +% +% The example is more complicated than you would normally use. Usually you +% want to |car| and |cdr| a sequence of tokens contained in macro |\foo|, and +% this is easy enough with |\E@car\foo\@nil|. To chop off the first token of +% |\foo|, |\edef\foo {\E@cdr\foo\@nil}|. (If you're wondering, the space +% after |\foo| is irrelevant.) +% +% \section{Gobbling} +% +% \DescribeMacro{\Gobble} +% \DescribeMacro{\GobbleM} +% \DescribeMacro{\GobbleO} +% \DescribeMacro{\GobbleMM} +% \DescribeMacro{\GobbleMO} +% \DescribeMacro{\GobbleOM} +% It occurs fairly often that you want to gobble things while \cs\makeatother +% is in effect, so these command names have no |@|'s. The |M| stands for a +% mandatory argument, and the |O| stands for an optional argument. For +% example, suppose there is a command |\foo|\oarg{optarg}\marg{marg}. If you +% |\let\foo\GobbleOM|, then the arguments to |\foo| will be gobbled +% appropriately. +% +% \cs\Gobble is the same as \cs\GobbleM, in imitation of the internal +% \cname{@gobble}. +% +% \section{Option declaration} +% +% The follwing two commands may be used in packages before the +% \cs\ProcessOptions command is issued. +% +% \DescribeMacro\DeclareBooleanOptions +% \cs\DeclareBooleanOptions\marg{on}\marg{off} declares a new boolean +% variable |@|\meta{on}|@| and makes it |true| if the option +% \option{\meta{on}} is given to the package, and |false| if the option +% \option{\meta{off}} is given, or if neither is given. I think it is good +% programming style not to rely on the default, always declaring either +% \meta{on} or \meta{off} with an \cs\ExecuteOptions statement. +% +% \DescribeMacro\DeclareBooleanUserOptions +% \cs\DeclareBooleanUserOptions\marg{on}\marg{off} is like +% \cs\DeclareBooleanOptions, but additionally declares two user commands +% \meta{\\on} and \meta{\\off} which are \cs\let to |\@|\meta{on}|@true| and +% |\@|\meta{off}|@false|, respectively. Use this command when it is sensible +% to change the status of the option after the package has been loaded. +% +% \section{Toggle a boolean} +% +% \DescribeMacro\ToggleBoolean +% \cs\ToggleBoolean\marg{boolean} changes the state of \meta{boolean} from +% |false| to |true| or vice versa. The argument \meta{boolean} should not +% include an initial |if| or final |true| or |false|. The redefinition is +% local unless \cs\Global precedes \cs\ToggleBoolean. +% +% \section{Debugging} +% +% \DescribeMacro\VerboseErrors +% \LaTeX{} by default gives very little context for errors. +% \cs\VerboseErrors\oarg{number} causes \LaTeX{} to give \meta{number} lines +% of context, or the maximum by default. +% +% \DescribeMacro\GVerboseErrors +% Like \cs\VerboseErrors but effective globally. +% +% \DescribeMacro\Debug +% \cs\Debug\marg{number} sets a debugging parameter to \meta{number}. I have +% plans to turn this into a bitwise parameter like many C programs, but right +% now the behavior is to issue a message with \cs\typeout, call +% \cs\VerboseErrors, and use the parameter to assign values to +% \cs\tracingoutput, \cs\tracingpages, \cs\tracingmacros, and +% \cs\tracingcommands. +% +% \DescribeMacro\GDebug +% \cs\GDebug\marg{number} is as \cs\Debug but its assignments are +% \cs\global. +% +% \DescribeMacro\DTypeout +% \DescribeMacro\DDTypeout +% \DescribeMacro\DDDTypeout +% \cs\DTypeout expands to \cs\typeout when \cs\Debug is 1 or greater, and +% \cs\GobbleM otherwise. \cs\DDTypeout is \cs\GobbleM unless \cs\Debug is 2 +% or greater; \cs\DDDTypeout is \cs\GobbleM unless \cs\Debug is 3 or greater. +% +% \DescribeMacro\DGobbleM +% Like \cs\GobbleM but when \cs\Debug is 1 or greater, tells you what it's +% gobbling with a \cs\typeout. +% +% \DescribeMacro\FrankenError +% \DescribeMacro\FrankenWarning +% \DescribeMacro\FrankenInfo +% The commands \cs\FrankenError, \cs\FrankenWarning, and \cs\FrankenInfo are +% defined here for use by other \Frankenstein packages and classes. They are +% simply wrappers for the obvious kernel commands (i.e., substitute +% ``Generic'' for ``Franken''). +% +% \StopEventually{} +% +% \part{Implementation} +% +% \section{Version control} +% +% \begin{macro}{\fileinfo} +% \begin{macro}{\DoXUsepackagE} +% \begin{macro}{\HaveECitationS} +% \begin{macro}{\fileversion} +% \begin{macro}{\filedate} +% \begin{macro}{\docdate} +% \begin{macro}{\PPOptArg} +% These definitions must be the first ones in the file. +% \begin{macrocode} +\def\fileinfo{more defining commands (Frankenstein's brain)} +\def\DoXPackageS {} +\def\fileversion{v1.8} +\def\filedate{2001/08/31} +\def\docdate{2001/08/31} +\edef\PPOptArg {% + \filedate\space \fileversion\space \fileinfo +} +% \end{macrocode} +% \end{macro} +% \end{macro} +% \end{macro} +% \end{macro} +% \end{macro} +% \end{macro} +% \end{macro} +% +% If we're loading this file from a \cs\ProcessDTXFile command (see the +% \package{compsci} package), then \cs\JusTLoaDInformatioN will be defined; +% othewise we assume it is not (that's why the FunkY NamE). +% +% If we're loading from \cs\ProcessDTXFile, we want to load the packages listed +% in \cs\DoXPackageS (needed to typeset the documentation for this file) and +% then bail out. Otherwise, we're using this file in a normal way as a +% package, so do nothing. \cs\DoXPackageS, if there are any, are declared in +% the \ext{dtx} file, and, if you're reading the typeset documentation of this +% package, would appear just above. (It's OK to call \cs\usepackage with an +% empty argument or \cs\relax, by the way.) +% \begin{macrocode} +\makeatletter% A special comment to help create bst files. Don't change! +\@ifundefined{JusTLoaDInformatioN} {% + }{% ELSE (we know the compsci package is already loaded, too) + \UndefineCS\JusTLoaDInformatioN + \SaveDoXVarS + \eExpand\csname DoXPackageS\endcsname\In {%use \csname in case it's undefined + \usepackage{#1}% + }% + \RestoreDoXVarS + \makeatother + \endinput +}% A special comment to help create bst files. Don't change! +% \end{macrocode} +% +% Now we check for \LaTeX2e and declare the LaTeX package. +% \begin{macrocode} +\NeedsTeXFormat{LaTeX2e} +\ProvidesPackage{moredefs}[\PPOptArg] +% \end{macrocode}^^A special comment to help create bst files. Don't change! +% +% ^^A NOTE: We have to compensate for the above backslashes, which are not +% ^^A actually in the .dtx file the author works on, by adding to the +% ^^A CheckSum. +%% +% \AddToCheckSum{17}^^A `dtx-update-checksum' automatically handles this. +% \AddToCheckSum{7}^^A The half a macrocode env. at the top is missed, however... +% \AddToCheckSum{10}^^A ... and so are the 5 \defs from the .dtx file +% ^^A that precede it. +% \IfCitations {% +% \AddToCheckSum{2}^^A When \initelyHavECitationS is defined in +% } ^^A the .dtx file, we need 2 more in the CheckSum. +% +% +% \section{Conditionals} +% We start with the conditionals section because we want to use +% \cname{@ifundefined@cs} in this package to make some of the subsequent +% definitions easier to read. +% +% \begin{macro}{\@ifundefined@cs} +% \mbox{} +% \begin{macrocode} +\newcommand*\@ifundefined@cs [1] {% + \edef\reserved@a{% + \expandafter\@gobble\string #1% + }% + \@ifundefined\reserved@a + \@firstoftwo + \@secondoftwo +} +% \end{macrocode} +% \end{macro} +% +% \begin{macro}{\IfElement...\In} +% \mbox{} +% \begin{macrocode} +\newcommand\IfElement{} +\def\IfElement #1\In#2{% + \@tempswafalse + \expandafter \@tfor + \expandafter \sc@t@a + \expandafter :% + \expandafter =#2\do {% + \ifx #1\sc@t@a +% \DTypeout{[\meaning #1] matches element [\meaning\sc@t@a] +% in [\string#2].}% + \@tempswatrue + \@break@tfor + \else +% \DTypeout{[\meaning #1] matches NO elements in [\string #2].}% + \fi + }% + \if@tempswa + \expandafter\@firstoftwo + \else + \expandafter\@secondoftwo + \fi +} +% \end{macrocode} +% \end{macro} +% +% \section{Defining commands} +% +% \begin{macro}{\sc@star@or@long} +% \begin{macro}{\sc@star@nothing} +% The macros \cname{sc@star@or@long} and \cname{sc@star@nothing} are parallel +% to the kernel's \cname{@star@or@long} and \cname{l@ngrel@x}, which control +% whether definitions are |long| or not. \cname{sc@star@or@long} causes the +% value of \cname{sc@star@nothing} to be either |*| or empty, depending on +% whether it finds a |*| when it is called. It also sets the kernel's +% \cname{l@ngrel@x} to nothing or \cs\long, respectively. (We need both +% flags at least once.) +% \begin{macrocode} +\newcommand*\sc@star@nothing{} +\newcommand*\sc@star@or@long [1] {% args: defining-command + \@ifstar {% + \let\l@ngrel@x\relax + \def\sc@star@nothing {*}% + #1% + }{% ELSE + \let\l@ngrel@x\long + \def\sc@star@nothing {}% + #1% + }% +} +% \end{macrocode} +% \end{macro} +% \end{macro} +% +% \begin{macro}{\md@check@star} +% Looks for a star with \cname{@ifstar} and sets \cname{sc@star@nothing} to +% |*| if there is a star and \cs\ShortEmpty if not. +% \begin{macrocode} +\newcommand\md@check@star {% + \@ifstar {% + \def\sc@star@nothing {*}% + }{% ELSE + \let\sc@star@nothing \ShortEmpty + }% +} +% \end{macrocode} +% \end{macro} +% +% \begin{macro}{\requirecommand} +% \begin{macro}{\requirecommand*} +% \begin{macro}{\require@command} +% A typical application of the star mechanisms is \cs\requirecommand. +% \begin{macrocode} +\newcommand\requirecommand {% + \sc@star@or@long\require@command +} +\newcommand\require@command [1] {% args: \csname + \@ifundefined@cs{#1} {% + \expandafter\newcommand\sc@star@nothing + }{% ELSE + \expandafter\CheckCommand\sc@star@nothing + }% + {#1}% +} +% \end{macrocode} +% \end{macro} +% \end{macro} +% \end{macro} +% +% \begin{macro}{\InitCS} +% \begin{macro}{\InitCS*} +% \begin{macro}{\InitName} +% \begin{macro}{\InitName*} +% \begin{macro}{\ReserveCS} +% \begin{macro}{\ReserveCS*} +% \begin{macro}{\ReserveName} +% \begin{macro}{\ReserveName*} +% \begin{macro}{\ShortEmpty} +% \begin{macro}{\LongEmpty} +% \mbox{} +% \begin{macrocode} +\newcommand\InitCS {% + \@star@or@long\Init@CS +} +\newcommand\Init@CS [1] {% args: \csname + \l@ngrel@x\def#1{}% +} +\newcommand\InitName {% + \sc@star@or@long\Init@Name +} +\newcommand\Init@Name [1] {% args: csname + \expandafter\DefName\sc@star@nothing{#1}{}{}% +} +\newcommand\ReserveCS {% + \sc@star@or@long\Reserve@CS +} +\newcommand\Reserve@CS [1] {% args: \csname + \expandafter\newcommand\sc@star@nothing{#1} {}% +} +\newcommand\ReserveName {% + \sc@star@or@long\Reserve@Name +} +\newcommand\Reserve@Name [1] {% args: csname + \expandafter\NewName\sc@star@nothing{#1}{} {}% +} +\InitCS*\ShortEmpty +\InitCS\LongEmpty +% \end{macrocode} +% \end{macro} +% \end{macro} +% \end{macro} +% \end{macro} +% \end{macro} +% \end{macro} +% \end{macro} +% \end{macro} +% \end{macro} +% \end{macro} +% +% \begin{macro}{\sc@t@a} +% \begin{macro}{\sc@t@b} +% \begin{macro}{\sc@t@c} +% \begin{macro}{\sc@t@d} +% \begin{macro}{\sc@t@e} +% \begin{macro}{\sc@t@f} +% \begin{macro}{\sc@t@g} +% Scratch variables. ^^A FIX +% \begin{macrocode} +\ReserveCS\sc@t@a +\ReserveCS\sc@t@b +\ReserveCS\sc@t@c +\ReserveCS\sc@t@d +\ReserveCS\sc@t@e +\ReserveCS\sc@t@f +\ReserveCS\sc@t@g +% \end{macrocode} +% \end{macro} +% \end{macro} +% \end{macro} +% \end{macro} +% \end{macro} +% \end{macro} +% \end{macro} +% +% \begin{macro}{\newtokens} +% \begin{macro}{\newlet} +% Because \cs\newtoks is \cs\outer, we have to fool \cs\def into allowing it +% to be in its argument by using \cname{@nameuse}. +% \begin{macrocode} +\newcommand\newtokens [1] {% args: \csname + \@ifdefinable #1 {% + \@nameuse{newtoks}#1% + }% +} +\newcommand*\newlet [2] {% args: \csname-a \csname-b + \@ifdefinable #1 {% + \let #1#2% + }% +} +% \end{macrocode} +% \end{macro} +% \end{macro} +% +% \begin{macro}{\providetokens} +% \begin{macro}{\providelength} +% \begin{macro}{\providesavebox} +% \begin{macro}{\providecounter} +% \begin{macro}{\newboolean} +% \begin{macro}{\provideboolean} +% The \cs\newboolean command is the same as the one in the \package{ifthen} +% package; so that package won't clash with this one. Isn't +% \cs\requirecommand nice? +% \begin{macrocode} +\newcommand*\providetokens [1] {% args: \csname + \@ifundefined@cs{#1} {% + \@nameuse{newtokens}#1% + }{% ELSE + \FrankenInfo{moredefs}{\protect\providetokens\space is not reallocating + token variable \protect#1.\MessageBreak + The existing contents are [\the#1]}% + }% +} +\newcommand*\providelength [1] {% args: \csname + \@ifundefined@cs{#1} {% + \newlength{#1}% + }{% ELSE + \FrankenInfo{moredefs}{\protect\providelength\space is not reallocating + \protect#1.\MessageBreak + The existing value is [\the#1]}% + }% +} +\newcommand*\providesavebox [1] {% args: \csname + \@ifundefined@cs{#1} {% + \newsavebox{#1}% + }{% ELSE + \FrankenInfo{moredefs}{\protect\providesavebox\space is not reallocating + box \protect#1.}% + }% +} +\newcommand*\providecounter [1] {% args: string + \@ifundefined{c@#1} {% + \newcounter{#1}% + }{% ELSE + \FrankenInfo{moredefs}{\protect\providecounter\space is not reallocating + counter #1.\MessageBreak + The existing value is [\expandafter\number\csname c@#1\endcsname]}% + }% +} +% \end{macrocode} +% The following definition follows the one in the \package{ifthen} package: +% \begin{macrocode} + +% \ProvidesPackage{ifthen} +% [1999/01/07 v1.1a Standard LaTeX ifthen package (DPC)] + +\requirecommand*\newboolean [1] {% args: string + \expandafter + \@ifdefinable\csname if#1\endcsname {% + \expandafter\newif\csname if#1\endcsname + }% +} + +% old def of \cs\newboolean I had before 15 Feb 00: +% \csname newif\expandafter\endcsname\csname if#1\endcsname +% \end{macrocode} +% Notice that \cs\defcommand is not defined yet. +% +% If the \package{ifthen} package is loaded \emph{either} before or +% after this package, the \cs\provideboolean command will be the one defined in +% \package{ifthen}. Otherwise, it will be the one defined here. +% +% There are two minor differences between this definition and the one in the +% \package{ifthen} package: (1) my command will barf on undefined but +% ``undefinable'' commands, e.g., ones that begin with \cs\end, which \LaTeX{} +% reserves; (2) my command writes an informational message to the log file when +% the boolean variable is already defined. I'm not sure how useful the +% informational message is, but the first difference should I think also be in +% the \package{ifthen} package, so \todo{I'm putting it on my list to write the +% \LaTeX{} team requesting this change.} +% \begin{macrocode} +\@ifpackageloaded{ifthen} {% + }{% ELSE + \requirecommand*\provideboolean [1] {% args: string + \@ifundefined {if#1} {% + \newboolean{#1}% + }{% ELSE + \FrankenInfo{moredefs}{\protect\provideboolean\space is not reallocating + \protect#1.\MessageBreak + The value is [\@nameuse{if#1}TRUE\else FALSE\fi]}% + }% + }% +} +% \end{macrocode} +% The following definition is what's in the \package{ifthen} package, for +% reference. +% \begin{macrocode} +% \requirecommand*\provideboolean [1] {% args: string +% \@ifundefined{if#1}{% +% \expandafter +% \newif\csname if#1\endcsname}\relax +% } +% \end{macrocode} +% \end{macro} +% \end{macro} +% \end{macro} +% \end{macro} +% \end{macro} +% \end{macro} +% +% \begin{macro}{\sc@toks@a} +% \begin{macro}{\sc@toks@b} +% \begin{macro}{\addto@macro} +% \begin{macro}{\lg@addto@macro} +% \begin{macro}{\prependto@macro} +% \begin{macro}{\g@prependto@macro} +% \begin{macro}{\lg@prependto@macro} +% There are still missing a couple of the permutations, but I won't add them +% until I need them. You can add them yourself in the configuration file +% \file{moredefs.cfg}. +% \begin{macrocode} +\newtokens\sc@toks@a +\newtokens\sc@toks@b + +\newcommand\addto@macro [2] {% + \sc@toks@a=\expandafter{#1#2}% + \edef#1{% + \the\sc@toks@a + }% +} +\newcommand\lg@addto@macro [2] {% + \sc@toks@a=\expandafter{#1#2}% + \long\xdef#1{% + \the\sc@toks@a + }% +} +\newcommand\prependto@macro [2] {% + \sc@toks@a={#2}% + \sc@toks@b=\expandafter{#1}% + \edef#1{% + \the\sc@toks@a\the\sc@toks@b + }% +} +\newcommand\g@prependto@macro [2] {% + \sc@toks@a={#2}% + \sc@toks@b=\expandafter{#1}% + \xdef#1{% + \the\sc@toks@a\the\sc@toks@b + }% +} +\newcommand\lg@prependto@macro [2] {% + \sc@toks@a={#2}% + \sc@toks@b=\expandafter{#1}% + \long\xdef#1{% + \the\sc@toks@a\the\sc@toks@b + }% +} +% \end{macrocode} +% \end{macro} +% \end{macro} +% \end{macro} +% \end{macro} +% \end{macro} +% \end{macro} +% \end{macro} +% +% \begin{macro}{\UndefineCS} +% \begin{macro}{\UndefineName} +% \cs\global works before them. +% \begin{macrocode} +\newcommand\UndefineCS [1] {% args: \csname + \let#1\@undefined +} +\newcommand\UndefineName [1] {% args: csname + \expandafter\let\csname#1\endcsname\@undefined +} +% \end{macrocode} +% \end{macro} +% \end{macro} +% +% \begin{macro}{\defcommand} +% \begin{macro}{\defcommand*} +% \begin{macro}{\def@command} +% See the user documentation for a discussion of when to use this insteae of \cs\def. +% \begin{macrocode} +\newcommand\defcommand {% + \@star@or@long\def@command +} +\newcommand\def@command {% + \let\@ifdefinable\@rc@ifdefinable + \new@command +} +% \end{macrocode} +% \end{macro} +% \end{macro} +% \end{macro} +% +% \begin{macro}{\DefName} +% \begin{macro}{\DefName*} +% \begin{macro}{\def@name} +% \begin{macro}{\NewName} +% \begin{macro}{\NewName*} +% \begin{macro}{\new@name} +% \begin{macro}{\Global} +% \begin{macro}{\sc@global} +% \cs\Global works before \cs\DefName, \cs\NewName, and \cs\ToggleBoolean +% only! +% \begin{macrocode} +\newcommand\DefName {% + \@star@or@long\def@name +} +\newcommand\def@name [3] {% args: arglist csname body + \sc@global\l@ngrel@x\@namedef{#1}#2{#3}% +} +\newcommand\NewName {% + \@star@or@long\new@name +} +\newcommand\new@name [3] {% args: arglist csname body + \@ifundefined{#1} {% + \sc@global\l@ngrel@x\@namedef{#1}#2{#3}% + }{% ELSE + \defcommand\reserved@a {% + #1% + }% + \@notdefinable + }% +} +\newcommand\sc@global {% + \relax +} +\newcommand\Global {% + \def\sc@global {% + \global\let\sc@global\relax\global + }% +} +% \end{macrocode} +% \end{macro} +% \end{macro} +% \end{macro} +% \end{macro} +% \end{macro} +% \end{macro} +% \end{macro} +% \end{macro} +% +% \begin{macro}{\CheckName} +% \begin{macro}{\CheckName*} +% \begin{macro}{\check@name} +% \begin{macro}{\RequireName} +% \begin{macro}{\RequireName*} +% \begin{macro}{\require@name} +% \mbox{} +% \begin{macrocode} +\newcommand\CheckName {% + \@star@or@long\check@name +} +\newcommand\check@name [3] {% args: arglist csname body + \expandafter\DefName\sc@star@nothing{reserved@a}{#2}{#3}% + \expandafter\@check@eq\csname #1\endcsname\reserved@a +} +\newcommand\RequireName {% + \sc@star@or@long\require@name +} +\newcommand\require@name [3] {% args: arglist csname body + \@ifundefined{#1} {% + \expandafter\DefName\sc@star@nothing{#1}{#2}{#3}% + }{% ELSE + \expandafter \expandafter + \expandafter \CheckName + \expandafter \sc@star@nothing + \csname #1\endcsname + {#2}{#3}% + }% +} +% \end{macrocode} +% \end{macro} +% \end{macro} +% \end{macro} +% \end{macro} +% \end{macro} +% \end{macro} +% +% \begin{macro}{\NewTextFontCommand} +% \begin{macro}{\NewRobustCommand} +% \begin{macro}{\new@robustcommand} +% \begin{macro}{\new@@robustcommand} +% \mbox{} +% \begin{macrocode} +\newcommand\NewTextFontCommand [2] {% args: \csname font-command + \NewRobustCommand#1[1]{% + \ifmmode + \nfss@text{#2##1}% + \else + \leavevmode + {\text@command{##1}% + #2\check@icl ##1\check@icr + \expandafter}% + \fi + }% +} +\newcommand\NewRobustCommand {% + \@star@or@long\new@robustcommand +} +% \end{macrocode} +% We need a second level here because otherwise the \cs\fi that closes +% \cname{@ifdefinable} will become the definition of the closing +% \cname{new@command}. We could use a chain of \cs\expandafter{}s but that +% would be confusing. +% \begin{macrocode} +\newcommand\new@robustcommand [1] {% + \let\sc@t@a\relax + \@ifdefinable #1 {% + \def\sc@t@a {% + \new@@robustcommand #1% + }% + }% + \sc@t@a +} +\newcommand\new@@robustcommand [1] {% + \edef\reserved@a {\string#1}% + \def\reserved@b {#1}% + \edef\reserved@b {% + \expandafter\strip@prefix\meaning\reserved@b + }% + \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} +% \end{macro} +% \end{macro} +% +% \begin{macro}{\Elet} +% \mbox{} +% \begin{macrocode} +\newcommand\Elet {% + \expandafter\let\expandafter +} +% \end{macrocode} +% \end{macro} +% +% \begin{macro}{\EElet} +% \mbox{} +% \begin{macrocode} +\newcommand*\EElet {% + \expandafter\expandafter\expandafter\let\expandafter\expandafter +} +% \end{macrocode} +% \end{macro} +% +% \begin{macro}{\NewUserInfo} +% \begin{macro}{\NewUserInfo*} +% \begin{macro}{\new@userinfo} +% Using \cs\lowercase in this macro is tricky, since it gets expanded only in +% \TeX's stomach. +% \begin{macrocode} +\newcommand\NewUserInfo {% + \sc@star@or@long\new@userinfo +} +\newcommand*\new@userinfo [2][] {% args: [\csname] \csname + \expandafter\ReserveCS\sc@star@nothing{#2}% + \def\sc@t@b {#1}% +% \end{macrocode} +% If we were not given the optional user-cmd, define scratch |b| to be a +% lowercase version of the variable, without the backslash. Otherwise use the +% user-cmd given, without the backslash. +% \begin{macrocode} + \ifx\sc@t@b\ShortEmpty + \edef\sc@t@a {% + \edef\noexpand\sc@t@b{% + \E@cdr\string#2\@nil + }% + }% + \lowercase\expandafter{\sc@t@a}% + \else + \edef\sc@t@b {\E@cdr\string#1\@nil}% + \fi +% \end{macrocode} +% Now define the user-cmd to be a redefinition of the variable. +% \begin{macrocode} + \edef\sc@t@a {% + \noexpand\NewName\sc@star@nothing{\sc@t@b}{####1} + {\noexpand\renewcommand\sc@star@nothing\noexpand#2{####1}} + }% + \sc@t@a +} +% \end{macrocode} +% \end{macro} +% \end{macro} +% \end{macro} +% +% \begin{macro}{\SaveCS} +% \begin{macro}{\RestoreCS} +% \begin{macro}{\SaveName} +% \begin{macro}{\RestoreName} +% \mbox{} +% \begin{macrocode} +\newcommand\SaveCS [1] {% args: \csname + \expandafter\newlet\csname MDSaved\E@cdr\string#1\@nil\endcsname#1% +} +\newcommand\RestoreCS [1] {% args: \csname + \Elet#1\csname MDSaved\E@cdr\string#1\@nil\endcsname + \UndefineName{MDSaved\E@cdr\string#1\@nil}% +} +\newcommand\SaveName [1] {% args: csname + \ReserveName{MDSaved#1}% + \EElet\csname MDSaved#1\endcsname + \csname #1\endcsname +} +\newcommand\RestoreName [1] {% args: csname + \EElet\csname #1\endcsname + \csname MDSaved#1\endcsname + \UndefineName{MDSaved#1}% +} +% \end{macrocode} +% \end{macro} +% \end{macro} +% \end{macro} +% \end{macro} +% +% \section{Controlling expansion} +% +% \begin{macro}{\EExpand...\In} +% \begin{macro}{\EExpand*...\In} +% \begin{macro}{\sc@EExpand} +% \begin{macro}{\eExpand...\In} +% \begin{macro}{\eExpand*...\In} +% \begin{macro}{\sc@eExpand} +% \begin{macro}{\eExecute} +% \begin{macro}{\eExecute*} +% \begin{macro}{\sc@eExecute} +% Uses \cname{sc@t@a}, \cname{sc@t@b}, \cname{sc@t@c}. +% \begin{macrocode} +\newcommand\eExpand {% + \sc@star@or@long\sc@eExpand +} +\NewName{sc@eExpand} {#1\In#2} {% args: object body + \l@ngrel@x\edef\sc@t@a{#1}% + \expandafter\defcommand\sc@star@nothing\sc@t@b [1] {#2}% + \expandafter \sc@t@b + \expandafter {\sc@t@a}% +} +\newcommand\EExpand {% + \sc@star@or@long\sc@EExpand +} +% \end{macrocode} +% When this is |short|, both the two args are |short|. \cname{sc@star@nothing} +% gets reset by the first \cs\defcommand, so we save it in \cname{sc@t@c}. +% \begin{macrocode} +\NewName{sc@EExpand}{#1\In#2} {% args: object body + \let\sc@t@c\sc@star@nothing + \expandafter \expandafter + \expandafter \defcommand + \expandafter \sc@t@c + \expandafter \sc@t@a + \expandafter {#1}% + \expandafter\defcommand\sc@t@c\sc@t@b [1] {#2}% + \expandafter\sc@t@b + \expandafter{\sc@t@a}% +} +\newcommand\eExecute {% + \sc@star@or@long\sc@eExecute +} +\newcommand\sc@eExecute [1] {% args: body + \l@ngrel@x\edef\sc@t@a {#1}% + \sc@t@a +} +% \end{macrocode} +% \end{macro} +% \end{macro} +% \end{macro} +% \end{macro} +% \end{macro} +% \end{macro} +% \end{macro} +% \end{macro} +% \end{macro} +% +% \begin{macro}{\E@car} +% \begin{macro}{\E@cdr} +% \mbox{} +% \begin{macrocode} +\NewName{E@cdr} {#1\@nil} {% + \expandafter\@cdr #1\@nil +} +\NewName{E@car} {#1\@nil} {% + \expandafter\@car #1\@nil +} +% \end{macrocode} +% \end{macro} +% \end{macro} +% +% \section{Gobbling} +% +% \begin{macro}{\Gobble} +% \begin{macro}{\GobbleM} +% \begin{macro}{\GobbleO} +% \begin{macro}{\GobbleMM} +% \begin{macro}{\GobbleMO} +% \begin{macro}{\GobbleOM} +% \begin{macro}{\sc@gobbleO} +% \begin{macro}{\sc@gobbleOM} +% \textsf{M} for mandatory arg, i.e., one token. \textsf{O} for optional arg, +% i.e., a square-brace pair. +% \begin{macrocode} +\newlet\Gobble\@gobble +\newlet\GobbleM\@gobble +\newcommand\GobbleO {% + \@ifnextchar [ + \sc@gobbleO + \relax +} +\newlet\GobbleMM\@gobbletwo +\newcommand\GobbleOM {% + \@ifnextchar [ + \sc@gobbleOM + \Gobble +} +\newcommand\GobbleMO [1] {% + \@ifnextchar [ + \sc@gobbleO + \relax +} +\NewName{sc@gobbleOM} {[#1]#2} + {} +\NewName{sc@gobbleO} {[#1]} + {} +% \end{macrocode} +% \end{macro} +% \end{macro} +% \end{macro} +% \end{macro} +% \end{macro} +% \end{macro} +% \end{macro} +% \end{macro} +% +% \section{Option declaration} +% +% \begin{macro}{\DeclareBooleanOptions} +% \begin{macro}{\DeclareBooleanUserOptions} +% \mbox{} +% \begin{macrocode} +\newcommand\DeclareBooleanOptions [2] {% args: on off + \newboolean{@#1@}% + \DeclareOption{#1} {% + \@nameuse{@#1@true} + }% + \DeclareOption{#2} {% + \@nameuse{@#1@false} + }% +} +\newcommand\DeclareBooleanUserOptions [2] {% args: on off + \DeclareBooleanOptions{#1}{#2}% + \ReserveName{#1}% + \ReserveName{#2}% + \EElet \csname#1\endcsname\csname @#1@true\endcsname + \EElet \csname#2\endcsname\csname @#1@false\endcsname +} +% \end{macrocode} +% \end{macro} +% \end{macro} +% +% \section{Toggle a boolean} +% +% \begin{macro}{\ToggleBoolean} +% \mbox{} +% \begin{macrocode} +\newcommand\ToggleBoolean [1] {% arg: boolean + \csname if#1\endcsname + \sc@global\csname #1false\endcsname + \else + \sc@global\csname #1true\endcsname + \fi +} +% \end{macrocode} +% \end{macro} +% +% \section{Debugging} +% +% \begin{macro}{\VerboseErrors} +% \begin{macro}{\GVerboseErrors} +% We do not use \cs\setcounter but rather set these counters locally. +% \begin{macrocode} +\newcommand*\VerboseErrors [1][\@M] {% args: [number] + \c@errorcontextlines #1% + \showboxbreadth #1% + \showboxdepth #1% +} +\newcommand*\GVerboseErrors [1][\@M] {% args: [number] + \global\c@errorcontextlines #1% + \global\showboxbreadth #1% + \global\showboxdepth #1% +} +% \end{macrocode} +% \end{macro} +% \end{macro} +% +% \begin{macro}{\Debug} +% \begin{macro}{\GDebug} +% \begin{macro}{\md@maybe@global} +% Set \cs\debug to 0, 1, or~2. ^^A remember \cs\showlists +% \begin{macrocode} +\ReserveCS\md@maybe@global +\newcommand*\Debug {% + \let\md@maybe@global\relax + \md@debug +} +\newcommand*\GDebug {% + \let\md@maybe@global\global + \md@debug +} +\newcommand*\md@debug [1] {% args: debug-level + \ifnum #1 > 0% + \let\sc@t@a\@M + \md@maybe@global\def\DTypeout ##1{% + \typeout{##1}% + }% + \md@maybe@global\def\DGobbleM ##1{% + \typeout{DGobbleM: [##1]}% + }% + \ifnum #1 > 1% + \md@maybe@global\def\DDTypeout ##1{% + \typeout{##1}% + }% + \ifnum #1 > 2% + \md@maybe@global\def\DDDTypeout ##1{% + \typeout{##1}% + }% + \fi + \fi + \else + \let\sc@t@a\m@ne + \md@maybe@global\let\DTypeout\GobbleM + \md@maybe@global\let\DDTypeout\GobbleM + \md@maybe@global\let\DDDTypeout\GobbleM + \md@maybe@global\let\DGobbleM\GobbleM + \fi + \md@maybe@global\tracingoutput#1 % + \md@maybe@global\tracingpages#1 % + \md@maybe@global\tracingmacros#1 % + \md@maybe@global\tracingcommands#1 % + \ifx\md@maybe@global\relax + \VerboseErrors[\sc@t@a]% + \typeout{++++ Debugging [#1]\on@line}% + \else + \GVerboseErrors[\sc@t@a]% + \typeout{++++ Global debugging [#1]\on@line}% + \fi +} +% \end{macrocode} +% \end{macro} +% \end{macro} +% \end{macro} +% +% \begin{macro}{\DTypeout} +% \begin{macro}{\DTypeout} +% \begin{macro}{\DTypeout} +% \begin{macro}{\DGobbleM} +% When the debugging parameter is not set, these commands gobble their +% argument. \todo{Streamline dox about ``debugging parameter''; should be +% something checkable, no?} +% \begin{macrocode} +\newlet\DTypeout\GobbleM +\newlet\DDTypeout\GobbleM +\newlet\DDDTypeout\GobbleM +\newlet\DGobbleM\GobbleM +% \end{macrocode} +% \end{macro} +% \end{macro} +% \end{macro} +% \end{macro} +% +% \begin{macro}{\FrankenError} +% \begin{macro}{\FrankenWarning} +% \begin{macro}{\FrankenInfo} +% \mbox{} +% \begin{macrocode} +\newcommand\FrankenWarning [2] {% args: package warning + \GenericWarning % continuation message + {(#1)\@spaces\@spaces\@spaces\@spaces\@spaces} + {Frankenstein (#1) WARNING: #2}% +} +\newcommand\FrankenError [3] {% args: package error-message help-text + \GenericError % args: continuation message where-help what-help + {(#1)\@spaces\@spaces\@spaces\@spaces\@spaces} + {Frankenstein (#1) error: #2} + {See the documenation for the #1 package for more information.} + {#3}% +} +\newcommand\FrankenInfo [2] {% args: package info + \GenericInfo % continuation message + {(#1)\@spaces\@spaces\@spaces\@spaces\@spaces} + {Frankenstein (#1) says: #2}% +} +% \end{macrocode} +% \end{macro} +% \end{macro} +% \end{macro} +% +% \Finale diff --git a/Master/texmf-dist/tex/latex/frankenstein/newclude.stq b/Master/texmf-dist/tex/latex/frankenstein/newclude.stq new file mode 100644 index 00000000000..071ce7f85f5 --- /dev/null +++ b/Master/texmf-dist/tex/latex/frankenstein/newclude.stq @@ -0,0 +1,223 @@ +%% +%% This is file `newclude.stq', +%% generated with the docstrip utility. +%% +%% The original source files were: +%% +%% newclude.sty +%% +%% This program is part of the Frankenstein bundle for LaTeX. +%% +%% Copyright (C) 1995-2001 Matthew Swift <swift@alum.mit.edu> +%% +%% This file may have one of TWO names, either +%% newclude.sty or newclude.stq. This +%% LaTeX package will work ONLY if it is called newclude.sty +%% and placed in a proper directory. This file should have been +%% distributed to you with a DIFFERENT file (also) called +%% newclude.sty which functions identically to this one +%% but contains documentation in comments. This file works faster, +%% but the other should be kept because it contains the documentation +%% for this LaTeX package. Files called README and INSTALL should have +%% also been distributed to you with this file; see them for more +%% information. +%% +%% This program is free software; you may redistribute it and/or +%% modify it under the conditions of the LaTeX Project Public +%% License, either version 1.2 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. +%% +%% This program is distributed in the hope that it will be useful, +%% but WITHOUT ANY WARRANTY; without even the implied warranty of +%% MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the +%% LaTeX Project Public License for more details. +%% +%% \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 \~} + +\def\fileinfo{A new system for including files (Frankenstein's backbone)} +\def\DoXPackageS {} +\def\fileversion{v2} +\def\filedate{1999/11/02} +\def\docdate{1999/11/02} +\edef\PPOptArg {% + \filedate\space \fileversion\space \fileinfo +} +\makeatletter% A special comment to help create bst files. Don't change! +\@ifundefined{JusTLoaDInformatioN} {% + }{% ELSE (we know the compsci package is already loaded, too) + \UndefineCS\JusTLoaDInformatioN + \SaveDoXVarS + \eExpand\csname DoXPackageS\endcsname\In {%use \csname in case it's undefined + \usepackage{#1}% + }% + \RestoreDoXVarS + \makeatother + \endinput +}% A special comment to help create bst files. Don't change! +\NeedsTeXFormat{LaTeX2e} +\ProvidesPackage{newclude}[\PPOptArg] +%% +\RequirePackage{moredefs} +\InitCS\sc@t@a +\DeclareOption{simple} {% + \input{simple.sto} + \let\sc@t@a\endinput +} +\DeclareOption{tag} {% + \AtEndOfPackage {\input{tag.sto}} +} +\DeclareOption{allocate} {% + \AtEndOfPackage {\input{allocate.sto}} +} +\DeclareBooleanOptions{dynamic}{static} +\ExecuteOptions{tag} +\ProcessOptions +\sc@t@a +\ReserveCS\nc@t@a +\ReserveCS\nc@t@b +\ReserveCS\nc@t@c +\newtokens\nc@toks@a +\newcommand\DefaultIncludeSurround {% + \par +} +\newlet\IncludeSurround\DefaultIncludeSurround +\newcounter{IncludeDepth} % starts at 0 +\newcommand\IfAllowed [1] {% + \@firstoftwo +} +\newcommand\includeall {% + \let\includeonly\Gobble +} +\defcommand\includeonly [1] {% + \@partswtrue + \edef\@partlist {\zap@space#1 \@empty}% + \@for\nc@t@a:=\@partlist \do {% + \InitName*{nc@part@\nc@t@a}% + }% + \defcommand\IfAllowed [1] {% args: part-name + \@ifundefined{nc@part@##1} {% + \let\nc@t@c\@secondoftwo + }{% ELSE + \let\nc@t@c\@firstoftwo + }% + \nc@t@c + }% +} +\def\include {% + \@ifstar {% + \let\nc@t@b\IncludeSurround + \nc@include + }{% ELSE + \let\nc@t@b\clearpage + \nc@include + }% +} +\ReserveCS\DisableAll +\newcommand\Disable [1] {% + \g@addto@macro\DisableAll{#1}% +} +\ReserveCS\nc@radical@shutdown +\addto@macro\nc@radical@shutdown {% + \MonsterInfo{newclude} + {\protect\nc@radical@shutdown\space beginning}} +\addto@macro\nc@radical@shutdown{\catcode`\%=14} % 14 = comment +\addto@macro\nc@radical@shutdown{\catcode`\^=7} % 7 = superscript +\newcommand\nc@disable@char[1] {% + \addto@macro\nc@radical@shutdown + {\catcode`#1=14}} % 14 = comment +\@tfor\sc@t@a:=abcdefghijklmnopqrstuvwxyz% + ABCDEFGHIJKLMNOPQRSTUVWXYZ% + ~!@$&*()_+-=[]|/?.,<>% + 1234567890% + `'";:% + \^\\\{\}\ % this is really the chars "^\{}" and space + \do {\expandafter\nc@disable@char\sc@t@a} +\nc@disable@char\# +\addto@macro\nc@radical@shutdown{\endinput} +\newcommand\nc@radical@shutdown@aftergroup {% + \aftergroup\nc@radical@shutdown +} +\newcommand\includedoc {% + \md@check@star + \Expand \sc@star@nothing\In {% + \IncludeEnv##1{document}{}% + }% +} +\newcommand\includedocskip {% + \md@check@star + \Expand \sc@star@nothing\In {% + \IncludeEnvSkip##1{document}{}% + }% +} +\newcommand\IncludeEnv [2] {% args: environment instance + \md@check@star + \@ifnextchar [ {% ^^A for Emacs: ] + \nc@includeenv{#1}{#2}% + }{% ELSE + \nc@includeenv{#1}{#2}[]% + }% +} +\NewName{nc@includeenv} {#1#2[#3]} {% args: environment instance [prehook] + \@ifnextchar [ {% ^^A for Emacs: ] + \nc@@includeenv {#1}{#2}{#3}% + }{% ELSE + \nc@@includeenv {#1}{#2}{#3}[]% + }% +} +\NewName{nc@@includeenv} {#1#2#3[#4]} {% args: environment instance prehook [posthook] + \begingroup + \DisableAll + \let\documentclass\GobbleOM + \let\usepackage\GobbleOM + \expandafter\def\csname end#1\endcsname {% + \makeatletter + % POSTHOOK + \nc@radical@shutdown@aftergroup + }% + \expandafter\def\csname #1\endcsname {} % PREHOOK + \endgroup + \par + \Expand \sc@star@nothing\In {% + \include##1{#2}% + }% +} +\NewName {nc@@includeenvskip} {#1#2#3[#4]} {% args: environment instance prehook [posthook] + \begingroup + \DisableAll + \expandafter\def\csname end#1\endcsname {% + \makeatletter + % POSTHOOK + \nc@radical@shutdown@aftergroup + }% + \expandafter\def\csname #1\endcsname {} % PREHOOK + \long\def\documentclass ##1\begin{document}{% + \begingroup + \def\@currenvir{document}% + } + \endgroup + \par + #1% +} +\newcommand\DeclareFormattingPackage [1] {% + \addto@macro\nc@formatting@packages{,#1}% +} +\newcommand\nc@formatting@packages {times,helvetic} +\endinput +%% +%% End of file `newclude.stq'. diff --git a/Master/texmf-dist/tex/latex/frankenstein/newclude.sty b/Master/texmf-dist/tex/latex/frankenstein/newclude.sty new file mode 100644 index 00000000000..759797767c8 --- /dev/null +++ b/Master/texmf-dist/tex/latex/frankenstein/newclude.sty @@ -0,0 +1,959 @@ +%^^A* legal notices +% \iffalse +% +% This program is part of the Frankenstein bundle for LaTeX. +% +% Copyright 1995-2001 Matt Swift <swift@alum.mit.edu>. +% +% This file contains both the code and documentation for the +% newclude LaTeX package. It will work ONLY if it is placed in a +% proper directory. Files called README, INSTALL, newclude.tex +% and newclude.ins should have also been distributed to you +% with this file. See them for more information on how to typeset +% the documentation with LaTeX and how to generate a version of this +% file that will work faster than this one. +% +% This program is free software; you may redistribute it and/or +% modify it under the conditions of the LaTeX Project Public +% License, either version 1.2 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. +% +% This program is distributed in the hope that it will be useful, +% but without any warranty; without even the implied warranty of +% merchantability or fitness for a particular purpose. See the +% LaTeX Project Public License for more details. +% +% \fi +% +%^^A* checks +% +%^^A NOTE: The character table, with two %'s, will get written to all files. +%% \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 \~} +% +% \CheckSum{208} +% +% \begin{abstract} +% \package{Newclude} is a backwards-compatible reimplementation of the +% \LaTeX{} system for including files. The princpal new features are: (1) +% the restriction that \cs\clearpage{}s must surround an included file is +% removed, (2) the restriction that \cs\include{}s cannot be nested is +% removed, and (3) the provision of hooks executed before and after the +% contents of an included file. Newclude accomplishes the first two by using +% a single \ext{aux} file instead of many. +% +% Still in development, but already useful in many situations, are new +% commands that include partial contents of independent \LaTeX{} files, which +% can also be processed on their own (that is, files that contain +% \cs\documentclass, |\begin{document}|, etc.). \package{Newclude} absorbs +% and supersedes the former package \package{includex}. +% \end{abstract} +% \clearpage +% \tableofcontents +% +% \part{Discussion} +% +% \section{Introduction} +% +% Let us call a file that might be included into another document with a +% command in the \cs\include family a \term{part}. When a part is actually +% included during a particular processing run, let us call it an \term{included +% part}, and when it is not included, let us call it an \term{unincluded part}. +% Notice that an unincluded part is \emph{not} the same as a file that was +% never a candidate for inclusion with a command in the \cs\include family. +% +% The \package{newclude} package adds these features to the standard LaTeX{} +% inclusion system: +% \begin{enumerate} +% \item\label{item:hooks} Hooks \cs\AtBeginInclude and \cs\AtEndInclude are provided. +% \item\label{item:hooks:opt} Optional arguments to \cs\include and friends +% override current values of \cs\AtBeginInclude and \cs\AtEndInclude. +% \item \cname{include*} is like \cs\include but with arbitrary commands +% rather than \cs\clearpage{}s surrounding the part. +% \item \cs\include and friends can be nested. +% \item \cs\includeall cancels the effect of \cs\includeonly. +% \item \cs\IfAllowed\meta{filename} is a new conditional that branches, +% depending on what has been declared in an \cs\includeonly. +% \item Commands \cs\includedoc etc.\ include a part that can be processed +% independently. These features are in development. +% \end{enumerate} +% +% \package{Newclude} accepts three mutually-exclusive package options, with +% \option{tag} the default when no package option is given. +% +% Loading \package{newclude} with the \option{simple} option provides only +% features \ref{item:hooks} and~\ref{item:hooks:opt}. If you don't use either +% of these new features, the standard \LaTeX{} and \package{newclude} inclusion +% systems will behave identically except in some unusual and benign odd cases +% relating the the parsing of the new optional arguments to \cs\include, which +% are discussed below in that command's documentation. +% +% The options \option{tag} and \option{allocate} each implement all the above +% features with a different method. Each method introduces different +% discrepancies from standard \LaTeX{} which are discussed below in sections +% \ref{opt:tag} and~\ref{opt:allocate}. If I discover how to make one method +% never inferior to the other, I will remove the other option from the package. +% +% \section{Usage} +% +% \DescribeMacro\include +% \DescribeMacro\AtBeginInclude +% \DescribeMacro\AtEndInclude +% \cs\include\oarg{prehook}\marg{filename}\oarg{posthook} behaves like +% standard \LaTeX{}'s \cs\include except that it can be nested and the +% contents of the two hook arguments, when they are given, are inserted at +% the beginning and end of the part whenever it is included, overriding the +% current values of \cs\AtBeginInclude and \cs\AtEndInclude. +% +% \caveat{Right square braces (|]|s) in the optional arguments must be +% surrounded by curly braces to avoid confusing the argument parser.} +% +% \caveat{A left square brace (|[|) that immediately follows an +% \cs\include command's mandatory \meta{filename} argument (after optional +% whitespace) will be considered to delimit the beginning of the +% \meta{posthook} argument. If you want an actual left brace character in +% this position, you must precede it with something that will terminate +% \TeX's search for an optional argument, such as \cs\relax, |{}|, or a +% paragraph division (explicit or implicit).} +% +% The commands \cs\AtBeginInclude\meta{tokens} and +% \cs\AtEndInclude\meta{tokens} are analagous to standard \LaTeX{}'s commands +% \cs\AtBeginDocument\meta{tokens} and \cs\AtEndDocument\meta{tokens}. +% +% FIX: multiple instances concatenate? +% +% FIX give name to what's held by atbegininclude so that an override can mention it +% +% When the optional argument \meta{prehook} is given to \cs\include, its +% contents will be used instead of whatever has been specified with +% \cs\AtBeginInclude, for that one inclusion. Likewise, \meta{posthook} will +% be used in place of whatever has been specified with \cs\AtEndInclude for +% that one inclusion. +% +% For example, putting the \cs\chapter declaration in the \meta{prehook} +% argument allows the chapter name, and, optionally, a corresponding \LaTeX{} +% label, to be kept in the including file, rather than the included file: +% \begin{codeexample} +% \include [\chapter{Whales} +% \label{ch:whales}] +% {big-cetecea} +% \end{codeexample} +% +% The \meta{posthook} argument can be used, for example, to delimit or undo +% declarations made in the \meta{prehook} or the included file: FIX: better +% example, since these coudl simple appear before/after the \cs\include +% without ill effect. +% \begin{codeexample} +% \include [\begingroup\larger] % this part in larger type +% {manifesto} +% [\endgroup] +% \end{codeexample} +% +% \DescribeMacro{\include*} +% \DescribeMacro\IncludeSurround +% \DescribeMacro\DefaultIncludeSurround +% \cname{include*}\oarg{prehook}\marg{filename}\oarg{posthook} is like +% \cs\include but omits the usual \cs\clearpage{}s that surround an included +% part, replacing them with \cs\IncludeSurround, which defaults to +% \cs\DefaultIncludeSurround. The contents of \cs\IncludeSurround are +% inserted before the \meta{prehook} or whatever has been specified with +% \cs\AtBeginInclude, and after the \meta{posthook} or whatever has been +% specified with \cs\AtEndInclude. +% +% \caveat{A space gets inserted after an \cname{include*} unless it is +% suppressed by a |%| immediately following. Combined with trailing spaces +% in the included file, this may lead to unwanted spaces. For this reason, +% \cs\DefaultIncludeSurround is initialized to \cname{par}. When the user +% must explicitly change \cs\IncludeSurround to achieve totally smooth flow +% from main file to included file, they are more likely to consult this +% documentation if they spot a problem. Package and class writers should +% take this difficulty into account when changing \cs\DefaultIncludeSurround.} +% +% \DescribeMacro\includeonly +% The \cs\includeonly command is reimplemented, but its usage and behavior is +% the same as the standard \LaTeX{} version. +% +% \DescribeMacro\includeall +% The \cs\includeall command cancels the effect of any \cs\includeonly +% command presently in effect. +% +% If you write an \cs\includeonly so that each file appears on its own line, +% it is particularly easy to add and remove files to include by commenting +% out their lines, but it becomes laborious to comment out the entire +% \cs\includeonly command. It's easy, however, to uncomment a single +% \cs\includeall command when you want to process the entire document. (Or +% \cs\includeall could be inserted from the command line that invokes +% \LaTeX{}, and so on.) +% +% \section{Experimental features} +% +% \DescribeMacro\includeenv +% \cs\includeenv\oarg{prehook}\marg{filename}\marg{environment name}% +% \marg{instance}\oarg{posthook} +% \cs\includeenv*\oarg{prehook}\marg{filename}\marg{environment name}% +% \marg{instance}\oarg{posthook} +% +% \cs\includeenv includes the contents of a single \LaTeX{} environment that +% appears in \meta{filename}. The environment is specified by giving its +% name (\meta{environment}) and an instance of that environment in the file +% (\meta{instance}). Presently, \meta{instance} is ignored, so that it will +% always be the contents of the first occurrence in \meta{filename} of a +% \LaTeX{} environment with the name \meta{environment} that will be +% included. In the future, the \meta{instance} argument may be used to +% specify the $n$th instance of the environment within the file, or further +% specify the environment to be extracted in some other way. +% +% FIX: right now they're required; skip text up to documentclass OR the target, +% then branch? +% +% Good preamble syntactic sugar: |\let\TheMarkupDeclarations\begin| +% +% \todo{You can insert a \cs\usepackage into the main aux file and have it +% loaded properly. If we discover a \cs\usepackage that is not a formatting +% package, one strategy is to insert a corresponding \cs\usepackage into the +% (main) aux file and then bail after the preamble.} +% +% \todo{You can't skip verbatim text via macro argument processing and sugar. +% this means that a major reimplementation of skipping using verbatim methods +% will have to be done.} +% +% The included file is permitted (but not required) to have its own +% \cs\documentclass command and \code{\begin{document}}\lips +% \cs{\end{document}} pair. \cs\includeenv extracts the specified +% environment by processing the preamble if one exists, skipping text up +% until the beginning of the specified environment, processing the contents +% of the environment, and skipping the rest of the included part. +% +% Notice that while a \code{\begin{document}}\lips\code{\end{document}} pair +% may not technically delimit a \LaTeX{} environment, you may nevertheless +% (because it looks exactly like an environment) set \meta{environment} to +% |document| to extract the contents of the \env{document} ``environment'' of +% \meta{filename}. +% +% Consider the following issues when you are tempted to use this +% command. Maybe the \cs\usepackage you are about to disregard is necessary +% to processing the part's contents. Maybe it conflicts with a package +% already loaded at top level. Maybe both! The same holds of course for the +% defining commands like \cs\newcommand that one expects to find in a +% package. +% +% A deep problem with the design of a \LaTeX{} source file exists with +% respect to the function of the preamble. The preamble contains +% declarations that determine how the document below will be formatted. +% Unfortunately, there is no way to make the distinction between: +% \begin{enumerate} +% \item +% declarations that signal that certain markup will appear in the document +% that are either not defined in the \LaTeX{} kernel or are used with a +% different syntax +% \item declarations that describe how a certain instance +% of the document should be formatted +% \end{enumerate} +% Examples in the first category are \code{\usepackage{url}} and \code{FIX +% example}, and examples in the second are \code{\usepackage{times}} and +% \code{FIX}. When you want to include the document or a part of it in +% another document, it is absolutely necessary to make this distinction so +% that declarations in category (1) can be processed and declarations in +% category (2) can be ignored. ^^A FIX: \cat{} is a compsci command? +% +% Adopting a convention on the use of the preamble can overcome this design +% problem, but it will not fix the problem for legacy files whose preambles +% do not obey the convention. Legacy files that contain category (1) +% declarations in their preambles must either be altered or specifically +% accommodated with additional commands. +% +% The convention I suggest is to |\usepackage{preamble}|. \cs\beginmarkup +% \cs\endmarkup. FIX. Can we arrange to load +% +% When \cs\includeenv encounters a \cs\usepackage command in the included +% part, it looks at the packages in the argument of \cs\usepackage and issues +% a warning if the package is not already loaded and does not appear on a +% list of packages known whose use falls entirely within category (2). (See +% the \cs\DeclareFormattingPackage command below.) +% +% The \cs\documentclass command is of course also a category (1) declaration. +% Presently, if \cs\includeenv detects that the arguments to an included +% \cs\documentclass command differ from the arguments of the +% \cs\documentclass command of the including document, it will issue a +% warning, and continue. In the future, I hope to make this behavior smarter +% by having \cs\includeenv take specific actions for specific combinations of +% arguments. For example, if the included document's class implies the use +% of markup not defined in the parent's class, an appropriate action would be +% to define the missing markup commands. A document of class \class{report} +% and a document of class \class{article}, on the other hand, do not (I don't +% think) declare different markup, so that there should be no warning in this +% case. +% +% \DescribeMacro{\includeenv*} +% \cname{includeenv*} is analogous to \cname{include*}, that is, it surrounds +% the included part with \cs\IncludeSurround rather than \cs\clearpage. +% +% \DescribeMacro\includedoc +% \DescribeMacro{\includedoc*} +% \cs\includedoc\oarg{prehook}\marg{file name}\oarg{posthook} is shorthand +% for +% \cs\includeenv\oarg{prehook}\marg{filename}\marg{|document|}\marg{}\oarg{posthook}. +% +% \cname{includedoc*} is analogous to \cname{includeenv*}. +% +% \section{Options} +% +% \subsection{Simple}\label{opt:simple} +% +% If the \option{simple} option is given, the only new feature provided is the +% hooks (features \ref{item:hooks} and~\ref{item:hooks:opt} above). As +% with standard \LaTeX{}, \cs\clearpage{}s surround an \cs\include and nesting +% \cs\include{}s gives an error. \package{Newclude} will only behave +% differently than standard \LaTeX{} command scans for +% possible optional arguments will make a different. +% + +% +% \subsection{Tag}\label{opt:tag} +% The \option{tag} option causes \LaTeX{} to use just one \ext{aux} file. +% This option, which is the default, works well. I am aware of the following +% two differences from the kernel's including system: +% +% \begin{enumerate} +% \item +% If the \LaTeX{} process is stopped during the processing of a part, all +% information normally stored in an \ext{aux} file from that point in the +% document forward is lost. In the kernel's system, processing the document +% twice more would recover any \ext{aux} information previously generated for +% parts. +% +% If \LaTeX{} is always invoked in \cs\nonstopmode (e.g., by \auctex), then +% this difference is only going to occur when there are catastrophic errors +% that cause even \cs\nonstopmode to terminate processing. +% +% \item Other packages and classes that redefine kernel commands that write to +% \cname{@auxout} will cause problems. +% \end{enumerate} +% +% The first difference must be accepted. The second difference can be removed +% on a case by case basis, by specifically coding compatibility with such +% packages and classes. I intend to do this. Here is a list of such packages +% and classes known to me: +% +% \begin{tabular}{l} +% \meta{none so far} +% \end{tabular} +% If you discover any more for this list, please write me! +% +% It's also very easy to revise the other package to be compatible with +% \package{newclude} as it is now. See section~\ref{adapt} below, which +% includes a list of relevant kernel commands. +% +% \subsection{Allocate}\label{opt:allocate} +% +% The second way (the \option{allocate} option) represents my first attempt at +% a solution, and until I am sure it has no advantages over \option{tag} under +% any circumstances, it will continue to be an option. +% +% The \option{allocate} option causes \LaTeX{} to dynamically allocate \TeX{} +% output streams to each part as they are needed. Streams are allocated when +% processing of the part begins, and are reclaimed after the ejection of the +% last page to which the part has contributed. Like the old system, a separate +% \ext{aux} file is created for each part. The limitation of this +% implementation is that \TeX{} only possesses 16 output streams. Each of the +% commands \cs\tableofcontents, \cs\listoffigures, \cs\listoftables, +% \cs\makeglossary, and \cs\makeindex causes \LaTeX{} to use one output stream. +% The remainder (minus any streams required by packages and classes) are +% available for the including system. If $n$ streams are available, the level +% of nesting possible is $n - 1$ minus the maximum number of parts that occur +% on the same page. For example, if 10 streams are available and the parts +% never appear on the same page (the old behavior required by the +% \cs\clearpage{}s), then 8 levels of nesting are possible (which is 8, not 7 +% more than with the old system). The maximum number of parts that may +% contribute the to same page is calculated with the same equation. Note: +% \TeX's page-breaking algorithm looks ahead until it has more than enough +% material to fill one page. You must count all the new \ext{aux} files that +% are opened during a look-ahead as contributing to the page in question, even +% if some of the later ones do not actually contribute to the page after the +% break is chosen. +% +% The \option{allocate} solution is itself implemented in two ways. The system +% either reserves a fixed number of output streams from the start, or will +% dynamically claim and free them as needed. The dynamic solution is the +% default. I do not see much use for the static solution at present. If the +% dynamic system claims streams that are later required, then it is simply a +% question of whether \package{newclude} or the other feature is going to +% signal an error about having no more streams to allocate. +% +% \section{Programmers' interface} +% +% \DescribeMacro\IfAllowed +% \cs\IfAllowed\marg{part name}\marg{true}\marg{false} executes \meta{true} +% if \meta{part-name} is on the list of files to be included and \meta{false} +% otherwise. If there is no list, executes \meta{true}. +% +% \DescribeMacro\IncludeName +% \cs\IncludeName expands to the name of the part currently being processed. +% In the toplevel source file, it will expand to \cs\jobname. +% +% \DescribeMacro\ParentName +% \cs\ParentName expands to the name of the part that includes the part +% currently being processed. In the toplevel source file, expanding +% \cs\ParentName will generate a warning and expand to \cs\jobname (which is +% also what \cs\IncludeName expands to). +% +% FIX: root source file? toplevel? master? principle source? glossary! +% +% \DescribeMacro\DeclareFormattingPackage +% \cs\DeclareFormattingPackage\marg{package name} declares \meta{package +% name} to be a package that only makes formatting declarations, that is, the +% effect of using it falls entirely within category (2). If a formatting +% package occurs in a \cs\usepackage declaration in the preamble of a part +% included by \cs\includeenv, no warning will be given. An example of a +% formatting package is the \package{times} package. No facility is provided +% to distinguish the case when a package is used with or without certain +% package options, so do not declare a package as a formatting package unless +% it is so regardless of the options it is passed. +% +% If you send me the names of formatting packages, I will include them in the +% next release of \package{newclude}. Meanwhile, you may declare them in +% \file{newclude.cfg}. Do the same for your local formatting packages if you +% wish. It does no harm to declare a package as a formatting package more +% than once. +% +% \DescribeMacro\ifSkipPreamble +% \DescribeMacro\SkipPreambletrue +% \DescribeMacro\SkipPreamblefalse +% +% \DescribeMacro\Disable +% \DescribeMacro\DisableAll +% \cs\Disable\marg{tokens} provides a way to ignore additional commands when +% using \cs\includeenv and friends. If you want to cause the macro \cs\foo +% which takes no arguments to be entirely ignored in parts, issue the command +% \code{\Disable{\let\foo\relax}} any time before including the parts you +% want to affect. If \cs\foo takes one mandatory argument, write +% \code{\let\foo\Gobble} instead. If \cs\foo takes one optional and one +% mandatory, write \code{\let\foo\GobbleOM}. And so on. For other examples, +% see the gobbling commands in the \package{moredefs} package (which +% \package{newclude} requires), or write your own. +% +% The arguments to \cs\Disable are accumulated and executed by the command +% \cs\DisableAll, which is executed inside a group that contains a part when +% it is included. +% +% There is no way to undo the effect of issuing a \cs\Disable command. +% +% \section{How to play nicely with \package{newclude}}\label{adapt} +% +% To adapt a package or class for use with the \option{tag} option of +% \package{newclude}: +% \begin{enumerate} +% \item replace |\immediate\write\@auxout| with \cs{\@writeaux} +% \item replace |\protected@write\@auxout| with \cs{\protected@writeaux} +% \item add +% \begin{codeexample} +% \providecommand\@writeaux {% +% \immediate\write\@auxout +% } +% \providecommand\protected@writeaux {% +% \protected@write\@auxout +% } +% \end{codeexample} +% \end{enumerate} +% +% \StopEventually{} +% +% \part{Implementation} +% +% \section{Version control} +% +% \begin{macro}{\fileinfo} +% \begin{macro}{\DoXUsepackagE} +% \begin{macro}{\HaveECitationS} +% \begin{macro}{\fileversion} +% \begin{macro}{\filedate} +% \begin{macro}{\docdate} +% \begin{macro}{\PPOptArg} +% These definitions must be the first ones in the file. +% \begin{macrocode} +\def\fileinfo{A new system for including files (Frankenstein's backbone)} +\def\DoXPackageS {} +\def\fileversion{v2} +\def\filedate{1999/11/02} +\def\docdate{1999/11/02} +\edef\PPOptArg {% + \filedate\space \fileversion\space \fileinfo +} +% \end{macrocode} +% \end{macro} +% \end{macro} +% \end{macro} +% \end{macro} +% \end{macro} +% \end{macro} +% \end{macro} +% +% If we're loading this file from a \cs\ProcessDTXFile command (see the +% \package{compsci} package), then \cs\JusTLoaDInformatioN will be defined; +% othewise we assume it is not (that's why the FunkY NamE). +% +% If we're loading from \cs\ProcessDTXFile, we want to load the packages listed +% in \cs\DoXPackageS (needed to typeset the documentation for this file) and +% then bail out. Otherwise, we're using this file in a normal way as a +% package, so do nothing. \cs\DoXPackageS, if there are any, are declared in +% the \ext{dtx} file, and, if you're reading the typeset documentation of this +% package, would appear just above. (It's OK to call \cs\usepackage with an +% empty argument or \cs\relax, by the way.) +% \begin{macrocode} +\makeatletter% A special comment to help create bst files. Don't change! +\@ifundefined{JusTLoaDInformatioN} {% + }{% ELSE (we know the compsci package is already loaded, too) + \UndefineCS\JusTLoaDInformatioN + \SaveDoXVarS + \eExpand\csname DoXPackageS\endcsname\In {%use \csname in case it's undefined + \usepackage{#1}% + }% + \RestoreDoXVarS + \makeatother + \endinput +}% A special comment to help create bst files. Don't change! +% \end{macrocode} +% +% Now we check for \LaTeX2e and declare the LaTeX package. +% \begin{macrocode} +\NeedsTeXFormat{LaTeX2e} +\ProvidesPackage{newclude}[\PPOptArg] +% \end{macrocode}^^A special comment to help create bst files. Don't change! +% +% ^^A NOTE: We have to compensate for the above backslashes, which are not +% ^^A actually in the .dtx file the author works on, by adding to the +% ^^A CheckSum. +%% +% \AddToCheckSum{17}^^A `dtx-update-checksum' automatically handles this. +% \AddToCheckSum{7}^^A The half a macrocode env. at the top is missed, however... +% \AddToCheckSum{10}^^A ... and so are the 5 \defs from the .dtx file +% ^^A that precede it. +% \IfCitations {% +% \AddToCheckSum{2}^^A When \initelyHavECitationS is defined in +% } ^^A the .dtx file, we need 2 more in the CheckSum. +% +% +% \section{Review of the kernel's inclusion system} +% +% One \ext{aux} file is written to disk for the \term{principle source} and one +% for each of the included \term{parts}. The reason to have a separate ones +% for the parts is so that information from the last time the part was included +% is retained in subsequent runs even when the part is excluded by +% \cs\includeonly. Suppose a part is processed once, and on a subsequent run +% its name is removed from the \cs\includeonly list. This run will still read +% in the part's \ext{aux} file, since the \ext{aux} file of any part that was +% \cs\included during the last run is always read. But the information therein +% is not going to be regenerated in this run, since the part will not be +% processed. The main \ext{aux} file is created anew with each run, so this +% information would be lost if it resided there. +% +% To handle writing these multiple \ext{aux} files, the kernel uses two of +% \TeX's output streams. When a routine writes to an auxiliary file, it writes +% to \cname{@auxout}, which is \cs\let to either \cname{@mainaux}, the +% \ext{aux} file for the principle source, or \cname{@partaux} the \ext{aux} +% file for all the parts each in turn. +% +% When encountering an \cs\include command, but before deciding whether or not +% to actually load the part, the kernel writes a command to \cname{@mainaux} +% that will load the part's \ext{aux} file. The main \ext{aux} +% file is loaded by \cs\document, so that \emph{all} \ext{aux} files are read +% in every time the principle source is processed. +% +% If a part is actually loaded, a \term{checkpoint} is written to the part's +% \ext{aux} file consisting of a snapshot of the counters (a record of the +% values of all \LaTeX{} counters). On the next run, if the part is not +% actually loaded, the information in its \ext{aux} file has nevertheless +% already been processed by \cs\document. Processing the checkpoint causes a +% macro to be defined that when invoked restores the counter state. When +% \cs\include does not actually load a part it calls this checkpoint macro +% instead to alter the present counter state. +% +% This system has pitfalls as well as benefits. It is useful to keep the +% bibliography, citations, cross references, and page numbers up to date in +% certain situations, but the results can be confusing sometimes, because +% checkpoints are not documented. (Perhaps this is remedied in the 2d edition +% of the \LaTeX{} manual.) How, besides reading the code, or finding out the +% hard way, is anyone supposed to guess that rearranging two ``deactivated'' +% \cs\include statements in a principle source will bring havoc on the page +% numbers? +% +% \section{Discussion of \package{newclude}'s inclusion system} +% +% The simple removal of the \cs\clearpage{}s that surround an included part +% would cause a problem involving the delayed action of \cs\write commands. +% Suppose a part ending with a \cs\write command ends halfway down a page, and +% another \cs\write occurs in the principle source immediately (or soon) after +% the inclusion. The first must be written to \cname{@partaux} and the second +% to \cname{@mainaux}. If we close \cname{@partaux} while the first \cs\write +% is still pending, that is, before the current page has been shipped out, then +% the \cs\write will be destined for a closed stream and therefore go to the +% log file and terminal. The \cs\clearpage{}s solve this by flushing all +% pending \cs\writes. Then we can close \cname{@partaux} immediately and +% reopen \cname{@mainaux}. +% +% Successful removal of the \cs\clearpage{}s can be accomplished either by +% having the entire document use just one auxiliary file, or by allocating +% additional output streams so that it becomes possible to avoid closing +% \cname{@partaux} until after the current page is shipped out when all the +% \cs\write{}'s to it have been completed. +% +% \section{Package initialization} +% +% \begin{macrocode} +\RequirePackage{moredefs} +% \end{macrocode} +% +% \begin{macrocode} +\InitCS\sc@t@a +\DeclareOption{simple} {% + \input{simple.sto} + \let\sc@t@a\endinput +} +%^^A\DeclareOption{group} {% +%^^A \AtEndOfPackage {\input{group.sto}} +%^^A} +\DeclareOption{tag} {% + \AtEndOfPackage {\input{tag.sto}} +} +\DeclareOption{allocate} {% + \AtEndOfPackage {\input{allocate.sto}} +} +\DeclareBooleanOptions{dynamic}{static} +\ExecuteOptions{tag} +\ProcessOptions +% \end{macrocode} +% If the \option{simple} option has been given, end right here. +% \begin{macrocode} +\sc@t@a +% \end{macrocode} +% +% \section{Simple} +% +% The above option processing causes the file \file{simple.sto} to be loaded +% when the \option{simple} is given. After it is loaded, processing stops. +% When the \option{simple} option is not given, \package{newclude} package code +% continues in section~\ref{sec:common}. +% +% \input{simple.sto} +% +% \section{Common}\label{sec:common} +% +% The code in this section is common to the \option{tag} and \option{allocate} +% options. +% +% \begin{macro}{\nc@t@a} +% \begin{macro}{\nc@t@b} +% \begin{macro}{\nc@t@c} +% \begin{macro}{\nc@toks@a} +% Scratch variables. +% \begin{macrocode} +\ReserveCS\nc@t@a +\ReserveCS\nc@t@b +\ReserveCS\nc@t@c +\newtokens\nc@toks@a +% \end{macrocode} +% \end{macro} +% \end{macro} +% \end{macro} +% \end{macro} +% +% \begin{macro}{\IncludeSurround} +% \begin{macro}{\DefaultIncludeSurround} +% \mbox{} +% \begin{macrocode} +\newcommand\DefaultIncludeSurround {% + \par +} +\newlet\IncludeSurround\DefaultIncludeSurround +% \end{macrocode} +% \end{macro} +% \end{macro} +% +% \begin{macro}{\c@IncludeDepth} +% With nested \cs\include{}s, we need some way for the various ones to +% distinguish themselves, so we keep track of the nested depth with the +% |IncludeDepth| counter. +% \begin{macrocode} +\newcounter{IncludeDepth} % starts at 0 +% \end{macrocode} +% \end{macro} +% +% \begin{macro}{\IfAllowed} +% \begin{macro}{\includeonly} +% \begin{macro}{\includeall} +% I think it's more efficient to define a macro for each included part on the +% list than it is to search through the list possibly twice for each one. +% Other opinions on making this whole thing more efficient? +% +% We are using the usual \LaTeX{} trick of undefined control sequences +% comparing equally with \cs\relax. Empty control sequences are \emph{not} +% the same. Should be followed by \meta{true clause} then \meta{false +% clause}. +% \begin{macrocode} +\newcommand\IfAllowed [1] {% + \@firstoftwo +} +\newcommand\includeall {% + \let\includeonly\Gobble +} +\defcommand\includeonly [1] {% + \@partswtrue +% \DTypeout{INCLUDEONLY}% + \edef\@partlist {\zap@space#1 \@empty}% + \@for\nc@t@a:=\@partlist \do {% + \InitName*{nc@part@\nc@t@a}% + }% + \defcommand\IfAllowed [1] {% args: part-name + \@ifundefined{nc@part@##1} {% +% \DTypeout{##1 NOTALLOWED}% + \let\nc@t@c\@secondoftwo + }{% ELSE +% \DTypeout{##1 ALLOWED}% + \let\nc@t@c\@firstoftwo + }% + \nc@t@c + }% +% \DTypeout{ENDINCLUDEONLY}% +} +% \end{macrocode} +% \end{macro} +% \end{macro} +% \end{macro} +% +% \begin{macro}{\include} +% \begin{macro}{\include*} +% This is the principle user command. The scratch variable \cname{nc@t@b} +% contains what really surrounds the included file. +% \begin{macrocode} +\def\include {% + \@ifstar {% + \let\nc@t@b\IncludeSurround + \nc@include + }{% ELSE + \let\nc@t@b\clearpage + \nc@include + }% +} +% \end{macrocode} +% \end{macro} +% \end{macro} +% +% +% \section{Experimental common} +% +% \begin{macro}{\Disable} +% \begin{macro}{\DisableAll} +% This allows the disabling hacks. +% \begin{macrocode} +\ReserveCS\DisableAll +\newcommand\Disable [1] {% + \g@addto@macro\DisableAll{#1}% +} +% \end{macrocode} +% \end{macro} +% \end{macro} +% +% We start with considering how to quit inputting a file. The idea is to make +% the \code{\end{document}} command of the part call \cs\endinput. But there +% is a hitch that characters on the line after the \code{\end{document}} get +% inserted when you don't want them to. To beat that limitation, we have to do +% some work. +% +% \begin{macro}{\nc@radical@shutdown} +% We will add a bunch of commands to this macro, with the idea of \cs\catcode{}ing +% everything and its brother to a comment. This would be a brute force +% method! +% \begin{macrocode} +\ReserveCS\nc@radical@shutdown +% \end{macrocode} +% First log a message that we're about to do some crazy things. In case +% something goes wrong, this might help. +% \begin{macrocode} +\addto@macro\nc@radical@shutdown {% + \MonsterInfo{newclude} + {\protect\nc@radical@shutdown\space beginning}} +% \end{macrocode} +% Now we start adding \cs\catcode commands. These first two should be +% redundant; but just in case someone changed things\lips. +% \begin{macrocode} +\addto@macro\nc@radical@shutdown{\catcode`\%=14} % 14 = comment +\addto@macro\nc@radical@shutdown{\catcode`\^=7} % 7 = superscript +% \end{macrocode} +% \begin{macro}{\nc@disable@char} +% Next, we define a command we weill use in a loop in a moment. +% \begin{macrocode} +\newcommand\nc@disable@char[1] {% + \addto@macro\nc@radical@shutdown + {\catcode`#1=14}} % 14 = comment +% \end{macrocode} +% The following list contains every keyboard char except these three, which are +% treated specially: |%#|. +% The first is already a comment, and we handle the second in a moment. Each +% character in the following list is \cs\catcode{}d to a comment: +% \begin{macrocode} +\@tfor\sc@t@a:=abcdefghijklmnopqrstuvwxyz% + ABCDEFGHIJKLMNOPQRSTUVWXYZ% + ~!@$&*()_+-=[]|/?.,<>% + 1234567890% + `'";:% + \^\\\{\}\ % this is really the chars "^\{}" and space + \do {\expandafter\nc@disable@char\sc@t@a} +% \end{macrocode} +% We add |#| separately, because it's tricky or impossible to put it into the +% list we just used. +% \begin{macrocode} +\nc@disable@char\# +% \end{macrocode} +% \end{macro} +% We end the macro with \cs\endinput. This has to come after all the previous, +% otherwise, \TeX{} goes ahead and reads to the end of the line immediately, +% with regular catcodes. This is a good theory, I'm not sure it's necessary. +% \begin{macrocode} +\addto@macro\nc@radical@shutdown{\endinput} +% \end{macrocode} +% \end{macro} +% +% \begin{macro}{\nc@radical@shutdown@aftergroup} +% We need to use \cname{nc@radical@shutdown} this way. +% \begin{macrocode} +\newcommand\nc@radical@shutdown@aftergroup {% + \aftergroup\nc@radical@shutdown +} +% \end{macrocode} +% \end{macro} +% +% \begin{macro}{\includedoc} +% \begin{macro}{\includedoc*} +% \mbox{} +% \begin{macrocode} +\newcommand\includedoc {% + \md@check@star + \Expand \sc@star@nothing\In {% + \IncludeEnv##1{document}{}% + }% +} +% \end{macrocode} +% \end{macro} +% \end{macro} +% +% \begin{macro}{\includedocskip} +% \begin{macro}{\includedocskip*} +% \mbox{} +% \begin{macrocode} +\newcommand\includedocskip {% + \md@check@star + \Expand \sc@star@nothing\In {% + \IncludeEnvSkip##1{document}{}% + }% +} +% \end{macrocode} +% \end{macro} +% \end{macro} +% +% \begin{macro}{\IncludeEnv} +% \begin{macro}{\nc@includeenv} +% \begin{macro}{\nc@@includeenv} +% \mbox{} +% \begin{macrocode} +\newcommand\IncludeEnv [2] {% args: environment instance + \md@check@star + \@ifnextchar [ {% ^^A for Emacs: ] + \nc@includeenv{#1}{#2}% + }{% ELSE + \nc@includeenv{#1}{#2}[]% + }% +} +\NewName{nc@includeenv} {#1#2[#3]} {% args: environment instance [prehook] + \@ifnextchar [ {% ^^A for Emacs: ] + \nc@@includeenv {#1}{#2}{#3}% + }{% ELSE + \nc@@includeenv {#1}{#2}{#3}[]% + }% +} +\NewName{nc@@includeenv} {#1#2#3[#4]} {% args: environment instance prehook [posthook] + \begingroup + \DisableAll + \let\documentclass\GobbleOM + \let\usepackage\GobbleOM + \expandafter\def\csname end#1\endcsname {% + \makeatletter + % POSTHOOK + \nc@radical@shutdown@aftergroup + }% + \expandafter\def\csname #1\endcsname {} % PREHOOK + \endgroup + \par + \Expand \sc@star@nothing\In {% + \include##1{#2}% + }% +} +% \end{macrocode} +% \end{macro} +% \end{macro} +% \end{macro} +% +% \begin{macrocode} +\NewName {nc@@includeenvskip} {#1#2#3[#4]} {% args: environment instance prehook [posthook] + \begingroup + \DisableAll + \expandafter\def\csname end#1\endcsname {% + \makeatletter + % POSTHOOK + \nc@radical@shutdown@aftergroup + }% + \expandafter\def\csname #1\endcsname {} % PREHOOK + \long\def\documentclass ##1\begin{document}{% + \begingroup + \def\@currenvir{document}% + } + \endgroup + \par + #1% +} +% \end{macrocode} +% +% \section{Tag} +% +% The code in this section is processed when the \option{tag} package option is +% given (or, because the \option{tag} option is the default, when no package +% options are given.) +% +% \input{tag.sto} +% +% \section{Allocate} +% +% The code in this section is processed when the \option{allocate} package +% option is given. +% +% \input{allocate.sto} +% +% \section{Benign packages} +% +% \begin{macro}{\DeclareFormattingPackage} +% \begin{macro}{\nc@formatting@packages} +% \mbox{} +% \begin{macrocode} +\newcommand\DeclareFormattingPackage [1] {% + \addto@macro\nc@formatting@packages{,#1}% +} +\newcommand\nc@formatting@packages {times,helvetic} +% \end{macrocode} +% \end{macro} +% \end{macro} +% +% \Finale diff --git a/Master/texmf-dist/tex/latex/frankenstein/simple.sto b/Master/texmf-dist/tex/latex/frankenstein/simple.sto new file mode 100644 index 00000000000..80fbcabe9a3 --- /dev/null +++ b/Master/texmf-dist/tex/latex/frankenstein/simple.sto @@ -0,0 +1,58 @@ +% \AddToCheckSum{67} +% +% The \option{simple} option adds the optional argument to \cs\include, and +% does nothing else. +% +% \begin{macro}{\include} +% I'm not really sure why the \cs\relax is there; I'm imitating the kernel's +% command. +% \begin{macrocode} +\defcommand\include {% + \relax + \ifnum\@auxout=\@partaux + \@latex@error{\string\include\space cannot be nested}\@eha + \else + \expandafter\@include + \fi +} +% \end{macrocode} +% \end{macro} +% +% \begin{macro}{\@include} +% \mbox{} +% \begin{macrocode} +\defcommand\@include [2][] {% + \clearpage + \if@filesw + \immediate\write\@mainaux{\string\@input{#2.aux}}% + \fi + \@tempswatrue + \if@partsw + \@tempswafalse + \edef\reserved@b{#2}% + \@for\reserved@a:=\@partlist\do + {\ifx\reserved@a\reserved@b\@tempswatrue\fi}% + \fi + \if@tempswa + \let\@auxout\@partaux + \if@filesw + \immediate\openout\@partaux #2.aux + \immediate\write\@partaux{\relax}% + \fi +% \end{macrocode} +% All we did was change |#1| to |#2| and add the next line. +% \begin{macrocode} + #1% + \@input@{#2.tex}% + \clearpage + \@writeckpt{#2}% + \if@filesw + \immediate\closeout\@partaux + \fi + \else + \@nameuse{cp@#2}% + \fi + \let\@auxout\@mainaux +} +% \end{macrocode} +% \end{macro} diff --git a/Master/texmf-dist/tex/latex/frankenstein/slemph.cfg b/Master/texmf-dist/tex/latex/frankenstein/slemph.cfg new file mode 100644 index 00000000000..8c6cd087897 --- /dev/null +++ b/Master/texmf-dist/tex/latex/frankenstein/slemph.cfg @@ -0,0 +1,27 @@ +% \iffalse +%% +% Even if you don't want any code in this file, leave the empty file, or else +% loading the \package{slemph} package will consume extra time as it searches +% for this file. +%% +% \fi +% \begin{macrocode} +\def\fileinfo{slemph package configuration} +\def\fileversion{v1.0} +\def\filedate{1996/01/24} +\def\docdate{1996/01/24} +% \end{macrocode} +% +% \AddToCheckSum{12} +% +% \begin{macrocode} +\ProvidesFile{slemph.cfg} +% \end{macrocode} +% +% \begin{macro}{\em} +% Slanted emphasis. +% \begin{macrocode} +\let\em\slswitch +% \end{macrocode} +% \end{macro} + diff --git a/Master/texmf-dist/tex/latex/frankenstein/slemph.stq b/Master/texmf-dist/tex/latex/frankenstein/slemph.stq new file mode 100644 index 00000000000..1d40812f5fd --- /dev/null +++ b/Master/texmf-dist/tex/latex/frankenstein/slemph.stq @@ -0,0 +1,103 @@ +%% +%% This is file `slemph.stq', +%% generated with the docstrip utility. +%% +%% The original source files were: +%% +%% slemph.sty +%% +%% This program is part of the Frankenstein bundle for LaTeX. +%% +%% Copyright (C) 1995-2001 Matthew Swift <swift@alum.mit.edu> +%% +%% This file may have one of TWO names, either +%% slemph.sty or slemph.stq. This +%% LaTeX package will work ONLY if it is called slemph.sty +%% and placed in a proper directory. This file should have been +%% distributed to you with a DIFFERENT file (also) called +%% slemph.sty which functions identically to this one +%% but contains documentation in comments. This file works faster, +%% but the other should be kept because it contains the documentation +%% for this LaTeX package. Files called README and INSTALL should have +%% also been distributed to you with this file; see them for more +%% information. +%% +%% This program is free software; you may redistribute it and/or +%% modify it under the conditions of the LaTeX Project Public +%% License, either version 1.2 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. +%% +%% This program is distributed in the hope that it will be useful, +%% but WITHOUT ANY WARRANTY; without even the implied warranty of +%% MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the +%% LaTeX Project Public License for more details. +%% +%% \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 \~} +\def\fileinfo{slanted emphasis (Frankenstein's gait)} +\def\DoXPackageS {} +\def\fileversion{v1.2} +\def\filedate{1999/02/25} +\def\docdate{1999/02/25} +\edef\PPOptArg {% + \filedate\space \fileversion\space \fileinfo +} +\makeatletter% A special comment to help create bst files. Don't change! +\@ifundefined{JusTLoaDInformatioN} {% + }{% ELSE (we know the compsci package is already loaded, too) + \UndefineCS\JusTLoaDInformatioN + \SaveDoXVarS + \eExpand\csname DoXPackageS\endcsname\In {%use \csname in case it's undefined + \usepackage{#1}% + }% + \RestoreDoXVarS + \makeatother + \endinput +}% A special comment to help create bst files. Don't change! +\NeedsTeXFormat{LaTeX2e} +\ProvidesPackage{slemph}[\PPOptArg] +%% +\newcommand\itswitch {} +\newcommand\slswitch {} +\newcommand\textitswitch {} +\newcommand\textslswitch {} + +\DeclareRobustCommand\itswitch {% + \@nomath\itswitch + \def\reserved@a{it}% + \ifx\f@shape\reserved@a + \upshape + \else + \itshape + \fi +} +\DeclareRobustCommand\slswitch {% + \@nomath\slswitch + \def\reserved@a{sl}% + \ifx\f@shape\reserved@a + \upshape + \else + \slshape + \fi +} +\DeclareTextFontCommand\textitswitch\itswitch +\DeclareTextFontCommand\textslswitch\slswitch +\InputIfFileExists{slemph.cfg}{}{} +\endinput +%% +%% End of file `slemph.stq'. diff --git a/Master/texmf-dist/tex/latex/frankenstein/slemph.sty b/Master/texmf-dist/tex/latex/frankenstein/slemph.sty new file mode 100644 index 00000000000..f48c93cb761 --- /dev/null +++ b/Master/texmf-dist/tex/latex/frankenstein/slemph.sty @@ -0,0 +1,214 @@ +%^^A* legal notices +% \iffalse +% +% This program is part of the Frankenstein bundle for LaTeX. +% +% Copyright 1995-2001 Matt Swift <swift@alum.mit.edu>. +% +% This file contains both the code and documentation for the +% slemph LaTeX package. It will work ONLY if it is placed in a +% proper directory. Files called README, INSTALL, slemph.tex +% and slemph.ins should have also been distributed to you +% with this file. See them for more information on how to typeset +% the documentation with LaTeX and how to generate a version of this +% file that will work faster than this one. +% +% This program is free software; you may redistribute it and/or +% modify it under the conditions of the LaTeX Project Public +% License, either version 1.2 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. +% +% This program is distributed in the hope that it will be useful, +% but without any warranty; without even the implied warranty of +% merchantability or fitness for a particular purpose. See the +% LaTeX Project Public License for more details. +% +% \fi +% +%^^A* checks +% +%^^A NOTE: The character table, with two %'s, will get written to all files. +%% \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 \~} +% +% \CheckSum{41} +% +% \begin{abstract} +% The \package{slemph} package defines the commands \cs\itswitch, \cs\slswitch, +% \cs\textitswitch, and \cs\textslswitch, which switch between slanted or +% italic type and upright type. They can be used to represent emphasis with +% slanted type. +% \end{abstract} +% \tableofcontents +% +% \part{Discussion} +% +% \DescribeMacro\itswitch +% \cs\itswitch calls \cs\itshape if the current font is not italic, and +% \cs\upshape if the current font is italic. +% +% \DescribeMacro\slswitch +% \cs\slswitch calls \cs\slshape if the current font is not slanted, and +% \cs\upshape if the current font is slanted. +% +% \DescribeMacro\textitswitch +% \cs\textitswitch\marg{text} sets its argument with \cs\itshape if the +% current font is not italic, or \cs\upshape if the current font is italic. +% +% \DescribeMacro\textslswitch +% \cs\textslswitch\marg{text} sets its argument with \cs\slshape if the +% current font is not slanted, or \cs\upshape if the current font is slanted. +% +% Regarding all four commands above, notice that the factory definition of +% \cs\em would switch based on whether the current font was \emph{sloped}, +% which includes both slanted and italic type. I think slanted and italic type +% are different enough that you can leave, say, an italic word in the midst of +% a slanted context and it will still communicate to the reader whatever italic +% type signifies in an upright context. +% +% \StopEventually{} +% +% \part{Implementation} +% +% \section{Version control} +% +% \begin{macro}{\fileinfo} +% \begin{macro}{\DoXUsepackagE} +% \begin{macro}{\HaveECitationS} +% \begin{macro}{\fileversion} +% \begin{macro}{\filedate} +% \begin{macro}{\docdate} +% \begin{macro}{\PPOptArg} +% These definitions must be the first ones in the file. +% \begin{macrocode} +\def\fileinfo{slanted emphasis (Frankenstein's gait)} +\def\DoXPackageS {} +\def\fileversion{v1.2} +\def\filedate{1999/02/25} +\def\docdate{1999/02/25} +\edef\PPOptArg {% + \filedate\space \fileversion\space \fileinfo +} +% \end{macrocode} +% \end{macro} +% \end{macro} +% \end{macro} +% \end{macro} +% \end{macro} +% \end{macro} +% \end{macro} +% +% If we're loading this file from a \cs\ProcessDTXFile command (see the +% \package{compsci} package), then \cs\JusTLoaDInformatioN will be defined; +% othewise we assume it is not (that's why the FunkY NamE). +% +% If we're loading from \cs\ProcessDTXFile, we want to load the packages listed +% in \cs\DoXPackageS (needed to typeset the documentation for this file) and +% then bail out. Otherwise, we're using this file in a normal way as a +% package, so do nothing. \cs\DoXPackageS, if there are any, are declared in +% the \ext{dtx} file, and, if you're reading the typeset documentation of this +% package, would appear just above. (It's OK to call \cs\usepackage with an +% empty argument or \cs\relax, by the way.) +% \begin{macrocode} +\makeatletter% A special comment to help create bst files. Don't change! +\@ifundefined{JusTLoaDInformatioN} {% + }{% ELSE (we know the compsci package is already loaded, too) + \UndefineCS\JusTLoaDInformatioN + \SaveDoXVarS + \eExpand\csname DoXPackageS\endcsname\In {%use \csname in case it's undefined + \usepackage{#1}% + }% + \RestoreDoXVarS + \makeatother + \endinput +}% A special comment to help create bst files. Don't change! +% \end{macrocode} +% +% Now we check for \LaTeX2e and declare the LaTeX package. +% \begin{macrocode} +\NeedsTeXFormat{LaTeX2e} +\ProvidesPackage{slemph}[\PPOptArg] +% \end{macrocode}^^A special comment to help create bst files. Don't change! +% +% ^^A NOTE: We have to compensate for the above backslashes, which are not +% ^^A actually in the .dtx file the author works on, by adding to the +% ^^A CheckSum. +%% +% \AddToCheckSum{17}^^A `dtx-update-checksum' automatically handles this. +% \AddToCheckSum{7}^^A The half a macrocode env. at the top is missed, however... +% \AddToCheckSum{10}^^A ... and so are the 5 \defs from the .dtx file +% ^^A that precede it. +% \IfCitations {% +% \AddToCheckSum{2}^^A When \initelyHavECitationS is defined in +% } ^^A the .dtx file, we need 2 more in the CheckSum. +% +% +% \section{The switchers} +% +% \begin{macro}{\itswitch} +% \begin{macro}{\textitswitch} +% \begin{macro}{\slswitch} +% \begin{macro}{\textslswitch} +% Normally we would use the \cs\NewRobustCommand and \cs\NewTextFontCommand +% commands from the \package{moredefs} package, but this package is so small we +% might as well do that by hand and avoid dependence on that larger package, +% for efficiency. +% \begin{macrocode} +\newcommand\itswitch {} +\newcommand\slswitch {} +\newcommand\textitswitch {} +\newcommand\textslswitch {} + +\DeclareRobustCommand\itswitch {% + \@nomath\itswitch + \def\reserved@a{it}% + \ifx\f@shape\reserved@a + \upshape + \else + \itshape + \fi +} +\DeclareRobustCommand\slswitch {% + \@nomath\slswitch + \def\reserved@a{sl}% + \ifx\f@shape\reserved@a + \upshape + \else + \slshape + \fi +} +\DeclareTextFontCommand\textitswitch\itswitch +\DeclareTextFontCommand\textslswitch\slswitch +% \end{macrocode} +% \end{macro} +% \end{macro} +% \end{macro} +% \end{macro} +% +% \part{Configuration} +% +% Load a configuration file. +% \begin{macrocode} +\InputIfFileExists{slemph.cfg}{}{} +% \end{macrocode} +% +% The contents of the distributed configuration file are below. +% +% \InputIfFileExists{slemph.cfg}{}{} +% +% \Finale diff --git a/Master/texmf-dist/tex/latex/frankenstein/tag.sto b/Master/texmf-dist/tex/latex/frankenstein/tag.sto new file mode 100644 index 00000000000..e8bfe0fa161 --- /dev/null +++ b/Master/texmf-dist/tex/latex/frankenstein/tag.sto @@ -0,0 +1,441 @@ +% \AddToCheckSum{441} +% +% \subsection{Writing to \cname{@auxout}} +% +% \todo{ +% Might I need to do \code{\let\protect\@unexpandable@protect} instead of +% \cs\noexpand, in the def of \cname{\protected@writeaux}? +% } +% +% \begin{macro}{\nc@writeaux@main} +% \begin{macro}{\nc@protected@writeaux@main} +% The |main| versions are exactly the same as what they replaced. +% \begin{macrocode} +\newcommand\nc@writeaux@main {% + \immediate\write\@auxout +} +\newcommand\nc@protected@writeaux@main {% + \protected@write\@auxout +} +% \end{macrocode} +% \end{macro} +% \end{macro} +% +% \begin{macro}{\nc@writeaux@aux} +% \begin{macro}{\nc@protected@writeaux@aux} +% When you remove the \cs\immediate, you have to expand whatever's in the +% argument at the time you invoke \cs\write. \cs\IncludeName and +% \cname{@percentchar}, and other exandables in |#2| will get expanded now. +% The \cname{@percentchar} and the |^^J|s are there because lines written to +% \cname{@auxout} must be on lines by themselves to satisfy \BibTeX. The +% |^^J|s write newlines, and the \cname{@percentchar} eliminates a newline when +% the \ext{aux} file is read in again later. Accommodating \BibTeX{} requires +% special consideration several times below as well. +% \begin{macrocode} +\newcommand\nc@writeaux@aux [1] {% args: write-text + \eExecute {% + \write\@auxout{\string\@auxtag{\IncludeName}{\@percentchar^^J#1^^J}}% + }% +} +\newcommand\nc@protected@writeaux@aux [2] {% args: init-hook write-text + \protected@write\@auxout{#1}{\string\@auxtag{\IncludeName}{\@percentchar^^J#2^^J}}% +} +% \end{macrocode} +% \end{macro} +% \end{macro} +% +% \begin{macro}{\@writeaux} +% \begin{macro}{\@protected@writeaux} +% We start with the |main| versions. We don't reserve the control sequences +% \cname{@writeaux} and \cname{protected@writeaux} because the hack to adapt +% other packages might have already defined it with \cs\providecommand. +% \begin{macrocode} +\let\@writeaux\nc@writeaux@main +\let\protected@writeaux\nc@protected@writeaux@main +% \end{macrocode} +% \end{macro} +% \end{macro} +% +% \subsection{Kernel redefinitions} +% +% \begin{macro}{\@bibitem} +% \begin{macro}{\@lbibitem} +% \begin{macro}{\label} +% \begin{macro}{\@citex} +% \begin{macro}{\bibliography} +% \begin{macro}{\nocite} +% \begin{macro}{\addtocontents} +% These are simple redefinitions of kernel functions. The changes are the +% substitutions for the writing commands described above. +% \begin{macrocode} +\defcommand*\@bibitem [1] {% + \item + \if@filesw + \@writeaux{\string\bibcite{#1}{\the\value{\@listctr}}}% + \fi + \ignorespaces +} +\DefName*{@lbibitem} {[#1]#2} {% + \item[\@biblabel{#1}\hfill]% + \if@filesw + \begingroup + \let\protect\noexpand + \@writeaux{\string\bibcite{#2}{#1}}% + \endgroup + \fi + \ignorespaces +} +\defcommand*\label [1] {% + \@bsphack + \protected@writeaux{}{\string\newlabel{#1}{{\@currentlabel}{\thepage}}}% + \@esphack +} +\defcommand\addtocontents [2] {% + \protected@writeaux + { + \let\label\Gobble + \let\index\Gobble + \let\glossary\Gobble + } + {\string\@writefile{#1}{#2}}% +} +\DefName*{@citex} {[#1]#2} {% + \let\@citea\@empty + \@cite {% + \@for\@citeb:=#2\do {% + \@citea + \def\@citea{,\penalty\@m\ }% + \edef\@citeb{\expandafter\@firstofone\@citeb}% + \if@filesw + \@writeaux{\string\citation{\@citeb}}% + \fi + \@ifundefined{b@\@citeb} {% + \mbox{\reset@font\bfseries ?}% + \G@refundefinedtrue + \@latex@warning + {Citation `\@citeb' on page \thepage \space undefined}% + }{% ELSE + \hbox{\csname b@\@citeb\endcsname}% + }% + }% + }{#1}% second arg to \@cite +} +\defcommand*\bibliography [1] {% + \if@filesw + \@writeaux{\string\bibdata{#1}}% + \fi + \@input@{\jobname.bbl}% +} + \defcommand*\bibliographystyle [1] {% + \ifx\@begindocumenthook\@undefined\else + \expandafter\AtBeginDocument + \fi + {\if@filesw + \@writeaux{\string\bibstyle{#1}}% + \fi}% +} +\defcommand*\nocite [1] {% + \@bsphack + \@for\@citeb:=#1\do {% + \edef\@citeb{\expandafter\@firstofone\@citeb}% + \if@filesw + \@writeaux{\string\citation{\@citeb}}% + \fi + \@ifundefined{b@\@citeb} {% + \G@refundefinedtrue + \@latex@warning{Citation `\@citeb' undefined}% + }{}% + }% + \@esphack +} +% \end{macrocode} +% \end{macro} +% \end{macro} +% \end{macro} +% \end{macro} +% \end{macro} +% \end{macro} +% \end{macro} +% +% \subsection{Checkpoints} +% +% \begin{macro}{\@writeckpt} +% \begin{macro}{\@wckptelt} +% The \cname{@charlb}, \cname{@charrb}, and \cname{@percentchar} stuff is to +% satisfy \BibTeX{} (see above). +% \begin{macrocode} +\defcommand*\@writeckpt [1] {% + \if@filesw + \write\@auxout{\string\@setckpt{#1}\@charlb\@percentchar}% + {\let\@elt\@wckptelt + \cl@@ckpt}% + \write\@auxout{\@charrb}% + \fi +} +\defcommand\@wckptelt [1] {% + \write\@auxout{\string\setcounter{#1}{\the\@nameuse{c@#1}}}% +} +% \end{macrocode} +% \end{macro} +% \end{macro} +% +% \subsection{Including} +% +% \begin{macro}{\IncludeName} +% \begin{macro}{\ParentName} +% \begin{macro}{\nc@includename@<N>} +% \mbox{} +% \begin{macrocode} +\newcommand\IncludeName {% + \@nameuse{nc@includename@\theIncludeDepth}% +} +\newcommand\ParentName {% + \ifnum\value{IncludeDepth}= 0 + \jobname + \FrankenWarning{newclude}{Requested name of parent of principle source}% + \else +% \end{macrocode} +% The incrementation of the \cs{IncludeDepth} counter is local to the group. +% \begin{macrocode} + \begingroup + \advance\c@IncludeDepth by \m@one + \@nameuse{nc@includename@\theIncludeDepth}% + \endgroup + \fi +} +\NewName {nc@includename@0} {} {\jobname} +% \end{macrocode} +% \end{macro} +% \end{macro} +% \end{macro} +% +% \begin{macro}{\nc@include} +% \begin{macro}{\nc@@include} +% \todo{dox} +% \begin{macrocode} +\newcommand\nc@include [2][] {% args: hook filename + \@ifnextchar [ {%] + \nc@@include{#1}{#2}% + }{% ELSE + \nc@@include{#1}{#2}[]% + }% +} +\NewName{nc@@include}{#1#2[#3]} {% args: prehook filename posthook + \IfAllowed{#2} {% + \nc@t@b % surround the \include with something + \stepcounter{IncludeDepth}% + \DefName*{nc@includename@\theIncludeDepth} {} {#2}% + \let\@writeaux\nc@writeaux@aux + \let\protected@writeaux\nc@protected@writeaux@aux +% \end{macrocode} +% Now execute the text of the optional argument to \cs\include. +% \begin{macrocode} + #1% + \@input@{#2.tex}% + #3% + \@writeckpt{#2}% + \let\@writeaux\nc@writeaux@main + \let\protected@writeaux\nc@protected@writeaux@main +% \end{macrocode} +% We mustn't restore the counter before we have finished using it. +% \begin{macrocode} + \addtocounter{IncludeDepth}{\m@ne}% + \nc@t@b % surround the \include with something + }{% ELSE +% \end{macrocode} +% If the file is not allowed, we don't load it and do two things instead. We +% execute the part's checkpoint, then we write out the part's auxcommands and +% checkpoint again. We must handle the case when the auxcommands isn't +% defined; but the checkpoint will always be defined. +% \begin{macrocode} + \@ifundefined{cp@#2} {% +% \DTypeout{No information on part [#2]!}% + }{% ELSE + \@nameuse{cp@#2}% + \if@filesw% + \nc@write@auxcommands{#2}% + \nc@write@ckpt{#2}% + \fi% if@filesw + }% if@undefined + }% IfAllowed +}% +% \end{macrocode} +% \end{macro} +% \end{macro} +% +% \begin{macro}{\nc@write@auxcommands} +% \begin{macro}{\nc@write@ckpt} +% \todo{dox} +% +% \cs\meaning produces catcode 12's for all chars except spaces which are 10. +% Begin making definitions with |\catcode`\^^M=12| (other). +% \begin{macrocode} +\begingroup +\catcode`\^^M=12 %% double percents mean they're there only because of the catcode +%% +\Global\DefName*{nc@write@auxcommands} {#1} {% args: partname + \@ifundefined{nc@auxcommands@#1} {% + }{% ELSE + \write\@auxout{\string\@auxtag{#1}\@charlb\@percentchar}% + \EExpand*\csname nc@auxcommands@#1\endcsname\In {% + \edef\nc@t@a {% + \expandafter\strip@prefix\meaning ##1% + }% + }% + \edef\nc@t@a {\expandafter\nc@strip@M\nc@t@a\@nil}% +% \DTypeout{The auxcommands: \meaning\nc@t@a}% + \begingroup %% + \catcode`\^^M=12 % other + \nc@for\nc@t@b:=\nc@t@a\do {% +% \DTypeout{auxcommand ITEM: \meaning\nc@t@b}% + \EExpand\nc@t@b\In {% + \write\@auxout{##1}% + }% + }% + \endgroup %% + \write\@auxout{\@charrb}% + }% +}%% +\Global\DefName*{nc@write@ckpt} {#1} {% args: partname + \write\@auxout{\string\@setckpt{#1}\@charlb\@percentchar}% + \EExpand*\csname cp@#1\endcsname\In {% + \edef\nc@t@a {% + \expandafter\strip@prefix\meaning ##1% + }% + }% + \edef\nc@t@a {\expandafter\nc@strip@M\nc@t@a\@nil}% + \begingroup %% + \catcode`\^^M=12 % other + \nc@for\nc@t@b:=\nc@t@a\do {% +% \DTypeout{checkpoint ITEM: \meaning\nc@t@b}% + \EExpand\nc@t@b\In {% + \write\@auxout{##1}% + }% + }% + \endgroup %% + \write\@auxout{\@charrb}% +}%% +% \end{macrocode} +% \end{macro} +% \end{macro} +% +% \begin{macro}{\nc@for} +% \begin{macro}{\nc@forloop} +% \begin{macro}{\nc@iforloop} +% \cname{nc@for} is like the kernel's \cname{@for} but divides its list at +% |^^M|$_{12}$ instead of |,|. +% \begin{macrocode} +\Global\NewName{nc@for} {#1:=#2\do#3} {% FIX (what?) + \expandafter \def %% + \expandafter \@fortmp %% + \expandafter {#2}% + \ifx\@fortmp\@empty \else %% + \expandafter\nc@forloop#2^^M\@nil^^M\@nil\@@#1{#3}% + \fi %% +}%% +\Global\NewName{nc@forloop} {#1^^M#2^^M#3\@@#4#5} {% + \def#4{#1}% + \ifx #4\@nnil \else %% + #5% + \def#4{#2}% + \ifx #4\@nnil \else %% + #5% + \nc@iforloop #3\@@#4{#5}% + \fi %% + \fi %% +}%% +\Global\NewName{nc@iforloop} {#1^^M#2\@@#3#4} {% + \def#3{#1}% + \ifx #3\@nnil %% + \expandafter\@fornoop %% + \else %% + #4% + \relax %% + \expandafter\nc@iforloop %% + \fi %% + #2\@@#3{#4}% +}%% +% \end{macrocode} +% \end{macro} +% \end{macro} +% \end{macro} +% +% \begin{macro}{\nc@strip@M} +% This strips a final |^^M|$_{12}$ from its argument. \todo{I think this could be +% built in to \cname{nc@for}.} +% \begin{macrocode} +\Global\NewName{nc@strip@M} {#1^^M\@nil} {#1}%% +% \end{macrocode} +% Finish making definitions with |\catcode`\^^M=12|. +% \begin{macrocode} +\endgroup +% \end{macrocode} +% \end{macro} +% +% \begin{macro}{\@auxtag} +% \begin{macro}{\@@auxtag} +% We both execute and save. \todo{efficiency? check only once, then redefine +% auxtag?} \todo{dox}. +% +% I could use |\EExpand\In| for clarity, but I go for efficiency on this +% crucial macro. +% +% Begin making definitions with |\catcode`\^^M=12| (other). +% \begin{macrocode} +\begingroup +\catcode`\^^M\active %% double percents mean they're there only because of the catcode +%% +\Global\NewName*{@auxtag} {#1} {% args: partname + \begingroup %% + \catcode`\^^M\active %% + \@@auxtag{#1}% +}%% +\Global\NewName*{@@auxtag} {#1#2} {% args: partname auxcommands + \@ifundefined {nc@auxcommands@#1} {% + \nc@toks@a={#2}% + }{% ELSE + \expandafter \nc@toks@a %% + \expandafter \expandafter %% + \expandafter {\csname nc@auxcommands@#1\endcsname#2}% + }% + \expandafter\xdef\csname nc@auxcommands@#1\endcsname{\the\nc@toks@a}% + #2% + \endgroup %% +}%% +% \end{macrocode} +% \end{macro} +% \end{macro} +% +% \begin{macro}{\@setckpt} +% \begin{macro}{\@@setckpt} +% \todo{dox} +% \begin{macrocode} +\Global\DefName*{@setckpt} {#1} {% args: partname + \begingroup %% + \catcode`\^^M\active %% + \@@setckpt{#1}% +}%% +% \end{macrocode} +% Finish making definitions with |\catcode`\^^M=12|. +% \begin{macrocode} +\endgroup +% \end{macrocode} +% The \cs\endgroup terminates the change in catcode. +% \begin{macrocode} +\newcommand*\@@setckpt [2] {% args: partname checkpoint + \expandafter\gdef\csname cp@#1\endcsname{#2}% + \endgroup +} +% \end{macrocode} +% \end{macro} +% \end{macro} +% +% What this does is effectively remove all the tags. The end of document hook +% is processed before the closing processing of the \ext{aux} files, during +% which checking for things like undefined references is done. At this point +% we do not need the tags. +% \begin{macrocode} +\AtEndDocument {% + \let\@auxtag\@secondoftwo +} +% \end{macrocode} diff --git a/Master/texmf-dist/tex/latex/frankenstein/titles.cfg b/Master/texmf-dist/tex/latex/frankenstein/titles.cfg new file mode 100644 index 00000000000..27b3a5c16d9 --- /dev/null +++ b/Master/texmf-dist/tex/latex/frankenstein/titles.cfg @@ -0,0 +1,412 @@ +% \iffalse +%% +% Even if you don't want any code in this file, leave the empty file, or else +% loading the \package{titles} package will consume extra time as it searches +% for this file. +%% +% \fi +% \begin{macrocode} +\def\fileinfo{titles package configuration} +\def\fileversion{v1.4} +\def\filedate{2001/08/31} +\def\docdate{2001/08/31} +% \end{macrocode} +% +% \AddToCheckSum{24} +% +% \begin{macrocode} +\ProvidesFile{titles.cfg} +% \end{macrocode} +% +% \section{User Customization} +% +% Put your own alterations and additions here. For example. +% \begin{macrocode} +% \let\word\textslswitch + \newlet\longpoem\textitswitch + \newlet\film\textitswitch + \newlet\essaytitle\Wrapquotes + \newlet\chaptertitle\Wrapquotes +% \end{macrocode} +% +% \part{Testing} +% +% \begingroup +% \setlength\parindent{0pt} +% \raggedright +% +% \subsection{Question and exclamation marks} +% +% \newcommand\TestQE [1] {% +% Test string: [#1]\qquad Result: +% \IfQuestionOrExclamation{#1} +% {Question or Exclamation} +% {Declarative} +% } +% +% \TestQE{% +% Title% +% } +% +% \TestQE{% +% Title?% +% } +% +% \TestQE{% +% Title!% +% } +% +% \TestQE{% +% Title??% +% } +% +% \TestQE{% +% Title!!% +% } +% +% \TestQE{% +% Title? Title% +% } +% +% \TestQE{% +% Title! Title% +% } +% +% \TestQE{% +% Title!?% +% } +% +% \TestQE{% +% Title?!% +% } +% +% \TestQE{% +% Title? Title?% +% } +% +% \TestQE{% +% Title? Title!% +% } +% +% \TestQE{% +% Title! Title?% +% } +% +% \TestQE{% +% Title?? Title% +% } +% +% \TestQE{% +% Title!! Title% +% } +% +% \subsection{Plain} +% +% \book{Book Title}. Test. +% +% \book{Book Title}, test. +% +% \book{Book Title}; test. +% +% \book{Book Title} test. +% +% \play{Play Title}. Test. +% +% ``Play Title.'' Test. +% +% \play{Play Title}, test. +% +% ``Play Title,'' test. +% +% \play{Play Title}; test. +% +% ``Play Title''; test. +% +% \play{Play Title} test. +% +% ``Play Title'' test. +% +% \play{title}~tie +% +% ``title''~tie +% +% \play{title}\ explicit space +% +% ``title''\ explicit space +% +% \play{title}\space \cs\space +% +% ``title''\space \cs\space +% +% \play{title}/slash +% +% ``title''/slash +% +% \play{title}\/ italcorr +% +% ``title''\/ italcorr +% +% \newpage {\makeatletter +% +% \play{title}\@xobeysp xobey +% +% } +% +% {\makeatletter +% +% ``title''\@xobeysp xobey +% +% } +% \subsection{Nested beginnings} +% +%% +% +% \book{\book{Book Title} begins first book title} and +% outside. +% +% \book{\book{Book Title}, begins first book title}, and +% outside. +% +% \book{\book{Book Title}. begins first book title}. and +% outside. +% +% \book{\book{Book Title}; begins first book title}; and +% outside. +% +%% +% +% \book{\play{Play Title} begins first book title} and +% outside. +% +% \book{\play{Play Title}, begins first book title}, and +% outside. +% +% \book{\play{Play Title}. begins first book title}. and +% outside. +% +% \book{\play{Play Title}; begins first book title}; and +% outside. +% +%% +% +% \play{\book{Book Title} begins first play title} and +% outside. +% +% \play{\book{Book Title}, begins first play title}, and +% outside. +% +% \play{\book{Book Title}. begins first play title}. and +% outside. +% +% \play{\book{Book Title}; begins first play title}; and +% outside. +% +%% +% +% \play{\play{Play Title} begins first play title} and +% outside. +% +% \play{\play{Play Title}, begins first play title}, and +% outside. +% +% \play{\play{Play Title}. begins first play title}. and +% outside. +% +% \play{\play{Play Title}; begins first play title}; and +% outside. +% +%% +% \subsection{Nested endings} +% +% There are too many cases I think to test them all. I'm testing to +% three levels of nesting. +% +% This is a \book{Book Title including \book{Book Title including +% \book{Book Title}} and ending first one} and outside. +% +% This is a \book{Book Title including \book{Book Title including +% \book{Book Title}}, and ending first one}, and outside. +% +% This is a \book{Book Title including \book{Book Title including +% \book{Book Title}}. and ending first one}. and outside. +% +% This is a \book{Book Title including \book{Book Title including +% \book{Book Title}}; and ending first one}; and outside. +% +%% +% +% This is a \book{Book Title including \book{Book Title including +% \play{Play Title}} and ending first one} and outside. +% +% This is a \book{Book Title including \book{Book Title including +% \play{Play Title}}, and ending first one}, and outside. +% +% This is a \book{Book Title including \book{Book Title including +% \play{Play Title}}. and ending first one}. and outside. +% +% This is a \book{Book Title including \book{Book Title including +% \play{Play Title}}; and ending first one}; and outside. +% +%% +% +% This is a \book{Book Title including \play{Play Title including +% \book{Book Title}} and ending first one} and outside. +% +% This is a \book{Book Title including \play{Play Title including +% \book{Book Title}}, and ending first one}, and outside. +% +% This is a \book{Book Title including \play{Play Title including +% \book{Book Title}}. and ending first one}. and outside. +% +% This is a \book{Book Title including \play{Play Title including +% \book{Book Title}}; and ending first one}; and outside. +% +%% +% +% This is a \book{Book Title including \play{Play Title including +% \play{Play Title}} and ending first one} and outside. +% +% This is a \book{Book Title including \play{Play Title including +% \play{Play Title}}, and ending first one}, and outside. +% +% This is a \book{Book Title including \play{Play Title including +% \play{Play Title}}. and ending first one}. and outside. +% +% This is a \book{Book Title including \play{Play Title including +% \play{Play Title}}; and ending first one}; and outside. +% +%% +% +% This is a \play{Play Title including \play{Play Title including +% \play{Play Title}} and ending first one} and outside. +% +% This is a \play{Play Title including \play{Play Title including +% \play{Play Title}}, and ending first one}, and outside. +% +% This is a \play{Play Title including \play{Play Title including +% \play{Play Title}}. and ending first one}. and outside. +% +% This is a \play{Play Title including \play{Play Title including +% \play{Play Title}}; and ending first one}; and outside. +% +%% +% +% This is a \play{Play Title including \play{Play Title including +% \book{Book Title}} and ending first one} and outside. +% +% This is a \play{Play Title including \play{Play Title including +% \book{Book Title}}, and ending first one}, and outside. +% +% This is a \play{Play Title including \play{Play Title including +% \book{Book Title}}. and ending first one}. and outside. +% +% This is a \play{Play Title including \play{Play Title including +% \book{Book Title}}; and ending first one}; and outside. +% +%% +% +% This is a \play{Play Title including \book{Book Title including +% \play{Play Title}} and ending first one} and outside. +% +% This is a \play{Play Title including \book{Book Title including +% \play{Play Title}}, and ending first one}, and outside. +% +% This is a \play{Play Title including \book{Book Title including +% \play{Play Title}}. and ending first one}. and outside. +% +% This is a \play{Play Title including \book{Book Title including +% \play{Play Title}}; and ending first one}; and outside. +% +%% +% +% This is a \play{Play Title including \book{Book Title including +% \book{Book Title}} and ending first one} and outside. +% +% This is a \play{Play Title including \book{Book Title including +% \book{Book Title}}, and ending first one}, and outside. +% +% This is a \play{Play Title including \book{Book Title including +% \book{Book Title}}. and ending first one}. and outside. +% +% This is a \play{Play Title including \book{Book Title including +% \book{Book Title}}; and ending first one}; and outside. +% +%% +% +% \subsection{double and single nosuck} +% \newcommand\note [1] {% +% \medskip{\bfseries #1:}% +% } +% +% \note{OS=open-single\quad OD=open-double\quad CS=close-single\quad +% CD=close-double +% +% The following pairs of lines in medium weight roman should look identical. +% +% The line in typewriter font is the source text. +% +% The following line in medium weight roman is what that source produces. +% +% The third line is what the second line \emph{ought} to produce} +% +% |The word \WrapquotesDN{quoted} is quoted.| +% +% The word \WrapquotesDN{quoted} is quoted. +% +% The word ``quoted'' is quoted. +% +% \medskip +% |The word \WrapquotesSN{scare} is in scare quotes.| +% +% The word \WrapquotesSN{scare} is in scare quotes. +% +% The word `scare' is in scare quotes. +% +% \note{Nesting with no abuttment} +% +% |\WrapquotesDN{The \WrapquotesSN{quick} brown fox \WrapquotesDN{jumped} over the lazy dogs.}| +% +% \WrapquotesDN{The \WrapquotesSN{quick} brown fox \WrapquotesDN{jumped} over the lazy dogs.} +% +% ``The `quick' brown fox ``jumped'' over the lazy dogs.'' +% +% \medskip +% |\WrapquotesSN{The \WrapquotesSN{quick} brown fox \WrapquotesDN{jumped} over the lazy dogs.}| +% +% \WrapquotesSN{The \WrapquotesSN{quick} brown fox \WrapquotesDN{jumped} over the lazy dogs.} +% +% `The `quick' brown fox ``jumped'' over the laxy dogs.' +% +% \note{OS+OS, CD+CS} +% +% |\WrapquotesSN{\WrapquotesSN{The quick} brown fox jumped over the \WrapquotesDN{lazy dogs.}}| +% +% \WrapquotesSN{\WrapquotesSN{The quick} brown fox jumped over the \WrapquotesDN{lazy dogs.}} +% +% `\,`The quick brown fox jumped over the ``lazy dogs.''\,' +% +% \note{OS+OD, CD+CS} +% +% |\WrapquotesSN{\WrapquotesDN{The quick} brown fox jumped over the \WrapquotesSN{lazy dogs.}}| +% +% \WrapquotesSN{\WrapquotesDN{The quick} brown fox jumped over the \WrapquotesSN{lazy dogs.}} +% +% `\,``The quick'' brown fox jumped over the `lazy dogs.'\,' +% +% \note{OD+OD, CS+CD} +% +% |\WrapquotesDN{\WrapquotesDN{The quick} brown fox jumped over the \WrapquotesSN{lazy dogs.}}| +% +% \WrapquotesDN{\WrapquotesDN{The quick} brown fox jumped over the \WrapquotesSN{lazy dogs.}} +% +% ``\,``The quick'' brown fox jumped over the `lazy dogs.'\,'' +% +% \note{OS+OD, CS+CS} +% +% |\WrapquotesSN{\WrapquotesDN{The quick} brown fox jumped over the \WrapquotesSN{lazy dogs.}}| +% +% \WrapquotesSN{\WrapquotesDN{The quick} brown fox jumped over the \WrapquotesSN{lazy dogs.}} +% +% `\,``The quick'' brown fox jumped over the `lazy dogs.'\,' +% +% \endgroup diff --git a/Master/texmf-dist/tex/latex/frankenstein/titles.stq b/Master/texmf-dist/tex/latex/frankenstein/titles.stq new file mode 100644 index 00000000000..c540e9a5348 --- /dev/null +++ b/Master/texmf-dist/tex/latex/frankenstein/titles.stq @@ -0,0 +1,432 @@ +%% +%% This is file `titles.stq', +%% generated with the docstrip utility. +%% +%% The original source files were: +%% +%% titles.sty +%% +%% This program is part of the Frankenstein bundle for LaTeX. +%% +%% Copyright (C) 1995-2001 Matthew Swift <swift@alum.mit.edu> +%% +%% This file may have one of TWO names, either +%% titles.sty or titles.stq. This +%% LaTeX package will work ONLY if it is called titles.sty +%% and placed in a proper directory. This file should have been +%% distributed to you with a DIFFERENT file (also) called +%% titles.sty which functions identically to this one +%% but contains documentation in comments. This file works faster, +%% but the other should be kept because it contains the documentation +%% for this LaTeX package. Files called README and INSTALL should have +%% also been distributed to you with this file; see them for more +%% information. +%% +%% This program is free software; you may redistribute it and/or +%% modify it under the conditions of the LaTeX Project Public +%% License, either version 1.2 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. +%% +%% This program is distributed in the hope that it will be useful, +%% but WITHOUT ANY WARRANTY; without even the implied warranty of +%% MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the +%% LaTeX Project Public License for more details. +%% +%% \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 \~} +\def\fileinfo{title macros (Frankenstein's references)} +\def\DoXPackageS {} +\def\initelyHavECitationS {} +\def\fileversion{v1.2} +\def\filedate{2001/08/31} +\def\docdate{2001/08/31} +\edef\PPOptArg {% + \filedate\space \fileversion\space \fileinfo +} +\makeatletter% A special comment to help create bst files. Don't change! +\@ifundefined{JusTLoaDInformatioN} {% + }{% ELSE (we know the compsci package is already loaded, too) + \UndefineCS\JusTLoaDInformatioN + \SaveDoXVarS + \eExpand\csname DoXPackageS\endcsname\In {%use \csname in case it's undefined + \usepackage{#1}% + }% + \RestoreDoXVarS + \makeatother + \endinput +}% A special comment to help create bst files. Don't change! +\NeedsTeXFormat{LaTeX2e} +\ProvidesPackage{titles}[\PPOptArg] +%% +\RequirePackage{moredefs,slemph} +\ReserveCS\ti@domelater +\DeclareOption{british} {% + \def\ti@domelater {% + \let\Wrapquotes\WrapquotesNN + \@doublequotes@false + } +} +\DeclareOption{american} {% + \def\ti@domelater {% + \let\Wrapquotes\WrapquotesNS + \@doublequotes@true + } +} +\ExecuteOptions{american} +\ProcessOptions +\newcommand\IfQuestionOrExclamation [1] {% + \@tempswafalse + \ti@checkfor@q #1?\@nil + \ti@checkfor@e #1!\@nil + \if@tempswa + \expandafter\@firstoftwo + \else + \expandafter\@secondoftwo + \fi +} +\newboolean{@ti@sw@} +\ReserveCS\ti@prev +\ReserveCS\ti@prev@prev +\NewName{ti@checkfor@q} {#1?#2\@nil} {% + \def\sc@t@a{#2}% + \def\sc@t@b{?}% + \ifx\sc@t@a\ShortEmpty + \else + \ifx\sc@t@a\sc@t@b + \@tempswatrue + \else + \let\ti@prev\sc@t@a + \let\ti@prev@prev\sc@t@a + \@ti@sw@true + \@whilesw \if@ti@sw@ \fi {% + \ifx\sc@t@a\ShortEmpty + \@ti@sw@false + \else + \let\ti@prev@prev\ti@prev + \let\ti@prev\sc@t@a + \edef\sc@t@a{\E@cdr\sc@t@a\@nil}% + \fi + }% + \edef\ti@prev@prev{\E@car\ti@prev@prev\@nil}% + \ifx\ti@prev@prev\sc@t@b + \@tempswatrue + \fi + \fi + \fi +} +\NewName{ti@checkfor@e} {#1!#2\@nil} {% + \def\sc@t@a{#2}% + \def\sc@t@b{!}% + \ifx\sc@t@a\ShortEmpty + \else + \ifx\sc@t@a\sc@t@b + \@tempswatrue + \else + \let\ti@prev\sc@t@a + \let\ti@prev@prev\sc@t@a + \@ti@sw@true + \@whilesw \if@ti@sw@ \fi {% + \ifx\sc@t@a\ShortEmpty + \@ti@sw@false + \else + \let\ti@prev@prev\ti@prev + \let\ti@prev\sc@t@a + \edef\sc@t@a{\E@cdr\sc@t@a\@nil}% + \fi + }% + \edef\ti@prev@prev{\E@car\ti@prev@prev\@nil}% + \ifx\ti@prev@prev\sc@t@b + \@tempswatrue + \fi + \fi + \fi +} +\newcommand*\ti@wrapquotes@suck [1] {% + \IfQuestionOrExclamation {#1} {% + \ti@wrapquotes@nosuck{#1}% + }{% ELSE + \begingroup + \if@doublequotes@ + \@doublequotes@false + \def\sc@t@a {\ti@open@double #1\ti@close@double@suck}% + \else + \@doublequotes@true + \def\sc@t@a {\ti@open@single #1\ti@close@single@suck}% + \fi + \sc@t@a + \endgroup + }% +} +\newcommand*\ti@wrapquotes@nosuck [1] {% + \begingroup + \if@doublequotes@ + \@doublequotes@false + \def\sc@t@a {\ti@open@double #1\ti@close@double@nosuck}% + \else + \@doublequotes@true + \def\sc@t@a {\ti@open@single #1\ti@close@single@nosuck}% + \fi + \sc@t@a + \endgroup +} +\newboolean{@doublequotes@} +\newcommand*\WrapquotesNS {% + \ti@wrapquotes@suck +} +\newcommand*\WrapquotesIS {% + \ToggleBoolean{@doublequotes@}% + \ti@wrapquotes@suck +} +\newcommand*\WrapquotesNN {% + \ti@wrapquotes@nosuck +} +\newcommand*\WrapquotesIN {% + \ToggleBoolean{@doublequotes@}% + \ti@wrapquotes@nosuck +} +\newcommand*\WrapquotesSN [1] {% + \begingroup + \ti@open@single #1\ti@close@single@nosuck + \endgroup +} +\newcommand*\WrapquotesDN [1] {% + \begingroup + \ti@open@double #1\ti@close@double@nosuck + \endgroup +} +\newcommand*\WrapquotesSK [1] {% FIX: test + \begingroup + \ti@open@single #1\ti@close@single@nosuck\@% + \endgroup +} +\ReserveCS\Wrapquotes +\ti@domelater +\newcommand\ti@open@double {% + \gdef\sc@t@f {\textquotedblleft}% + \ti@openquote +} +\newcommand\ti@open@single {% + \gdef\sc@t@f {\textquoteleft}% + \ti@openquote +} +\newcommand\ti@openquote {% + \futurelet\sc@t@a\ti@@openquote +} +\newcommand\ti@@openquote {% + \sc@t@f + \ifx\sc@t@a\WrapquotesNS + \,% + \else \ifx\sc@t@a\WrapquotesNN + \,% + \else \ifx\sc@t@a\WrapquotesIN + \,% + \else \ifx\sc@t@a\WrapquotesIS + \,% + \else \ifx\sc@t@a\WrapquotesSN + \,% + \else \ifx\sc@t@a\WrapquotesDN + \,% + \else \ifx\sc@t@a\WrapquotesSK + \,% + \else + \fi \fi \fi \fi \fi \fi \fi +} +\newcommand*\ti@close@single@nosuck {% + \aftergroup\ti@close@single@@nosuck +} +\newcommand*\ti@close@double@nosuck {% + \aftergroup\ti@close@double@@nosuck +} +\newcommand*\ti@close@single@@nosuck {% + \gdef\sc@t@f {\textquoteright}% + \ti@close@quote@nosuck +} +\newcommand*\ti@close@double@@nosuck {% + \gdef\sc@t@f {\textquotedblright}% + \ti@close@quote@nosuck +} +\newboolean{@look@nosuck@} +\@look@nosuck@false +\newcommand\ti@close@quote@nosuck {% + \@look@nosuck@true +%% FIX + \expandafter \ti@q@ifnextcharin \expandafter {\nospacelist} {% + \sc@t@f + }{% ELSE + \sc@t@f\space + }% +} +\newcommand\ti@close@double@suck {% + \aftergroup\ti@close@double@@suck +} +\newcommand\ti@close@single@suck {% + \aftergroup\ti@close@single@@suck +} +\newcommand\ti@close@double@@suck {% + \gdef\sc@t@f {\textquotedblright}% + \ti@close@quote@suck +} +\newcommand\ti@close@single@@suck {% + \gdef\sc@t@f {\textquoteright}% + \ti@close@quote@suck +} +\requirecommand\nospacelist {% + ,.':;?-/\slash~!)]\bgroup\egroup\@sptoken\ \space\/\@xobeysp +} +\newcommand\ti@close@quote@suck {% + \@look@nosuck@false + \ti@q@ifnextcharin {.,} {% + \sc@t@c\sc@t@f\DGobbleM % This gobbles the original punctuation. + }{% ELSE + \@look@nosuck@true + \expandafter \ti@q@ifnextcharin \expandafter {\nospacelist} {% + \sc@t@f + }{% ELSE + \sc@t@f\space + }% + }% +} +%% FIX +\newcommand\ti@q@ifnextcharin [3] {% args: charlist true false + \gdef\sc@t@e {#1}% + \gdef\sc@t@a {#2}% + \gdef\sc@t@b {#3}% + \ti@q@check +} +\newcommand\ti@q@check {% + \futurelet\sc@t@c\ti@q@ifnch +} +%% \verb*|\ | +\newcommand\ti@q@ifnch {% + \ifx\sc@t@c\ifvmode + \let\sc@t@d\ti@q@handle@ifvmode + \else + \let\sc@t@d\ti@q@@ifnch + \fi + \sc@t@d +} +\newcommand\ti@q@@ifnch {% + \ifx\sc@t@c\check@icr + \defcommand\sc@t@d [1] {% + ##1\aftergroup\ti@q@check + }% + \else \ifx\sc@t@c\endgroup + \def\sc@t@d {\aftergroup\ti@q@check}% + \else \ifx\sc@t@c\@sptoken + \let\sc@t@d\ti@q@handle@space + \else \ifx\sc@t@c\egroup + \def\sc@t@d {\aftergroup\ti@q@check}% + \else \ifx\sc@t@c\ti@close@double@suck + \let\sc@t@d\ti@q@handle@double@suck + \else \ifx\sc@t@c\ti@close@single@suck + \let\sc@t@d\ti@q@handle@single@suck + \else \ifx\sc@t@c\ti@close@double@nosuck + \let\sc@t@d\ti@q@handle@double@nosuck + \else \ifx\sc@t@c\ti@close@single@nosuck + \let\sc@t@d\ti@q@handle@single@nosuck + \else + \@tempswafalse + \expandafter \@tfor + \expandafter \sc@t@g + \expandafter :% + \expandafter =% + \sc@t@e + \do {% + \expandafter\ifx\sc@t@g\sc@t@c + \@tempswatrue + \@break@tfor + \else + \fi + }% + \if@tempswa + \let\sc@t@d\sc@t@a % the ``true'' clause + \else + \let\sc@t@d\sc@t@b % the ``false'' clause + \fi + \fi \fi \fi \fi \fi \fi \fi \fi + \sc@t@d +} +\newcommand\ti@q@handle@ifvmode {% + \FrankenInfo{titles} + {Handling an \string\ifvmode\space following a title.\MessageBreak + If you now get an error that \string\sc@t@d\space does not\MessageBreak + match its definition, this \string\ifvmode\space is\MessageBreak + unexpected}% + \DefName{sc@t@d} {\ifvmode\else\check@icr\fi} {% + \ifvmode + \else + \check@icr + \fi + \aftergroup\ti@q@check + }% + \sc@t@d +} +\ReserveCS\ti@q@handle@space +\let\sc@t@a\: +\def\:{\ti@q@handle@space} \expandafter\def\: {\ti@q@check} +\let\:\sc@t@a +\newcommand*\ti@q@handle@double@suck [1] {% + \g@addto@macro\sc@t@f {\,\textquotedblright}% + \ti@q@check +} +\newcommand*\ti@q@handle@single@suck [1] {% + \g@addto@macro\sc@t@f {\,\textquoteright}% + \ti@q@check +} +\newcommand*\ti@q@handle@double@nosuck [1] {% + \if@look@nosuck@ + \g@addto@macro\sc@t@f {\,\textquotedblright}% + \let\sc@t@d\sc@t@a % the ``true'' clause of ti@q@ifnextcharin + \else + \let\sc@t@d\sc@t@b % the ``false'' clause of ti@q@ifnextcharin + \fi + \ti@q@check +} +\newcommand*\ti@q@handle@single@nosuck [1] {% + \if@look@nosuck@ + \g@addto@macro\sc@t@f {\,\textquoteright}% + \let\sc@t@d\sc@t@a % the ``true'' clause of ti@q@ifnextcharin + \else + \let\sc@t@d\sc@t@b % the ``false'' clause of ti@q@ifnextcharin + \fi + \ti@q@check +} +\newlet\word\textitswitch +\newlet\foreign\textitswitch +\newcommand\foreignword [1] {% + \phrase{\word{#1}}% +} + +\newcommand\phrase [1] {% + \textquoteleft #1\textquoteright\@% +} +\newlet\term\textitswitch +\newlet\defn\textslswitch +\newlet\book\textitswitch +\newlet\journal\textitswitch +\newlet\music\textitswitch +\newlet\article\Wrapquotes +\newlet\storytitle\Wrapquotes +\newlet\poemtitle\Wrapquotes +\newlet\play\textitswitch % \manualref{7.145} +\newlet\craft\textitswitch +\newlet\species\textitswitch +\InputIfFileExists{titles.cfg}{}{} +\endinput +%% +%% End of file `titles.stq'. diff --git a/Master/texmf-dist/tex/latex/frankenstein/titles.sty b/Master/texmf-dist/tex/latex/frankenstein/titles.sty new file mode 100644 index 00000000000..c2d58e469d0 --- /dev/null +++ b/Master/texmf-dist/tex/latex/frankenstein/titles.sty @@ -0,0 +1,1312 @@ +%^^A* legal notices +% \iffalse +% +% This program is part of the Frankenstein bundle for LaTeX. +% +% Copyright 1995-2001 Matt Swift <swift@alum.mit.edu>. +% +% This file contains both the code and documentation for the +% titles LaTeX package. It will work ONLY if it is placed in a +% proper directory. Files called README, INSTALL, titles.tex +% and titles.ins should have also been distributed to you +% with this file. See them for more information on how to typeset +% the documentation with LaTeX and how to generate a version of this +% file that will work faster than this one. +% +% This program is free software; you may redistribute it and/or +% modify it under the conditions of the LaTeX Project Public +% License, either version 1.2 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. +% +% This program is distributed in the hope that it will be useful, +% but without any warranty; without even the implied warranty of +% merchantability or fitness for a particular purpose. See the +% LaTeX Project Public License for more details. +% +% \fi +% +%^^A* checks +% +%^^A NOTE: The character table, with two %'s, will get written to all files. +%% \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 \~} +% +% \CheckSum{783} +% +%^^A** abstract +% \begin{abstract} +% The \package{titles} package defines macros that typeset the titles of +% books, journals, etc. and handle following spacing and punctuation +% intelligently, based on context. These are useful for bibliographic +% databases, for example. Also defined is other markup like \cs\word, +% \cs\defn, \cs\phrase, etc. +% \end{abstract} +% \tableofcontents +% +% \part{Discussion} +% +% \section{Options} +% +% There are two package options, \option{british} and \option{american}, the default +% is \option{american}. They select the conventional way to use quotation marks: +% British style is use single quotes, and do not suck following period or comma +% inside; American style is to use double quotes and to suck following period +% or comma inside. +% +% \section{Words and phrases} +% +% \DescribeMacro\word +% Typeset a word or phrase referred to as a noun with \cs\word\marg{word}. +% The argument is not expected to contain punctuation. +% +% \begin{bothexample} +% \word{Elephant} is such a silly word. +% \end{bothexample} +% +% \DescribeMacro\phrase +% Typeset a phrase used as a noun rather than direct quotation with +% \cs\phrase\marg{phrase}. The argument might well have punctuation, +% including final punctuation, which should not be considered to be +% punctuation of the containing sentence. +% +% \begin{bothexample} +% The sentence \phrase{And stop calling me Shirley!} occurs +% twenty-seven times. +% \end{bothexample} +% +% \DescribeMacro{\foreign} +% Typeset a foreign word or phrase with \cs\foreign\marg{foreign text}. +% +% \begin{bothexample} +% I couldn't think of the \foreign{mot juste} at the time. +% \end{bothexample} +% +% \DescribeMacro{\foreignword} +% Typeset a foreign word or phrase referred to as a noun with +% \cs\foreignword\marg{foreign word}. +% +% \begin{bothexample} +% Only later did I realize that the right word was +% \foreignword{bouffon}. +% \end{bothexample} +% +% \caveat {Notice that writing \code{\foreign{\word{text}}} or vice versa is +% not necessarily going to do the right thing. Suppose \cs\foreign and +% \cs\word were both set to \cs\textitswitch (which are in fact the default +% settings below). Then \code{\foreign{\word{text}}} is going to cancel out +% and look just like the surrounding text. This is not the most intuitive +% fact, but it's not worth it to try to make \cs\foreign and \cs\word smart +% enough to see each other inside themselves.} +% +% \DescribeMacro{\term} +% \cs\term\marg{technical term} typesets a techincal term in a different +% font. You might want to use this where a techincal term is first used, or +% defined. One could enhance this macro and \cs\defn to help build an +% automatic glossary +% +% \begin{bothexample} +% This sort of thing is called a \term{blibnil}. +% \end{bothexample} +% +% \DescribeMacro{\defn} +% \cs\defn\marg{definition} typesets a definition, perhaps of a technical +% term. One could enhance this macro and \cs\defn to help build an automatic +% glossary +% +% \begin{bothexample} +% We may describe a \term{blibnil} as \defn{a slibnil with +% three arms}. +% \end{bothexample} +% +% \section{Titles} +% +% \DescribeMacro\book +% \cs\book\marg{book title} typesets a book title. +% +% \begin{bothexample} +% Some people find \book{Moby-Dick} dull, but I thought +% it was exciting. +% \end{bothexample} +% +% \DescribeMacro\journal +% \cs\journal\marg{journal title} typesets a journal title. +% +% \begin{bothexample} +% I liked it so much I started a scholarly journal called +% \journal{The Melville Times} with the inheritance from +% my grandmother. +% \end{bothexample} +% +% \DescribeMacro\music +% \cs\music\marg{music title} typesets a music title. +% +% \begin{bothexample} +% My journal didn't do very well; I moped around my office +% and listened to Schubert's \music{Winterreise}. +% \end{bothexample} +% +% \DescribeMacro\article +% \cs\article\marg{article title} typesets a article title. +% +% \begin{bothexample} +% Then one day I received an article, \article{Pip and +% the Milk of Human Kindness}, by express mail from Wales. +% \end{bothexample} +% +% \DescribeMacro\poemtitle +% \cs\poemtitle\marg{poem title} typesets a poem title. +% +% \begin{bothexample} +% I then wrote my famous poem \poemtitle{Jump for Joy like +% the Butterflies of Troy} in five minutes. +% \end{bothexample} +% +% Sometimes longer poems are distinguished from shorter ones in type when +% they have been published separately as a book [FIX give reference]. This +% package defines a macro \cs\longpoem in the configuration file in the +% following way: +% \begin{codeexample} +% \newlet\longpoem\textitswitch +% \end{codeexample} +% +% \DescribeMacro\play +% \cs\play\marg{play title} typesets a play title. +% +% \begin{bothexample} +% To celebrate the popularity of the article, I took the +% author to the theater to see the acclaimed play +% \play{Grave in Waterloo}, starring Vincent Price. +% \end{bothexample} +% +% \DescribeMacro\craft +% \cs\craft\marg{craft title} typesets a title of a craft or ship. +% +% \begin{bothexample} +% With tears in my heart, I put the author on the \craft{HMS Shangrila} +% bound for Wales. +% \end{bothexample} +% +% \DescribeMacro\species +% \cs\species\marg{[ genus ] species [ subspecies ]} typesets the Latin +% generic and/or specific names for an organism. +% +% \begin{lesson} +% \manual specifies italic type. Genus names should be capitalized, and +% may be abbreviated on subsequent appearances with the initial letter. +% Following designations should be in roman. E.g., ``var.''\ for +% ``variant'' following species name and ``sp.''\ for ``species'' following +% genus name, meaning ``any species in the genus.'' \attrib{7.102--4} +% +% Higher groupings should be in capitalized roman. English derivatives of +% scientific names, e.g., amoeba, are lowercased. \attrib{7.105--6} +% +% \todo{\package{abbrevs} +% category for genus/species and/or datemark for suffixes} +% \end{lesson} +% +% \begin{warning} +% Right now there is a small discrepancy between the behavior of +% \cs\textitswitch and \cs\Wrapquotes regarding what happens when followed by +% a command sequence such as \cs\footnote. I hope to make these things +% completely parallel one day, but for now, realize that after using a +% titling macro that uses \cs\Wrapquotes, you must use |{}| before any +% following command sequence that you want to immediately follow the title +% with no intervening space. The only case I can think of is \cs\footnote. +% If you forget the |{}|, you will have an extra space after the title and before the +% footnotemark. The following example illustrates this behavior and +% contrasts it with \cs\textitswitch: +% \begin{bothexample} +% \newabbrev\foo{Foo} +% +% \book{Foo}\foo +% +% \book{Foo} \foo +% +% \book{Foo}\footnote{footie} +% +% \book{Foo}{}\footnote{footie} +% +% \poemtitle{Foo}\foo +% +% \poemtitle{Foo} \foo +% +% \poemtitle{Foo}\footnote{footie} +% +% \poemtitle{Foo}{}\footnote{footie} +% +% \poemtitle{Foo}.\footnote{footie} +% \end{bothexample} +% \end{warning} +% +% \section{Programmer's interface} +% +% \DescribeMacro\Wrapquotes +% \DescribeMacro\WrapquotesNS +% \DescribeMacro\WrapquotesIS +% \DescribeMacro\WrapquotesNN +% \DescribeMacro\WrapquotesIN +% \DescribeMacro\WrapquotesSN +% \DescribeMacro\WrapquotesDN +% \DescribeMacro\WrapquotesSK +% \cs\Wrapquotes\marg{text} wraps \meta{text} in quotes. Single quotes are +% used initially if the \option{singlequotes} option is given to the +% package, and double quotes if no option or the \option{doublequotes} +% option is given to the package. +% +% When quotation marks inserted by \cs\Wrapquotes and friends are doubled up +% (this occurs sometimes when nesting them), a thinspace (|\,|) is inserted +% between the abutted quotes. +% +% \cs\Wrapquotes will be \cs\let to one of the six macros +% \cs\Wrapquotes\meta{XY}. +% +% In the two-letter suffix \meta{XY}, first letter |N| means ``normal'' and +% |I| means ``inverse.'' These are macros that switch between single and +% double quotes when they nest: an inverse wrapquotes wraps with single +% quotes when a normal wrapquotes would wrap with double quotes, and vice +% versa. First letter |S| for ``single'' and |D| for ``double'' are for +% macros that always wrap with single or double quotes. Spacing and +% punctuation following the closing quotes are handled intelligently by +% macros with second letter |S|, which means means suck a following period +% or comma into the closing quote, that is, if what follows is a comma or +% period, it is pulled inside the quotes (following American practice). +% Second letter |N| means ``nosuck,'' that is, don't suck. Second letter +% |K| means ``kill'': the same as |N| but suppress the effect of any +% punctuation in the quoted argument on spacing that follows the closing +% quotes (i.e., execute \cs\@, which sets the spacefactor to~1000). This is +% only useful in certain technical writing where punctuation in the quoted +% argument should not be considered puncutation of the containing sentence. +% +% A space is inserted after the closing quotes unless what follows is in the +% set |;?:!-)]'\textquoteright{|, in which case no space is inserted.^^A for Emacs: } +% FIX: that would be |\nospacelist| +% +% \DescribeMacro\IfQuestionOrExclamation +% \cs\IfQuestionOrExclamation\marg{text}\marg{true}\marg{false} +% executes \meta{true} clause iff \meta{text} ends with a question mark or +% an exclamation point; executes \meta{false} clause otherwise. +% +% \subsection{Limitations of Wrapquotes and friends} +% ^^A FIX: hmm, can't use \cs or \protect\cs +% \subsubsection{Nesting} +% \begin{warning} +% For proper nesting of \cs\Wrapquotes and friends, user commands must be +% \cs\let to \cs\Wrapquotes or one of the six \cs\Wrapquotes\meta{XY} +% commands instead of using a \cs\def-like defining command. It's OK to +% \cs\let % a user macro to something like \cs\Wrapquotes which itself +% has been % \cs\let to one of the six \cs\Wrapquotes\meta{XY} macros. +% +% The user command which is \cs\let to one of the \cs\Wrapquotes commands +% must furthermore appear in the source. That is, it must not appear as +% the result of an expansion. Among other things, this means that +% nesting won't work properly if you put \cs\Wrapquotes into an abbrev +% (see the \package{abbrevs} package in the \Frankenstein bundle). +% +% For applications where nesting will not occur, there should be nothing +% to worry about. +% \end{warning} +% +% \subsubsection{Italic corrections} +% +% \begin{warning} +% The question of when to insert an italic correction is not nearly as +% simple as it might seem. I cannot figure good rules which cover all +% cases, and I do not trust the behavior of the kernel's macros as a +% guide. So I can not tell you whether this package handles italic +% corrections properly. If you discover behavior which you think is +% wrong, please let me know with an example and an argument. +% \end{warning} +% +% \subsubsection{A slight bug} +% \begin{warning} +% Right now there is a small bug in cases where closing quotes fall at +% the end of italic text, such as +% \begin{bothexample} +% \normalfont +% \book{My love of \poemtitle{Daffodils}}, by H.~Moneysworth. +% \end{bothexample} +% These cases loose because the closing quotation marks and any +% sucked-in punctuation are going to be in roman, not italic, or italic, +% not roman. Only the more obsessive will notice this flaw. I'm sure I +% will come up with a way to handle this for a future version of this +% package. +% \end{warning} +% +% \StopEventually{} +% +% \part{Implementation} +% +% \section{Version control} +% +% \begin{macro}{\fileinfo} +% \begin{macro}{\DoXUsepackagE} +% \begin{macro}{\HaveECitationS} +% \begin{macro}{\fileversion} +% \begin{macro}{\filedate} +% \begin{macro}{\docdate} +% \begin{macro}{\PPOptArg} +% These definitions must be the first ones in the file. +% \begin{macrocode} +\def\fileinfo{title macros (Frankenstein's references)} +\def\DoXPackageS {} +\def\initelyHavECitationS {} +\def\fileversion{v1.2} +\def\filedate{2001/08/31} +\def\docdate{2001/08/31} +\edef\PPOptArg {% + \filedate\space \fileversion\space \fileinfo +} +% \end{macrocode} +% \end{macro} +% \end{macro} +% \end{macro} +% \end{macro} +% \end{macro} +% \end{macro} +% \end{macro} +% +% If we're loading this file from a \cs\ProcessDTXFile command (see the +% \package{compsci} package), then \cs\JusTLoaDInformatioN will be defined; +% othewise we assume it is not (that's why the FunkY NamE). +% +% If we're loading from \cs\ProcessDTXFile, we want to load the packages listed +% in \cs\DoXPackageS (needed to typeset the documentation for this file) and +% then bail out. Otherwise, we're using this file in a normal way as a +% package, so do nothing. \cs\DoXPackageS, if there are any, are declared in +% the \ext{dtx} file, and, if you're reading the typeset documentation of this +% package, would appear just above. (It's OK to call \cs\usepackage with an +% empty argument or \cs\relax, by the way.) +% \begin{macrocode} +\makeatletter% A special comment to help create bst files. Don't change! +\@ifundefined{JusTLoaDInformatioN} {% + }{% ELSE (we know the compsci package is already loaded, too) + \UndefineCS\JusTLoaDInformatioN + \SaveDoXVarS + \eExpand\csname DoXPackageS\endcsname\In {%use \csname in case it's undefined + \usepackage{#1}% + }% + \RestoreDoXVarS + \makeatother + \endinput +}% A special comment to help create bst files. Don't change! +% \end{macrocode} +% +% Now we check for \LaTeX2e and declare the LaTeX package. +% \begin{macrocode} +\NeedsTeXFormat{LaTeX2e} +\ProvidesPackage{titles}[\PPOptArg] +% \end{macrocode}^^A special comment to help create bst files. Don't change! +% +% ^^A NOTE: We have to compensate for the above backslashes, which are not +% ^^A actually in the .dtx file the author works on, by adding to the +% ^^A CheckSum. +%% +% \AddToCheckSum{17}^^A `dtx-update-checksum' automatically handles this. +% \AddToCheckSum{7}^^A The half a macrocode env. at the top is missed, however... +% \AddToCheckSum{10}^^A ... and so are the 5 \defs from the .dtx file +% ^^A that precede it. +% \IfCitations {% +% \AddToCheckSum{2}^^A When \initelyHavECitationS is defined in +% } ^^A the .dtx file, we need 2 more in the CheckSum. +% +% +% \section{Requirements} +% +% \begin{macrocode} +\RequirePackage{moredefs,slemph} +% \end{macrocode} +% +% \section{Options} +% +% \begin{macro}{\ti@domelater} +% \begin{macrocode} +\ReserveCS\ti@domelater +\DeclareOption{british} {% + \def\ti@domelater {% + \let\Wrapquotes\WrapquotesNN + \@doublequotes@false + } +} +\DeclareOption{american} {% + \def\ti@domelater {% + \let\Wrapquotes\WrapquotesNS + \@doublequotes@true + } +} +\ExecuteOptions{american} +\ProcessOptions +% \end{macrocode} +% \end{macro} +% +% \section{Wrapquotes} +% +% Here we go! This is not a picnic, so leave your jelly jar home. +% +% \subsection{Titles that are Questions or Exclamations} +% +% \begin{macro}{\IfQuestionOrExclamation} +% \begin{macro}{\ti@checkfor@q} +% \begin{macro}{\ti@checkfor@e} +% \begin{macro}{\ti@prev} +% \begin{macro}{\ti@prev@prev} +% \begin{macro}{\@ti@sw@true} +% \begin{macro}{\@ti@sw@false} +% \begin{macro}{\if@ti@sw@} +% \mbox{} +% \begin{macrocode} +\newcommand\IfQuestionOrExclamation [1] {% + \@tempswafalse + \ti@checkfor@q #1?\@nil + \ti@checkfor@e #1!\@nil + \if@tempswa + \expandafter\@firstoftwo + \else + \expandafter\@secondoftwo + \fi +} +% \end{macrocode} +% The large majority of titles will not contain a question mark or exclamation +% point. The large majority of those that do will have a single mark or point +% at the end. We could (I think) use a simpler check that processed all titles +% by looping through to examine the end, but a slightly more complicated check +% will handle the majority of cases very quickly (and at a constant speed, +% rather than proportional to title length) and not greatly slow down +% processing the remaining two unusual cases. We divide our argument (with an +% extra question mark tacked onto the end) into what's before the first +% question mark and what's after it. Then we examine what's after it and +% interpret the results thus: +% \begin{description} +% \item [empty] no question mark in title +% \item [question mark] title ends with question mark (and there are no other +% question marks) +% \item [text ending with one question mark] a question mark occurs in the +% title, but not at the end +% \item [text ending with two question marks] title ends with a question mark +% (and there is a previous question mark) +% \end{description} +% We set switch |a| to true if the title ends with a question mark. +% \begin{macrocode} +\newboolean{@ti@sw@} +\ReserveCS\ti@prev +\ReserveCS\ti@prev@prev +\NewName{ti@checkfor@q} {#1?#2\@nil} {% + \def\sc@t@a{#2}% + \def\sc@t@b{?}% + \ifx\sc@t@a\ShortEmpty + \else + \ifx\sc@t@a\sc@t@b + \@tempswatrue + \else +% \end{macrocode} +% We use a loop to whittle down |#2| until \cname{ti@prev} contains the last +% character and \cname{ti@prev@prev} contains the second-to-last. We know that +% \cname{ti@prev} is going to be a question mark. Iff \cname{ti@prev@prev} is a +% question mark, we are in the final case above. +% \begin{macrocode} + \let\ti@prev\sc@t@a + \let\ti@prev@prev\sc@t@a + \@ti@sw@true + \@whilesw \if@ti@sw@ \fi {% + \ifx\sc@t@a\ShortEmpty + \@ti@sw@false + \else + \let\ti@prev@prev\ti@prev + \let\ti@prev\sc@t@a + \edef\sc@t@a{\E@cdr\sc@t@a\@nil}% + \fi + }% + \edef\ti@prev@prev{\E@car\ti@prev@prev\@nil}% + \ifx\ti@prev@prev\sc@t@b + \@tempswatrue + \fi + \fi + \fi +} +% \end{macrocode} +% Exact same logic applies to exclamation points. +% \begin{macrocode} +\NewName{ti@checkfor@e} {#1!#2\@nil} {% + \def\sc@t@a{#2}% + \def\sc@t@b{!}% + \ifx\sc@t@a\ShortEmpty + \else + \ifx\sc@t@a\sc@t@b + \@tempswatrue + \else + \let\ti@prev\sc@t@a + \let\ti@prev@prev\sc@t@a + \@ti@sw@true + \@whilesw \if@ti@sw@ \fi {% + \ifx\sc@t@a\ShortEmpty + \@ti@sw@false + \else + \let\ti@prev@prev\ti@prev + \let\ti@prev\sc@t@a + \edef\sc@t@a{\E@cdr\sc@t@a\@nil}% + \fi + }% + \edef\ti@prev@prev{\E@car\ti@prev@prev\@nil}% + \ifx\ti@prev@prev\sc@t@b + \@tempswatrue + \fi + \fi + \fi +} +% \end{macrocode} +% \end{macro} +% \end{macro} +% \end{macro} +% \end{macro} +% \end{macro} +% \end{macro} +% \end{macro} +% \end{macro} +% +% \subsection{Highlevel macros} +% +% \begin{macro}{\ti@wrapquotes@suck} +% \begin{macro}{\ti@wrapquotes@nosuck} +% These two are the top-level internal macros, and they are pretty sane. One +% sucks in a following period or comma, the other does not. +% \cname{ti@wrapquotes@suck} does not suck, however, when the title ends in a +% question or exclamation point. +% +% The group here is necessary to scope the \cname{@doublequotes@} boolean. +% \begin{macrocode} +\newcommand*\ti@wrapquotes@suck [1] {% +% \DTypeout{top of wrapquotes@suck}% + \IfQuestionOrExclamation {#1} {% + \ti@wrapquotes@nosuck{#1}% + }{% ELSE +% \DTypeout{top of wrapquotes@suck ELSE}% + \begingroup + \if@doublequotes@ +% \DTypeout{double true in suck}% + \@doublequotes@false + \def\sc@t@a {\ti@open@double #1\ti@close@double@suck}% + \else +% \DTypeout{double false in suck}% + \@doublequotes@true + \def\sc@t@a {\ti@open@single #1\ti@close@single@suck}% + \fi + \sc@t@a + \endgroup + }% +} +\newcommand*\ti@wrapquotes@nosuck [1] {% + \begingroup + \if@doublequotes@ +% \DTypeout{double true in nosuck}% + \@doublequotes@false + \def\sc@t@a {\ti@open@double #1\ti@close@double@nosuck}% + \else +% \DTypeout{double false in nosuck}% + \@doublequotes@true + \def\sc@t@a {\ti@open@single #1\ti@close@single@nosuck}% + \fi + \sc@t@a + \endgroup +} +% \end{macrocode} +% \end{macro} +% \end{macro} +% +% \begin{macro}{\WrapquotesNS} +% \begin{macro}{\WrapquotesIS} +% \begin{macro}{\WrapquotesNN} +% \begin{macro}{\WrapquotesIN} +% \begin{macro}{\WrapquotesSN} +% \begin{macro}{\WrapquotesDN} +% \begin{macro}{\WrapquotesSK} +% \begin{macro}{\Wrapquotes} +% \begin{macro}{\if@doublequotes@} +% \begin{macro}{\@doublequotes@true} +% \begin{macro}{\@doublequotes@false} +% Now we can define the secondary programmers' macros. +% +% We simply reserve \cs\Wrapquotes here, and assign it in the user options +% section above. +% \begin{macrocode} +\newboolean{@doublequotes@} +\newcommand*\WrapquotesNS {% +% \DTypeout{starting wrapquotes NS}% + \ti@wrapquotes@suck +} +\newcommand*\WrapquotesIS {% +% \DTypeout{starting wrapquotes IS}% + \ToggleBoolean{@doublequotes@}% + \ti@wrapquotes@suck +} +\newcommand*\WrapquotesNN {% +% \DTypeout{starting wrapquotes NN}% + \ti@wrapquotes@nosuck +} +\newcommand*\WrapquotesIN {% +% \DTypeout{starting wrapquotes IN}% + \ToggleBoolean{@doublequotes@}% + \ti@wrapquotes@nosuck +} +\newcommand*\WrapquotesSN [1] {% +% \DTypeout{starting wrapquotes SN}% + \begingroup + \ti@open@single #1\ti@close@single@nosuck + \endgroup +} +\newcommand*\WrapquotesDN [1] {% +% \DTypeout{starting wrapquotes DN}% + \begingroup + \ti@open@double #1\ti@close@double@nosuck + \endgroup +} +\newcommand*\WrapquotesSK [1] {% FIX: test +% \DTypeout{starting wrapquotes SK}% + \begingroup + \ti@open@single #1\ti@close@single@nosuck\@% + \endgroup +} +\ReserveCS\Wrapquotes +\ti@domelater +% \end{macrocode} +% \end{macro} +% \end{macro} +% \end{macro} +% \end{macro} +% \end{macro} +% \end{macro} +% \end{macro} +% \end{macro} +% \end{macro} +% \end{macro} +% \end{macro} +% +% \subsection{Opening quotes} +% +% \begin{macro}{\ti@open@double} +% \begin{macro}{\ti@open@single} +% \begin{macro}{\ti@openquote} +% We start by putting an opening mark in scratch |f| with a global +% definition. +% +% I can't remember why it's global. In the macros that close quotes, we want +% to keep that information around past a group end because we're using +% \cs\aftergroup, but that doesn't seem to apply for opening them. Best not +% to change what's not broke, however. +% \begin{macrocode} +\newcommand\ti@open@double {% + \gdef\sc@t@f {\textquotedblleft}% + \ti@openquote +} +\newcommand\ti@open@single {% + \gdef\sc@t@f {\textquoteleft}% + \ti@openquote +} +% \end{macrocode} +% Then we look ahead with scratch |a|. We are looking ahead at the first +% character of the contents of the \cs\Wrapquotes. +% \begin{macrocode} +\newcommand\ti@openquote {% + \futurelet\sc@t@a\ti@@openquote +} +% \end{macrocode} +% Insert the opening mark. Then, if we are about to open another quote, insert +% the space appropriate to separate contiguous quotation marks. +% \begin{macrocode} +\newcommand\ti@@openquote {% + \sc@t@f + \ifx\sc@t@a\WrapquotesNS +% \DTypeout{Quotation marks are doubled up (next is NS); inserting padding.}% + \,% + \else \ifx\sc@t@a\WrapquotesNN +% \DTypeout{Quotation marks are doubled up (next is NN); inserting padding.}% + \,% + \else \ifx\sc@t@a\WrapquotesIN +% \DTypeout{Quotation marks are doubled up (next is IN); inserting padding.}% + \,% + \else \ifx\sc@t@a\WrapquotesIS +% \DTypeout{Quotation marks are doubled up (next is IS); inserting padding.}% + \,% + \else \ifx\sc@t@a\WrapquotesSN +% \DTypeout{Quotation marks are doubled up (next is SN); inserting padding.}% + \,% + \else \ifx\sc@t@a\WrapquotesDN +% \DTypeout{Quotation marks are doubled up (next is DN); inserting padding.}% + \,% + \else \ifx\sc@t@a\WrapquotesSK +% \DTypeout{Quotation marks are doubled up (next is SK); inserting padding.}% + \,% + \else + \fi \fi \fi \fi \fi \fi \fi +} +% \end{macrocode} +% \end{macro} +% \end{macro} +% \end{macro} +% +% \subsection{Closing macros that don't suck} +% +% This case that doesn't suck is easier, so we warm up with it. +% +% \begin{macro}{\ti@close@single@nosuck} +% \begin{macro}{\ti@close@double@nosuck} +% \begin{macro}{\ti@close@single@@nosuck} +% \begin{macro}{\ti@close@double@@nosuck} +% \mbox{} +% \begin{macrocode} +\newcommand*\ti@close@single@nosuck {% + \aftergroup\ti@close@single@@nosuck +} +\newcommand*\ti@close@double@nosuck {% + \aftergroup\ti@close@double@@nosuck +} +\newcommand*\ti@close@single@@nosuck {% + \gdef\sc@t@f {\textquoteright}% + \ti@close@quote@nosuck +} +\newcommand*\ti@close@double@@nosuck {% + \gdef\sc@t@f {\textquotedblright}% + \ti@close@quote@nosuck +} +% \end{macrocode} +% \end{macro} +% \end{macro} +% \end{macro} +% \end{macro} +% +% \begin{macro}{\ti@close@quote@nosuck} +% \begin{macro}{\if@look@nosuck@} +% \begin{macro}{\@look@nosuck@true} +% \begin{macro}{\@look@nosuck@false} +% \todo{Document this flag. It's a hack, we must set it before each call +% to \cname{ti@q@ifnextcharin} I think. What it stands for is something +% like the presence of the tokens \cname{ti@close@single@nosuck} and +% \cname{ti@close@double@nosuck} in the list of chars to look for, but since +% they aren't really chars they can't go in the list, so instead we set the +% flag. Somewhat cleaner would be putting a flag char in the list, but I +% can't think of what char I could safely use.} +% \begin{macrocode} +\newboolean{@look@nosuck@} +\@look@nosuck@false +\newcommand\ti@close@quote@nosuck {% +% \DTypeout{Starting ti@close@quote@nosuck}% + \@look@nosuck@true +% \end{macrocode} +%% FIX +% Aha, but here is a good reason to leave in |.,| in our substitute for \cs\nospacelist. +% \begin{macrocode} + \expandafter \ti@q@ifnextcharin \expandafter {\nospacelist} {% +% \DTypeout{Found a nosuck no-spacer. C=[\meaning\sc@t@c] F=[\meaning\sc@t@f]}% + \sc@t@f + }{% ELSE +% \DTypeout{Found a nosuck spacer. C=[\meaning\sc@t@c] F=[\meaning\sc@t@f]}% + \sc@t@f\space + }% +} +% \end{macrocode} +% \end{macro} +% \end{macro} +% \end{macro} +% \end{macro} +% +% \subsection{Closing macros that suck} +% +% \begin{macro}{\ti@close@double@suck} +% \begin{macro}{\ti@close@single@suck} +% We need to look ahead beyond the \cs\endgroup that ends +% \cname{Wrapquotes??}. The lookahead mechanism that gets invoked in scratch +% |a| below could handle looking past the \cs\endgroup, but I think it is +% more efficient to skip it by using \cs\aftergroup. +% \begin{macrocode} +\newcommand\ti@close@double@suck {% + \aftergroup\ti@close@double@@suck +} +\newcommand\ti@close@single@suck {% + \aftergroup\ti@close@single@@suck +} +% \end{macrocode} +% \end{macro} +% \end{macro} +% +% \begin{macro}{\ti@close@double@@suck} +% \begin{macro}{\ti@close@single@@suck} +% This part isn't so bad yet. To close the quotes, we again start with the +% closing mark in scratch |f|, with a global definition. +% \begin{macrocode} +\newcommand\ti@close@double@@suck {% + \gdef\sc@t@f {\textquotedblright}% + \ti@close@quote@suck +} +\newcommand\ti@close@single@@suck {% + \gdef\sc@t@f {\textquoteright}% + \ti@close@quote@suck +} +% \end{macrocode} +% \end{macro} +% \end{macro} +% +% \begin{macro}{\nospacelist} +% Put these in the order of their frequency. Anything in \cs\nocorrlist +% should also be in here, most likely. I'm putting in \cname{@xobeysp} +% because it's in the \package{xspace} package, but I can't tell you when it +% would come up. +% \begin{macrocode} +\requirecommand\nospacelist {% + ,.':;?-/\slash~!)]\bgroup\egroup\@sptoken\ \space\/\@xobeysp +} +% \end{macrocode} +% \end{macro} +% +% \begin{macro}{\ti@close@quote@suck} +% Then we use \cname{ti@q@ifnextcharin} to look as far ahead as necessary for +% a significant character. The latest significant character found is +% available in scratch |c|. The work of handling all the cases of what we +% might find while looking ahead is divided up between +% \cname{ti@close@quote@suck} and \cname{ti@q@ifnextcharin}. +% \cname{ti@close@quote@suck} handles the last step in the process, and +% \cname{ti@q@ifnextcharin} handles all the steps up to the last. +% +% Here is what \cname{ti@close@quote@suck} does, in English. If we find a +% comma or period, we put it inside the closing quote, and gobble the one we +% found. That is, we print out scratch |c|, then scratch |f|, then gobble a +% character. If we find something in the set given in \cs\nospacelist, do +% not leave a space after the closing mark. That is, just print out scratch +% |f|. If we find something else, we leave a space after the closing mark. +% That is, print scratch |f| and a space. +% \begin{macrocode} +\newcommand\ti@close@quote@suck {% +% \DTypeout{Starting ti@close@quote@suck}% + \@look@nosuck@false + \ti@q@ifnextcharin {.,} {% +% \DTypeout{Found a comma or period. C=[\meaning\sc@t@c] F=[\meaning\sc@t@f]}% + \sc@t@c\sc@t@f\DGobbleM % This gobbles the original punctuation. + }{% ELSE +% \DTypeout {Before second ti@qifnextcharin. C=[\meaning\sc@t@c] F=[\meaning\sc@t@f]}% + \@look@nosuck@true +% \end{macrocode} +% \begin{todoenv} +% Using \cs\nospacelist is inefficient here, since some of the cases, +%^^A for Emacs { +% namely \verb*|,.\@sptoken}|, are never going to be there and shouldn't be +% checked for, since they are passed over by \cname{ti@q@ifnextcharin} before +% the list is compared. But it would be good to have this parallelism between +% \package{abbrevs} and \package{titles}. +% \end{todoenv} +% \begin{macrocode} + \expandafter \ti@q@ifnextcharin \expandafter {\nospacelist} {% +% \DTypeout{Found a suck no-spacer. C=[\meaning\sc@t@c] F=[\meaning\sc@t@f]}% + \sc@t@f + }{% ELSE +% \DTypeout{Found a suck spacer. C=[\meaning\sc@t@c] F=[\meaning\sc@t@f]}% + \sc@t@f\space + }% + }% +} +% \end{macrocode} +% \end{macro} +% +% \subsection{Looking ahead} +% +% Now things are getting fun. +% +% \begin{macro}{\ti@q@ifnextcharin} +% \begin{macro}{\ti@q@check} +% \begin{macro}{\ti@q@ifnch} +% \begin{macro}{\ti@q@@ifnch} +% These macros are modeled after the definition of \cname{@ifnextchar} which +% skips spaces. While looking ahead for the next significant character, +% these macros skip spaces, \cs\egroup, \cs\endgroup, \cname{check@icr}, +% \cname{ti@close@double} and \cname{ti@close@single} while doing the right +% thing after each. +% +% The first argument should be a list of tokens. If the next significant +% char is in the list, then the |true| clause is executed, otherwise the +% |false| clause is executed. The next significant char is left in scratch +% |c| so it can be accessed by the clauses. +% +% The three arguments to \cname{ti@q@ifnextcharin} are saved in global +% variables because while looking ahead we must continue past the ends of +% groups. +% +%% FIX +% Not sure I need gdef for scratch |e|. +% \begin{macrocode} +\newcommand\ti@q@ifnextcharin [3] {% args: charlist true false +% \sc@toks@a{#1}% +% \DTypeout{charlist unexpanded is =[\the\sc@toks@a]}% + \gdef\sc@t@e {#1}% + \gdef\sc@t@a {#2}% + \gdef\sc@t@b {#3}% + \ti@q@check +} +% \end{macrocode} +% Having saved the arguments, we look ahead with scratch |c|. This step is not +% in the macro above so that we can jump back to \cname{ti@q@check} whenever we +% want to look ahead another character. +% \begin{macrocode} +\newcommand\ti@q@check {% + \futurelet\sc@t@c\ti@q@ifnch +} +% \end{macrocode} +% Scratch |c| contains the current char. Scratch |d| is the action to take at +% the end of this macro. We attempt to order these possibilities to make +% \cs\Wrapquotes most efficient, though it is a guess which items will be +% encountered most frequently. +% +% The actions taken for each of the possibilities are the following: +% \begin{description} +% \item[\cs\ifvmode] Assume that the \cs\Wrapquotes was the argument of a +% \cs\TextFontCommand from certain \LaTeX{} kernels. Gobble three more tokens +% expected to follow the \cs\ifvmode, execute them, and continue on to look +% ahead another character. See documentation of +% \cname{ti@q@handle@ifvmode} for more details. +% \item[\cname{check@icr}] This means the \cs\Wrapquotes was the +% argument of a \cs\TextFontCommand. Gobble the \cname{check@icr} +% and look ahead another character after we exit the +% group that the \cs\TextFontCommand has given us. +% \item[\cs\endgroup and {\normalfont\ttfamily \}}] Pass right by an \cs\endgroup or +% |}| and look ahead another char. +% \item[\cname{@sptoken} (a non-explicit space)] Handle a non-explicit space by calling +% \cname{ti@q@handle@space}, which gobbles the space and looks ahead +% another char. When the user or a macro has followed the titles with an +% \emph{explicit} space such as a tie, or the +%% \verb*|\ | +% or \cs\space macros, we do nothing and let this be caught by the +% comparison to the tokens in the argument of \cname{ti@q@ifnextcharin}. +% \item[\cname{ti@close@double@suck}, +% \cname{ti@close@single@suck}] +% \item[\cname{ti@close@double@nosuck}, and +% \cname{ti@close@single@nosuck}] We are in a nested +% \cs\Wrapquotes. Call \cname{ti@q@handle@single/double@suck/nosuck} +% as appropriate, which +% gobbles the closequotes token, adds properly-padded closing quotes to +% scratch |f|, and then goes on to look ahead another character. +% \end{description} +% The lookahead process stops when it finds something not on this list. Then +% it compares what it found to the list of characters given to +% \cname{ti@q@ifnextcharin} and executes the |true| or |false| clause as +% appropriate. +% +% First we have to handle the case of finding an \cs\ifvmode. We can't bundle +% this test in with the tests for other tokens, so it gets its own macro, +% \cname{ti@q@handle@ifvmode}, which see for details. The remaining cases are +% handled in \cname{ti@q@@ifnch}. +% \begin{macrocode} +\newcommand\ti@q@ifnch {% +% \DTypeout{The lookahead in ti@q@ifnch: [\meaning\sc@t@c]}% + \ifx\sc@t@c\ifvmode + \let\sc@t@d\ti@q@handle@ifvmode + \else + \let\sc@t@d\ti@q@@ifnch + \fi + \sc@t@d +} +\newcommand\ti@q@@ifnch {% +% \DTypeout{entering ti@q@@ifnch}% +% \expandafter\sc@toks@a\expandafter{\sc@t@c}% +% \DTypeout{ti@q@@ifnch: C expanded once is =[\the\sc@toks@a]}% + \ifx\sc@t@c\check@icr +% \DTypeout{Handling check@icr}% + \defcommand\sc@t@d [1] {% +% \DTypeout{check@icr handler: gobbling [\meaning ##1]}% + ##1\aftergroup\ti@q@check + }% + \else \ifx\sc@t@c\endgroup +% \DTypeout{Handling endgroup}% + \def\sc@t@d {\aftergroup\ti@q@check}% + \else \ifx\sc@t@c\@sptoken +% \DTypeout{Handling space}% + \let\sc@t@d\ti@q@handle@space + \else \ifx\sc@t@c\egroup +% \DTypeout{Handling egroup}% + \def\sc@t@d {\aftergroup\ti@q@check}% + \else \ifx\sc@t@c\ti@close@double@suck +% \DTypeout{Handling ti@close@double@suck}% + \let\sc@t@d\ti@q@handle@double@suck + \else \ifx\sc@t@c\ti@close@single@suck +% \DTypeout{Handling ti@close@single@suck}% + \let\sc@t@d\ti@q@handle@single@suck + \else \ifx\sc@t@c\ti@close@double@nosuck +% \DTypeout{Handling ti@close@double@nosuck}% + \let\sc@t@d\ti@q@handle@double@nosuck + \else \ifx\sc@t@c\ti@close@single@nosuck +% \DTypeout{Handling ti@close@single@nosuck}% + \let\sc@t@d\ti@q@handle@single@nosuck + \else +% \end{macrocode} +% We've handled all the lookahead cases, so now we are left with the simple +% comparison of the next char with the charlist. +% \begin{macrocode} + \@tempswafalse + \expandafter \@tfor + \expandafter \sc@t@g + \expandafter :% + \expandafter =% + \sc@t@e + \do {% + \expandafter\ifx\sc@t@g\sc@t@c +% \DTypeout{We have a match of [\meaning\sc@t@c] +% with [\expandafter\meaning\sc@t@g]}% + \@tempswatrue + \@break@tfor + \else +% \DTypeout{We have NO match between [\meaning\sc@t@c] +% with [\meaning\sc@t@g]}% + \fi + }% + \if@tempswa +% \DTypeout{Choosing true clause [\meaning\sc@t@a]}% + \let\sc@t@d\sc@t@a % the ``true'' clause + \else +% \DTypeout{Choosing false clause [\meaning\sc@t@b]}% + \let\sc@t@d\sc@t@b % the ``false'' clause + \fi + \fi \fi \fi \fi \fi \fi \fi \fi +% \DTypeout{About to fall out of ti@q@@ifnch and do this [\meaning\sc@t@d]}% + \sc@t@d +} +% \end{macrocode} +% \end{macro} +% \end{macro} +% \end{macro} +% \end{macro} +% +% \begin{macro}{\ti@q@handle@ifvmode} +% This is in its own macro for clarity and to avoid problems with skipping +% over clauses. +% +% \cname{ti@q@ifnch} has to take two different kinds of \LaTeX{} kernel into +% account. The 1996/12/01 and 1997/06/01 kernels used a different definition +% of \cs\DeclareTextFontCommand: +% \begin{macrocode} +%\def \DeclareTextFontCommand #1#2{% +% \DeclareRobustCommand#1[1] {% +% \ifmmode +% \nfss@text{#2##1}% +% \else +% \leavevmode +% {\text@command{##1}% +% #2\check@icl ##1\ifvmode\else\check@icr\fi +% \expandafter}% +% \fi +% }% +%} +% \end{macrocode} +% All other kernels leave out the check for vertical mode (kernels from +% 1997/12/01 include it when necessary inside \cname{check@icr}). The macro +% \cname{ti@q@ifnch}, which will be called immediately before this point of +% difference, handles both cases by looking for both \cs\ifvmode and +% \cname{check@icr}. For the history, see \LaTeX{} bug report 2646. +% +% The check for \cs\ifvmode must not be part of a nested conditional. \TeX{} +% can't match \cs\if{}s with \cs\fi{}s properly when you nest tests for +% \cs\if-type tokens. See p.~211 of the \TeX{}book. +% +% When we encounter an \cs\ifvmode, we must assume we are inside a +% TextFontCommand declared by one of the two kernel versions mentioned above. +% If not, we are in an unknown situation and we will bomb. Since the error +% message in this case won't be helpful, we warn the user in the log file. +% We use scratch |d| to gobble both the \cs\ifvmode and what we expect will +% follow the \cs\ifvmode, namely \code{\else\check@icr\fi}. After swallowing +% those, we reissue those same commands and then proceed with our lookahead. +% We want to issue those commands, which conditionally introduce an italic +% correction, before looking further ahead. +% \begin{macrocode} +\newcommand\ti@q@handle@ifvmode {% +% \DTypeout{Handling ifvmode}% + \FrankenInfo{titles} + {Handling an \string\ifvmode\space following a title.\MessageBreak + If you now get an error that \string\sc@t@d\space does not\MessageBreak + match its definition, this \string\ifvmode\space is\MessageBreak + unexpected}% + \DefName{sc@t@d} {\ifvmode\else\check@icr\fi} {% + \ifvmode + \else + \check@icr + \fi + \aftergroup\ti@q@check + }% + \sc@t@d +} +% \end{macrocode} +% \end{macro} +% +% \begin{macro}{\ti@q@handle@space} +% Handle the case of a following space: gobble the space and call +% \cname{ti@q@check}. +% +% This little bit of trickery sneaks a space in as the \cs\def template, +% thereby causing a space following \cname{ti@q@handle@space} to get gobbled. +% We use the control character \cname{:} and restore its value. +% \begin{macrocode} +\ReserveCS\ti@q@handle@space +\let\sc@t@a\: +\def\:{\ti@q@handle@space} \expandafter\def\: {\ti@q@check} +\let\:\sc@t@a +% \end{macrocode} +% \end{macro} +% +% \begin{macro}{\ti@q@handle@single@suck} +% \begin{macro}{\ti@q@handle@double@suck} +% Handle the single and double sucking cases: gobble the closequotes token +% with a \cs\def template, add some stuff to scratch |f| and call +% \cname{ti@q@check}. These are put in their own macros only to avoid +% clutter above. +% \begin{macrocode} +\newcommand*\ti@q@handle@double@suck [1] {% +% \DTypeout{handle double suck: gobbling [\meaning#1]}% +% \DTypeout{scratch f before: [\meaning\sc@t@f]}% + \g@addto@macro\sc@t@f {\,\textquotedblright}% +% \DTypeout{scratch f after: [\meaning\sc@t@f]}% + \ti@q@check +} +\newcommand*\ti@q@handle@single@suck [1] {% +% \DTypeout{handle single suck: gobbling [\meaning#1]}% +% \DTypeout{scratch f before: [\meaning\sc@t@f]}% + \g@addto@macro\sc@t@f {\,\textquoteright}% +% \DTypeout{scratch f after: [\meaning\sc@t@f]}% + \ti@q@check +} +% \end{macrocode} +% \end{macro} +% \end{macro} +% +% \begin{macro}{\ti@q@handle@single@nosuck} +% \begin{macro}{\ti@q@handle@double@nosuck} +% Handle the single and double nosucking cases. Add inter-quote space to +% scratch |f| and exit \cname{ti@q@@ifnch} with |true| or |false| depending +% on whether we were looking for it. We had to do it this way instead of the +% normal \cname{if} test above at the end of \cname{ti@q@@ifnch} because +% \cname{ti@close@double@nosuck} is more than one character long. +% \begin{macrocode} +\newcommand*\ti@q@handle@double@nosuck [1] {% +% \DTypeout{handle double nosuck: gobbling [\meaning#1]}% + \if@look@nosuck@ +% \DTypeout{And we're looking for \string\ti@close@double@nosuck.}% + \g@addto@macro\sc@t@f {\,\textquotedblright}% +% \DTypeout{After adding padding, F=[\meaning\sc@t@f]}% + \let\sc@t@d\sc@t@a % the ``true'' clause of ti@q@ifnextcharin + \else +% \DTypeout{But we're not looking for \string\ti@close@double@nosuck.}% +% \DTypeout{F is unchanged, F=[\meaning\sc@t@f]}% + \let\sc@t@d\sc@t@b % the ``false'' clause of ti@q@ifnextcharin + \fi + \ti@q@check +} +\newcommand*\ti@q@handle@single@nosuck [1] {% +% \DTypeout{handle single nosuck: gobbling [\meaning#1]}% + \if@look@nosuck@ +% \DTypeout{And we're looking for \string\ti@close@single@nosuck.}% + \g@addto@macro\sc@t@f {\,\textquoteright}% +% \DTypeout{After adding padding, F=[\meaning\sc@t@f]}% + \let\sc@t@d\sc@t@a % the ``true'' clause of ti@q@ifnextcharin + \else +% \DTypeout{But we're not looking for \string\ti@close@single@nosuck.}% +% \DTypeout{F is unchanged, F=[\meaning\sc@t@f]}% + \let\sc@t@d\sc@t@b % the ``false'' clause of ti@q@ifnextcharin + \fi + \ti@q@check +} +% \end{macrocode} +% \end{macro} +% \end{macro} +% +% \section{Words and phrases} +% +% \begin{macro}{\word} +% \begin{macro}{\foreign} +% \begin{macro}{\foreignword} +% \begin{macro}{\phrase} +% \begin{macro}{\term} +% \begin{macro}{\defn} +% \mbox{} +% \begin{macrocode} +\newlet\word\textitswitch +\newlet\foreign\textitswitch +% \end{macrocode} +% \todo{\cs\phrase is the result of expansion here: what effect will this have +% on its proper nesting, and is this something to worry about?} +% \begin{macrocode} +\newcommand\foreignword [1] {% + \phrase{\word{#1}}% +} +% \end{macrocode} +% The \cs\@ cancels the effect on spacing of any final punctuation in the +% argument. +% \begin{macrocode} +% \newlet\phrase\WrapquotesSK -- whoops, doesn't work as intended, +% \phrase{foo}s puts a space before the following `s' + +% old definition: +\newcommand\phrase [1] {% + \textquoteleft #1\textquoteright\@% +} +\newlet\term\textitswitch +\newlet\defn\textslswitch +% \end{macrocode} +% \end{macro} +% \end{macro} +% \end{macro} +% \end{macro} +% \end{macro} +% \end{macro} +% +% \section{Titles} +% +% \begin{macro}{\book} +% \begin{macro}{\journal} +% \begin{macro}{\music} +% \begin{macro}{\article} +% \begin{macro}{\storytitle} +% \begin{macro}{\poemtitle} +% \begin{macro}{\play} +% \begin{macro}{\craft} +% \begin{macro}{\species} +% \mbox{} +% \begin{macrocode} +\newlet\book\textitswitch +\newlet\journal\textitswitch +\newlet\music\textitswitch +\newlet\article\Wrapquotes +\newlet\storytitle\Wrapquotes +\newlet\poemtitle\Wrapquotes +\newlet\play\textitswitch % \manualref{7.145} +\newlet\craft\textitswitch +\newlet\species\textitswitch +% \end{macrocode} +% \end{macro} +% \end{macro} +% \end{macro} +% \end{macro} +% \end{macro} +% \end{macro} +% \end{macro} +% \end{macro} +% \end{macro} +% +% \part{Configuration} +% +% User alterations and additions and package testing are in a configuration +% file. +% \begin{macrocode} +\InputIfFileExists{titles.cfg}{}{} +% \end{macrocode} +% +% The contents of the \emph{distributed} configuration file are below. +% +% \InputIfFileExists{titles.cfg}{}{} +% +% \Finale |