% gerolf.tex % ========== % This file is part of Gerolf Markup Shredder, % written by G. D. Brettschneider (1999-2008). All rights reserved. % Send corrections to: MarkupShredder(at)Gerolf.org (www.Gerolf.org) % TeX programming literature: % Knuth, Donald Ervin: The TeXbook (1984-1996), % Addison-Wesley Publishing Comp., ISBN 0-201-13448-9 % Schwarz, Norbert: Einfuehrung in TeX (1991-1993), % Addison-Wesley Verlag GmbH, ISBN 3-89319-345-6 % Appelt, Wolfgang: TeX fuer Fortgeschrittene (1988), % Addison-Wesley Verlag GmbH, ISBN 3-89319-115-1 % 1. Basics ################################################################## % Load third - party macros: \input prologue.cfg % An "\input plain.tex" command is expected to be found in "prologue.cfg". % Plain TeX may be replaced by another file that re-defines a few basic macros % needed by GMS, e. g. \newbox, \newcount, \newdimen, \newtocs, \newrite, % \newif, \loop etc. % In Plain TeX, the "\input hyphen" command should be disabled, because GMS % too has a pattern loading mechanism. Also, font preloading should be % disabled. % Character category definitions: -------------------------------------------- % compare Knuth, pages 343-344: \chardef \CATescape = 0 \chardef \CATopengroup = 1 \chardef \CATclosegroup = 2 \chardef \CATmathmode = 3 \chardef \CATalignment = 4 \chardef \CATendofline = 5 \chardef \CATparameter = 6 \chardef \CATsuperscript = 7 \chardef \CATsubscript = 8 \chardef \CATignore = 9 \chardef \CATwhitespace = 10 \chardef \CATletter = 11 \chardef \CATother = 12 \chardef \CATactive = 13 \chardef \CATcomment = 14 \chardef \CATinvalid = 15 % Basic category code assignments: ------------------------------------------- % This is necessary for defining macros: \catcode `\{ = \CATopengroup \catcode `\} = \CATclosegroup \catcode `\# = \CATparameter \def \gcatcode {\global \catcode} \def \CATactivelessthan {\catcode `\< = \CATactive} \def \CATclosegroupclosebracket {\catcode `\] = \CATclosegroup} \def \CATcommentbar {\catcode `\| = \CATcomment} \def \CATcommenthashmark {\catcode `\# = \CATcomment} \def \CATescapelt {\catcode `\< = \CATescape} \def \CATletterexclamation {\catcode `\! = \CATletter} \def \CATletterhyphen {\catcode `\- = \CATletter} \def \CATothergt {\catcode `\> = \CATother} \def \CATopengroupopenbracket {\catcode `\[ = \CATopengroup} \def \CATotherampersand {\catcode `\& = \CATother} \def \CATotherclosebrace {\catcode `\} = \CATother} \def \CATotherhashmark {\catcode `\# = \CATother} \def \CATotherlessthan {\catcode `\< = \CATother} \def \CATotheropenbrace {\catcode `\{ = \CATother} \def \CATotherpercent {\catcode `\% = \CATother} \def \CATothertilde {\catcode `\~ = \CATother} \def \CATparameterat {\catcode `\@ = \CATparameter} \def \CATparameterdegree {\catcode `\° = \CATparameter} \def \CATwhitespacegt {\catcode `\> = \CATwhitespace} \def \CATwhitespaceslash {\catcode `\/ = \CATwhitespace} \def \CATentity {% \CATescapelt \CATletterexclamation \CATletterhyphen \CATotherampersand \CATotherhashmark \CATothergt \CATparameterat} \def \CATreference {% \CATotherhashmark \CATotherampersand \CATparameterdegree} \def \CATstylegap {% \CATclosegroupclosebracket \CATopengroupopenbracket \CATotherclosebrace \CATotheropenbrace} % This is what initex and "plain.tex" do (Characters not mentioned here % are assumed to be letters (A-Z, a-z) or other): \def \endmarkupCAT {% \global \catcode 0 = \CATignore % nul \global \catcode 1 = \CATsubscript % start of heading \global \catcode 9 = \CATwhitespace % horizontal tabulator \global \catcode 11 = \CATsuperscript % vertical tabulator \global \catcode 12 = \CATactive % form feed \global \catcode 13 = \CATendofline % carriage return \global \catcode `\ = \CATwhitespace % &32#; \global \catcode `\# = \CATparameter % &35#; \global \catcode `\$ = \CATmathmode % &36#; \global \catcode `\% = \CATcomment % &37#; \global \catcode `\& = \CATalignment % &38#; \global \catcode `\< = \CATother % < \global \catcode `\\ = \CATescape % &92#; \global \catcode `\^ = \CATsuperscript % &94#; \global \catcode `\_ = \CATsubscript % &95#; \global \catcode `\{ = \CATopengroup % &123#; \global \catcode `\} = \CATclosegroup % &125#; \global \catcode `\~ = \CATactive % &126#; \global \catcode 127 = \CATinvalid} % delete \endmarkupCAT \outer \def ^^L{\par} % form feed \def \activateshredder {\catcode `\< = \CATactive \catcode `\# = \CATother \catcode `\~ = \CATother} \activateshredder \def \enableshredder {\let < = \TAGget} \def \shredder {\activateshredder \enableshredder} \endmarkupCAT % So far, the "plain.tex" assignments will not interfere with Markup Shredder. \let \CHARampersand \relax \let \CHARhashmark \relax \def \preamble {\CHARhashmark \CHARampersand \CHARampersand \CHARhashmark} \let \CHARampersand = & \let \CHARhashmark = # \def \beginhalign {\halign \expandafter \bgroup \preamble \cr} \def \expandthree {\expandafter \expandafter \expandafter} % Character category changes for input files using html-style markup: -------- % The less-then sign "<" must be made an active character, because texts using % "html-style" markup are expected as input. Other TeX macro files must be % loaded before this is done (via "epilogue.cfg"). % This will be executed by the start tag ("<" is no longer active then % ): \def \beginmarkupCAT {% \global \catcode 0 = \CATother % nul \global \catcode 1 = \CATother % start of heading \global \catcode 9 = \CATwhitespace % horizontal tabulator \global \catcode 11 = \CATother % vertical tabulator \global \catcode 12 = \CATother % form feed \global \catcode 13 = \CATwhitespace % carriage return \global \catcode `\ = \CATwhitespace % &32#; \global \catcode `\# = \CATother % &35#; \global \catcode `\$ = \CATother % &36#; \global \catcode `\% = \CATother % &37#; \global \catcode `\& = \CATother % &38#; \global \catcode `\< = \CATactive % < \global \catcode `\\ = \CATother % &92#; \global \catcode `\^ = \CATother % &94#; \global \catcode `\_ = \CATother % &95#; \global \catcode `\{ = \CATother % &123#; \global \catcode `\} = \CATother % &125#; \global \catcode `\~ = \CATother % &126#; \global \catcode 127 = \CATother} % delete % This is used locally, e. g. to skip JavaScripts: \def \beginscriptCAT {% \catcode `\# = \CATother % &35#; \catcode `\$ = \CATother % &36#; \catcode `\% = \CATother % &37#; \catcode `\& = \CATother % &38#; \catcode `\< = \CATother % < \catcode `\\ = \CATother % &92#; \catcode `\^ = \CATother % &94#; \catcode `\_ = \CATother % &95#; \catcode `\{ = \CATother % &123#; \catcode `\} = \CATother % &125#; \catcode `\~ = \CATother}% &126#; % Information about this software: %%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%% \def \GMSformat {gerolf} \def \GMSname {Gerolf Markup Shredder} \def \GMSversion {0.08a}% \def \GMSdate {20080107}% \def \GMSauthor {G. D. Brettschneider} \def \GMSaddress {Luchtbergstrasse 27, D-28237 Bremen, Germany} \def \GMSdomain {www.Gerolf.org} \def \GMSemail {MarkupShredder(a)Gerolf.org} \def \GMScopyright {% Copyright (c) 1999 - 2008 by Gerolf Diethelm Brettschneider, Luchtbergstrasse 27, D-28237 Bremen. All rights reserved. This GMS software comes without ANY warrenty. You may freely distribute and use it.} % %%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%% \tracingstats = 1 % Lines and messages: -------------------------------------------------------- \def \CONspace { } \def \CONhyphen {-} \def \CONhalfline {------} \def \CONline {\CONhalfline \CONhalfline} \def \CONlongline {\CONline \CONline \CONline \CONline \CONline} \def \CONhalfLINE {======} \def \CONLINE {\CONhalfLINE \CONhalfLINE} \def \CONlongLINE {\CONLINE \CONLINE \CONLINE \CONLINE \CONLINE} \def \predashes {\ifcase \count 1 \or -\or --\or ---\or \temponumber \or -----\or --\temponumber \else ?\fi} \def \postdashes {\ifcase \count 4 \or -\or --\or ---\or ----\or -----\or \CONhalfline \or \CONhalfline -\or \CONhalfline --\or \CONhalfline ---\or \CONhalfline ----\or \CONhalfline -----\or \CONline \or -\CONline \else ?\fi} \def \dotmessage {\message {.}} \def \hyphenmessage {\message {-}} \def \fillmessage #1#2#3#4{{% \count 1 = #1 \count 4 = #4 \def \temposecond {#2}% \ifx \temposecond \CONhyphen \def \temponumber {----}% \else \def \temponumber { #2 -}\fi \message {\predashes <#3>\postdashes \CONlongline}}} \def \GMScodepage {CP1252} \def \GMSwelcome {\fillmessage 0-{GMS}{13}} \def \GMSgoodbye {\fillmessage 0-{/GMS}{12}} \def \GMSbeginabout {\message {This is \GMSname, Version \GMSversion, written by \GMSauthor}} \def \GMSendabout {\message {Release: \GMSdate \CONspace | Domain: \GMSdomain \CONspace | Mail: \GMSemail}} % Load interface and modules: ------------------------------------------------ \GMSwelcome \GMSbeginabout \fillmessage 2-{initialize}4 \fillmessage 41{interface}3 % Fixme: lowercase functions without uppercase prefix should be backed up \let \mef \mathchardef \let \neb \newbox \let \nec \newcount \let \ned \newdimen \let \net \newtoks \let \new \newif % Variables: ----------------------------------------------------------------- \net \FONTmonospace \net \FONTsansserif \net \FONTserif \let \LINEheight \baselineskip \ned \LINEheightpageno \def \LINEupskip {\vskip -\LINEheight} \ned \TEXTheight \ned \TEXTwidth \new \ifCLASSpredefined \new \ifEND \new \ifGEDCOM \new \ifLINEheightgiven \new \ifOPENbouter \new \ifOPENcomment \new \ifOPENdlcompact \new \ifOPENfloatsuppress \new \ifOPENfontinner \new \ifOPENfontouter \new \ifOPENform \new \ifOPENh \new \ifOPENiouter \new \ifOPENparinner \new \ifOPENparouter \new \ifOPENstyle \new \ifSCRIPTother \new \ifTEXTindentgiven \let \HYPHENtables \empty \let \INDENTinputtype \empty \let \INDENTinputvalue \empty \let \NAMESPACE \empty \let \OBJECTtype \empty \let \POSTfamilies \empty \def \REFeuro {80} \let \SCRIPTtype \empty \let \TEXTindent \parindent % Literature: Donald Ervin Knuth, "The TeXbook" (1984-1996), Appendix B and D. % Abbreviations: ------------------------------------------------------------- \def \gadvance {\global \advance} \def \glet {\global \let} \def \ldef {\long \def} \def \gldef {\global \long \def} \def \begintrace {\global \tracingmacros = 3 \global \tracingcommands = 1 } \def \endtrace {\global \tracingmacros = 0 \global \tracingcommands = 0 } % Indirect definitions: ------------------------------------------------------ % These definitions can have non-letters in their names (see Knuth, page 375): \def \Def #1 #2{% \csname expandafter\endcsname \def \csname #1\endcsname {#2}} \def \gDef #1 #2{% \csname expandafter\endcsname \gdef \csname #1\endcsname {#2}} \def \eDef #1 #2{% \csname expandafter\endcsname \edef \csname #1\endcsname {#2}} \ldef \lDef #1 #2{% \csname expandafter\endcsname \ldef \csname #1\endcsname {#2}} \ldef \glDef #1 #2{% \csname expandafter\endcsname \gldef \csname #1\endcsname {#2}} \def \unDef #1{% clear memory \csname expandafter\endcsname \let \csname #1\endcsname \undefined} \def \xDef #1 #2{% \csname expandafter\endcsname \xdef \csname #1\endcsname {#2}} % Search an expandable command (control sequence definition check): ---------- % compare Knuth, pages 40 and 308; similar to e-TeX's \ifcsname...\endcsname: \new \ifDEF \def \DEFsearch #1{\expandafter \ifx \csname #1\endcsname \relax \DEFfalse \else \DEFtrue \fi} \def \blap #1{\vbox to 0pt {#1\vss}} \def \tlap #1{\vbox to 0pt {\vss #1}} \bgroup \catcode`\^ = \CATsuperscript \gdef \^^M{\ } % carriage return = space \egroup % Fixme: move % System functions: ---------------------------------------------------------- % Log file messages: \def \echo #1{\immediate \backupwrite 16 {#1}} \def \noecho {\echo {}} % System commands: \def \system #1{\immediate \backupwrite 18 {#1}} % Count files on Dos: \def \NOfilemax {1234567}% may be redefined to e.g. 16 on Dos via 'files.cfg' \def \Message #1{\message {<#1>}} \ifx \pdfpagewidth \undefined \echo {! Unsupported: PDF output (pdfTeX required). Writing DVI instead. }% \fi % 2. Functions ############################################################### % ALIGN: ===================================================================== % compare Knuth, pages 107, 317, 353 and 356: \new \ifALGN \new \ifALGNcenter \new \ifALGNleft \new \ifALGNright \def \ALGNtext #1{\edef \algnZ {#1}% \ALGNleftfalse \ALGNcenterfalse \ALGNrightfalse \ifx \algnZ \CONleft \algnB \ALGNlefttrue \else \ifx \algnZ \CONcenter \algnC \ALGNcentertrue \else \ifx \algnZ \CONright \algnA \ALGNrighttrue \else \ifx \algnZ \CONmiddle \CHKerryoumeantcenter \algnC \ALGNcentertrue \fi \fi \fi \fi} \def \algnA {\leftskip = 0pt plus 2em \algnD} % left \def \algnB {\rightskip = 0pt plus 2em \algnD} % right \def \algnC {\leftskip = 0pt plus 2em \rightskip = \leftskip \algnD} % center \def \algnD {\parindent = 0pt \parfillskip = \parindent \ALGNtextrespace \hbadness = 10000 \relax} % any \def \ALGNtextbyvalue {\VALgetlc \ALGNtext \VALlowercase} \def \ALGNtextend {\ifALGNcenter \hskip \parfillskip \else \ifx \BIDI \CONltr \ifALGNright \else \hfill \fi \fi \fi} \def \ALGNtextrespace {\spaceskip = 0.3333em \xspaceskip = 0.5em } % ANCR: ====================================================================== % \Def \CONSTYLE a:link {\CLRsetlink} % Fixme % \Def \CONSTYLE a:visited {\CLRsetvlink} % Fixme: line and page breaks, outsource \GAPwrite % Fixme: This may produce masses of control sequences. % Define limit of destinations to be checked in typeset.cfg \def \ANCRadd {% \DEFsearch {\CONdest \ancrAZ}\ifDEF \CHKerrduplicate \ancrAZ \else \pdfdest name {\ancrAZ} fit\relax % fith, fitv, fitb, fitbh, fitbv \xDef {\CONdest \ancrAZ} {}\fi} \ifx \pdfdest \undefined \let \ANCRadd \relax \fi \def \ANCRbegin {% begin anchor \ifLINKunrendered \else \ifLINKunlinked \else \ifx \URLhref \empty \ifx \LINKname \empty \ifx \LINKid \empty \CHKerrunanchored \fi \else \ANCRbyname \LINKname \fi \else %%% \ifx \LINKname \empty \else \ANCRbyname \LINKname \fi % Fixme \ancrA \URLhref \fi \fi \fi} \def \ancrA #1{\edef \ancrAZ {#1}\ifx \ancrAZ \empty \else \ancrC \fi} \def \ancrB {\ANCRedtrue \hskip 0mm % get into horizontal mode \bgroup \pdflinkmargin = 0ex \ANCRedtrue \ifANCRheightgiven \ancrBA \else \ancrBB \fi} \ifx \pdfdest \undefined \let \ancrB \relax \fi \def \ancrBA {% height given \pdfstartlink height \ANCRheight \CONspace depth 0pt \CONspace} \ifx \pdfdest \undefined \let \ancrBA \relax \fi \def \ancrBB {% no height given \pdfstartlink height 0.7\LINEheight %%% Fixme: differs from \strut \CONspace depth 0.3\LINEheight \CONspace} %%% \ifx \pdfdest \undefined \let \ancrBB \relax \fi \def \ancrC {\let \ANCRext \empty \let \ANCRint \empty \URLinternetfalse \URLget \ancrAZ \ifURLinternet \ancrCA \else \ancrD \fi} % href \def \ancrCA {\ifx \ANCRext \ANCRint \else % href ext. \edef \ANCRext {\ANCRext \CONhashmark \ANCRint }\fi \ancrCAA \ANCRext} \def \ancrCAA #1{% start external destination \ancrB attr {/C [\the \CLRanchorext] /Border [0 0 1] }% user {/Subtype /Link /A << /Type /Action /S /URI /URI (#1) >>}% \egroup} \def \ancrD {\ifx \ANCRint \empty \ancrDA \else \ancrDB \ANCRint \fi }% int. \def \ancrDA {\expandafter \CHNcopyrelativepath \ancrAZ \to \ANCRint \ancrDB \ANCRint }% internal href empty \def \ancrDB #1{\ancrB attr {/C [\the \CLRanchorint] /Border [0 0 1] }% goto name {#1}\egroup }% internal destination \let \ANCRbegext \ancrCA \def \ANCRbychain #1{% \edef \ancrAZ {#1}\ifx \ancrAZ \empty \else \ANCRadd \fi} \def \ANCRbyname #1{% , \edef \ancrAZ {#1}\ifx \ancrAZ \empty \else \ANCRadd \fi} \new \ifANCRed \def \ANCRend {\ifLINKunrendered \else \ifLINKunlinked \else % \ifx \URLhref \empty \else \ifvmode \leavevmode \fi \ANCRendA \fi % Fixme: not if nameLINK \fi \fi \ifANCRed \ANCRendA \fi} \def \ANCRendA {\GAPwrite \ifANCRed \pdfendlink \fi \ANCRedfalse} \ifx \pdfdest \undefined \let \ANCRendA \relax \fi \def \ANCRgedcom {\ANCRinit \ELEMENTvalueget \ANCRbegin \global \GAP = {=>}\GAPwrite \ANCRend} \ned \ANCRheight \new \ifANCRheightgiven \def \ANCRinit {\glet \LINKname \empty \glet \URLhref \empty} % % ARRAY: ===================================================================== % Compare Knuth, page 378 ("Dirty tricks: list macros"): \net \ARRAY \net \ARRAYentry \def \ARRAYafter #1{\ARRAY = \expandafter {#1}% \xdef #1{\the \ARRAY \the \ARRAYentry}} \def \ARRAYbefore #1{\ARRAY = \expandafter {#1}% \xdef #1{\the \ARRAYentry \the \ARRAY}} \ldef \ARRAYone [#1] {% \ARRAYentry = {\\ [#1] }} \ldef \ARRAYtwo [#1] [#2] {% \ARRAYentry = {\\ [#1] [#2] }} \ldef \ARRAYthree [#1] [#2] [#3] {% \ARRAYentry = {\\ [#1] [#2] [#3] }} \ldef \ARRAYfour [#1] [#2] [#3] [#4] {% \ARRAYentry = {\\ [#1] [#2] [#3] [#4] }} \ldef \ARRAYfive [#1] [#2] [#3] [#4] [#5] {% \ARRAYentry = {\\ [#1] [#2] [#3] [#4] [#5] }} \ldef \ARRAYsix [#1] [#2] [#3] [#4] [#5] [#6] {% \ARRAYentry = {\\ [#1] [#2] [#3] [#4] [#5] [#6] }} \ldef \ARRAYseven [#1] [#2] [#3] [#4] [#5] [#6] [#7] {% \ARRAYentry = {\\ [#1] [#2] [#3] [#4] [#5] [#6] [#7] }} \ldef \ARRAYeight [#1] [#2] [#3] [#4] [#5] [#6] [#7] [#8] {% \ARRAYentry = {\\ [#1] [#2] [#3] [#4] [#5] [#6] [#7] [#8] }} \ldef \ARRAYnine [#1] [#2] [#3] [#4] [#5] [#6] [#7] [#8] [#9] {% \ARRAYentry = {\\ [#1] [#2] [#3] [#4] [#5] [#6] [#7] [#8] [#9] }} % ATT: ======================================================================= \new \ifATT % Section restructured (20070202) \let \ATTactual \relax \let \attWX \empty \let \attWXunq \empty \let \attYtest \empty \let \attZ \empty \def \ATTget {\edef \attYtest {\the \ATTlist}% \expandafter \attA \attYtest ... = "GMS-STOP"} \ldef \attA #1#2=#3"#4"{\lowercase {\edef \attWX {#1#2}}% \edef \attY {#3}\edef \attZ {#4}% \ifx \attZ \CONpar \let \attZ \CONthatsall \fi \let \ATTactual \attA \let \attAnext \relax \ATTlistmissingquotesfalse \ifx \attZ \CONthatsall \ATTlistalltrue \else \ifx \attZ \CONstopmark \else \attAA #4 ... = \relax \fi \fi \ifx \attY \empty \let \attAnext \attC \else \ifx \attY \CONspace \let \attAnext \attC \else \ifx \attZ \empty \let \attAnext \attD \else \let \attAnext \attB \fi \fi \fi \attAnext \ifATTlistall \let \ATTactual \attF \fi \ATTactual} \def \attAA #1 ... = #2\relax {\VAL = {#1}\edef \attAAZ {#2}% \ifx \attAAZ \CONthatsall \edef \attY {#1}\ATTlistalltrue \else \ATTlistallfalse \fi }% check \def \attB {\ifx \attZ \CONstopmark \let \ATTactual \relax \let \attAfourthnext \attBB \else \let \attAfourthnext \attBA \fi \attAfourthnext }% parse attZ \def \attBA {\edef \attBtest {% \attWX = \attY \CONspace \CONspace GMS-STOP }% \expandafter \attE \attBtest \VAL = \expandafter {\attZ }% \edef \attBtest {\attYETfirst \CONspace \attZ }% \expandafter \attG \attBtest \relax} % run \def \attBB {\edef \attBtest {% \attWX = \attY \CONspace \CONspace GMS-STOP }% \expandafter \attE \attBtest} % stop \def \attC {\ifx \attZ \CONstopmark \let \ATTactual \relax \else \attCA \fi} % attY empty \def \attCA {\ifATTlistall \let \ATTactual \relax \else \let \ATTactual \attA \fi \ifATTlistmissingquotes \else \VAL = \expandafter {\attZ}% \edef \attSTOPdoprobe {\attWX \CONspace }% \expandafter \attG \attSTOPdoprobe \relax \fi} \def \attD {\ATTlistmissingquotestrue % attY given \edef \attY {\attY \CONspace }\expandafter \attDA \attY \relax \edef \attYgiventest {\attWX \CONspace }% \expandafter \attG \attYgiventest \relax \ifx \attZ \CONstopmark \let \attYgivennext \attDC \else \let \attYgivennext \attDB \fi \attYgivennext} \def \attDA #1 #2 #3\relax {% parse attY \ifx \attWX \CONendmarkdots \VAL = {}\let \attYtest \empty \else \DEFsearch {\CONatt \attWX }% \ifDEF \attDAA {#1}{#2 #3}% \else \DEFsearch {\CONtag \the \ELEMENT \CONatt \attWX }% \ifDEF \attDAA {#1}{#2 #3}\else \attDAA {#2}{#3}\fi \fi \fi \ifx \attYtest \empty \ATTunqfalse \else \ifx \attYtest \CONendmark \ATTunqfalse \else \ifx \attYtest \CONendmarktwo \ATTunqfalse \else \ifx \attYtest \CONendmarkequal \ATTunqfalse \else \ATTunqtrue \fi \fi \fi \fi} \def \attDAA #1#2{\VAL = \expandafter {#1}\edef \attYtest {#2}}% do \def \attDB {\edef \test {\attWX = \attY \CONspace \CONspace GMS-STOP }% \expandafter \attE \test }% run \def \attDC {\edef \test {\attWX \CONspace \attY \CONspace ...}% \expandafter \attDCA \test \relax }% stop \def \attDCA #1 #2 ...#3\relax {% parse stop \VAL = {#2}\let \ATTactual \relax \edef \attDCAXY {#1 #2}% \expandafter \attG \attDCAXY \relax \CHKerrunquot} \ldef \attE #1=#2#3 {% parse unquoted \def \attWXunq {#1}\edef \attEY {#2}% \ifx \attEY \CONapostroph \CHKerrapostrophized \attEA #3'\relax \else \edef \attEYZ {#2#3}\attEB \fi \ifx \attEY \CONpar \let \attEnext \relax \fi \attEnext} \def \attEA #1'#2\relax {\edef \attEAY {#2}% apostrophe \ifx \attEAY \empty %%% \let \attEnext \attEAA \let \attEnext \attEC %%% \else \let \attEnext \attEC \VAL = \expandafter {#1}% \edef \attEAtest {\attWXunq \CONspace #1}% \expandafter \attG \attEAtest \relax \fi} %% \ldef \attEAA #1'#2GMS-STOP#3{% Fixme: discarding value %% \edef \attEAY {#3}\let \ATTactual \relax %% \ifx \attEAY \CONquotmark \let \attEAY \relax \fi \attEAY} \def \attEB {\ifx \attEYZ \CONstopmark \attEBB \else \attEBA \fi} % do \def \attEBA {\VAL = \expandafter {\attEYZ}% \edef \attEall {\attWXunq \CONspace \attEYZ}% \expandafter \attG \attEall \relax \CHKerrunquot \ifATTlistall \let \attEnext \attEC \else \let \attEnext \attE \fi} % run \def \attEBB {\ifx \attZ \CONstopmark \let \attEnext \relax \else \attEBBA \fi} % stop \def \attEBBA {\VAL = \expandafter {\attZ }% \edef \attEall {\attWXunq \CONspace \attZ }% pass stop \expandafter \attG \attEall \relax \let \attEnext \relax} \ldef \attEC #1GMS-STOP{\let \ATTactual \relax % gulp unquoted \edef \attECZ {#1}% Fixme \ifx \attECZ \CONspace \let \attECZ \attF \else \ifx \attECZ \CONattstop \attECA \ATTlistallfalse \else \ifx \attECZ \CONattstopspace \attECA \ATTlistallfalse \else \attECA \fi \fi \fi \attECZ} \def \attECA {\let \attECZ \relax} \ldef \attF #1GMS-STOP#2{% stop unquoted \edef \attFZ {#2}\let \ATTactual \relax \ifx \attFZ \CONquotmark \let \attFZ \relax \fi \attFZ} \let \attYETfirst \empty \ldef \attG #1 #2\relax {% get attribute \lowercase {\edef \attYETfirst {#1}}\attH} \def \attH {\let \attHnext \relax \ifx \attYETfirst \CONstyle \PRPtrue \PRPlist = \VAL \else \ifx \attYETfirst \CONclass \attJ \else \attK \fi \fi \attHnext }% do \def \attJ {\VALgetlc \let \attYETclassdotest \VALlowercase \DEFsearch {\CONCLASS \attYETclassdotest}% \ifDEF \CLASSpredefinedtrue \csname \CONCLASS \attYETclassdotest \endcsname \fi \DEFsearch {\CONSTYLE \attYETclassdotest }\ifDEF \attJA \else \DEFsearch {\CONSTYLE \the \ELEMENT .\attYETclassdotest }% \ifDEF \attJB \else \ifCLASSpredefined \else \CHKerrundefclass \attYETclassdotest \fi \fi \fi} % class \def \attJA {\def \attHnext {\expandafter % property \PRPlistget \csname \CONSTYLE \VALlowercase \endcsname}} \def \attJB {\def \attHnext {\expandafter % style \PRPlistget \csname \CONSTYLE \the \ELEMENT .\VALlowercase \endcsname}} \def \attK {\DEFsearch {\CONtag \the \ELEMENT \CONatt \attYETfirst }% \ifDEF \attKA \else \attKB \fi }% element \def \attKA {\def \attHnext {\csname \CONtag \the \ELEMENT \CONatt \attYETfirst \endcsname }}% next att. \def \attKB {\DEFsearch {\CONatt \attYETfirst}% next element \ifDEF \def \attHnext {\csname \CONatt \attYETfirst \endcsname }\else \let \attHnext \relax \CHKerrunrecogattprop \attYETfirst \fi} \net \ATTlist \new \ifATTlistall \new \ifATTlistmissingquotes \new \ifATTunq \new \ifATTunqmessage % attribute value unquoted % BACKGROUND: ================================================================ \new \ifBKGD \def \BKGDclrsetbody {\edef \BKGDtest {\the \VAL \CONspace}% \expandafter \BKGDclrsetbodyA \BKGDtest \relax} \def \BKGDclrsetbodyA #1 #2\relax {\edef \BKGDclrsetbodyAZ {#2}% \ifx \BKGDclrsetbodyAZ \empty \BKGDgiventrue \CLRsetbg \ifCLRgetanyfailed \CLRbgfalse \else \CLRbgbodytrue \edef \CLRbgbody {\CLRbackground}\fi \else \CHKerrunsuppattprop \CONbackground \fi} % set background color \def \BKGDgeturl #1{\expandafter \BKGDgeturlA #1 url(none)\relax} \def \BKGDgeturlA #1url(#2)#3\relax {\edef \BKGDsource {#2}\BKGDload}% parse \new \ifBKGDgiven \ned \BKGDheight \def \BKGDload {\let \FILEname \CONnone \let \FILEsource \BKGDsource \IMGheight = 0mm \IMGwidth = 0mm \FILEget \ifx \FILEname \CONdotslashnonejpg \global \BKGDfalse \else \FILEsearch \FILEname \ifFILEexist \BKGDloadA \else \expandafter \FILEsearchimage \FILEname .jpg\relax \ifFILEexist \BKGDloadA \else \CHKerrabsent \FILEname \fi \fi \fi} \def \BKGDloadA {\xdef \BKGDimage {\FILEname}% \ifx \FILEname \CONnone \else \chkWLMtotfileadvance \ifFILEtoomany \else \BKGDloadAA \fi \fi} \def \BKGDloadAA {\global \BKGDtrue \imgGA \imgH \empty \empty % Fixme: rename \setbox \IMGbox = \hbox {\imgC}% \IMGwidth = \wd \IMGbox \IMGheight = \ht \IMGbox \global \BKGDheight = \IMGheight \global \BKGDwidth = \IMGwidth} \def \BKGDmake {{\let \FILEname \BKGDimage \FILEsearch \FILEname \ifFILEexist \imgH \BKGDheight \BKGDwidth \vbox to 0mm {\vskip -\OUTmargint \hbox to 0mm {\hskip -\OUTmarginl \ifBKGDnorepx \BKGDmakeA \else \BKGDmakeB \fi \hss }\vss }\fi}} \def \BKGDmakeA {% no repeat-x \ifBKGDnorepy \hbox {\imgC}\else \BKGDmakeAA {\hbox {\imgC}}\fi} \def \BKGDmakeAA #1{{\vbox {\loop \ifdim \OUTheight > 0mm #1\advance \OUTheight by -\BKGDheight \repeat}}} \def \BKGDmakeB {% repeat-x \ifBKGDnorepy \BKGDmakeBB \else \BKGDmakeAA \BKGDmakeBB \fi} \def \BKGDmakeBB {{\hbox {\loop \ifdim \OUTwidth > 0mm \imgC \advance \OUTwidth by -\BKGDwidth \repeat}}} % Fixme: rename \new \ifBKGDnorepx \new \ifBKGDnorepy \def \BKGDsetrepeat {\edef \BKGDrepeattest {\the \VAL}% \ifx \BKGDrepeattest \CONrepeatx \global \BKGDnorepxfalse \global \BKGDnorepytrue \else \ifx \BKGDrepeattest \CONrepeaty \global \BKGDnorepxtrue \global \BKGDnorepyfalse \else \BKGDsetrepeatA \fi \fi} \def \BKGDsetrepeatA {% no repeat \ifx \BKGDrepeattest \CONnorepeat \global \BKGDnorepxtrue \global \BKGDnorepytrue \else \global \BKGDnorepxfalse \global \BKGDnorepyfalse \fi} \def \BKGDsourceset {\edef \BKGDsource {\the \VAL}} \ned \BKGDwidth % BKP: ======================================================================= % Tags and gap contents must be backed up for analyzing tables (2005/10/21): % Fixme: always clear memory afterwards \new \ifBKP \nec \BKPnest \nec \BKPno \let \BKPnocols \empty \let \BKPnorows \empty % stack \nec \BKPnotable \let \BKPnotables \empty % stack \newif \ifBKPpop \def \BKPpop {\global \BKPpopfalse \global \BKPno = 0 \bkpB \ifnum \BKPno < \BKPstop \bkpA \bkpBrepeat \global \BKPno = 0 } \def \bkpA {\gadvance \BKPno by 1 % recall tag \edef \bkpAP {\csname BKPt\the \BKPno \endcsname \CONspace}% probe \expandafter \bkpAA \bkpAP \relax \edef \bkpAP {\csname BKPg\the \BKPno \endcsname \empty}% recall gap \expandafter \bkpAB \bkpAP \empty \empty \empty \relax \ifbkpABend \else \expandafter \bkpAC \bkpAP \relax \fi \bkpAD \tagE} \ldef \bkpAA #1#2 #3\relax {\lowercase {\ELEMENT = {#1#2}}% parse \edef \TAGgetCX {#1}\def \TAGgetCXY {#1#2}% see \TAGgetC \def \TAGgetCY {#2}\def \TAGgetCZ {#3}\ATTlist = {#3}} \ldef \bkpAB #1#2#3#4\relax {\def \bkpABtest {#1#2#3}% comment \ifx \bkpABtest \CONendcomment \bkpABendtrue \tagAfalse \tagAbegfalse \tagDtrue \xdef \GAPcontent {#4}% \GAPchkfilled \GAPchklog \GAPchkobey \GAPset {#4}% \else \bkpABendfalse \fi} \newif \ifbkpABend % comment end \ldef \bkpAC #1\relax {% gap, see \GAPget \xdef \GAPcontent {#1}\GAPchkfilled \GAPchklog \GAPchkobey \GAPset {#1}} \def \bkpAD {% clear \xDef {BKPt\the \BKPno} \empty \xDef {BKPg\the \BKPno} \empty} \def \bkpB #1\bkpBrepeat {\let \bkpBrepeat \fi % loop \gdef \bkpBbody {#1}\bkpBA} % global to pass moziller.htm \def \bkpBA {\bkpBbody % iterate (unnestable, see \loop in plain.tex) \let \bkpBnext \bkpBA \else \let \bkpBnext \relax \fi \bkpBnext} \def \BKPpush #1{\iftagA \ifBKP \bkpC \fi \fi \edef \BKPelement {\the \ELEMENT}% \ifx \BKPelement \CONtable \bkpD \else \ifx \BKPelement \CONtd \bkpE \else \ifx \BKPelement \CONth \bkpE \else \ifx \BKPelement \CONtr \bkpF \else \ifx \BKPelement \CONendtable \bkpG \fi \fi \fi \fi \fi \ifBKP \let #1\relax \bkpH\fi \ifBKPpop \let #1\relax \BKPpop \fi} \def \bkpC {\ELEMENT = \expandafter {\CONcomment}} % comment \def \bkpD {\gadvance \BKPnotable by 1 % start \expandafter \STACKxpush \the \BKPnotable \to \BKPnotables \expandafter \STACKxpush \the \BKPtr \to \BKPnorows \expandafter \STACKxpush \the \BKPtd \to \BKPnocols \gadvance \BKPnest by 1 \global \BKPtd = 0 \global \BKPtdmax = 0 \global \BKPtr = 0 \ifnum \BKPnest = 1 \global \BKPtrue \xdef \BKPstart {\the \BKPno}\fi} \def \bkpE {\gadvance \BKPtd by 1 \ifnum \BKPtd > \BKPtdmax \global \BKPtdmax = \BKPtd \fi} % td \def \bkpF {\global \BKPtd = 0 \gadvance \BKPtr by 1 } % tr \def \bkpG {\gadvance \BKPnest by -1 \STACKxpopnumber \BKPnotable \from \BKPnotables \xDef {TROWS\the \BKPnotable} {\the \BKPtr}% \STACKxpopnumber \BKPtr \from \BKPnorows \xDef {TCOLS\the \BKPnotable} {\the \BKPtdmax}% \STACKxpopnumber \BKPtd \from \BKPnocols \SPANrowclear \ifnum \BKPnest = 0 \global \BKPpoptrue \global \BKPfalse \bkpH \tagAbegfalse \xdef \BKPstop {\the \BKPno}\fi} % stop \def \bkpH {% exec: create array of tags and gaps \iftagAbeg \iftagD \else \let \BKPelement \CONcomment \fi \fi \gadvance \BKPno by 1 \glet \BKPtaglast \BKPtagnew \glet \BKPtagnew \BKPelement \ifx \BKPtaglast \CONcomment \ifx \BKPtagnew \CONcomment \GAP = {}\fi \fi \xDef {BKPt\the \BKPno} {\BKPelement \CONspace \TAGgetCZ}% \xDef {BKPg\the \BKPno} {\the \GAP}} \nec \BKPtd \nec \BKPtdmax \nec \BKPtr % BIDI: ====================================================================== \ifx \TeXXeTstate \undefined \message {No eTeX: Unidirectional typesetting. -}% \csname newcount\endcsname \TeXXeTstate \fi \def \BIDI {ltr} \ifx \eTeXversion \undefined \let \BIDIbegin \empty \let \BIDIbeginone \empty \let \BIDIend \empty \let \BIDIendone \empty \let \BIDIset \empty \let \BIDIsetone \empty \else \def \BIDIbegin {\ifnum \TeXXeTstate = 2 \beginR \fi} \def \BIDIbeginone {\ifnum \TeXXeTstate = 1 \beginR \fi} \def \BIDIend {\ifnum \TeXXeTstate = 2 \endR \fi} \def \BIDIendone {\ifnum \TeXXeTstate = 1 \endR \fi} \def \BIDIset {\VALset \BIDI \ifx \BIDI \CONrtl \TeXXeTstate = 2 \fi} \def \BIDIsetone {\VALset \BIDI \ifx \BIDI \CONrtl \TeXXeTstate = 1 \fi }\fi % BORDER: ==================================================================== % The visible border width between cells has to be twice border-width, and % border greyness should be one third (or skip width should equal twice rule % width), independent from border style. If a
rule. % If TeX is programmed to make a full width overlap of horizontal and % vertical rule edges, it turns out that both Acrobat Reader and Ghostview % sometimes show a small offset caused by rounding errors that looks ugly. % Therefore GMS does half width overlapping, if possible. \def \BRDdraw #1#2{\ifx \BRDprofile \empty \let \BRDprofile \CONsolid \fi \csname \CONborderstyle \BRDprofile #2#1\endcsname} \def \brdAgroovecellbegin {\brdCa \brdBaa} % borders carved into canvas \def \brdAgroovecellend {\brdCb \brdBab} \def \brdAgroovetablebegin {\brdCc \brdBab} \def \brdAgroovetableend {\brdCd \brdBaa} \def \brdAhiddencellbegin {\BRDreset} % borders hidden \let \brdAhiddencellend \brdAhiddencellbegin \let \brdAhiddentablebegin \brdAhiddencellbegin \let \brdAhiddentableend \brdAhiddencellbegin \let \brdAnonecellbegin \brdAhiddencellbegin % borders absent \let \brdAnonecellend \brdAhiddencellbegin \let \brdAnonetablebegin \brdAhiddencellbegin \let \brdAnonetableend \brdAhiddencellbegin \def \brdAinsetcellbegin {\brdCa \brdBba} % box embedded in canvas \def \brdAinsetcellend {\brdCb \brdBca} \def \brdAinsettablebegin {\brdCc \brdBbb} \def \brdAinsettableend {\brdCd \brdBcb} \def \brdAoutsetcellbegin {\brdCa \brdBcb} % box coming out of canvas \def \brdAoutsetcellend {\brdCb \brdBbb} \def \brdAoutsettablebegin {\brdCc \brdBca} \def \brdAoutsettableend {\brdCd \brdBba} \def \brdAridgecellbegin {\brdCa \brdBda} % borders coming out of canvas \def \brdAridgecellend {\brdCb \brdBdb} \def \brdAridgetablebegin {\brdCc \brdBdb} \def \brdAridgetableend {\brdCd \brdBda} \def \brdAdoublecellbegin {\brdCa \brdBea} % simple double borders \def \brdAdoublecellend {\brdCb \brdBeb} \def \brdAdoubletablebegin {\brdCc \brdBeb} \def \brdAdoubletableend {\brdCd \brdBea} \def \brdAsolidcellbegin {\brdDc 3\BRDwt \BRDwl \brdDa 3\BRDwl \BRDwt} \def \brdAsolidcellend {\brdDb 3\BRDwb \BRDwr \brdDd 3\BRDwr \BRDwb} \def \brdAsolidtablebegin {\brdDa 3\BRDwl \BRDwt \brdDc 3\BRDwt \BRDwl} \def \brdAsolidtableend {\brdDd 3\BRDwr \BRDwb \brdDb 3\BRDwb \BRDwr} \def \brdBaa {1221}\def \brdBab {2211} % groove \def \brdBba {0222}\def \brdBbb {2220} % inset \def \brdBca {1212}\def \brdBcb {2121} % outset \def \brdBda {1122}\def \brdBdb {1221} % ridge \def \brdBea {1221}\def \brdBeb {1221} % simple double \def \brdCa #1{\expandafter \brdCaA #1\BRDwt \BRDwl} \def \brdCaA #1#2#3#4#5#6{% skip rule skip rule - cell begin \brdDc {#1}#5#6\brdDa {#2}#6#5\brdDc {#3}#5#6\brdDa {#4}#6#5} \def \brdCb #1{\expandafter \brdCbA #1\BRDwb \BRDwr} \def \brdCbA #1#2#3#4#5#6{% rule skip rule skip - cell end \brdDb {#1}#5#6\brdDd {#2}#6#5\brdDb {#3}#5#6\brdDd {#4}#6#5} \def \brdCc #1{\expandafter \brdCcA #1\BRDwl \BRDwt} \def \brdCcA #1#2#3#4#5#6{% rule skip rule skip - table begin \brdDa {#1}#5#6\brdDc {#2}#6#5\brdDa {#3}#5#6\brdDc {#4}#6#5} \def \brdCd #1{\expandafter \brdCDA #1\BRDwr \BRDwb} \def \brdCDA #1#2#3#4#5#6{% skip rule skip rule - table end \brdDd {#1}#6#5\brdDb {#2}#5#6\brdDd {#3}#6#5\brdDb {#4}#5#6} \def \brdDa #1#2#3{\CLRizeborder \global \brdFdwl = #1#2\global \brdFdwt = #1#3% \ifnum \TABLEnesting < 5 \brdDaA \fi} % drop begin \def \brdDaA {\brdFdw \brdFdwl \brdFdwt \brdDaAA \vbox \bgroup \ifTABLEinter \else \brdEb \brdFdwt \fi \hbox \bgroup \brdEa \brdFdwl \brdDaAA} \def \brdDaAA {\vbox \bgroup \ifTABLEinter \else \vskip \brdFdwt \fi \hbox \bgroup \hskip \brdFdwl} \def \brdDb #1#2#3{\CLRizeborder \global \brdFdwb = #1#2\global \brdFdwr = #1#3% \ifnum \TABLEnesting < 5 \brdDbA \fi} % drop end \def \brdDbA {\brdFdw \brdFdwb \brdFdwr \brdDbAA \brdEa \brdFdwr \egroup \ifTABLEinter \else \brdEb \brdFdwb \fi \egroup \brdDbAA} \def \brdDbAA {\hskip \brdFdwr \egroup \ifTABLEinter \else \vskip \brdFdwb \fi \egroup} % hbox inside vbox with skips of fraction of border-width: \def \brdDc #1#2#3{\brdFlw \brdFlwt {#1#2}\brdFlw \brdFlwl {#1#3}% \vbox \bgroup \ifTABLEinter \else \brdEd \brdFlwt \fi \hbox \bgroup \brdEc \brdFlwl} % lift begin \def \brdDd #1#2#3{\brdFlw \brdFlwr {#1#2}% lift end \brdFlw \brdFlwb {#1#3}\brdEc \brdFlwr \egroup \ifTABLEinter \else \brdEd \brdFlwb \fi \egroup} % drop h,v: \def \brdEa #1{\ifdim #1 >0pt \hskip -#1 \vrule width 2#1 \hskip -#1 \fi} \def \brdEb #1{\ifdim #1 >0pt \vskip -#1 \hrule height 2#1 \vskip -#1 \fi} \def \brdEc #1{\ifCLRbgtable \brdEcA #1 \else \hskip #1 \fi} \def \brdEcA #1{\CLRize \CLRbgtable \hskip 0.1#1\vrule width 0.8#1\hskip 0.1#1} % lift h \def \brdEd #1{\ifCLRbgtable \brdEdA #1 \else \vskip #1 \fi} \def \brdEdA #1{\CLRize \CLRbgtable \vskip 0.1#1\hrule height 0.8#1\vskip 0.1#1} % lift v % drop width (get; bottom, left, right, top): \def \brdFdw #1#2{\global \divide #1 by 12\global \divide #2 by 12 } \ned \brdFdwb \ned \brdFdwl \ned \brdFdwr \ned \brdFdwt % lift width (get; bottom, left, right, top): \def \brdFlw #1#2{\global #1 = #2\global \divide #1 by 6 } \ned \brdFlwb \ned \brdFlwl \ned \brdFlwr \ned \brdFlwt \def \BRDhandle {\ifBRDrulegiven \BRDhandleA \else \BRDreset \fi} \def \BRDhandleA {\BRDwb = 0mm \BRDwl = 0mm \BRDwr = 0mm \BRDwt = 0mm } \let \BRDprofile \empty \def \BRDreset {\BRDw = 0mm \BRDwb = 0mm \BRDwl = 0mm \BRDwr = 0mm \BRDwt = 0mm } \new \ifBRDrulegiven \def \BRDset {\edef \BRDtest {\the \VAL}\BRDsetA} \def \BRDsetA {\BRDrulegiventrue \ifx \BRDtest \CONthin \BRDsetAA {12}% Fixme: check numbers \else \ifx \BRDtest \CONmedium \BRDsetAA 9 \else \ifx \BRDtest \CONthick \BRDsetAA 6 \else \VALsetdim \BRDw \hsize \fi \fi \fi} % Set border-width to a fraction of line-height, if #1 is a keyword % string, or to #1, which is otherwise supposed to be a dimension: \def \BRDsetAA #1{\BRDw = \LINEheight \ifdim \BRDw = 0pt \BRDw = \BOXlineheight \fi \divide \BRDw by #1} \def \BRDsetone #1{\BRDsetoneA = \BRDw \BRDset #1 = \BRDw \BRDw = \BRDsetoneA} \ned \BRDsetoneA \def \BRDupdate {\BRDwb = \BRDw \BRDwl = \BRDw \BRDwr = \BRDw \BRDwt = \BRDw} \ned \BRDw % width \ned \BRDwb \ned \BRDwl \ned \BRDwr \ned \BRDwt % bottom, left, right, top % BOX: ======================================================================= \def \BOXbegin {\SPANcolgivenfalse \xdef \NOcollast {0}% | , | \BOXwidthgivenfalse \OPENfontinnerfalse \leftskip = 0pt \rightskip = 0pt \hbadness = 10000 \ifBOXvaligngiven \let \BOXfillerright \empty \let \BOXfillerleft \empty \else \let \BOXfillertop \vfil \let \BOXfillerright \empty \let \BOXfillerbottom \vfil \let \BOXfillerleft \empty \fi \BOXwidthdefault = \hsize \BOXwidth = \BOXwidthdefault \BRDhandle \NOparreset \ifSPANrowspangiven \SPANrowpre \BOXwidthdefault \fi \SPANcolpre \BOXwidthdefault \LNGchangedetect \ELEMENTvalueget \ifdim \LINEheight > 0pt \edef \BOXlineheight {\the \LINEheight}% \LINEheight = 0pt \fi \boxA \FONTdo \CLRizeforeground \ifdim \LINEheight = 0pt \LINEheight = \BOXlineheight \fi \MSGtdlanguage} \def \SPANrowpre #1{% Fixme: rename \DEFsearch {attSPANrowspan\the \TABLEnesting .\the \NOcol }\ifDEF \edef \test {\csname attSPANrowspan\the \TABLEnesting .\the \NOcol \endcsname }% \count 7 = \NOrow \advance \count 7 by -\test \edef \test {\the \count 7 }% \ifnum \test < 0 \DEFsearch {\CONcolwidth \the \TABLEnesting .\the \NOcol }\ifDEF \edef \test {\csname \CONcolwidth \the \TABLEnesting .\the \NOcol \endcsname}% \ifSPANrowspangivenhere \else \ifx \test \empty {\divide #1 by \BKPtdmax % Fixme: colspan gets lost \multiply #1 by \SPANcollast % Fixme: too simple \hskip #1}\else \hskip \test \fi \gadvance \NOcol by 1 \SPANrowpre {#1}\fi \else {\divide #1 by \BKPtdmax \hskip #1}\fi \fi \fi}% recursion \def \SPANcolpre #1{\DEFsearch {TCOLS\the \NOtable}\ifDEF % Fixme: rename \edef \SPANcolpretest {\csname TCOLS\the \NOtable \endcsname}% \ifx \SPANcolpretest \empty \else \SPANcolpredefault = \SPANcolpretest \fi \fi \ifx \SPANcol \empty \divide #1 by \SPANcolpredefault \else \divide #1 by \SPANcol \fi} \nec \SPANcolpredefault \def \boxA {\hskip 0pt \hbox \bgroup \raise \LINEheight \vtop \bgroup \vskip \MARGIN \hbox \bgroup \hskip \MARGIN \ifSPANrowspangivenhere \else \ifdim \BOXheight < \BOXheightold \BOXheight = \BOXheightold \BOXheightgiventrue \fi \fi \vsize = \BOXheight \ifBOXwidthgiven \hsize = \BOXwidth \else \hsize = \BOXwidthdefault \BOXwidthget \fi \advance \vsize by -2\MARGIN \advance \hsize by -2\MARGIN \ifdim \vfuzz < 1pt \vfuzz = 1pt \fi \ifCLRbg \boxB \fi \ifdim \BRDw > 0mm \BRDupdate \fi \BRDdraw \CONbegin \CONcell \advance \vsize by -\BRDwb \advance \vsize by -\BRDwt \advance \hsize by -\BRDwl \advance \hsize by -\BRDwr \PDGbegin \advance \vsize by -\PDGtop \advance \vsize by -\PDGbottom \advance \hsize by -\PDGleft \advance \hsize by -\PDGright \ifBOXheightgiven \vbox to \vsize \bgroup \else \vbox \bgroup \fi \BOXfillertop \hbox to \hsize \bgroup \strut \BOXfillerleft \vbox \bgroup} \def \boxB {\ifTABLEinter \else \ifBOXheightgiven % background \ifBOXwidthgiven \boxBA \else \boxBB \fi \else \boxBB \fi \fi} \def \boxBA {\CLRize \CLRbackground % dimensioned \vbox {\vskip -\vsize \hbox {% \vrule height \vsize width \hsize \hskip -\hsize }}} \def \boxBB {\CLRize \CLRbackground % undimensioned {\advance \hsize by -\PDGleft \vrule width \hsize \hskip -\hsize }} \let \BOXcellvalign \empty \def \BOXend {\ifOPENtd \boxC \else \ifOPENth \boxC \fi \fi} \def \boxC {\egroup \BOXfillerright \strut \egroup \BOXfillerbottom \egroup \PDGend \BRDdraw \CONend \CONcell \hskip \MARGIN \egroup \vskip \MARGIN \ifSPANrowspangivenhere \vskip -\BOXheight \else \ifdim \BOXheight > \BOXheightold \global \BOXheightold = \BOXheight \fi \fi \egroup \egroup} \let \BOXfillerbottom \empty \let \BOXfillerleft \empty \let \BOXfillerright \empty \let \BOXfillertop \empty \def \BOXgridtrbegin {\global \BOXwidthcolspan = 0pt \BOXheightgivenfalse \BOXwidthdefault = \hsize \BOXwidth = \BOXwidthdefault \BOXheightold = 0pt \BOXheight = \LINEheight} \def \BOXgridtrend {\BOXheightgivenfalse \BOXwidthgivenfalse \OPENtrfalse} \ned \BOXheight \new \ifBOXheightgiven \ned \BOXheightold \ned \BOXheightswapped \def \BOXheightswappedinit {\BOXheightswapped = \BOXheight} \ned \BOXindent \def \BOXinit {\BOXheightgivenfalse \BOXwidthgivenfalse \BOXheight = 0mm \BOXheightswapped = 0mm \BOXindent = \hsize \BOXwidth = \hsize} \edef \BOXlineheight {\the \LINEheight} \def \BOXlineheightset {% \ifnum \TABLEnesting = 1 \edef \BOXlineheight {\the \LINEheight}\fi} \def \BOXrownoadvance {\NOcol = 0 \advance \NOrow by 1 } \def \BOXspancolexec {\ifBOXwidthgiven \xDef {\CONcolwidth \the \TABLEnesting.\the \NOcol} {\the \BOXwidth}\fi} \new \ifBOXvaligngiven \def \BOXvalignset {\edef \BOXvalign {\the \VAL}% \ifx \BOXvalign \CONbottom \BOXvalignsetbottom \BOXvaligngiventrue \else \ifx \BOXvalign \CONtop \BOXvalignsettop \BOXvaligngiventrue \else \ifx \BOXvalign \CONcenter \CHKerryoumeantmiddle \fi \fi \fi} \def \BOXvalignsetbottom {% \let \BOXfillertop \vfill \let \BOXfillerbottom \vfil} \def \BOXvalignsettop {% \let \BOXfillertop \vfil \let \BOXfillerbottom \vfill} \ned \BOXwidth \ned \BOXwidthcolspan \ned \BOXwidthdefault \def \BOXwidthget {\DEFsearch {\CONcolwidth \the \TABLEnesting.\the \NOcol }% \ifDEF \edef \BOXwidthgettest {% \csname \CONcolwidth \the \TABLEnesting.\the \NOcol \endcsname }% \ifx \BOXwidthgettest \empty \else \hsize = \BOXwidthgettest \fi \fi} \new \ifBOXwidthgiven % CHAIN: ===================================================================== % Input file: \def \CHNcheck {\CHNloadnextfalse \glet \CHNhrefnext \empty % \ifOPENobject \else \ifx \CHNhref \empty \else \glet \CHNhrefnext \CHNhref \ENDfalse \CHNloadnexttrue \fi \fi} \def \CHNcopyrelativepath #1#2\to #3{\let \CHNfolderbackup \CHNfoldercurrent \glet \chainNEXTfile \empty \glet \chainNEXTlevel \empty \edef \CHNcopyfirst {#1}% \ifx \CHNcopyfirst \CONslash \edef #3{#1#2/}% Fixme: use some absolute path \else \edef #3{./#1#2/}\fi \expandafter \chnC #3\relax \edef #3{.\CHNfoldercurrent /\chainNEXTfile}% \glet \CHNfoldercurrent \CHNfolderbackup} \def \CHNfile #1{% executed by |
---|