diff options
author | Karl Berry <karl@freefriends.org> | 2014-04-24 17:50:01 +0000 |
---|---|---|
committer | Karl Berry <karl@freefriends.org> | 2014-04-24 17:50:01 +0000 |
commit | cbfc368620bf1ec89c0feff3230ec1c082999975 (patch) | |
tree | 5a5f99b91bb93f046950a9f4b48880c7b09de987 /Master/texmf-dist/tex/lollipop | |
parent | 6e7d419dedc358b0393e9318e9b338168004bcd8 (diff) |
lollipop, new format
git-svn-id: svn://tug.org/texlive/trunk@33658 c570f23f-e606-0410-a88d-b1316a301751
Diffstat (limited to 'Master/texmf-dist/tex/lollipop')
-rw-r--r-- | Master/texmf-dist/tex/lollipop/dvilollipop.ini | 31 | ||||
-rw-r--r-- | Master/texmf-dist/tex/lollipop/dvilualollipop.ini | 34 | ||||
-rw-r--r-- | Master/texmf-dist/tex/lollipop/lollipop-define.tex | 425 | ||||
-rw-r--r-- | Master/texmf-dist/tex/lollipop/lollipop-document.tex | 381 | ||||
-rw-r--r-- | Master/texmf-dist/tex/lollipop/lollipop-float.tex | 94 | ||||
-rw-r--r-- | Master/texmf-dist/tex/lollipop/lollipop-fontdefs.tex | 67 | ||||
-rw-r--r-- | Master/texmf-dist/tex/lollipop/lollipop-fonts.tex | 415 | ||||
-rw-r--r-- | Master/texmf-dist/tex/lollipop/lollipop-heading.tex | 49 | ||||
-rw-r--r-- | Master/texmf-dist/tex/lollipop/lollipop-lists.tex | 362 | ||||
-rw-r--r-- | Master/texmf-dist/tex/lollipop/lollipop-output.tex | 739 | ||||
-rw-r--r-- | Master/texmf-dist/tex/lollipop/lollipop-plain.tex | 1237 | ||||
-rw-r--r-- | Master/texmf-dist/tex/lollipop/lollipop-text.tex | 490 | ||||
-rw-r--r-- | Master/texmf-dist/tex/lollipop/lollipop-tools.tex | 1508 | ||||
-rw-r--r-- | Master/texmf-dist/tex/lollipop/lollipop.ini | 24 | ||||
-rw-r--r-- | Master/texmf-dist/tex/lollipop/lualollipop.ini | 35 | ||||
-rw-r--r-- | Master/texmf-dist/tex/lollipop/xelollipop.ini | 51 |
16 files changed, 5942 insertions, 0 deletions
diff --git a/Master/texmf-dist/tex/lollipop/dvilollipop.ini b/Master/texmf-dist/tex/lollipop/dvilollipop.ini new file mode 100644 index 00000000000..e15d75ee551 --- /dev/null +++ b/Master/texmf-dist/tex/lollipop/dvilollipop.ini @@ -0,0 +1,31 @@ +% copyright 2014 Vafa Khalighi +% +% +% This program is free software: you can redistribute it and/or modify +% it under the terms of the GNU General Public License as published by +% the Free Software Foundation, either version 3 of the License, or +% (at your option) any later version. +% +% 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 +% GNU General Public License for more details. +% +% You should have received a copy of the GNU General Public License +% along with this program. If not, see <http://www.gnu.org/licenses/>. +% +% +\ifx\pdfoutput\undefined \else + \ifx\pdfoutput\relax \else + \input pdftexconfig + \pdfoutput=0 + \fi +\fi +% +% the usual format initialization. +\scrollmode +\input lollipop.tex +\dump +\endinput + +% dvilollipop.fmt is generated by `pdftex -ini -jobname=dvilollipop -progname=dvilollipop -translate-file=cp227.tcx -etex dvilollipop.ini' diff --git a/Master/texmf-dist/tex/lollipop/dvilualollipop.ini b/Master/texmf-dist/tex/lollipop/dvilualollipop.ini new file mode 100644 index 00000000000..53249eeeaed --- /dev/null +++ b/Master/texmf-dist/tex/lollipop/dvilualollipop.ini @@ -0,0 +1,34 @@ +% copyright 2014 Vafa Khalighi +% +% +% This program is free software: you can redistribute it and/or modify +% it under the terms of the GNU General Public License as published by +% the Free Software Foundation, either version 3 of the License, or +% (at your option) any later version. +% +% 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 +% GNU General Public License for more details. +% +% You should have received a copy of the GNU General Public License +% along with this program. If not, see <http://www.gnu.org/licenses/>. +% +% +% must be done first (activation of primitives) +\input luatexiniconfig.tex + +% settings inherited from pdftex +\input pdftexconfig.tex +% dvi output by default +\pdfoutput=0 + +\input luatex-unicode-letters.tex % set codes based on Unicode (full range) + +% the usual format initialization. +\scrollmode +\input lollipop.tex +\dump +\endinput + +% dvilualollipop.ini is generated by `luatex -ini -jobname=dvilualollipop -progname=dvilualollipop dvilualollipop.ini'
\ No newline at end of file diff --git a/Master/texmf-dist/tex/lollipop/lollipop-define.tex b/Master/texmf-dist/tex/lollipop/lollipop-define.tex new file mode 100644 index 00000000000..b01e4e75473 --- /dev/null +++ b/Master/texmf-dist/tex/lollipop/lollipop-define.tex @@ -0,0 +1,425 @@ +% lollipop-define.tex copyright 1992/3 Victor Eijkhout +% copyright 2014 Vafa Khalighi +% +% +% This program is free software: you can redistribute it and/or modify +% it under the terms of the GNU General Public License as published by +% the Free Software Foundation, either version 3 of the License, or +% (at your option) any later version. +% +% 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 +% GNU General Public License for more details. +% +% You should have received a copy of the GNU General Public License +% along with this program. If not, see <http://www.gnu.org/licenses/>. +% +% +\NewTrace:ref +%%%%%%%%%%%%%%%% Symbolic references + +% User command for labels. +% this is hardly ever necessary: +% most commands directly accept the label. +% +\def\label[#1]{\bsp@hack\@label{#1}\esp@hack} + +% Automatic generation of labels. +% after \@Labelize{command}, it is possible to write \command[sym:ref] +% This is done for any generic construct that has a counter. +% +%\add@generic@stop@default{\ifhas@label \@Labelize{\@command}\fi} +\newif\ifhas@label +\add@generic@default{\has@labelno} +\@GenericOption{haslabel}{\global\has@labelyes} +\def\@Labelize#1{\edef\cs@e{\let\CSname{lab@#1}=\CSname{#1}}\cs@e + \csarg\edef{#1}{\begingroup + \aftergroup\CSname{lab@#1}\nxp\@referentiep}} +\def\@referentiep + {\ifnextchar[%] + \x@label{\ifNextChar<%> + \x@o@label{\gdef\xx@label{}\endgroup}% + }} + +% if \command has a symbolic key, +% \x@label#1 = +% \def\xx@label +% \@label{#1} +% \xx@label <- {} +% the \xx@label command is called at the start of every environment +% this delay is necessary, because the label is seen before +% the title, or before any counter is stepped. +% +\newif\ifcustom@label +\def\xx@label{}\def\RefLabel{} +\def\x@o@label<#1>{\global\custom@labeltrue + \global\current@label{#1}\x@label} +\def\x@label[#1]{\gdef\RefLabel{#1}% + \gdef\xx@label{\@label{#1}\global\custom@labelfalse + \gdef\xx@label{}}\endgroup} + +% Label contents +% mostly generated by \step@counter or so +% +\newtoks\current@label +\def\define@reference + #1{\ifcustom@label\else + \edef\cs@e{\global\current@label + {\counter@@repr{#1}{\csarg\number{\counter@name{#1}}}}}% + \cs@e + \fi} + +% Internal labeling command +% 1/ \current@label contains tokens describing the reference +% do a twostep unwrap of that +% 2/ write out the result to the .aux file +% 3/ if the current file has been \InputeFile'd, +% write out to the .aux of the input file. +% +% the string written out is for \@label{Key}: +% \refer@label{ref@Key}{label value}{page counter} +% +\def\@label@key#1{ref@#1} +\noeol +\def\@label#1{\Tmessage[ref]{Label definition: <#1>=\the + \current@label} + \ifWriteExtern \begingroup + \def\label[##1]{}\normalesc + \def\cprotect{\xp\string} + %\xp\xp\xp\string\FooCounter => + %\xp\string\Foo@R{\number\Foo@C} => \string\@arabic{123} + \def\protect{\noexpand\protect\noexpand} + %\test@defined@key{#1} + \edef\cs@e{\edef\nxp\cs@e{\current@label={\the\current@label}} + \nxp\cs@e} + \cs@e + %\Tmessage[ref]{Label as written: <\the\current@label>} + \edef\cs@e{\the\current@label} + \edef\cs@a##1{\nxp\csarg\write{##1@file} + {\string\refer@label{\@label@key{#1}} + {\macro@meaning\cs@e}{\noexpand\PageCounter}}} + \cs@a{aux} + \ifx\@invoernaam\@leeg + \else \ifLocalReferences \cs@a{incaux}\relax \fi\fi + \endgroup\fi} +\newcount\duplicate@labels +\def\test@defined@key#1{\if\UndefinedCS{\@label@key{#1}} + \Tmessage[ref]{First time definition of <#1>} + \else\xp\xp\xp\xp\xp\xp\xp\ifx\xp\xp\xp + \third@of@three\csn \@label@key{#1}\ecs\StaleRef + \begingroup + \edef\cs@e{\CSname{\@label@key{#1}}} + \xp\xp\xp\def\xp\xp\xp\cs@e\xp\xp\xp{\cs@e} + \temptoksa\xp\xp\xp{\xp\first@of@three\cs@e} + \edef\cs@e{\CSname{\@label@key{#1}}} + \xp\xp\xp\def\xp\xp\xp\cs@e\xp\xp\xp{\cs@e} + \temptoksb\xp\xp\xp{\xp\second@of@three\cs@e} + \edef\cs@e{\temptoksa + {{\the\temptoksa}{\the\temptoksb}\nxp\FreshRef}} + \cs@e + \csarg\xdef{\@label@key{#1}}{\the\temptoksa} + \endgroup + \Tmessage[ref]{Refreshing definition of <#1>:\@space + \xp\meaning\csn \@label@key{#1}\ecs} + \else\Wmessage{Duplicate label: <#1>}% + \advance\duplicate@labels\@ne\fi\fi} +\normaleol + +% complete expandable exploding of token lists +\def\macro@meaning#1{\xp\strip@macro@meaning\meaning#1} +\def\toks@meaning#1{\edef\cs@e{\the#1}\macro@meaning\cs@e} +\begingroup\escapechar=-1 +\xp\xp\xp\gdef\xp\xp\xp\strip@macro@meaning\xp\string + \csname macro:->\endcsname{} +\endgroup + +\NewDummy{StaleRef}\NewDummy{FreshRef} + +% Referring and Page references. +% first of all, when the .aux file is read: +% \refer@label{ref@Key}{label}{page} = +% \gdef\ref@Key{ {{label}} {{page}} } +% with extra braces for occurring fonts +% +\def\refer@label#1#2#3{\csarg\gdef{#1}{{{#2}}{{#3}}\StaleRef}} + +% then \ref[key] = \@ref\take@former[key] +% \pgref[key] = \@ref\take@latter[key] +% and \@ref\cs[key] = \expandafter\cs\ref@key +% = \cs {{label}} {{page}} +% +\def\ref {\ifnextchar(%) + {\@ref\first@of@three}{\@ref\first@of@three()}} +\def\pgref{\ifnextchar(%) + {\@ref\second@of@three}{\@ref\second@of@three()}} +\newcount\unknown@refs +\add@start@command{\unknown@refs\z@} +\def\@ref#1(#2)[#3]{% + \if\UndefinedCS{\@label@key{#3}}% + \message{Unknown #1{}{page}{}reference: <#3>}{\bf ??}% + \global\advance\unknown@refs\@ne + \else \@@ref{#1}{#2}{\@label@key{#3}}\fi} +\def\@@ref#1#2#3{\@@@ref#1{#3}% + \if\IsEmptyList{#2}\else,\penalty200\ #2\fi} +\def\@@@ref#1#2{% + \xp\xp\xp#1\csname#2\endcsname} +% for btxmac +\def\@printlabel#1{\@ref\first@of@three()[#1]} +%\@@@ref\first@of@three{\@label@key{#1}}} + +% Test for changed references +% at the end of the job +% +\def\test@refer@label#1#2#3{ + \def\cs@a{{{#2}}{{#3}}\FreshRef} + \def\cs@b{{{#2}}{{#3}}\StaleRef} + \csarg\ifx{#1}\cs@a + \else \csarg\ifx{#1}\cs@b + \else \labels@changedyes + \Tmessage[ref]{New definition for <#1>} + \fi\fi} + +% Citations. +% \cite[key] = [\ref[key]] +% \cite(string)[key] = [\ref[key], string] +% +%\def\cite{\ifnextchar(\y@cite\x@cite} +%\def\y@cite(#1)[#2]{[\ref[#2], #1]} +%\def\x@cite[#1]{[\ref[#1]]} + +% External Generic Option +% use: external:extfile ... external:stop +% stores result in \extern@x/y/z@toks in a tricky way: +% 'x' stores expandable parts, 'y' stores protectable parts. +% this is inserted in \@outerstartcommands +% +\NewTrace:ext +\newif\ifin@external +\add@generic@default{\in@externalno} +\newtoks\extern@toks \newtoks\late@extern@toks +\newtoks\build@extern@toks +\newtoks\extern@x@toks \newtoks\extern@y@toks \newtoks\extern@z@toks +\adds@generic@default{ + \extern@toks\empty@toks \late@extern@toks\empty@toks + \extern@x@toks\empty@toks\extern@y@toks\empty@toks} +\@GenericOption{external}{ + \switch {\if\EqualString{#1}} + {stop} {\external@stop{extern@toks}} + {late} {\external@stop{late@extern@toks}} + {default} {\external@start{#1}} + \endswitch} +\def\external@start#1{\b@group[external]\in@externalyes + \build@extern@toks\empty@toks + \switch@to@options@list{build@extern@toks} + \if\UndefinedCS{\file@ext@name{#1}} + \Wmessage{Unknown external file: <#1> + while defining <\@name>}\def\@add@toks##1{}% + \else \generate@extern{#1}% document: this writes the file name + \Tmessage[ext]{External definition <#1>} + \fi + \extern@x@toks\empty@stack \extern@y@toks\empty@stack + \extern@z@toks\empty@toks + \begingroup \switch@to@options@list{extern@z@toks} + } +\def\external@handle@title#1{\seen@textyes + \external@handle@expandable{#1}{\csn\@@@title{#1}\ecs}{title: <#1>}} +\def\external@handle@expandable#1#2#3{ + \extern@push@part{y}{\the\extern@z@toks} + \extern@push@part{x}{#2} + \Tmessage[ext]{External pushed #3} + \extern@z@toks\empty@toks} +\def\extern@push@part#1{\csarg{\let\xp\cs@a}{extern@#1@toks} + \xp\push@onto@cs\xp\cs@a\xp} +\def\extern@pop@n@pop{} +\def\external@before@title{\in@externalyes\seen@textno + \switch@to@options@list{e@before@toks}} +\def\in@ref@protect{\ifin@label\@add@toks{\protect}\fi} +\def\cs@in@ref@protect#1{% + \ifin@label \title@count@no@protect{#1} \fi + \ifin@external \title@count@no@protect{#1} \fi +} +\def\title@count@no@protect#1{% + \if\has@no@count@string #1Counter? + \if\has@no@title@string #1Title? + \@add@toks{\protect}\fi\fi} +\def\has@no@count@string #1Counter#2? + {00\fi\if\IsEmptyList{#2}} +\def\has@no@title@string #1Title#2? + {00\fi\if\IsEmptyList{#2}} +% wind up making an external: invert the stacks +% and append them +\def\external@stop#1{\extern@push@part{y}{\the\extern@z@toks} + \invert@csstack\extern@x@toks \invert@csstack\extern@y@toks + \xdef\cs@e{\nxp\@add@toks + {{\the\extern@x@toks}{\the\extern@y@toks}}} + \endgroup %revert to build@extern@toks + \cs@e \@add@toks{\e@extern} + \switch@to@options@list{#1} + \edef\cs@e{\nxp\@add@toks{\the\build@extern@toks}}\cs@e + \e@group[external]} +% how do we write stuff to the aux file? +% #1 is the x toks, #2 the y +\def\aux@write@external#1#2{% + \extern@x@toks{#1}\extern@y@toks{#2}% +% \let\\\relax +%\message{Expandables <\the\extern@y@toks>} +% \edef\cs@e{\extern@y@toks{#2}}\cs@e +%\message{becomes <\the\extern@y@toks>} + \length@of@csstack\extern@x@toks + \tempcounta\z@ \extern@toks\empty@toks + \loop\ifnum\tempcounta<\stack@length + \pop@cs@into\extern@z@toks\extern@y@toks + \append@cslist@to@cslist\extern@toks\extern@z@toks + \pop@cs@into\extern@z@toks\extern@x@toks + \extern@z@toks\xp\xp\xp{\the\extern@z@toks}% + \append@cslist@to@cslist\extern@toks\extern@z@toks + \advance\tempcounta\@ne\repeat + \pop@cs@into\extern@z@toks\extern@y@toks + \append@cslist@to@cslist\extern@toks\extern@z@toks + \xp\def\xp\cs@e\xp{\the\extern@toks}\edef\cs@e + {\write\aux@file{\real@meaning\cs@e}}\cs@e} +% +% Protection of expandable control sequences; +% value \nxp\protect\nxp is set during label definition and shipout +% \protect should be empty during execution +% +\def\protect{} + +%%%%%%%%%%%%%%%% External references +% define explicitly the form a reference will take +% label:start ... label:stop +% +% Maybe this can be unified with the `external' option +% +\newif\ifin@label +\newif\iflabel@defined \newtoks\@labelcoms +\add@generic@default{\@labelcoms{} \label@definedno \in@labelno} +\@GenericOption{label}{ + \if\EqualString{#1}{stop}\e@group[label] + \else \global\label@definedyes\global\has@labelyes + \b@group[label] \in@labelyes + \switch@to@options@list{@labelcoms} + \fi} + +%%%%%%%%%%%%%%%% Substitutions + +% Long substitutions +% the style designer declares the existence of a substitution +% +% \DefineSubstitution:Foo = +% \def\Foo#1\par +% +\def\DefineSubstitution:#1 + {\Tmessage[def]{Substitution being defined: #1} + \csarg\edef{#1}##1\par{\@@subdef{#1}} + \edef\cs@e{\let\CSname{if#1Exists}=\CSname{iffalse}} + \cs@e + } +\def\@@subdef#1{\let\CSname{if#1Exists}=\CSname{iftrue}% + \def\CSname{#1@text}{##1}} + +% Short substitutions +% almost the same, but to end of line instead of to \par +% +\def\DefineShortSubstitution:#1 + {\@DefineShortSubstitution{#1}} +{\noeol +\othercr +\gdef\@DefineShortSubstitution#1{ + \Tmessage[def]{Defining short substitution: #1} + {\othercr + \csarg\xdef{#1}{\noexpand\othercr \CSname{@#1}} + \csarg\xdef{@#1}##1^^M{ + \@@subdef{#1}\noexpand\normalcr}} + \global\csarg\let{ifExists#1}=\iffalse}} + + +% Substitute +% is then a command for both user and style designer. +% \Substitute:text=uppercase/lowercase is possible +% but these take more than just expansion. +% +\def\Substitute:#1 {\@substitute#1== } +\def\@substitute#1=#2= + {\if\ifempty{#2}{\csname#1@text\endcsname}% + \else\if\EqualString{#2}{uppercase}% + \uppercase\xp\xp\xp{\csname#1@text\endcsname}% + \else \lowercase\xp\xp\xp{\csname#1@text\endcsname}% + \fi + \fi}%why did this say \noesc\csname\string#1@text... ? + +{\noeol +\othercr +\gdef\variant{\bgroup\othercr \@variant} +\gdef\@variant:#1=#2^^M#3\variantstop{ + \csarg\gdef{#1}{\par\bgroup #3 \csname#2\endcsname} + \csarg\xdef{#1stop}{\CSname{#2stop}\egroup} + \egroup} +} + +% Value +% this is analogous to \Distance (in file text) +% +\def\Value:#1=#2 + {\edef\cs@e{\if\UndefinedCS{#1}\noexpand\new@count + \else \noexpand\set@value \fi + {#1}% + \if\UndefinedCS{#2}{#2}% + \else \CSname{#2}\fi} + \cs@e} + +%%%%%%%%%%%%%%%% Tests +% +% Test user command +% +\def\DefineTest:#1 + {\Tmessage[def]{Defining test: #1} + \csarg\newif{if#1} + \csarg\def{#1}:##1 {\csname #1##1\endcsname}} + +% Test generic option +% +% option test:Foo tests if \ifFoo is defined +% +% if not, \let\ifFoo=\iffalse, and +% \StyleDefinitionStop performs a test +% and warns if still undefined +% +% \let\hang@fi\@empty globally +% \def\hang@fi{\@add@toks{\fi}} is defined locally +% ==> check on unclosed test options. +% +\@GenericOption{test}{ + \switch {\if\EqualString{#1}} + {otherwise}{\hang@else} + {stop}{\hang@fi \e@group} + {default}{\b@group + \if\UndefinedCS{if#1} + \check@existence{if#1} + \edef\cs@e{\global\let\CSname{if#1}\CSname{iffalse}} + \cs@e + \fi + \hang@fi@define + \edef\cs@e{\nxp\@add@toks{\CSname{if#1}}}\cs@e + } + \endswitch} + +% The body of these macros has to be kept outside of conditionals +% +\def\hang@else{\@add@toks{\else}} +\def\hang@fi@define{\def\hang@fi{\@add@toks{\fi}}} +\add@generic@default{\let\hang@fi\@empty} +\add@generic@stop@default + {\ifx\hang@fi\@empty\else + \Emessage{There are tests open in \@name}\fi} + +% voorgegeven tests uit TOOLS +\newif\ifVoortgang +\def\Voortgang:#1 {\csname Voortgang#1\endcsname} +\DefineTest:Diagnose + +\endinput + +% 92/11/26 ifcustom@label and attendant handling +% 92/12/05 \@label@key
\ No newline at end of file diff --git a/Master/texmf-dist/tex/lollipop/lollipop-document.tex b/Master/texmf-dist/tex/lollipop/lollipop-document.tex new file mode 100644 index 00000000000..7014bae8423 --- /dev/null +++ b/Master/texmf-dist/tex/lollipop/lollipop-document.tex @@ -0,0 +1,381 @@ +% lollipop-document.tex copyright 1992/3 Victor Eijkhout +% copyright 2014 Vafa Khalighi +% +% +% This program is free software: you can redistribute it and/or modify +% it under the terms of the GNU General Public License as published by +% the Free Software Foundation, either version 3 of the License, or +% (at your option) any later version. +% +% 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 +% GNU General Public License for more details. +% +% You should have received a copy of the GNU General Public License +% along with this program. If not, see <http://www.gnu.org/licenses/>. +% +% +%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%% +%%% D O C U M E N T S T R U C T U R E %%% +%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%% + +\DefineTest:LocalReferences +\NewTrace:doc + +% Start +% open external files and execute default commands +% +\newif\if@started +\def\Start{\@startedyes \the\start@commands + \ifBasicIndentIsSet\else + \Distance:basicindent=parindent \fi + \set@level@indent} +\def\StartCommand#1{\adds@start@command{#1}} + +% End +% 1/ close any open groups and give warnings +% 2/ \vfil\eject the last page +% 3/ \immediate\close the .auxs file +% 4/ load the .aux for writing the external files +% and testing changed references +% +\let\@end=\end +\def\Stop{\Close@all@groups + \the\stop@commands + \vfil \penalty\slotpenalty + \ifnum\unknown@refs>\z@ + \message{-- There \ifnum\unknown@refs=\@ne was an \else + were \number\unknown@refs\@space\fi + unresolved reference\ifnum\unknown@refs>\@ne s\fi.}\fi + \ifnum\duplicate@labels>\z@ + \message{-- There \ifnum\duplicate@labels=\@ne was an\else + were \number\duplicate@labels\@space\fi + duplicate label\ifnum\duplicate@labels>\@ne s\fi.}\fi + \immediate@close@aux@file{aux} + \ifWriteExtern \final@load@aux \fi + \@end} +\def\StopCommand#1{\adds@stop@command{#1}} + +%%%%%%%%%%%% input other files +\newwrite\aux@file \newwrite\incaux@file +\let\ifWriteaux\iftrue +\def\aux@name{aux} \def\aux@extension{aux} +\newif\if@auxopen \newif\if@incauxopen + +% the following line is in output.tex +%\add@mark@item{first@page} + +% Input files are in a group, +% they also set the IsFirstPage test +\def\InputFile:#1 {\begingroup \def\input@name{#1} + \Tmessage[doc]{Input File: #1} + \refresh@mark@item{first@page}{yes} + \refresh@mark@item{first@page}{no} + \ifLocalReferences + \get@aux@file{#1}{incaux}{aux}\fi + \input@file{#1}% + \immediate@close@aux@file{incaux} + \Close@all@groups + \def\test@input@name{#1}\ifx\input@name\test@input@name\else + \Wmessage{Input `#1' overbalanced}\fi + \endgroup} +\def\xInputFile:#1 {\input@file{#1}} +\def\input@file#1{\input #1 \vfil\penalty\slotpenalty\par} + +\let\input@name=\@empty +\let\test@input@name=\@empty + +% Input of Lollipop files +% +\def\InputLollipop:#1 {\makeatletter\input#1\relax\makeatother} + +%%%%%%%%%%%%%%%% External Communication + +% List of files +% not including the .aux file +% +\newtoks\ext@files@list \ext@files@list={} + +% I don't want to remember my own naming conventions. +% +\def\file@ext@name#1{#1@extension} +\def\cs@file@ext@name#1{\csname#1@extension\endcsname} + +% Define External File +% #1 is name known to style definition, +% #2#3#4 is three-letter file extension in +% file system +% +% correspondence: \#1@extension = #2#3#4, \#2#3#4@name = #1 +% +% user test \Write#1 to prevent overwriting +% internal test \if@#2#3#4open +% \newwrite\#2#3#4@file +% +\def\DefineExternalFile:#1=#2#3#4#5 + {\Tmessage[doc]{Define external file `#1' (ext=#2#3#4)} + \csarg\newwrite{#2#3#4@file} + \append@to@list{ext@files@list}{\\#2#3#4; } + \csarg\newtoks{#1@local@defs}%constructed in \ExternalItem + \csarg\gdef{\file@ext@name{#1}}{#2#3#4} + \csarg\gdef{#2#3#4@name}{#1} + \DefineTest:{Write#1} + \global\csname Write#1yes\endcsname + \csarg\newif{if@#2#3#4open} + } + +%%%% Load + +% Initial load of the auxiliary file +% +\def\initial@load@aux{%\begingroup%why this group? + \disable@external@write@command + \Tmessage[doc]{Load initial aux file} + \get@aux@file{\jobname}{aux}{aux} + %\endgroup + \ifWriteExtern + \open@ext@file@for@output{\jobname}{aux}{aux} + \fi} +% A test to determine all-or-nothing writing of .aux file. +% below there is a redefinition for bibTeX +\DefineTest:WriteExtern \WriteExtern:yes +\ifini{\add@start@command{\initial@load@aux}} + +% Load of external file +% +\def\LoadExternalFile:#1 + {\if\UndefinedCS{\file@ext@name{#1}} + \Wmessage{LoadExternalFile: unknown external file `#1'} + \else \begingroup + \Tmessage[doc]{Loading external file: #1} + \WriteExtern:no %prevent trouble with undefined entries + \csarg\the{#1@local@defs} + \get@aux@file{\jobname}{\cs@file@ext@name{#1}} + {\cs@file@ext@name{#1}} + \endgroup + \fi} + +% Basic load +% +\def\get@aux@file#1#2#3{ + \csarg\openin{#2@file} #1.#3 + \csarg\ifeof{#2@file} + \message{No aux file `\csname#2@name\endcsname'} + \else \csarg\closein{#2@file} + \Tmessage[ref]{Inputting aux file <#2>: <#1.#3>} + \Tmessage[ext]{Inputting aux file <#2>: <#1.#3>} + \makeatletter \input #1.#3 \makeatother + \fi} + +% Open for output: +% initially used for the .aux file +% at the final load of the .aux file used to generate .toc +% et cetera +% +\def\open@ext@file@for@output#1#2#3{ + \csname ifWrite\csname #2@name\endcsname\endcsname + \immediate\openout\csname#2@file\endcsname=#1.#3 + \global\csname @#2openyes\endcsname + \immediate\write\csname#2@file\endcsname{\relax} + \Tmessage[doc]{File '#2' (#3) open for output} + \Tmessage[ext]{File '#2' (#3) open for output} + \else + \global\csname @#2openno\endcsname + \Tmessage[doc]{File '#2' (#3) not open for output} + \Tmessage[ext]{File '#2' (#3) not open for output} + \fi} +\def\open@external@files@for@output{ + \def\protect{\noexpand\protect\noexpand} + \def\\##1;{##1}\Tmessage[doc]{External files: \the\ext@files@list} + \def\\##1;{\open@ext@file@for@output{\jobname}{##1}{##1}} + \the\ext@files@list} + +\newif\iflabels@changed +\def\final@load@aux{\labels@changedno + \def\refer@label##1##2##3{\test@refer@label{##1}{##2}{##3}} + \open@external@files@for@output + \install@external@write@command + \Tmessage[doc]{Load aux for label testing and ext file generation} + \Tmessage[ext]{Load aux for label testing and ext file generation} + \makeatletter \input \jobname.aux + \end@write@extern + \iflabels@changed \Wmessage{Labels have changed. Rerun!} \fi + \makeatother} +\def\end@write@extern{ + \def\\##1;{\immediate@close@aux@file{##1}} + \the\ext@files@list} +\def\close@aux@file #1{\csname if@#1open\endcsname + \write\csname#1@file\endcsname{\relax} + \closeout\csname#1@file\endcsname + \Tmessage[doc]{File '#1' closed}\fi} +\def\immediate@close@aux@file#1{\csname if@#1open\endcsname + \immediate\write\csname#1@file\endcsname{\relax} + \immediate\closeout\csname#1@file\endcsname + \Tmessage[doc]{File '#1' immediately closed}\fi} + + +% Generate the extern call in the style definition +% this one is part of 'external:<file name>' +% +\def\generate@extern#1{\edef\cs@e + {\nxp\@add@toks{\nxp\@extern + {\CSname{\file@ext@name{#1}}} + {\@name} + {\ifhas@counter \CSname{\@name Counter}\fi} +%\counter@@repr{\@name} +%{\nxp\the\counter@@name{\@name}}\fi}% + }}\cs@e} + +% call: +% \@extern{extension}{object}{counter}\the\title@toks\e@extern +% to aux: +% \write@to@external{extension}{object}{counter}{page}{tekst}\ew@extern +% to .extension file: +% \object{counter}{page}tekst\par +% where \object is locally defined in the 'extension' file. +% +\def\ToExternalFile:#1=#2 + {\edef\cs@e{\nxp\x@extern{\cs@file@ext@name{#1}}}% + \cs@e{anon}{}{\\{#2}\\{}}{\\{}\\{}\\{}}\e@extern} +\def\@extern{\ifWriteExtern + \xp\x@extern \else \xp\skip@extern \fi} +\def\skip@extern#1#2#3\e@extern + {\Tmessage[ext]{Skipped `#2' for `#1'}} +\newtoks\ext@text@toks +\newtoks\ext@labl@toks +\newtoks\ext@page@toks +\begingroup\noeol\catcode`\?\catcode`\%\catcode`\%=12 +\gdef\x@extern#1#2#3#4#5\e@extern + {\begingroup\normalesc + \def\label[##1]{} + \def\protect{\noexpand\protect\noexpand} + \def\cprotect{\xp\string} + \Tmessage[ext]{Write to aux `#2' for `\csname#1@name\endcsname'} + \edef\cs@e{\write\aux@file{\string\write@to@external + {#1}{#2}{#3}}}\cs@e + \write\aux@file{ + {\counter@@repr{Page}{\csarg\number{\counter@name{Page}}}}%} + \aux@write@external{#4}{#5} + \write\aux@file{\string\ew@extern} + \endgroup} +\normaleol\endgroup + +% string a word, delimited by a space, +% first see whether it is a group, recognized by the fact +% that there is another space in it. +\def\string@um@up#1 {\string@space@group#1 \>\@bean} +\def\string@space@group#1 #2#3\@bean + {\ifx#2\> \string@word#1\@roy + \else \string{\string@um@up#1 #2#3 \string}% + \fi \@space\string@um@up} +% a word is delimited by \@roy; if the word is \> then this +% is the last word, and we should remove +% a trailing \@roy plus the \@space\string@um@up tokens after the call, +% but also parts of the conditional after the call have to be removed: +% \expandafter \take@three \expandafter \@roy \else .. \fi \@space\string@.. +% +% sick. very sick. +% +\def\string@word#1{\ifx#1\>\xp\expandafter\xp\take@three\xp\expandafter + \else \ifx#1\@roy + \else \string#1\ifcat\nxp#1\relax\@space\fi + \xp\xp\xp\string@word + \fi \fi} + +% an attempt to string up a title. +% this covers for the case where there are groups, +% but it is still quite wrong if \else or so is in the title +% +\NewDummy{@roy}\NewDummy{@bean}\NewDummy{@rope}\NewDummy{@bear} +\NewDummy{@Rope} +% Enable/Disable communication to external files +% former during initial load of .aux file, +% latter during final load of .aux file +% +\def\disable@external@write@command + {\def\write@to@external##1\ew@extern{}} +\disable@external@write@command %do this initially just to be sure +\def\install@external@write@command %grouping ok? + {\def\write@to@external##1##2##3##4##5\ew@extern + {\csname if@##1open\endcsname + \Tmessage[ext]{Write `##2' + to `\csname##1@name\endcsname'} + \ext@labl@toks{##3} + \ext@page@toks{##4} + \ext@text@toks{##5} + \immediate\write\csname##1@file\endcsname + {\CSname{##2}{\the\ext@labl@toks}% + {\the\ext@page@toks}\the\ext@text@toks + \string\par} + \else + \Tmessage[ext]{Skipped `##2' + for `\csname##1@name\endcsname'} + \fi}} + +%%%%%%%%%%%%% BibTeX interface +% we interface ourselves to the BtxMac macros +% of Karl Berry and Oren Patashnik, version 0.99h + +% prevent btxmac from rewriting *our* auxfile +% if btxmac has not been loaded this is just \relax +\adds@start@command{\csn @auxfiledonetrue\ecs} + +% alternate name for the aux write stream +\adds@start@command{\let\@auxfile\aux@file} + +% disable / alter Btxmac definitions +\def\bbl@hook{\default@everypar} +\adds@start@command{\let\bblhook\bbl@hook} + +% switch off btxmac if need be +\xp\def\xp\WriteExternno\xp + {\WriteExternno \let\noauxfile\@space} + +% if you want to read an aux file but not load btxmac: +\let\bibstyle\take@one \let\bibdata\take@one +\let\citation\take@one \let\nocite\take@one +% similarly the source: +\let\bibliography\take@one \let\bibliographystyle\take@one + +% user defined bibliography +\def\DefineBBL{\let\bbl@hook\BBL@hook \DefineList:BBL } +\def\BBL@hook + {\def\begin##1##2{\default@everypar\BBL}\def\end##1{\>}% + %intercept \begin{thebibliography}{width} + \def\bibitem{\ifNextChar[%] + \bbl@print@item\bbl@item} + \def\biblabelprint##1{} + } +\def\bbl@item#1{\item[#1]} +\def\bbl@print@item[#1]#2{\item<#1>[#2]} + +% refer to a bib item +\def\bibref[#1]{\cite{#1}}%{[\ref[#1]]\nocite{#1}} + +\def\one@bib@citation#1\@@{% this is what \bib@citation will become + \if@notfirstcitation + \printbetweencitations + \fi + % + \expandafter \ifx \csname\@citelabel{#1}\endcsname \relax + \if@citewarning + \message{\@linenumber Undefined citation `#1'.}% + \fi + % Give it a dummy definition: + \expandafter\gdef\csname\@citelabel{#1}\endcsname{% + {\tt \nobreak\hskip0pt#1\nobreak\hskip0pt}}% + \fi + \@printlabel{#1}% + \@notfirstcitationtrue +} +\def\@c@l#1{@empty} +\adds@start@command{\let\@onecitation\one@bib@citation + \let\@citelabel\@c@l} + +\endinput + +% 92/11/18 \Start extended with start@commands and \basicindent +% 92/11/20 \StopCommand added +% 92/11/21 groups removed from initial loading aux (twice) +% 92/11/26 BibTeX interface
\ No newline at end of file diff --git a/Master/texmf-dist/tex/lollipop/lollipop-float.tex b/Master/texmf-dist/tex/lollipop/lollipop-float.tex new file mode 100644 index 00000000000..5aaa54c13ff --- /dev/null +++ b/Master/texmf-dist/tex/lollipop/lollipop-float.tex @@ -0,0 +1,94 @@ +% lollipop-floats.tex copyright 1992/3 Victor Eijkhout +% copyright 2014 Vafa Khalighi +% +% +% This program is free software: you can redistribute it and/or modify +% it under the terms of the GNU General Public License as published by +% the Free Software Foundation, either version 3 of the License, or +% (at your option) any later version. +% +% 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 +% GNU General Public License for more details. +% +% You should have received a copy of the GNU General Public License +% along with this program. If not, see <http://www.gnu.org/licenses/>. +% +% +% these macros handle inserts for the Lollipop format +%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%% +%%%%%%%%%%%%%% Floating insertions %%%%%%%%%%%%%%%%%% +%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%% + +\@GenericConstruct{Insertion} + +\NewTrace:ins + +\@InsertionOption{location}{ + \switch {\if\EqualString{#1}} + {top} {} + {bot} {} + {mid} {} + {default} {\Wmessage{Unknown qualifier: <location:#1>}} + \endswitch} +\newif\ifsplit@insert +\add@Insertion@default{\split@insertno} +\@InsertionOption{split}{ + \switch {\if\EqualString{#1}} + {no} {\split@insertno} + {default} {\split@insertyes} + \endswitch} + +\def\@DefineInsertion{ + \csarg\newinsert{\@name @ins} + \csarg\edef{\@name}{\insert\CSname{\@name @ins} + \ifsplit@insert\else\vbox\fi % make this a box if no split allowed + \bgroup \the\before@coms + } + \@DefineStopCommand{\the\after@coms \egroup} + } +\endinput +\newinsert\footins +\def\footnote#1{\let\@sf\empty % parameter #2 (the text) is read later + \ifhmode\edef\@sf{\spacefactor\the\spacefactor}\/\fi + #1\@sf\vfootnote{#1}} +\def\vfootnote#1{\insert\footins\bgroup + \interlinepenalty\interfootnotelinepenalty + \splittopskip\ht\strutbox % top baseline for broken footnotes + \splitmaxdepth\dp\strutbox \floatingpenalty\@MM + \leftskip\z@skip \rightskip\z@skip \spaceskip\z@skip \xspaceskip\z@skip + \textindent{#1}\footstrut\futurelet\next\fo@t} +\def\fo@t{\ifcat\bgroup\noexpand\next \let\next\f@@t + \else\let\next\f@t\fi \next} +\def\f@@t{\bgroup\aftergroup\@foot\let\next} +\def\f@t#1{#1\@foot} +\def\@foot{\strut\egroup} +\def\footstrut{\vbox to\splittopskip{}} +\skip\footins=\bigskipamount % space added when footnote is present +\count\footins=1000 % footnote magnification factor (1 to 1) +\dimen\footins=8in % maximum footnotes per page + +\newif\ifp@ge \newif\if@mid +\let\p@getrue=\p@geyes \let\p@gefalse=\p@geno +\let\@midtrue=\@midyes \let\@midfalse=\@midno +\def\topinsert{\@midfalse\p@gefalse\@ins} +\def\midinsert{\@midtrue\@ins} +\def\pageinsert{\@midfalse\p@getrue\@ins} +\skip\topins=\z@skip % no space added when a topinsert is present +\count\topins=1000 % magnification factor (1 to 1) +\dimen\topins=\maxdimen % no limit per page +\def\@ins{\par\begingroup\setbox\z@\vbox\bgroup} % start a \vbox +\def\endinsert{\egroup % finish the \vbox + \if@mid \dimen@\ht\z@ \advance\dimen@\dp\z@ + \advance\dimen@12\p@ \advance\dimen@\pagetotal + \ifdim\dimen@>\pagegoal\@midfalse\p@gefalse\fi\fi + \if@mid \bigskip\box\z@\bigbreak + \else\insert\topins{\penalty100 % floating insertion + \splittopskip\z@skip + \splitmaxdepth\maxdimen \floatingpenalty\z@ + \ifp@ge \dimen@\dp\z@ + \vbox to\vsize{\unvbox\z@\kern-\dimen@}% depth is zero + \else \box\z@\nobreak\bigskip\fi}\fi\endgroup} + +\endinput
\ No newline at end of file diff --git a/Master/texmf-dist/tex/lollipop/lollipop-fontdefs.tex b/Master/texmf-dist/tex/lollipop/lollipop-fontdefs.tex new file mode 100644 index 00000000000..2d9e02319f3 --- /dev/null +++ b/Master/texmf-dist/tex/lollipop/lollipop-fontdefs.tex @@ -0,0 +1,67 @@ +% lollipop-fontdefs.tex copyright 2014 Vafa Khalighi +% +% +% This program is free software: you can redistribute it and/or modify +% it under the terms of the GNU General Public License as published by +% the Free Software Foundation, either version 3 of the License, or +% (at your option) any later version. +% +% 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 +% GNU General Public License for more details. +% +% You should have received a copy of the GNU General Public License +% along with this program. If not, see <http://www.gnu.org/licenses/>. +% +% +%\noeol +% good (?) old Computer Modern +\DefineTypeface{ComputerModern}{cm}% + {roman:r; slant:sl; italic:ti; mitalic:mi; bold:bx; typewriter:tt; + default:r;}% + {<6:5; <7:6; <8:7; <9:8; <10:9; <11:10; <12:10 \sc@led\magstephalf; + <14:10 \sc@led\magstep1; <16:10 \sc@led\magstep2; + <20:10 \sc@led\magstep3; >19:10 \sc@led\magstep4; + default:10;}% + [\ifStyle:italic \ifnum\Fsize<7 ti7\fi\fi + \ifStyle:typewriter \ifnum\Fsize<8 tt8\fi\fi] +\DefineTypeface{ComputerSans}{cmss}% + {roman:; italic:i; mitalic:i; bold:bx; demiboldcondensed:dc; + default:;}% + {<9:8; <10:9; <11:10; <12:10 \sc@led\magstephalf; + <14:10 \sc@led\magstep1; <16:10 \sc@led\magstep2; + <20:10 \sc@led\magstep3; >19:10 \sc@led\magstep4; + default:10;}% + [\ifStyle:bold \ifnum\Fsize<10 bx10\fi\fi] + +% MonoType +\DefineTypeface{MTGill}{MGilSan} + {roman:; italic:Ita; mitalic:Ita; bold:Bol; + lite:Lig; litital:LigIta; default:;} + {default: at \Fsize pt;} + +% Postscript +\DefineTypeface{macTimes}{Times} + {roman:; italic:I; mitalic:I; bold:B; default:;} + {default: at \Fsize pt;} +\DefineTypeface{macHelvetica}{Helvetica} + {roman:; italic:I; mitalic:I; bold:B; default:;} + {default: at \Fsize pt;} +\DefineTypeface{macAvantGarde}{AvantGarde} + {roman:; italic:I; mitalic:I; bold:B; default:;} + {default: at \Fsize pt;} +\DefineTypeface{macCourier}{cour} + {roman:; italic:i; mitalic:i; bold:b; default:;} + {default: at \Fsize pt;} +\DefineTypeface{unixTimes}{Times} + {roman:; italic:I; mitalic:I; bold:B; default:;} + {default: at \Fsize pt;} +\DefineTypeface{unixHelvetica}{Helvetica} + {roman:; italic:I; mitalic:I; bold:B; default:;} + {default: at \Fsize pt;} +\DefineTypeface{unixCourier}{cour} + {roman:; italic:i; mitalic:i; bold:b; default:;} + {default: at \Fsize pt;} + +\endinput diff --git a/Master/texmf-dist/tex/lollipop/lollipop-fonts.tex b/Master/texmf-dist/tex/lollipop/lollipop-fonts.tex new file mode 100644 index 00000000000..d7a1ce76dc2 --- /dev/null +++ b/Master/texmf-dist/tex/lollipop/lollipop-fonts.tex @@ -0,0 +1,415 @@ +% lollipop-fonts.tex copyright 1992/3 Victor Eijkhout +% copyright 2014 Vafa Khalighi +% +% +% This program is free software: you can redistribute it and/or modify +% it under the terms of the GNU General Public License as published by +% the Free Software Foundation, either version 3 of the License, or +% (at your option) any later version. +% +% 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 +% GNU General Public License for more details. +% +% You should have received a copy of the GNU General Public License +% along with this program. If not, see <http://www.gnu.org/licenses/>. +% +% +%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%% +%%%%%%%%% Font selection macros %%%%%%%%%%% + +%%%% +%%%% Text Fonts +%%%% + +\NewTrace:font + +% User commands to change the three parameters + +% \Typeface:FACE +% \F@name <-- FACE +% +\def\Typeface:#1 + {\if\UndefinedCS{#1@code}\Wmessage{Undefined typeface: `#1'}\fi + \def\F@name{#1}} +\let\TypeFace\Typeface + +% \Pointsize:NN +% \Fsize <-- NN +% compute script/sscript sizes +% if necessary install math fonts +% +\def\PointSize:#1 {\tempcounta=\@ww{#1}% + \edef\Fsize{\the\tempcounta}%this line is used in \set@mathfont + \xp\@setsizes\xp{\Fsize}% + \xp\pointsize@baselineskip\xp{\Fsize}} +\let\Pointsize=\PointSize + +% \Style:STYLE +% \F@style <-- STYLE +% load actual font +% put font in \textfont0 +% install value of \@space +% +\def\Style:#1 {\def\F@style{#1}% + \ifmmode\SetFamily\else\SetFont\fi} +\def\ifStyle:#1 {\xp\if\xp\EqualStringX\xp{\F@style}{#1}} + +% and together this makes: +% +\def\current@font{\F@name\F@style\romannumeral\Fsize} + + +% abbreviations for common styles +% +\def\tty{\Style:typewriter } +\def\rm{\Style:roman }\def\bf{\Style:bold }\def\it{\Style:italic } +\def\sl{\Style:italic } + +% Command for actual loading is also user command. +% If this is in a style definition, fill the math families. +% +\def\SetFont{\maybe@load@font + \if@started\else\store@main@font\fi + \ifx\cs@a\relax %error condition if load not succeeded + \else \csname\cs@a\endcsname + \@@space=.5em\relax + \fi} +\def\maybe@load@font{\edef\cs@a{\current@font}% + \if\UndefinedCS{\cs@a}\load@font\fi} +\def\load@font{\def@f@ext@name + \Tmessage[font]{Loading font (text): \cs@a=`\f@ext@name'}% + \edef\cs@e{\global\font\CSname{\cs@a}=\f@ext@name\relax}\cs@e + } +\def\def@f@ext@name + {\edef\f@ext@name{\ext@combo}% + \edef\f@ext@name{\ext@name + \ifx\f@ext@name\@empty \ext@style\ext@size + \else \f@ext@name \fi}} + +\def\face@tag{\F@name @code} +\def\cs@face@tag{\csname\face@tag\endcsname} + +% Find relative sizes of the current size +% and install math fonts +% +\def\@ps@rls#1{ps@rls\romannumeral#1} +\def\PointSizeScriptSizes:#1=#2,#3,#4 + {\csarg\def{\@ps@rls#1}{{#2}{#3}{#4}}} +\def\@setsizes#1{\if\UndefinedCS{\@ps@rls{#1}}\tempcounta#1\relax + \tempcountb\tempcounta \multiply\tempcountb7 \divide\tempcountb10 + \tempcountc\tempcounta \divide\tempcountc2 + \edef\@@setsizes + {{\the\tempcounta}{\the\tempcountb}{\the\tempcountc}}% + \else + \edef\@@setsizes{\csname\@ps@rls{#1}\endcsname}% + \fi + \expandafter\@setsize\@@setsizes} +\PointSizeScriptSizes:0=0,0,0 +\PointSizeScriptSizes:1=1,1,1 +\PointSizeScriptSizes:2=2,2,2 +\PointSizeScriptSizes:3=2,3,3 +\PointSizeScriptSizes:4=4,4,4 +\PointSizeScriptSizes:5=5,5,5 +\PointSizeScriptSizes:6=6,5,5 +\PointSizeScriptSizes:7=7,6,5 +\PointSizeScriptSizes:8=8,6,5 +\PointSizeScriptSizes:9=9,7,5 +\PointSizeScriptSizes:10=10,7,5 +\PointSizeScriptSizes:11=11,8,6 +\PointSizeScriptSizes:12=12,9,7 + +% Fill in a math font family corresponding to the +% surrounding size +\def\SetFamily{\ifface@size@changed\begingroup +%\tracingmacros=2 \tracingcommands\tracingmacros + \edef\tmp@sizes{\csname\@ps@rls{\Fsize}\endcsname} + \edef\Fsize{\xp\first@of@three\tmp@sizes}\maybe@load@font + \edef\cs@e{\global\textfont + \CSname{\F@style @fam}\CSname{\cs@a}}\cs@e + \edef\Fsize{\xp\second@of@three\tmp@sizes}\maybe@load@font + \edef\cs@e{\global\scriptfont + \CSname{\F@style @fam}\CSname{\cs@a}}\cs@e + \edef\Fsize{\xp\third@of@three\tmp@sizes}\maybe@load@font + \edef\cs@e{\global\scriptscriptfont + \CSname{\F@style @fam}\CSname{\cs@a}}\cs@e + \endgroup\fi + \csarg\fam{\F@style @fam}} +\newfam\roman@fam \def\roman@face@size{{foo}{bar}} +\newfam\italic@fam \def\italic@face@size{{foo}{bar}} +\newfam\bold@fam \def\bold@face@size{{foo}{bar}} +\newfam\tty@fam \def\tty@face@size{{foo}{bar}} +\def\ifface@size@changed{\iftrue} +\def\temporarily@out@of@order + {\edef\cs@a{\csn\F@style @face@size\ecs} + \if\EqualString{\F@name}{\xp\take@former\cs@a} + \if\EqualString{\Fsize}{\xp\take@latter\cs@a} + \csn iffalse\xp\xp\xp\ecs + \else \Tmessage[font]{Loading family <\F@style>} + \csarg\edef{\F@style @face@size}% + {{\F@name}{\Fsize}} + \csn iftrue\xp\xp\xp\ecs\fi + \else \Tmessage[font]{Loading family <\F@style>} + \csarg\edef{\F@style @face@size}% + {{\F@name}{\Fsize}} + \csn iftrue\xp\ecs \fi} + +% Define relative sizes, +% and install math fonts, +% loading if necessary +% +\def\@setsize#1#2#3{% + \def\normal{\def\Fsize{#1}\SetFont}\relax + \def\script{\def\Fsize{#2}\SetFont}\relax + \def\scriptscript{\def\Fsize{#3}\SetFont}\relax + \def\style@sizes{#1,#2,#3 }} +\newif\ifloading@math +\def\math@setsize#1,#2,#3 {% + \SaveFont \loading@mathyes + \set@mathfont{#1}\textfont + \set@mathfont{#2}\scriptfont + \set@mathfont{#3}\scriptscriptfont + \RestoreFont \loading@mathno + } + +% these lines are in 'text.tex' +%\everymath{\the\every@everymath} +%\everydisplay{\the\every@everymath} +%\every@everymath{\high@fam\count18\relax \xp\math@setsize\style@sizes} + +% Strut: .8\baselineskip+.2\baselineskip +% note: struts should be locally defined! +% +\def\make@strut{\tempdima=.8\baselineskip \tempdimb=.2\baselineskip + \edef\strut{\vrule height \the\tempdima width \z@ + depth \the\tempdimb \relax}} + +% Main Font +% is the font that's current at the end of the style definition +% this is switched to in the output routine (head/footline!) +% and the user can use it too. +% this does not take properly care of baselineskip and strut. +% nor math fonts, come to think of it. +% +\def\store@main@font + {\edef\MainFace{\def\nxp\F@name{\F@name}} + \SaveFont \let\MainFont\RestoreFont} +\let\MainFont\relax %cs is used in output@setup, which may be called + %from lollipop.tex + +% Save and restore fonts +% +\def\SaveFont + {\edef\RestoreFont{\def\nxp\F@name{\F@name}% + \def\nxp\Fsize{\Fsize}% + \def\nxp\F@style{\F@style}% + \nxp\SetFont + \baselineskip=\the\baselineskip\relax + } + } +\def\RestoreFont{\Wmessage{No `Savefont' has been given}} + +% Defined Fonts +% rather limited, because not upscalable. +% +\def\DefineFont:#1=#2,#3,#4 {\begingroup + \Typeface:#2 \PointSize:#3 \Style:#4 + \edef\cs@e{\global\let\CSname{#1}=\CSname{\current@font}}\cs@e + \endgroup} + + +% Increase / decrease point size +% +\def\PointSizeLarger{\if\NextChar[%] + \ps@plus{\ps@plus[1]}} +\def\PointSizeSmaller{\if\NextChar[%] + \ps@minus{\ps@minus[1]}} +\def\ps@plus[#1]{\let\save@Fsize\Fsize + \tempcounta\Fsize\relax \advance\tempcounta#1\relax + \edef\Fsize{\the\tempcounta}\SetFont + \let\Fsize\save@Fsize} +\def\ps@minus[{\ps@plus[-%] + }%] + +% Baselineskip +% +\def\BaselineSkip:#1 {\baselineskip\@ww{#1}\make@strut} +\def\@ps@bls#1{ps@bls\romannumeral#1} +\def\@@ps@bls#1{\tempcounta#1\relax\baselineskip\tempcounta pt + \baselineskip\bls@ps@ratio\baselineskip\relax} +\def\BaselineSkipPointSizeRatio:#1 {\def\bls@ps@ratio{#1}} +\BaselineSkipPointSizeRatio:1.2 +\def\PointSizeBaselineSkip:#1 + {\edef\cs@e{\nxp\pointsize@baselineskip{\w@w{#1}}}\cs@e}%nxp? +\def\pointsize@baselineskip#1{%also used in \PointSize + \if\UndefinedCS{\@ps@bls{#1}}\@@ps@bls{#1}% + \else \baselineskip\csname \@ps@bls{#1}\endcsname \fi + \make@strut} +\def\SetPointSizeBaselineSkip:#1=#2 + {\edef\cs@e{\w@w{#1}}% + \csarg\edef{\@ps@bls\cs@e}{\w@w{#2}}} + +\def\exblssizes#1{\ifcase#1\z@ \or \z@ \or \z@ \or \z@ \or \z@ + \or 6.1pt %5 + \or 7.3pt %6 + \or 8.5pt %7 + \or 9.7pt %8 + \or 11pt %9 + \or 12pt %10 + \or 13pt %11 + \or 14.5pt %12 + \or 15.6pt %13 + \or 16.8pt %14 + \or 18pt %15 + \or 19.2pt %16 + \or 20.4pt %17 + \or 21.6pt %18 + \or 22.8pt %19 + \or 24pt %20 + \else \ifnum#1=24 28pt \else + \ifnum#1=30 36pt \else + \ifnum#1=32 38pt \else + \ifnum#1=48 56pt \else + \z@ \Emessage{Unknown pointsize: #1}\fi\fi\fi\fi + \fi \normalbaselineskip\baselineskip} + +%%%% Math Fonts +% Math fonts are loaded through the \everymath and \everydisplay. +% This means that they are undefined outside math. +% Therefore, any load during the style definition is global. +% +% Symbol and extension fonts don't change with type +% Control sequences \m@.. are \let to 0 or 1 to indicate that +% math at a certain size has been loaded + +% The ten point extension font is special because it is used +% for all smaller sizes +\font\exx=cmex10 + +% Size to external name conversion for math fonts +\def\mi@size#1{\ifcase#1 \or \or \or \or \or 5\or 6\or 7\or 8\or + 9\or 10\or 10 \sc@led \magstephalf \or 10 \sc@led \magstep1\or + \or 10 \sc@led \magstep2\or \or 10 \sc@led \magstep3\or + \or 10 \sc@led \magstep3\or \or 10 \sc@led \magstep4\fi} +\let\sy@size=\mi@size \let\cm@size=\mi@size +\def\ex@size#1{\ifnum#1<10 10 \else\mi@size{#1}\fi} + +% For a size, test if it has been loaded yet, if not do; +% then install as given style +% +\def\set@mathfont#1#2%% #1=size #2=\text/script/scriptscript style + {\if\UndefinedCS{m@\romannumeral#1}\begingroup + \Tmessage[font]{Loading math style \string#2 at #1pt}%\globaldefs\@ne + \load@mathfammember{cm}{MathIT}{mi}{#1}\mi@size{'177}\relax + \load@mathfammember{cm}{MathSY}{sy}{#1}\sy@size{'060}\relax + \load@mathfammember{cm}{MathRM} {r}{#1}\cm@size{-1}\relax + \ifnum#1>10 \load@mathfammember{cm}{MathEX}{ex}{#1}\ex@size{-1}\relax + \else \global\csarg\let{MathEX\romannumeral#1}\exx + \fi + \global\csarg\let{m@\romannumeral#1}1\relax + \endgroup\fi + \if\UndefinedCS{\F@name VMI\romannumeral#1}\begingroup + \def\Fsize{#1}\def\F@style{mitalic}% + \load@mathfammember{\cs@face@tag} + {\F@name VMI}{\ext@style}{#1} + {\ext@size\take@one}{-1}\relax + \endgroup\fi + \def\Fsize{#1}\SetFont #20\the\font + #21 \csname MathIT\romannumeral#1\endcsname + #22 \csname MathSY\romannumeral#1\endcsname + #23 \csname MathEX\romannumeral#1\endcsname + #2\Kgriek \csname MathRM\romannumeral#1\endcsname + #2\VMIfam \csname \F@name VMI\romannumeral#1\endcsname} +\def\load@mathfammember + #1#2#3#4#5#6% + %% #1=root of external name #2=internal tag + %% #3=external tag #4=size #5=size convertor #6=skew character + {\Tmessage[font]{Loading font (math) + \csname#2\romannumeral#4\endcsname=#1#3#5{#4}}% + \global\xp\font\csname#2\romannumeral#4\endcsname= + #1#3#5{#4}\relax + \global\xp\skewchar\csname#2\romannumeral#4\endcsname=#6\relax + } + +% Allocate a family for cmr, which has Greek capitals +% +\storecat" +\ifini{\newfam\Kgriek} +\mathchardef\Gamma="0\hexdigit\Kgriek 00 +\mathchardef\Delta="0\hexdigit\Kgriek 01 +\mathchardef\Theta="0\hexdigit\Kgriek 02 +\mathchardef\Lambda="0\hexdigit\Kgriek 03 +\mathchardef\Xi="0\hexdigit\Kgriek 04 +\mathchardef\Pi="0\hexdigit\Kgriek 05 +\mathchardef\Sigma="0\hexdigit\Kgriek 06 +\mathchardef\Upsilon="0\hexdigit\Kgriek 07 +\mathchardef\Phi="0\hexdigit\Kgriek 08 +\mathchardef\Psi="0\hexdigit\Kgriek 09 +\mathchardef\Omega="0\hexdigit\Kgriek 0A + +% Math italic variables have to be from the current typeface +% maybe this should be switchable +% +\def\loop@redef@until#1{ +\loop \mathcode\tempcountb\tempcountc + \advance\tempcountb\@ne + \advance\tempcountc\@ne + \ifnum\tempcountb>#1\relax\else \repeat} +\ifini{ +\newfam\VMIfam +\tempcounta=-"100 \advance\tempcounta"\hexdigit\VMIfam00 +\tempcountb=`a \tempcountc=\mathcode`a +\advance\tempcountc\tempcounta +\loop@redef@until{`z} +\tempcountb=`A \tempcountc=\mathcode`A +\advance\tempcountc\tempcounta +\loop@redef@until{`Z} +} + +\restorecat" +\def\cal{\fam2} + +% Typewriter is a bit of a problem +% + \font\ttix=cmtt9 + \font\ttx=cmtt10 \font\ttxi=cmtt10 \sc@led \magstephalf + \font\ttxii=cmtt10 \sc@led \magstep1 + \font\ttxiv=cmtt10 \sc@led \magstep2 + \font\ttxvii=cmtt10 \sc@led \magstep3 + \font\ttxx=cmtt10 \sc@led \magstep4 + +\def\tt{\Typeface:ComputerModern \Style:typewriter } +\def\terugstreep{{\tt \char`\\}} + +% Typeface Definition +% \DefineTypeface{Naam}{rump}{style:exts}{size:exts}{combo:exts} +% after this \Typeface:Naam can be used +% the rump and the extension construct the external file names +% +\def\DefineTypeface#1#2#3#4{\csarg\def{#1@code}{#2} + \csarg\def{#1@styles}{#3 } + \csarg\def{#1@sizes}{#4 } + \if\NextChar[%] + {\DefineTypeface@combos{#1}}{\DefineTypeface@combos{#1}[]}} +\def\DefineTypeface@combos#1[#2]{\csarg\def{#1@combos}{#2}} + +\def\style@selector{\mswitch \xp\if\xp\EqualStringX\xp{\F@style} in: } +\def\a@style@selector#1{\mswitch \xp\if\xp\EqualStringX\xp{#1} in: } +\def\size@selector{\fswitch {\ifnum\Fsize} in: } +\def\a@size@selector#1{\fswitch {\ifnum#1} in: } + +\def\ext@combo{\csname\F@name @combos\endcsname} +\def\ext@style{\xp\xp\xp\style@selector + \csname\F@name @styles\endcsname\endswitch} +\def\ext@size {\xp\xp\xp\size@selector + \csname\F@name @sizes\endcsname\endswitch} +\def\ext@name{\csname\F@name @code\endcsname} + +%\noeol +\endinput + +% 2014/04/16 defined \PointSizeScriptSizes:12 +% 92/11/05 math family setting +% 93/07/03 removed \bold, \italic etc because of change in tools +% 93/07/24 F@size -> Fsize, fontdefs file split off
\ No newline at end of file diff --git a/Master/texmf-dist/tex/lollipop/lollipop-heading.tex b/Master/texmf-dist/tex/lollipop/lollipop-heading.tex new file mode 100644 index 00000000000..29023bf6cc1 --- /dev/null +++ b/Master/texmf-dist/tex/lollipop/lollipop-heading.tex @@ -0,0 +1,49 @@ +% lollipop-heading.tex copyright 1992 Victor Eijkhout +% copyright 2014 Vafa Khalighi +% +% +% This program is free software: you can redistribute it and/or modify +% it under the terms of the GNU General Public License as published by +% the Free Software Foundation, either version 3 of the License, or +% (at your option) any later version. +% +% 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 +% GNU General Public License for more details. +% +% You should have received a copy of the GNU General Public License +% along with this program. If not, see <http://www.gnu.org/licenses/>. +% +% +%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%% +%%%%%%%%%%%%%% H E A D I N G S %%%%%%%%%%%% +\@GenericConstruct{Heading} + +\newif\if@headed +\add@generic@default{\add@after@command{\@headedno}} +\add@Heading@default{\add@after@command{\@headedyes}} + +\add@Heading@default{\def\@afterpenalty{\penalty\@M} + \default@break@afterno} +\add@Heading@default{\has@marksyes} + +\def\@DefineHeading{ + \@DefineStopCommand{\relax} + \csarg\edef{\@name}% + {\@gen@open % this contains: \let\CSname{\@name Title}\nxp\tmp@title + \the\@main@options@list + \@gen@close} + } + +\@HeadingOption{TwoLines}{\switch {\if\EqualString{#1}} + {yes} {\add@after@command{\next@paragraph{\clubpenalty\M@ + \next@paragraph{\global\clubpenalty\default@clubpenalty}}}} + {no} {\add@after@command{\clubpenalty\default@clubpenalty}} + {default} {\edef\cs@e{\nxp\add@after@command{\nxp\next@paragraph + {\clubpenalty\@w@w{#1}\relax\nxp\next@paragraph + {\global\clubpenalty\default@clubpenalty}}}} + \cs@e} + \endswitch} + +\endinput
\ No newline at end of file diff --git a/Master/texmf-dist/tex/lollipop/lollipop-lists.tex b/Master/texmf-dist/tex/lollipop/lollipop-lists.tex new file mode 100644 index 00000000000..0da48fdcb3e --- /dev/null +++ b/Master/texmf-dist/tex/lollipop/lollipop-lists.tex @@ -0,0 +1,362 @@ +% lollipop-lists.tex copyright 1992/3 Victor Eijkhout +% copyright 2014 Vafa Khalighi +% +% +% This program is free software: you can redistribute it and/or modify +% it under the terms of the GNU General Public License as published by +% the Free Software Foundation, either version 3 of the License, or +% (at your option) any later version. +% +% 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 +% GNU General Public License for more details. +% +% You should have received a copy of the GNU General Public License +% along with this program. If not, see <http://www.gnu.org/licenses/>. +% +% +%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%% +%%%%%%%%%%%%%%% L I S T S + + +\@GenericConstruct{List} + +\newif\if@initem \@initemyes \newif\if@alitem +\newbox\@labelbox + +\def\item{\Emessage{Item command outside list}} + +% Breakpoints around a list +% +% first redefine generic defaults: +% try not to break before, maybe not after, +% +\add@List@default{\def\@beforepenalty{\penalty1000 }} +\add@List@default{\def\@afterpenalty{\penalty200 }} + +% between items is okay +% +\add@List@default{\def\@betweenpenalty{\penalty-50 }} +\@ListOption{breakbetween}{ + \switch {\if\EqualString{#1}} + {no} {\def\@betweenpenalty{\penalty\@M}} + {yes} {\def\@betweenpenalty{\CSname{\h@or@v fil}\penalty-\@M}} + {0} {\def\@betweenpenalty{}} + {default} {\edef\cs@e{\def\nxp\@betweenpenalty{\penalty\@w@w{#1}\relax}} + \cs@e} + \endswitch + } + +\newtoks\indent@depth +\add@List@default{\indent@depth={}} + +\noeol +\def\@DefineList{ + \@DefineStopCommand{\nxp\xx@label \the\item@e@coms\@gen@close} + \csarg\edef{\@name}{\@gen@open + \ifitem@list \nxp\step@counter{itemlevel}\fi + \ifenum@list \nxp\step@counter{enumlevel} + \nxp\represent@counter{item} + {\nxp\enum@repr{\counter@@name{enumlevel}}}\fi + \ifleft@embedded@construct \previousindent\z@ + \else \nxp\PushIndentLevel + \ifauto@indent \else \levelindent\the\indent@depth \fi + \parindent\levelindent + \fi + \nxp\@alitemno + \nxp\start@counter{item}% + \the\item@b@coms + \def\nxp\item@label{ + \nxp\ifdim\wd\@labelbox>\tempdima + \ifitem@tab \advance\tempdima20pt\relax + {\nxp\item@label} + \else \iflabel@flow@right + \ifleft@embedded@construct + \else\hskip-\previousindent\fi + \box\@labelbox + \else \nxp\llap{\box\@labelbox}\fi\fi + \nxp\else \llap{\hbox to \tempdima + {\ifleft@item\else\hfil\fi + \box\@labelbox \ifleft@item\hfil\fi}} + \nxp\fi}% + \def\nxp\num@item + {\setbox\@labelbox=\hbox{\the\item@coms} + \tempdima\previousindent + \nxp\item@label %\nxp\Indent:no + \the\item@a@coms \nxp\xx@label} + \def\nxp\item + {\ifleft@embedded@construct + \else \nxp\if@alitem\@par%\CSname{@itembreek}% + \nxp\hold@parskip \nxp\fi \fi + \nxp\if\nxp\TestCounter:item >0 \@betweenpenalty \nxp\fi + \CSname{@\h@or@v white}{\white@between} + \nxp\@initemno \nxp\@alitemyes \nxp\noindent + \nxp\step@counter{item}\relax + \iflabel@defined\else\nxp\define@reference{item}\fi + \CSname{\@name @item}} + } + \csarg\edef{\@name @item}{ + \iflist@has@description \nxp\desc@item + \else \nxp\num@item\fi} + \@Labelize{\@name @item} + } +\normaleol + +% Inside a list Foo \item is defined as +% +% \item = all sorts of skips and switches +% step item counter, define reference +% \Foo@item +% +% \Foo@item[opt.lab.] = \desc@item or \num@item +% +% \desc@item = +% { \aftergroup\num@item \@description} +% +% \num@item = \item@label \item@a@coms \xx@label +% + +% Item +% start with start/left/right +% indicating alignment, start = left +% +\newif\ifleft@item \newif\ifitem@tab +\add@List@default{\left@itemyes \item@tabno} +\newtoks\item@coms % content of the item label +\newtoks\item@b@coms % start of the list? +\newtoks\item@a@coms % immediately after the item +\newtoks\item@e@coms % after the whole list +\add@List@default{\item@coms{}\item@b@coms{}\item@a@coms{} + \item@e@coms{}\def\@current@options@list{item@b@coms}} +\@ListOption{item}{ + \switch {\if\EqualString{#1}} + {stop} {\@add@toks{\egroup}\e@group + \def\@current@options@list{item@a@coms}} + {tabstop} {\item@tabyes + \@add@toks{\egroup}\e@group + \def\@current@options@list{item@a@coms}} + {left} {\global\left@itemyes + \b@group\def\@current@options@list{item@coms}% + \@add@toks{\bgroup}} + {start}{\global\left@itemyes + \b@group\def\@current@options@list{item@coms}% + \@add@toks{\bgroup}} + {right}{\global\left@itemno + \b@group\def\@current@options@list{item@coms}% + \@add@toks{\bgroup}} + {default} {\Emessage{Unknown option #1 for List, item}} + \endswitch} + +% Label overflow +% +\newif\iflabel@flow@right +\add@List@default{\label@flow@rightyes} +\@ListOption{labeloverflow}{ + \if\EqualString{#1}{left}\label@flow@rightno + \else\label@flow@rightyes\fi} + +% Description +% the line after \item gets picked up, +% and becomes available as `description' +% +\newif\iflist@has@description +\add@List@default{\list@has@descriptionno} +\@ListOption{description}{ + \global\list@has@descriptionyes \@add@toks{\description@text}} +{\noeol + \othercr +\gdef\@description{\bgroup\othercr \@@description} +\gdef\@@description#1^^M + {\gdef\description@text{#1}% + \egroup % balance the \bgroup in \@description + % which kept the \othercr local + \egroup % balance the \bgroup in \desc@item + % which enabled the \aftergroup\num@item + } +} +\def\desc@item{\bgroup + \aftergroup\num@item + \@description} + +% White between items +% +\add@List@default{\def\white@between{0pt}} +\@ListOption{whitebetween}{\def\white@between{#1}} +% \edef\white@between{\@w@w{#1}}} + +% Indentation +% is automatic (default) and level dependent +% or explicit +% +\newif\ifauto@indent +\add@List@default{\auto@indentyes} +\@ListOption{indentation}{ + \if\EqualString{#1}{automatic}\auto@indentyes + \else\auto@indentno + \edef\cs@e{\nxp\indent@depth={\@w@w{#1}}}\cs@e + \fi} + +% Tail of the list: +% everything after the keyword 'text' is tail +% +\@ListOption{text}{\at@breakpointyes + \def\@current@options@list{item@e@coms}} + +%%%%%%%%%%%%%%%% List Nesting Counters +% + +% Item sign +% gives the default, level dependent marker +% +\new@@counter{itemlevel} \set@counter{itemlevel}0 +\newif\ifitem@list +\add@List@default{\item@listno} +\@ListOption{itemsign}{ + \global\item@listyes + \edef\cs@e{\nxp\@add@toks + {\nxp\ifcustom@label\nxp\the\current@label + \nxp\else\nxp\item@sign\counter@@name{itemlevel}% + \nxp\fi}} + \cs@e} +\def\@item@sign#1{itemsign\romannumeral#1} +\def\item@sign#1{\if\UndefinedCS{\@item@sign{#1}}\@@item@sign{#1}% + \else \csname \@item@sign{#1}\endcsname \fi} +\def\@@item@sign#1{\ifcase#1\relax\or + $\bullet$\or $\circ$ \or --\else $\cdot$\fi} +\def\SetItemSign:#1=#2{\csarg\edef{\@item@sign{#1}}% + {\cswitch \ifx#2 in: + b $\bullet$; + c $\circ$; + d $\diamond$; + m ---; + n --; + . $\cdot$; + default $\cdot$; + \endswitch}} + +% Item Counter +% +% Allocate a bare bones counter +\new@@counter{item}\represent@counter{item}1 +\newtoks\item@RL \item@RL{} + +% Keep track of enumerate list level +% +\new@@counter{enumlevel} \set@counter{enumlevel}0 +\newif\ifenum@list +\add@List@default{\enum@listno} +\@ListOption{itemCounter}{ + \global\enum@listyes + \@add@toks{\pad@clear\ifcustom@label\the\current@label + \else\itemCounter\fi} + } +\def\@enum@repr#1{enumrepr\romannumeral#1} +\def\enum@repr#1{\if\UndefinedCS{\@enum@repr{#1}}\@@enum@repr{#1}% + \else \csname \@enum@repr{#1}\endcsname \fi} +\def\@@enum@repr#1{\ifcase#1\relax\or + 1\or A\or I\or a\or i\else 1\fi} +\def\SetItemCounterRepresentation:#1=#2{\csarg\edef{\@enum@repr{#1}}{#2}} + +% +\def\@itembreek{\if@initem\par\fi} + +% Clear items for Widest. +% this is rather susceptible for improvement. +% +\def\ClearFor:#1 + {\def\widest@pad{#1}} +\def\widest@pad{\m@ne} +\def\pad@clear{\ifnum\widest@pad=\m@ne\else + \tempcounta\widest@pad + \advance\tempcounta-\LogTen{\cs@counter@name{item}}\relax + \hphantom{\ifcase\tempcounta \or 9\or 99 \or 999 \or 9999 \else 99999\fi + }% + \fi} + +%%%%%%%%%%%%%%%% Stripped Lists +% +% for use in external files +% + +\@GenericConstruct{ExternalItem}%stripped list + +\add@ExternalItem@default{\extra@args\tw@} + +\noeol +\def\@DefineExternalItem{ + \@DefineStopCommand{\@gen@close} + \ifx\pre@fix\@empty \Wmessage{No file for external item: \@name}\fi + \edef\cs@e{\nxp\append@to@list + {\pre@fix @local@defs} + {\nxp\if\nxp\UndefinedCS{\@command} + \nxp\Wmessage{Item `\@name' not defined for `\pre@fix'} + \nxp\else + \let\CSname{\@name}\CSname{\@command} + \nxp\fi}} + \cs@e + \csarg\edef{\@command}##1##2{ + \def\CSname{\@name Label}{##1} + \@gen@open\def\nxp\Page{##2} + \nxp\PushIndentLevel \let\nxp\nl\relax + \the\item@b@coms + \def\nxp\item{\ifleft@embedded@construct\else\noindent\fi + \setbox\@labelbox=\hbox{\the\item@coms} + \nxp\ifdim\wd\@labelbox>\previousindent + \iflabel@flow@right \hskip-\previousindent\box\@labelbox + \else \nxp\llap{\box\@labelbox}\fi + \nxp\else \llap{\hbox to \previousindent + {\ifleft@item\else\hfil\fi + \box\@labelbox \ifleft@item\hfil\fi}} + \nxp\fi}% + \ifexternal@item@has@item\nxp\item\the\item@a@coms\fi + \ifright@embedded@construct\else\@par\fi + \iflong@external\else\nxp\>\fi + } + } +\normaleol + +\add@ExternalItem@default{\@whitebefore\z@toks} +\add@ExternalItem@default{\@whiteafter\z@toks} +\add@ExternalItem@default{\let\Page\@space + \csarg\let{\@name Label}\@space} + +% Specify for what external file this is meant +% +\@ExternalItemOption{file}{ + \if\UndefinedCS{\file@ext@name{#1}} + \Emessage{File <#1> has not been defined yet}\fi + \def\pre@fix{#1}} + +\newif\iflong@external +\add@ExternalItem@default{\long@externalno} +\@ExternalItemOption{long}{ + \csname long@external#1\endcsname} + +% Commands before and after +% option 'title' is dummy +% +%\@ExternalItemOption{title}{} +% dangerous: better rely on automatic titelization + +% Item +% start with start/left/right +% indicating alignment, start = left +% +\add@ExternalItem@default{\left@itemyes} +\add@ExternalItem@default{\item@coms{}\item@b@coms{}\item@e@coms{} + \item@a@coms{}\def\@current@options@list{item@b@coms}} +\newif\ifexternal@item@has@item +\adds@ExternalItem@default{\external@item@has@itemno} +\def\ExternalItem@item{\external@item@has@itemyes + \List@item} + +% Label overflow +% +\add@ExternalItem@default{\label@flow@rightyes} +\let\ExternalItem@labeloverflow\List@labeloverflow + +\endinput + +% 92/11/26 itemsign / itemCounter changed to handle custom@label +% 93/01/03 item call in ExternalItem made conditional
\ No newline at end of file diff --git a/Master/texmf-dist/tex/lollipop/lollipop-output.tex b/Master/texmf-dist/tex/lollipop/lollipop-output.tex new file mode 100644 index 00000000000..eac3898a550 --- /dev/null +++ b/Master/texmf-dist/tex/lollipop/lollipop-output.tex @@ -0,0 +1,739 @@ +% lollipop-output.tex copyright 1992/3 Victor Eijkhout +% copyright 2014 Vafa Khalighi +% +% +% This program is free software: you can redistribute it and/or modify +% it under the terms of the GNU General Public License as published by +% the Free Software Foundation, either version 3 of the License, or +% (at your option) any later version. +% +% 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 +% GNU General Public License for more details. +% +% You should have received a copy of the GNU General Public License +% along with this program. If not, see <http://www.gnu.org/licenses/>. +% +% +%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%% +%%%%%%%%%%%%%%%%% O U T P U T %%%%%%%%%%%%%%% +%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%% + +\@GenericConstruct{PageGrid} + +\newif\if@pagegrid@installed +\ifini{\next@paragraph + {\if@pagegrid@installed \else + \Wmessage{No page grid installed}\fi + }} +\NewTrace:out +\add@PageGrid@default{\text@constructno} +\add@PageGrid@default{\has@marksyes} + +\newtoks\user@overrides +\def\add@user@override#1{\append@to@list{user@overrides}{#1}} + +\newif\if@nubalanceren +\newinsert\botins + +%%%% Page counting +% +% \count0 is the paper counter: +% is increased for every \shipout in the output routine +% \count1 is the page counter: +% you can do with it whatever you like. + +% This appears to the users as if \NewCounter:Page had been done. +% We do it by hand because the number has to be 1. +% +\countdef\sheet@counter=0 +\csarg\countdef{\counter@name{Page}}=1 +\edef\PageValue{\counter@@name{Page}} +\CounterRepresentation:Page=1 +\newtoks\Page@RL %trudge trudge! +\SetCounter:Page=1 + +%%%% Tests +% +\DefineTest:IsRightPage +\DefineTest:IsLeftPage +\DefineTest:IsFirstPage +\DefineTest:IsLastPage +\DefineTest:FlushBottom + +%% anonieme cs'en zijn in gebruik bij opbouw en gebruik %% +% \tempdima : / klad; gebruikt voor hoofdmeting; daarna in \text@column +% \tempdimc : / klad; gebruikt voor voetmeting +% \cs@a : in gebruik door \haalitems + +\def\slotpenalty{-10001} + +\def\@pseudoif#1#2{\tempcounta\escapechar \noesc + \edef\cs@e{\let\CSname{if@\string#1}\CSname{if\string#2}}\cs@e + \escapechar\tempcounta} +\@pseudoif\IsFirstPage\true \@pseudoif\IsLastPage\true +\@pseudoif\IsRightPage\true +\@pseudoif\IsLeftPage\false + +\def\leftright@setup + {\csarg\ifodd{\counter@name{Page}}\relax + \IsRightPage:yes \IsLeftPage:no + \else \IsRightPage:no \IsLeftPage:yes + \fi} +\def\firstpage@setup{\def\cs@a{yes} + \edef\cs@b{\xp\get@placed\xp{\firstmark}{first@page}} + \ifx\cs@a\cs@b \IsFirstPage:yes \else \IsFirstPage:no \fi} +\def\lastpage@setup + {\ifnum\outputpenalty=\slotpenalty\relax + \Tmessage[out]{Last page}\IsLastPage:yes + \else \IsLastPage:no + \fi} +\def\output@setup{\let\par\@par + \parindent\z@ \leftskip\z@ \rightskip\z@ \lineskip\z@ + \default@everypar \MainFont + \leftright@setup \firstpage@setup \lastpage@setup + \@colnum\@ne \output@set@page@width + \Tmessage[out]{Incoming text: (\the\ht\@cclv+\the\dp\@cclv) x + \the\wd\@cclv} + } + +%%%%%%%%%%%%%%%% Head, Foot, Body +% +% Separate boxes are allocated for the page +% head, body, and foot. +% Head and foot contain static material, the +% body contains the text. The body can be empty. +% +\newbox\page@head@box \newtoks\page@head@toks +\page@head@toks{} +\add@PageGrid@default + {\page@head@toks={\setbox\page@head@box=\vbox\bgroup}} +\newdimen\head@height +\def\measure@head{\head@height=\ht\page@head@box + \advance\head@height\dp\page@head@box + \Tmessage[out]{Head measurement: \the\head@height}} + +\newbox\page@foot@box \newtoks\page@foot@toks +\page@foot@toks{} +\add@PageGrid@default{\page@foot@toks= + {\setbox\page@foot@box=\vbox\bgroup}} +\newdimen\foot@height +\def\measure@foot{\foot@height=\ht\page@foot@box + \advance\foot@height\dp\page@foot@box + \Tmessage[out]{Foot measurement: \the\foot@height}} + +\def\goal@height@trace + {\tempdimb\text@height + \multiply\tempdimb\ifnum\user@n@cols=\m@ne\n@cols\else\user@n@cols\fi + \Tmessage[out]{Aim for text height: \the\text@height\@space + \ifnum\user@n@cols>\m@ne (\the\user@n@cols\@space columns; + total height: \the\tempdimb) + \else\ifnum\n@cols>\@ne (\the\n@cols\@space columns; + total height: \the\tempdimb) + \fi\fi}} + +\def\report@body@measurement{ + \Tmessage[out]{Body measurement: + (\the\ht\page@body@box+\the\dp\page@body@box) + x\the\wd\page@body@box} + \ifvoid\topins\else + \Tmessage[out]{Top inserts: \the\ht\topins+\the\dp\topins}\fi + \ifvoid\botins\else + \Tmessage[out]{Foot inserts: \the\ht\footins+\the\dp\footins}\fi + } + +\newbox\page@body@box \newtoks\page@body@toks +\page@body@toks{} +\add@PageGrid@default + {\page@body@toks={\setbox\page@body@box=\vbox\bgroup}} + +\def\finish@part@routines + {\append@to@list{page@head@toks}{\egroup\measure@head} + \append@to@list{page@foot@toks}{\egroup\measure@foot} + \append@to@list{page@body@toks}{\egroup}} + +\newbox\WholePage +\def\make@page{ + \setbox\WholePage=\vbox + {\box\page@head@box + \ifabut@head\nointerlineskip\fi + \ifabut@foot\tempdima\dp\page@body@box\fi + \box\page@body@box + \ifabut@foot\ifvoid\page@foot@box\else + \kern-\tempdima\relax\nointerlineskip\fi\fi + \box\page@foot@box}%\showbox\WholePage + } + +% \vsize has two possibilities: +% 1/ it is calculated dynamically by subtracting +% body and foot height from the total page height. +% If \vsize is different from \ht255, the page +% is thrown back. +% 2/ it is set and the page has whatever size results. +% +\newif\iftext@fits +\def\see@if@text@fits + {{\multiply\text@height\n@cols + \tempdima\text@height + \advance\tempdima-\vsize + \ifdim\tempdima<\z@ \tempdima=-\tempdima \fi + \ifdim\tempdima<.1pt\relax + \global\text@fitsyes + \Tmessage[out]{Page accepted.} + \else \global\text@fitsno + \Tmessage[out]{Text does not fit. (vsize=\the\vsize)} + \global\vsize=\text@height + \fi}} + +% Multicolumn stuff +% +% every PageGrid macro installs \n@cols, but the user +% can specify a different number with \NumberOfColumns:x +% This sets \user@n@cols which is usually -1 +% +\newcount\n@cols \n@cols\@ne +\newcount\@colnum +\newcount\user@n@cols \user@n@cols\m@ne +\Distance:GutterWidth=1cm +\def\NumberOfColumns:#1 + {\user@n@cols=\w@w{#1}\relax + \Tmessage[out]{Switch to \the\user@n@cols\@space columns} + \hsize\page@width + \tempdima\GutterWidth \multiply\tempdima\user@n@cols + \advance\tempdima-\GutterWidth + \advance\hsize-\tempdima \divide\hsize\user@n@cols + \Tmessage[out]{New hsize: \the\hsize}} +\add@user@override{\ifnum\user@n@cols=\m@ne\else + \csarg\let{\output@routine @body}\trivial@body + \n@cols\user@n@cols + \Tmessage[out]{User override: \the\n@cols\@space columns.}% + \fi} + +\def\trivial@body{\Tmessage[out]{Trivial multicolumn (\the\n@cols) setup} + \@colnum\@ne \splittopskip\topskip + \setbox\page@body@box\hbox{\text@column} + \@colnum\tw@ + \ifnum\n@cols>\@ne + \loop \setbox\page@body@box\hbox{\unhbox\page@body@box + \kern\GutterWidth \text@column} + \advance\@colnum\@ne + \ifnum\@colnum>\n@cols\else\repeat + \fi} +\def\real@text@column{\begingroup\vbadness\@M + \setbox\z@ + \ifnum\n@cols=\@ne + \vbox to \vsize{\boxmaxdepth\maxdepth + \ifvoid\topins\else\unvbox\topins \fi + \unvbox\@cclv + \ifvoid\footins\else\unvbox\footins \fi}% + \Tmessage[out]{Column: \the\ht\z@+\the\dp\z@}% + \else + \vsplit\@cclv to \text@height + \Tmessage[out]{Column \the\@colnum: \the\ht\z@+\the\dp\z@}% + \fi \ifnum\badness=\@M\Wmessage{Underfull textcolumn}\fi + \box\z@ \endgroup} + +\def\CurrentShipout{\shipout\box\WholePage} +\let\OriginalShipout\CurrentShipout +\newif\ifCountSheets \CountSheetsyes +\def\finish@off@page{\Tmessage[out]{Whole page: + \the\ht\WholePage+\the\dp\WholePage} + {\def\protect{\noexpand\protect\noexpand} + \def\cprotect{\expandafter\string} + \normalesc + \ifsink@pages + \message{Page sunk [\the\sheet@counter.\csarg\the + {\counter@name{Page}}]} + \deadcycles\z@ + \else \CurrentShipout + \ifCountSheets\global\advance\sheet@counter\@ne\fi + \fi + } + \global\step@counter{Page} + } +\def\shipout@and@unbox@remainder{ + \iftext@fits \make@page \finish@off@page \fi + \ifvoid\@cclv \Tmessage[out]{Shipped out whole page} + \else \Tmessage[out]{Part of page not shipped: \the\ht\@cclv} + \unvbox\@cclv + \ifnum\outputpenalty=\@M\else\penalty\outputpenalty\fi + \fi + \iftext@fits \ifother@grid\install@next@page@grid + \else\Tmessage[out]{Same grid once again.}\fi + \fi} + +\newif\ifsink@pages +\sink@pagesno +\let\NoPages\sink@pagesyes \let\PagesOut\sink@pagesno + +% this is a mess. clear up please. +\newtoks\page@options +\def\options@to@pagepart + {\append@toks@cs@to@list{page@\page@part @toks}\page@options + \page@options={}} +\add@PageGrid@default{\csarg\newtoks{\@name @routine} + \def\@current@options@list{page@options} + \def\page@part{head}\page@options{} + } + +\def\install@output@routine#1{{\globaldefs\@ne + \output=\xp{\csname#1@routine\endcsname}% + \def\output@routine{#1}% + \Tmessage[out]{Install output: #1 ---}% + \@pagegrid@installedyes + \csname#1@install@parameters\endcsname + }} + +\newdimen\text@height + +% During the load of this file we build up a list of +% defaults and test. These are then turned into PageGrid@default +% at the end of this file. +\newtoks\otr@settings \newtoks\otr@conditions +\def\add@otr@setting#1{\append@to@list{otr@settings}{#1}} +\def\del@otr@setting#1{\del@tok@from@list{otr@settings}#1} +\def\add@otr@condition#1{\append@to@list{otr@conditions}{#1}} +\def\set@otr@stuff{\def\cs@e##1{ + \edef\cs@f{\nxp\adds@PageGrid@default{\global##1={\the##1}}} + \cs@f} + \cs@e\otr@settings \cs@e\otr@conditions} +%\showthe\otr@settings \showthe\otr@conditions +%\showthe\PageGrid@defaults} + +\def\@DefinePageGrid{\options@to@pagepart \finish@part@routines + \csarg\edef{\@name @install@parameters}{% + \vsize\the\height@toks\relax \set@topskip + \multiply\vsize + \nxp\ifnum\user@n@cols>\@ne\user@n@cols\relax + \nxp\else\the\n@cols\relax\nxp\fi + \hsize\the\width@toks\relax + \def\CSname{\@name @page@width}% + {\the\width@toks\relax}% + \nxp\Tmessage[out]{Initial hsize: \nxp\the\hsize}% + \ifwidth@of@text + \else \nxp\hsize@from@page@width + \ifnum\the\n@cols>1 + \divide\hsize\the\n@cols\relax\fi + \fi + \nxp\Tmessage[out]{Installed hsize: \nxp\the\hsize}% + } + \csarg\edef{\@name @otr@parameters}{% + \the\otr@settings + \xp\@empty\the\otr@conditions + \CSname{height@of@text\ifheight@of@text yes\else no\fi}% + \text@height\the\height@toks\relax + \CSname{width@of@text\ifwidth@of@text yes\else no\fi}% + \n@cols\the\n@cols\relax} + \csarg\edef{\@name @head@foot}{\the\page@head@toks + \the\page@foot@toks + \ifheight@of@text\else + \advance\text@height-\head@height + \advance\text@height-\foot@height + \fi} + \csarg\edef{\@command @body}{\the\page@body@toks} + \csarg\edef{\@command}{% + \nxp\EjectPage + \nxp\install@output@routine{\@name}% + %\global\hsize= \ifseen@text \CSname{\@name @text@width}% + % \else \CSname{\next@page@grid @text@width}% + % \fi + \outer@start@commands \after@indent + } + \csarg\edef{\@name @routine}{ + \nxp\Tmessage[out]{======== Output routine: \@name\@space ==========} + \nxp\output@setup + \CSname{\@name @otr@parameters} + \nxp\the\user@overrides + \CSname{\@name @head@foot} + \nxp\goal@height@trace + \ifnum\n@cols=\z@ %% no text, trivial case. + \setbox\page@body@box\voidb@x + \nxp\text@fitsyes + \else \nxp\ifragged@bottom\nxp\text@fitsyes + \nxp\else\nxp\see@if@text@fits\nxp\fi + \nxp\iftext@fits + \let\nxp\text@column\nxp\real@text@column + \tempcounta\hbadness\hbadness\@M\CSname{\@name @body} + \nxp\ifnum\badness>\tempcounta + \nxp\Wmessage{Underfull page body}\nxp\fi + \hbadness\tempcounta\nxp\report@body@measurement + \nxp\fi + \fi + \nxp\shipout@and@unbox@remainder + \nxp\Tmessage[out]{==========}% + } + \xp\install@output@routine\xp{\@name} + } + +% not operative yet. +\new@dimen{user@page@height}{\m@ne sp} +\new@dimen{user@text@height}{\m@ne sp} +\def\Height:#1=#2 + {\switch {\if\EqualString{#1}} + {Page} {\user@page@height\w@w{#2}} + {Text} {\user@text@height\w@w{#2}} + {default} {\Wmessage{Unknown option: `Height:#1=#2'}} + \endswitch} + +%-- height of page/text +% +% the \ifheight@of@text conditional is also used +% during run time. +% +\newif\ifheight@of@text +\newtoks\height@toks \newdimen\page@height +\add@PageGrid@default{\height@of@textyes\height@toks{20cm}} +\add@PageGrid@default{\let\text@lines\relax} +\@PageGridOption{height}{ + \switch {\if\EqualString{#1}} + {page} {\height@of@textno} + {text} {\height@of@textyes} + {lines} {\height@of@textyes + \edef\cs@e{\def\nxp\text@lines{\@w@w{#2}}}\cs@e} + {default} {\Wmessage{Strange modifier: `height:#1=#2'}} + \endswitch + \edef\cs@e{\nxp\height@toks={\@w@w{#2}}}\cs@e + } +% Make sure that the \Height command is not used! +\@PageGridNOOP{Height} + +%%%% +% +% Width handling +% +\newif\ifwidth@of@text +\newtoks\width@toks \newdimen\page@width +\@PageGridOption{width}{ + \switch {\if\EqualString{#1}} + {page} {\width@of@textno} + {text} {\width@of@textyes} + {default} {\Wmessage{Strange modifier: `width:#1=#2'}} + \endswitch + \edef\cs@e{\nxp\width@toks={\@w@w{#2}}}\cs@e + } + +% Make sure that the \Width command is not used! +\@PageGridNOOP{Width} + +% At installation of the output routine, calculate the hsize +% if the page width is given. +% +\def\hsize@from@page@width + {\def\text@column{\hskip\z@\relax}% + \everyhbox{}\everyvbox{}% + \let\maybe@to@page@width\relax + \the\page@body@toks +%\ifdim\wd\page@body@box>0pt \showthe\page@body@toks \fi + \Tmessage[out]{Width page body minus text: \the\wd\page@body@box}% + \global\advance\hsize-\wd\page@body@box} + +% At the start of the output routine, calculate the page width +% from the hsize (which may have been tinkered with), or set to +% routine-specific page width (which may also have been changed). +% +\def\output@set@page@width + {\ifwidth@of@text + \edef\text@column{\hskip\the\wd\@cclv\relax\hskip\z@\relax}% + \let\maybe@to@page@width\relax + \csn\output@routine @body\ecs + \page@width\wd\page@body@box + \Tmessage[out]{Deduced page width: \the\page@width} + \else \def\maybe@to@page@width{ to \page@width} + \page@width\csn\output@routine @page@width\ecs\relax + \fi} + +%%%% Topskip +% initially the outer topskip is picked up, unless +% the option 'topskip' is given. +% +\add@PageGrid@default + {\edef\set@topskip + {\topskip\the\topskip\relax\splittopskip\topskip}} +\@PageGridOption{topskip}{ + \edef\cs@e + {\def\nxp\set@topskip{\topskip\@w@w{#1}\relax + \splittopskip\topskip}} + \cs@e + } +% ragged bottom the way it's done in plain TeX. +\newif\ifragged@bottom +\add@otr@setting{\ragged@bottomno} +\@PageGridOption{raggedbottom}{ + \del@otr@setting{\ragged@bottomno} + \add@otr@setting{\ragged@bottomyes} + \if\IsEmptyList{#1}\@add@toks{\var@topskip{60pt}} + \else\edef\cs@e{\nxp\@add@toks{\nxp\var@topskip{\@w@w{#1}}}} + \cs@e + \fi} +\def\var@topskip#1{\tempdima\topskip\tempskipa\z@ plus #1\relax + \topskip\tempdima \advance\topskip\tempskipa + \splittopskip\topskip} + +%-- textband +\newif\ifin@textband \add@PageGrid@default{\in@textbandno} +\@PageGridOption{textband}{ + \switch {\if\EqualString{#1}} + {start} {\start@textband} + {stop} {\stop@textband} + {default} {\Wmessage{Strange modifier `textband:#1'}} + \endswitch} +\newdimen\text@width +\def\start@textband + {\options@to@pagepart + \b@group[textband]\@hmodeyes\in@textbandyes + \@add@toks{\hbox \maybe@to@page@width\bgroup} + } +\def\stop@textband + {\@add@toks{\egroup} \e@group[textband] + \ifseen@text \before@textno + \def\page@part{body} \options@to@pagepart + \def\page@part{foot} + \fi} + +%-- band +\newif\ifabut@foot \newif\ifabut@head +\add@otr@setting{\abut@footno \abut@headno} +\@PageGridOption{band}{ + \switch {\if\EqualString{#1}} + {start} {\@add@toks{\hbox to \page@width\bgroup} + \b@group[band]\@hmodeyes + \def\block@closing{\@add@toks{\hfil\egroup} + \e@group[band]}} + {invisible} {\@add@toks{\setbox\tempboxa + \hbox to \page@width\bgroup} + \b@group[band]\@hmodeyes + \def\block@closing{\@add@toks{\hfil\egroup} + \ifbefore@text + \@add@toks{\vtop to\z@{\kern\z@\box\tempboxa\vss} + \nointerlineskip} + \del@otr@setting{\abut@headno} + \add@otr@setting{\abut@headyes} + %\global\abut@headyes + \else \@add@toks{\nointerlineskip + \vbox to\z@{\vss\box\tempboxa}} + \del@otr@setting{\abut@footno} + \add@otr@setting{\abut@footyes} + %\global\abut@footyes + \fi\e@group[band]}} + {stop} {\block@closing} + {default} {\Wmessage{Strange modifier `band:#1'}} + \endswitch} + + +%-- next page grid +\newif\ifother@grid +\add@PageGrid@default{\other@gridno} +\add@otr@setting{\other@gridno} +\add@otr@condition{\ifother@grid + \def\nxp\install@next@page@grid + {\nxp\install@output@routine{\next@page@grid}}% + \fi} +\@PageGridOption{NextPageGrid}{\other@gridyes + \del@otr@setting{\other@gridno} + \add@otr@setting{\other@gridyes} + \def\next@page@grid{#1} + } + +%-- text +\add@PageGrid@default{\n@cols\z@} +\newif\ifbefore@text +\newif\ifseen@text %this one is also used by 'external' +\add@PageGrid@default{\before@textyes \seen@textno} +\@PageGridOption{text}{\global\seen@textyes + \ifin@textband\else\Emessage{'text' has to be in 'textband'}\fi + \global\advance\n@cols\@ne + \@add@toks{\text@column}} + +%%%%%%%%%%%%%%%%%%%%%%% user commands + +\def\leegbladinvoegen{\@g@stapteller{Page}} +\def\EjectPage{\vfil\eject} +\def\ToRecto{\csarg\ifodd{\counter@name{Page}}\else\step@counter{Page}\fi} +\def\ToVerso{\csarg\ifodd{\counter@name{Page}}\step@counter{Page}\fi} + +% less useful user command (mostly for formatting the manual :-) +% +\newbox\saved@page@box \newdimen\saved@hsize \newcount\saved@pageno +\newtoks\saved@mark@items +\def\SuspendOutput{\xdef\saved@output@routine{\output@routine}% + \let\saved@shipout\CurrentShipout + \global\saved@hsize\hsize \global\saved@mark@items\mark@items + \global\saved@pageno\cs@counter@name{Page}% + \output{\global\setbox\saved@page@box\box\@cclv + \Tmessage[out]{Suspend output @\the\saved@pageno; + saved (\the\ht\saved@page@box+\the\dp\saved@page@box) + x \the\wd\saved@page@box}% + \global\output{\Emessage{You should not call output now!}% + \OriginalShipout\box\@cclv}}% + \eject + } +\def\ResumeOutput + {\xp\install@output@routine\xp{\saved@output@routine}% + \let\CurrentShipout\saved@shipout + \global\hsize\saved@hsize \global\mark@items\saved@mark@items + \global\cs@counter@name{Page}\saved@pageno + \unvbox\saved@page@box + \Tmessage[out]{Resume output}% + } + +%%%%%%%%%%%%%%%% Marks +%%%% +\NewTrace:mark +\def\FirstPlaced:#1 + {\Tmessage[mark]{First Placed #1 from \firstmark}% + \xp\get@placed\xp{\firstmark}{#1}} +\def\PreviousPlaced:#1 + {\Tmessage[mark]{Previous Placed #1 from \topmark}% + \xp\get@placed\xp{\topmark}{#1}} +\def\LastPlaced:#1 + {\Tmessage[mark]{Last Placed #1 from \botmark}% + \xp\get@placed\xp{\botmark}{#1}} +\def\get@placed#1#2{% + \get@@placed{#2}#1{SM}{}$}% SM: StopMarker +\def\get@@placed#1#2#3{\if\EqualStringX{#2}{SM}\xp\take@to@dollar + \else\if\EqualStringX{#1}{#2}% + \maybe@uppercase{#3}\xp\xp\xp\take@to@dollar + \else\xp\xp\xp\get@@placed\fi + \fi{#1}} +\ifini{\newtoks\mark@items} + % \newtoks\mark@toks % is this one used? + +\newif\ifhas@marks +\add@generic@default{\has@marksno} + % only yes in heading and output routine. + % it seems that you can have page breaks at marks... +\@GenericOption{nomarks}{\has@marksno} +\def\add@mark@item#1{\csarg\newtoks{mark@toks@#1}% + \Tmessage[mark]{Adding mark item #1}% + \global\mark@items\xp{\the\mark@items{#1}}} +\def\refresh@mark@item#1#2{\csarg\global{mark@toks@#1}{#2}} +\def\get@mark@items#1{\if\EqualStringX{#1}{SM}% + \else{#1}{\csarg\the{mark@toks@#1}}\xp\get@mark@items + \fi} +\def\place@mark{\mark{\xp\get@mark@items\the\mark@items{SM}}} + +% this one should be defined in document.tex +\add@mark@item{first@page} + +% Page wide rule + +\@PageGridOption{pagerule}{ + \@add@toks{\hrule width\page@width\relax\nobreak}} + +% Set default otr@settings and otr@conditions +\set@otr@stuff + +\endinput + +92/10/24 raggedbottom in progress +92/11/04 splittopskip made equal to topskip +92/11/14 messed with otr@xyz token lists +92/11/15 warning on underfull text column; + ragged bottom still not working properly +93/01/17 box \WholePage, new definition of \CurrentShipout + + +%%%%%%%%%%%%%%%%%%%%%% Old Stuff; maybe useful, maybe not + +\newskip\@topS \newskip\@botS +{\noeol +\othercr +\gdef\topillustratie{\bgroup\othercr \@topill} +\gdef\@topill:#1=#2^^M{\edef\cs@e{\gdef\CSname{@topS#1}{#2}} + \cs@e \global\advance\@topS #2\egroup} +\gdef\botillustratie{\bgroup\othercr \@botill} +\gdef\@botill:#1=#2^^M{\edef\cs@e{\gdef\CSname{@botS#1}{#2}} + \cs@e \global\advance\@botS #2\egroup}} + +\def\@wisill{\global\@topS\z@ \global\@botS\z@ + \csarg\gdef{@topS1}{\z@}\csarg\gdef{@botS1}{\z@} + \csarg\gdef{@topS2}{\z@}\csarg\gdef{@botS2}{\z@} + \csarg\gdef{@topS3}{\z@}\csarg\gdef{@botS3}{\z@} + } +\@wisill + +\newtoks\@stramienlijst +\def\invoerpad{} +\def\opmaak: #1\par{\@stramienlijst={} + \def\cs@a##1 {\eqstring{##1}{klaar}{}% + {\append@to@list{@stramienlijst}{\@probeerstramien ##1;} + \cs@a}} + \cs@a #1klaar }%% let op de significante spaties!! + %% en de spatie achter het laatste stramien komt van de ^^M +\def\invoer: #1 { + \def\@probeerstramien ##1;{\csn ##1\ecs + \message{Ik probeer het met opmaak: ##1} + \@installeertellers{##1} + \input \invoerpad#1.tex + \vfill\eject + \@bewaartellers{##1} + } + \the\@stramienlijst} + +%% uitloop van vorige output routine +% iftempf: als pagina geen uitloop gebruikt, direct eventuele +% uitloop leeg gooien. +% laatste pagina: tempboxa <- vbox{unvcopy255} +% er wordt een pagina uitgeworpen: +% - 255 is void: invoer is op, dus uitlopen +% als dit de laatste pagina was +% - 255 non-void: er is iets terug te werpen; dit was kennelijk niet +% de laatste pagina, dus geen uitloop. + +\newbox\@uitloop \newbox\@tempuitloop \newif\ifisereenuitloop + \Tmessage[out]{Aangetroffen uitloop: \the\ht\@uitloop+\the\dp\@uitloop} + +%-- uitloop +% mag alleen in kop of voet voorkomen. +\setbox\@tempuitloop= + \vbox{\ifvoid\topins\else\unvcopy\topins\fi + \unvcopy\@cclv\kern\z@} +\setbox\@tempuitloop=\hbox{} +\@PageGridOption{uitloop}{\tempfyes + \@add@toks{\Tmessage[out]{Uitloop wordt verwerkt.}% + \copy\@uitloop + }} + + \iftempd + \iftempc \Tmessage[out]{Eerste pagina, derhalve:} + \@loopnietuit \else \@loopuit \fi + \else \Tmessage[out]{Niet de laatste pagina, derhalve:} + \@loopnietuit \fi + + \iftempf \else \nxp\@uitloopwegwerpen \fi %geheugenbesparing. + +\def\@loopuit{\global\isereenuitloopyes + \global\setbox\@uitloop=\box\@tempuitloop + \Tmessage[out]{Uitloop: \the\ht\@uitloop+\the\dp\@uitloop}} +\def\@loopnietuit{\global\isereenuitloopno \@uitloopwegwerpen} +\def\@uitloopwegwerpen{ + \Tmessage[out]{Uitloop weggegooid: \the\ht\@uitloop+\the\dp\@uitloop} + \global\setbox\@uitloop=\hbox{}} + +%-- veld %% is deze nog nodig nu we 'tekstblok' generisch hebben? +\@PageGridOption{veld}{ + \eqstring{#1}{stop}% + {\@add@toks{\egroup}}% + {\@add@toks{\vtop\bgroup\kern0cm} + \eqstring{#1}{uitvullen}{}% + {\@add@toks{\hsize=\w@w{#1}} + \iftempc\advance\text@width-\w@w{#1}\fi} + }} +%-- parallel Nog eens goed over nadenken. +\@PageGridOption{parallel}{ + \eqstring{#1}{stop}% + {\@add@toks{\vfil\egroup\egroup}}% + {\@add@toks{\vtop\bgroup\kern0cm + \vbox to \vsize\bgroup}% dit is fout. + \eqstring{#1}{uitvullen}{}% + {\iftempc\advance\text@width-\w@w{#1}\relax\fi + \@add@toks{\hsize=\w@w{#1}}} + }} +%-- kolommenbalanceren +% heeft alleen zin voor meerkoloms uitvoer, +% werkt alleen op laatste pagina +\@PageGridOption{kolommenbalanceren}{ + \eqstring{#1}{}{\tempgyes}{\csn tempg#1\ecs}} + +\endinput
\ No newline at end of file diff --git a/Master/texmf-dist/tex/lollipop/lollipop-plain.tex b/Master/texmf-dist/tex/lollipop/lollipop-plain.tex new file mode 100644 index 00000000000..eb2c173f19d --- /dev/null +++ b/Master/texmf-dist/tex/lollipop/lollipop-plain.tex @@ -0,0 +1,1237 @@ +% This is lollipop-plain.tex, the version of plain.tex adapted to the +% Lollipop format of Victor Eijkhout and Vafa Khalighi. +% copyright 1991/92 Victor Eijkhout +% copyright 2014 Vafa Khalighi +% +% +% This program is free software: you can redistribute it and/or modify +% it under the terms of the GNU General Public License as published by +% the Free Software Foundation, either version 3 of the License, or +% (at your option) any later version. +% +% 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 +% GNU General Public License for more details. +% +% You should have received a copy of the GNU General Public License +% along with this program. If not, see <http://www.gnu.org/licenses/>. +% +% + +\catcode`\{=1 % left brace is begin-group character +\catcode`\}=2 % right brace is end-group character +\catcode`\$=3 % dollar sign is math shift +\catcode`\&=4 % ampersand is alignment tab +\catcode`\#=6 % hash mark is macro parameter character +\catcode`\^=7 \catcode`\^^K=7 % circumflex and uparrow are for superscripts +\catcode`\_=8 \catcode`\^^A=8 % underline and downarrow are for subscripts +\catcode`\^^I=10 % ascii tab is a blank space +\chardef\active=13 \catcode`\~=\active % tilde is active +\chardef\ignored=9 \chardef\other=12 +\catcode`\^^L=\active \outer\def^^L{\par} % ascii form-feed is "\outer\par" + +% We had to define the \catcodes right away, before the message line, +% since \message uses the { and } characters. +% When INITEX (the TeX initializer) starts up, +% it has defined the following \catcode values: +% \catcode`\^^@=9 % ascii null is ignored +% \catcode`\^^M=5 % ascii return is end-line +% \catcode`\\=0 % backslash is TeX escape character +% \catcode`\%=14 % percent sign is comment character +% \catcode`\ =10 % ascii space is blank space +% \catcode`\^^?=15 % ascii delete is invalid +% \catcode`\A=11 ... \catcode`\Z=11 % uppercase letters +% \catcode`\a=11 ... \catcode`\z=11 % lowercase letters +% all others are type 12 (other) + +% INITEX sets up \mathcode x=x, for x=0..127, except that +% \mathcode x=x+"7100, for x = `A to `Z and `a to `z; +% \mathcode x=x+"7000, for x = `0 to `9. +% The following changes define internal codes as recommended +% in Appendix C of The TeXbook: +\mathcode`\^^@="2201 % \cdot +\mathcode`\^^A="3223 % \downarrow +\mathcode`\^^B="010B % \alpha +\mathcode`\^^C="010C % \beta +\mathcode`\^^D="225E % \land +\mathcode`\^^E="023A % \lnot +\mathcode`\^^F="3232 % \in +\mathcode`\^^G="0119 % \pi +\mathcode`\^^H="0115 % \lambda +\mathcode`\^^I="010D % \gamma +\mathcode`\^^J="010E % \delta +\mathcode`\^^K="3222 % \uparrow +\mathcode`\^^L="2206 % \pm +\mathcode`\^^M="2208 % \oplus +\mathcode`\^^N="0231 % \infty +\mathcode`\^^O="0140 % \partial +\mathcode`\^^P="321A % \subset +\mathcode`\^^Q="321B % \supset +\mathcode`\^^R="225C % \cap +\mathcode`\^^S="225B % \cup +\mathcode`\^^T="0238 % \forall +\mathcode`\^^U="0239 % \exists +\mathcode`\^^V="220A % \otimes +\mathcode`\^^W="3224 % \leftrightarrow +\mathcode`\^^X="3220 % \leftarrow +\mathcode`\^^Y="3221 % \rightarrow +\mathcode`\^^Z="8000 % \ne +\mathcode`\^^[="2205 % \diamond +\mathcode`\^^\="3214 % \le +\mathcode`\^^]="3215 % \ge +\mathcode`\^^^="3211 % \equiv +\mathcode`\^^_="225F % \lor +\mathcode`\ ="8000 % \space +\mathcode`\!="5021 +\mathcode`\'="8000 % ^\prime +\mathcode`\(="4028 +\mathcode`\)="5029 +\mathcode`\*="2203 % \ast +\mathcode`\+="202B +\mathcode`\,="613B +\mathcode`\-="2200 +\mathcode`\.="013A +\mathcode`\/="013D +\mathcode`\:="303A +\mathcode`\;="603B +\mathcode`\<="313C +\mathcode`\=="303D +\mathcode`\>="313E +\mathcode`\?="503F +\mathcode`\[="405B +\mathcode`\\="026E % \backslash +\mathcode`\]="505D +\mathcode`\_="8000 % \_ +\mathcode`\{="4266 +\mathcode`\|="026A +\mathcode`\}="5267 +\mathcode`\^^?="1273 % \smallint + +% INITEX sets \uccode`x=`X and \uccode `X=`X for all letters x, +% and \lccode`x=`x, \lccode`X=`x; all other values are zero. +% No changes to those tables are needed in plain TeX format. + +% INITEX sets \sfcode x=1000 for all x, except that \sfcode`X=999 +% for uppercase letters. The following changes are needed: +\sfcode`\)=0 \sfcode`\'=0 \sfcode`\]=0 +% The \nonfrenchspacing macro will make further changes to \sfcode values. + +% Finally, INITEX sets all \delcode values to -1, except \delcode`.=0 +\delcode`\(="028300 +\delcode`\)="029301 +\delcode`\[="05B302 +\delcode`\]="05D303 +\delcode`\<="26830A +\delcode`\>="26930B +\delcode`\/="02F30E +\delcode`\|="26A30C +\delcode`\\="26E30F +% N.B. { and } should NOT get delcodes; otherwise parameter grouping fails! + +% To make the plain macros more efficient in time and space, +% several constant values are declared here as control sequences. +% If they were changed, anything could happen; so they are private symbols. +\chardef\@ne=1 +\chardef\tw@=2 +\chardef\thr@@=3 +\chardef\sixt@@n=16 +\chardef\@cclv=255 +\mathchardef\@cclvi=256 +\mathchardef\@m=1000 +\mathchardef\@M=10000 +\mathchardef\@MM=20000 + +% Allocation of registers + +% Here are macros for the automatic allocation of \count, \box, \dimen, +% \skip, \muskip, and \toks registers, as well as \read and \write +% stream numbers, \fam codes, \language codes, and \insert numbers. + +% When a register is used only temporarily, it need not be allocated; +% grouping can be used, making the value previously in the register return +% after the close of the group. The main use of these macros is for +% registers that are defined by one macro and used by others, possibly at +% different nesting levels. All such registers should be defined through +% these macros; otherwise conflicts may occur, especially when two or more +% macro packages are being used at once. + +% The following counters are reserved: +% 0 to 9 page numbering +% 10 count allocation +% 11 dimen allocation +% 12 skip allocation +% 13 muskip allocation +% 14 box allocation +% 15 toks allocation +% 16 read file allocation +% 17 write file allocation +% 18 math family allocation +% 19 language allocation +% 20 insert allocation +% 21 the most recently allocated number +% 22 constant -1 +% New counters are allocated starting with 23, 24, etc. Other registers are +% allocated starting with 10. This leaves 0 through 9 for the user to play +% with safely, except that counts 0 to 9 are considered to be the page and +% subpage numbers (since they are displayed during output). In this scheme, +% \count 10 always contains the number of the highest-numbered counter that +% has been allocated, \count 14 the highest-numbered box, etc. +% Inserts are given numbers 254, 253, etc., since they require a \count, +% \dimen, \skip, and \box all with the same number; \count 20 contains the +% lowest-numbered insert that has been allocated. Of course, \box255 is +% reserved for \output; \count255, \dimen255, and \skip255 can be used freely. + +% It is recommended that macro designers always use +% \global assignments with respect to registers numbered 1, 3, 5, 7, 9, and +% always non-\global assignments with respect to registers 0, 2, 4, 6, 8, 255. +% This will prevent ``save stack buildup'' that might otherwise occur. + +\count10=22 % allocates \count registers 23, 24, ... +\count11=9 % allocates \dimen registers 10, 11, ... +\count12=9 % allocates \skip registers 10, 11, ... +\count13=9 % allocates \muskip registers 10, 11, ... +\count14=9 % allocates \box registers 10, 11, ... +\count15=9 % allocates \toks registers 10, 11, ... +\count16=-1 % allocates input streams 0, 1, ... +\count17=-1 % allocates output streams 0, 1, ... +\count18=3 % allocates math families 4, 5, ... +\count19=0 % allocates \language codes 1, 2, ... +\count20=255 % allocates insertions 254, 253, ... +\countdef\insc@unt=20 % the insertion counter +\countdef\allocationnumber=21 % the most recent allocation +\countdef\m@ne=22 \m@ne=-1 % a handy constant +\def\wlog{\immediate\write\m@ne} % write on log file (only) + +% Here are abbreviations for the names of scratch registers +% that don't need to be allocated. + +\countdef\count@=255 +\dimendef\dimen@=0 +\dimendef\dimen@i=1 % global only +\dimendef\dimen@ii=2 +\skipdef\skip@=0 +\toksdef\toks@=0 + +% Now, we define \newcount, \newbox, etc. so that you can say \newcount\foo +% and \foo will be defined (with \countdef) to be the next counter. +% To find out which counter \foo is, you can look at \allocationnumber. +% Since there's no \boxdef command, \chardef is used to define a \newbox, +% \newinsert, \newfam, and so on. + +% Be able to save the allocation state. Write streams are +% excepted from this. +\def\SaveAlloc{\xdef\RestoreAlloc + {\begingroup\globaldefs=1 + \count10=\the\count10 \count11=\the\count11 \count12=\the\count12 + \count13=\the\count13 \count14=\the\count14 \count15=\the\count15 + \count16=\the\count16 %\count17=\the\count17 + \count18=\the\count18 + \endgroup}} +%LP no longer outer; switch off trace in these macros +\def\@@newcount{\alloc@0\count\countdef\insc@unt} +\def\@@newdimen{\alloc@1\dimen\dimendef\insc@unt} +\def\@@newskip{\alloc@2\skip\skipdef\insc@unt} +\def\@@newmuskip{\alloc@3\muskip\muskipdef\@cclvi} +\def\@@newbox{\alloc@4\box\chardef\insc@unt} +\let\newtoks\relax +\let\@@newtoks=\relax % we do this to allow plain.tex to be read in twice +\def\@@newhelp#1#2{\newtoks#1#1\expandafter{\csname#2\endcsname}} +\def\@@newtoks{\alloc@5\toks\toksdef\@cclvi} +\def\@@newread{\alloc@6\read\chardef\sixt@@n} +\def\@@newwrite{\alloc@7\write\chardef\sixt@@n} +\def\@@newfam{\alloc@8\fam\chardef\sixt@@n} +\def\@@newlanguage{\alloc@9\language\chardef\@cclvi} + +\def\newcount#1{\@TM@s\@@newcount#1\@TM@r} +\def\newdimen#1{\@TM@s\@@newdimen#1\@TM@r} +\def\newskip#1{\@TM@s\@@newskip#1\@TM@r} +\def\newmuskip#1{\@TM@s\@@newmuskip#1\@TM@r} +\def\newbox#1{\@TM@s\@@newbox#1\@TM@r} +\let\newtoks=\relax % we do this to allow plain.tex to be read in twice +\def\newhelp#1#2{\@TM@s\@@newhelp#1#2\@TM@r} +\def\newtoks#1{\@TM@s\@@newtoks#1\@TM@r} +\def\newread#1{\@TM@s\@@newread#1\@TM@r} +\def\newwrite#1{\@TM@s\@@newwrite#1\@TM@r} +\def\newfam#1{\@TM@s\@@newfam#1\@TM@r} +\def\newlanguage#1{\@TM@s\@@newlanguage#1\@TM@r} +\def\alloc@#1#2#3#4#5{\global\advance\count1#1by\@ne + \ch@ck#1#4#2% make sure there's still room + \allocationnumber=\count1#1% + \global#3#5=\allocationnumber + \wlog{\string#5=\string#2\the\allocationnumber}} +\def\newinsert#1{\global\advance\insc@unt by\m@ne + \ch@ck0\insc@unt\count + \ch@ck1\insc@unt\dimen + \ch@ck2\insc@unt\skip + \ch@ck4\insc@unt\box + \allocationnumber=\insc@unt + \global\chardef#1=\allocationnumber + \wlog{\string#1=\string\insert\the\allocationnumber}} +\def\ch@ck#1#2#3{\ifnum\count1#1<#2% + \else\errmessage{No room for a new #3}\fi} + +%% trace +{\def\newcount{\alloc@0\count\countdef\insc@unt} + \def\newdimen{\alloc@1\dimen\dimendef\insc@unt} +\newcount\@TM@c \newcount\@TC@c +\newdimen\z@ \global\z@=0pt} +\def\@TM@s{\@TC@c\tracingcommands \tracingcommands\z@ + \@TM@c\tracingmacros \tracingmacros\z@ + \relax} +\def\@TM@r{\tracingmacros\@TM@c \tracingcommands\@TC@c} +\let\x@TM@s\@TM@s \let\x@TM@r\@TM@r + +% Here are some examples of allocation. +\newdimen\maxdimen \maxdimen=16383.99999pt % the largest legal <dimen> +\newskip\hideskip \hideskip=-1000pt plus 1fill % negative but can grow +\newskip\centering \centering=0pt plus 1000pt minus 1000pt +\newdimen\p@ \p@=1pt % this saves macro space and time +%V \newdimen\z@ \z@=0pt % naar boven +\newskip\z@skip \z@skip=0pt plus0pt minus0pt +\newbox\voidb@x % permanently void box register + +% And here's a different sort of allocation: +% For example, \newif\iffoo creates \footrue, \foofalse to go with \iffoo. +\def\newif#1{%\@TM@s + \count@\escapechar \escapechar\m@ne + \expandafter\expandafter\expandafter + \xdef\@if#1{yes}{\let\noexpand#1=\noexpand\iftrue}% + \expandafter\expandafter\expandafter + \xdef\@if#1{true}{\let\noexpand#1=\noexpand\iftrue}% + \expandafter\expandafter\expandafter + \xdef\@if#1{no}{\let\noexpand#1=\noexpand\iffalse}% + \expandafter\expandafter\expandafter + \xdef\@if#1{false}{\let\noexpand#1=\noexpand\iffalse}% + \global\@if#1{no}% the condition starts out false + \escapechar\count@ +% \@TM@r +} +\def\@if#1#2{\csname\expandafter\if@\string#1#2\endcsname} +{\uccode`1=`i \uccode`2=`f \uppercase{\gdef\if@12{}}} % `if' is required + + +% Assign initial values to TeX's parameters + +% All of TeX's numeric parameters are listed here, +% but the code is commented out if no special value needs to be set. +% INITEX makes all parameters zero except where noted. + +\pretolerance=100 +\tolerance=200 % INITEX sets this to 10000 +\hbadness=1000 +\vbadness=1000 +\linepenalty=10 +\hyphenpenalty=50 +\exhyphenpenalty=50 +\binoppenalty=700 +\relpenalty=500 +\clubpenalty=150 +\widowpenalty=150 +\displaywidowpenalty=50 +\brokenpenalty=100 +\predisplaypenalty=10000 +% \postdisplaypenalty=0 +% \interlinepenalty=0 +% \floatingpenalty=0, set during \insert +% \outputpenalty=0, set before TeX enters \output +\doublehyphendemerits=10000 +\finalhyphendemerits=5000 +\adjdemerits=10000 +% \looseness=0, cleared by TeX after each paragraph +% \pausing=0 +% \holdinginserts=0 +% \tracingonline=0 +% \tracingmacros=0 +% \tracingstats=0 +% \tracingparagraphs=0 +% \tracingpages=0 +% \tracingoutput=0 +\tracinglostchars=1 +% \tracingcommands=0 +% \tracingrestores=0 +% \language=0 +\uchyph=1 +% \lefthyphenmin=2 \righthyphenmin=3 set below +% \globaldefs=0 +% \maxdeadcycles=25 % INITEX does this +% \hangafter=1 % INITEX does this, also TeX after each paragraph +% \fam=0 +% \mag=1000 % INITEX does this +% \escapechar=`\\ % INITEX does this +\defaulthyphenchar=`\- +\defaultskewchar=-1 +% \endlinechar=`\^^M % INITEX does this +\newlinechar=-1 +\delimiterfactor=901 +% \time=now % TeX does this at beginning of job +% \day=now % TeX does this at beginning of job +% \month=now % TeX does this at beginning of job +% \year=now % TeX does this at beginning of job +\showboxbreadth=5 +\showboxdepth=3 +\errorcontextlines=5 + +\hfuzz=0.1pt +\vfuzz=0.1pt +\overfullrule=5pt +\hsize=6.5in +\vsize=8.9in +\maxdepth=4pt +\splitmaxdepth=\maxdimen +\boxmaxdepth=\maxdimen +% \lineskiplimit=0pt, changed by \normalbaselines +\delimitershortfall=5pt +\nulldelimiterspace=1.2pt +\scriptspace=0.5pt +% \mathsurround=0pt +% \predisplaysize=0pt, set before TeX enters $$ +% \displaywidth=0pt, set before TeX enters $$ +% \displayindent=0pt, set before TeX enters $$ +\parindent=20pt +% \hangindent=0pt, zeroed by TeX after each paragraph +% \hoffset=0pt +% \voffset=0pt + +% \baselineskip=0pt, changed by \normalbaselines +% \lineskip=0pt, changed by \normalbaselines +\parskip=0pt plus 1pt +\abovedisplayskip=12pt plus 3pt minus 9pt +\abovedisplayshortskip=0pt plus 3pt +\belowdisplayskip=12pt plus 3pt minus 9pt +\belowdisplayshortskip=7pt plus 3pt minus 4pt +% \leftskip=0pt +% \rightskip=0pt +\topskip=10pt +\splittopskip=10pt +% \tabskip=0pt +% \spaceskip=0pt +% \xspaceskip=0pt +\parfillskip=0pt plus 1fil + +\thinmuskip=3mu +\medmuskip=4mu plus 2mu minus 4mu +\thickmuskip=5mu plus 5mu + +% We also define special registers that function like parameters: +\newskip\smallskipamount \smallskipamount=3pt plus 1pt minus 1pt +\newskip\medskipamount \medskipamount=6pt plus 2pt minus 2pt +\newskip\bigskipamount \bigskipamount=12pt plus 4pt minus 4pt +\newskip\normalbaselineskip \normalbaselineskip=12pt +\newskip\normallineskip \normallineskip=1pt +\newdimen\normallineskiplimit \normallineskiplimit=0pt +\newdimen\jot \jot=3pt +\newcount\interdisplaylinepenalty \interdisplaylinepenalty=100 +\newcount\interfootnotelinepenalty \interfootnotelinepenalty=100 + +% Definitions for preloaded fonts + +\def\magstephalf{1095 } +\def\magstep#1{\ifcase#1 \@m\or 1200\or 1440\or 1728\or 2074\or 2488\fi\relax} + +% Fonts assigned to \preloaded are not part of "plain TeX", +% but they are preloaded so that other format packages can use them. +% For example, if another set of macros says "\font\ninerm=cmr9", +% TeX will not have to reload the font metric information for cmr9. + +%\font\tenrm=cmr10 % roman text +%\font\preloaded=cmr9 +%\font\preloaded=cmr8 +%\font\sevenrm=cmr7 +%\font\preloaded=cmr6 +%\font\fiverm=cmr5 + +%\font\teni=cmmi10 % math italic %LP in fonts.tex +%\font\preloaded=cmmi9 +%\font\preloaded=cmmi8 +%\font\seveni=cmmi7 +%\font\preloaded=cmmi6 +%\font\fivei=cmmi5 + +%\font\tensy=cmsy10 % math symbols %LP in fonts.tex +%\font\preloaded=cmsy9 +%\font\preloaded=cmsy8 +%\font\sevensy=cmsy7 +%\font\preloaded=cmsy6 +%\font\fivesy=cmsy5 + +\font\tenex=cmex10 % This seems to be necessary here + +%\font\preloaded=cmss10 % sans serif +%\font\preloaded=cmssq8 + +%\font\preloaded=cmssi10 % sans serif italic +%\font\preloaded=cmssqi8 + +%%\font\tenbf=cmbx10 % boldface extended +%\font\preloaded=cmbx9 +%\font\preloaded=cmbx8 +%%\font\sevenbf=cmbx7 +%\font\preloaded=cmbx6 +%%\font\fivebf=cmbx5 + +\font\tentt=cmtt10 % typewriter +%\font\preloaded=cmtt9 +%\font\preloaded=cmtt8 + +%\font\preloaded=cmsltt10 % slanted typewriter + +%%\font\tensl=cmsl10 % slanted roman +%\font\preloaded=cmsl9 +%\font\preloaded=cmsl8 + +%%\font\tenit=cmti10 % text italic +%\font\preloaded=cmti9 +%\font\preloaded=cmti8 +%\font\preloaded=cmti7 + + +\let\preloaded=\undefined % preloaded fonts must be declared anew later. + +%LP \skewchar moved to fonts.tex +%\skewchar\teni='177 \skewchar\seveni='177 \skewchar\fivei='177 +%\skewchar\tensy='60 \skewchar\sevensy='60 \skewchar\fivesy='60 + +% Macros for setting ordinary text + +\def\frenchspacing{\sfcode`\.\@m \sfcode`\?\@m \sfcode`\!\@m + \sfcode`\:\@m \sfcode`\;\@m \sfcode`\,\@m} +\def\nonfrenchspacing{\sfcode`\.3000\sfcode`\?3000\sfcode`\!3000% + \sfcode`\:2000\sfcode`\;1500\sfcode`\,1250 } + +\def\^^M{\ } % control <return> = control <space> +\def\^^I{\ } % same for <tab> + +\def\lq{`} \def\rq{'} +\def\lbrack{[} \def\rbrack{]} + +\let\endgraf=\par \let\endline=\cr + +%LP In case we redefine \par, here is the original +\let\@par=\par + +\def\space{ } +\def\empty{} +\def\null{\hbox{}} + +\let\bgroup={ \let\egroup=} + +%%%%%%%%%%%%%%%% Catcode alterations + +%%%% Dospecials +% +% (not counting ascii null, tab, linefeed, formfeed, return, delete) +% Each symbol in the list is preceded by \do, which can be defined +% if you want to do something to every item in the list. +% +% " added wrt plain definition +% +\def\dospecials{\@TM@s\do\ \do\\\do\{\do\}\do\$\do\&% + \do\#\do\^\do\^^K\do\_\do\^^A\do\%\do\~\do\"\@TM@r} + +% handy abbrevs +% +\def\makeother#1{\catcode`#1\other} +\def\othercr{\makeother\^^M\relax} +\def\normalcr{\catcode`\^^M=5\relax} +\def\activecr{\catcode`\^^M\active} +\def\noeol{\endlinechar\m@ne}\def\normaleol{\endlinechar`\^^M\relax} +\def\noesc{\escapechar\m@ne}\def\normalesc{\escapechar`\\\relax} + +% obeylines +% +% In \obeylines, we say `\let^^M=\par' instead of `\def^^M{\par}' +% since this allows, for example, `\let\par=\cr \obeylines \halign{...' +% +% addition for empty lines +% +{\activecr % these lines must end with % + \gdef\obeylines{\activecr \def^^M{\@par\leavevmode\hbox{}}}% + \global\let^^M\@par} % this is in case ^^M appears in a \write + +% obeyspaces +% +% plain: {\obeyspaces\global\let =\space} +% extended for initial spaces on a line +% +{\catcode`\ \active +\gdef\obeyspaces{\catcode`\ \active\let =\@ospace}} +\def\@ospace{\leavevmode{} } + +%LP minimal improvement over the original \loop macro +\long\def\loop#1\repeat{\long\def\body{#1}\iterate} +\def\iterate{\let\loopnext\relax \body \let\loopnext\iterate \fi + \loopnext} +\let\repeat=\fi % this makes \loop...\if...\repeat skippable + +\def\thinspace{\kern .16667em } +\def\negthinspace{\kern-.16667em } +\def\enspace{\kern.5em } + +\def\enskip{\hskip.5em\relax} +\def\quad{\hskip1em\relax} +\def\qquad{\hskip2em\relax} + +\def\smallskip{\vskip\smallskipamount} +\def\medskip{\vskip\medskipamount} +\def\bigskip{\vskip\bigskipamount} + +\def\nointerlineskip{\prevdepth-1000\p@} +\def\offinterlineskip{\baselineskip-1000\p@ + \lineskip\z@ \lineskiplimit\maxdimen} + +\def\topglue{\nointerlineskip\vglue-\topskip\vglue} % for top of page +\def\vglue{\afterassignment\vgl@\skip@=} +\def\vgl@{\par \dimen@\prevdepth \hrule height\z@ + \nobreak\vskip\skip@ \prevdepth\dimen@} +\def\hglue{\afterassignment\hgl@\skip@=} +\def\hgl@{\leavevmode \count@\spacefactor \vrule width\z@ + \nobreak\hskip\skip@ \spacefactor\count@} + +\def~{\penalty\@M \ } % tie +\def\slash{/\penalty\exhyphenpenalty} % a `/' that acts like a `-' + +\def\break{\penalty-\@M} +\def\nobreak{\penalty \@M} +\def\allowbreak{\penalty \z@} + +\def\filbreak{\par\vfil\penalty-200\vfilneg} +\def\goodbreak{\par\penalty-500 } +\def\eject{\par\break} +\def\supereject{\par\penalty-\@MM} + +\def\removelastskip{\ifdim\lastskip=\z@\else\vskip-\lastskip\fi} +\def\smallbreak{\par\ifdim\lastskip<\smallskipamount + \removelastskip\penalty-50\smallskip\fi} +\def\medbreak{\par\ifdim\lastskip<\medskipamount + \removelastskip\penalty-100\medskip\fi} +\def\bigbreak{\par\ifdim\lastskip<\bigskipamount + \removelastskip\penalty-200\bigskip\fi} + +\def\line{\hbox to\hsize} +\def\leftline#1{\line{#1\hss}} +\def\rightline#1{\line{\hss#1}} +\def\centerline#1{\line{\hss#1\hss}} + +\def\rlap#1{\hbox to\z@{#1\hss}} +\def\llap#1{\hbox to\z@{\hss#1}} + +\def\m@th{\mathsurround\z@} +\def\underbar#1{$\setbox\z@\hbox{#1}\dp\z@\z@ + \m@th \underline{\box\z@}$} + +\newbox\strutbox +\setbox\strutbox=\hbox{\vrule height8.5pt depth3.5pt width\z@} +\def\strut{\relax\ifmmode\copy\strutbox\else\unhcopy\strutbox\fi} + +\def\hidewidth{\hskip\hideskip} % for alignment entries that can stick out +\def\ialign{\everycr{}\tabskip\z@skip\halign} % initialized \halign +\newcount\mscount +\def\multispan#1{\omit \mscount#1\relax + \loop\ifnum\mscount>\@ne \sp@n\repeat} +\def\sp@n{\span\omit\advance\mscount\m@ne} + +%LP We keep the old tabbing macros +\newif\ifus@ \newif\if@cr +\newbox\tabs \newbox\tabsyet \newbox\tabsdone + +\def\cleartabs{\global\setbox\tabsyet\null \setbox\tabs\null} +\def\settabs{\setbox\tabs\null \futurelet\next\sett@b} +\let\+=\relax % in case this file is being read in twice +\def\sett@b{\ifx\next\+\def\nxt{\afterassignment\s@tt@b\let\nxt}% + \else\let\nxt\s@tcols\fi \let\next\relax \nxt} +\def\s@tt@b{\let\nxt\relax \us@false\m@ketabbox} +\def\tabalign{\us@true\m@ketabbox} % non-\outer version of \+ +\outer\def\+{\tabalign} +\def\s@tcols#1\columns{\count@#1\dimen@\hsize + \loop\ifnum\count@>\z@ \@nother \repeat} +\def\@nother{\dimen@ii\dimen@ \divide\dimen@ii\count@ + \setbox\tabs\hbox{\hbox to\dimen@ii{}\unhbox\tabs}% + \advance\dimen@-\dimen@ii \advance\count@\m@ne} + +\def\m@ketabbox{\begingroup + \global\setbox\tabsyet\copy\tabs + \global\setbox\tabsdone\null + \def\cr{\@crtrue\crcr\egroup\egroup + \ifus@\unvbox\z@\lastbox\fi\endgroup + \setbox\tabs\hbox{\unhbox\tabsyet\unhbox\tabsdone}}% + \setbox\z@\vbox\bgroup\@crfalse + \ialign\bgroup&\t@bbox##\t@bb@x\crcr} + +\def\t@bbox{\setbox\z@\hbox\bgroup} +\def\t@bb@x{\if@cr\egroup % now \box\z@ holds the column + \else\hss\egroup \global\setbox\tabsyet\hbox{\unhbox\tabsyet + \global\setbox\@ne\lastbox}% now \box\@ne holds its size + \ifvoid\@ne\global\setbox\@ne\hbox to\wd\z@{}% + \else\setbox\z@\hbox to\wd\@ne{\unhbox\z@}\fi + \global\setbox\tabsdone\hbox{\box\@ne\unhbox\tabsdone}\fi + \box\z@} + +\chardef\%=`\% +\chardef\&=`\& +\chardef\#=`\# +\chardef\$=`\$ +\chardef\ss="19 +\chardef\ae="1A +\chardef\oe="1B +\chardef\o="1C +\chardef\AE="1D +\chardef\OE="1E +\chardef\O="1F +\chardef\i="10 \chardef\j="11 % dotless letters +\def\aa{\accent23a} +\def\l{\char32l} +\def\L{\leavevmode\setbox0\hbox{L}\hbox to\wd0{\hss\char32L}} + +\def\leavevmode{\unhbox\voidb@x} % begins a paragraph, if necessary +\def\_{\leavevmode \kern.06em \vbox{\hrule width.3em}} +\def\AA{\leavevmode\setbox0\hbox{!}\dimen@\ht0\advance\dimen@-1ex% + \rlap{\raise.67\dimen@\hbox{\char'27}}A} + +\def\mathhexbox#1#2#3{\leavevmode + \hbox{$\m@th \mathchar"#1#2#3$}} +\def\dag{\mathhexbox279} +\def\ddag{\mathhexbox27A} +\def\S{\mathhexbox278} +\def\P{\mathhexbox27B} +\def\Orb{\mathhexbox20D} + +\def\oalign#1{\leavevmode\vtop{\baselineskip\z@skip \lineskip.25ex% + \ialign{##\crcr#1\crcr}}} \def\o@lign{\lineskiplimit\z@ \oalign} +\def\ooalign{\lineskiplimit-\maxdimen \oalign} % chars over each other +{\catcode`p=12 \catcode`t=12 \gdef\\#1pt{#1}} \let\getf@ctor=\\ +\def\sh@ft#1{\dimen@#1\kern\expandafter\getf@ctor\the\fontdimen1\font + \dimen@} % kern by #1 times the current slant +\def\d#1{{\o@lign{\relax#1\crcr\hidewidth\sh@ft{-1ex}.\hidewidth}}} +\def\b#1{{\o@lign{\relax#1\crcr\hidewidth\sh@ft{-3ex}% + \vbox to.2ex{\hbox{\char22}\vss}\hidewidth}}} +\def\c#1{{\setbox\z@\hbox{#1}\ifdim\ht\z@=1ex\accent24 #1% + \else\ooalign{\unhbox\z@\crcr\hidewidth\char24\hidewidth}\fi}} +\def\copyright{{\ooalign{\hfil\raise.07ex\hbox{c}\hfil\crcr\Orb}}} + +\def\dots{\relax\ifmmode\ldots\else$\m@th\ldots\,$\fi} +\def\TeX{\protect\@TeX} +\def\@TeX{T\kern-.1667em\lower.5ex\hbox{E}\kern-.125emX} + +\def\`#1{{\accent18 #1}} +\def\'#1{{\accent19 #1}} +\def\v#1{{\accent20 #1}} \let\^^_=\v +\def\u#1{{\accent21 #1}} \let\^^S=\u +\def\=#1{{\accent22 #1}} +\def\^#1{{\accent94 #1}} \let\^^D=\^ +\def\.#1{{\accent95 #1}} +\def\H#1{{\accent"7D #1}} +\def\~#1{{\accent"7E #1}} +\def\"#1{{\accent"7F #1}} +\def\t#1{{\edef\next{\the\font}\the\textfont1\accent"7F\next#1}} + +\def\hrulefill{\leaders\hrule\hfill} +\def\dotfill{\cleaders\hbox{$\m@th \mkern1.5mu.\mkern1.5mu$}\hfill} +\def\rightarrowfill{$\m@th\smash-\mkern-7mu% + \cleaders\hbox{$\mkern-2mu\smash-\mkern-2mu$}\hfill + \mkern-7mu\mathord\rightarrow$} +\def\leftarrowfill{$\m@th\mathord\leftarrow\mkern-7mu% + \cleaders\hbox{$\mkern-2mu\smash-\mkern-2mu$}\hfill + \mkern-7mu\smash-$} +\mathchardef\braceld="37A \mathchardef\bracerd="37B +\mathchardef\bracelu="37C \mathchardef\braceru="37D +\def\downbracefill{$\m@th \setbox\z@\hbox{$\braceld$}% + \braceld\leaders\vrule height\ht\z@ depth\z@\hfill\braceru + \bracelu\leaders\vrule height\ht\z@ depth\z@\hfill\bracerd$} +\def\upbracefill{$\m@th \setbox\z@\hbox{$\braceld$}% + \bracelu\leaders\vrule height\ht\z@ depth\z@\hfill\bracerd + \braceld\leaders\vrule height\ht\z@ depth\z@\hfill\braceru$} + +%\outer\def\bye{\par\vfill\supereject\end} + +% Macros for math setting + +\let\sp=^ \let\sb=_ +\def\,{\mskip\thinmuskip} +\def\>{\mskip\medmuskip} +\def\;{\mskip\thickmuskip} +\def\!{\mskip-\thinmuskip} +\def\*{\discretionary{\thinspace\the\textfont2\char2}{}{}} +{\catcode`\'=\active \gdef'{^\bgroup\prim@s}} +\def\prim@s{\prime\futurelet\next\pr@m@s} +\def\pr@m@s{\ifx'\next\let\nxt\pr@@@s \else\ifx^\next\let\nxt\pr@@@t + \else\let\nxt\egroup\fi\fi \nxt} +\def\pr@@@s#1{\prim@s} \def\pr@@@t#1#2{#2\egroup} +{\catcode`\^^Z=\active \gdef^^Z{\not=}} % ^^Z is like \ne in math + +{\catcode`\_=\active \global\let_=\_} % _ in math is either subscript or \_ + +\mathchardef\alpha="010B +\mathchardef\beta="010C +\mathchardef\gamma="010D +\mathchardef\delta="010E +\mathchardef\epsilon="010F +\mathchardef\zeta="0110 +\mathchardef\eta="0111 +\mathchardef\theta="0112 +\mathchardef\iota="0113 +\mathchardef\kappa="0114 +\mathchardef\lambda="0115 +\mathchardef\mu="0116 +\mathchardef\nu="0117 +\mathchardef\xi="0118 +\mathchardef\pi="0119 +\mathchardef\rho="011A +\mathchardef\sigma="011B +\mathchardef\tau="011C +\mathchardef\upsilon="011D +\mathchardef\phi="011E +\mathchardef\chi="011F +\mathchardef\psi="0120 +\mathchardef\omega="0121 +\mathchardef\varepsilon="0122 +\mathchardef\vartheta="0123 +\mathchardef\varpi="0124 +\mathchardef\varrho="0125 +\mathchardef\varsigma="0126 +\mathchardef\varphi="0127 +\mathchardef\Gamma="7000 +\mathchardef\Delta="7001 +\mathchardef\Theta="7002 +\mathchardef\Lambda="7003 +\mathchardef\Xi="7004 +\mathchardef\Pi="7005 +\mathchardef\Sigma="7006 +\mathchardef\Upsilon="7007 +\mathchardef\Phi="7008 +\mathchardef\Psi="7009 +\mathchardef\Omega="700A + +\mathchardef\aleph="0240 +\def\hbar{{\mathchar'26\mkern-9muh}} +\mathchardef\imath="017B +\mathchardef\jmath="017C +\mathchardef\ell="0160 +\mathchardef\wp="017D +\mathchardef\Re="023C +\mathchardef\Im="023D +\mathchardef\partial="0140 +\mathchardef\infty="0231 +\mathchardef\prime="0230 +\mathchardef\emptyset="023B +\mathchardef\nabla="0272 +\def\surd{{\mathchar"1270}} +\mathchardef\top="023E +\mathchardef\bot="023F +\def\angle{{\vbox{\ialign{$\m@th\scriptstyle##$\crcr + \not\mathrel{\mkern14mu}\crcr + \noalign{\nointerlineskip} + \mkern2.5mu\leaders\hrule height.34pt\hfill\mkern2.5mu\crcr}}}} +\mathchardef\triangle="0234 +\mathchardef\forall="0238 +\mathchardef\exists="0239 +\mathchardef\neg="023A \let\lnot=\neg +\mathchardef\flat="015B +\mathchardef\natural="015C +\mathchardef\sharp="015D +\mathchardef\clubsuit="027C +\mathchardef\diamondsuit="027D +\mathchardef\heartsuit="027E +\mathchardef\spadesuit="027F + +\mathchardef\coprod="1360 +\mathchardef\bigvee="1357 +\mathchardef\bigwedge="1356 +\mathchardef\biguplus="1355 +\mathchardef\bigcap="1354 +\mathchardef\bigcup="1353 +\mathchardef\intop="1352 \def\int{\intop\nolimits} +\mathchardef\prod="1351 +\mathchardef\sum="1350 +\mathchardef\bigotimes="134E +\mathchardef\bigoplus="134C +\mathchardef\bigodot="134A +\mathchardef\ointop="1348 \def\oint{\ointop\nolimits} +\mathchardef\bigsqcup="1346 +\mathchardef\smallint="1273 + +\mathchardef\triangleleft="212F +\mathchardef\triangleright="212E +\mathchardef\bigtriangleup="2234 +\mathchardef\bigtriangledown="2235 +\mathchardef\wedge="225E \let\land=\wedge +\mathchardef\vee="225F \let\lor=\vee +\mathchardef\cap="225C +\mathchardef\cup="225B +\mathchardef\ddagger="227A +\mathchardef\dagger="2279 +\mathchardef\sqcap="2275 +\mathchardef\sqcup="2274 +\mathchardef\uplus="225D +\mathchardef\amalg="2271 +\mathchardef\diamond="2205 +\mathchardef\bullet="220F +\mathchardef\wr="226F +\mathchardef\div="2204 +\mathchardef\odot="220C +\mathchardef\oslash="220B +\mathchardef\otimes="220A +\mathchardef\ominus="2209 +\mathchardef\oplus="2208 +\mathchardef\mp="2207 +\mathchardef\pm="2206 +\mathchardef\circ="220E +\mathchardef\bigcirc="220D +\mathchardef\setminus="226E % for set difference A\setminus B +\mathchardef\cdot="2201 +\mathchardef\ast="2203 +\mathchardef\times="2202 +\mathchardef\star="213F + +\mathchardef\propto="322F +\mathchardef\sqsubseteq="3276 +\mathchardef\sqsupseteq="3277 +\mathchardef\parallel="326B +\mathchardef\mid="326A +\mathchardef\dashv="3261 +\mathchardef\vdash="3260 +\mathchardef\nearrow="3225 +\mathchardef\searrow="3226 +\mathchardef\nwarrow="322D +\mathchardef\swarrow="322E +\mathchardef\Leftrightarrow="322C +\mathchardef\Leftarrow="3228 +\mathchardef\Rightarrow="3229 +\def\neq{\not=} \let\ne=\neq +\mathchardef\leq="3214 \let\le=\leq +\mathchardef\geq="3215 \let\ge=\geq +\mathchardef\succ="321F +\mathchardef\prec="321E +\mathchardef\approx="3219 +\mathchardef\succeq="3217 +\mathchardef\preceq="3216 +\mathchardef\supset="321B +\mathchardef\subset="321A +\mathchardef\supseteq="3213 +\mathchardef\subseteq="3212 +\mathchardef\in="3232 +\mathchardef\ni="3233 \let\owns=\ni +\mathchardef\gg="321D +\mathchardef\ll="321C +\mathchardef\not="3236 +\mathchardef\leftrightarrow="3224 +\mathchardef\leftarrow="3220 \let\gets=\leftarrow +\mathchardef\rightarrow="3221 \let\to=\rightarrow +\mathchardef\mapstochar="3237 \def\mapsto{\mapstochar\rightarrow} +\mathchardef\sim="3218 +\mathchardef\simeq="3227 +\mathchardef\perp="323F +\mathchardef\equiv="3211 +\mathchardef\asymp="3210 +\mathchardef\smile="315E +\mathchardef\frown="315F +\mathchardef\leftharpoonup="3128 +\mathchardef\leftharpoondown="3129 +\mathchardef\rightharpoonup="312A +\mathchardef\rightharpoondown="312B + +\def\joinrel{\mathrel{\mkern-3mu}} +\def\relbar{\mathrel{\smash-}} % \smash, because - has the same height as + +\def\Relbar{\mathrel=} +\mathchardef\lhook="312C \def\hookrightarrow{\lhook\joinrel\rightarrow} +\mathchardef\rhook="312D \def\hookleftarrow{\leftarrow\joinrel\rhook} +\def\bowtie{\mathrel\triangleright\joinrel\mathrel\triangleleft} +\def\models{\mathrel|\joinrel=} +\def\Longrightarrow{\Relbar\joinrel\Rightarrow} +\def\longrightarrow{\relbar\joinrel\rightarrow} +\def\longleftarrow{\leftarrow\joinrel\relbar} +\def\Longleftarrow{\Leftarrow\joinrel\Relbar} +\def\longmapsto{\mapstochar\longrightarrow} +\def\longleftrightarrow{\leftarrow\joinrel\rightarrow} +\def\Longleftrightarrow{\Leftarrow\joinrel\Rightarrow} +\def\iff{\;\Longleftrightarrow\;} + +\mathchardef\ldotp="613A % ldot as a punctuation mark +\mathchardef\cdotp="6201 % cdot as a punctuation mark +\mathchardef\colon="603A % colon as a punctuation mark +\def\ldots{\mathinner{\ldotp\ldotp\ldotp}} +\def\cdots{\mathinner{\cdotp\cdotp\cdotp}} +\def\vdots{\vbox{\baselineskip4\p@ \lineskiplimit\z@ + \kern6\p@\hbox{.}\hbox{.}\hbox{.}}} +\def\ddots{\mathinner{\mkern1mu\raise7\p@\vbox{\kern7\p@\hbox{.}}\mkern2mu + \raise4\p@\hbox{.}\mkern2mu\raise\p@\hbox{.}\mkern1mu}} + +\def\acute{\mathaccent"7013 } +\def\grave{\mathaccent"7012 } +\def\ddot{\mathaccent"707F } +\def\tilde{\mathaccent"707E } +\def\bar{\mathaccent"7016 } +\def\breve{\mathaccent"7015 } +\def\check{\mathaccent"7014 } +\def\hat{\mathaccent"705E } +\def\vec{\mathaccent"017E } +\def\dot{\mathaccent"705F } +\def\widetilde{\mathaccent"0365 } +\def\widehat{\mathaccent"0362 } +\def\overrightarrow#1{\vbox{\m@th\ialign{##\crcr + \rightarrowfill\crcr\noalign{\kern-\p@\nointerlineskip} + $\hfil\displaystyle{#1}\hfil$\crcr}}} +\def\overleftarrow#1{\vbox{\m@th\ialign{##\crcr + \leftarrowfill\crcr\noalign{\kern-\p@\nointerlineskip} + $\hfil\displaystyle{#1}\hfil$\crcr}}} +\def\overbrace#1{\mathop{\vbox{\m@th\ialign{##\crcr\noalign{\kern3\p@} + \downbracefill\crcr\noalign{\kern3\p@\nointerlineskip} + $\hfil\displaystyle{#1}\hfil$\crcr}}}\limits} +\def\underbrace#1{\mathop{\vtop{\m@th\ialign{##\crcr + $\hfil\displaystyle{#1}\hfil$\crcr\noalign{\kern3\p@\nointerlineskip} + \upbracefill\crcr\noalign{\kern3\p@}}}}\limits} +\def\skew#1#2#3{{\muskip\z@#1mu\divide\muskip\z@\tw@ \mkern\muskip\z@ + #2{\mkern-\muskip\z@{#3}\mkern\muskip\z@}\mkern-\muskip\z@}{}} + +\def\lmoustache{\delimiter"437A340 } % top from (, bottom from ) +\def\rmoustache{\delimiter"537B341 } % top from ), bottom from ( +\def\lgroup{\delimiter"462833A } % extensible ( with sharper tips +\def\rgroup{\delimiter"562933B } % extensible ) with sharper tips +\def\arrowvert{\delimiter"26A33C } % arrow without arrowheads +\def\Arrowvert{\delimiter"26B33D } % double arrow without arrowheads +\def\bracevert{\delimiter"77C33E } % the vertical bar that extends braces +\def\Vert{\delimiter"26B30D } \let\|=\Vert +\def\vert{\delimiter"26A30C } +\def\uparrow{\delimiter"3222378 } +\def\downarrow{\delimiter"3223379 } +\def\updownarrow{\delimiter"326C33F } +\def\Uparrow{\delimiter"322A37E } +\def\Downarrow{\delimiter"322B37F } +\def\Updownarrow{\delimiter"326D377 } +\def\backslash{\delimiter"26E30F } % for double coset G\backslash H +\def\rangle{\delimiter"526930B } +\def\langle{\delimiter"426830A } +\def\rbrace{\delimiter"5267309 } \let\}=\rbrace +\def\lbrace{\delimiter"4266308 } \let\{=\lbrace +\def\rceil{\delimiter"5265307 } +\def\lceil{\delimiter"4264306 } +\def\rfloor{\delimiter"5263305 } +\def\lfloor{\delimiter"4262304 } + +\def\bigl{\mathopen\big} +\def\bigm{\mathrel\big} +\def\bigr{\mathclose\big} +\def\Bigl{\mathopen\Big} +\def\Bigm{\mathrel\Big} +\def\Bigr{\mathclose\Big} +\def\biggl{\mathopen\bigg} +\def\biggm{\mathrel\bigg} +\def\biggr{\mathclose\bigg} +\def\Biggl{\mathopen\Bigg} +\def\Biggm{\mathrel\Bigg} +\def\Biggr{\mathclose\Bigg} +\def\big#1{{\hbox{$\left#1\vbox to8.5\p@{}\right.\n@space$}}} +\def\Big#1{{\hbox{$\left#1\vbox to11.5\p@{}\right.\n@space$}}} +\def\bigg#1{{\hbox{$\left#1\vbox to14.5\p@{}\right.\n@space$}}} +\def\Bigg#1{{\hbox{$\left#1\vbox to17.5\p@{}\right.\n@space$}}} +\def\n@space{\nulldelimiterspace\z@ \m@th} + +\def\choose{\atopwithdelims()} +\def\brack{\atopwithdelims[]} +\def\brace{\atopwithdelims\{\}} + +\def\sqrt{\radical"270370 } + +\def\mathpalette#1#2{\mathchoice{#1\displaystyle{#2}}% + {#1\textstyle{#2}}{#1\scriptstyle{#2}}{#1\scriptscriptstyle{#2}}} +\newbox\rootbox +\def\root#1\of{\setbox\rootbox\hbox{$\m@th\scriptscriptstyle{#1}$} + \mathpalette\r@@t} +\def\r@@t#1#2{\setbox\z@\hbox{$\m@th#1\sqrt{#2}$} + \dimen@\ht\z@ \advance\dimen@-\dp\z@ + \mkern5mu\raise.6\dimen@\copy\rootbox \mkern-10mu \box\z@} +\newif\ifv@ \newif\ifh@ +%% LP +\let\v@true=\v@yes \let\v@false=\v@no +\let\h@true=\h@yes \let\h@false=\h@no +\def\vphantom{\v@true\h@false\ph@nt} +\def\hphantom{\v@false\h@true\ph@nt} +\def\phantom{\v@true\h@true\ph@nt} +\def\ph@nt{\ifmmode\def\next{\mathpalette\mathph@nt}% + \else\let\next\makeph@nt\fi\next} +\def\makeph@nt#1{\setbox\z@\hbox{#1}\finph@nt} +\def\mathph@nt#1#2{\setbox\z@\hbox{$\m@th#1{#2}$}\finph@nt} +\def\finph@nt{\setbox\tw@\null + \ifv@ \ht\tw@\ht\z@ \dp\tw@\dp\z@\fi + \ifh@ \wd\tw@\wd\z@\fi \box\tw@} +\def\mathstrut{\vphantom(} +\def\smash{\relax % \relax, in case this comes first in \halign + \ifmmode\def\next{\mathpalette\mathsm@sh}\else\let\next\makesm@sh + \fi\next} +\def\makesm@sh#1{\setbox\z@\hbox{#1}\finsm@sh} +\def\mathsm@sh#1#2{\setbox\z@\hbox{$\m@th#1{#2}$}\finsm@sh} +\def\finsm@sh{\ht\z@\z@ \dp\z@\z@ \box\z@} + +\def\cong{\mathrel{\mathpalette\@vereq\sim}} % congruence sign +\def\@vereq#1#2{\lower.5\p@\vbox{\lineskiplimit\maxdimen\lineskip-.5\p@ + \ialign{$\m@th#1\hfil##\hfil$\crcr#2\crcr=\crcr}}} +\def\notin{\mathrel{\mathpalette\c@ncel\in}} +\def\c@ncel#1#2{\m@th\ooalign{$\hfil#1\mkern1mu/\hfil$\crcr$#1#2$}} +\def\rightleftharpoons{\mathrel{\mathpalette\rlh@{}}} +\def\rlh@#1{\vcenter{\m@th\hbox{\ooalign{\raise2pt + \hbox{$#1\rightharpoonup$}\crcr + $#1\leftharpoondown$}}}} +\def\buildrel#1\over#2{\mathrel{\mathop{\kern\z@#2}\limits^{#1}}} +\def\doteq{\buildrel\textstyle.\over=} + +\def\log{\mathop{\rm log}\nolimits} +\def\lg{\mathop{\rm lg}\nolimits} +\def\ln{\mathop{\rm ln}\nolimits} +\def\lim{\mathop{\rm lim}} +\def\limsup{\mathop{\rm lim\,sup}} +\def\liminf{\mathop{\rm lim\,inf}} +\def\sin{\mathop{\rm sin}\nolimits} +\def\arcsin{\mathop{\rm arcsin}\nolimits} +\def\sinh{\mathop{\rm sinh}\nolimits} +\def\cos{\mathop{\rm cos}\nolimits} +\def\arccos{\mathop{\rm arccos}\nolimits} +\def\cosh{\mathop{\rm cosh}\nolimits} +\def\tan{\mathop{\rm tan}\nolimits} +\def\arctan{\mathop{\rm arctan}\nolimits} +\def\tanh{\mathop{\rm tanh}\nolimits} +\def\cot{\mathop{\rm cot}\nolimits} +\def\coth{\mathop{\rm coth}\nolimits} +\def\sec{\mathop{\rm sec}\nolimits} +\def\csc{\mathop{\rm csc}\nolimits} +\def\max{\mathop{\rm max}} +\def\min{\mathop{\rm min}} +\def\sup{\mathop{\rm sup}} +\def\inf{\mathop{\rm inf}} +\def\arg{\mathop{\rm arg}\nolimits} +\def\ker{\mathop{\rm ker}\nolimits} +\def\dim{\mathop{\rm dim}\nolimits} +\def\hom{\mathop{\rm hom}\nolimits} +\def\det{\mathop{\rm det}} +\def\exp{\mathop{\rm exp}\nolimits} +\def\Pr{\mathop{\rm Pr}} +\def\gcd{\mathop{\rm gcd}} +\def\deg{\mathop{\rm deg}\nolimits} + +\def\bmod{\nonscript\mskip-\medmuskip\mkern5mu + \mathbin{\rm mod}\penalty900\mkern5mu\nonscript\mskip-\medmuskip} +\def\pmod#1{\allowbreak\mkern18mu({\rm mod}\,\,#1)} + +\def\cases#1{\left\{\,\vcenter{%\normalbaselines + \m@th + \ialign{$##\hfil$&\quad##\hfil\crcr#1\crcr}}\right.} +\def\matrix#1{\null\,\vcenter{%\normalbaselines + \m@th + \ialign{\hfil$##$\hfil&&\quad\hfil$##$\hfil\crcr + \mathstrut\crcr\noalign{\kern-\baselineskip} + #1\crcr\mathstrut\crcr\noalign{\kern-\baselineskip}}}\,} +\def\pmatrix#1{\left(\matrix{#1}\right)} +\newdimen\p@renwd +\setbox0=\hbox{\tenex B} \p@renwd=\wd0 % width of the big left ( +\def\bordermatrix#1{\begingroup \m@th + \setbox\z@\vbox{\def\cr{\crcr\noalign{\kern2\p@\global\let\cr\endline}}% + \ialign{$##$\hfil\kern2\p@\kern\p@renwd&\thinspace\hfil$##$\hfil + &&\quad\hfil$##$\hfil\crcr + \omit\strut\hfil\crcr\noalign{\kern-\baselineskip}% + #1\crcr\omit\strut\cr}}% + \setbox\tw@\vbox{\unvcopy\z@\global\setbox\@ne\lastbox}% + \setbox\tw@\hbox{\unhbox\@ne\unskip\global\setbox\@ne\lastbox}% + \setbox\tw@\hbox{$\kern\wd\@ne\kern-\p@renwd\left(\kern-\wd\@ne + \global\setbox\@ne\vbox{\box\@ne\kern2\p@}% + \vcenter{\kern-\ht\@ne\unvbox\z@\kern-\baselineskip}\,\right)$}% + \null\;\vbox{\kern\ht\@ne\box\tw@}\endgroup} + +\def\openup{\afterassignment\@penup\dimen@=} +\def\@penup{\advance\lineskip\dimen@ + \advance\baselineskip\dimen@ + \advance\lineskiplimit\dimen@} +\def\eqalign#1{\null\,\vcenter{\openup\jot\m@th + \ialign{\strut\hfil$\displaystyle{##}$&$\displaystyle{{}##}$\hfil + \crcr#1\crcr}}\,} +\newif\ifdt@p +\let\dt@ptrue=\dt@pyes \let\dt@pfalse=\dt@pno %%LP +\def\displ@y{\global\dt@ptrue\openup\jot\m@th + \everycr{\noalign{\ifdt@p \global\dt@pfalse \ifdim\prevdepth>-1000\p@ + \vskip-\lineskiplimit \vskip\normallineskiplimit \fi + \else \penalty\interdisplaylinepenalty \fi}}} +\def\@lign{\tabskip\z@skip\everycr{}} % restore inside \displ@y +\def\displaylines#1{\displ@y \tabskip\z@skip + \halign{\hbox to\displaywidth{$\@lign\hfil\displaystyle##\hfil$}\crcr + #1\crcr}} +\def\eqalignno#1{\displ@y \tabskip\centering + \halign to\displaywidth{\hfil$\@lign\displaystyle{##}$\tabskip\z@skip + &$\@lign\displaystyle{{}##}$\hfil\tabskip\centering + &\llap{$\@lign##$}\tabskip\z@skip\crcr + #1\crcr}} +\def\leqalignno#1{\displ@y \tabskip\centering + \halign to\displaywidth{\hfil$\@lign\displaystyle{##}$\tabskip\z@skip + &$\@lign\displaystyle{{}##}$\hfil\tabskip\centering + &\kern-\displaywidth\rlap{$\@lign##$}\tabskip\displaywidth\crcr + #1\crcr}} + +% Definitions related to output + +%LP Voorlopig even laten staat voor een default output routine + +\countdef\pageno=0 \pageno=1 % first page is number 1 + +\def\textindent#1{\indent\llap{#1\enspace}\ignorespaces} +\newinsert\footins +\def\footnote#1{\let\@sf\empty % parameter #2 (the text) is read later + \ifhmode\edef\@sf{\spacefactor\the\spacefactor}\/\fi + #1\@sf\vfootnote{#1}} +\def\vfootnote#1{\insert\footins\bgroup + \interlinepenalty\interfootnotelinepenalty + \splittopskip\ht\strutbox % top baseline for broken footnotes + \splitmaxdepth\dp\strutbox \floatingpenalty\@MM + \leftskip\z@skip \rightskip\z@skip \spaceskip\z@skip \xspaceskip\z@skip + \textindent{#1}\footstrut\futurelet\next\fo@t} +\def\fo@t{\ifcat\bgroup\noexpand\next \let\next\f@@t + \else\let\next\f@t\fi \next} +\def\f@@t{\bgroup\aftergroup\@foot\let\next} +\def\f@t#1{#1\@foot} +\def\@foot{\strut\egroup} +\def\footstrut{\vbox to\splittopskip{}} +\skip\footins=\bigskipamount % space added when footnote is present +\count\footins=1000 % footnote magnification factor (1 to 1) +\dimen\footins=8in % maximum footnotes per page + +\newinsert\topins +\newif\ifp@ge \newif\if@mid +\let\p@getrue=\p@geyes \let\p@gefalse=\p@geno +\let\@midtrue=\@midyes \let\@midfalse=\@midno +\def\topinsert{\@midfalse\p@gefalse\@ins} +\def\midinsert{\@midtrue\@ins} +\def\pageinsert{\@midfalse\p@getrue\@ins} +\skip\topins=\z@skip % no space added when a topinsert is present +\count\topins=1000 % magnification factor (1 to 1) +\dimen\topins=\maxdimen % no limit per page +\def\@ins{\par\begingroup\setbox\z@\vbox\bgroup} % start a \vbox +\def\endinsert{\egroup % finish the \vbox + \if@mid \dimen@\ht\z@ \advance\dimen@\dp\z@ \advance\dimen@12\p@ + \advance\dimen@\pagetotal \advance\dimen@-\pageshrink + \ifdim\dimen@>\pagegoal\@midfalse\p@gefalse\fi\fi + \if@mid \bigskip\box\z@\bigbreak + \else\insert\topins{\penalty100 % floating insertion + \splittopskip\z@skip + \splitmaxdepth\maxdimen \floatingpenalty\z@ + \ifp@ge \dimen@\dp\z@ + \vbox to\vsize{\unvbox\z@\kern-\dimen@}% depth is zero + \else \box\z@\nobreak\bigskip\fi}\fi\endgroup} + +% Hyphenation, miscellaneous macros, and initial values for standard layout + +\lefthyphenmin=2 \righthyphenmin=3 % disallow x- or -xx breaks +\input hyphen + +\def\magnification{\afterassignment\m@g\count@} +\def\m@g{\mag\count@ + \hsize6.5truein\vsize8.9truein\dimen\footins8truein} + +\def\tracingall{\tracingonline\@ne\tracingcommands\tw@\tracingstats\tw@ + \tracingpages\@ne\tracingoutput\@ne\tracinglostchars\@ne + \tracingmacros\tw@\tracingparagraphs\@ne\tracingrestores\@ne + \showboxbreadth\maxdimen\showboxdepth\maxdimen\errorstopmode} + +\font\tenrm=cmr10 % aw hell. +\def\showhyphens#1{\setbox0\vbox{\parfillskip\z@skip\hsize\maxdimen\tenrm + \pretolerance\m@ne\tolerance\m@ne\hbadness0\showboxdepth0\ #1}} + +\endinput + +% 2014/04/11 brought up to date with plain.tex for 3.141592653 +% 92/11/03 brought up to date with plain.tex for 3.0 diff --git a/Master/texmf-dist/tex/lollipop/lollipop-text.tex b/Master/texmf-dist/tex/lollipop/lollipop-text.tex new file mode 100644 index 00000000000..0c822fb7a50 --- /dev/null +++ b/Master/texmf-dist/tex/lollipop/lollipop-text.tex @@ -0,0 +1,490 @@ +% lollipop-text.tex copyright 1992 Victor Eijkhout +% copyright 2014 Vafa Khalighi +% +% +% This program is free software: you can redistribute it and/or modify +% it under the terms of the GNU General Public License as published by +% the Free Software Foundation, either version 3 of the License, or +% (at your option) any later version. +% +% 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 +% GNU General Public License for more details. +% +% You should have received a copy of the GNU General Public License +% along with this program. If not, see <http://www.gnu.org/licenses/>. +% +% +%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%% +%%%%% Text Blocks + +\@GenericConstruct{TextBlock} + +% commands can be before and after text +% store in two token lists +% switch from one to other by option 'text' +% this may also be used by ParagraphShape +% +\add@TextBlock@default{ + \def\@current@options@list{before@coms} + \def\switch@lists{\at@breakpointyes + \def\@current@options@list{after@coms}} + } +\@TextBlockOption{text}{\switch@lists} + +\def\@DefineTextBlock{ + \csarg\edef{\@name}{\@gen@open + \the\before@coms + } + \@DefineStopCommand{\the\after@coms \@gen@close} + } + + + +%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%% +%%%%% A L I N E A V O R M E N +%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%% +% via \everypar: +% \everypar={\@everyeverypar { ...locaal spul... +% \def\par{... \@par\egroup} +\@GenericConstruct{ParagraphShape} + +%%%%!!!!!!!!!!!!!!!! +% not functioning. +% note: \@defaulteverypar is installed now +% as a start@command! + +%% anonieme namen +% \iftempa : moet dit inspringen +% \iftempb : speciale behandeling staart? + +\def\@ParagraphShapeverstekwaardes{ + \tempano \tempbno + \temptoksb={} \temptoksc={} + \def\cs@d{b}\def\@current@options@list{temptoks\cs@d} + } +\def\@DefineParagraphShape{ + \csarg{\edef}{\@name}{% + \CSname{AltijdInspringen\iftempa yes\else no\fi}% + \nxp\everypar={\nxp\@everyeverypar + \iftempb \bgroup \fi + \the\temptoksb + \iftempb \parfillskip\z@ + \else \if@erislinkswit \parfillskip\z@ \fi\fi + \relax + \iftempb \def\nxp\par{\nxp\unskip\nxp\nobreak\the\temptoksc + \hbox{}\nxp\@par\egroup}\fi + }} } + +\@ParagraphShapeNOOP{verticaal} + +%-- inspringen +\@ParagraphShapeOption{inspringen}{ + \if\EqualString{#1}{no}\else\tempayes\fi} + +%-- tekst +\@ParagraphShapeOption{tekst}{\tempbyes\def\cs@d{c}} + + +%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%% +%%%%%%%%%%%%%%%% U T I L I T I E S +%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%% + +%%%%%%%%%%%%%%%% Space, white space +% +% unit space \@@space is set by switching font style +% +\newdimen\@@space \@@space=.5em +\def\Spaces:#1 {\hskip#1\@@space} + +% handig voor bibliografieen +\def\lax{\tolerance\@m \hfuzz\p@} + + +%%%%%%%%%%%%%%%%%%%%%%% +% White space +% +\NewTrace:skip + +\def\hwhite:#1 {\@hwhite{#1}} +\def\@hwhite#1{\ifhmode\unskip\fi\relax + \if\EqualString{#1}{fillup}\hfill\else\hskip\@ww{#1}\relax\fi} + +% Vertical +% subtle: argument should be placed even if +% size is equal: stretch may be different, +% probably more. (cf \par\vwit{0pt plus 1fil} ) +% +\def\vwhite:#1 {\@vwhite{#1}} +\@GenericOption{vwhite}{\protect@breakpoint + \@add@toks{\@vwhite{#1}}\at@breakpointno} +\def\@vwhite#1{\tempskipa=\@ww{#1}\relax \tempskipb\lastskip + \Tmessage[skip]{Considering vskip \the\tempskipa}% + \ifvmode \ifdim\tempskipb>\tempskipa + \Tmessage[skip]{Ignored. (lastskip=\the\tempskipb)}% + \else \Tmessage[skip]{Backvspacing \the\tempskipb}% + \vskip-\tempskipb + \Tmessage[skip]{Vskip \the\tempskipa}% + \vskip\tempskipa \fi + \else \if\EqualString{#1}{fillup}\hfill + \else\vskip\tempskipa \fi + \fi} + +% advance skip by literal or name of control sequence +\def\advance@skip#1#2{\advance#1\@ww{#2}\relax} + +% only backspace the previous; +% in this case prevent creating a breakpoint +% if there was no glue +% +\def\v@buffer#1{\tempskipa=\@ww{#1}\relax \tempskipb\lastskip + \Tmessage[skip]{Clearing for vskip \the\tempskipa}% + \ifvmode \ifdim\tempskipb>\tempskipa + \else \ifdim\tempskipb=\z@ + \else \vskip-\tempskipb\relax + \Tmessage[skip]{Backspaced}\fi + \fi \fi} +\def\unhskip{\ifhmode\unskip\fi} +\def\leavehmode{\unvbox\voidb@x} +\def\novbreak{\leavehmode\nobreak} + +\def\white:#1 {\@white{#1}} +\@GenericOption{white}{\protect@breakpoint + \@add@toks{\@white{#1}}\at@breakpointyes} +\def\@white#1{\ifhmode\@hwhite{#1}\else + \ifvmode\@vwhite{#1}\fi\fi} +\def\fillup{\@white{0pt plus1fill}} + +\def\@@distance#1{\csarg\newskip{#1}} +\def\Distance:#1=#2 + {\if\UndefinedCS{#1}\@@distance{#1}\fi + \edef\cs@e{\global\noexpand\set@value{#1}% + \if\UndefinedCS{#2}{#2}% + \else \CSname{#2}\fi} + \cs@e} +\def\AdaptiveDistance:#1=#2 {\Distance:#1=#2 + \adds@stop@command + {\ifWriteExtern\immediate\write\aux@file + {\string\Distance:#1={\xp\the\csn#1\ecs}}\fi + }} + +\Distance:filler={0pt plus 1fil} +\parindent=30pt +\parskip=0pt +\parfillskip=0cm plus 1 fil +\baselineskip=12pt + +%%%%%%%%%%%%%%%% Rules +\@GenericOption{rule}{ + \if\EqualString{#1}{h}\protect@breakpoint + \@add@toks{\hrule#2\relax} + \at@breakpointyes + \else\if\EqualString{#1}{v}\@add@toks{\vrule#2\relax} + \else\Wmessage{Strange option: <rule:#1=#2>} + \fi \fi} +\@GenericOption{hrule}{\protect@breakpoint + \@add@toks{\hrule}\at@breakpointyes} +\@GenericOption{vrule}{\@add@toks{\vrule}} + +%%%%%%%%%%%%%%%% Indentation Control +% default value for all paragraphs set by AlwaysIndent +% this one is set by by the user, +% or by 'indentinside' option of paragraph shapes +% +\DefineTest:AlwaysIndent +\AlwaysIndent:yes + +% override by Indent +% can be set by the user, +% or by start/end of text constructs +% +\DefineTest:Indent %forceer/onderdruk inspringen + +% Remove indentation +% this is executed by \every@everypar +% +\def\controlled@indentation + {\ifAlwaysIndent + \ifIndent \else \remove@indent \Indent:yes \fi + \else \ifIndent \Indent:no \else \remove@indent \fi + \fi} +\def\remove@indent{{\setbox0=\lastbox}} + +\def\noindentation{\AlwaysIndentno \Indentno} + +% Indentation control in Universal Block +% control sequences \first@indent \inside@indent \after@indent +% are called (in \edef context) in general open/close macros +% for universal environments + +% Indent after this block +% \global because the block may be in a further group +% +\add@generic@default{\def\after@indent{\global\nxp\Indent:no }} +\@GenericOption{indentafter}{ + \def\after@indent{\global\nxp\Indent:#1 }} + +% Indent in this block +\add@generic@default{\def\inside@indent{}} +\@GenericOption{indentinside}{ + \def\inside@indent{\nxp\AlwaysIndent:#1 }} + +% Indent first in this block +\add@generic@default{\def\first@indent{\nxp\Indent:no }} +\@GenericOption{indentfirst}{ + \def\first@indent{\nxp\Indent:#1 }} + +%%%% Level dependent indentation +% +\NewTrace:indent + +% Lots of commands and parameters +% +% \levelindent is the indentation that will be taken +% on the current level, jumping to the next +% +\newdimen\levelindent + +% \previousindent is the indentation that got us to this level +% list item labels have to outdent over this amount +% +\newdimen\previousindent \previousindent\z@ + +% indentlevel counter: used to generate automatic indentation, +% for instance \levelindentvi for level vi +% +\new@@counter{indentlevel} +\set@counter{indentlevel}1 + +% \set@level@indent : set \levelindent to automatically +% generated indentation; if \levelindentiii is defined take it, +% otherwise use \@@level@indent{3}, which uses fraction +% of a \basicindent +% +\def\set@level@indent{\levelindent= + \level@indent{\cs@counter@name{indentlevel}}} +\def\level@indent + #1{\if\UndefinedCS{\@level@indent{#1}}\@@level@indent{#1}% + \else \csname \@level@indent{#1}\endcsname \fi} +\def\@level@indent#1{levelindent\romannumeral#1} +\def\@@level@indent#1{\ifcase#1\z@\or + \basicindent \or .75\basicindent \else .5\basicindent \fi} + +\DefineTest:BasicIndentIsSet +% the following lines appear as the last command in \Start, +% so that the user can tinker with \parindent +% through adaptive distances or in the style +%\ifBasicIndentIsSet\else\Distance:basicindent=parindent\fi +%\set@level@indent + +% \SetLevelIndent : set exact amount of indentation for +% specific level +% +\def\LevelIndent:#1=#2 {\csarg\edef{\@level@indent{#1}}{\@ww{#2}}} + +% Push/Pop indentlevels +% +\def\PushIndentLevel + {\Tmessage[indent]{Old indent: \the\leftskip}% + \advance\leftskip\levelindent + \previousindent=\levelindent + \step@counter{indentlevel}\set@level@indent + \Tmessage[indent]{New indent: \the\leftskip, + at level \the\cs@counter@name{indentlevel}}% + } + +% Popping an indent level requires two pops: one for the \levelindent +% and one for the \previousindent. This last one then has to be +% pushed again. +% +\def\PopIndentLevel + {\ifnum\cs@counter@name{indentlevel}=\@ne + \Emessage{Pop indent level attempted at outer level} + \else \back@step@counter{indentlevel}% + \back@step@counter{indentlevel}% + \set@level@indent \previousindent\levelindent + \step@counter{indentlevel}% + \set@level@indent\advance\leftskip-\levelindent + \fi} + +%%%%%%%%%%%%%%%% Paragraph Skip control +% parskip is stored and set to zero at the start and end +% of environments +\newskip\@restoreparskip + +% it is recorded if a parskip has been stored +% +\newif\if@parskipsaved \@parskipsavedno + +% Do no parskip +% used at start of environment +% +\def\hold@parskip + {\@restoreparskip\parskip \parskip\z@ \@parskipsavedyes} + +% Hold off parskip +% used at end of environment +% +\def\dono@parskip{\if@parskipsaved \else \hold@parskip \fi} + +% Reestablish the parskip +% this is executed in \every@everypar +% +\def\controlled@parskip + {\if@parskipsaved \@parskipsavedno + \parskip\@restoreparskip + \fi} + +\def\noparskip{\parskip\z@ \@restoreparskip\z@} + +%%%%%%%%%%%%%%%% Every Paragraph +% \everypar is supposed to contain \every@everypar +% as its first element. +% +\newtoks\EveryParagraph +\def\every@everypar{\controlled@indentation \controlled@parskip + \one@shot@coms \@headedno} +\def\default@everypar{\everypar={\every@everypar\the\EveryParagraph}} +\add@start@command{\default@everypar} +\everypar{\Emessage{You forgot to give the \nxp\Start\@space command.}} + +% Execute once +% +\newtoks\one@shot@toks +\def\one@shot@coms{\temptoksa\one@shot@toks + \global\one@shot@toks={}\the\temptoksa\temptoksa{}} +\def\next@paragraph#1{\append@to@list{one@shot@toks}{#1}} + +%%%%%%%%%%%%%%%% Every Math +% just like \everypar. +% +\newtoks\EveryMath +\newtoks\EveryDisplay +\newtoks\every@everymath \newcount\high@fam +\every@everymath{\high@fam\count18\relax + %\MainFace + \xp\math@setsize\style@sizes} +\everymath{\the\every@everymath\the\EveryMath} +\everydisplay{\the\every@everymath\the\EveryDisplay} + +% Flush margins +% +\Distance:rightmarginstretch={0pt plus 6cm} +\Distance:leftmarginstretch={0pt plus 6cm} +\def\FlushLeft:#1 {\switch {\if\EqualString{#1}} + {yes} {\leftskip=1\leftskip} + {default} {\leftskip=1\leftskip + \advance\leftskip\leftmarginstretch} + \endswitch \relax} +\FlushLeft:yes +\def\FlushRight:#1 {\switch {\if\EqualString{#1}} + {yes} {\rightskip=1\rightskip} + {default} {\rightskip=1\rightskip + \advance\rightskip\rightmarginstretch} + \endswitch \relax} +\FlushRight:yes + +%%%%%%% lijn +% #1 : hoogte; #2 : lengte; #3 : elevatie +% parameters kunnen van achter af aan weggelaten worden; +% #4 is dummy, kan niet door de gebruiker gespecificeerd worden. +% NNNNNNNNNBBBBBBBBBBBBB: #2 werkt nog niet!!!!!!!!!!!! +\newtoks\@lijntoks +\@lijntoks={} + +% Lijn. Hier moet ik nog eens naar kijken. +\@GenericOption{lijn}{ + \edef\cs@e{\nxp\lijnanalyse:#1:\@restarg::::;}\cs@e + \edef\cs@e{\nxp\@add@toks{\nxp\leavevmode\the\@lijntoks}} + \cs@e} + +\def\lijnanalyse:#1:#2:#3:#4;{\@lijntoks={} + \eqstring{#1}{}{}{\achteraanlijst{@lijntoks}{height #1 }} + \eqstring{#2}{}{\vooraanlijst{@lijntoks}{\leaders\hrule depth 0cm } + \achteraanlijst{@lijntoks}{\hfill}}% + {\eqstring{#2}{uitvullen}% + {\vooraanlijst{@lijntoks}{\leaders\hrule depth 0cm } + \achteraanlijst{@lijntoks}{\hfill}}% + {\achteraanlijst{@lijntoks}{width \w@w{#2} }% + \vooraanlijst{@lijntoks}{\vrule depth 0cm }} +% \eqstring{#3}{}{}{\vooraanlijst{@lijntoks}{\raise #3\hbox\bgroup} +% \achteraanlijst{@lijntoks}{\egroup}} + } + \achteraanlijst{@lijntoks}{\hbox{}} % \par doet \unskip!!! + } + + +%%%%%%%%%%%%%%%%%%%%%%%%%%% accenten +\gdef\allowhyphens{\penalty\@M \hskip\z@\relax} + +%{\catcode`\"=12 \gdef\hex{"}} + +%\catcode`\"=13 +%\def "#1{\ifx#1i\discretionary{-}{i}{{\accent'177 \i}}% +\def\"#1{\ifx#1i\discretionary{-}{i}{{\accent'177 \i}}% + \else\ifx#1-\allowhyphens-\penalty\z@\allowhyphens + \else\ifx#1"\hskip\z@\relax +% \else\ifx#1!\hex + \else\ifx#1!" + \else\ifx#1|\allowhyphens + \else {\accent'177 #1}\fi\fi\fi\fi\fi} + +%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%% +%%%%%%%%%%%%%%%%%% C A S E +%% +\def\UpperCase#1{\edef\cs@a{\uppercase{#1}}\cs@a} + +%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%% +%%%%%%%%%%% L E T T E R S P A C I N G +%% +\def\LetterSpace + {\ifnextchar[\@LetterSpace %] <- to fool emacs + {\@LetterSpace[0ptplus1fil]}} +\def\@LetterSpace[#1]#2{\def\@LS{\hskip#1\relax}% + \edef\cs@e{#2}\xp\@@LS\cs@e&} +\def\@@LS#1#2&{#1\if\IsEmptyList{#2}\xp\take@one\else\@LS\xp\@@LS\fi#2&} + +%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%% +%%%%%%%%%%%%%%% Interdictions +%% +\def\NoHyphenation{\hyphenpenalty\@M \exhyphenpenalty\@M} +\def\NoWidows{\widowpenalty\@M} +\def\NoOrphans{\clubpenalty\@M} + +%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%% +%%%%%%%%%%%%%%%%%% V E R B A T I M +%% + +\def\setupverbatim{\let\do=\makeother \dospecials} + +%% inline verbatim +\def\ver{\leavevmode\begingroup \setupverbatim \obeyspaces\tt \@ver} +\def\@ver#1{\def\@@ver##1#1{##1\endgroup}\@@ver} + +%% display verbatim +{\activecr % + \gdef\vVer>{\setupverbatim \obeyspaces % + \tt \parindent\z@ \noparskip \obeylines % + \ifnextchar + \@@Ver\@Ver}\noeol % + \gdef\@Ver#1<Rev{#1\VerStop}% + \gdef\@@Ver + #1<Rev{#1\VerStop}} + +%% verbatim files +\def\verbatimfile#1{\begingroup + \setupverbatim \obeyspaces \parindent\z@ \noparskip \obeylines % + \tt \input#1\relax + \endgroup} + +\endinput + +% 2014/04/13 defined \EveryParagraph, \EveryMath, and \EveryDisplay +% 2014/04/12 changed "#1 cs to \"#1 cs to be compatible with plain; +% also we can not make " active since it is used by xetex for font selection +% 92/11/08 white options created; +% breakpoint protection in white options +% 92/11/18 AdaptiveDistance implemented +% 92/11/20 \set@counter calls updated for \w@w use +% 92/12/14 default flush right diff --git a/Master/texmf-dist/tex/lollipop/lollipop-tools.tex b/Master/texmf-dist/tex/lollipop/lollipop-tools.tex new file mode 100644 index 00000000000..a0ccbefdf99 --- /dev/null +++ b/Master/texmf-dist/tex/lollipop/lollipop-tools.tex @@ -0,0 +1,1508 @@ +% lollipop-tools.tex copyright 1992/3 Victor Eijkhout +% copyright 2014 Vafa Khalighi +% +% +% This program is free software: you can redistribute it and/or modify +% it under the terms of the GNU General Public License as published by +% the Free Software Foundation, either version 3 of the License, or +% (at your option) any later version. +% +% 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 +% GNU General Public License for more details. +% +% You should have received a copy of the GNU General Public License +% along with this program. If not, see <http://www.gnu.org/licenses/>. +% +% +%% anonymous control sequences +\newif\iftempa \newif\iftempb \newif\iftempc \newif\iftempd + +\newdimen\tempdima \newdimen\tempdimb \newdimen\tempdimc + +\newskip\tempskipa \newskip\tempskipb \newskip\tempskipc + +\newcount\tempcounta \newcount\tempcountb \newcount\tempcountc + +\newbox\tempboxa \newbox\tempboxb \newbox\tempboxc \newbox\tempboxd + +\newtoks\temptoksa \newtoks\temptoksb \newtoks\temptoksc +%\newtoks\temptoksd \newtoks\temptokse \newtoks\temptoksf + +%% auxiliaries +\def\@meld#1{{\immediate\write16{\trace@prefix #1}}} +\def\Dmessage#1{\ifDiagnose \@meld{#1}\fi} +\def\Wmessage#1{\@meld{--- Warning: #1}} +\def\Emessage#1{{\errorcontextlines\m@ne + \errmessage{<><><><><><><><> #1 <><><><><><><><>}}} + +\showboxdepth=7 \showboxbreadth=20 +\newlinechar=`\^^J %nodig? + +\chardef\busje`\\ +\def\cs#1{{\tt\char\busje#1}} + +\let\xp\expandafter \let\nxp\noexpand +\let\csn\csname \let\ecs\endcsname + +% Remove or select tokens +% is used in several places +% +\long\def\id@#1{#1} +\long\def\take@former#1#2{#1} \long\def\take@latter#1#2{#2} +\long\def\take@one#1{} \long\def\take@two#1#2{} +\long\def\take@three#1#2#3{} +\long\def\keep@one#1{#1} \long\def\take@to@dollar#1${} +\def\Xignorespaces#1{#1} + +{\noesc +\xp\xp\xp\gdef\xp\xp\xp\meaning@take@zero + \xp\string\csn macro:\xp\xp\xp\xp\xp\xp\xp\ecs + \xp\xp\xp\xp\xp\xp\xp#\xp\xp\xp1\xp\string\csn->\ecs{} +}\def\real@meaning{\xp\meaning@take@zero\meaning} + +\def\first@of@three#1#2#3{#1} +\def\second@of@three#1#2#3{#2} +\def\third@of@three#1#2#3{#3} +\def\first@two@of@three#1#2#3{{#1}{#2}} + + +% Check if this file is being loaded from IniTeX, or +% by \input'ting on top of an already existing format. +% This is to avoid double definitions and major accidents. +% +\def\lolli@name{Lollipop} +\expandafter\ifx\csname fmtname\endcsname\lolli@name + \let\ifini\take@one + \let\ifnin\keep@one + \message{! Loading Lollipop on top of format !} +\else + \let\ifini\keep@one %iniTeX run or on top of plain TeX + \let\ifnin\take@one + \everyjob{\let\ifini\take@one\let\ifnin\keep@one} +\fi + +%%%%%%%%%%%%%%%% forward definitions +\def\new@@counter#1{\csarg\newcount{\counter@name{#1}}} +\def\counter@name#1{#1@C} + +%%%%%%%%%%%%%%%% Special characters + +% At sign +% + +\def\makeatletter{\catcode`\@=11\relax} +\def\makeatother{\catcode`\@=12\relax} + +% Catcode (re)storing +% +\def\storecat#1% + {\noesc + \csarg\edef{restorecat\string#1}% + {\catcode`\string#1= + \the\catcode\expandafter`\string#1}% + \catcode\expandafter`\string#1=12\relax + \normalesc} +\def\restorecat#1% + {\noesc + \csname restorecat\string#1\endcsname + \normalesc} + +% save writing. + +\def\@space{ }\def\@empty{} \newtoks\empty@toks \empty@toks{} +\def\sc@led{scaled} +\def\nl{\hfil\break} +\def\IniTeX{Ini\TeX} +\def\LaTeX{L\kern-.3em\raise.35ex\hbox{\script A}\kern-.1em\TeX} +\def\AmsTeX{$\cal A_MS$-\TeX} +%my old def +%\def\LamsTeX{L\kern-.2em\raise.4ex\hbox +% {$\scriptstyle\cal A$}\kern-.2em$\cal_M$\kern-.2em$\cal S\,$\TeX} +%Spivak's old def +%\def\LamSTeX{L\kern-.4em\raise.3ex\hbox{$\ssize\Cal A$}\kern-.25em +% \lower.4ex\hbox{\eightsy M}\kern-.1em{$\Cal S$}-\TeX} +\def\LamsTeX{L\kern-.4em\raise.3ex\hbox{\script$\cal A$}\kern-.25em + \lower.4ex\hbox{\script$\cal M$}\kern-.1em{$\cal S$}-\TeX} + +\def\CorporateLogo{\TeX\kern-.15em \raise.5ex\hbox{T}\kern-.25em + ECHNIQUE} + + +\hsize=15cm + +%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%% +%%%%%%%%%%%%%%%%% T O O L S %%%%%%%%%%%%%%% +%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%% + +% Construct a control sequence inside \edef +% +\def\CSname#1{\expandafter\noexpand\csname#1\endcsname} + +% Construct a control sequence out of #2, and give it to #1 +% +\def\csarg#1#2{\expandafter#1\csname#2\endcsname} + +% Pick an escapecharacter +% this presumes that its argument is a character. +% +\def\pickescape#1{\ifnum`#1=\escapechar\else#1\fi} + +% Equality of strings. +% the fast approach: does not work in expansion-only environment. +% +\def\EqualString#1#2{00\fi\def\eqs@a{#1}\def\eqs@b{#2}% + \ifx\eqs@a\eqs@b} + +% Test by expansion only +% +\def\EqualStringX#1#2{00\fi + \csname if\@EqualStringX#1&$#2&$\endcsname} +\def\@EqualStringX#1#2$#3#4${\ifx#1#3% + \ifx#1&true\else\hop@ES\@EqualStringX#2$#4$\fi + \else false\fi} +\def\hop@ES#1\fi#2\fi{\fi\fi#1} + +% Lexicographic ordering +% note the use of \def +% also note the characters 0,127,255 that are used, +% these are not supposed to appear in the strings +% +{\catcode0=12 \catcode255=12 \catcode127=12 +\gdef\StringBeforeNC#1#2{\00\fi + \CharsBefore#1^^@^^?#2^^ff^^?} +\gdef\CharsBeforeNC#1#2^^?#3#4^^?{% + \ifcat#1\relax\def\next{\CharsBefore#2^^@^^?#3#4^^ff^^?}% + \else\ifcat#3\relax\def\next{\CharsBefore#1#2^^@^^?#4^^ff^^?}% + \else\ifnum\lccode`#1<\lccode`#3 + \def\next{\csname iftrue\endcsname}% + \else\ifnum\lccode`#1>\lccode`#3 + \def\next{\csname iffalse\endcsname}% + \else\def\next{\CharsBefore#2^^?#4^^?}% + \fi \fi \fi \fi + \next} +\gdef\StringBefore#1#2{\00\fi + \CharsBefore#1^^@^^?#2^^ff^^?} +\gdef\CharsBefore#1#2^^?#3#4^^?{% + \ifnum`#1<`#3 + \def\next{\csname iftrue\endcsname}% + \else\ifnum`#1>`#3 + \def\next{\csname iffalse\endcsname}% + \else\def\next{\CharsBefore#2^^?#4^^?}% + \fi\fi + \next} +} + + +% Null argument test +% +\def\ifempty#1{00\fi\xp\ifx\csname#1null\endcsname\null} +\def\ifEmptyX#1{\xp\ifx\csname#1null\endcsname\null} +%\def\ifEmpty#1{\def\cs@a{#1}\ifx\cs@a\empty} +\def\IsEmptyList#1{00\fi\def\cs@a{#1}\ifx\cs@a\empty} + +% Next character test +% +\def\NextChar#1#2#3{00\fi + \let\nxt@ch#1\def\nxt@a{#2}\def\nxt@b{#3}% + \futurelet\nxt@c\@ifnxtc} +\def\ifNextChar#1#2#3{% + \let\nxt@ch#1\def\nxt@a{#2}\def\nxt@b{#3}% + \futurelet\nxt@c\@ifnxtc} +\let\ifnextchar\ifNextChar +\def\@ifnxtc{\ifx\nxt@ch\nxt@c \expandafter\nxt@a + \else \expandafter\nxt@b \fi} + +% Test for defined-ness of string as control sequence. +% works inside \edef +% +%outdated: \def\ifnotdefined#1{\csarg\ifx{#1}\relax} +\def\UndefinedCS#1{00\fi\csarg\ifx{#1}\relax} + +% Define uniquely defined dummy macros, +% usually to serve as bumper blocks at the end of a list +% +\newcount\dummies +\def\NewDummy#1{ + \if\UndefinedCS{#1}\csarg\edef{#1}{dum\the\dummies} + \advance\dummies\@ne + \else + \ifini{\Wmessage{Attempt at second definition of `#1'}} + \fi} + +% string case statement +% use: \switch \iftest{...} in: +% item1 action1 +% ... +% itemn actionn +% default defaultaction [optional] +% \endswitch +% inspired by Jonathan Fine: Some Basic Control Macros +% Tugboat 12 #4 +% +\let\@fi\fi \let\endswitch\relax \NewDummy{default} +\def\switch@exit #1 \@fi #2 \endswitch {\fi #1} +\def\switch #1#2#3{\csarg\ifx{#2}\default\switch@exit #3 \@fi + #1{#2}\switch@exit #3 \@fi + \switch {#1} +} +% this version puts the test object in {} +\def\oswitch #1 in: #2 #3; {\csarg\ifx{#2}\default\switch@exit #3 \@fi + #1{#2}\switch@exit #3 \@fi + \switch #1 in: +} +% this version assumes that the test object is just one character +\def\cswitch #1 in: #2 #3; {\csarg\ifx{#2}\default\switch@exit #3 \@fi + #1#2\switch@exit #3 \@fi + \cswitch #1 in: +} +% this version assumes that the test object can have an optional space +\def\bswitch #1 in: #2 #3; {\csarg\ifx{#2}\default\switch@exit #3 \@fi + #1#2 \switch@exit #3 \@fi + \bswitch #1 in: +} +% this version can cope with significant spaces at the start of #3; +% #2 is macro argument +\def\mswitch #1 in: #2:#3; {\csarg\ifx{#2}\default\switch@exit #3 \@fi + #1{#2}\switch@exit #3 \@fi + \mswitch #1 in: +} +% idem; #2 does not have to be enclosed in braces +\def\fswitch #1 in: #2:#3; {\csarg\ifx{#2}\default\switch@exit #3 \@fi + #1#2 \switch@exit #3 \@fi + \fswitch #1 in: +} + +% Routines for taking the value of a string: +% if the string is defined as control sequence +% take the value of that, otherwise take the string itself + +% String or value of control sequence +% +\def\w@w#1{\if\UndefinedCS{#1}#1\else \the\csname#1\endcsname\fi} + +% String or control sequence +% +\def\@ww#1{\if\UndefinedCS{#1}#1\else \csname#1\endcsname \fi} + +% String or \noexpand-ed control sequence; +% for use in \edef +% +\def\@w@w#1{\if\UndefinedCS{#1}#1\else + \ifin@label\noexpand\protect\fi \CSname{#1}\fi} +\newtoks\are@these@correct +\def\t@w@w#1{% + \if\UndefinedCS{#1}#1% + \ifdefining\append@to@list\are@these@correct{#1 }\fi + \else + \ifin@label\noexpand\protect\fi \CSname{#1}\fi} +% see below what happens to \are@these@correct + +% Allocation +% +\def\new@count#1#2{\csarg\newcount{#1}\global\set@value{#1}{#2}} +\def\new@skip#1#2{\csarg\newskip{#1}\global\set@value{#1}{#2}} +\def\new@dimen#1#2{\csarg\newdimen{#1}\global\set@value{#1}{#2}} + +% Assignment of Values +% +\def\set@value#1#2{\csname#1\endcsname #2\relax} +\def\increase@value#1#2{\advance\csname#1\endcsname #2\relax} +\def\decrease@value#1#2{\advance\csname#1\endcsname -#2\relax} + +% Hex +% +\def\hexdigit#1{\ifcase#10\or 1\or 2\or 3\or 4\or + 5\or 6\or 7\or 8\or 9\or A\or B\or C\or D\or E\or F\fi} + +% Log 10 +% +\def\LogTen#1{\switch{\ifnum#1<} + {10 }{1} {100 }{2} {1000 }{3} {10000 }{4} {default}{5} + \endswitch} + +% List Manipulation ................ +% this assumes that #1 is a list of tokens, #2 is the name of a list +% +% Names of lists (and of items to pop into) are given as strings; +% not as control sequences. +% +\newtoks\toks@lista \newtoks\toks@listb +% basic append/prepend macro +\long\def\@append@to@cslist#1#2#3{\begingroup\toks@lista=#2{#3}% + \global#1=\xp\xp\xp{\xp\the\xp#1\the\toks@lista}\endgroup} +\long\def\@prepend@to@cslist#1#2#3{\begingroup\toks@lista=#2{#3}% + \global#1=\xp\xp\xp{\xp\the\xp\toks@lista\the#1}\endgroup} +\def\@append@to@list{\csarg\@append@to@cslist} +% variations: +\long\def\append@to@list#1#2{\@append@to@list{#1}{}{#2}} +\def\append@list@to@list#1#2{% + \@append@to@list{#1}{\xp\xp\xp}{\xp\the\csn#2\ecs}} +\def\append@cslist@to@cslist#1#2{% + \@append@to@cslist{#1}\xp{\the#2}} +\def\append@toks@cs@to@list#1#2{\@append@to@list{#1}\xp{\the#2}} + +% A few list macros for the user +\def\NewList:#1 {\csarg\newtoks{#1}\global\csn#1\ecs{}} +\def\EmptyList:#1 {\global\csn#1\ecs{}} +\long\def\AppendToList:#1=#2 {\@append@to@list{#1}{}{#2}} +\def\TheList:#1 {\let\oldwbuskip\willbeunhskip \let\willbeunhskip\@empty + \if\UndefinedCS{#1}\message{List <#1> undefined} + \else\csarg\the{#1}\fi + \let\willbeunhskip\oldwbuskip} + +\def\del@tok@from@list#1#2{\begingroup + \long\def\cs@liste##1#2##2\tok@SM + {\toks@lista{##1}\toks@listb{##2}% + \edef\cs@listb{\global\CSname{#1}= + {\the\toks@lista\the\toks@listb}}% + \cs@listb}% + \edef\cs@lista{\nxp\cs@liste{}\xp\the\csn#1\ecs\nxp\tok@SM}% + \cs@lista \endgroup} +\def\in@front@of@list#1{\csarg{\let\xp\cs@lista}{#1}% + \in@front@of@cslist\cs@lista} +\long\def\in@front@of@cslist#1#2{\begingroup\toks@lista={#2}% + \global#1=\xp\xp\xp{\xp\the\xp\toks@lista \the#1}% + \endgroup} +\long\def\local@in@front@of@list#1#2{\toks@lista={#2}% + \csname#1\endcsname\xp\xp\xp\xp\xp\xp\xp + {\xp\xp\xp\the\xp\xp\xp\toks@lista + \xp\the\csname#1\endcsname}% + } +\def\set@list#1{\csarg{\let\xp\cs@lista}{#1}% + \set@cslist\cs@lista} +\long\def\set@cslist#1#2{\begingroup\toks@lista={#2}% + \global#1=\xp{\the\toks@lista}\endgroup} + +%%%%%%%%%%%%%%%% Stack macros +% +% push in terms of prepending of lists +\def\push@cs@onto@cs#1#2{\@prepend@to@cslist#1\xp{\xp\\\xp{\the#2}}} +\def\push@onto#1{\csarg\push@onto@cs{#1}} +\def\push@onto@cs#1#2{\@prepend@to@cslist#1{}{\\{#2}}} +\def\local@push@onto#1#2{\let\\=\relax + \local@in@front@of@list{#1}{\\{#2}}} +% pop via auxiliary macro: #1 is result, #2 is stack +% two cs arguments +\def\pop@cs@into#1#2{\edef\cs@e + {\nxp\@@popinto\nxp#1\nxp#2\the#2\nxp\@@pop}\cs@e} +% two string arguments +\def\pop@into#1#2{\edef\cs@e + {\nxp\@@popinto\CSname{#1}\CSname{#2}\csarg\the{#2}\nxp\@@pop}\cs@e} +\long\def\@@popinto#1#2\\#3#4\@@pop{#1{#3}#2{#4}} +\def\copy@stacktop#1#2{% + \edef\cs@e{\noexpand\@copy@stacktop + {#1}\csarg\the{#2}\noexpand\@@pop}% + \cs@e} +\def\@copy@stacktop#1\\#2#3\@@pop{\csname#1\endcsname#2\relax} +\newcount\stack@length \newtoks\empty@stack \empty@stack{\\{}} +\def\length@of@stack#1{\csarg\length@of@csstack{#1}} +\def\length@of@csstack#1{\def\\##1{\advance\stack@length\@ne}% + \stack@length\m@ne \the#1} +% turn a stack upside down +\def\invert@csstack#1{\length@of@csstack{#1}% + \tempcountb\z@ \temptoksa\empty@stack + \loop\ifnum\tempcountb<\stack@length + \pop@cs@into\temptoksb#1\advance\stack@length\m@ne + \push@cs@onto@cs\temptoksa\temptoksb +% \append@cslist@to@cslist\temptoksb\temptoksa% append a to b +% \temptoksa\temptoksb + \repeat% copy b to a + #1\temptoksa \temptoksa\empty@toks} +% invert a stack into a list +\def\x@stack@to@list#1{\length@of@stack{#1}% + \tempcountb\z@ \temptoksa\empty@toks + \loop\ifnum\tempcountb<\stack@length + \pop@into{temptoksb}{#1}\advance\stack@length\m@ne + \append@list@to@list{temptoksb}{temptoksa}\repeat + \csn#1\ecs\temptoksa \temptoksa\empty@toks} + + +% Bookkeeping and Householding lists................ +% Generic Defaults +% to be executed each time a definition starts +% +\ifini{\newtoks\generic@defaults} +\def\adds@generic@default#1{ + \append@to@list{generic@defaults}{#1}} +\def\add@generic@default#1{\ifini + {\append@to@list{generic@defaults}{#1}}} + +% Document Start Commands +% to be executed by \Start +% +\ifini{\newtoks\start@commands} +\def\add@start@command#1{\ifini + {\append@to@list{start@commands}{#1}}} +\def\adds@start@command#1{% + \append@to@list{start@commands}{#1}} + +% Document Stop Commands +% to be executed by \Stop +% +\ifini{\newtoks\stop@commands} +\def\add@stop@command#1{\ifini + {\append@to@list{stop@commands}{#1}}} +\def\adds@stop@command#1{% + \append@to@list{stop@commands}{#1}} + +% Style Start Commands +% to be executed by \StyleDefinition +% +\ifini{\newtoks\style@start@commands} +\def\add@style@start@command#1{\ifini + {\append@to@list{style@start@commands}{#1}}} + +% Style Stop Commands +% to be executed by \StyleDefinitionStop +% +\ifini{\newtoks\style@stop@commands} +\def\add@style@stop@command#1{\ifini + {\append@to@list{style@stop@commands}{#1}}} +\add@style@stop@command{\style@stop@commands{} + \style@start@commands{}} + +\def\check@existence#1{\Wmessage{Used \nxp\check@existence. Check}} +% \add@style@stop@command{\if\UndefinedCS{#1}\Wmessage +% {Some trouble involving #1; check definitions carefully!}\fi} + +%\add@style@start@command{\are@these@correct{}} +%\add@style@stop@command{\if\IsEmptyList{\the\are@these@correct}\else +% \Wmessage{Check if the following are literals: \the\are@these@correct} +% \fi} + +% Tracing +% +% if trace@all=0 and \trace@foo is >0, every \Tmessage[foo] is written. +% if \Trace:no, then all trace is disabled through \trace@all=-1 +% if \Trace:yes then all traces are written through \trace@all=1 +% by default: \trace@all=0 +% +\def\Tmessage{\ifnum\trace@all>\m@ne\xp\t@message\else\xp\del@message\fi} +\def\del@message[#1]#2{}\let\trace@prefix\@empty +\def\t@message[#1]#2{% + \ifnum\trace@all>\z@ \def\trace@prefix{[T]}\@meld{#2}% + \else\csarg\ifnum{trace@#1}>\z@ + \def\trace@prefix{[T:#1]}\@meld{#2}\fi + \fi\global\let\trace@prefix\@empty} + +\def\Trace:#1 {\switch{\if\EqualString{#1}} + {yes} {\trace@all\@ne\message{Switching ON all tracing}} + {no} {\trace@all\m@ne\message{Switching OFF all tracing}} + {default} {\if\UndefinedCS{trace@#1}\Wmessage{Strange trace: #1}\else + \csname trace@#1\endcsname\@ne \trace@all\z@ \fi} + \endswitch} +\def\NewTrace:#1 {\new@count{trace@#1}\m@ne} +\new@count{trace@all}\z@ +\NewTrace:gen % traces everything in this file +\NewTrace:def % definitions of constructs etc + +%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%% +%%%%%%%%%%%%%%%%%% Generic Constructs %%%%%%%%%%%%%%%%%%%%% + +% \@GenericConstruct{Foo} = +% \newtoks\Foo@defaults +% \Foo@defaults={} +% \def\add@Foo@default#1{...} +% \def\DefineFoo#1 = +% \@FooDefaults % has to be defined explicitly +% \the\Foo@defaults % constructed cumulatively +% \@GenericDefaults % constructed cumulatively +% \@GetOptions +% \@DefineFoo % has to be defined explicitly +% \def\@FooOption ... % same syntax as \@GenericOption +% +% Options are either generic (the ones below) +% defined by \@GenericOption, +% or specific for some construct, +% defined by \@FooOption +% +\ifini{\newtoks\@gencons} +\newif\ifdefining@a@construct +\def\@GenericConstruct#1{ + \ifini{\append@to@list{@gencons}{\\#1;} + \csarg\newtoks{#1@defaults} + \csn #1@defaults\ecs{}} + \csarg\def{add@#1@default}##1{\ifini + {\append@to@list{#1@defaults}{##1}}} + \csarg\def{adds@#1@default}##1{\append@to@list{#1@defaults}{##1}} + \Install@Noops{#1} + \csarg\def{Define#1}:##1 {\defining@a@constructyes + \def\@name{##1}\def\@class{#1} + \Tmessage[def]{Defining a #1: ##1} + \the\generic@defaults + \csarg\the{#1@defaults} + \Get@Items} + \csarg\def{@#1Option}##1{\csarg\def{#1@##1}####1####2} + } +\add@generic@default{\let\pre@fix\@empty} +\def\@command{\ifx\pre@fix\@empty\else\pre@fix @\fi\@name} +\def\stop@command@suffix{Stop} +\def\stop@command{\@command\stop@command@suffix} +\def\@DefineStopCommand{\csarg\edef{\stop@command}} + +%%%% Abbreviated Closing: +% every group defines its own \default@stop@command; +% on the outer level this is an error msg. +% \> closes whatever is open, \>] closes everything that is open. +\def\outer@stop@command{\Emessage{Vacuous group closing}} +\let\default@stop@command\outer@stop@command +\def\>{\default@stop@command%[fool the editor + \ifNextChar]{\ifx\default@stop@command\outer@stop@command + \xp\take@one + \else \xp\>\fi}{}} +\newif\if@implicitclose +\add@generic@default{\@implicitcloseyes} +% the next line replicated below +%\@GenericOption{noimplicitclose}{\@implicitcloseno} +\def\install@stop{\if@implicitclose + \def\nxp\default@stop@command{\CSname{\stop@command}}% + \else \let\nxp\default@stop@command\nxp\outer@stop@command + \fi} + +%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%% +%%%%%%%%%%%%%%%% Here is the main +%%%%%%%%%%%%%%%% I T E M A N A L Y S I S +%%%%%%%%%%%%%%%% loop +%%%% + +% This macro is recursive, but with some detours. +% first filter out empty arguments +% +\def\Get@Items#1 {\if\IsEmptyList{#1}\let\get@next@item\Get@Items + \else\def\get@next@item{\@Get@Items#1 }\fi + \get@next@item} + +% Check if the argument is `Stop', in which case you +% have reached the end of a generic definition. +% Otherwise filter the special case of a colon, and process an item +% +\NewDummy{Stop} +\def\@Get@Items#1 {\let\get@next@item=\Get@Items + \csarg\ifx{#1}\Stop + \the\generic@stop@defaults + \let\get@next@item=\relax + \else \if\EqualString{#1}{:}\@add@toks{:} + \else \Item@or@Macro#1::. \fi + \fi \get@next@item} + +% Default actions to be executed when GetItems has finished +% +\def\add@generic@stop@default#1{\ifini + {\append@to@list{generic@stop@defaults}{#1}}} +\ifini{\newtoks\generic@stop@defaults} +\add@generic@stop@default{\csname @Define\@class\endcsname} + +% Now check successive possibilities: +% first it can be a macro. +% +\def\OptionsMacro:#1=#2Stop {\global\csarg\def{opt@mac@#1}{#2}} +\def\split@at@is#1=#2=#3.{{#1}{#2}} +\def\Item@or@Macro#1:#2:#3.{ + \switch {\if\EqualString{#1}} + {macro} {\if\UndefinedCS{opt@mac@#2} + \Wmessage{Unknown macro: `#2'} + \else \edef\get@next@item{\nxp\Get@Items \csn opt@mac@#2\ecs } + \fi} + {default} {\edef\cs@e{\nxp\Option@Item{#1}\split@at@is#2==.} + \cs@e} + \endswitch} + +% The option #1 is not a Lollipop style macro. It can be +% - a specific option +% - a generic option +% - a character +% - a defined control sequence +% +% Is it an option of some sort? +% +\def\Option@Item#1#2#3{ + \if\UndefinedCS{\@class @#1} + \if\UndefinedCS{\gen@option@name{#1}} + \Character@CS@Item{#1}{#2}{#3} + \else \if\EqualString{#2}{title} + \edef\cs@e{\CSname{\gen@option@name{#1}}\CSname{#3Title}} + \cs@e + \else \csn \gen@option@name{#1}\ecs{#2}{#3} + \fi + \Tmessage[gen]{Generic option `#1' for `\@class': + `#2' = `#3'} + \fi + \else \if\EqualString{#2}{title} + \edef\cs@e{\CSname{\@class @#1}\CSname{#3Title}} + \cs@e + \else \csn \@class @#1\ecs{#2}{#3} + \fi + \Tmessage[gen]{Specific option `#1' for `\@class': `#2'} + \fi} + +% If it is not an option, is it a character or control sequence? +% +% Commands are either `\Command', `\Command:arg', `\Command:arg1=arg2' +% See what arguments are nonempty in order to attach them; +% in case 2 and 3 append space token. +% +\def\Character@CS@Item#1#2#3{ + \def\cs@b{#1}\def\cs@c##1##2<<<{\def\cs@c{##1}}\cs@c#1<<< + \ifx\cs@b\cs@c \@add@toks{#1} + \Tmessage[gen]{Single character `#1' for `\@class'} + \else + \if\UndefinedCS{#1} + \Wmessage{Unknown option for `\@class': `#1' in `\@name'.} + \@add@toks{\csn#1\ecs} + \else + \cs@in@ref@protect{#1}% + \edef\cs@e{\nxp\@add@toks{\CSname{#1}}}\cs@e + \fi + \if\IsEmptyList{#2} + \else \if\IsEmptyList{#3}\@add@toks{:#2 } + \else + \if\EqualString{#2}{title} + \edef\cs@e{\nxp\@add@toks{:\CSname{#3Title} }} + \cs@e + \else \@add@toks{:#2={#3} } + \fi + \fi + \fi + \Tmessage[gen]{Command `#1' (#2,#3)} + \fi} + + + +%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%% +%%%% G E N E R I C O P T I O N S +%%%% +% +% All generic constructs get these options. +% They are at liberty to redefine them. +% +\newtoks\@GenericOptions +\def\gen@option@name#1{Option@#1} +\def\@GenericOption#1{ + \append@to@list{@GenericOptions}{\\#1;} + \csarg\def{\gen@option@name{#1}}##1##2} +\def\Noop@Error#1#2{\Emessage{Option #2 is not allowed for class #1}} + +\def\Install@Noops#1{ + \csarg\def{@#1NOOP}##1{\csarg\def{#1@##1}{\Noop@Error{#1}{##1}}} + } +\newtoks\@main@options@list +\newtoks\before@coms \newtoks\after@coms +\add@generic@default + {\def\@current@options@list{@main@options@list}% + \@main@options@list{} + \before@coms{} \after@coms{}} +\long\def\@add@toks#1{\append@to@list{\@current@options@list}{#1}} +\def\toks@add@toks#1{ + \edef\cs@e{\nxp\append@to@list + {\nxp\@current@options@list}{\xp\the\csn#1\ecs}} + \cs@e \let\cs@e\relax} +\def\switch@to@options@list#1{\def\@current@options@list{#1}} +\def\temp@options@list#1{ + \xdef\saved@options@list{\@current@options@list} + \def\@current@options@list{#1}} +\def\revert@options@list{ + \xdef\@current@options@list{\saved@options@list} + \global\let\saved@options@list\@empty} + +\newtoks\z@toks \z@toks={0pt} + +% the next line should be higher, +% but \@GenericOption wasn't defined yet there +\@GenericOption{noimplicitclose}{\@implicitcloseno} + +%%%%%%%%%%%%%%%% Universal textblock +% +% These macros will only be used inside an \edef. +% They are meant for text blocks, but the \outer@start@commands +% are also necessary for output routines, hence the test +% if this is a text-like construct. +% +\newif\iftext@construct +\add@generic@default{\text@constructyes} + +% Level of nesting +% +\newcount\nest@depth + +% Open command +% +\def\@gen@open{\outer@start@commands + \begingroup \inner@start@commands} + +\def\outer@start@commands{% + \iftext@construct + \ifleft@embedded@construct \install@h@before@penalty + \else \nxp\leavehmode \nxp\v@buffer{\the\@whitebefore}% + % backspace previous white space while it's visible + \nxp\if@headed\nxp\else\install@v@before@penalty + \nxp\fi + \fi \fi + \ifhas@counter \nxp\StepCounter:\expandafter\@name\@space + % This sets the \current@label by default + \ifhas@marks + \edef\nxp\cs@e{\nxp\nxp\nxp\refresh@mark@item + {\@name Counter}{\CSname{\@name Counter}}}% + \nxp\cs@e + \fi + \fi + \iflabel@defined + \global\current@label={\the\@labelcoms}\fi + \ifhas@title \install@title@code + % subtle: the title has to be installed after any page break + % otherwise footlines may contain the wrong title. + % also the title has to be global. + \fi + \ifhas@marks\nxp\ifnin{\nxp\place@mark}\fi + %otherwise IniTeX'ing Lollipop will output a page + \nxp\xx@label\the\extern@toks\penalty\@M + % also subtle: if this white space would be higher, it would + % be invisible because of marks et cetera. + % insert nobreak after marks/writes to prevent page breaks. + \iftext@construct + \ifleft@embedded@construct + \else \nxp\@vwhite{\the\@whitebefore}\fi + \fi + } +\def\inner@start@commands{% + \nxp\Open@Group\CSname{\@class}\CSname{\@name}% + \install@stop + \ifleft@embedded@construct + \else \nxp\hold@parskip + \nxp\default@everypar + \ifwhiteleft@defined + \advance@skip\leftskip{\the\@whiteleft}\fi + \ifwhiteright@defined + \advance@skip\rightskip{\the\@whiteright}\fi + \nxp\let\nxp\par=\nxp\@par %explain to me again why this is necessary... + \inside@indent \first@indent + \fi + \advance\nest@depth\@ne + } + +\def\@gen@close{\inner@end@commands \endgroup \outer@end@commands} +\def\inner@end@commands{% + \nxp\Close@Group\CSname{\@class}\CSname{\@name}% + \the\late@extern@toks + \ifright@embedded@construct \install@h@after@penalty + \else \nxp\leavehmode \install@v@after@penalty + \nxp\@vwhite{\the\@whiteafter}\fi + } +\def\outer@end@commands{% + \the\after@toks + \ifright@embedded@construct \nxp\@headedno + \else \after@indent \nxp\dono@parskip + \fi} +\let\esp@hack\relax +\def\bsp@hack{\let\esp@hack\relax + \ifhmode\ifdim\lastskip>\z@\let\esp@hack\ignorespaces\fi\fi} + +%%%%%%%%%%%%%%%% Breaking + +% Constructs such as 'line' or 'rule' introduce breakpoints. +% Here's how we deal with that. The \ifat@breakpoint test is set +% by options such as 'line' or 'vwhite'. Similarly, these options +% test for this condition and if necessary protect. +% After 'text' in a text block the condition is set too. +\newif\ifat@breakpoint +\add@generic@default{\at@breakpointno} +\def\protect@breakpoint{\ifat@breakpoint\@add@toks{\nobreak}\fi} + +% Break Before +% user specifies yes/no, numeric value, or name of value +% yes also does a fill +% default: place zero penalty +% +\newif\ifdefault@break@before +\adds@generic@default{\default@break@beforeyes} +\@GenericOption{breakbefore}{\default@break@beforeno + \switch {\if\EqualString{#1}} + {no} {\def\@beforepenalty{\penalty\@M }} + {yes} {\def\@beforepenalty{\CSname{\h@or@v fil}\penalty-\@M}} + {0} {\def\@beforepenalty{}} + {default} + {\edef\cs@e{\def\nxp\@beforepenalty + {\penalty\@w@w{#1}\relax}} + \cs@e} + \endswitch} +\def\install@v@before@penalty + {\ifdefault@break@before\penalty\z@ + \else\nxp\ifnum\lastpenalty=\z@\@beforepenalty\nxp\fi + \fi} +\def\install@h@before@penalty + {\ifdefault@break@before + \else\nxp\ifnum\lastpenalty=\z@\@beforepenalty\nxp\fi + \fi} + +% Break After +% same story +% +\newif\ifdefault@break@after +\adds@generic@default{\default@break@afteryes}% Heading overrides +\@GenericOption{breakafter}{\default@break@afterno + \switch {\if\EqualString{#1}} + {no} {\def\@afterpenalty{\penalty\@M }} + {yes} {\def\@afterpenalty{\CSname{\h@or@v fil}\penalty-\@M}} + {0} {\def\@afterpenalty{}} + {default} + {\edef\cs@e{\def\nxp\@afterpenalty + {\penalty\@w@w{#1}\relax}} + \cs@e} + \endswitch} +\def\install@v@after@penalty + {\ifdefault@break@after\penalty\z@ \else\@afterpenalty \fi} +\def\install@h@after@penalty + {\ifdefault@break@after \else\@afterpenalty \fi} + +%%%%%%%%%%%%%%%% Surrounding White Space +% WhiteBefore +% amount is put in token list \@whitebefore, +% the \@define... macro uses this to its own discretion +% For the three text construct this happens in the general macros +% In ExternalItem a different default is used +% +\ifini{\newtoks\@whitebefore \newskip\whitebefore} +\add@generic@default{\@whitebefore={whitebefore}} +\whitebefore=6pt plus 6pt\relax +\@GenericOption{whitebefore}{ +% \edef\cs@e{\@whitebefore={\@w@w{#1}}}\cs@e} + \@whitebefore={#1}} + +% WhiteAfter +% same story with \@whiteafter +% +\ifini{\newtoks\@whiteafter \newskip\whiteafter} +\add@generic@default{\@whiteafter={whiteafter}} +\whiteafter=6pt\relax +\@GenericOption{whiteafter}{ +% \edef\cs@e{\@whiteafter={\@w@w{#1}}}\cs@e} + \@whiteafter={#1}} + +% WhiteLeft +% same story with \@whiteleft +% +\ifini{\newtoks\@whiteleft} +\newif\ifwhiteleft@defined +\add@generic@default{\@whiteleft\z@toks \whiteleft@definedno} +\@GenericOption{whiteleft}{ +% \edef\cs@e{\nxp\@whiteleft={\@w@w{#1}}}\cs@e + \@whiteleft={#1} + \whiteleft@definedyes} + +% WhiteRight +% same story with \@whiteright +% +\ifini{\newtoks\@whiteright} +\newif\ifwhiteright@defined +\add@generic@default{\@whiteright\z@toks \whiteright@definedno} +\@GenericOption{whiteright}{ + \edef\cs@e{\nxp\@whiteright={\@w@w{#1}}}\cs@e + \whiteright@definedyes} + +%%%%%%%%%%%%%%%% Group Bookkeeping +\def\@@nulklasse{????}\def\@@nulnaam{????} +\let\@@groepklasse=\@@nulklasse \let\@Group@Name=\@@nulnaam + +% Grouping level during definition +% +\new@@counter{group} +\add@generic@default{\start@counter{group}} +\add@generic@stop@default{\if\TestCounter:group >0 + \Emessage{There are groups open in <\@name>}\fi} + +\add@generic@default{\def\current@def@group{>>OUTER LEVEL<<}} +\def\b@group{\edef\@outer@options@list{\@current@options@list} + \bgroup\step@counter{group} + \ifnextchar[\def@def@group{}%] + } +\def\def@def@group[#1]{\def\current@def@group{#1}} +\def\e@group{\ifnextchar[\test@def@group\egroup%] + } +\def\test@def@group[#1]{\def\current@test@group{#1} + \ifx\current@def@group\current@test@group\egroup + \else\Emessage{Closing `\current@def@group' with `\current@test@group' + in \@class: \@name} + \fi} + + +% Grouping during execution +% +\def\@@testklasse{OUTER}\def\@@testnaam{OUTER} +\def\@DEFgroepsluit{\nxp\Close@Group{\@class}{\@name}} +\def\@groepERR#1#2{\Wmessage{Unexpected close of + <\expandafter\string#1; expected: \expandafter\string#2.}} +\newcount\group@open@lineno +\def\Open@Group#1#2{\def\@@groepklasse{#1}\def\@Group@Name{#2}% + \Tmessage[gen]{Open \string#1\@space \string#2 @ \the\inputlineno} + \group@open@lineno\inputlineno} +\def\Close@Group#1#2{\def\@@testklasse{#1}\def\@@testnaam{#2}% + \ifx\@@testnaam\@Group@Name + \Tmessage[gen]{Close \string#1\@space \string#2}% + \else \@groepERR{\@@testnaam}{\@Group@Name}\fi} +\def\Close@all@groups + {\ifx\@Group@Name\@@nulnaam + \else \Wmessage{Group not closed: \expandafter\string\@Group@Name; + start @\the\group@open@lineno} + \endgroup + \Close@all@groups + \fi} + +\def\@groeptester{\ifx\@Group@Name\@@nulnaam + \else \Wmessage{Group still open: \expandafter\string\@Group@Name}\fi} + +%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%% +%%%%%%%%%%%% Counters + +% Counter name +% has been abstracted. +% this may be removed later for efficiency. +% +%\def\counter@name#1{#1@C}%defined above +\def\cs@counter@name#1{\csn#1@C\ecs} +\def\counter@@name#1{\CSname{#1@C}} +\def\counter@value#1{\xp\the\csn#1@C\ecs} + +% +% \NewCounter:COUNTER +% \newcount\COUNTER@C +% \CounterRepresentation:COUNTER=1 ; print arabic numeral +% \StartCounter:COUNTER ; set to 0 +% \COUNTER@RL={} ; create reset list +% +% \CounterRepresentation:THING=W +% if W is another counter, make synonym, otherwise +% \THING@R <- representation command +% \THINGCounter = \THING@R \THING@C +% #1 = naam van een nieuw te definieren teller; +% #2 = telwijze of naam van teller waar de nieuwe teller synoniem +% mee moet worden. +% +\def\NewCounter:#1 {\new@counter{#1}} +\def\new@counter#1{ + \new@@counter{#1}\csarg\edef{#1Value}{\counter@@name{#1}} + \CounterRepresentation:{#1}=1 + \StartCounter:{#1} + } +% given above +%\def\new@@counter#1{\csarg\newcount{\counter@name{#1}}} +\def\AdaptiveCounter:#1 + {\if\UndefinedCS{\counter@name{#1}}\new@counter{#1}\fi + \adds@stop@command + {\ifWriteExtern\immediate\write\aux@file + {\string\SetCounter:#1={\counter@value{#1}}} \fi + }} + +% Counter allocation in the generic constructs +% counter:x +% indicates the mode of representation of the counter +% of the construct being defined. The counter is first allocated. +% A switch is thrown that will generate automatic step instructions. +% +\newif\ifhas@counter +\@GenericOption{HasCounter}{ + \switch {\if\EqualString{#1}} + {yes} {\has@counteryes\has@labelyes + \if\IsEmptyList{#2}\else\def\this@counter@repr{#2}\fi} + {no} {\has@counterno} + {default} {\has@counteryes} + \endswitch} +\@GenericOption{counter}{ + \ifin@label \edef\cs@e{\nxp\@add@toks{\CSname{\@name Counter}}} + \cs@e + \else\has@counteryes\has@labelyes \def\this@counter@repr{#1} + \fi} +\def\install@counter#1{\new@counter{\@name}% + \ifhas@marks\xp\add@mark@item\xp{\@name Counter}\fi + \if\IsEmptyList{#1}\else\CounterRepresentation:\@name=#1 \fi + } + +% Counter-related defaults: initially there is no counter, +% if a counter starts it counts Arabic unless otherwise indicated, +% and the countername associated with this construct is +% made available as an option; +% later it will be a command, and the option is removed again. +% +\add@generic@default{\has@counterno\has@labelno + \def\this@counter@repr{1} + \csarg\def{\gen@option@name{\@name Counter}}{% + \edef\cs@e{\nxp\@add@toks{%\nxp\cprotect + \CSname{\@name Counter}}}\cs@e + \global\has@counteryes\global\has@labelyes}} +\add@generic@stop@default + {\csarg\let{\gen@option@name{\@name Counter}}\relax} +\add@generic@stop@default{\ifhas@counter + \xp\install@counter\xp{\this@counter@repr}\fi} + +%titles are handled below but the actions have to be +%in this order. +\add@generic@stop@default + {\ifhas@title \ifshort@title \@sTitelize\@command + \else \@Titelize{\@command} + \fi\fi} +\add@generic@stop@default{\ifhas@label \@Labelize{\@command}\fi} + + +%%%%%%%%%%%%%%%% Counter Representaton +% main use: indicate representation of numerical value of counter +% control sequence \FooCounter <- Foo@R\Foo@C +% two-step approach necessary because of symbolic reference: +% not all representations work purely by expansion. +% + +% 1 arabic, i lowercase roman, I uppercase roman +% a lowercase character, A uppercase Character +% +\def\@arabic#1{\number#1 } +\def\@lcascii#1{{\tempcounta=#1\relax \advance\tempcounta by 96 + \char\tempcounta\relax}} +\def\@ucascii#1{{\tempcounta=#1\relax \advance\tempcounta by 64 + \char\tempcounta\relax}} +\def\@roman#1{\romannumeral#1 } +\def\@Roman#1{\uppercase\expandafter{\romannumeral#1}} + +% Representation has been abstracted +% +\def\counter@repr#1{#1@R} + +% Give the representing control sequence (@roman, ...) +% inside an \edef +% +\def\counter@@repr#1{\xp\xp\xp\string\csname#1@R\endcsname} + +% Counter Representation (user command) +% decides if this is a real representation command, +% or a synonym declaration +% +\def\CounterRepresentation:#1=#2 { + \if\UndefinedCS{\counter@name{#2}}%is this counter a synonym? + \represent@counter{#1}{#2} + \else \@SynonymCounter{#1}{#2} + \fi} +\def\represent@counter#1#2{ + \edef\cs@e{@\if#2iroman\else + \if#2IRoman\else \if#2alcascii\else + \if#2Aucascii\else arabic\fi\fi\fi\fi} +% \csarg\xdef{\counter@repr{#1}}{\CSname{\cs@e}} + \csarg\edef{\counter@repr{#1}}{\CSname{\cs@e}} + \csarg\xdef{#1Counter}{\nxp\cprotect %\xp\string when writing label out + \CSname{\counter@repr{#1}}{\nxp\number\counter@@name{#1}}} + } +\def\cprotect{} + +\def\PrintCounter:#1 {\csn#1Counter\ecs} + +% Synonym Counters +% share the \FooCounter command, internal name, and reset list +% +\def\@SynonymCounter#1#2{ + \edef\cs@b{\nxp\let\counter@@name{#1}=\counter@@name{#2} + \nxp\let\CSname{#1Counter}=\CSname{#2Counter} + \nxp\let\CSname{#1@RL}=\CSname{#2@RL}} + \cs@b + } + +% Synonym as generic option +% sharecounter:xyz +% Don't allocate a counter, but share the counter of the +% 'xyz' construct. +% +\@GenericOption{sharecounter}{\CounterRepresentation:\@name=#1 } + +% Governing counters +% If a counter governs another counter, the other is reset +% whenever the first is altered. +% +\def\GoverningCounter:#1=#2 {\tempano + \if\UndefinedCS{\counter@name{#1}} + \Wmessage{No such counter <#1>} + \else\if\UndefinedCS{\counter@name{#2}} + \Wmessage{No such counter <#2>} + \else\tempayes + \fi\fi + \iftempa\if\UndefinedCS{#2@RL}\csarg\newtoks{#2@RL} + \csn #2@RL\ecs={}\fi + \append@to@list{#2@RL}{\\#1;} + \fi} +\def\reset@subordinates#1{\if\UndefinedCS{#1@RL}\else + \def\\##1;{\start@counter{##1}}% + \the\csname #1@RL\endcsname \let\\=\relax + \fi} + +% User counter manipulation +% should be global, and should reset subordinate counters +% and define references. +% +\def\StartCounter:#1 {\handle@user@counter{#1}{start}{}} +\let\ResetCounter\StartCounter +\def\StepCounter:#1 {\handle@user@counter{#1}{step}{}} +\def\AddToCounter:#1=#2 {\handle@user@counter{#1}{addto}{#2}} +\def\BackStepCounter:#1 {\handle@user@counter{#1}{back@step}{}} +\def\SetCounter:#1=#2 {\handle@user@counter{#1}{set}{#2}} +\def\handle@user@counter#1#2#3{\if\UndefinedCS{\counter@name{#1}} + \Wmessage{Unknown counter: #1} + \else \begingroup\globaldefs\@ne + \csn#2@counter\ecs{#1}{#3}% + \reset@subordinates{#1}\define@reference{#1}% + \endgroup + \fi} + +% Numeric manipulation +% +\def\CounterValue:#1 {% + \if\UndefinedCS{\counter@name{#1}}0 + \else \cs@counter@name{#1}\fi + } +\def\TestCounter:#1 {00\fi\ifnum\cs@counter@name{#1}} + +% Internal counter manipulation +% is local and has no side effects +% +\def\step@counter#1{\increase@value{\counter@name{#1}}\@ne} +\def\addto@counter#1#2{\edef\cs@e + {\nxp\increase@value{\nxp\counter@name{#1}}{\w@w{#2}}}\cs@e} +\def\back@step@counter#1{\increase@value{\counter@name{#1}}\m@ne} +\def\start@counter#1{\set@value{\counter@name{#1}}\z@} +\def\set@counter#1#2{\edef\cs@e + {\nxp\set@value{\nxp\counter@name{#1}}{\w@w{#2}}}\cs@e} + + +%%%%%%%%%%%%%%%% Title +% +% All constructs can have titles. +% By using the option 'title' the user indicates that +% this particular option has a title. +% A control sequence \constructTitle is defined. +% +% In case the \constructTitle is only used in a macro, +% the user has to set HasTitle:yes as an option. +% +\def\@@@title#1{#1Title}\def\@@title{\@@@title\@name} +\newif\ifhas@title\add@generic@default{\has@titleno} +\newif\ifshort@title\add@generic@default{\short@titleno} +\add@generic@stop@default % we cannot use @@title here! + {\ifhas@marks\ifhas@title\xp\add@mark@item\xp{\@name Title}\fi\fi} +\def\give@title{\global\has@titleyes + \global\csarg\let\@@title\@space + %to define it until first call + } +\@GenericOption{title}{\give@title + \ifin@external \if\IsEmptyList{#1} + \external@handle@title{\@name} + \else \external@handle@title{#1}\fi + \else \if\IsEmptyList{#1} + \edef\cs@e{\nxp\@add@toks{\CSname{\@@title}}}\cs@e + \else\Wmessage{Parametrized titles only in external}\fi + \fi + } +\@GenericOption{HasTitle}{ + \switch {\if\EqualString{#1}} + {yes} {\give@title} + {no} {\global\has@titleno} + {short} {\give@title \global\short@titleyes} + {default} {\give@title} + \endswitch + } + +% this code appears in \outer@start@commands; +% it will be executed in an \edef +% +\newtoks\title@toks +\def\install@title@code + {%\nxp\xp\gdef\nxp\xp\CSname{\@name Title}\nxp\xp{% + % \nxp\xp\nxp\maybe@uppercase\nxp\xp{\nxp\the\title@toks}}% + \nxp\xp\gdef\nxp\xp\CSname{\@name Title}\nxp\xp + {\nxp\the\title@toks}% + \ifhas@marks + \edef\nxp\cs@e{\nxp\nxp\nxp\refresh@mark@item + {\@name Title}{\nxp\the\title@toks}}% + \nxp\cs@e + \fi} + +% Give a macro a title +% +%\add@generic@stop@default{\ifhas@title \@Titelize{\@name}\fi} %above! +% +\newcount\extra@args \add@generic@default{\extra@args\z@} +\def\ttl@name#1{ttl@#1} +\def\@Titelize#1{\edef\cs@e{\let\CSname{\ttl@name{#1}}=\CSname{#1}}\cs@e + \ifcase\extra@args %0: + \csarg\edef{#1}##1\par + {\title@toks\nxp\xp{\nxp\id@##1\nxp\willbeunhskip}% +% {\title@toks{##1\nxp\protect\nxp\unhskip}% + \CSname{\ttl@name{#1}}} + \or %1: + \csarg\edef{#1}##1##2\par + {\title@toks\nxp\xp{\nxp\id@##2\nxp\willbeunhskip}% +% {\title@toks{##2\nxp\protect\nxp\unhskip}% + \CSname{\ttl@name{#1}}{##1}} + \or %2: + \csarg\edef{#1}##1##2##3\par + {\title@toks\nxp\xp{\nxp\id@##3\nxp\willbeunhskip}% +% {\title@toks{##3\nxp\protect\nxp\unhskip}% + \CSname{\ttl@name{#1}}{##1}{##2}} + \else \Wmessage{Sorry, too many extra arguments % + for `\@class' : `\@name'} + \fi} +\begingroup\catcode`\^^M\active \endlinechar-1\relax% +% trick: with an active ^^M we can let it expand to \@space +% not a 100\% solution, true. +\gdef\@sTitelize#1{ + \edef\cs@e{\let\CSname{x@\ttl@name{#1}}=\CSname{#1}}\cs@e + \csarg\edef{#1}{\begingroup\endlinechar`\nxp\^^M + \catcode\endlinechar\active\CSname{\ttl@name{#1}}} +% short titles can have no unwanted trailing space + \ifcase\extra@args %0: + \csarg\edef{\ttl@name{#1}}##1^^M + {\endgroup\let\nxp^^M\nxp\@space + \title@toks\nxp\xp{\nxp\id@##1}% +% \title@toks{##1\nxp\protect\nxp\unhskip}% + \CSname{x@\ttl@name{#1}}} + \or %1: + \csarg\edef{\ttl@name{#1}}##1##2^^M + {\endgroup\let\nxp^^M\nxp\@space + \title@toks\nxp\xp{\nxp\id@##2}% +% \title@toks{##2\nxp\protect\nxp\unhskip}% + \CSname{x@\ttl@name{#1}}{##1}} + \or %2: + \csarg\edef{\ttl@name{#1}}##1##2##3^^M + {\endgroup\let\nxp^^M\nxp\@space + \title@toks\nxp\xp{\nxp\id@##3}% +% \title@toks{##3\nxp\protect\nxp\unhskip}% + \CSname{x@\ttl@name{#1}}{##1}{##2}} + \else \Wmessage{Sorry, too many extra arguments % + for `\@class' : `\@name'} + \fi} +\endgroup + +% Uppercase titles are a big problem +% after \MakeUpperCase +% any appearing title (including when it comes out of a mark) +% is uppercased +% +\newif\ifUpperCasing \def\MakeUpperCase{\UpperCasingyes} +\def\maybe@uppercase{\ifUpperCasing\uppercase\xp\fi} + +%%%%%%%%%%%%%%%% M O D E S +% +% controls whether a construct can start/end as part of a paragraph. +% chooses between a lot of horizontal/vertical commands. +% +% this should appear as one of the first options. +% maybe generate an error msg if it doesn't +% +\newif\ifleft@embedded@construct +\newif\ifright@embedded@construct +\add@generic@default{\left@embedded@constructno\right@embedded@constructno} +\newif\if@hmode \newif\if@vmode +\add@generic@default{\@hmodeno\@vmodeyes} +\@GenericOption{embedded}{\switch {\if\EqualString{#1}} + {yes} {\left@embedded@constructyes\right@embedded@constructyes} + {no} {\left@embedded@constructno \right@embedded@constructno} + {left} {\left@embedded@constructyes\right@embedded@constructno} + {right} {\left@embedded@constructno \right@embedded@constructyes} + {default} {\Wmessage{Strange modifier: `embedded:#1'}} + \endswitch + \ifleft@embedded@construct \@hmodeyes \@vmodeno \fi} + +% Mode dependent +% +\def\h@or@v{\ifleft@embedded@construct h\else v\fi} +\def\append@no@hv@break + {\edef\cs@e{\nxp\@add@toks{%\if@hmode \if@vmode\else\nxp\leavevmode\fi\fi + %\if@vmode \if@hmode\else\nxp\leavehmode\fi\fi + \nxp\nobreak}} + \cs@e} + +%%%%%%%%%%%%%%%% Boxes +% +% Line +% is a \hbox to \hsize +% mainly used to determine the width of stuff inside it. +% +\newif\ifin@line +\add@generic@default{\in@lineno} +\newcount\text@in@line \newtoks\line@toks \newbox\line@box +\def\rm@to@end@of@box{\everyvbox{}% + \setbox\tempboxa\vbox\bgroup + \aftergroup\rm@tmp@box} +\def\rm@tmp@box{\setbox\tempboxa\box\voidb@x\egroup} +\def\definitely@to@hsize{\def\maybe@to@hsize{ to\hsize}} +\@GenericOption{line}{ + \switch {\if\EqualString{#1}} + {start} {\protect@breakpoint + \b@group[line]\in@lineyes\line@toks{} + \temp@options@list{line@toks} + \@add@toks{\hbox \maybe@to@hsize\bgroup}\text@in@line\z@ + } + {stop} {\@add@toks{\hfil\egroup}\revert@options@list + \ifnum\text@in@line>\z@ + \edef\cs@e{\nxp\@add@toks + {\line@toks={\the\line@toks}}}\cs@e + \@add@toks{\begingroup\everyvbox{\rm@to@end@of@box}% + \let\maybe@to@hsize\relax + \setbox\line@box\the\line@toks + \tempdima\hsize\advance\tempdima-\wd\line@box + \everyvbox{}\definitely@to@hsize + \everyvbox{\hsize\tempdima}\the\line@toks + \endgroup} + \else \@add@toks{\definitely@to@hsize} + \toks@add@toks{line@toks} + \fi + \e@group[line]\at@breakpointyes} + {default} {\Wmessage{Strange modifier: `line:#1'}} + \endswitch} + +% Tekstkolom. Is een \vbox of \vtop. +% Openen met 'begin' 'ophangen', 'topregel' of 'voetregel', +% start,topregel : \vtop +% voetregel : \vbox +% ophangen : \vtop{\kern\z@ +% Eindigen met 'stop' +\@GenericOption{textcolumn}{ + \switch {\if\EqualString{#1}} + {stop} {\@add@toks{\egroup}\global\BlockWidth\hsize + \e@group[textcolumn]\at@breakpointyes} + {start} {\open@text@column\vtop{}} + {topline} {\open@text@column\vtop{}} + {hang} {\open@text@column\vtop{\kern\z@}} + {footline} {\open@text@column\vbox{}} + {default} {\Wmessage{Strange modifier: `textcolumn:#1=#2'}} + \endswitch} +\def\open@text@column#1#2% + {\ifin@line\advance\text@in@line\@ne\else\protect@breakpoint\fi + \@add@toks{#1\bgroup#2\leftskip\z@ \Indent:no \leavevmode} + \b@group[textcolumn] + \ifin@line\else\aftergroup\at@breakpointyes\fi + } + +% Depth strut: for use in line +\@GenericOption{depth}{ + \edef\cs@e{\nxp\@add@toks{\vrule width\z@ height\z@ depth \@w@w{#1}}} + \cs@e} + +% Block +% is an hbox +% opening +% 1/ blok:start --> \setbox\block@box=\hbox{ +% and \block@closing = } +% 2/ blok:hang --> \setbox\block@box=\hbox{\vtop{\kern\z@\hbox{ +% and \block@closing = }}} +% closing +% 1/ blok:stop --> \block@closing \box\block@box +% 2/ stickout:left/right --> \block@closing \l/rlap{\box\block@box} +% 3/ fillupto:foo --> \block@closing +% \hbox to \foo{\unhbox\block@box\hfil} +% +\newbox\block@box \newif\ifin@box +\add@generic@default{\in@boxno + \def\block@closing{\ifin@box\else + \Wmessage{Closing `block', but not opened. This is serious!}\fi} + } +\def\block@closing{} +\newdimen\BlockWidth +\def\Measure@Block{\global\BlockWidth\wd\block@box} +\@GenericOption{block}{ + \switch {\if\EqualString{#1}} + {stop} {\stop@block} + {hang} {\start@block + {\vtop\bgroup\kern\z@\hbox\bgroup} + {\egroup\egroup}} + {start} {\start@block{}{}} + {default} {\Wmessage{Strange option: `block:#1'}} + \endswitch} +\def\start@block#1#2{ + \ifin@line\else\protect@breakpoint\fi + \@add@toks{\setbox\block@box=\hbox\bgroup#1} + \b@group[block] + \ifin@line\else\aftergroup\at@breakpointyes\fi + \def\block@closing{\@add@toks{#2\egroup\Measure@Block}} + } +\def\stop@block{\block@closing + \ifin@box \@add@toks{\advance\hsize by -\wd\block@box} \fi + \@add@toks{\box\block@box} + \e@group[block]} + +\@GenericOption{fillupto}{ + \block@closing \e@group[block] + \edef\cs@e{\nxp\@add@toks{\hbox to \@w@w{#1}{\unhbox\block@box\hfil}}} + \cs@e + \ifin@line \edef\cs@e{\nxp\@add@toks{\advance\hsize by -\@w@w{#1}}} + \cs@e \fi + } +\@GenericOption{stickout}{ + \block@closing \e@group[block] + \switch {\if\EqualString{#1}} + {right} {\stickout@right{#2}} + {left} {\stickout@left{#2}} + {default} {\Wmessage{Unknown qualifier (stickout:) `#1'}} + \endswitch + } +\def\stickout@left#1{ + \@add@toks{\llap} + \if\IsEmptyList{#1} + \@add@toks{{\box\block@box}} + \else \edef\cs@e{\nxp\@add@toks{{\hbox to \@w@w{#1} + {\box\block@box\hss}}}} + \cs@e + \fi} +\def\stickout@right#1{ + \@add@toks{\rlap} + \if\IsEmptyList{#1} + \@add@toks{{\box\block@box}} + \else \edef\cs@e{\nxp\@add@toks{{\hbox to \@w@w{#1} + {\hss\box\block@box}}}} + \cs@e + \fi} + +%%%%%%%%%%%%%%%% Tidbits + +% Commands +% +\@GenericOption{command}{ + \ifin@external \external@handle@expandable{#1}{\csn#1\ecs}{<#1>} + \else + \if\UndefinedCS{#1}\Wmessage{Undefined command: <#1>}\fi + \edef\cs@e{\nxp\@add@toks{\CSname{#1}}}\cs@e + \fi} +\@GenericOption{CSname}{ + \edef\cs@e{\nxp\@add@toks{\CSname{#1}}}\cs@e} + +% Literal text. +% only problem if this is a colon. +% +\@GenericOption{literal}{\@add@toks{#1}} + +% Arguments. +% +\@GenericOption{arg}{\edef\cs@e + {\nxp\@add@toks{\iftrue{\else}\fi#1\iffalse{\else}\fi}} + \cs@e} +\@GenericOption{OpenBrace}{\edef\cs@e + {\nxp\@add@toks{\iftrue{\else}\fi}} + \cs@e} +\@GenericOption{CloseBrace}{\edef\cs@e + {\nxp\@add@toks{\iffalse{\else}\fi}} + \cs@e} +% Extra Commands before and after +% +\newtoks\before@toks \add@generic@default{\before@toks{}} +\@GenericOption{commandbefore}{ + \edef\cs@e{\nxp\append@to@list{before@toks}{\CSname{#1}}} + \cs@e} +\newtoks\after@toks \add@generic@default{\after@toks{}} +\def\add@after@command#1{\append@to@list{after@toks}{#1}} +\@GenericOption{commandafter}{ + \edef\cs@e{\nxp\add@after@command{\CSname{#1}}} + \cs@e} + +\endinput + +% 2014/04/18 Fixed the wrong numbering of nested enumerate lists +% 92/11/03 Improved penalty handling for embedded environments +% \ifini test extended to make loading on top of plain possible +% 92/11/08 Breakpoint protection into line/block/textcolumn +% 92/11/14 Resetlist generation made conditional +% 92/11/21 option 'arg' +% 92/12/12 \sTitelize, \give@title +% 93/07/30 late@after@toks, inputlineno in group errmsg diff --git a/Master/texmf-dist/tex/lollipop/lollipop.ini b/Master/texmf-dist/tex/lollipop/lollipop.ini new file mode 100644 index 00000000000..506961b5c6f --- /dev/null +++ b/Master/texmf-dist/tex/lollipop/lollipop.ini @@ -0,0 +1,24 @@ +% copyright 2014 Vafa Khalighi +% +% +% This program is free software: you can redistribute it and/or modify +% it under the terms of the GNU General Public License as published by +% the Free Software Foundation, either version 3 of the License, or +% (at your option) any later version. +% +% 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 +% GNU General Public License for more details. +% +% You should have received a copy of the GNU General Public License +% along with this program. If not, see <http://www.gnu.org/licenses/>. +% +% +\input pdftexconfig.tex +\scrollmode +\input lollipop.tex +\dump +\endinput + +% lollipop.fmt is generated by `pdftex -ini -jobname=lollipop -progname=lollipop -translate-file=cp227.tcx -etex lollipop.ini'
\ No newline at end of file diff --git a/Master/texmf-dist/tex/lollipop/lualollipop.ini b/Master/texmf-dist/tex/lollipop/lualollipop.ini new file mode 100644 index 00000000000..9e74711ec2c --- /dev/null +++ b/Master/texmf-dist/tex/lollipop/lualollipop.ini @@ -0,0 +1,35 @@ +% copyright 2014 Vafa Khalighi +% +% +% This program is free software: you can redistribute it and/or modify +% it under the terms of the GNU General Public License as published by +% the Free Software Foundation, either version 3 of the License, or +% (at your option) any later version. +% +% 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 +% GNU General Public License for more details. +% +% You should have received a copy of the GNU General Public License +% along with this program. If not, see <http://www.gnu.org/licenses/>. +% +% +% PDF output by default. + +% must be done first (activation of primitives) +\input luatexiniconfig.tex + +% settings inherited from pdftex +\input pdftexconfig.tex +% pdf output by default + +\input luatex-unicode-letters.tex % set codes based on Unicode (full range) + +% the usual format initialization. +\scrollmode +\input lollipop.tex +\dump +\endinput + +% lualollipop.fmt is generated by `luatex -ini -jobname=lualollipop -progname=lualollipop lualollipop.ini'
\ No newline at end of file diff --git a/Master/texmf-dist/tex/lollipop/xelollipop.ini b/Master/texmf-dist/tex/lollipop/xelollipop.ini new file mode 100644 index 00000000000..2885acd55b0 --- /dev/null +++ b/Master/texmf-dist/tex/lollipop/xelollipop.ini @@ -0,0 +1,51 @@ +% copyright 2014 Vafa Khalighi +% +% +% This program is free software: you can redistribute it and/or modify +% it under the terms of the GNU General Public License as published by +% the Free Software Foundation, either version 3 of the License, or +% (at your option) any later version. +% +% 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 +% GNU General Public License for more details. +% +% You should have received a copy of the GNU General Public License +% along with this program. If not, see <http://www.gnu.org/licenses/>. +% +% +\catcode`\{=1 \catcode`\}=2 \catcode`\#=6 \catcode`\^=7 \catcode`\@=11 + +\scrollmode + +\input unicode-letters +\input lollipop.tex + +\catcode`\@=11 +% +% Allocator for \XeTeXintercharclass values, from Enrico Gregorio +% +\newcount\xe@alloc@intercharclass % allocates intercharclass +\xe@alloc@intercharclass=\thr@@ % from 4 (1,2 and 3 are used by CJK, AFAIK) +\def\xe@alloc@#1#2#3#4#5{\global\advance#1\@ne + \xe@ch@ck#1#4#2% make sure there's still room + \allocationnumber#1% + \global#3#5\allocationnumber + \wlog{\string#5=\string#2\the\allocationnumber}} +\def\xe@ch@ck#1#2#3{% + \ifnum#1<#2\else + \errmessage{No room for a new #3}% + \fi} +\def\newXeTeXintercharclass{% + \xe@alloc@\xe@alloc@intercharclass\XeTeXintercharclass\chardef\@cclv} %at most 254 + +\catcode`\@=12 + +\XeTeXuseglyphmetrics=1 +\XeTeXdashbreakstate=1 + +\dump +\endinput + +% xelollipop.fmt is generated by `xetex -ini -jobname=xelollipop -progname=xelollipop -etex xelollipop.ini'
\ No newline at end of file |