Debian Codegraph @

texmf-dist/source/jadetex/base/jadetex.dtx

raw
1 % \iffalse
2 % RCS: $Id: jadetex.dtx,v 1.14 2003/05/18 11:26:44 icastle Exp $
3 % File: jadetex.dtx. Copyright (C) 1996, 1997, 1998, 2000, 2001
4 % Sebastian Rahtz <[email protected]>
5 % Copyright (C) 2002, 2003
6 % Ian Castle <[email protected]>
7 %
8 % Permission is hereby granted, free of charge, to any person obtaining
9 % a copy of this software and associated documentation files (the
10 % ``Software''), to deal in the Software without restriction, including
11 % without limitation the rights to use, copy, modify, merge, publish,
12 % distribute, sublicense, and/or sell copies of the Software, and to
13 % permit persons to whom the Software is furnished to do so, subject to
14 % the following conditions:
15 %
16 % The above copyright notice and this permission notice shall be included
17 % in all copies or substantial portions of the Software.
18 %
19 % THE SOFTWARE IS PROVIDED ``AS IS'', WITHOUT WARRANTY OF ANY KIND, EXPRESS
20 % OR IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF
21 % MERCHANTABILITY, FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT.
22 % IN NO EVENT SHALL SEBASTIAN RAHTZ BE LIABLE FOR ANY CLAIM, DAMAGES OR
23 % OTHER LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE,
24 % ARISING FROM, OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR
25 % OTHER DEALINGS IN THE SOFTWARE.
26 %
27 %<dsssldef>\ProvidesFile{dsssl.def}
28 %<*dtx>
29 \ProvidesFile{jadetex.ltx}
30 %</dtx>
31 %<package>\NeedsTeXFormat{LaTeX2e}[1995/06/01]
32 %<package>\ProvidesFile{jadetex.ltx}
33 %\GetFileInfo{JadeTeX.dtx}
34 %<driver> \ProvidesFile{jadetex.drv}
35 % \fi
36 % \ProvidesFile{jadetex.dtx}
37 %
38 % \iffalse
39 %<*driver>
40 \documentclass{ltxdoc}
41 \usepackage{times,array,longtable,colortbl}
42 \usepackage[T1]{fontenc}
43 \makeatletter
44 \let\\\@centercr
45
46 \def\arraybackslash{\let\\=\@arraycr}
47 \newcolumntype{P}[1]{>{\raggedright\arraybackslash}p{#1}}
48 \makeatother
49 \EnableCrossrefs
50 \CodelineIndex
51 \begin{document}
52 \title{Jade DSSSL \TeX{} backend macros}
53 \author{Sebastian Rahtz\\Email: \texttt{[email protected]}}
54 \date{printed \today}
55 \maketitle
56 \tableofcontents
57 \DocInput{jadetex.dtx}
58 \end{document}
59 %</driver>
60 % \fi
61 % \CheckSum{4434}
62 % \StopEventually{}
63 %
64 % \section{Introduction}
65 % \subsection{Acknowledgements}
66 % Developed from the skeleton by David Megginson
67 % (\texttt{[email protected]}), who wrote the original Jade
68 % \texttt{TeXFOTBuilder} module. This version incorporates support for
69 % important changes made by Paul Prescod and Kathleen Marszalek for tables;
70 % those changes and the corresponding work in JadeTeX were commissioned by
71 % Novare International, to whom considerable thanks are due.
72 %
73 % Considerable benefit has been had from corrections, additions and
74 % discusions from David Carlisle, Matthias Clasen,
75 % Ulrich Drepper and Christian Leutloff.
76 %
77 % \subsection{Usage}
78 % The file |jadetex.ltx| can either be loaded before the Jade output
79 % or (better) made into a format file for fast loading; it
80 % sits on top of \LaTeX, so do:
81 % \begin{verbatim}
82 % tex -ini \&hugelatex jadetex.ltx '\dump'
83 % \end{verbatim}
84 % Be warned that because many elements can get labelled in JadeTeX, it is
85 % easy to run out of memory. You will very likely need to increase poolsize.
86 %
87 % If you really want to gain speed and save memory,
88 % prepare an even more cut down \LaTeX with unneeded chunks cut out.
89 % (such as the picture environment etc). Be careful and be legal, please.
90 %
91 % We build on \LaTeX, but do not need a lot of the paraphernalia
92 % of the document classes, so we just load the \texttt{minimal} class,
93 % designed for this purpose. We also need access to
94 % input and output font encoding, color, graphics inclusion, and
95 % headers and footers; so we load some standard packages. The
96 % \texttt{inputenc} option is temporary, and needs more thought.
97 % Eventually we want Unicode input working, with Omega.
98 % \begin{macrocode}
99 %<*package>
100 \def\JadeTeXMajorVersion{3}
101 \def\JadeTeXMinorVersion{13}
102 \def\JadeTeXDate{2003/04/27}
103 \documentclass{minimal}
104 \RequirePackage{array}[1995/01/01]
105 \RequirePackage{longtable}[1995/01/01]
106 \RequirePackage{color}[1997/09/09]
107 \RequirePackage{colortbl}
108 \RequirePackage{marvosym}
109 \RequirePackage{graphicx}[1997/06/09]
110 \IfFileExists{multicol.sty}
111 {\RequirePackage{multicol}[1997/12/16]}
112 {\newenvironment{multicols}[1]%
113 {\typeout{Warning, at line \the\inputlineno, multicol package not available}}{}%
114 }
115 \RequirePackage[normalem]{ulem}
116 \RequirePackage{fancyhdr}
117 \makeatletter
118 \count@\time
119 \divide\count@ 60
120 \count2=-\count@
121 \multiply\count2 60
122 \advance\count2 \time
123 \edef\today{%
124 \the\year/\two@digits{\the\month}/\two@digits{\the\day}:%
125 \two@digits{\the\count@}:\two@digits{\the\count2}}
126 \begingroup
127 \catcode`P=12
128 \catcode`T=12
129 \lowercase{\endgroup
130 \gdef\rem@ptetc#1.#2PT#3!{#1\ifnum#2>\z@.#2\fi}%
131 }
132 \def\strip@pt@and@otherjunk#1{\expandafter\rem@ptetc\the#1!}
133 \makeatother
134 \def\TeXFOTversion{0.0}
135 \makeatletter
136 \ifx\pushocplist\@undefined
137 \RequirePackage[implicit=true,colorlinks,linkcolor=black,bookmarks=true]{hyperref}[2000/03/01]
138 \def\PDFBorders{0 0 0}
139 \RequirePackage[dsssl]{inputenc}[1997/12/20]
140 \RequirePackage{mlnames}
141 \RequirePackage{unicode}
142 \def\DefineCharacter#1#2#3{\expandafter\def\csname!#1\endcsname{#3}}
143 \def\DefineEntity#1#2{\expandafter\def\csname Ent#1\endcsname{#2}}
144 \def\Entity#1{\csname Ent#1\endcsname}
145 \input ucharacters.sty
146 \input uentities.sty
147 % \end{macrocode}
148 % Define the characters under 127, normally not provided by ucharacters.sty
149 % \begin{macrocode}
150 \DefineCharacter{32}{20}{\space }
151 \DefineCharacter{33}{21}{!}
152 \DefineCharacter{34}{22}{"}
153 \DefineCharacter{35}{23}{\#}
154 \DefineCharacter{36}{24}{\ifmmode \$\else \textdollar \fi}%
155 \DefineCharacter{37}{25}{\%}
156 \DefineCharacter{38}{26}{\&}
157 \DefineCharacter{39}{27}{\textquotesingle }
158 \DefineCharacter{40}{28}{(}
159 \DefineCharacter{41}{29}{)}
160 \DefineCharacter{42}{2A}{\ensuremath{\ast }}
161 \DefineCharacter{43}{2B}{\ensuremath{+}}
162 \DefineCharacter{44}{2C}{,}
163 \DefineCharacter{45}{2D}{\ensuremath{-}}
164 \DefineCharacter{46}{2E}{.}
165 \DefineCharacter{47}{2F}{/}
166 \DefineCharacter{48}{30}{0}
167 \DefineCharacter{49}{31}{1}
168 \DefineCharacter{50}{32}{2}
169 \DefineCharacter{51}{33}{3}
170 \DefineCharacter{52}{34}{4}
171 \DefineCharacter{53}{35}{5}
172 \DefineCharacter{54}{36}{6}
173 \DefineCharacter{55}{37}{7}
174 \DefineCharacter{56}{38}{8}
175 \DefineCharacter{57}{39}{9}
176 \DefineCharacter{58}{3A}{:}
177 \DefineCharacter{59}{3B}{\ensuremath{;}}
178 \DefineCharacter{60}{3C}{\ensuremath{<}}
179 \DefineCharacter{61}{3D}{=}
180 \DefineCharacter{62}{3E}{\ensuremath{>}}
181 \DefineCharacter{63}{3F}{?}
182 \DefineCharacter{64}{40}{@}
183 \DefineCharacter{65}{41}{A}
184 \DefineCharacter{66}{42}{B}
185 \DefineCharacter{67}{43}{C}
186 \DefineCharacter{68}{44}{D}
187 \DefineCharacter{69}{45}{E}
188 \DefineCharacter{70}{46}{F}
189 \DefineCharacter{71}{47}{G}
190 \DefineCharacter{72}{48}{H}
191 \DefineCharacter{73}{49}{I}
192 \DefineCharacter{74}{4A}{J}
193 \DefineCharacter{75}{4B}{K}
194 \DefineCharacter{76}{4C}{L}
195 \DefineCharacter{77}{4D}{M}
196 \DefineCharacter{78}{4E}{N}
197 \DefineCharacter{79}{4F}{O}
198 \DefineCharacter{80}{50}{P}
199 \DefineCharacter{81}{51}{Q}
200 \DefineCharacter{82}{52}{R}
201 \DefineCharacter{83}{53}{S}
202 \DefineCharacter{84}{54}{T}
203 \DefineCharacter{85}{55}{U}
204 \DefineCharacter{86}{56}{V}
205 \DefineCharacter{87}{57}{W}
206 \DefineCharacter{88}{58}{X}
207 \DefineCharacter{89}{59}{Y}
208 \DefineCharacter{90}{5A}{Z}
209 \DefineCharacter{91}{5B}{[}
210 \DefineCharacter{92}{5C}{\ifmmode \backslash \else \textbackslash \fi}%
211 \DefineCharacter{93}{5D}{]}
212 \DefineCharacter{94}{5E}{\^{}}
213 \DefineCharacter{95}{5F}{\ensuremath{\_}}
214 \DefineCharacter{96}{60}{\textasciigrave }
215 \DefineCharacter{97}{61}{a}
216 \DefineCharacter{98}{62}{b}
217 \DefineCharacter{99}{63}{c}
218 \DefineCharacter{100}{64}{d}
219 \DefineCharacter{101}{65}{e}
220 \DefineCharacter{102}{66}{f}
221 \DefineCharacter{103}{67}{g}
222 \DefineCharacter{104}{68}{h}
223 \DefineCharacter{105}{69}{i}
224 \DefineCharacter{106}{6A}{j}
225 \DefineCharacter{107}{6B}{k}
226 \DefineCharacter{108}{6C}{l}
227 \DefineCharacter{109}{6D}{m}
228 \DefineCharacter{110}{6E}{n}
229 \DefineCharacter{111}{6F}{o}
230 \DefineCharacter{112}{70}{p}
231 \DefineCharacter{113}{71}{q}
232 \DefineCharacter{114}{72}{r}
233 \DefineCharacter{115}{73}{s}
234 \DefineCharacter{116}{74}{t}
235 \DefineCharacter{117}{75}{u}
236 \DefineCharacter{118}{76}{v}
237 \DefineCharacter{119}{77}{w}
238 \DefineCharacter{120}{78}{x}
239 \DefineCharacter{121}{79}{y}
240 \DefineCharacter{122}{7A}{z}
241 \DefineCharacter{123}{7B}{\ensuremath{\lbrace }}
242 \DefineCharacter{124}{7C}{\ensuremath{\vert }}
243 \DefineCharacter{125}{7D}{\ensuremath{\rbrace }}
244 \DefineCharacter{126}{7E}{\textasciitilde }
245 \else
246 % \end{macrocode}
247 % If we are Omega, do some things differently.
248 % From Apostolos Syropoulos <[email protected]>
249 % \begin{macrocode}
250 \RequirePackage{omega}[1999/06/01]
251 \background{greek}
252 \RequirePackage{nohyperref}
253 \RequirePackge{mlnames}
254 \fi
255 % \end{macrocode}
256 % This was suggested by Matthias Clasen, checking that the macros
257 % come from the right version of the Jade TeX backend. The package
258 % will have a n.m version number, where the n changes when Jade changes,
259 % and the m changes when the JadeTeX package changes.
260 % \begin{macrocode}
261 \def\checkFOTversion#1{%
262 \ifx\\#1\\\def\TeXFOTmajor{2}
263 \else
264 \def\TeXFOTmajor{#1}%
265 \fi
266 \let\next\relax
267 \ifnum\TeXFOTmajor>\JadeTeXMajorVersion
268 \message{Your file was generated by Jade TeX backend version \TeXFOTmajor}
269 \message{- these macros are for version \JadeTeXMajorVersion and lower. }
270 \message{I'll stop here...}
271 \let\next\@@end
272 \fi
273 \next}
274 % \end{macrocode}
275 % \section{Inherited characteristics}
276 % Here we list the default values; non-inherited characteristics
277 % will always be specified.
278 % \begin{macrocode}
279 \def\AlignLeader{}
280 \def\AsisWrapIndent{}
281 \def\BackgroundColor{}
282 \let\BackgroundColorRed\@empty
283 \def\BackgroundLayer{}
284 \def\BackgroundTile{}
285 \def\BorderAlignment{}
286 \def\BorderOmitAtBreak{}
287 \def\BorderPresent{0}
288 \def\BorderPriority{}
289 \def\BoxBorderAlignment{}
290 \def\BoxCornerRadius{}
291 \def\BoxOpenEnd{}
292 \def\BoxType{}
293 \def\CellBackground{}
294 \def\CellCrossed{}
295 \def\CellRowAlignment{start}
296 \def\CellBeforeRowMargin{\z@}
297 \def\CellAfterRowMargin{\z@}
298 \def\CellBeforeColumnMargin{\z@}
299 \def\CellAfterColumnMargin{\z@}
300 \def\Color{}
301 \def\Country{}
302 \def\DisplayAlignment{}
303 \def\EndIndent{\z@}
304 \def\EndMargin{}
305 \def\ExpandTabs{}
306 \def\FieldAlign{start}
307 \def\FieldWidth{0pt}
308 \def\FillingDirection{}
309 \def\FirstLineStartIndent{0pt}
310 \def\FloatOutLineNumbers{}
311 \def\FloatOutMarginalia{}
312 \def\FloatOutSidelines{}
313 \def\fFamName{Times-Roman} % Use Adobe Times Roman by default
314 \def\fPosture{normal}
315 \def\fProportionateWidth{medium}
316 \def\fSize{10pt}
317 \def\fStructure{}
318 \def\fWeight{medium}
319 \def\GlyphAlignmentMode{}
320 \def\GlyphReorderMethod{}
321 \def\GlyphSubstMethod{}
322 \def\HangingPunct{}
323 \def\HeadingLevel{0}
324 \def\Hyphenate{}
325 \def\HyphenationKeep{}
326 \def\HyphenationLadderCount{}
327 \def\HyphenationMethod{}
328 \def\HyphenationPushCharCount{}
329 \def\HyphenationRemainCharCount{}
330 \def\IgnoreRecordEnd{}
331 \def\ImplicitBidiMethod{}
332 \def\InhibitLineBreaks{}
333 \def\InputWhitespaceTreatment{}
334 \def\JustifyGlyphSpaceMaxAdd{}
335 \def\JustifyGlyphSpaceMaxRemove{}
336 \def\KernMode{}
337 \def\Kern{}
338 \def\Language{}
339 \def\LastLineEndIndent{}
340 \def\LastLineJustifyLimit{}
341 \def\LastLineQuadding{}
342 \def\Layer{0}
343 \def\Ligature{}
344 \def\LineBreakingMethod{}
345 \def\LineCap{}
346 \def\LineCompositionMethod{}
347 \def\LineJoin{}
348 \def\LineNumberSep{}
349 \def\LineNumberSide{}
350 \def\LineRepeat{}
351 \def\LineSpacing{12pt}
352 \def\Lines{}
353 \def\MarginaliaKeepWithPrevious{}
354 \def\MarginaliaSep{}
355 \def\MarginaliaSide{}
356 \def\MathDisplayMode{display}
357 \def\MinLeaderRepeat{}
358 \def\MinLeading{2\p@}
359 \def\NColumnsSpanned{1}
360 \def\NumberedLines{}
361 \def\OrphanCount{}
362 \def\PositionPreference{}
363 \def\PrincipalModeSimultaneous{}
364 \def\Quadding{start}
365 \def\ScoreSpaces{}
366 \def\SidelineSep{}
367 \def\SidelineSide{}
368 \def\SpanWeak{}
369 \def\Span{0}
370 \def\StartIndent{\z@}
371 \def\StartMargin{}
372 \def\TableAutoWidthMethod{}
373 \def\TableCornerRadius{}
374 \def\TablePartOmitMiddleFooter{0}
375 \def\TablePartOmitMiddleHeader{0}
376 \def\TruncateLeader{}
377 \def\WidowCount{}
378 \def\WritingMode{}
379 \def\AlignLeader{1}% true
380 \def\BreakAfter{0}% false
381 \def\BreakAfterPriority{0}%
382 \def\BreakBefore{0}% false
383 \def\BreakBeforePriority{0}%
384 \def\CoalesceId{0}% false
385 \def\EntitySystemId{}% [required]
386 \def\EscapementDirection{}% [=writing-mode]
387 \def\EscapementSpaceAfterNom{\z@}%
388 \def\EscapementSpaceAfterMin{\z@}%
389 \def\EscapementSpaceAfterMax{\z@}%
390 \def\IdrefAddress{}%
391 \def\IsDisplay{0}% false
392 \def\Keep{0}% false
393 \def\KeepWithNext{0}% false
394 \def\KeepWithPrevious{0}% false
395 \def\MayViolateKeepAfter{0}% false
396 \def\MayViolateKeepBefore{0}% false
397 \def\MaxWidth{!}
398 \def\MaxHeight{!}
399 \def\NotationSystemId{}% [required]
400 \def\Orientation{}% [required]
401 \def\PageNColumns{1}
402 \def\PageNumberRestart{0}
403 \def\PageNumberFormat{1}
404 \expandafter\def\csname PageNumbering@1\endcsname#1{%
405 \expandafter\@arabic#1}
406 \expandafter\def\csname PageNumbering@i\endcsname#1{%
407 \expandafter\@roman#1}
408 \expandafter\def\csname PageNumbering@I\endcsname#1{%
409 \expandafter\@Roman#1}
410 \expandafter\def\csname PageNumbering@a\endcsname#1{%
411 \expandafter\@alph#1}
412 \expandafter\def\csname PageNumbering@A\endcsname#1{%
413 \expandafter\@Alph#1}
414 \expandafter\def\csname PageNumbering@0\endcsname#1{% this shouldn't happen
415 \expandafter\@arabic#1}
416 \expandafter\def\csname PageNumbering@\endcsname#1{%
417 \expandafter\@arabic#1}
418 \def\PageBalanceColumns{0}
419 \def\PageTwoSide{0}
420 \def\TwoSideStartOnRight{0}
421 \def\PageColumnSep{\z@}
422 \def\GridColumnSep{\z@}
423 \def\PositionPointShift{\z@}
424 \def\PositionPointShiftFactor{}
425 \def\PositionPointX{\z@}% ??
426 \def\PositionPointY{\z@}% ??
427 \def\PositionPreference{0}% false
428 \def\ScaleType{max-uniform}%
429 \def\ScaleX{}% [n/a] =scale
430 \def\ScaleY{}% [n/a] =scale
431 \def\ScoreLength{}% ??
432 \def\ScoreType{}% [required] =type
433 \def\saConditional{0}% false =space-after
434 \def\saForce{0}% false =space-after
435 \def\saMax{0pt}% =space-after
436 \def\saMaxFactor{0}% =space-after
437 \def\saMin{0pt}% =space-after
438 \def\saMinFactor{0}% =space-after
439 \def\saNom{0pt}% =space-after
440 \def\saNomFactor{0}% =space-after
441 \def\saPriority{0}% =space-after
442 \let\@sAfterMin\saMin
443 \let\@sAfterMax\saMax
444 \let\@sAfterNom\saNom
445 \let\@sAfterPriority\saPriority
446 \def\sbConditional{0}% false
447 \def\sbForce{0}% false
448 \def\sbMax{0pt}%
449 \def\sbMaxFactor{0}%
450 \def\sbMin{0pt}%
451 \def\sbMinFactor{0}%
452 \def\sbNom{0pt}%
453 \def\sbNomFactor{0}%
454 \def\sbPriority{0}%
455 \newdimen\CurrentSpaceNom
456 \newdimen\CurrentSpaceMin
457 \newdimen\CurrentSpaceMax
458 \newdimen\LastSpaceNom
459 \newdimen\LastSpaceMin
460 \newdimen\LastSpaceMax
461 \CurrentSpaceNom\z@
462 \CurrentSpaceMax\z@
463 \CurrentSpaceMin\z@
464 \LastSpaceNom\z@
465 \LastSpaceMax\z@
466 \LastSpaceMin\z@
467 \def\LastSpaceConditional{0}% false
468 \def\LastSpaceForce{0}% false
469 \def\LastSpaceMaxFactor{0}%
470 \def\LastSpaceMinFactor{0}%
471 \def\LastSpaceNomFactor{0}%
472 \def\LastSpacePriority{0}%
473 \def\TruncateLeader{0}% false
474 \def\Width{}% [required] *
475 \def\Length{}% [context]
476 \def\TableWidth{\hsize}%
477 \def\ColumnIndex{}% [contextual] =column-number?
478 \def\HeaderMargin{\z@}
479 \def\FooterMargin{\z@}
480 \def\LeftMargin{\z@}
481 \def\RightMargin{\z@}
482 \def\TopMargin{\z@}
483 \def\BottomMargin{\z@}
484 \def\PageWidth{211mm}
485 \def\PageHeight{297mm}
486 \def\placement{htbp}
487 \edef\OldFontSize{\fSize}
488 \edef\OldLineSpacing{\LineSpacing}
489 \edef\OldFontPosture{\fPosture}
490 \edef\OldFontProportionateWidth{\fProportionateWidth}
491 \edef\OldFontWeight{\fWeight}
492 \edef\OldfFamName{\fFamName}
493 \let\pageFontSize\fSize
494 \let\pageLineSpacing\LineSpacing
495 \let\pageFontPosture\fPosture
496 \let\pageFontProportionateWidth\fProportionateWidth
497 \let\pageFontWeight\fWeight
498 \let\pagefFamName\fFamName
499 \let\ColorRed\@empty
500 \def\listitem@content@mode{listitem-content-mode}
501 \newtoks\JadeTeXtoks
502 \def\@displaylevel{0}
503 \def\NoLig#1{#1\ifmmode\else\/\fi}
504 \def\DEBUG#1{\typeout{DBG: #1 at \the\inputlineno}}
505 % \end{macrocode}
506 % \section{Nodes and labels}
507 % A node in mode `listitem-content-mode' is allowed to be
508 % labeled, but normally only elements in empty mode
509 % get labels.
510 % \begin{macrocode}
511 \let\Label\@empty
512 \let\Element\@empty
513 \def\Node#1{%
514 \ifnum\Mathcount>1\relax
515 \else
516 \ifx\\#1\\\else
517 \let\ProcessingMode\@empty
518 #1%
519 \ifx\ProcessingMode\@empty\else
520 \ifx\ProcessingMode\listitem@content@mode\else
521 \let\Label\@empty\let\Element\@empty
522 \fi
523 \fi
524 % \typeout{Node <\Label> or <\Element> -- pending at \the\inputlineno}%
525 \fi
526 \fi
527 }
528 \def\endNode#1{%
529 \let\Label\@empty\let\Element\@empty%\noindent
530 }
531 \def\PageLabel#1{%
532 \@bsphack
533 \expandafter\ifx\csname p@#1\endcsname\relax
534 \else
535 \protected@write\@auxout{}%
536 {\string\pagelabel{#1}{\thepage}}%
537 \fi
538 \@esphack}
539 \def\OriginalPageLabel#1{%
540 \@bsphack\protected@write\@auxout{}%
541 {\string\pagelabel{#1}{\thepage}}\@esphack}
542 \def\pagelabel#1#2{\global\@namedef{p@#1}{#2}}
543 \def\Pageref#1{\expandafter\@Setref\csname p@#1\endcsname{#1}}
544 \def\@qqq{qqq}
545 \def\@Setref#1#2{%
546 \ifx#1\relax
547 \immediate\write\@mainaux{\string\pagelabel{#2}{qqq}}%
548 \protect\G@refundefinedtrue
549 \nfss@text{\reset@font\bfseries ??}%
550 \@latex@warning{Reference `#2' on page \thepage \space
551 undefined}%
552 \else
553 \ifx#1\@qqq
554 \protect\G@refundefinedtrue
555 \nfss@text{\reset@font\bfseries ??}%
556 \@latex@warning{Reference `#2' on page \thepage \space undefined}%
557 \else
558 \ifNestedLink{#1}%
559 \else
560 \hyper@@link[Page]{}{page.#1}{#1}%
561 % \typeout{Made a Link at \the\inputlineno, to page.#1}%
562 \fi
563 \fi
564 \fi
565 }
566 %
567 \def\insertCurrentNodePageNumber#1{%
568 \bgroup
569 \SetupICs{#1}%
570 \InlineNIC
571 \ifx\Label\@empty
572 \Pageref{\Element}%
573 \else
574 \Pageref{\Label}%
575 \fi
576 \endInlineNIC
577 \endSetupICs
578 \egroup
579 }
580 % \end{macrocode}
581 %\section{Atomic flow objects}
582 % \begin{macrocode}
583 \def\insertAlignmentPoint#1{}
584 % \end{macrocode}
585 % \subsection{Maths}
586 % \subsubsection{General math sequences}
587 % \begin{macrocode}
588 \def\@display{display}
589 % \end{macrocode}
590 % We are likely to meet nested math sequences, so maintain a counter
591 % to determine if we are at the outer level, and should turn
592 % math (display or inline) off or on.
593 % \begin{macrocode}
594 \newcount\Mathcount
595 \def\MathSeq#1{%
596 \bgroup
597 \SetupICs{#1}%
598 \FlowObjectSetup{0}%
599 \global\advance\Mathcount by 1%
600 \let\Action\relax
601 \ifnum\Mathcount=1
602 \ifx\MathDisplayMode\@display
603 \let\Action\Dmath
604 \else
605 \let\Action\Imath
606 \fi
607 \fi
608 \Action
609 }
610 \def\endMathSeq{%
611 \global\advance\Mathcount by -1%
612 \let\Action\relax
613 \ifnum\Mathcount=0
614 \ifx\MathDisplayMode\@display\let\Action\endDmath\else\let\Action\Imath\fi
615 \fi
616 \Action
617 \endSetupICs
618 \egroup
619 }
620 \def\Dmath{\begingroup\abovedisplayskip\Jadeskip\global\Jadeskip\z@\[}
621 \def\endDmath{\]\endgroup}
622 \def\Imath{$}
623 \def\Cleanmath{\def\Node##1{}\def\endNode##1{}%
624 \def\MathSeq##1{}\def\endMathSeq##1{}
625 }
626 % \end{macrocode}
627 % \subsubsection{Fences}
628 % \begin{macrocode}
629 \def\FenceSerial#1#2#3#4{#1\FlowObjectSetup{0}%
630 {\Cleanmath
631 %
632 % #1: fence characteristics
633 % #2: fence contents
634 % #3 open character
635 % #4 close character
636 %
637 \ifx\\#3\\\left.\else
638 \let\plainCharacter\Character
639 \let\Character\LeftDelimiterCharacter #3%
640 \let\Character\plainCharacter\fi
641 {#2}%
642 \ifx\\#4\\\right.\else
643 \let\plainCharacter\Character
644 \let\Character\RightDelimiterCharacter #4%
645 \let\Character\plainCharacter\fi
646 }%
647 }
648 % \end{macrocode}
649 % Simon Pepping added this, to really make sure the open and close
650 % characters of the fence are proper left and right.
651 % \begin{macrocode}
652 \let\plainCharacter\Character
653 \def\LeftDelimiterCharacter#1{\DelimiterCharacter\left{#1}}%
654 \def\RightDelimiterCharacter#1{\DelimiterCharacter\right{#1}}%
655 \def\DelimiterCharacter#1#2{%
656 \SetupICs{}%
657 \expandafter\ifx\csname !#2\endcsname\relax
658 <#2>\typeout{Warning: Unknown character #2, at \the\inputlineno}%
659 \else\expandafter#1\csname !#2\endcsname\fi % #1 is \left or \right
660 \ifdim\EscapementSpaceAfterNom=\z@
661 \else
662 \@tempdima\EscapementSpaceAfterNom
663 \advance\@tempdima by -\EscapementSpaceAfterMin
664 \@tempdimb\EscapementSpaceAfterNom
665 \advance\@tempdimb by -\EscapementSpaceAfterMax
666 \hskip\EscapementSpaceAfterNom plus \@tempdimb minus \@tempdima%
667 \fi
668 \endSetupICs{}%
669 }
670 % \end{macrocode}
671 % \subsubsection{Fractions}
672 % These simply translate into |{Numerator \over Denominator}|
673 % \begin{macrocode}
674 \def\FractionSerial#1{#1\FlowObjectSetup{0}\bgroup}
675 \def\endFractionSerial{\egroup}
676 \def\FractionDenominator{}
677 \def\endFractionDenominator{}
678 \def\FractionNumerator{}
679 \def\endFractionNumerator{\over }
680 \def\insertFractionBar{}
681 % \end{macrocode}
682 % \subsubsection{Marks}
683 % Waiting to be implemented.
684 % \begin{macrocode}
685 \def\MarkOver#1#2\endMarkOver{}
686 \def\MarkUnder#1#2\endMarkUnder{}
687 \def\MarkSerial#1{}
688 \def\endMarkSerial{}
689 % \end{macrocode}
690 % \subsubsection{Operators/limits}
691 % \begin{macrocode}
692 \def\MathOperatorSerial#1{#1\FlowObjectSetup{0}\begingroup\Cleanmath}
693 \def\endMathOperatorSerial{\endgroup}
694 \def\MathOperatorOperator#1#2\endMathOperatorOperator#3{#1%
695 \mathop{#2}}
696 \def\MathOperatorLowerLimit#1{#1_\bgroup}
697 \def\endMathOperatorLowerLimit#1{\egroup}
698 \def\MathOperatorUpperLimit#1{#1^\bgroup}
699 \def\endMathOperatorUpperLimit#1{\egroup}
700 % \end{macrocode}
701 % \subsubsection{Radicals}
702 % \begin{macrocode}
703 \def\RadicalSerial#1\insertRadicalRadicalDefaulted#2#3\RadicalDegree#4#5\endRadicalDegree#6\endRadicalSerial{#1\FlowObjectSetup{0}%
704 \ifx\\#5\\\ensuremath{\sqrt{#3}}\else\ensuremath{\root #5 \of {#3}}\fi}
705 % \end{macrocode}
706 % \subsubsection{Grids}
707 % \begin{macrocode}
708 \newcount\GridCells
709 \newcount\GridRows
710 \newif\ifExplicitGrid
711 \def\Grid#1{#1%
712 \begingroup
713 \FlowObjectSetup{0}%
714 \Cleanmath
715 \global\GridCells\@ne\global\GridRows0
716 \ifnum\NColumns=0 \ExplicitGridtrue\def\NColumns{25}%
717 \else\ExplicitGridfalse\fi
718 \begin{array}{*{\NColumns}{c}}%
719 }
720 \def\endGrid{\end{array}\endgroup}
721 \def\GridCell#1{#1\FlowObjectSetup{0}}
722 \def\endGridCell#1{%
723 \ifnum\NColumns=\GridCells
724 \global\GridCells\@ne
725 \def\@tempa{\cr}%
726 \else
727 \global\advance\GridCells\@ne
728 \def\@tempa{&}%
729 \fi
730 \@tempa}
731 \def\NewColumn{&}
732 \def\NewRow{\\}
733 % \end{macrocode}
734 % \subsubsection{Superscript, subscript}
735 % \begin{macrocode}
736 \def\Subscript#1#2{_{#2}}
737 \def\Superscript#1#2{^{#2}}
738 % \end{macrocode}
739 % \subsubsection{Unmath}
740 % \begin{macrocode}
741 \def\Unmath#1#2{%
742 {\SetupICs{#1}\mbox{#2}\endSetupICs}%
743 }
744 % \end{macrocode}
745 % \subsubsection{ScriptSerial}
746 % \begin{macrocode}
747 \def\ScriptSerial#1#2#3#4#5#6#7#8{%
748 \ifx$#3#4$%
749 \else
750 \vphantom{#2}_{#4}^{#3}%
751 \fi
752 \ifx$#7#8$%
753 {#2}%
754 \else
755 {\mathop{#2}\limits_{#8}^{#7}}\vphantom{#2}%
756 \fi
757 _{#6}^{#5}}
758 % \end{macrocode}
759 % \subsection{External Graphic flow object class (clause 12.6.15)}
760 % How we include graphics depends on the NotationSystemId.
761 % Ulrich Drepper <[email protected]> worked this
762 % out, and he also made the alignment and indentation work correctly.
763 %If any other notation needs special
764 % handling it can be implemented by adding a macro
765 % |insertExternalGraphicNotationXXX|
766 % where XXX is the notation name.
767 % \begin{macrocode}
768 \def\insertExternalGraphic#1{%
769 \begingroup
770 \SetupICs{#1}%
771 \expandafter\ifx\csname insertExternalGraphicNotation\NotationSystemId\endcsname\relax%
772 \insertExternalGraphicNotation%
773 \else
774 \csname insertExternalGraphicNotation\NotationSystemId\endcsname
775 \fi
776 \endgroup
777 }
778 \newbox\jadeGraphic
779 \newdimen\jadeGraphicHeight
780 \newdimen\jadeGraphicWidth
781 \def\insertExternalGraphicNotation{%
782 \ifnum\@TableNest>0\def\IsDisplay{0}\fi
783 \ExternalGraphicNIC
784 \ifcase\IsDisplay
785 % 0, its inline
786 \setbox\jadeGraphic=\hbox{\expandafter\IncludeGraphic\EntitySystemId\\}%
787 \noindent%Enter hmode
788 \ifdim\PositionPointX>\z@
789 \kern -\PositionPointX
790 \fi
791 \ifnum\Layer>0%
792 % Graphic drawn at layer > 0 overwrites surrounding text
793 \jadeGraphicWidth=\wd\jadeGraphic
794 \raisebox{-\PositionPointY}[\z@][\z@]{\box\jadeGraphic}
795 \kern\PositionPointX\kern-\jadeGraphicWidth
796 \else
797 \jadeGraphicHeight=\ht\jadeGraphic
798 \advance\jadeGraphicHeight by \dp\jadeGraphic
799 \advance\jadeGraphicHeight by -\PositionPointY
800 \raisebox{-\PositionPointY}[\jadeGraphicHeight][\PositionPointY]{%
801 \box\jadeGraphic
802 }%
803 \fi
804 % 1 its display
805 \or%
806 \DisplayNIC
807 \@@par%
808 \@tempdima\columnwidth
809 \nointerlineskip
810 \ifdim\EndIndent>\z@
811 \advance\@tempdima by-\EndIndent
812 \fi
813 \ifdim\StartIndent>\z@
814 \advance\@tempdima by-\StartIndent
815 \moveright\StartIndent
816 \fi
817 \hbox to\@tempdima{%
818 \ifx\DisplayAlignment\A@center\hfill\fi%
819 \ifx\DisplayAlignment\A@end\hfill\fi%
820 \expandafter\IncludeGraphic\EntitySystemId\\%
821 \ifx\DisplayAlignment\A@center\hfill\fi%
822 \ifx\DisplayAlignment\A@start\hfill\fi%
823 }%
824 \@@par%
825 \else%
826 \expandafter\IncludeGraphic\EntitySystemId\\%
827 \fi
828 \endExternalGraphicNIC
829 \ifcase\IsDisplay
830 \or
831 \endDisplayNIC
832 \fi
833 }
834 \def\insertExternalGraphicNotationTEX{%
835 \input\EntitySystemId
836 }
837 \def\IncludeGraphic{\@ifnextchar<{\@IncludeGraphic}{\@IncludeGraphic<>}}
838 \def\scale@max{max}
839 \def\scale@false{false}
840 \def\scale@maxuniform{max-uniform}
841 % \end{macrocode}
842 % There are three situations: ScaleX and ScaleY are supplied
843 % (possibly identical), in which case ScaleType is `false', or
844 % ScaleType is `max' or `max-uniform' (the default); in the latter
845 % cases, use MaxWidth and MaxHeight, with and without preserved
846 % aspect ratio. The width and height default to \LaTeX{} graphics package
847 % `!', ie their natural size. I \emph{think} this is the right
848 % interpretation of the standard.
849 % \begin{macrocode}
850 \def\Exclams{!!}
851 \def\@IncludeGraphic<#1>#2\\{%
852 \ifx\ScaleType\scale@false
853 \ifx\ScaleX\ScaleY
854 \scalebox{\ScaleX}{\includegraphics{#2}}%
855 \else
856 \scalebox{\ScaleX}[\ScaleY]{\includegraphics{#2}}%
857 \fi
858 \else
859 \ifx\ScaleType\scale@maxuniform
860 \edef\MaxBoth{\MaxHeight\MaxWidth}%
861 \ifx\MaxBoth\Exclams
862 \includegraphics{#2}%
863 \else
864 \includegraphics[width=\MaxWidth,keepaspectratio=true,
865 height=\MaxHeight]{#2}%
866 \fi
867 \else
868 \ifx\ScaleType\scale@max
869 \includegraphics[width=\MaxWidth,height=\MaxHeight,
870 keepaspectratio=false]{#2}%
871 \else
872 \typeout{ERROR: invalid scale type of \ScaleType}%
873 \fi
874 \fi
875 \fi
876 }
877 \def\insertPageNumber#1{#1%
878 \csname PageNumbering@\PageNumberFormat\endcsname\c@page}
879 \def\insertParagraphBreak#1{\@@par}
880 %
881 \def\horizontal{horizontal}
882 \def\vertical{vertical}
883 \def\escapement{escapement}
884 \def\LineThickness{1pt}
885 \def\A@center{center}
886 \def\A@end{end}
887 \def\A@start{start}
888 \def\insertRule#1{%
889 \bgroup
890 \SetupICs{#1}%
891 \def\IsDisplay{0}
892 \ifx\Orientation\horizontal\def\IsDisplay{1}\fi
893 \ifx\Orientation\vertical\def\IsDisplay{1}\fi
894 \RuleNIC
895 \ifcase\IsDisplay
896 % 0, its inline
897 \ifx\Orientation\escapement
898 \ifx\Length\@empty
899 % Length isn't specified, so it depends of the context.
900 % No rule is a good context ;-)
901 \else
902 \noindent\raisebox{\PositionPointShift}[\z@][\z@]{\vrule width \Length height \LineThickness depth \z@}
903 \ifnum\Layer>0
904 \kern-\Length%
905 \fi
906 \fi
907 \else
908 % Line-progression orientation doesn't affect placement of subsequent
909 % flow object. [Note 104]
910 \ifx\Length\@empty
911 % Length isn't specified, so it depends of the context.
912 % No rule is a good context ;-)
913 \else
914 \raisebox{\PositionPointShift}[\z@][\z@]{\vrule width \LineThickness height \z@ depth \Length}
915 \fi
916 \kern-\LineThickness%
917 \fi
918 % 1 its display
919 \or%
920 \DisplayNIC
921 \@@par%
922 \@tempdima\linewidth
923 \nointerlineskip
924 \ifdim\EndIndent>\z@
925 \advance\@tempdima by-\EndIndent
926 \fi
927 \ifdim\StartIndent>\z@
928 \advance\@tempdima by-\StartIndent
929 \moveright\StartIndent
930 \fi
931 \hbox to\@tempdima{%
932 \ifx\DisplayAlignment\A@center\hfill\fi
933 \ifx\DisplayAlignment\A@end\hfill\fi
934 \ifx\Orientation\horizontal
935 \ifx\Length\@empty\else \hbox to \Length\fi
936 {\leaders\hrule height \LineThickness \hfill}%
937 \else
938 \hbox to \LineThickness {\leaders\hrule
939 \ifx\Length\@empty\else height \Length \fi \relax
940 \hfill}%
941 \fi
942 \ifx\DisplayAlignment\A@center\hfill\fi
943 \ifx\DisplayAlignment\A@start\hfill\fi
944 }%
945 \nointerlineskip
946 \@@par%
947 \else%
948 % Unknown IsDiplay
949 \typeout{ERROR: invalid IsDisplay value of \IsDisplay}%
950 \fi
951 \endRuleNIC
952 \ifcase\IsDisplay
953 \or
954 \endDisplayNIC
955 \fi
956 \endSetupICs
957 \egroup
958 }
959 % \end{macrocode}
960 % \subsection{Tables}
961 % \begin{macrocode}
962 \setlength\arraycolsep\z@
963 \setlength\tabcolsep\z@
964 %\extrarowheight3\p@
965 \setlength\arrayrulewidth{.4\p@}
966 \setlength\doublerulesep{2\p@}
967 \def\arraybackslash{\let\\=\@arraycr}
968 \renewcommand{\arraystretch}{0}
969 % Those are for backward compatibility
970 \newcolumntype{L}[1]{>{\raggedright\arraybackslash}p{#1}}
971 \newcolumntype{C}[1]{>{\centering\arraybackslash}p{#1}}
972 \newcolumntype{R}[1]{>{\raggedleft\arraybackslash}p{#1}}
973 % Those columns defs follows the direction of the corresponding
974 % keys on a QWERTY keyboard.
975 \newcolumntype{T}[3]{@{\hspace{#1}}>{\raggedright\arraybackslash}p{#2}@{\hspace{#3}}}
976 \newcolumntype{Y}[3]{@{\hspace{#1}}>{\centering\arraybackslash}p{#2}@{\hspace{#3}}}
977 \newcolumntype{U}[3]{@{\hspace{#1}}>{\raggedleft\arraybackslash}p{#2}@{\hspace{#3}}}
978 \newcolumntype{G}[3]{@{\hspace{#1}}>{\raggedright\arraybackslash}m{#2}@{\hspace{#3}}}
979 \newcolumntype{H}[3]{@{\hspace{#1}}>{\centering\arraybackslash}m{#2}@{\hspace{#3}}}
980 \newcolumntype{J}[3]{@{\hspace{#1}}>{\raggedleft\arraybackslash}m{#2}@{\hspace{#3}}}
981 \newcolumntype{B}[3]{@{\hspace{#1}}>{\raggedright\arraybackslash}b{#2}@{\hspace{#3}}}
982 \newcolumntype{N}[3]{@{\hspace{#1}}>{\centering\arraybackslash}b{#2}@{\hspace{#3}}}
983 \newcolumntype{M}[3]{@{\hspace{#1}}>{\raggedleft\arraybackslash}b{#2}@{\hspace{#3}}}
984 % The numeric column types follows the numeric keypad direction
985 % and support colour
986 \newcolumntype{7}[4]{@{\hspace{#1}}>{\columncolor[rgb]{#4}\raggedright\arraybackslash}p{#2}@{\hspace{#3}}}
987 \newcolumntype{8}[4]{@{\hspace{#1}}>{\columncolor[rgb]{#4}\centering\arraybackslash}p{#2}@{\hspace{#3}}}
988 \newcolumntype{9}[4]{@{\hspace{#1}}>{\columncolor[rgb]{#4}\raggedleft\arraybackslash}p{#2}@{\hspace{#3}}}
989 \newcolumntype{4}[4]{@{\hspace{#1}}>{\columncolor[rgb]{#4}\raggedright\arraybackslash}m{#2}@{\hspace{#3}}}
990 \newcolumntype{5}[4]{@{\hspace{#1}}>{\columncolor[rgb]{#4}\centering\arraybackslash}m{#2}@{\hspace{#3}}}
991 \newcolumntype{6}[4]{@{\hspace{#1}}>{\columncolor[rgb]{#4}\raggedleft\arraybackslash}m{#2}@{\hspace{#3}}}
992 \newcolumntype{1}[4]{@{\hspace{#1}}>{\columncolor[rgb]{#4}\raggedright\arraybackslash}b{#2}@{\hspace{#3}}}
993 \newcolumntype{2}[4]{@{\hspace{#1}}>{\columncolor[rgb]{#4}\centering\arraybackslash}b{#2}@{\hspace{#3}}}
994 \newcolumntype{3}[4]{@{\hspace{#1}}>{\columncolor[rgb]{#4}\raggedleft\arraybackslash}b{#2}@{\hspace{#3}}}
995 \newcount\@tmpcounta
996 \def\JadeRowSpanBox#1{\csname jadeRowSpanBox#1\endcsname}
997 \def\JadeRowSpanSpace#1{\csname jadeRowSpanSpace#1\endcsname}
998 \def\JadeRowSpan{%
999 \expandafter\ifx\csname jadeRowSpanBox\ColumnIndex\endcsname\relax
1000 \expandafter\newbox\csname jadeRowSpanBox\ColumnIndex\endcsname
1001 \expandafter\newdimen\csname jadeRowSpanSpace\ColumnIndex\endcsname
1002 \fi
1003 \setbox\JadeRowSpanBox{\ColumnIndex}\vtop\bgroup\noindent%
1004 }
1005 \def\endJadeRowSpan{%
1006 \egroup%
1007 \global\JadeRowSpanSpace{\ColumnIndex}\ht\JadeRowSpanBox{\ColumnIndex}%
1008 \global\advance\JadeRowSpanSpace{\ColumnIndex} by \dp\JadeRowSpanBox{\ColumnIndex}%
1009 \@tempdima\ht\JadeRowSpanBox{\ColumnIndex}%
1010 \@tempdimb\dp\JadeRowSpanBox{\ColumnIndex}%
1011 \@tmpcounta\NRowsSpanned%
1012 \advance\@tmpcounta by -1%
1013 \@tempdima\CellBeforeRowMargin%
1014 \@tempdimb\CellAfterRowMargin%
1015 \multiply\@tempdima by \@tmpcounta%
1016 \multiply\@tempdimb by \@tmpcounta%
1017 \global\advance\JadeRowSpanSpace{\ColumnIndex} by -\@tempdima%
1018 \global\advance\JadeRowSpanSpace{\ColumnIndex} by -\@tempdimb%
1019 \global\divide\JadeRowSpanSpace{\ColumnIndex} by \NRowsSpanned%
1020 \vtop to \JadeRowSpanSpace{\ColumnIndex}{\unvbox\JadeRowSpanBox{\ColumnIndex}}
1021 }
1022 \def\JadeRowSpanFiller{%
1023 \expandafter\ifx\csname jadeRowSpanBox\ColumnIndex\endcsname\relax
1024 \errmessage{Invalid row span identifier}
1025 \fi
1026 \vtop to \JadeRowSpanSpace{\ColumnIndex}{}%
1027 }
1028 \def\insertTableAfterColumnBorder#1{}
1029 \def\insertTableAfterRowBorder#1{}
1030 \def\insertTableBeforeColumnBorder#1{}
1031 \def\insertTableBeforeRowBorder#1{}
1032 %
1033 \def\insertTableCellAfterColumnBorder#1{\edef\AfterCol{\BorderPresent}}
1034 \def\insertTableCellAfterRowBorder#1{\edef\AfterRow{\BorderPresent}}
1035 \def\insertTableCellBeforeColumnBorder#1{\edef\BeforeCol{\BorderPresent}}
1036 \def\insertTableCellBeforeRowBorder#1{\edef\BeforeRow{\BorderPresent}}
1037 \def\insertTableColumn#1{#1}
1038 % \end{macrocode}
1039 % \section{Non-atomic flow objects}
1040 % \subsection{Box flow object class}
1041 % \begin{macrocode}
1042 \def\BOX#1{%
1043 \SetupICs{#1}%
1044 \fboxrule\LineThickness
1045 \@tempdima\columnwidth
1046 \ifdim\EndIndent>\z@
1047 \advance\@tempdima by-\EndIndent
1048 \fi
1049 \ifdim\StartIndent>\z@
1050 \advance\@tempdima by-\StartIndent
1051 \hspace*{\StartIndent}%
1052 \fi
1053 \advance\@tempdima by-\StartIndent
1054 \setbox0\vbox\bgroup\def\StartIndent{\z@}\hsize\@tempdima\ignorespaces}
1055 \def\endBOX{%
1056 \ifhmode\unskip\fi
1057 \egroup%
1058 % FIXME: we aren't handling box-type: 'both
1059 \ifx\BackgroundColorRed\@empty
1060 \ifdim\ht0>\ht\strutbox
1061 \noindent\fbox{\box0}%
1062 \else
1063 \setbox0\vbox{\unvbox0\global\setbox1\lastbox}%
1064 \noindent\fbox{\kern-\parindent\unhbox1\unskip\unskip}%
1065 \fi
1066 \else
1067 \c@lor@RGB@rgb{\BackgroundColorRed}\@tempa
1068 \c@lor@RGB@rgb{\BackgroundColorGreen}\@tempb
1069 \c@lor@RGB@rgb{\BackgroundColorBlue}\@tempc
1070 \ifdim\ht0>\ht\strutbox
1071 \noindent\colorbox[rgb]{\@tempa, \@tempb, \@tempc}{\box0}%
1072 \else
1073 \setbox0\vbox{\unvbox0\global\setbox1\lastbox}%
1074 \noindent\colorbox[rgb]{\@tempa, \@tempb, \@tempc}{\kern-\parindent\unhbox1\unskip\unskip}%
1075 \fi
1076 \fi%
1077 }
1078 % \end{macrocode}
1079 % \subsection{Multicolumn management macros}
1080 % Contributed by Simon Pepping.
1081 % \begin{macrocode}
1082 \def\closeOrOpenMulticols#1{%
1083 % juggling with nesting levels
1084 {#1\global\edef\SavedSpan{\Span}}%
1085 \ifnum\@displaylevel=0\relax\ifnum\PageNColumns>1\relax
1086 % close
1087 \ifnum\SavedSpan>1\relax
1088 \ifnum\col@number>1\relax % in multicols
1089 \ifnum\PageBalanceColumns>0
1090 \end{multicols}
1091 \else
1092 % \endmulticols*
1093 \vfill\end{multicols}
1094 \fi
1095 \fi
1096 % or delayed open
1097 \else % not \ifnum\SavedSpan>1\relax
1098 \ifnum\col@number=1 % not in multicols
1099 \columnsep\PageColumnSep
1100 \ifnum\PageBalanceColumns>0
1101 \begin{multicols}{\PageNColumns}
1102 \else
1103 % \begin{multicols*}{\PageNColumns}
1104 \let\balance@columns@out
1105 \multi@column@out
1106 \begin{multicols}{\PageNColumns}
1107 \fi
1108 \fi
1109 \fi
1110 \fi\fi
1111 }
1112
1113 \def\openMulticols{%
1114 \ifnum\@displaylevel=0\relax
1115 \def\@displaylevel{1}%
1116 % local to this nesting level, for use by endDisplayGroup
1117 \edef\@SavedSpan{\SavedSpan}
1118 \ifnum\PageNColumns>1\relax
1119 \ifnum\@SavedSpan>1\relax
1120 \ifnum\@SavedSpan=\PageNColumns\else
1121 \columnsep\PageColumnSep
1122 \ifnum\PageBalanceColumns>0
1123 \begin{multicols}{\PageNColumns}
1124 \else
1125 % \begin{multicols*}{\PageNColumns}
1126 \let\balance@columns@out
1127 \multi@column@out
1128 \begin{multicols}{\PageNColumns}
1129 \fi
1130 \fi
1131 \fi
1132 \fi
1133 \else
1134 \def\@displaylevel{2}%
1135 \fi
1136 }
1137
1138 \def\closeMulticols{%
1139 \ifnum\@displaylevel=1\ifnum\PageNColumns>1\relax
1140 \ifnum\@SavedSpan>1\relax
1141 \ifnum\@SavedSpan=\PageNColumns\else
1142 \ifnum\PageBalanceColumns>0
1143 \end{multicols}
1144 \else
1145 % \endmulticols*
1146 \vfill\end{multicols}
1147 \fi
1148 \fi
1149 \fi
1150 \fi\fi
1151 }
1152 % \end{macrocode}
1153 % \subsection{Display group flow object class (clause 12.6.2)}
1154 % \begin{macrocode}
1155 \def\Keep@Page{page}
1156 \def\Keep@Column{column}
1157 \newif\ifKeepPage
1158 \KeepPagefalse
1159 \def\DisplayGroup#1{\ifnum\@TableNest>0\SetupICs{#1}\else\@DisplayGroup{#1}\fi}
1160 \def\@DisplayGroup#1{%
1161 \closeOrOpenMulticols{#1}
1162 \begingroup
1163 \SetupICs{#1}%
1164 \FlowObjectSetup{1}%
1165 \ifx\Keep\Keep@Page\KeepPagetrue
1166 \else
1167 \ifx\Keep\Keep@Column\KeepPagetrue
1168 \else
1169 \KeepPagefalse
1170 \fi
1171 \fi
1172 \ifKeepPage
1173 \vbox\bgroup
1174 \fi
1175 \DisplayGroupNIC
1176 \ifnum\Mathcount>0\relax
1177 \else\everypar{\UseJadevskip{everypar}}\@@par
1178 \fi
1179 \FlowObjectSetup{1}%
1180 \openMulticols
1181 }
1182 \def\endDisplayGroup#1{\ifnum\@TableNest>0\else\@endDisplayGroup{#1}\fi}
1183 \def\@endDisplayGroup#1{%
1184 \closeMulticols
1185 \ifnum\Mathcount>0\relax\else
1186 \@@par
1187 \fi
1188 \endDisplayGroupNIC
1189 \ifKeepPage
1190 \egroup
1191 \fi
1192 \endgroup
1193 \gdef\SavedSpan{0}%
1194 % \end{macrocode}
1195 % This eats the parindent, and then restores an empty everypar;
1196 % it is called by an implicit start of hmode. Contributed by Simon Pepping.
1197 % \begin{macrocode}
1198 \everypar{{\leavevmode\setbox\z@\lastbox \UseJadevskip{everypar}}%
1199 \everypar{\UseJadevskip {everypar}}%
1200 }
1201 }
1202 % \end{macrocode}
1203 % \subsection{Leader flow object class}
1204 % \begin{macrocode}
1205 \newsavebox{\leaderbox}
1206 \def\Leader#1{#1\begin{LRbox}{\leaderbox}}
1207 \def\endLeader{\end{LRbox}\noindent\leaders\box\leaderbox\hfill}
1208 % \end{macrocode}
1209 % \subsection{Line Field flow object class}
1210 % Field align can be \emph{start}, \emph{end}, or \emph{center}.
1211 % \begin{macrocode}
1212 \newsavebox\dssslbox
1213 \def\LRbox#1{%
1214 \edef\reserved@a{%
1215 \endgroup
1216 \setbox#1\hbox{%
1217 \begingroup\aftergroup}%
1218 \def\noexpand\@currenvir{\@currenvir}}%
1219 \reserved@a
1220 \@endpefalse
1221 \color@setgroup\ignorespaces
1222 }
1223 \def\LRboxW#1#2{%
1224 \edef\reserved@a{%
1225 \endgroup
1226 \setbox#1\hbox to #2{%
1227 \begingroup\aftergroup}%
1228 \def\noexpand\@currenvir{\@currenvir}}%
1229 \reserved@a
1230 \@endpefalse
1231 \color@setgroup\ignorespaces
1232 }
1233 \def\endLRbox{\color@endgroup}
1234 \let\endLRboxW\endLRbox
1235 \def\LineField#1{\bgroup
1236 \SetupICs{#1}%
1237 \LineFieldNIC
1238 \FlowObjectSetup{0}%
1239 \begin{LRbox}{\dssslbox}%
1240 }
1241 \def\endLineField{%
1242 \end{LRbox}%
1243 \ifdim\wd\dssslbox>\FieldWidth\def\FieldWidth{\wd\dssslbox}\fi
1244 \makebox[\FieldWidth][\csname Fld@\FieldAlign\endcsname]{%
1245 \ifdim\PositionPointShift=\z@
1246 \usebox{\dssslbox}%
1247 \else
1248 \raisebox{\PositionPointShift}{\usebox{\dssslbox}}%
1249 \fi
1250 \EndSetFont}%
1251 \endLineFieldNIC
1252 \endSetupICs
1253 \egroup
1254 }
1255 %
1256 % \end{macrocode}
1257 % \subsection{Link flow object class (clause 12.6.28.3)}
1258 % \begin{macrocode}
1259 \newif\ifLabelElements
1260 \LabelElementstrue
1261 \newif\ifNestedLink
1262 \NestedLinkfalse
1263 \def\LinkType{link}
1264 \def\Link#1{%
1265 \begingroup
1266 \SetupICs{#1}%
1267 \ifx\Label\@empty\let\Label\Element\fi
1268 % \typeout{Made a Link at \the\inputlineno, to \Label}%
1269 \hyper@linkstart{\LinkType}{\Label}%
1270 \NestedLinktrue
1271 }
1272 \def\endLink{%
1273 \hyper@linkend
1274 \NestedLinkfalse
1275 \endSetupICs
1276 \endgroup
1277 }
1278 % \end{macrocode}
1279 % \subsection{Marginalia flow object class (clause 12.6.28.4)}
1280 % \begin{macrocode}
1281 \def\Marginalia#1{#1\FlowObjectSetup{0}}
1282 \def\endMarginalia{}
1283 % \end{macrocode}
1284 % \subsection{Paragraph flow object class (clause 12.6.6)}
1285 %\begin{longtable}{|P{.2\textwidth}|l|P{.25\textwidth}|l|l|}
1286 %\hline
1287 %\itshape
1288 %Characteristic&
1289 %\itshape Inh.&\itshape Values&\itshape Default&\itshape Dsssl-o\\
1290 %\hline
1291 %\endhead
1292 %\hline
1293 %\endfoot
1294 %lines&I&wrap, asis, asis-wrap*, asis-truncate*, none&wrap&Partial\\
1295 %\rowcolor{yellow}
1296 %asis-truncate-char&I&\#f, \emph{char object}& &Ignore\\
1297 %asis-wrap-char&I&\#f, \emph{char object}& &Ignore\\
1298 %\rowcolor{yellow}
1299 %asis-wrap-indent&I&\emph{length-spec}& &Ignore\\
1300 %first-line-align&I&\#f, \emph{char object}& &Ignore\\
1301 %\rowcolor{yellow}
1302 %alignment-point-offset&I&\#f, \emph{number between 0 and 100}& &Ignore\\
1303 %ignore-record-end?&I&\#f, \#t&\#f&Standard\\
1304 %\rowcolor{yellow}
1305 %expand-tabs?&I&\#f, \emph{integer greater than zero}&8&Standard\\
1306 %line-spacing&I&\emph{length-spec}&12pt&Standard\\
1307 %\rowcolor{yellow}
1308 %line-spacing-priority&I&force, \emph{integer}&0&Default\\
1309 %min-pre-line-spacing&I&\#f, \emph{length-spec}&\#f&Default\\
1310 %\rowcolor{yellow}
1311 %min-post-line-spacing&I&\#f, \emph{length-spec}&\#f&Default\\
1312 %min-leading&I&\#f, \emph{length-spec}&\#f&Standard\\
1313 %\rowcolor{yellow}
1314 %first-line-start-indent&I&\emph{length-spec}&0m&Standard\\
1315 %last-line-end-indent&I&\emph{length-spec}&0m&Default\\
1316 %\rowcolor{yellow}
1317 %hyphenation-char&I&\emph{character}& &Ignore\\
1318 %hyphenation-method&I&\#f, \emph{public identifier}&\#f&Default\\
1319 %\rowcolor{yellow}
1320 %hyphenation-ladder-count&I&\#f, \emph{integer greater than zero}&\#f&Default\\
1321 %hyphenation-remain-char-count&I&\emph{positive integer}&2&Ignore\\
1322 %\rowcolor{yellow}
1323 %hyphenation-push-char-count&I&\emph{positive integer}&2&Ignore\\
1324 %hyphenation-keep&I&\#f, spread, page, column&\#f&Default\\
1325 %\rowcolor{yellow}
1326 %hyphenation-exceptions&I&\emph{list of strings}&empty list&Default\\
1327 %line-breaking-method&I&\#f, \emph{public identifier}&\#f&Default\\
1328 %\rowcolor{yellow}
1329 %line-composition-method&I&\#f, \emph{public identifier}&\#f&Default\\
1330 %implicit-bidi-method&I&\#f, \emph{public identifier}& &Default\\
1331 %\rowcolor{yellow}
1332 %glyph-alignment-mode&I&base, center, top, bottom, font&font&Default\\
1333 %font-family-name&I&\#f, \emph{string}&iso-serif&Standard\\
1334 %\rowcolor{yellow}
1335 %font-weight&I&\#f, not-applicable*, ultra-light*, extra-light*, light, semi-light*, medium, semi-bold*, bold, extra-bold*, ultra-bold*&medium&Partial\\
1336 %font-posture&I&\#f, not-applicable*, upright, oblique, back-slanted-oblique*, italic, back-slanted-italic*&upright&Partial\\
1337 %\rowcolor{yellow}
1338 %font-structure&I&\#f, not-applicable, solid, outline&solid&Default\\
1339 %font-proportionate-width&I&\#f, not-applicable*, ultra-condensed*, extra-condensed*, condensed, semi-condensed*, medium, semi-expanded*, expanded, extra-expanded*, ultra-expanded*&medium&Partial\\
1340 %\rowcolor{yellow}
1341 %font-name&I&\#f, \emph{public identifier}& &Standard\\
1342 %font-size&I&\emph{length}&10pt&Standard\\
1343 %\rowcolor{yellow}
1344 %numbered-lines?&I&\#f, \#t&\#t&Ignore\\
1345 %line-number&I&\#f, \emph{unlabeled sosofo}& &Ignore\\
1346 %\rowcolor{yellow}
1347 %line-number-side&I&start, end, spread-inside, spread-outside, page-inside, page-outside& &Ignore\\
1348 %line-number-sep&I&\emph{length-spec}& &Ignore\\
1349 %\rowcolor{yellow}
1350 %quadding&I&start, end, spread-inside*, spread-outside*, page-inside*, page-outside*, center, justify*&start&Partial\\
1351 %last-line-quadding&I&relative, start, end, spread-inside, spread-outside, page-inside, page-outside, center, justify&relative&Default\\
1352 %\rowcolor{yellow}
1353 %last-line-justify-limit&I&\emph{length-spec}&0&Ignore\\
1354 %justify-glyph-space-max-add&I&\emph{length-spec}&0m&Ignore\\
1355 %\rowcolor{yellow}
1356 %justify-glyph-space-max-remove&I&\emph{length-spec}&0m&Ignore\\
1357 %hanging-punct?&I&\#f, \#t&\#f&Default\\
1358 %\rowcolor{yellow}
1359 %widow-count&I&\emph{positive integer}&2&Default\\
1360 %orphan-count&I&\emph{positive integer}&2&Default\\
1361 %\rowcolor{yellow}
1362 %language&I&\#f, \emph{ISO 639 language code}&\#f&Standard\\
1363 %country&I&\#f, \emph{ISO 3166 country code}&\#f&Standard\\
1364 %\rowcolor{yellow}
1365 %position-preference&N&\#f, top, bottom&\#f&Ignore\\
1366 %writing-mode&I&left-to-right, right-to-left, top-to-bottom&left-to-right&Default\\
1367 %\rowcolor{yellow}
1368 %start-indent&I&\emph{length-spec}&0m&Standard\\
1369 %end-indent&I&\emph{length-spec}&0m&Standard\\
1370 %\rowcolor{yellow}
1371 %span&I&\emph{integer greater than zero}&1&Default\\
1372 %span-weak?&I&\#f, \#t&\#f&Default\\
1373 %\rowcolor{yellow}
1374 %space-before&N&\emph{display space}&no space before &Standard\\
1375 %space-after&N&\emph{display space}&no space after &Standard\\
1376 %\rowcolor{yellow}
1377 %keep-with-previous?&N&\#f, \#t&\#f&Standard\\
1378 %keep-with-next?&N&\#f, \#t&\#f&Standard\\
1379 %\rowcolor{yellow}
1380 %break-before&N&\#f, page, page-region*, column*, column-set*&\#f&Partial\\
1381 %break-after&N&\#f, page, page-region*, column*, column-set*&\#f&Partial\\
1382 %\rowcolor{yellow}
1383 %keep&N&\#f, page, column-set*, column*, \#t*&\#f&Partial\\
1384 %may-violate-keep-before?&N&\#f, \#t&\#f&Default\\
1385 %\rowcolor{yellow}
1386 %may-violate-keep-after?&N&\#f, \#t&\#f&Default\\
1387 %\end{longtable}
1388 % \begin{macrocode}
1389 \newcount\@TablePars
1390 \newcount\@ParNest
1391 \newcount\@TableNest
1392 \def\Par#1{%
1393 % \end{macrocode}
1394 % We need to end the current paragraph, with its current line spacing,
1395 % hyphenation, what have you, before anything is done.
1396 % This could have horrible repercussions, but something like
1397 % it is necessary.
1398 % \begin{macrocode}
1399 \everypar{\UseJadevskip{everypar}}\@@par
1400 \closeOrOpenMulticols{#1}
1401 \begingroup
1402 \SetupICs{#1}%
1403 \ParagraphNIC
1404 \FlowObjectSetup{1}%
1405 \openMulticols
1406 \paraSetup%
1407 }
1408 \def\TablePar#1{%
1409 \begingroup
1410 \let\@action\relax
1411 \global\advance\@ParNest by 1
1412 \ifnum\@ParNest=1
1413 \ifnum\@TablePars>0%
1414 \def\@action{\@@par}%\@arraycr}%
1415 \fi
1416 \else
1417 \ifnum\@ParNest>1
1418 \ifnum\@TablePars>0\def\@action{\par}\fi
1419 \fi
1420 \fi
1421 \@action
1422 \SetupICs{#1}%
1423 \csname startQ@\Quadding\endcsname
1424 \FlowObjectSetup{1}%
1425 \paraSetup%
1426 }
1427 \def\FootnotePar#1{%
1428 \begingroup
1429 \let\@action\relax
1430 \global\advance\@ParNest by 1
1431 \ifnum\@ParNest=1
1432 \ifnum\@FootnotePars>0%
1433 \def\@action{\@@par}%
1434 \fi
1435 \else
1436 \ifnum\@ParNest>1
1437 \ifnum\@FootnotePars>0\def\@action{\par}\fi
1438 \fi
1439 \fi
1440 \@action
1441 \SetupICs{#1}%
1442 \csname startQ@\Quadding\endcsname
1443 \FlowObjectSetup{1}%
1444 \paraSetup%
1445 }
1446 \def\HeadPar#1{\Par{#1}}
1447 \setcounter{tocdepth}{99}
1448 \def\@mysect#1#2#3{%
1449 \edef\@thishlabel{\csname theH#1\endcsname}%
1450 \pdfbookmark[#2]{#3}{\@thishlabel}%
1451 }
1452 % \end{macrocode}
1453 % From J.-M. Kubek, for PDF bookmarks
1454 % \begin{macrocode}
1455 \newcounter {headingOne}
1456 \newcounter {headingTwo}[headingOne]
1457 \newcounter {headingThree}[headingTwo]
1458 \newcounter {headingFour}[headingThree]
1459 \newcounter {headingFive}[headingFour]
1460 \def\theHheadingOne{\arabic{headingOne}}
1461 \def\theHheadingTwo{\theHheadingOne.\arabic{headingTwo}}
1462 \def\theHheadingThree{\theHheadingTwo.\arabic{headingThree}}
1463 \def\theHheadingFour{\theHheadingThree.\arabic{headingFour}}
1464 \def\theHheadingFive{\theHheadingFour.\arabic{headingFive}}
1465 \def\endHeadPar#1{%
1466 \ifnum\@TableNest>0
1467 \ifnum\@ParNest>1
1468 \ifnum\@TablePars>0\box\@@par\fi
1469 \fi
1470 \csname endQ@\Quadding\endcsname\null
1471 \global\advance\@TablePars by 1
1472 \global\advance\@ParNest by -1
1473 \else
1474 \ifnum\HeadingLevel>0%
1475 \ifnum\HeadingLevel=1%
1476 \addtocounter{headingOne}{1}%
1477 \@mysect{headingOne}{0}{\HeadingText}%
1478 \else\ifnum\HeadingLevel=2%
1479 \addtocounter{headingTwo}{1}%
1480 \@mysect{headingTwo}{1}{\HeadingText}%
1481 \else\ifnum\HeadingLevel=3%
1482 \addtocounter{headingThree}{1}%
1483 \@mysect{headingThree}{2}{\HeadingText}%
1484 \else\ifnum\HeadingLevel=4%
1485 \addtocounter{headingFour}{1}%
1486 \@mysect{headingFour}{3}{\HeadingText}%
1487 \else\ifnum\HeadingLevel=5%
1488 \addtocounter{headingFive}{1}%
1489 \@mysect{headingFive}{4}{\HeadingText}%
1490 \fi
1491 \fi
1492 \fi
1493 \fi
1494 \fi
1495 \fi
1496 % SP
1497 \closeMulticols
1498 \@@par
1499 \endParagraphNIC
1500 \fi
1501 \endSetupICs
1502 \endgroup
1503 % \end{macrocode}
1504 % This eats the parindent, and then restores an empty everypar;
1505 % it is called by an implicit start of hmode. Contributed by Simon Pepping.
1506 % \begin{macrocode}
1507 \everypar{{\leavevmode\setbox\z@\lastbox \UseJadevskip{everypar}}%
1508 \everypar{\UseJadevskip {everypar}}%
1509 }
1510 }
1511 \def\endPar#1{%
1512 \ifnum\@TableNest>0
1513 \let\@action\relax
1514 \ifnum\@ParNest>1
1515 \ifnum\@TablePars>0\def\@action{\@@par}\fi
1516 \fi
1517 \@action
1518 \csname endQ@\Quadding\endcsname\null
1519 \global\advance\@TablePars by 1
1520 \global\advance\@ParNest by -1
1521 \else
1522 % SP
1523 \closeMulticols
1524 \@@par
1525 \endParagraphNIC
1526 \fi
1527 \endSetupICs
1528 \endgroup
1529 % \end{macrocode}
1530 % This eats the parindent, and then restores an empty everypar;
1531 % it is called by an implicit start of hmode. Contributed by Simon Pepping.
1532 % \begin{macrocode}
1533 \everypar{{\leavevmode\setbox\z@\lastbox \UseJadevskip{everypar}}%
1534 \everypar{\UseJadevskip {everypar}}%
1535 }
1536 }
1537 \def\endFootnotePar#1{%
1538 \let\@action\relax
1539 \ifnum\@ParNest>1
1540 \ifnum\@FootnotePars>0\def\@action{\@@par}\fi
1541 \fi
1542 \@action
1543 \csname endQ@\Quadding\endcsname\null
1544 \global\advance\@FootnotePars by 1
1545 \global\advance\@ParNest by -1
1546 \endSetupICs
1547 \endgroup
1548 \everypar{{\leavevmode\setbox\z@\lastbox \UseJadevskip{everypar}}%
1549 \everypar{\UseJadevskip {everypar}}%
1550 }
1551 }
1552 % \end{macrocode}
1553 % \subsection{Score flow object class (clause 12.6.17)}
1554 % No support for: score-spaces, color or
1555 % line-thickness yet.
1556 %
1557 % \begin{macrocode}
1558 \def\Scoreafter{\uline}
1559 \def\Scorethrough{\sout}
1560 \def\Scorebefore{}
1561 \def\Score#1#2\endScore{#1%
1562 \csname Score\ScoreType\endcsname{#2}%
1563 }
1564 % \end{macrocode}
1565 % \subsection{Scroll flow object class (clause 12.6.28.1)}
1566 % \begin{macrocode}
1567 \def\Scroll{\SpS}
1568 \def\endScroll{\endSpS}
1569 % \end{macrocode}
1570 % \subsection{Sequence flow object class (clause 12.6.1)}
1571 % We have to allow for the document starting with a
1572 % sequence, not a simple page sequence, so we check if the
1573 % `begin document' work has been done.
1574 % \begin{macrocode}
1575 \newdimen\CurPosShift\CurPosShift\z@
1576 \newif\if@Raised
1577 \def\Seq#1{%
1578 \ifInSpS\begingroup\fi
1579 \SetupICs{#1}%
1580 \ifx \@nodocument\relax
1581 \else
1582 \typeout{Jade begin document sequence at \the\inputlineno}%
1583 \JadeSetPage
1584 \JadeBeginDocument
1585 \ifnum\PageNColumns>1
1586 \columnsep\PageColumnSep
1587 \ifnum\PageBalanceColumns>0
1588 \begin{multicols}{\PageNColumns}
1589 \else
1590 % begin\{multicols*}{\PageNColumns}
1591 \let\balance@columns@out
1592 \multi@column@out
1593 \begin{multicols}{\PageNColumns}
1594 \fi
1595 \fi
1596 \fi
1597 \FlowObjectSetup{0}%
1598 \@Raisedfalse
1599 \ifdim\PositionPointShift=\CurPosShift
1600 \else
1601 \@tempdima\PositionPointShift
1602 \ifdim\PositionPointShift>\CurPosShift
1603 \advance\@tempdima by -\CurPosShift
1604 \else
1605 \advance\@tempdima by \CurPosShift
1606 \fi
1607 \CurPosShift\PositionPointShift
1608 \@Raisedtrue
1609 \fi
1610 \ifnum\@TableNest>0\else\if@Raised\leavevmode\raise\@tempdima\hbox\bgroup\fi\fi
1611 }
1612 \def\endSeq{%
1613 \ifnum\@TableNest>0\else\if@Raised\egroup\fi\fi
1614 \EndSetFont
1615 \endSetupICs
1616 \@Raisedfalse
1617 \ifInSpS\endgroup\fi
1618 }
1619 % \end{macrocode}
1620 % \subsection{Side Line flow object class}
1621 % \begin{macrocode}
1622 \def\SideLine#1{#1}
1623 \def\endSideLine{}
1624 % \end{macrocode}
1625 % \subsection{Simple Page Sequence flow object class (clause 12.6.3)}
1626 % Look out for the canonical 1in margins in TeX systems!
1627 % \begin{macrocode}
1628 \def\JadeSetPage{%
1629 \ifnum\PageNumberRestart=1
1630 \global\c@page \@ne
1631 \fi
1632 \ifnum\PageTwoSide=0
1633 \global\@twosidefalse
1634 \else
1635 \global\@twosidetrue
1636 \fi
1637 \oddsidemargin\LeftMargin
1638 \ifnum\PageTwoSide=0
1639 \evensidemargin\LeftMargin
1640 \else
1641 \evensidemargin\RightMargin
1642 \fi
1643 \topmargin\HeaderMargin
1644 \headheight\LineSpacing
1645 \headsep\TopMargin
1646 \advance\headsep by -\HeaderMargin
1647 \advance\headsep by -\LineSpacing
1648 \footskip\BottomMargin
1649 \advance\footskip by -\FooterMargin
1650 \paperwidth\PageWidth
1651 \paperheight\PageHeight
1652 \textheight\paperheight
1653 \textwidth\paperwidth
1654 \advance\textheight by -\TopMargin
1655 \advance\textheight by -\BottomMargin
1656 \advance\textwidth by -\LeftMargin
1657 \advance\textwidth by -\RightMargin
1658 \ifx\pdfimage\@undefined
1659 \else
1660 \global\pdfpagewidth\paperwidth
1661 \global\pdfpageheight\paperheight
1662 \fi
1663 \@colht\textheight
1664 \@colroom\textheight
1665 \vsize\textheight
1666 \headwidth\textwidth
1667 \linewidth\textwidth
1668 \columnwidth\textwidth
1669 \hsize\columnwidth \linewidth\hsize
1670 \headheight12pt
1671 \let\pageFontSize\fSize
1672 \let\pageLineSpacing\LineSpacing
1673 \let\pageFontPosture\fPosture
1674 \let\pageFontProportionateWidth\fProportionateWidth
1675 \let\pageFontWeight\fWeight
1676 \let\pagefFamName\fFamName
1677 \arraycolsep\GridColumnSep
1678 }
1679 % initialize it
1680 \JadeSetPage
1681 \def\JadeBeginDocument{%
1682 % \end{macrocode}
1683 % We borrow most of the code of |\begin{document}|; we do not
1684 % want it all, as it interposes an unwanted group.
1685 % \begin{macrocode}
1686 \@clubpenalty\clubpenalty
1687 \begingroup\@floatplacement\@dblfloatplacement
1688 \makeatletter\let\@writefile\@gobbletwo
1689 \global \let \@multiplelabels \relax
1690 \@input{\jobname.aux}%
1691 \endgroup
1692 \immediate\openout\@mainaux\jobname.aux
1693 \immediate\write\@mainaux{\relax}%
1694 \process@table
1695 \let\glb@currsize\@empty %% Force math initialisation.
1696 \normalsize
1697 \everypar{\UseJadevskip{everypar}}%
1698 \@noskipsecfalse
1699 \let \@refundefined \relax
1700 \let\AtBeginDocument\@firstofone
1701 \ifdim\topskip<1sp\global\topskip 1sp\relax\fi
1702 \global\@maxdepth\maxdepth
1703 \@begindocumenthook
1704 \global\let\@begindocumenthook\@undefined
1705 \global\let\@filelist\relax
1706 \global\let\@addtofilelist\@gobble
1707 \gdef\do##1{\global\let ##1\@notprerr}%
1708 \@preamblecmds
1709 \global\let \@nodocument \relax
1710 \global\let\do\noexpand
1711 \ignorespaces
1712 }
1713 \newif\ifInSpS
1714 \def\SpS#1{%
1715 \InSpStrue
1716 \DoFOBSettrue
1717 \SetupICs{#1}%
1718 \gdef\thepage{\csname PageNumbering@\PageNumberFormat\endcsname\c@page}%
1719 % \end{macrocode}
1720 % The basic page setup needs to be delayed to this point, otherwise
1721 % the first page will be `frozen' in the format file. So check
1722 % here whether we are at the start of the document, and if so trigger
1723 % \LaTeX's |\begin{document}|. This is a pain, delaying the start of
1724 % the document. It means that documents which don't have a simple-page-
1725 % sequence at the start will fail.
1726 % \begin{macrocode}
1727 \JadeSetPage
1728 \ifx \@nodocument\relax
1729 \else
1730 \JadeBeginDocument
1731 \fi
1732 % \end{macrocode}
1733 % Grouping is turned on now we are inside a simple page sequence.
1734 % but is itself inside a group of the page sequence.
1735 % The problem is that if we start a Sequence, then start a
1736 % PageSequence, the |\begin{document}| occurs inside a group,
1737 % and so gets in a mess. If we turn off grouping
1738 % outside simple page sequences, any changes become global!
1739 % Does it make sense to have material not in a page
1740 % sequence, in TeX? Sadly, yes. The
1741 % document will still \emph{start} in non-group mode.
1742 % \begin{macrocode}
1743 \closeOrOpenMulticols{#1}%
1744 \DisplayNIC
1745 \openMulticols
1746 \FlowObjectSetup{0}%
1747 }
1748 \def\endSpS{%
1749 \DoFOBSetfalse
1750 \ifnum\PageNColumns>1\relax
1751 \ifnum\col@number>1\relax % in multicols
1752 \ifnum\PageBalanceColumns>0
1753 \end{multicols}
1754 \else
1755 % \endmulticols*
1756 \vfill\end{multicols}
1757 \fi
1758 \fi
1759 \fi
1760 \if@twoside
1761 \ifnum\TwoSideStartOnRight=1
1762 \cleardoublepage
1763 \else
1764 \clearpage
1765 \fi
1766 \else
1767 \clearpage
1768 \fi
1769 \fancyhf{}%
1770 \endDisplayNIC
1771 \let\FancyHook\@empty
1772 \let\FancyFirstHook\@empty
1773 \global\let\@sAfterMin\saMin
1774 \global\let\@sAfterMax\saMax
1775 \global\let\@sAfterNom\saNom
1776 \global\let\@sAfterPriority\saPriority
1777 \InSpSfalse
1778 }
1779 % \end{macrocode}
1780 % \subsection{Headers and footers}
1781 % \begin{macrocode}
1782 \def\SpSCenterFooter#1{\Setfoot[C]{#1}{CenterFooter}}
1783 \def\SpSCenterHeader#1{\Sethead[C]{#1}{CenterHeader}}
1784 \def\SpSLeftFooter#1{\Setfoot[L]{#1}{LeftFooter}}
1785 \def\SpSLeftHeader#1{\Sethead[L]{#1}{LeftHeader}}
1786 \def\SpSRightFooter#1{\Setfoot[R]{#1}{RightFooter}}
1787 \def\SpSRightHeader#1{\Sethead[R]{#1}{RightHeader}}
1788 %
1789 \def\SpSOtherBackCenterFooter#1{\Setfoot[CE]{#1}{OtherBackCenterFooter}}
1790 \def\SpSOtherBackLeftFooter#1{\Setfoot[LE]{#1}{OtherBackLeftFooter}}
1791 \def\SpSOtherBackRightFooter#1{\Setfoot[RE]{#1}{OtherBackRightFooter}}
1792 \def\SpSOtherBackRightHeader#1{\Sethead[RE]{#1}{OtherBackRightHeader}}
1793 \def\SpSOtherBackCenterHeader#1{\Sethead[CE]{#1}{OtherBackCenterHeader}}
1794 \def\SpSOtherBackLeftHeader#1{\Sethead[LE]{#1}{OtherBackLeftHeader}}
1795 %
1796 \def\SpSOtherFrontCenterFooter#1{\Setfoot[CO]{#1}{OtherFrontCenterFooter}}
1797 \def\SpSOtherFrontLeftFooter#1{\Setfoot[LO]{#1}{OtherFrontLeftFooter}}
1798 \def\SpSOtherFrontRightFooter#1{\Setfoot[RO]{#1}{OtherFrontRightFooter}}
1799 \def\SpSOtherFrontRightHeader#1{\Sethead[RO]{#1}{OtherFrontRightHeader}}
1800 \def\SpSOtherFrontCenterHeader#1{\Sethead[CO]{#1}{OtherFrontCenterHeader}}
1801 \def\SpSOtherFrontLeftHeader#1{\Sethead[LO]{#1}{OtherFrontLeftHeader}}
1802 %
1803 \def\SpSFirstBackCenterFooter#1{\SetFirstfoot[CE]{#1}{FirstBackCenterFooter}}
1804 \def\SpSFirstBackLeftFooter#1{\SetFirstfoot[LE]{#1}{FirstBackLeftFooter}}
1805 \def\SpSFirstBackRightFooter#1{\SetFirstfoot[RE]{#1}{FirstBackRightFooter}}
1806 \def\SpSFirstBackCenterHeader#1{\SetFirsthead[CE]{#1}{FirstBackCenterHeader}}
1807 \def\SpSFirstBackLeftHeader#1{\SetFirsthead[LE]{#1}{FirstBackLeftHeader}}
1808 \def\SpSFirstBackRightHeader#1{\SetFirsthead[RE]{#1}{FirstBackRightHeader}}
1809
1810 \def\SpSFirstFrontCenterFooter#1{\SetFirstfoot[CO]{#1}{FirstFrontCenterFooter}}
1811 \def\SpSFirstFrontLeftFooter#1{\SetFirstfoot[LO]{#1}{FirstFrontLeftFooter}}
1812 \def\SpSFirstFrontRightFooter#1{\SetFirstfoot[RO]{#1}{FirstFrontRightFooter}}
1813 \def\SpSFirstFrontCenterHeader#1{\SetFirsthead[CO]{#1}{FirstFrontCenterHeader}}
1814 \def\SpSFirstFrontLeftHeader#1{\SetFirsthead[LO]{#1}{FirstFrontLeftHeader}}
1815 \def\SpSFirstFrontRightHeader#1{%
1816 \SetFirsthead[RO]{#1}{FirstFrontRightHeader}%
1817 % \end{macrocode}
1818 % This one comes last, so now set up page styles. YUCK!
1819 % \begin{macrocode}
1820 \pagestyle{jadeother}%
1821 \thispagestyle{jadefirst}%
1822 }
1823 \fancypagestyle{jadeother}{\fancyhf{}\FancyHook}%
1824 \fancypagestyle{jadefirst}{\fancyhf{}\FancyFirstHook}%
1825 %
1826 \def\Sethead[#1]#2#3{%
1827 \ifx\\#2\\\relax\else
1828 \g@addto@macro\FancyHook{\fancyhead[#1]{\setnormal#2}}%
1829 \fi
1830 }
1831 \def\Setfoot[#1]#2#3{%
1832 \ifx\\#2\\\relax\else
1833 \g@addto@macro\FancyHook{\fancyfoot[#1]{\setnormal#2}}%
1834 \fi
1835 }
1836 \def\SetFirsthead[#1]#2#3{%
1837 \ifx\\#2\\\relax\else
1838 \g@addto@macro\FancyFirstHook{\fancyhead[#1]{\setnormal#2}}%
1839 \fi
1840 }
1841 \def\SetFirstfoot[#1]#2#3{%
1842 \ifx\\#2\\\relax\else
1843 \g@addto@macro\FancyFirstHook{\fancyfoot[#1]{\setnormal#2}}%
1844 \fi
1845 }
1846 \def\FancyHook{}
1847 \def\FancyFirstHook{}
1848 \pagestyle{jadeother}
1849 % \end{macrocode}
1850 % \subsection{Table flow object class}
1851 % \begin{macrocode}
1852 \def\Table#1{\TableNIC\UseJadevskip{table}\SetupICs{#1}}
1853 \def\endTable{\endSetupICs\endTableNIC}
1854 \def\@full{full}
1855 \LTpre=\z@
1856 \LTpost=\z@
1857 \newenvironment{TeXTable}[3]{% width, ncolumns, template
1858 \global\advance\@TableNest by 1
1859 \ifx\TableWidth\@full\def\TableWidth{\hsize}\fi
1860 \FlowObjectSetup{0}%
1861 \let\Node\@gobble
1862 \let\endNode\@gobble
1863 \let\Par\TablePar
1864 \setlength\LTleft\StartIndent
1865 \setlength\LTright\fill
1866 \ifnum\PageNColumns>1
1867 \tabular{#3}%
1868 \else
1869 \ifnum\@TableNest>1
1870 \tabular{#3}%
1871 \else
1872 \longtable{#3}%
1873 \fi
1874 \fi
1875 }{%
1876 \ifnum\PageNColumns>1
1877 \endtabular
1878 \else
1879 \ifnum\@TableNest>1
1880 \endtabular
1881 \else
1882 \endlongtable
1883 \fi
1884 \fi
1885 \ifvoid\@mpfootins\else
1886 \vskip\skip\@mpfootins
1887 \normalcolor
1888 \unvbox\@mpfootins
1889 \fi
1890 \global\advance\@TableNest by -1
1891 }
1892 % \end{macrocode}
1893 % \subsection{Table Cell flow object class}
1894 % \begin{macrocode}
1895 \def\Hline{\hline}
1896 \def\Cline{\cline}
1897 \let\TeXTableCell=\multicolumn
1898 \def\TableCell#1{%
1899 \TableCellNIC%
1900 \SetupICs{#1}%
1901 \FlowObjectSetup{0}%
1902 \rule[2ex]{0pt}{\CellBeforeRowMargin}%
1903 \global\@TablePars0%
1904 \ifnum\NRowsSpanned>1% Row spanning
1905 \JadeRowSpan%
1906 \else
1907 \ifnum\TeXRowSpanFiller>0%
1908 \JadeRowSpanFiller
1909 \fi
1910 \fi%
1911 }
1912 \def\endTableCell#1{%
1913 \ifnum\NRowsSpanned>1%
1914 \endJadeRowSpan%
1915 \fi
1916 \rule[-\CellAfterRowMargin]{0pt}{0pt}%
1917 \endSetupICs
1918 \endTableCellNIC
1919 }
1920 % \end{macrocode}
1921 % \subsection{Table Part flow object class}
1922 % \begin{macrocode}
1923 \def\TablePart#1{#1\FlowObjectSetup{0}}
1924 \def\TablePartHeader#1{}
1925 \def\TablePartFooter#1{}
1926 \def\endTablePartFooter#1{}
1927 \def\endTablePartHeader#1{%
1928 \ifnum\TablePartOmitMiddleHeader=1
1929 \endfirsthead
1930 \else
1931 \endhead
1932 \fi}
1933 \def\endTablePart{}
1934 % \end{macrocode}
1935 % \subsection{Table Row flow object class}
1936 % \begin{macrocode}
1937 \def\TableRow#1{#1}
1938 \def\endTableRow#1{\\}
1939 % \end{macrocode}
1940 %
1941 % \subsection{Character mapping}
1942 % \begin{macrocode}
1943 \def\Character#1{%
1944 \SetupICs{}%
1945 \ifnum#1<255\char#1\else
1946 \expandafter\ifx\csname !#1\endcsname\relax
1947 <#1>\typeout{Warning: Unknown character #1, at \the\inputlineno}%
1948 \else\csname !#1\endcsname\fi
1949 \fi
1950 \ifdim\EscapementSpaceAfterNom=\z@
1951 \else
1952 \@tempdima\EscapementSpaceAfterNom
1953 \advance\@tempdima by -\EscapementSpaceAfterMin
1954 \@tempdimb\EscapementSpaceAfterNom
1955 \advance\@tempdimb by -\EscapementSpaceAfterMax
1956 \hskip\EscapementSpaceAfterNom plus \@tempdimb minus \@tempdima%
1957 \fi
1958 \endSetupICs{}%
1959 }
1960 % \end{macrocode}
1961 %\subsection{DisplayNIC}
1962 % \begin{macrocode}
1963 \newcount\DisplayStack
1964 \newcount\LastDisplayStack
1965 \newif\ifBreakMe
1966 \newif\ifJadeskipready
1967 \Jadeskipreadyfalse
1968 \newskip\Jadeskip
1969 \newskip\Jadelastskip
1970 \newskip\jadetempskip
1971 \BreakMefalse
1972 \DisplayStack0
1973 \LastDisplayStack-1
1974 \let\@sBeforeMin\sbMin
1975 \let\@sBeforeMax\sbMax
1976 \let\@sBeforeNom\sbNom
1977 \let\@sBeforePriority\sbPriority
1978 \def\@force{force}
1979 \def\Jadevskip#1#2{\global\Jadeskipreadytrue\global\Jadeskip#1\relax}
1980 \def\UseJadevskip#1{%
1981 \global\Jadeskipreadyfalse
1982 \ifdim\Jadeskip=\z@\else
1983 \ifvmode
1984 \vskip\Jadeskip\global\Jadeskip\z@
1985 \else
1986 \setbox\z@\lastbox\par
1987 \vskip\Jadeskip\global\Jadeskip\z@
1988 {\everypar{}\noindent\box\z@}%
1989 \fi
1990 \fi
1991 }
1992 \def\QueryPageBreak{%
1993 \ifBreakMe
1994 \ifvmode
1995 \penalty \@M
1996 \else
1997 \@bsphack
1998 \vadjust{\penalty \@M}%
1999 \@esphack
2000 \fi
2001 \else
2002 \ifnum\KeepWithNext=1
2003 \penalty-600
2004 \else
2005 \penalty \z@
2006 \fi
2007 \fi
2008 }
2009 \def\DisplayNIC{%
2010 \advance\DisplayStack by 1
2011 \QueryPageBreak
2012 % \end{macrocode}
2013 % What we are trying to identify is a display which starts
2014 % inside another display.
2015 % \begin{macrocode}
2016 % \ifnum\DisplayStack>\LastDisplayStack
2017 % \def\sbPriority{force}%
2018 % \def\LastSpaceBeforePriority{0}%
2019 % \fi
2020 \let\@sAfterMin\saMin
2021 \let\@sAfterMax\saMax
2022 \let\@sAfterNom\saNom
2023 \let\@sAfterPriority\saPriority
2024 %
2025 \begingroup
2026 \ifx\BreakBefore\relax\else
2027 \csname Break@\BreakBefore\endcsname
2028 \fi
2029 \CurrentSpaceMin=\sbMin
2030 \CurrentSpaceNom=\sbNom
2031 \CurrentSpaceMax=\sbMax
2032 %
2033 \edef\CurrentSpacePriority{\sbPriority}%
2034 % \end{macrocode}
2035 % See if either display space priority is set to `force';
2036 % if so, use that set of values;
2037 % if both priorities are `force', add values together
2038 % \begin{macrocode}
2039 \ifx\sbPriority\@force
2040 \ifx\LastSpacePriority\@force
2041 \advance\CurrentSpaceMin by \LastSpaceMin
2042 \advance\CurrentSpaceNom by \LastSpaceNom
2043 \advance\CurrentSpaceMax by \LastSpaceMax
2044 \fi
2045 \else
2046 \ifx\LastSpacePriority\@force
2047 \CurrentSpaceMin=\LastSpaceMin
2048 \CurrentSpaceNom=\LastSpaceNom
2049 \CurrentSpaceMax=\LastSpaceMax
2050 % \end{macrocode}
2051 % See if the priority of either set is higher, if so use that
2052 % \begin{macrocode}
2053 \else
2054 \ifnum\CurrentSpacePriority>\LastSpacePriority
2055 \relax
2056 \else
2057 \ifnum\LastSpacePriority>\CurrentSpacePriority
2058 \CurrentSpaceMin=\LastSpaceMin
2059 \CurrentSpaceNom=\LastSpaceNom
2060 \CurrentSpaceMax=\LastSpaceMax
2061 \else
2062 % \end{macrocode}
2063 % So the priorities are equal; take the one with the larger Nom
2064 % \begin{macrocode}
2065 \ifdim\CurrentSpaceNom>\LastSpaceNom
2066 \relax
2067 \else
2068 \ifdim\LastSpaceNom>\CurrentSpaceNom
2069 \CurrentSpaceMin=\LastSpaceMin
2070 \CurrentSpaceNom=\LastSpaceNom
2071 \CurrentSpaceMax=\LastSpaceMax
2072 \else
2073 % \end{macrocode}
2074 % Dang, the Noms are equal. Take the larger minimum, and smaller
2075 % maximum
2076 % \begin{macrocode}
2077 \ifdim\LastSpaceMax<\CurrentSpaceMax
2078 \CurrentSpaceMax\LastSpaceMax
2079 \fi
2080 \ifdim\LastSpaceMin>\CurrentSpaceMin
2081 \CurrentSpaceMin\LastSpaceMin
2082 \fi
2083 \fi
2084 \fi
2085 \fi
2086 \fi
2087 \fi
2088 \fi
2089 \@tempdima\CurrentSpaceNom
2090 \advance\@tempdima by -\CurrentSpaceMin
2091 \@tempdimb\CurrentSpaceNom
2092 \advance\@tempdimb by -\CurrentSpaceMax
2093 \QueryPageBreak
2094 \jadetempskip=\CurrentSpaceNom plus \@tempdimb minus \@tempdima
2095 \Jadevskip{\the\jadetempskip}{startDisplayNIC}%
2096 \let\Keep\relax
2097 \let\BreakBefore\relax
2098 \let\BreakAfter\relax
2099 \let\KeepWithPrevious\relax
2100 \let\MayViolateKeepBefore\relax
2101 \let\MayViolateKeepAfter\relax
2102 \def\sbMin{\z@}%
2103 \def\sbMax{\z@}%
2104 \def\sbNom{\z@}%
2105 \def\sbPriority{0}%
2106 \def\saMin{\z@}%
2107 \def\saMax{\z@}%
2108 \def\saNom{\z@}%
2109 \def\saPriority{0}%
2110 \ifdim\Jadeskip=\z@\else\the\everypar\fi
2111 }
2112 \def\endDisplayNIC{%
2113 \ifnum\KeepWithNext=1
2114 \penalty\@M\global\BreakMetrue\else\global\BreakMefalse
2115 \fi
2116 \ifdim\Jadeskip=\z@\else\the\everypar\fi
2117 \endgroup
2118 \global\LastSpaceNom=\@sAfterNom
2119 \global\LastSpaceMax=\@sAfterMax
2120 \global\LastSpaceMin=\@sAfterMin
2121 \global\edef\LastSpacePriority{\@sAfterPriority}%
2122 \@tempdima\@sAfterNom
2123 \advance\@tempdima by -\@sAfterMin
2124 \@tempdimb\@sAfterNom
2125 \advance\@tempdimb by -\@sAfterMax
2126 \jadetempskip=\@sAfterNom plus \@tempdimb minus \@tempdima
2127 \Jadevskip{\the\jadetempskip}{endDIsplayNIC}%
2128 \global\LastDisplayStack=\DisplayStack
2129 \advance\DisplayStack by -1
2130 }
2131 \def\paraSetup{%
2132 \rightskip\EndIndent
2133 \leftskip\StartIndent
2134 \csname JQ@\Quadding\endcsname
2135 \csname L@\Language\endcsname
2136 \ifx\FirstLineStartIndent\@empty\relax
2137 \else\parindent\FirstLineStartIndent
2138 \fi
2139 \ifx\InputWhitespaceTreatment\@empty\relax
2140 \else\csname White@\InputWhitespaceTreatment\endcsname
2141 \fi
2142 \ifx\Lines\@empty\relax
2143 \else\csname Lines@\Lines\endcsname
2144 \fi
2145 }
2146 % \end{macrocode}
2147 %\section{Setup of non-inherited characteristics}
2148 %\subsection{Inline}
2149 % \begin{macrocode}
2150 \def\InlineNIC{%
2151 \begingroup
2152 }
2153 \def\endInlineNIC{%
2154 \let\BreakBeforePriority\relax
2155 \let\BreakAfterPriority\relax
2156 \endgroup
2157 }
2158 % \end{macrocode}
2159 %\subsection{Display}
2160 % \begin{macrocode}
2161 \def\DisplayGroupNIC{%
2162 \DisplayNIC
2163 }
2164 \def\endDisplayGroupNIC{%
2165 \endDisplayNIC
2166 }
2167 % \end{macrocode}
2168 %\subsection{Graphics, boxes, leaders}
2169 % \begin{macrocode}
2170 \def\ExternalGraphicNIC{%
2171 \InlineNIC
2172 }
2173 \def\endExternalGraphicNIC{%
2174 \endInlineNIC
2175 }
2176 \def\BoxNIC{%
2177 \DisplayNIC
2178 \InlineNIC
2179 }
2180 \def\endBoxNIC{%
2181 \endInlineNIC
2182 \endDisplayNIC
2183 }
2184 \def\RuleNIC{%
2185 \DisplayNIC
2186 \InlineNIC
2187 }
2188 \def\endRuleNIC{%
2189 \endInlineNIC
2190 \endDisplayNIC
2191 }
2192 \def\LeaderNIC{%
2193 \InlineNIC
2194 }
2195 \def\LeaderNIC{%
2196 \InlineNIC
2197 }
2198 % \end{macrocode}
2199 %\subsection{Tables}
2200 % \begin{macrocode}
2201 \let\TableNIC\DisplayNIC
2202 \let\endTableNIC\endDisplayNIC
2203 \def\TableColumnNIC{}
2204 \def\endTableColumnNIC{}
2205 \def\TableCellNIC{%
2206 \begingroup%
2207 \def\NColumnsSpanned{1}%
2208 \def\NRowsSpanned{1}%
2209 \def\ColumnIndex{0}%
2210 \def\TeXRowSpanFiller{0}%
2211 }
2212 \def\endTableCellNIC{\endgroup}
2213 \def\GridNIC{}
2214 \def\endGridNIC{}
2215 \def\GridCellNIC{}
2216 \def\endGridCellNIC{}
2217 \let\ParagraphNIC\DisplayNIC
2218 \let\LineFieldNIC\InlineNIC
2219 \let\endParagraphNIC\endDisplayNIC
2220 \let\endLineFieldNIC\endInlineNIC
2221 % \end{macrocode}
2222 %\section{Setup of inherited characteristics}
2223 % A problem arises here is `whitespacetreatment' is set to
2224 % `preserve', as this makes spaces active. If then a font name
2225 % like `Times Roman' is processed, the space in the middle
2226 % is processed! We replace spaces in font family names with `-'
2227 % in TeXFOTBuilder.cxx
2228 % \begin{macrocode}
2229 \newif\ifNeedsSelect
2230 \chardef\nonactive=10
2231 \def\SetupICs#1{#1%
2232 \let\current@f@series\f@series
2233 \let\current@f@shape\f@shape
2234 \let\current@f@family\f@family
2235 \let\current@f@size\f@size
2236 \edef\LaTeXshape{\csname Width@\fProportionateWidth\endcsname
2237 \csname Weight@\fWeight\endcsname}%
2238 \ifx\LaTeXshape\@empty\def\LaTeXshape{m}\fi
2239 \edef\f@series{\LaTeXshape}%
2240 \edef\f@shape{\csname Posture@\fPosture\endcsname}%
2241 \IfFileExists{t1\fFamName.fd}
2242 {\def\f@family{\fFamName}}
2243 {\edef\f@family{%
2244 \expandafter\ifx\csname Family@\fFamName\endcsname\relax
2245 \csname Family@\DefaultfFamName\endcsname
2246 \else
2247 \csname Family@\fFamName\endcsname
2248 \fi}}%
2249 \set@fontsize\baselinestretch{\fSize}{\LineSpacing}%
2250 %\NeedsSelecttrue
2251 %\ifx\f@size\current@f@size\relax\NeedsSelectfalse\fi
2252 %\ifx\f@family\current@f@family\relax\NeedsSelectfalse\fi
2253 %\ifx\f@shape\current@f@shape\relax\NeedsSelectfalse\fi
2254 %\ifx\f@series\current@f@series\relax\NeedsSelectfalse\fi
2255 %\ifNeedsSelect
2256 \selectfont
2257 %\fi
2258 \ifx\ColorRed\@empty\relax\else
2259 \RGBColor{\ColorRed}{\ColorGreen}{\ColorBlue}%
2260 \fi
2261 }
2262 \def\endSetupICs{}
2263 % \end{macrocode}
2264 % |\FlowObjectSetup| should be called at the beginning of every object
2265 % that can be meaningfully labelled. It is this that creates an anchor,
2266 % not the |\Node|, to avoid duplicates and wastage.
2267 %
2268 % Because labelling writes to an external file, or does a |\special|,
2269 % it adds a whatsit to the main vertical list. This wrecks the
2270 % |\vskip-\lastskip| which every paragraph or display does. Bad news!
2271 % Labelling when we are in a Link element is not a good thing.
2272 % It messes up the references.
2273 % \begin{macrocode}
2274 \def\@madelink{ }
2275 \newif\ifDoFOBSet
2276 \DoFOBSettrue
2277 \def\FlowObjectSetup#1{%
2278 \ifDoFOBSet
2279 \ifLabelElements
2280 \ifx\Label\@empty\let\Label\Element\fi
2281 \fi
2282 \ifx\Label\@empty\else
2283 \expandafter\ifx\csname x@\Label\endcsname\@madelink
2284 \else
2285 \bgroup
2286 \ifNestedLink
2287 \else
2288 \hyper@anchorstart{\Label}\hyper@anchorend
2289 \PageLabel{\Label}%
2290 \expandafter\gdef\csname x@\Label\endcsname{ }%
2291 \fi
2292 \egroup
2293 \let\Label\@empty
2294 \let\Element\@empty
2295 \fi
2296 \fi
2297 \fi
2298 }
2299 % \end{macrocode}
2300 % \section{Non-standard flow objects}
2301 % \begin{macrocode}
2302 \def\fps@figure{htbp} % prefer figures to be placed here
2303 \def\ftype@figure{1}
2304 \def\PageFloat#1{\SetupICs{#1}%
2305 \ifnum\Span>0
2306 \def\Span{0}%
2307 \typeout{JadeTeX WARNING: specifying column spans for floats not supported}%
2308 \fi
2309 \FlowObjectSetup{0}%
2310 \@dblfloat{figure}[\placement]%
2311 }
2312 \def\endPageFloat{\end@dblfloat}
2313 \def\Footnotesize{\@setfontsize\small\@ixpt{11}}
2314 \newcount\@FootnotePars
2315 \skip\@mpfootins = \skip\footins
2316 \long\def\PageFootnote#1#2{#1%
2317 \ifnum\@TableNest>0
2318 \global\setbox\@mpfootins\vbox{%
2319 \unvbox\@mpfootins
2320 \reset@font\Footnotesize
2321 \hsize\TableWidth
2322 \leftskip\StartIndent
2323 \@parboxrestore
2324 \color@begingroup
2325 \@makefntext{%
2326 \rule\z@\footnotesep\ignorespaces#2\@finalstrut\strutbox}%
2327 \color@endgroup}%
2328 \else
2329 \insert\footins{%
2330 \let\Par\FootnotePar
2331 \let\endPar\endFootnotePar
2332 \global\@FootnotePars0%
2333 \reset@font\Footnotesize
2334 \interlinepenalty\interfootnotelinepenalty
2335 \splittopskip\footnotesep
2336 \splitmaxdepth \dp\strutbox \floatingpenalty \@MM
2337 \hsize\columnwidth \@parboxrestore
2338 \color@begingroup
2339 \@makefntext{%
2340 \rule\z@\footnotesep\ignorespaces#2\@finalstrut\strutbox}
2341 \color@endgroup}%
2342 \fi
2343 }
2344 \def\@makefntext#1{%
2345 \parindent 1em%
2346 \noindent
2347 #1}
2348 % \end{macrocode}
2349 % \section{Color}
2350 % Only RGB color working at present. Sorry.
2351 % \begin{macrocode}
2352 \def\RGBColor#1#2#3{%
2353 \c@lor@RGB@rgb{#1}\@tempa
2354 \c@lor@RGB@rgb{#2}\@tempb
2355 \c@lor@RGB@rgb{#3}\@tempc
2356 % \typeout{Set Color \@tempa, \@tempb, \@tempc}%
2357 \color[rgb]{\@tempa, \@tempb, \@tempc}%
2358 }
2359 \def\c@lor@RGB@rgb#1#2{%
2360 \dimen@#1\p@
2361 \divide\dimen@\@cclv
2362 \edef#2{\strip@pt\dimen@}}
2363 \def\EndSetFont{%
2364 \ifx\csname\fPosture Over\endcsname\relax
2365 \relax\else\csname\fPosture Over\endcsname\fi
2366 }
2367 % \end{macrocode}
2368 % \section{Startup}
2369 % \begin{macrocode}
2370 %\let\DEBUG\@gobble
2371 \def\endFOT{%\let\normalcolor\relax
2372 \def\Hy@colorlink##1{}%
2373 \def\Hy@endcolorlink{}%
2374 \ifnum\col@number>1
2375 \ifnum\PageBalanceColumns>0
2376 \end{multicols}
2377 \else
2378 % \endmulticols*
2379 \vfill\end{multicols}
2380 \fi
2381 \fi
2382 \enddocument}
2383 \def\FOT#1{%
2384 \checkFOTversion{#1}%
2385 \hoffset-1in\voffset-1in
2386 \def\setnormal{%
2387 \let\fSize\pageFontSize
2388 \let\LineSpacing\pageLineSpacing
2389 \let\fPosture\pageFontPosture
2390 \let\fProportionateWidth\pageFontProportionateWidth
2391 \let\fWeight\pageFontWeight
2392 \let\fFamName\pagefFamName
2393 }
2394 \def\headrulewidth{0\p@}%
2395 \def\footrulewidth{0\p@}%
2396 \abovedisplayskip=\z@
2397 \abovedisplayshortskip=\z@
2398 \belowdisplayskip=\z@
2399 \belowdisplayshortskip=\z@
2400 \raggedbottom
2401 \clubpenalty=4000
2402 \widowpenalty=2000
2403 \setlength\emergencystretch{2in}
2404 \frenchspacing
2405 \fancyhf{}%
2406 \def\familydefault{ptm}%
2407 \fontfamily{\familydefault}\selectfont
2408 \pagenumbering{arabic}%
2409 \nonstopmode
2410 \Mathcount0
2411 % \end{macrocode}
2412 % We do not put out a |\begin{document}|, as that would fix
2413 % the page size in advance; we delay that for the first
2414 % page sequence.
2415 % \begin{macrocode}
2416 \let\default@color\current@color
2417 % \end{macrocode}
2418 % Individual users or projects can override anything in this
2419 % setup with a configuration file, loaded here, called
2420 % \texttt{jadetex.cfg}.
2421 % \begin{macrocode}
2422 \InputIfFileExists{jadetex.cfg}{}{}%
2423 \ifLabelElements
2424 \typeout{Elements will be labelled}%
2425 \else
2426 \typeout{Elements will NOT be labelled}%
2427 \fi
2428 % wicked. dont redo \@begindocumenthook! cause color in pdftex to foul up.
2429 % \@begindocumenthook
2430 \makeatletter
2431 }
2432 \everyjob{%
2433 \typeout{JadeTeX \JadeTeXDate: \JadeTeXMajorVersion.\JadeTeXMinorVersion}%
2434 }
2435 \catcode`\^^M=10%
2436 \catcode0=9%
2437 %</package>
2438 %<*dsssldef>
2439 \NeedsTeXFormat{LaTeX2e}[1995/12/01]
2440 \ProvideTextCommandDefault{\textonequarter}{\ensuremath{\frac14}}
2441 \ProvideTextCommandDefault{\textonehalf}{\ensuremath{\frac12}}
2442 \ProvideTextCommandDefault{\textthreequarters}{\ensuremath{\frac34}}
2443 \ProvideTextCommandDefault{\textcent}
2444 {\TextSymbolUnavailable\textcent}
2445 \ProvideTextCommandDefault{\textyen}
2446 {\TextSymbolUnavailable\textyen}
2447 \ProvideTextCommandDefault{\textcurrency}
2448 {\TextSymbolUnavailable\textcurrency}
2449 \ProvideTextCommandDefault{\textbrokenbar}
2450 {\TextSymbolUnavailable\textbrokenbar}
2451 \providecommand{\mathdegree}{{\ensuremath{^\circ}}
2452 }
2453 \providecommand{\mathonesuperior}{{^1}}
2454 \providecommand{\mathtwosuperior}{{^2}}
2455 \providecommand{\maththreesuperior}{{^3}}
2456 \providecommand{\mathordmasculine}{\mathrm{^{\underline{o}}}}
2457 \providecommand{\mathordfeminine}{\mathrm{^{\underline{a}}}}
2458 \DeclareInputText{"0A0}{\nobreakspace}
2459 \DeclareInputMath{"0B0}{\mathdegree}
2460 \DeclareInputText{"0A1}{\textexclamdown}
2461 \DeclareInputMath{"0B1}{\ensuremath{\pm}}
2462 \DeclareInputText{"0A2}{\textcent}
2463 \DeclareInputMath{"0B2}{\mathtwosuperior}
2464 \DeclareInputText{"0B2}{\ensuremath{\mathtwosuperior}}
2465 \DeclareInputText{"0A3}{\pounds}
2466 \DeclareInputMath{"0B3}{\maththreesuperior}
2467 \DeclareInputText{"0B3}{\ensuremath{\maththreesuperior}}
2468 \DeclareInputText{"0A4}{\textcurrency}
2469 \DeclareInputText{"0B4}{\@tabacckludge'{}}
2470 \DeclareInputText{"0A5}{\textyen}
2471 \DeclareInputMath{"0B5}{\mu}
2472 \DeclareInputText{"0B5}{\textmu}
2473 \DeclareInputText{"0A6}{\textbrokenbar}
2474 \DeclareInputText{"0B6}{\P}
2475 \DeclareInputText{"0A7}{\S}
2476 \DeclareInputText{"0B7}{\ifmmode\cdot\else\textperiodcentered\fi}
2477 \DeclareInputText{"0A8}{\"{}}
2478 \DeclareInputText{"0B8}{\c{}}
2479 \DeclareInputText{"0A9}{\copyright}
2480 \DeclareInputMath{"0B9}{\mathonesuperior}
2481 \DeclareInputMath{"0AA}{\mathordfeminine}
2482 \DeclareInputMath{"0BA}{\mathordmasculine}
2483 \DeclareInputText{"0B9}{\ensuremath{\mathonesuperior}}
2484 \DeclareInputText{"0AA}{\ensuremath{\mathordfeminine}}
2485 \DeclareInputText{"0BA}{\ensuremath{\mathordmasculine}}
2486 \DeclareInputText{"0AB}{\guillemotleft}
2487 \DeclareInputText{"0BB}{\guillemotright}
2488 \DeclareInputMath{"0AC}{\lnot}
2489 \DeclareInputText{"0AC}{\ensuremath{\lnot}}
2490 \DeclareInputText{"0BC}{\textonequarter}
2491 \DeclareInputText{"0AD}{\-}
2492 \DeclareInputText{"0BD}{\textonehalf}
2493 \DeclareInputText{"0AE}{\textregistered}
2494 \DeclareInputText{"0BE}{\textthreequarters}
2495 \DeclareInputText{"0AF}{\ifmmode\else\@tabacckludge={}\fi}
2496 \DeclareInputText{"0BF}{\textquestiondown}
2497 \DeclareInputText{"0C0}{\@tabacckludge`A}
2498 \DeclareInputText{"0D0}{\DH}
2499 \DeclareInputText{"0C1}{\@tabacckludge'A}
2500 \DeclareInputText{"0D1}{\~N}
2501 \DeclareInputText{"0C2}{\^A}
2502 \DeclareInputText{"0D2}{\@tabacckludge`O}
2503 \DeclareInputText{"0C3}{\~A}
2504 \DeclareInputText{"0D3}{\@tabacckludge'O}
2505 \DeclareInputText{"0C4}{\"A}
2506 \DeclareInputText{"0D4}{\^O}
2507 \DeclareInputText{"0C5}{\AA}
2508 \DeclareInputText{"0D5}{\~O}
2509 \DeclareInputText{"0C6}{\AE}
2510 \DeclareInputText{"0D6}{\"O}
2511 \DeclareInputText{"0C7}{\c C}
2512 \DeclareInputMath{"0D7}{\ensuremath{\times}}
2513 \DeclareInputText{"0C8}{\@tabacckludge`E}
2514 \DeclareInputText{"0D8}{\O}
2515 \DeclareInputText{"0C9}{\@tabacckludge'E}
2516 \DeclareInputText{"0D9}{\@tabacckludge`U}
2517 \DeclareInputText{"0CA}{\^E}
2518 \DeclareInputText{"0DA}{\@tabacckludge'U}
2519 \DeclareInputText{"0CB}{\"E}
2520 \DeclareInputText{"0DB}{\^U}
2521 \DeclareInputText{"0CC}{\@tabacckludge`I}
2522 \DeclareInputText{"0DC}{\"U}
2523 \DeclareInputText{"0CD}{\@tabacckludge'I}
2524 \DeclareInputText{"0DD}{\@tabacckludge'Y}
2525 \DeclareInputText{"0CE}{\^I}
2526 \DeclareInputText{"0DE}{\TH}
2527 \DeclareInputText{"0CF}{\"I}
2528 \DeclareInputText{"0DF}{\ss}
2529 \DeclareInputText{"0E0}{\@tabacckludge`a}
2530 \DeclareInputText{"0F0}{\dh}
2531 \DeclareInputText{"0E1}{\@tabacckludge'a}
2532 \DeclareInputText{"0F1}{\~n}
2533 \DeclareInputText{"0E2}{\^a}
2534 \DeclareInputText{"0F2}{\@tabacckludge`o}
2535 \DeclareInputText{"0E3}{\~a}
2536 \DeclareInputText{"0F3}{\@tabacckludge'o}
2537 \DeclareInputText{"0E4}{\"a}
2538 \DeclareInputText{"0F4}{\^o}
2539 \DeclareInputText{"0E5}{\aa}
2540 \DeclareInputText{"0F5}{\~o}
2541 \DeclareInputText{"0E6}{\ae}
2542 \DeclareInputText{"0F6}{\"o}
2543 \DeclareInputText{"0E7}{\c c}
2544 \DeclareInputMath{"0F7}{\ensuremath{\div}}
2545 \DeclareInputText{"0E8}{\@tabacckludge`e}
2546 \DeclareInputText{"0F8}{\o}
2547 \DeclareInputText{"0E9}{\@tabacckludge'e}
2548 \DeclareInputText{"0F9}{\@tabacckludge`u}
2549 \DeclareInputText{"0EA}{\^e}
2550 \DeclareInputText{"0FA}{\@tabacckludge'u}
2551 \DeclareInputText{"0EB}{\"e}
2552 \DeclareInputText{"0FB}{\^u}
2553 \DeclareInputText{"0EC}{\@tabacckludge`\i}
2554 \DeclareInputText{"0FC}{\"u}
2555 \DeclareInputText{"0ED}{\@tabacckludge'\i}
2556 \DeclareInputText{"0FD}{\@tabacckludge'y}
2557 \DeclareInputText{"0EE}{\^\i}
2558 \DeclareInputText{"0FE}{\th}
2559 \DeclareInputText{"0EF}{\"\i}
2560 \DeclareInputText{"0FF}{\"y}
2561 %</dsssldef>
2562 % \end{macrocode}
2563 % \Finale
2564 %
2565 \endinput
2566