aboutsummaryrefslogtreecommitdiffstats
path: root/include
diff options
context:
space:
mode:
authorJeffrey H. Kingston <jeff@it.usyd.edu.au>2010-09-14 20:38:56 +0000
committerJeffrey H. Kingston <jeff@it.usyd.edu.au>2010-09-14 20:38:56 +0000
commit7d292f1247e3287fb07a9a12377217ce8942cf09 (patch)
treeffe937ba04fb59a72b785040cf29db1476f7282a /include
parent68c155de3c3e83f53404288a318c5e29f0c4610f (diff)
downloadlout-7d292f1247e3287fb07a9a12377217ce8942cf09.tar.gz
Lout 3.29.
git-svn-id: http://svn.savannah.nongnu.org/svn/lout/trunk@27 9365b830-b601-4143-9ba8-b4a8e2c3339c
Diffstat (limited to 'include')
-rw-r--r--include/README2
-rw-r--r--include/book9
-rw-r--r--include/bookf6
-rw-r--r--include/diagf453
-rw-r--r--include/diagf.lpg167
-rw-r--r--include/doc9
-rw-r--r--include/dsf60
-rw-r--r--include/graphf66
-rw-r--r--include/graphf.lpg100
-rw-r--r--include/haskell109
-rw-r--r--include/haskellf467
-rw-r--r--include/picture9
-rw-r--r--include/report9
-rw-r--r--include/rsl110
-rw-r--r--include/rslf448
-rw-r--r--include/save_bookf1358
-rw-r--r--include/save_dsf4930
-rw-r--r--include/slides9
18 files changed, 1926 insertions, 6395 deletions
diff --git a/include/README b/include/README
index ebea782..d4e5a84 100644
--- a/include/README
+++ b/include/README
@@ -38,6 +38,7 @@ Setup files (containing mainly lists of options settable by the user)
perl Perl + Pod
pod Pod
python Python
+ rsl RSL
ruby Ruby
Source files containing Lout and PostScript source code for the packages
@@ -74,6 +75,7 @@ Source files containing Lout and PostScript source code for the packages
perlf Perl
podf Pod
pythonf Python
+ rslf RSL
rubyf Ruby
Obsolete source files retained for backward compatibility
diff --git a/include/book b/include/book
index e2afc0f..09c8fa4 100644
--- a/include/book
+++ b/include/book
@@ -165,6 +165,9 @@
# @IndexFormat { @Body } # @Index format
# @SubIndexFormat { {1f @Wide}@Body } # @SubIndex format
# @SubSubIndexFormat { {2f @Wide}@Body } # @SubSubIndex format
+ # @IndexTypeOrdinary { @PageNum } # Ordinary pagenum format
+ # @IndexTypeMain { @B @PageNum } # Main pagenum format
+ # @IndexTypeSpecial { @I @PageNum } # Special pagenum format
# @IndexColumnNumber { 2 } # index columns (1 to 10)
# @IndexColumnGap { 1.00c @OrIfPlain 6s } # index column gap
# @IndexCtd { Yes } # include (ctd.) lines
@@ -181,6 +184,9 @@
# @IndexAFormat { @Body } # @IndexA format
# @SubIndexAFormat { {1f @Wide}@Body } # @SubIndexA format
# @SubSubIndexAFormat { {2f @Wide}@Body } # @SubSubIndexA format
+ # @IndexATypeOrdinary { @PageNum } # Ordinary pagenum format
+ # @IndexATypeMain { @B @PageNum } # Main pagenum format
+ # @IndexATypeSpecial { @I @PageNum } # Special pagenum format
# @IndexAColumnNumber { 2 } # index A columns (1 to 10)
# @IndexAColumnGap { 1.00c @OrIfPlain 6s } # index A column gap
# @IndexACtd { Yes } # include (ctd.) lines
@@ -197,6 +203,9 @@
# @IndexBFormat { @Body } # @IndexB format
# @SubIndexBFormat { {1f @Wide}@Body } # @SubIndexB format
# @SubSubIndexBFormat { {2f @Wide}@Body } # @SubSubIndexB format
+ # @IndexBTypeOrdinary { @PageNum } # Ordinary pagenum format
+ # @IndexBTypeMain { @B @PageNum } # Main pagenum format
+ # @IndexBTypeSpecial { @I @PageNum } # Special pagenum format
# @IndexBColumnNumber { 2 } # index B columns (1 to 10)
# @IndexBColumnGap { 1.00c @OrIfPlain 6s } # index B column gap
# @IndexBCtd { Yes } # include (ctd.) lines
diff --git a/include/bookf b/include/bookf
index 45a5bed..6aff163 100644
--- a/include/bookf
+++ b/include/bookf
@@ -651,7 +651,7 @@ def @BookSetup
# its flushing is delayed until we reach the body galleys, either
# @Introduction or @Chapter. If not, @BookBody will free up
# @PrefacePlace etc. too soon, producing a "no @PrefacePlace
- # precedes this @PrefacePLace&&preceding" error message.
+ # precedes this @PrefacePlace&&preceding" error message.
@AbbreviationsPlace
// @IntroductionPlace
@@ -659,11 +659,11 @@ def @BookSetup
// @ReferencesBeforeAppendices @Do {
@MakeReferences @Do @ReferencesPart
}
- // @MakeGlossary @Do @GlossaryPart
// @AppendixList @FirstAppendixNumber
// @ReferencesBeforeAppendices @NoDo {
@MakeReferences @Do @ReferencesPart
}
+ // @MakeGlossary @Do @GlossaryPart
// @MakeIndexA @Do @IndexAPart
// @MakeIndexA @Case {
Bypass @Yield @BypassBeginIndexAPlace
@@ -710,11 +710,11 @@ def @BookSetup
// @ReferencesBeforeAppendices @Do {
@MakeReferences @Do @ReferencesPart
}
- // @MakeGlossary @Do @GlossaryPart
// @AppendixList @FirstAppendixNumber
// @ReferencesBeforeAppendices @NoDo {
@MakeReferences @Do @ReferencesPart
}
+ // @MakeGlossary @Do @GlossaryPart
// @MakeIndexA @Do @IndexAPart
// @MakeIndexA @Case {
Bypass @Yield @BypassBeginIndexAPlace
diff --git a/include/diagf b/include/diagf
index 5142dc8..ab1e059 100644
--- a/include/diagf
+++ b/include/diagf
@@ -49,11 +49,17 @@ def @DiagSetup
import @Geometry named angle { "dup 180 exch div" }
named translate { }
named outlinestyle
- named solid { "/ldiagsolid" }
- named dashed { "/ldiagdashed" }
- named cdashed { "/ldiagcdashed" }
- named dotted { "/ldiagdotted" }
- named noline { "/ldiagnoline" }
+ named solid { "/ldiagsolid" }
+ named dashed { "/ldiagdashed" }
+ named cdashed { "/ldiagcdashed" }
+ named dotdashed { "/ldiagdotdashed" }
+ named dotcdashed { "/ldiagdotcdashed" }
+ named dotdotdashed { "/ldiagdotdotdashed" }
+ named dotdotcdashed { "/ldiagdotdotcdashed" }
+ named dotdotdotdashed { "/ldiagdotdotdotdashed" }
+ named dotdotdotcdashed { "/ldiagdotdotdotcdashed" }
+ named dotted { "/ldiagdotted" }
+ named noline { "/ldiagnoline" }
{ solid }
import @Geometry named outlinedashlength { 0.2f }
import @Geometry named outlinewidth
@@ -162,11 +168,17 @@ def @DiagSetup
import @Geometry named aangle { "dup 180 exch div" }
named atranslate { }
named aoutlinestyle
- named solid { "/ldiagsolid" }
- named dashed { "/ldiagdashed" }
- named cdashed { "/ldiagcdashed" }
- named dotted { "/ldiagdotted" }
- named noline { "/ldiagnoline" }
+ named solid { "/ldiagsolid" }
+ named dashed { "/ldiagdashed" }
+ named cdashed { "/ldiagcdashed" }
+ named dotdashed { "/ldiagdotdashed" }
+ named dotcdashed { "/ldiagdotcdashed" }
+ named dotdotdashed { "/ldiagdotdotdashed" }
+ named dotdotcdashed { "/ldiagdotdotcdashed" }
+ named dotdotdotdashed { "/ldiagdotdotdotdashed" }
+ named dotdotdotcdashed { "/ldiagdotdotdotcdashed" }
+ named dotted { "/ldiagdotted" }
+ named noline { "/ldiagnoline" }
{ solid }
import @Geometry named aoutlinedashlength { 0.2f }
import @Geometry named aoutlinewidth
@@ -275,11 +287,17 @@ def @DiagSetup
import @Geometry named bangle { "dup 180 exch div" }
named btranslate { }
named boutlinestyle
- named solid { "/ldiagsolid" }
- named dashed { "/ldiagdashed" }
- named cdashed { "/ldiagcdashed" }
- named dotted { "/ldiagdotted" }
- named noline { "/ldiagnoline" }
+ named solid { "/ldiagsolid" }
+ named dashed { "/ldiagdashed" }
+ named cdashed { "/ldiagcdashed" }
+ named dotdashed { "/ldiagdotdashed" }
+ named dotcdashed { "/ldiagdotcdashed" }
+ named dotdotdashed { "/ldiagdotdotdashed" }
+ named dotdotcdashed { "/ldiagdotdotcdashed" }
+ named dotdotdotdashed { "/ldiagdotdotdotdashed" }
+ named dotdotdotcdashed { "/ldiagdotdotdotcdashed" }
+ named dotted { "/ldiagdotted" }
+ named noline { "/ldiagnoline" }
{ solid }
import @Geometry named boutlinedashlength { 0.2f }
import @Geometry named boutlinewidth
@@ -388,11 +406,17 @@ def @DiagSetup
import @Geometry named cangle { "dup 180 exch div" }
named ctranslate { }
named coutlinestyle
- named solid { "/ldiagsolid" }
- named dashed { "/ldiagdashed" }
- named cdashed { "/ldiagcdashed" }
- named dotted { "/ldiagdotted" }
- named noline { "/ldiagnoline" }
+ named solid { "/ldiagsolid" }
+ named dashed { "/ldiagdashed" }
+ named cdashed { "/ldiagcdashed" }
+ named dotdashed { "/ldiagdotdashed" }
+ named dotcdashed { "/ldiagdotcdashed" }
+ named dotdotdashed { "/ldiagdotdotdashed" }
+ named dotdotcdashed { "/ldiagdotdotcdashed" }
+ named dotdotdotdashed { "/ldiagdotdotdotdashed" }
+ named dotdotdotcdashed { "/ldiagdotdotdotcdashed" }
+ named dotted { "/ldiagdotted" }
+ named noline { "/ldiagnoline" }
{ solid }
import @Geometry named coutlinedashlength { 0.2f }
import @Geometry named coutlinewidth
@@ -519,11 +543,17 @@ def @DiagSetup
import @Geometry named frompt { 0 0 }
import @Geometry named topt { 0 0 }
named pathstyle
- named solid { "/ldiagsolid" }
- named dashed { "/ldiagdashed" }
- named cdashed { "/ldiagcdashed" }
- named dotted { "/ldiagdotted" }
- named noline { "/ldiagnoline" }
+ named solid { "/ldiagsolid" }
+ named dashed { "/ldiagdashed" }
+ named cdashed { "/ldiagcdashed" }
+ named dotdashed { "/ldiagdotdashed" }
+ named dotcdashed { "/ldiagdotcdashed" }
+ named dotdotdashed { "/ldiagdotdotdashed" }
+ named dotdotcdashed { "/ldiagdotdotcdashed" }
+ named dotdotdotdashed { "/ldiagdotdotdotdashed" }
+ named dotdotdotcdashed { "/ldiagdotdotdotcdashed" }
+ named dotted { "/ldiagdotted" }
+ named noline { "/ldiagnoline" }
{ solid }
import @Geometry named pathdashlength { 0.2f }
import @Geometry named pathwidth
@@ -666,9 +696,9 @@ def @DiagSetup
@Tree @HTree
@StartRight @StartUp @StartLeft @StartDown
- @StartRightRight @StartRightDown
+ @StartRightRight @StartRightRightRight @StartRightDown
@Skip @XCell @ACell @BCell @CCell
- @Sequence @Select @Optional @OptionalDiverted @Diverted
+ @Sequence @OneOrBoth @Select @Optional @OptionalDiverted @Diverted
@Loop @LoopOpposite @Repeat @RepeatOpposite @RepeatDiverted
def @Diag
@@ -704,11 +734,17 @@ def @DiagSetup
named translate { translate }
named nodetag { }
named outlinestyle
- named solid { "/ldiagsolid" }
- named dashed { "/ldiagdashed" }
- named cdashed { "/ldiagcdashed" }
- named dotted { "/ldiagdotted" }
- named noline { "/ldiagnoline" }
+ named solid { "/ldiagsolid" }
+ named dashed { "/ldiagdashed" }
+ named cdashed { "/ldiagcdashed" }
+ named dotdashed { "/ldiagdotdashed" }
+ named dotcdashed { "/ldiagdotcdashed" }
+ named dotdotdashed { "/ldiagdotdotdashed" }
+ named dotdotcdashed { "/ldiagdotdotcdashed" }
+ named dotdotdotdashed { "/ldiagdotdotdotdashed" }
+ named dotdotdotcdashed { "/ldiagdotdotdotcdashed" }
+ named dotted { "/ldiagdotted" }
+ named noline { "/ldiagnoline" }
{ outlinestyle }
import @Geometry named outlinedashlength{ outlinedashlength }
import @Geometry named outlinewidth
@@ -766,11 +802,17 @@ def @DiagSetup
named atranslate { atranslate }
named anodetag { }
named aoutlinestyle
- named solid { "/ldiagsolid" }
- named dashed { "/ldiagdashed" }
- named cdashed { "/ldiagcdashed" }
- named dotted { "/ldiagdotted" }
- named noline { "/ldiagnoline" }
+ named solid { "/ldiagsolid" }
+ named dashed { "/ldiagdashed" }
+ named cdashed { "/ldiagcdashed" }
+ named dotdashed { "/ldiagdotdashed" }
+ named dotcdashed { "/ldiagdotcdashed" }
+ named dotdotdashed { "/ldiagdotdotdashed" }
+ named dotdotcdashed { "/ldiagdotdotcdashed" }
+ named dotdotdotdashed { "/ldiagdotdotdotdashed" }
+ named dotdotdotcdashed { "/ldiagdotdotdotcdashed" }
+ named dotted { "/ldiagdotted" }
+ named noline { "/ldiagnoline" }
{ aoutlinestyle }
import @Geometry named aoutlinedashlength{ aoutlinedashlength }
import @Geometry named aoutlinewidth
@@ -828,11 +870,17 @@ def @DiagSetup
named btranslate { btranslate }
named bnodetag { }
named boutlinestyle
- named solid { "/ldiagsolid" }
- named dashed { "/ldiagdashed" }
- named cdashed { "/ldiagcdashed" }
- named dotted { "/ldiagdotted" }
- named noline { "/ldiagnoline" }
+ named solid { "/ldiagsolid" }
+ named dashed { "/ldiagdashed" }
+ named cdashed { "/ldiagcdashed" }
+ named dotdashed { "/ldiagdotdashed" }
+ named dotcdashed { "/ldiagdotcdashed" }
+ named dotdotdashed { "/ldiagdotdotdashed" }
+ named dotdotcdashed { "/ldiagdotdotcdashed" }
+ named dotdotdotdashed { "/ldiagdotdotdotdashed" }
+ named dotdotdotcdashed { "/ldiagdotdotdotcdashed" }
+ named dotted { "/ldiagdotted" }
+ named noline { "/ldiagnoline" }
{ boutlinestyle }
import @Geometry named boutlinedashlength{ boutlinedashlength }
import @Geometry named boutlinewidth
@@ -890,11 +938,17 @@ def @DiagSetup
named ctranslate { ctranslate }
named cnodetag { }
named coutlinestyle
- named solid { "/ldiagsolid" }
- named dashed { "/ldiagdashed" }
- named cdashed { "/ldiagcdashed" }
- named dotted { "/ldiagdotted" }
- named noline { "/ldiagnoline" }
+ named solid { "/ldiagsolid" }
+ named dashed { "/ldiagdashed" }
+ named cdashed { "/ldiagcdashed" }
+ named dotdashed { "/ldiagdotdashed" }
+ named dotcdashed { "/ldiagdotcdashed" }
+ named dotdotdashed { "/ldiagdotdotdashed" }
+ named dotdotcdashed { "/ldiagdotdotcdashed" }
+ named dotdotdotdashed { "/ldiagdotdotdotdashed" }
+ named dotdotdotcdashed { "/ldiagdotdotdotcdashed" }
+ named dotted { "/ldiagdotted" }
+ named noline { "/ldiagnoline" }
{ coutlinestyle }
import @Geometry named coutlinedashlength{ coutlinedashlength }
import @Geometry named coutlinewidth
@@ -980,11 +1034,17 @@ def @DiagSetup
import @Geometry named frompt { frompt }
import @Geometry named topt { topt }
named pathstyle
- named solid { "/ldiagsolid" }
- named dashed { "/ldiagdashed" }
- named cdashed { "/ldiagcdashed" }
- named dotted { "/ldiagdotted" }
- named noline { "/ldiagnoline" }
+ named solid { "/ldiagsolid" }
+ named dashed { "/ldiagdashed" }
+ named cdashed { "/ldiagcdashed" }
+ named dotdashed { "/ldiagdotdashed" }
+ named dotcdashed { "/ldiagdotcdashed" }
+ named dotdotdashed { "/ldiagdotdotdashed" }
+ named dotdotcdashed { "/ldiagdotdotcdashed" }
+ named dotdotdotdashed { "/ldiagdotdotdotdashed" }
+ named dotdotdotcdashed { "/ldiagdotdotdotcdashed" }
+ named dotted { "/ldiagdotted" }
+ named noline { "/ldiagnoline" }
{ pathstyle }
import @Geometry named pathdashlength { pathdashlength }
import @Geometry named pathwidth
@@ -2267,11 +2327,17 @@ def @DiagSetup
import @Geometry named angle { angle }
named nodetag { nodetag }
named outlinestyle
- named solid { "/ldiagsolid" }
- named dashed { "/ldiagdashed" }
- named cdashed { "/ldiagcdashed" }
- named dotted { "/ldiagdotted" }
- named noline { "/ldiagnoline" }
+ named solid { "/ldiagsolid" }
+ named dashed { "/ldiagdashed" }
+ named cdashed { "/ldiagcdashed" }
+ named dotdashed { "/ldiagdotdashed" }
+ named dotcdashed { "/ldiagdotcdashed" }
+ named dotdotdashed { "/ldiagdotdotdashed" }
+ named dotdotcdashed { "/ldiagdotdotcdashed" }
+ named dotdotdotdashed { "/ldiagdotdotdotdashed" }
+ named dotdotdotcdashed { "/ldiagdotdotdotcdashed" }
+ named dotted { "/ldiagdotted" }
+ named noline { "/ldiagnoline" }
{ outlinestyle }
import @Geometry named outlinedashlength { outlinedashlength}
import @Geometry named outlinewidth
@@ -2611,11 +2677,17 @@ def @DiagSetup
import @Geometry named angle { aangle }
named nodetag { anodetag }
named outlinestyle
- named solid { "/ldiagsolid" }
- named dashed { "/ldiagdashed" }
- named cdashed { "/ldiagcdashed" }
- named dotted { "/ldiagdotted" }
- named noline { "/ldiagnoline" }
+ named solid { "/ldiagsolid" }
+ named dashed { "/ldiagdashed" }
+ named cdashed { "/ldiagcdashed" }
+ named dotdashed { "/ldiagdotdashed" }
+ named dotcdashed { "/ldiagdotcdashed" }
+ named dotdotdashed { "/ldiagdotdotdashed" }
+ named dotdotcdashed { "/ldiagdotdotcdashed" }
+ named dotdotdotdashed { "/ldiagdotdotdotdashed" }
+ named dotdotdotcdashed { "/ldiagdotdotdotcdashed" }
+ named dotted { "/ldiagdotted" }
+ named noline { "/ldiagnoline" }
{ aoutlinestyle }
import @Geometry named outlinedashlength { aoutlinedashlength}
import @Geometry named outlinewidth
@@ -2955,11 +3027,17 @@ def @DiagSetup
import @Geometry named angle { bangle }
named nodetag { bnodetag }
named outlinestyle
- named solid { "/ldiagsolid" }
- named dashed { "/ldiagdashed" }
- named cdashed { "/ldiagcdashed" }
- named dotted { "/ldiagdotted" }
- named noline { "/ldiagnoline" }
+ named solid { "/ldiagsolid" }
+ named dashed { "/ldiagdashed" }
+ named cdashed { "/ldiagcdashed" }
+ named dotdashed { "/ldiagdotdashed" }
+ named dotcdashed { "/ldiagdotcdashed" }
+ named dotdotdashed { "/ldiagdotdotdashed" }
+ named dotdotcdashed { "/ldiagdotdotcdashed" }
+ named dotdotdotdashed { "/ldiagdotdotdotdashed" }
+ named dotdotdotcdashed { "/ldiagdotdotdotcdashed" }
+ named dotted { "/ldiagdotted" }
+ named noline { "/ldiagnoline" }
{ boutlinestyle }
import @Geometry named outlinedashlength { boutlinedashlength}
import @Geometry named outlinewidth
@@ -3299,11 +3377,17 @@ def @DiagSetup
import @Geometry named angle { cangle }
named nodetag { cnodetag }
named outlinestyle
- named solid { "/ldiagsolid" }
- named dashed { "/ldiagdashed" }
- named cdashed { "/ldiagcdashed" }
- named dotted { "/ldiagdotted" }
- named noline { "/ldiagnoline" }
+ named solid { "/ldiagsolid" }
+ named dashed { "/ldiagdashed" }
+ named cdashed { "/ldiagcdashed" }
+ named dotdashed { "/ldiagdotdashed" }
+ named dotcdashed { "/ldiagdotcdashed" }
+ named dotdotdashed { "/ldiagdotdotdashed" }
+ named dotdotcdashed { "/ldiagdotdotcdashed" }
+ named dotdotdotdashed { "/ldiagdotdotdotdashed" }
+ named dotdotdotcdashed { "/ldiagdotdotdotcdashed" }
+ named dotted { "/ldiagdotted" }
+ named noline { "/ldiagnoline" }
{ coutlinestyle }
import @Geometry named outlinedashlength { coutlinedashlength}
import @Geometry named outlinewidth
@@ -3977,11 +4061,17 @@ def @DiagSetup
import @Geometry named frompt { frompt }
import @Geometry named topt { topt }
named pathstyle
- named solid { "/ldiagsolid" }
- named dashed { "/ldiagdashed" }
- named cdashed { "/ldiagcdashed" }
- named dotted { "/ldiagdotted" }
- named noline { "/ldiagnoline" }
+ named solid { "/ldiagsolid" }
+ named dashed { "/ldiagdashed" }
+ named cdashed { "/ldiagcdashed" }
+ named dotdashed { "/ldiagdotdashed" }
+ named dotcdashed { "/ldiagdotcdashed" }
+ named dotdotdashed { "/ldiagdotdotdashed" }
+ named dotdotcdashed { "/ldiagdotdotcdashed" }
+ named dotdotdotdashed { "/ldiagdotdotdotdashed" }
+ named dotdotdotcdashed { "/ldiagdotdotdotcdashed" }
+ named dotted { "/ldiagdotted" }
+ named noline { "/ldiagnoline" }
{ pathstyle }
import @Geometry named pathdashlength { pathdashlength }
import @Geometry named pathwidth
@@ -5209,8 +5299,19 @@ def @DiagSetup
def @Direct
{
pathstyle @Case {
- { "/ldiagsolid" "/ldiagdashed" "/ldiagcdashed"
- "/ldiagdotted" "/ldiagnoline" } @Yield 1
+ {
+ "/ldiagsolid"
+ "/ldiagdashed"
+ "/ldiagdotted"
+ "/ldiagnoline"
+ "/ldiagcdashed"
+ "/ldiagdotdashed"
+ "/ldiagdotcdashed"
+ "/ldiagdotdotdashed"
+ "/ldiagdotdotcdashed"
+ "/ldiagdotdotdotdashed"
+ "/ldiagdotdotdotcdashed"
+ } @Yield 1
else @Yield 0
}
}
@@ -5299,11 +5400,17 @@ def @DiagSetup
import @Geometry named frompt { frompt }
import @Geometry named topt { topt }
named pathstyle
- named solid { "/ldiagsolid" }
- named dashed { "/ldiagdashed" }
- named cdashed { "/ldiagcdashed" }
- named dotted { "/ldiagdotted" }
- named noline { "/ldiagnoline" }
+ named solid { "/ldiagsolid" }
+ named dashed { "/ldiagdashed" }
+ named cdashed { "/ldiagcdashed" }
+ named dotdashed { "/ldiagdotdashed" }
+ named dotcdashed { "/ldiagdotcdashed" }
+ named dotdotdashed { "/ldiagdotdotdashed" }
+ named dotdotcdashed { "/ldiagdotdotcdashed" }
+ named dotdotdotdashed { "/ldiagdotdotdotdashed" }
+ named dotdotdotcdashed { "/ldiagdotdotdotcdashed" }
+ named dotted { "/ldiagdotted" }
+ named noline { "/ldiagnoline" }
{ pathstyle }
import @Geometry named pathdashlength { pathdashlength }
import @Geometry named pathwidth
@@ -5992,6 +6099,41 @@ def @DiagSetup
back @ArrowLeftFrom BB@EMK
}
+ def @StartRightRightRight
+ named A {}
+ named B {}
+ named C {}
+ {
+ AA:: @LabelMarks { @HSkip & @GoRight A }
+ //syntaxgap
+ //syntaxgap
+ |syntaxgap |syntaxgap |syntaxgap |syntaxgap |syntaxgap |syntaxgap
+ XX:: @LabelMarks {}
+ //syntaxgap
+ //syntaxgap
+ |syntaxgap |syntaxgap |syntaxgap |syntaxgap |syntaxgap |syntaxgap
+ BB:: @LabelMarks { @GoRight B & @HSkip }
+ //syntaxgap
+ //syntaxgap
+ |syntaxgap |syntaxgap |syntaxgap |syntaxgap |syntaxgap |syntaxgap
+ YY:: @LabelMarks {}
+ //syntaxgap
+ //syntaxgap
+ |syntaxgap |syntaxgap |syntaxgap |syntaxgap |syntaxgap |syntaxgap
+ CC:: @LabelMarks { @GoRight C & @HSkip }
+ //syntaxgap
+ //syntaxgap
+ // @RVLCurve from { AA@EMK } to { XX@WMK }
+ bias { pssyntaxbias } radius { pssyntaxradius }
+ // @LVRCurve from { XX@WMK } to { BB@WMK }
+ bias { pssyntaxbias } radius { pssyntaxradius }
+ // @RVLCurve from { BB@EMK } to { YY@WMK }
+ bias { pssyntaxbias } radius { pssyntaxradius }
+ // @LVRCurve from { YY@WMK } to { CC@WMK }
+ bias { pssyntaxbias } radius { pssyntaxradius }
+ back @ArrowLeftFrom CC@EMK
+ }
+
def @StartRightDown
named A {}
named B {}
@@ -6114,6 +6256,149 @@ def @DiagSetup
#######################################################################
# #
+ # @OneOrBoth #
+ # #
+ #######################################################################
+
+ def @OneOrBoth
+ named A {}
+ named B {}
+ {
+
+ def @ALH {
+ @HContract {
+ |syntaxgap
+ "AX":: restrict { "(WMK) (EMK)" } @LabelMarks A
+ |syntaxgap
+ }
+ }
+
+ def @BLH {
+ @HContract {
+ |syntaxgap
+ "BX":: restrict { "(WMK) (EMK)" } @LabelMarks B
+ |syntaxgap
+ }
+ }
+
+ def @ALV {
+ @VContract {
+ /syntaxgap
+ "AX":: restrict { "(NMK) (SMK)" } @LabelMarks A
+ /syntaxgap
+ }
+ }
+
+ def @BLV {
+ @VContract {
+ /syntaxgap
+ "BX":: restrict { "(NMK) (SMK)" } @LabelMarks B
+ /syntaxgap
+ }
+ }
+
+ def @RightOneOrBoth
+ {
+ @LRLine {
+ @HContract @VContract { @ALH | /syntaxgap | @BLH }
+ //
+ @HVCurve from { "BX@WMK" } to { 0 ycoord "AX@WMK" }
+ arrow { no } bias { pssyntaxbias } radius { pssyntaxradius }
+ //
+ @HVCurve from { "BX@EMK" } to { xsize ycoord "AX@WMK" }
+ arrow { yes } bias { pssyntaxbias } radius { pssyntaxradius }
+ //
+ @Line from { 0 ycoord "AX@WMK" } to { "AX@WMK" }
+ //
+ @Line from { "AX@EMK" } to { xsize ycoord "AX@WMK" }
+ //
+ @Arrow
+ from { {xcoord "AX@EMK" * 0.5 + xcoord "BX@WMK" * 0.5}
+ ycoord "AX@EMK" }
+ to { {xcoord "AX@EMK" * 0.5 + xcoord "BX@WMK" * 0.5}
+ ycoord "BX@WMK" }
+ }
+ }
+
+ def @LeftOneOrBoth
+ {
+ @LRLine {
+ @HContract @VContract { | @ALH /syntaxgap @BLH | }
+ //
+ @HVCurve from { "BX@WMK" } to { 0 ycoord "AX@WMK" }
+ arrow { yes } bias { pssyntaxbias } radius { pssyntaxradius }
+ //
+ @HVCurve from { "BX@EMK" } to { xsize ycoord "AX@WMK" }
+ arrow { no } bias { pssyntaxbias } radius { pssyntaxradius }
+ //
+ @Line from { 0 ycoord "AX@WMK" } to { "AX@WMK" }
+ //
+ @Line from { "AX@EMK" } to { xsize ycoord "AX@WMK" }
+ //
+ @Arrow
+ from { {xcoord "AX@WMK" * 0.5 + xcoord "BX@EMK" * 0.5}
+ ycoord "AX@WMK" }
+ to { {xcoord "AX@WMK" * 0.5 + xcoord "BX@EMK" * 0.5}
+ ycoord "BX@EMK" }
+ }
+ }
+
+ def @DownOneOrBoth
+ {
+ @UDLine {
+ @HContract @VContract { @ALV |syntaxgap / | @BLV }
+ ||
+ @VHCurve from { "BX@NMK" } to { xcoord "AX@NMK" ysize }
+ arrow { no } bias { pssyntaxbias } radius { pssyntaxradius }
+ ||
+ @VHCurve from { "BX@SMK" } to { xcoord "AX@NMK" 0 }
+ arrow { yes } bias { pssyntaxbias } radius { pssyntaxradius }
+ ||
+ @Line from { xcoord "AX@NMK" ysize } to { "AX@NMK" }
+ ||
+ @Line from { "AX@SMK" } to { xcoord "AX@SMK" 0 }
+ ||
+ @Arrow
+ from { xcoord "AX@SMK"
+ {ycoord "AX@SMK" * 0.5 + ycoord "BX@NMK" * 0.5} }
+ to { xcoord "BX@NMK"
+ {ycoord "AX@SMK" * 0.5 + ycoord "BX@NMK" * 0.5} }
+ }
+ }
+
+ def @UpOneOrBoth
+ {
+ @UDLine {
+ @HContract @VContract { |syntaxgap @BLV / @ALV | }
+ ||
+ @VHCurve from { "BX@NMK" } to { xcoord "AX@NMK" ysize }
+ arrow { yes } bias { pssyntaxbias } radius { pssyntaxradius }
+ ||
+ @VHCurve from { "BX@SMK" } to { xcoord "AX@NMK" 0 }
+ arrow { no } bias { pssyntaxbias } radius { pssyntaxradius }
+ ||
+ @Line from { xcoord "AX@NMK" ysize } to { "AX@NMK" }
+ ||
+ @Line from { "AX@SMK" } to { xcoord "AX@SMK" 0 }
+ ||
+ @Arrow
+ from { xcoord "AX@NMK"
+ {ycoord "AX@NMK" * 0.5 + ycoord "BX@SMK" * 0.5} }
+ to { xcoord "BX@SMK"
+ {ycoord "AX@NMK" * 0.5 + ycoord "BX@SMK" * 0.5} }
+ }
+ }
+
+ @CurrDirection @Case {
+ @Right @Yield @RightOneOrBoth
+ @Up @Yield @UpOneOrBoth
+ @Left @Yield @LeftOneOrBoth
+ @Down @Yield @DownOneOrBoth
+ }
+ }
+
+ #######################################################################
+ # #
# @Select and @Optional #
# #
#######################################################################
diff --git a/include/diagf.lpg b/include/diagf.lpg
index 3a076ef..289672f 100644
--- a/include/diagf.lpg
+++ b/include/diagf.lpg
@@ -79,14 +79,9 @@ end
/ldiagdebugposy 432 def
/ldiagdebugposx 72 def
-% <string> <int> ldiagdebugprint -
-% must be defined outside ldiagdict since used in arbitrary places
-% print <string> plus count or <int> stack entries, whichever is the smaller
-/ldiagdebugprint
+% - ldiagdebugnextline -
+/ldiagdebugnextline
{
- exch
- gsave
- initgraphics
ldiagdebugposy 72 lt
{ /ldiagdebugposx ldiagdebugposx 144 add store
/ldiagdebugposy 432 store
@@ -95,30 +90,68 @@ end
/ldiagdebugposy ldiagdebugposy 12 sub store
} ifelse
ldiagdebugposx ldiagdebugposy moveto
+} def
+
+% - ldiagdebugbeginindent -
+/ldiagdebugbeginindent
+{
+ /ldiagdebugposx ldiagdebugposx 12 add store
+} def
+
+% - ldiagdebugendindent -
+/ldiagdebugendindent
+{
+ /ldiagdebugposx ldiagdebugposx 12 sub store
+} def
+
+% <string> <int> ldiagdebugprint -
+% must be defined outside ldiagdict since used in arbitrary places
+% print <string> plus count or <int> stack entries, whichever is the smaller
+/ldiagdebugprint
+{
+ exch
+ gsave
+ initgraphics
+ ldiagdebugnextline
/Times-Roman findfont 10 scalefont setfont
0 setgray show
+ ldiagdebugbeginindent
count 1 sub 2 copy lt { pop } { exch pop } ifelse 1 sub
0 exch 1 exch
{
- /ldiagdebugposy ldiagdebugposy 12 sub store
- ldiagdebugposx 12 add ldiagdebugposy moveto
+ ldiagdebugnextline
index
dup type (dicttype) eq
{
(begin dict) show
+ ldiagdebugbeginindent
{
- /ldiagdebugposy ldiagdebugposy 12 sub store
- ldiagdebugposx 12 add ldiagdebugposy moveto
+ ldiagdebugnextline
pop 100 string cvs show
} forall
- /ldiagdebugposy ldiagdebugposy 12 sub store
- ldiagdebugposx 12 add ldiagdebugposy moveto
+ ldiagdebugendindent
+ ldiagdebugnextline
(end dict) show
}
{
- 100 string cvs show
+ dup type (arraytype) eq
+ {
+ (begin array) show
+ ldiagdebugbeginindent
+ {
+ ldiagdebugnextline
+ 100 string cvs show
+ } forall
+ ldiagdebugendindent
+ ldiagdebugnextline
+ (end array) show
+ }
+ {
+ 100 string cvs show
+ } ifelse
} ifelse
} for
+ ldiagdebugendindent
grestore
} def
@@ -186,6 +219,11 @@ ldiagdict begin
% distance between two points: <point> <point> ldiagdistance <length>
/ldiagdistance { ldiagpsub dup mul exch dup mul add sqrt } def
+% stroke a noline line: <length> <dashlength> ldiagnoline -
+/ldiagnoline
+{ pop pop
+} def
+
% stroke a solid line: <length> <dashlength> ldiagsolid -
/ldiagsolid
{ pop pop [] 0 setdash 1 setlinecap stroke
@@ -222,9 +260,104 @@ ldiagdict begin
} ifelse 1 setlinecap stroke
} def
-% stroke a noline line: <length> <dashlength> ldiagnoline -
-/ldiagnoline
-{ pop pop
+% scale array elements by factor: <array> <factor> ldiagscalearray <array>
+/ldiagscalearray
+{
+ [ exch 3 2 roll
+ { exch dup 3 1 roll mul exch } forall
+ pop ]
+} def
+
+% sum array elements: <array> ldiagsumarray <number>
+/ldiagsumarray
+{
+ 0 exch { add } forall
+} def
+
+% begin a more complex line: <length> <dashlength> ldiaglinebegin -
+/ldiaglinebegin
+{
+ % (Entering ldiaglinebegin) 2 ldiagdebugprint
+ 20 dict begin
+ /dashlen exch 1 pt ldiagmax def
+ /len exch def
+ /gap dashlen def
+ /halfgap dashlen 2 div def
+ /dash dashlen def
+ /halfdash dashlen 2 div def
+ /dot 0 def
+ % (Leaving ldiaglinebegin) 0 ldiagdebugprint
+} def
+
+% end a more complex line: <linecap> <cycle> <startpos> <stoppos> ldiaglineend -
+/ldiaglineend
+{
+ % (Entering ldiaglineend) 3 ldiagdebugprint
+ /stoppos exch def
+ /startpos exch def
+ /cycle exch def
+ /linecap exch def
+ /stopposlen stoppos ldiagsumarray def
+ /startposlen startpos ldiagsumarray def
+ /cyclelen cycle ldiagsumarray def
+ /effectivelen len startposlen add stopposlen sub def
+ effectivelen 0 gt cyclelen 0 gt and
+ {
+ /repeats effectivelen cyclelen div ceiling def
+ /factor len repeats cyclelen mul startposlen sub stopposlen add div def
+ cycle factor ldiagscalearray startposlen factor mul setdash
+ linecap setlinecap stroke
+ } if
+ end
+ % (Leaving ldiaglineend) 0 ldiagdebugprint
+} def
+
+% stroke a dotdashed line: <length> <dashlength> ldiagdotdashed -
+/ldiagdotdashed
+{
+ ldiaglinebegin
+ 1 [dash gap dot gap] [] [dash]
+ ldiaglineend
+} def
+
+% stroke a dotcdashed line: <length> <dashlength> ldiagdotcdashed -
+/ldiagdotcdashed
+{
+ ldiaglinebegin
+ 1 [dash gap dot gap] [halfdash] [halfdash]
+ ldiaglineend
+} def
+
+% stroke a dotdotdashed line: <length> <dashlength> ldiagdotdotdashed -
+/ldiagdotdotdashed
+{
+ ldiaglinebegin
+ 1 [dash gap dot gap dot gap] [] [dash]
+ ldiaglineend
+} def
+
+% stroke a dotdotcdashed line: <length> <dashlength> ldiagdotdotcdashed -
+/ldiagdotdotcdashed
+{
+ ldiaglinebegin
+ 1 [dash gap dot gap dot gap] [halfdash] [halfdash]
+ ldiaglineend
+} def
+
+% stroke a dotdotdotdashed line: <length> <dashlength> ldiagdotdotdotdashed -
+/ldiagdotdotdotdashed
+{
+ ldiaglinebegin
+ 1 [dash gap dot gap dot gap dot gap] [] [dash]
+ ldiaglineend
+} def
+
+% stroke a dotdotdotcdashed line: <length> <dashlength> ldiagdotdotdotcdashed -
+/ldiagdotdotdotcdashed
+{
+ ldiaglinebegin
+ 1 [dash gap dot gap dot gap dot gap] [halfdash] [halfdash]
+ ldiaglineend
} def
% shape and labels of the @Box symbol
diff --git a/include/doc b/include/doc
index fdf436a..6138687 100644
--- a/include/doc
+++ b/include/doc
@@ -164,6 +164,9 @@
# @IndexFormat { @Body } # @Index format
# @SubIndexFormat { {1f @Wide}@Body } # @SubIndex format
# @SubSubIndexFormat { {2f @Wide}@Body } # @SubSubIndex format
+ # @IndexTypeOrdinary { @PageNum } # Ordinary pagenum format
+ # @IndexTypeMain { @B @PageNum } # Main pagenum format
+ # @IndexTypeSpecial { @I @PageNum } # Special pagenum format
# @IndexColumnNumber { 2 } # index columns (1 to 10)
# @IndexColumnGap { 1.00c @OrIfPlain 6s } # index column gap
# @IndexCtd { Yes } # include (ctd.) lines
@@ -180,6 +183,9 @@
# @IndexAFormat { @Body } # @IndexA format
# @SubIndexAFormat { {1f @Wide}@Body } # @SubIndexA format
# @SubSubIndexAFormat { {2f @Wide}@Body } # @SubSubIndexA format
+ # @IndexATypeOrdinary { @PageNum } # Ordinary pagenum format
+ # @IndexATypeMain { @B @PageNum } # Main pagenum format
+ # @IndexATypeSpecial { @I @PageNum } # Special pagenum format
# @IndexAColumnNumber { 2 } # index A columns (1 to 10)
# @IndexAColumnGap { 1.00c @OrIfPlain 6s } # index A column gap
# @IndexACtd { Yes } # include (ctd.) lines
@@ -196,6 +202,9 @@
# @IndexBFormat { @Body } # @IndexB format
# @SubIndexBFormat { {1f @Wide}@Body } # @SubIndexB format
# @SubSubIndexBFormat { {2f @Wide}@Body } # @SubSubIndexB format
+ # @IndexBTypeOrdinary { @PageNum } # Ordinary pagenum format
+ # @IndexBTypeMain { @B @PageNum } # Main pagenum format
+ # @IndexBTypeSpecial { @I @PageNum } # Special pagenum format
# @IndexBColumnNumber { 2 } # index B columns (1 to 10)
# @IndexBColumnGap { 1.00c @OrIfPlain 6s } # index B column gap
# @IndexBCtd { Yes } # include (ctd.) lines
diff --git a/include/dsf b/include/dsf
index 18a3825..2d3fa2b 100644
--- a/include/dsf
+++ b/include/dsf
@@ -267,6 +267,12 @@ def @DocumentSetup
right @Body { {1f @Wide}@Body } # @SubIndex format
named @SubSubIndexFormat
right @Body { {2f @Wide}@Body } # @SubSubIndex format
+ named @IndexTypeOrdinary
+ right @PageNum { @PageNum } # ordinary page numbers
+ named @IndexTypeMain
+ right @PageNum { @B @PageNum } # main page numbers
+ named @IndexTypeSpecial
+ right @PageNum { @I @PageNum } # special page numbers
named @IndexColumnNumber { 2 } # index columns (1 to 10)
named @IndexColumnGap { 1.00c @OrIfPlain 6s } # index column gap
named @IndexCtd { Yes } # include (ctd.) lines
@@ -290,6 +296,12 @@ def @DocumentSetup
right @Body { {1f @Wide}@Body } # @SubIndexA format
named @SubSubIndexAFormat
right @Body { {2f @Wide}@Body } # @SubSubIndexA format
+ named @IndexATypeOrdinary
+ right @PageNum { @PageNum } # ordinary page numbers
+ named @IndexATypeMain
+ right @PageNum { @B @PageNum } # main page numbers
+ named @IndexATypeSpecial
+ right @PageNum { @I @PageNum } # special page numbers
named @IndexAColumnNumber { 2 } # index A columns (1 to 10)
named @IndexAColumnGap { 1.00c @OrIfPlain 6s } # index A column gap
named @IndexACtd { Yes } # include (ctd.) lines
@@ -313,6 +325,12 @@ def @DocumentSetup
right @Body { {1f @Wide}@Body } # @SubIndexB format
named @SubSubIndexBFormat
right @Body { {2f @Wide}@Body } # @SubSubIndexB format
+ named @IndexBTypeOrdinary
+ right @PageNum { @PageNum } # ordinary page numbers
+ named @IndexBTypeMain
+ right @PageNum { @B @PageNum } # main page numbers
+ named @IndexBTypeSpecial
+ right @PageNum { @I @PageNum } # special page numbers
named @IndexBColumnNumber { 2 } # index B columns (1 to 10)
named @IndexBColumnGap { 1.00c @OrIfPlain 6s } # index B column gap
named @IndexBCtd { Yes } # include (ctd.) lines
@@ -4226,6 +4244,7 @@ def @DocumentSetup
def @Index
left lpart
named @Tag {}
+ named pnformat right @PageNum { Ordinary }
named depth { 0 }
named to {}
right rpart
@@ -4235,6 +4254,17 @@ def @DocumentSetup
tag @CrossLink @PageOf tag
}
+ def @Fmt right x
+ {
+ {pnformat x} @Case
+ {
+ Ordinary @Yield @IndexTypeOrdinary x
+ Main @Yield @IndexTypeMain x
+ Special @Yield @IndexTypeSpecial x
+ else @Yield {pnformat x}
+ }
+ }
+
def @PgRange
{
to @Case
@@ -4253,7 +4283,7 @@ def @DocumentSetup
@MakeIndex @Case {
Yes @Yield {
@PageMark @Tag &
- lpart @DoIndex depth { depth } pgrange { @PgRange } rpart }
+ lpart @DoIndex depth { depth } pgrange { @Fmt @PgRange } rpart }
else @Yield @Null
}
}
@@ -4423,6 +4453,7 @@ def @DocumentSetup
def @IndexA
left lpart
named @Tag {}
+ named pnformat right @PageNum { Ordinary }
named depth { 0 }
named to {}
right rpart
@@ -4432,6 +4463,17 @@ def @DocumentSetup
tag @CrossLink @PageOf tag
}
+ def @Fmt right x
+ {
+ {pnformat x} @Case
+ {
+ Ordinary @Yield @IndexATypeOrdinary x
+ Main @Yield @IndexATypeMain x
+ Special @Yield @IndexATypeSpecial x
+ else @Yield {pnformat x}
+ }
+ }
+
def @PgRange
{
to @Case
@@ -4450,7 +4492,7 @@ def @DocumentSetup
@MakeIndexA @Case {
Yes @Yield {
@PageMark @Tag &
- lpart @DoIndexA depth { depth } pgrange { @PgRange } rpart }
+ lpart @DoIndexA depth { depth } pgrange { @Fmt @PgRange } rpart }
else @Yield @Null
}
}
@@ -4620,6 +4662,7 @@ def @DocumentSetup
def @IndexB
left lpart
named @Tag {}
+ named pnformat right @PageNum { Ordinary }
named depth { 0 }
named to {}
right rpart
@@ -4629,6 +4672,17 @@ def @DocumentSetup
tag @CrossLink @PageOf tag
}
+ def @Fmt right x
+ {
+ {pnformat x} @Case
+ {
+ Ordinary @Yield @IndexBTypeOrdinary x
+ Main @Yield @IndexBTypeMain x
+ Special @Yield @IndexBTypeSpecial x
+ else @Yield {pnformat x}
+ }
+ }
+
def @PgRange
{
to @Case
@@ -4647,7 +4701,7 @@ def @DocumentSetup
@MakeIndexB @Case {
Yes @Yield {
@PageMark @Tag &
- lpart @DoIndexB depth { depth } pgrange { @PgRange } rpart }
+ lpart @DoIndexB depth { depth } pgrange { @Fmt @PgRange } rpart }
else @Yield @Null
}
}
diff --git a/include/graphf b/include/graphf
index e228021..8bb9d05 100644
--- a/include/graphf
+++ b/include/graphf
@@ -411,6 +411,66 @@ def @GraphDotted
}
}
+def @GraphDotDashed
+ import @PSLengths named dashlength { 0.2f }
+ import @PSLengths named linewidth { "currentlinewidth" }
+ import @LoutLengths named length { 1.0f }
+{
+ @BackEnd @Case {
+ PostScript @Yield {
+ @HContract @VContract
+ { "xsize 0 lgraphdict begin newpath 0 0 moveto lineto"
+ "/linewidth" linewidth "def xsize" dashlength "dotdashed end"
+ } @Graphic { length @Wide }
+ }
+# VT: PDF does nothing
+ PDF @Yield {
+ @HContract @VContract
+ { "% @GraphDotDashed UNIMPLEMENTED" } @Graphic { length @Wide }
+ }
+ }
+}
+
+def @GraphDotDotDashed
+ import @PSLengths named dashlength { 0.2f }
+ import @PSLengths named linewidth { "currentlinewidth" }
+ import @LoutLengths named length { 1.0f }
+{
+ @BackEnd @Case {
+ PostScript @Yield {
+ @HContract @VContract
+ { "xsize 0 lgraphdict begin newpath 0 0 moveto lineto"
+ "/linewidth" linewidth "def xsize" dashlength "dotdotdashed end"
+ } @Graphic { length @Wide }
+ }
+# VT: PDF does nothing
+ PDF @Yield {
+ @HContract @VContract
+ { "% @GraphDotDotDashed UNIMPLEMENTED" } @Graphic { length @Wide }
+ }
+ }
+}
+
+def @GraphDotDotDotDashed
+ import @PSLengths named dashlength { 0.2f }
+ import @PSLengths named linewidth { "currentlinewidth" }
+ import @LoutLengths named length { 1.0f }
+{
+ @BackEnd @Case {
+ PostScript @Yield {
+ @HContract @VContract
+ { "xsize 0 lgraphdict begin newpath 0 0 moveto lineto"
+ "/linewidth" linewidth "def xsize" dashlength "dotdotdotdashed end"
+ } @Graphic { length @Wide }
+ }
+# VT: PDF does nothing
+ PDF @Yield {
+ @HContract @VContract
+ { "% @GraphDotDotDotDashed UNIMPLEMENTED" } @Graphic { length @Wide }
+ }
+ }
+}
+
export @Data
def @Graph
@@ -701,6 +761,12 @@ def @Graph
solid @Yield { "linesetup solid" @IfPt "ilinesetup solid" }
dashed @Yield { "linesetup cdashed" @IfPt "ilinesetup dashed" }
dotted @Yield { "linesetup dotted" @IfPt "ilinesetup dotted" }
+ dotdashed @Yield { "linesetup dotcdashed" @IfPt
+ "ilinesetup dotdashed" }
+ dotdotdashed @Yield { "linesetup dotdotcdashed" @IfPt
+ "ilinesetup dotdotdashed" }
+ dotdotdotdashed @Yield { "linesetup dotdotdotcdashed" @IfPt
+ "ilinesetup dotdotdotdashed" }
surfacexhisto @Yield { "surfacexhisto" }
surfaceyhisto @Yield { "surfaceyhisto" }
xhisto @Yield { "xhisto" }
diff --git a/include/graphf.lpg b/include/graphf.lpg
index 3c7edbc..5546586 100644
--- a/include/graphf.lpg
+++ b/include/graphf.lpg
@@ -123,6 +123,106 @@ lgraphdict begin
{ pop pop
} def
+% scale array elements by factor: <array> <factor> scalearray <array>
+/scalearray
+{
+ [ exch 3 2 roll
+ { exch dup 3 1 roll mul exch } forall
+ pop ]
+} def
+
+% sum array elements: <array> sumarray <number>
+/sumarray
+{
+ 0 exch { add } forall
+} def
+
+% begin a more complex line: <length> <dashlength> linebegin -
+/linebegin
+{
+ % (Entering linebegin) 2 debugprint
+ 20 dict begin
+ /dashlen exch 1 pt max def
+ /len exch def
+ /gap dashlen def
+ /halfgap dashlen 2 div def
+ /dash dashlen def
+ /halfdash dashlen 2 div def
+ /dot 0 def
+ % (Leaving linebegin) 0 debugprint
+} def
+% end a more complex line: <linecap> <cycle> <startpos> <stoppos> lineend -
+/lineend
+{
+ % (Entering lineend) 3 debugprint
+ /stoppos exch def
+ /startpos exch def
+ /cycle exch def
+ /linecap exch def
+ /stopposlen stoppos sumarray def
+ /startposlen startpos sumarray def
+ /cyclelen cycle sumarray def
+ /effectivelen len startposlen add stopposlen sub def
+ effectivelen 0 gt cyclelen 0 gt and
+ {
+ /repeats effectivelen cyclelen div ceiling def
+ /factor len repeats cyclelen mul startposlen sub stopposlen add div def
+ cycle factor scalearray startposlen factor mul setdash
+ linecap setlinecap stroke
+ } if
+ end
+ % (Leaving lineend) 0 debugprint
+} def
+
+% stroke a dotdashed line: <length> <dashlength> dotdashed -
+/dotdashed
+{
+ linebegin
+ 1 [dash gap dot gap] [] [dash]
+ lineend
+} def
+
+% stroke a dotcdashed line: <length> <dashlength> dotcdashed -
+/dotcdashed
+{
+ linebegin
+ 1 [dash gap dot gap] [halfdash] [halfdash]
+ lineend
+} def
+
+% stroke a dotdotdashed line: <length> <dashlength> dotdotdashed -
+/dotdotdashed
+{
+ linebegin
+ 1 [dash gap dot gap dot gap] [] [dash]
+ lineend
+} def
+
+% stroke a dotdotcdashed line: <length> <dashlength> dotdotcdashed -
+/dotdotcdashed
+{
+ linebegin
+ 1 [dash gap dot gap dot gap] [halfdash] [halfdash]
+ lineend
+} def
+
+% stroke a dotdotdotdashed line: <length> <dashlength> dotdotdotdashed -
+/dotdotdotdashed
+{
+ linebegin
+ 1 [dash gap dot gap dot gap dot gap] [] [dash]
+ lineend
+} def
+
+% stroke a dotdotdotcdashed line: <length> <dashlength> dotdotdotcdashed -
+/dotdotdotcdashed
+{
+ linebegin
+ 1 [dash gap dot gap dot gap dot gap] [halfdash] [halfdash]
+ lineend
+} def
+
+
% stroke a y histogram: - yhisto -
/yhisto
{ xprev yleft trpoint yextra sub moveto
diff --git a/include/haskell b/include/haskell
new file mode 100644
index 0000000..7fa9b41
--- /dev/null
+++ b/include/haskell
@@ -0,0 +1,109 @@
+###############################################################################
+# #
+# Lout setup file for Haskell program printing #
+# #
+# Version 1.0 #
+# Thorsten Seitz #
+# 17 December 2001 #
+# #
+###############################################################################
+
+
+###############################################################################
+# #
+# @SysInclude line #
+# #
+# This line causes Lout to read the definitions for this programming #
+# language, and should not be touched. #
+# #
+###############################################################################
+
+@SysInclude { haskellf }
+
+
+###############################################################################
+# #
+# @Use clause #
+# #
+# To change the default value of any option, delete the # at the start of #
+# its line and change the value between braces. #
+# #
+###############################################################################
+
+@Use { @HaskellSetup
+ # pipe { } # pipe source through this
+ # numbered { No } # No, Yes, or a line number
+ # style { symbol @OrIfPlain fixed } # fixed, varying, or symbol
+
+ # the following options apply when style is "fixed"
+
+ # fixedfont { Courier } # font family
+ # fixedsize { -1.0p } # font size
+ # fixedline { 1.0vx } # line-space
+ # fixedtabin { 8 } # tab interval
+ # fixedtabout { 8s } # tab width
+
+ # fixedidentifiers { Base } # identifier face
+ # fixedkeywords { Base } # keyword face
+ # fixedoperators { Base } # operator face
+ # fixednumbers { Base } # number face
+ # fixedstrings { Base } # string face
+ # fixedcomments { Base } # comment face
+ # fixedlinenumbers { Base } # line numbers face
+
+ # fixedidentifiersformat { @Body } # identifiers format
+ # fixedkeywordsformat { @Body } # keywords format
+ # fixedoperatorsformat { @Body } # operators format
+ # fixednumbersformat { @Body } # numbers format
+ # fixedstringsformat { @Body } # strings format
+ # fixedcommentsformat { @Body } # comments format
+ # fixedlinenumbersformat { @Body } # line numbers format
+
+ # the following options apply when style is "varying"
+
+ # varyingfont { } # font family
+ # varyingsize { 1.0f } # font size
+ # varyingline { 1.0vx } # line-space
+ # varyingtabin { 8 } # tab interval
+ # varyingtabout { 3f } # tab width
+
+ # varyingidentifiers { Slope } # identifier face
+ # varyingkeywords { Bold } # keyword face
+ # varyingoperators { Base } # operator face
+ # varyingnumbers { Base } # number face
+ # varyingstrings { Slope } # string face
+ # varyingcomments { Base } # comment face
+ # varyinglinenumbers { Base } # line numbers face
+
+ # varyingidentifiersformat { @Body } # identifiers format
+ # varyingkeywordsformat { @Body } # keywords format
+ # varyingoperatorsformat { @Body } # operators format
+ # varyingnumbersformat { @Body } # numbers format
+ # varyingstringsformat { @Body } # strings format
+ # varyingcommentsformat { @Body } # comments format
+ # varyinglinenumbersformat { @Body } # line numbers format
+
+ # the following options apply when style is "symbol"
+
+ # symbolfont { } # font family
+ # symbolsize { 1.0f } # font size
+ # symbolline { 1.0vx } # line-space
+ # symboltabin { 8 } # tab interval
+ # symboltabout { 3f } # tab width
+
+ # symbolidentifiers { Slope } # identifier face
+ # symbolkeywords { Bold } # keyword face
+ # symboloperators { Base } # operator face
+ # symbolnumbers { Base } # number face
+ # symbolstrings { Slope } # string face
+ # symbolcomments { Base } # comment face
+ # symbollinenumbers { Base } # line numbers face
+
+ # symbolidentifiersformat { @Body } # identifiers format
+ # symbolkeywordsformat { @Body } # keywords format
+ # symboloperatorsformat { @Body } # operators format
+ # symbolnumbersformat { @Body } # numbers format
+ # symbolstringsformat { @Body } # strings format
+ # symbolcommentsformat { @Body } # comments format
+ # symbollinenumbersformat { @Body } # line numbers format
+}
diff --git a/include/haskellf b/include/haskellf
new file mode 100644
index 0000000..e7a2d14
--- /dev/null
+++ b/include/haskellf
@@ -0,0 +1,467 @@
+
+###############################################################################
+# #
+# Lout @HaskellSetup package for formatting Haskell programs #
+# #
+# Version 1.0 #
+# Thorsten Seitz #
+# 17 December 2001 #
+# #
+# This package uses a filtered body parameter to convert program source #
+# code into Lout source. The filter program is prg2lout, which is #
+# distributed with Lout and should be compiled and installed wherever #
+# Lout itself is. #
+# #
+###############################################################################
+
+export @Haskell
+def @HaskellSetup
+ named pipe { } # pipe through this first
+ named numbered { No } # want lines numbered?
+ named style
+ named @OrIfPlain left x right y
+ { @BackEnd @Case { PlainText @Yield y else @Yield x } }
+ { symbol @OrIfPlain fixed } # print style
+
+ # the following options apply when style is "fixed"
+ named fixedfont { Courier }# font family
+ named fixedsize { -1.0p } # font size
+ named fixedline { 1.0vx } # line-space
+ named fixedtabin { 4 } # tab interval
+ named fixedtabout { 4s } # tab width
+
+ named fixedbraces { Base } # braces face
+ named fixedidentifiers { Base } # identifier face
+ named fixedkeywords { Base } # keyword face
+ named fixedoperators { Base } # operator face
+ named fixednumbers { Base } # number face
+ named fixedstrings { Base } # string face
+ named fixedcomments { Base } # comment face
+ named fixedlinenumbers { Base } # line numbers face
+
+ named fixedleftbracesformat right @Body { @Body } # left braces format
+ named fixedrightbracesformat right @Body { @Body } # right braces format
+ named fixedidentifiersformat right @Body { @Body } # identifier format
+ named fixedkeywordsformat right @Body { @Body } # keyword format
+ named fixedoperatorsformat right @Body { @Body } # operators format
+ named fixednumbersformat right @Body { @Body } # number format
+ named fixedstringsformat right @Body { @Body } # string format
+ named fixedcommentsformat right @Body { @Body } # comment format
+ named fixedlinenumbersformat right @Body { @Body } # line nums format
+
+ # the following options apply when style is "varying"
+ named varyingfont { } # font family
+ named varyingsize { 1.0f } # font size
+ named varyingline { 1.0vx } # line-space
+ named varyingtabin { 4 } # tab interval
+ named varyingtabout { 1.5f } # tab width
+
+ named varyingbraces { Base } # braces face
+ named varyingidentifiers { Slope } # identifier face
+ named varyingkeywords { Bold } # keyword face
+ named varyingoperators { Base } # operator face
+ named varyingnumbers { Base } # number face
+ named varyingstrings { Slope } # string face
+ named varyingcomments { Base } # comment face
+ named varyinglinenumbers { Base } # line numbers face
+
+ named varyingleftbracesformat right @Body { @Body } # left braces format
+ named varyingrightbracesformat right @Body { @Body } # right braces format
+ named varyingidentifiersformat right @Body { @Body } # identifier format
+ named varyingkeywordsformat right @Body { @Body } # keyword format
+ named varyingoperatorsformat right @Body { @Body } # operators format
+ named varyingnumbersformat right @Body { @Body } # number format
+ named varyingstringsformat right @Body { @Body } # string format
+ named varyingcommentsformat right @Body { @Body } # comment format
+ named varyinglinenumbersformat right @Body { @Body } # line nums format
+
+ # the following options apply when style is "symbol"
+ named symbolfont { } # font family
+ named symbolsize { 1f } # font size
+ named symbolline { 1.0vx } # line-space
+ named symboltabin { 4 } # tab interval
+ named symboltabout { 1.7f } # tab width
+
+ named symbolbraces { Base } # braces face
+ named symbolidentifiers { Slope } # identifier face
+ named symbolkeywords { Bold } # keyword face
+ named symboloperators { Symbol Base } # operator face
+ named symbolnumbers { Base } # number face
+ named symbolstrings { Slope } # string face
+ named symbolcomments { Base } # comment face
+ named symbollinenumbers { Base } # line numbers face
+
+ named symbolidentifiersformat right @Body { 0.3s @Space {"" @Body} } # identifier format (with italic correction)
+ named symbolkeywordsformat right @Body { @Body } # keyword format
+ named symboloperatorsformat right @Body { 0.5s @Space {"" @Body ""}} # operators format
+ named symbolnumbersformat right @Body { @Body } # number format
+ named symbolstringsformat right @Body { @Body } # string format
+ named symbolcommentsformat right @Body { @Body } # comment format
+ named symbollinenumbersformat right @Body { @Body } # line nums format
+
+@Begin
+
+ export
+
+ @PI @PK @PO @PN @PS @PC @PCL @PL @PA @PM @PD
+ @PLAMBDA @PCIRC @PPLUSPLUS @PCOLON @PDOUBLECOLON
+
+ @A "$>"
+
+ def @Haskell
+ named style { style } # style
+ named numbered { numbered } # want numbered lines?
+ named pipe { pipe } # pipe through this first
+ named font { dft } # font family
+ named size { dft } # font size
+ named line { dft } # line-space
+ named tabin { dft } # tab interval
+ named tabout { dft } # tab width
+ named braces { dft } # braces font
+ named identifiers { dft } # ident. font
+ named keywords { dft } # keyword font
+ named operators { dft } # operator font
+ named numbers { dft } # number font
+ named strings { dft } # string font
+ named comments { dft } # comment font
+ named linenumbers { dft } # line numbers font
+ body @Body # filtered, see below
+ @Begin
+
+ def @Test # returns x unless x is dft
+ left x
+ named iffixed {}
+ named ifvarying {}
+ named ifsymbol {}
+ {
+ x @Case {
+ dft @Yield {
+ style @Case {
+ fixed @Yield { iffixed }
+ varying @Yield { ifvarying }
+ symbol @Yield { ifsymbol }
+ }
+ }
+ else @Yield x
+ }
+ }
+
+
+ def @Else # returns x, or y if x is dft
+ left x
+ right y
+ {
+ x @Case {
+ dft @Yield y
+ else @Yield x
+ }
+ }
+
+
+ def @InitTab
+ {
+ tabin @Test
+ iffixed { fixedtabin }
+ ifvarying { varyingtabin }
+ ifsymbol { symboltabin }
+ }
+
+
+ def @InitTabWidth
+ {
+ tabout @Test
+ iffixed { fixedtabout }
+ ifvarying { varyingtabout }
+ ifsymbol { symboltabout }
+ }
+
+
+ def @Filter
+ {
+ def wantnumbered
+ {
+ numbered @Case {
+ { No no } @Yield ""
+ { Yes yes } @Yield "-L"
+ else @Yield { "-L"numbered }
+ }
+ }
+
+ pipe @Case {
+ "" @Yield {
+ "prg2lout -r -lHaskell" wantnumbered -i{@FilterIn}
+ -o{@FilterOut} -e{@FilterErr}
+ -t{@InitTab} -T{@InitTabWidth}
+ }
+ else @Yield {
+ "cat" @FilterIn "|" pipe "|"
+ "prg2lout -r -lHaskell" wantnumbered -o{@FilterOut}
+ -e{@FilterErr} -t{@InitTab} -T{@InitTabWidth}
+ }
+ }
+ }
+
+
+ def @InitFontFamily
+ {
+ font @Test
+ iffixed { fixedfont }
+ ifvarying { varyingfont }
+ ifsymbol { symbolfont }
+ }
+
+
+ def @InitSize
+ {
+ size @Test
+ iffixed { fixedsize }
+ ifvarying { varyingsize }
+ ifsymbol { symbolsize }
+ }
+
+
+ def @InitLine
+ {
+ line @Test
+ iffixed { fixedline }
+ ifvarying { varyingline }
+ ifsymbol { symbolline }
+ }
+
+
+ def @PO # for formatting operators
+ right x
+ {
+ style @Case {
+ fixed @Yield fixedoperatorsformat {
+ { operators @Else fixedoperators } @Font x
+ }
+ varying @Yield varyingoperatorsformat {
+ { operators @Else varyingoperators } @Font x
+ }
+ symbol @Yield symboloperatorsformat {
+ { operators @Else symboloperators } @Font x
+ }
+ }
+ }
+
+
+ def @A # get characters from the Adobe Symbol font
+ left sym
+ right x
+ {
+ style @Case {
+ symbol @Yield { { Symbol Base } @Font @Char sym }
+ else @Yield { x }
+ }
+ }
+
+ # deleted by JeffK here and in prg2lout.c, who could not see the point
+ #def @APO
+ # left sym
+ # right x
+ #{
+ # @PO sym @A x
+ #}
+
+
+
+ def @PI # for formatting identifiers
+ right x
+ {
+ style @Case {
+ fixed @Yield fixedidentifiersformat {
+ { identifiers @Else fixedidentifiers } @Font x
+ }
+ varying @Yield varyingidentifiersformat {
+ { identifiers @Else varyingidentifiers } @Font x
+ }
+ symbol @Yield symbolidentifiersformat {
+ { identifiers @Else symbolidentifiers } @Font x
+ }
+ }
+ }
+
+
+ def @PK # for formatting keywords
+ right x
+ {
+ style @Case {
+ fixed @Yield fixedkeywordsformat {
+ { keywords @Else fixedkeywords } @Font x
+ }
+ varying @Yield varyingkeywordsformat {
+ { keywords @Else varyingkeywords } @Font x
+ }
+ symbol @Yield symbolkeywordsformat {
+ { keywords @Else symbolkeywords } @Font x
+ }
+ }
+ }
+
+
+ def @PN # for formatting numbers
+ right x
+ {
+ style @Case {
+ fixed @Yield fixednumbersformat {
+ { numbers @Else fixednumbers } @Font x
+ }
+ varying @Yield varyingnumbersformat {
+ { numbers @Else varyingnumbers } @Font x
+ }
+ symbol @Yield symbolnumbersformat {
+ { numbers @Else symbolnumbers } @Font x
+ }
+ }
+ }
+
+
+ def @PS # for formatting strings
+ right x
+ {
+ style @Case {
+ fixed @Yield fixedstringsformat {
+ { strings @Else fixedstrings } @Font x
+ }
+ varying @Yield varyingstringsformat {
+ { strings @Else varyingstrings } @Font x
+ }
+ symbol @Yield symbolstringsformat {
+ { strings @Else symbolstrings } @Font x
+ }
+ }
+ }
+
+
+ def @PCnoDelim
+ right x
+ {
+ style @Case {
+ fixed @Yield fixedcommentsformat {
+ { comments @Else fixedcomments } @Font x
+ }
+ varying @Yield varyingcommentsformat {
+ { comments @Else varyingcomments } @Font x
+ }
+ symbol @Yield symbolcommentsformat {
+ { comments @Else symbolcomments } @Font x
+ }
+ }
+ }
+
+
+ def @Symb right x { { Symbol Base } @Font @Char x }
+
+
+ def @PC # for formatting comments
+ right x
+ {
+ @PCnoDelim { "{"@Symb minus{x}@Symb minus"}" }
+ }
+
+
+ def @PCL # for formatting line comments
+ right x
+ {
+ @PCnoDelim { {@Symb minus} &0.5s {@Symb minus}{x} }
+ }
+
+
+ def @PL # for formatting line numbers
+ right x
+ {
+ style @Case {
+ fixed @Yield fixedlinenumbersformat {
+ { linenumbers @Else fixedlinenumbers } @Font x
+ }
+ varying @Yield varyinglinenumbersformat {
+ { linenumbers @Else varyinglinenumbers } @Font x
+ }
+ symbol @Yield symbollinenumbersformat {
+ { linenumbers @Else symbollinenumbers } @Font x
+ }
+ }
+ }
+
+
+ def @PA # for formatting asterisks
+ {
+ @PO @BackEnd @Case {
+ PlainText @Yield "*"
+ else @Yield { @Symb asteriskmath }
+ }
+ }
+
+
+ def @PM # for formatting minus signs
+ {
+ @PO @BackEnd @Case {
+ PlainText @Yield "-"
+ else @Yield style @Case {
+ fixed @Yield "-"
+ else @Yield { { Symbol Base } @Font @Char "minus" }
+ }
+ }
+ }
+
+
+ def @PD # for formatting dots, if wanted larger
+ {
+ @PO @BackEnd @Case {
+ PlainText @Yield "."
+ else @Yield { "1.4f" @Font "." &"0.05f" }
+ }
+ }
+
+
+ def @PLAMBDA
+ right x
+ {
+ style @Case {
+ symbol @Yield { { Symbol Base } @Font @Char lambda |0.5s }
+ else @Yield { x }
+ }
+ }
+
+ def @PCIRC
+ right x
+ {
+ style @Case {
+ symbol @Yield { @PO {/0.3fo 0i @Space {"" @Symb degree } } }
+ else @Yield { @PO x }
+ }
+ }
+
+ def @PPLUSPLUS
+ right x
+ {
+ style @Case {
+ symbol @Yield { @PO {@Symb plus |0.3fo @Symb plus} }
+ else @Yield { @PO x }
+ }
+ }
+
+ def @PCOLON
+ {
+ @PO ":"
+ }
+
+ def @PDOUBLECOLON
+ right x
+ {
+ style @Case {
+ symbol @Yield { @PO {: |0.8s :} }
+ else @Yield { @PO x }
+ }
+ }
+
+ macro "$>" { {} & }
+
+
+ { @InitFontFamily Base @InitSize } @Font
+ { @InitLine lines nohyphen } @Break @Body
+
+ @End @Haskell
+
+@End @HaskellSetup
diff --git a/include/picture b/include/picture
index 340b02b..dea061a 100644
--- a/include/picture
+++ b/include/picture
@@ -164,6 +164,9 @@
# @IndexFormat { @Body } # @Index format
# @SubIndexFormat { {1f @Wide}@Body } # @SubIndex format
# @SubSubIndexFormat { {2f @Wide}@Body } # @SubSubIndex format
+ # @IndexTypeOrdinary { @PageNum } # Ordinary pagenum format
+ # @IndexTypeMain { @B @PageNum } # Main pagenum format
+ # @IndexTypeSpecial { @I @PageNum } # Special pagenum format
# @IndexColumnNumber { 2 } # index columns (1 to 10)
# @IndexColumnGap { 1.00c @OrIfPlain 6s } # index column gap
# @IndexCtd { Yes } # include (ctd.) lines
@@ -180,6 +183,9 @@
# @IndexAFormat { @Body } # @IndexA format
# @SubIndexAFormat { {1f @Wide}@Body } # @SubIndexA format
# @SubSubIndexAFormat { {2f @Wide}@Body } # @SubSubIndexA format
+ # @IndexATypeOrdinary { @PageNum } # Ordinary pagenum format
+ # @IndexATypeMain { @B @PageNum } # Main pagenum format
+ # @IndexATypeSpecial { @I @PageNum } # Special pagenum format
# @IndexAColumnNumber { 2 } # index A columns (1 to 10)
# @IndexAColumnGap { 1.00c @OrIfPlain 6s } # index A column gap
# @IndexACtd { Yes } # include (ctd.) lines
@@ -196,6 +202,9 @@
# @IndexBFormat { @Body } # @IndexB format
# @SubIndexBFormat { {1f @Wide}@Body } # @SubIndexB format
# @SubSubIndexBFormat { {2f @Wide}@Body } # @SubSubIndexB format
+ # @IndexBTypeOrdinary { @PageNum } # Ordinary pagenum format
+ # @IndexBTypeMain { @B @PageNum } # Main pagenum format
+ # @IndexBTypeSpecial { @I @PageNum } # Special pagenum format
# @IndexBColumnNumber { 2 } # index B columns (1 to 10)
# @IndexBColumnGap { 1.00c @OrIfPlain 6s } # index B column gap
# @IndexBCtd { Yes } # include (ctd.) lines
diff --git a/include/report b/include/report
index 7666e93..12312e5 100644
--- a/include/report
+++ b/include/report
@@ -169,6 +169,9 @@
# @IndexFormat { @Body } # @Index format
# @SubIndexFormat { {1f @Wide}@Body } # @SubIndex format
# @SubSubIndexFormat { {2f @Wide}@Body } # @SubSubIndex format
+ # @IndexTypeOrdinary { @PageNum } # Ordinary pagenum format
+ # @IndexTypeMain { @B @PageNum } # Main pagenum format
+ # @IndexTypeSpecial { @I @PageNum } # Special pagenum format
# @IndexColumnNumber { 2 } # index columns (1 to 10)
# @IndexColumnGap { 1.00c @OrIfPlain 6s } # index column gap
# @IndexCtd { Yes } # include (ctd.) lines
@@ -185,6 +188,9 @@
# @IndexAFormat { @Body } # @IndexA format
# @SubIndexAFormat { {1f @Wide}@Body } # @SubIndexA format
# @SubSubIndexAFormat { {2f @Wide}@Body } # @SubSubIndexA format
+ # @IndexATypeOrdinary { @PageNum } # Ordinary pagenum format
+ # @IndexATypeMain { @B @PageNum } # Main pagenum format
+ # @IndexATypeSpecial { @I @PageNum } # Special pagenum format
# @IndexAColumnNumber { 2 } # index A columns (1 to 10)
# @IndexAColumnGap { 1.00c @OrIfPlain 6s } # index A column gap
# @IndexACtd { Yes } # include (ctd.) lines
@@ -201,6 +207,9 @@
# @IndexBFormat { @Body } # @IndexB format
# @SubIndexBFormat { {1f @Wide}@Body } # @SubIndexB format
# @SubSubIndexBFormat { {2f @Wide}@Body } # @SubSubIndexB format
+ # @IndexBTypeOrdinary { @PageNum } # Ordinary pagenum format
+ # @IndexBTypeMain { @B @PageNum } # Main pagenum format
+ # @IndexBTypeSpecial { @I @PageNum } # Special pagenum format
# @IndexBColumnNumber { 2 } # index B columns (1 to 10)
# @IndexBColumnGap { 1.00c @OrIfPlain 6s } # index B column gap
# @IndexBCtd { Yes } # include (ctd.) lines
diff --git a/include/rsl b/include/rsl
new file mode 100644
index 0000000..09427b6
--- /dev/null
+++ b/include/rsl
@@ -0,0 +1,110 @@
+# Hey Emacs, this is -*- lout -*- !
+###############################################################################
+# #
+# Lout setup file for RSL program printing #
+# #
+# Version 1.0 #
+# Darren Bane #
+# 18 February 2003 #
+# #
+###############################################################################
+
+
+###############################################################################
+# #
+# @SysInclude line #
+# #
+# This line causes Lout to read the definitions for this programming #
+# language, and should not be touched. #
+# #
+###############################################################################
+
+@SysInclude { rslf }
+
+
+###############################################################################
+# #
+# @Use clause #
+# #
+# To change the default value of any option, delete the # at the start of #
+# its line and change the value between braces. #
+# #
+###############################################################################
+
+@Use { @RSLSetup
+ # pipe { } # pipe source through this
+ # numbered { No } # No, Yes, or a line number
+ # style { symbol @OrIfPlain fixed } # fixed, varying, or symbol
+
+ # the following options apply when style is "fixed"
+
+ # fixedfont { Courier } # font family
+ # fixedsize { -1.0p } # font size
+ # fixedline { 1.0vx } # line-space
+ # fixedtabin { 8 } # tab interval
+ # fixedtabout { 8s } # tab width
+
+ # fixedidentifiers { Base } # identifier face
+ # fixedkeywords { Base } # keyword face
+ # fixedoperators { Base } # operator face
+ # fixednumbers { Base } # number face
+ # fixedstrings { Base } # string face
+ # fixedcomments { Base } # comment face
+ # fixedlinenumbers { Base } # line numbers face
+
+ # fixedidentifiersformat { @Body } # identifiers format
+ # fixedkeywordsformat { @Body } # keywords format
+ # fixedoperatorsformat { @Body } # operators format
+ # fixednumbersformat { @Body } # numbers format
+ # fixedstringsformat { @Body } # strings format
+ # fixedcommentsformat { @Body } # comments format
+ # fixedlinenumbersformat { @Body } # line numbers format
+
+ # the following options apply when style is "varying"
+
+ # varyingfont { } # font family
+ # varyingsize { 1.0f } # font size
+ # varyingline { 1.0vx } # line-space
+ # varyingtabin { 8 } # tab interval
+ # varyingtabout { 3f } # tab width
+
+ # varyingidentifiers { Slope } # identifier face
+ # varyingkeywords { Bold } # keyword face
+ # varyingoperators { Base } # operator face
+ # varyingnumbers { Base } # number face
+ # varyingstrings { Slope } # string face
+ # varyingcomments { Base } # comment face
+ # varyinglinenumbers { Base } # line numbers face
+
+ # varyingidentifiersformat { @Body } # identifiers format
+ # varyingkeywordsformat { @Body } # keywords format
+ # varyingoperatorsformat { @Body } # operators format
+ # varyingnumbersformat { @Body } # numbers format
+ # varyingstringsformat { @Body } # strings format
+ # varyingcommentsformat { @Body } # comments format
+ # varyinglinenumbersformat { @Body } # line numbers format
+
+ # the following options apply when style is "symbol"
+
+ # symbolfont { } # font family
+ # symbolsize { 1.0f } # font size
+ # symbolline { 1.0vx } # line-space
+ # symboltabin { 8 } # tab interval
+ # symboltabout { 3f } # tab width
+
+ # symbolidentifiers { Slope } # identifier face
+ # symbolkeywords { Bold } # keyword face
+ # symboloperators { Base } # operator face
+ # symbolnumbers { Base } # number face
+ # symbolstrings { Slope } # string face
+ # symbolcomments { Base } # comment face
+ # symbollinenumbers { Base } # line numbers face
+
+ # symbolidentifiersformat { @Body } # identifiers format
+ # symbolkeywordsformat { @Body } # keywords format
+ # symboloperatorsformat { @Body } # operators format
+ # symbolnumbersformat { @Body } # numbers format
+ # symbolstringsformat { @Body } # strings format
+ # symbolcommentsformat { @Body } # comments format
+ # symbollinenumbersformat { @Body } # line numbers format
+}
diff --git a/include/rslf b/include/rslf
new file mode 100644
index 0000000..f6c0bdf
--- /dev/null
+++ b/include/rslf
@@ -0,0 +1,448 @@
+# Hey Emacs, this is -*- lout -*- !
+###############################################################################
+# #
+# Lout @RSLSetup package for formatting RSL programs #
+# #
+# Version 1.0 #
+# Darren Bane #
+# 18 February 2003 #
+# #
+# This package uses a filtered body parameter to convert program source #
+# code into Lout source. The filter program is prg2lout, which is #
+# distributed with Lout and should be compiled and installed wherever #
+# Lout itself is. #
+# #
+###############################################################################
+
+export @RSL
+def @RSLSetup
+ named pipe { } # pipe through this first
+ named numbered { No } # want lines numbered?
+ named style
+ named @OrIfPlain left x right y
+ { @BackEnd @Case { PlainText @Yield y else @Yield x } }
+ { symbol @OrIfPlain fixed } # print style
+
+ # the following options apply when style is "fixed"
+ named fixedfont { Courier }# font family
+ named fixedsize { -1.0p } # font size
+ named fixedline { 1.0vx } # line-space
+ named fixedtabin { 8 } # tab interval
+ named fixedtabout { 8s } # tab width
+
+ named fixedidentifiers { Base } # identifier face
+ named fixedkeywords { Base } # keyword face
+ named fixedoperators { Base } # operator face
+ named fixednumbers { Base } # number face
+ named fixedstrings { Base } # string face
+ named fixedcomments { Base } # comment face
+ named fixedlinenumbers { Base } # line numbers face
+
+ named fixedidentifiersformat right @Body { @Body } # identifier format
+ named fixedkeywordsformat right @Body { @Body } # keyword format
+ named fixedoperatorsformat right @Body { @Body } # operators format
+ named fixednumbersformat right @Body { @Body } # number format
+ named fixedstringsformat right @Body { @Body } # string format
+ named fixedcommentsformat right @Body { @Body } # comment format
+ named fixedlinenumbersformat right @Body { @Body } # line nums format
+
+ # the following options apply when style is "varying"
+ named varyingfont { } # font family
+ named varyingsize { 1.0f } # font size
+ named varyingline { 1.0vx } # line-space
+ named varyingtabin { 8 } # tab interval
+ named varyingtabout { 3f } # tab width
+
+ named varyingidentifiers { Slope } # identifier face
+ named varyingkeywords { Bold } # keyword face
+ named varyingoperators { Base } # operator face
+ named varyingnumbers { Base } # number face
+ named varyingstrings { Slope } # string face
+ named varyingcomments { Base } # comment face
+ named varyinglinenumbers { Base } # line numbers face
+
+ named varyingidentifiersformat right @Body { @Body } # identifier format
+ named varyingkeywordsformat right @Body { @Body } # keyword format
+ named varyingoperatorsformat right @Body { @Body } # operators format
+ named varyingnumbersformat right @Body { @Body } # number format
+ named varyingstringsformat right @Body { @Body } # string format
+ named varyingcommentsformat right @Body { @Body } # comment format
+ named varyinglinenumbersformat right @Body { @Body } # line nums format
+
+ # the following options apply when style is "symbol"
+ named symbolfont { } # font family
+ named symbolsize { 1.0f } # font size
+ named symbolline { 1.0vx } # line-space
+ named symboltabin { 8 } # tab interval
+ named symboltabout { 3f } # tab width
+
+ named symbolidentifiers { Slope } # identifier face
+ named symbolkeywords { Bold } # keyword face
+ named symboloperators { Base } # operator face
+ named symbolnumbers { Base } # number face
+ named symbolstrings { Slope } # string face
+ named symbolcomments { Base } # comment face
+ named symbollinenumbers { Base } # line numbers face
+
+ named symbolidentifiersformat right @Body { @Body } # identifier format
+ named symbolkeywordsformat right @Body { @Body } # keyword format
+ named symboloperatorsformat right @Body { @Body } # operators format
+ named symbolnumbersformat right @Body { @Body } # number format
+ named symbolstringsformat right @Body { @Body } # string format
+ named symbolcommentsformat right @Body { @Body } # comment format
+ named symbollinenumbersformat right @Body { @Body } # line nums format
+
+@Begin
+
+ export
+
+ @PI @PK @PO @PN @PS @PC @PL @PA @PM @PD
+ @FA @A @PartialFn @Map @PartialMap @IntChoice @ExtChoice @InfList @Interlock "$>"
+
+ def @RSL
+ named style { style } # style
+ named numbered { numbered } # want numbered lines?
+ named pipe { pipe } # pipe through this first
+ named font { dft } # font family
+ named size { dft } # font size
+ named line { dft } # line-space
+ named tabin { dft } # tab interval
+ named tabout { dft } # tab width
+ named identifiers { dft } # ident. font
+ named keywords { dft } # keyword font
+ named operators { dft } # operator font
+ named numbers { dft } # number font
+ named strings { dft } # string font
+ named comments { dft } # comment font
+ named linenumbers { dft } # line numbers font
+ body @Body # filtered, see below
+ @Begin
+
+ def @Test # returns x unless x is dft
+ left x
+ named iffixed {}
+ named ifvarying {}
+ named ifsymbol {}
+ {
+ x @Case {
+ dft @Yield {
+ style @Case {
+ fixed @Yield { iffixed }
+ varying @Yield { ifvarying }
+ symbol @Yield { ifsymbol }
+ }
+ }
+ else @Yield x
+ }
+ }
+
+
+ def @Else # returns x, or y if x is dft
+ left x
+ right y
+ {
+ x @Case {
+ dft @Yield y
+ else @Yield x
+ }
+ }
+
+
+ def @InitTab
+ {
+ tabin @Test
+ iffixed { fixedtabin }
+ ifvarying { varyingtabin }
+ ifsymbol { symboltabin }
+ }
+
+
+ def @InitTabWidth
+ {
+ tabout @Test
+ iffixed { fixedtabout }
+ ifvarying { varyingtabout }
+ ifsymbol { symboltabout }
+ }
+
+
+ def @Filter
+ {
+ def wantnumbered
+ {
+ numbered @Case {
+ { No no } @Yield ""
+ { Yes yes } @Yield "-L"
+ else @Yield { "-L"numbered }
+ }
+ }
+
+ pipe @Case {
+ "" @Yield {
+ "prg2lout -r -lRSL" wantnumbered -i{@FilterIn}
+ -o{@FilterOut} -e{@FilterErr}
+ -t{@InitTab} -T{@InitTabWidth}
+ }
+ else @Yield {
+ "cat" @FilterIn "|" pipe "|"
+ "prg2lout -r -lRSL" wantnumbered -o{@FilterOut}
+ -e{@FilterErr} -t{@InitTab} -T{@InitTabWidth}
+ }
+ }
+ }
+
+
+ def @InitFontFamily
+ {
+ font @Test
+ iffixed { fixedfont }
+ ifvarying { varyingfont }
+ ifsymbol { symbolfont }
+ }
+
+
+ def @InitSize
+ {
+ size @Test
+ iffixed { fixedsize }
+ ifvarying { varyingsize }
+ ifsymbol { symbolsize }
+ }
+
+
+ def @InitLine
+ {
+ line @Test
+ iffixed { fixedline }
+ ifvarying { varyingline }
+ ifsymbol { symbolline }
+ }
+
+
+ def @PI # for formatting identifiers
+ right x
+ {
+ style @Case {
+ fixed @Yield fixedidentifiersformat {
+ { identifiers @Else fixedidentifiers } @Font x
+ }
+ varying @Yield varyingidentifiersformat {
+ { identifiers @Else varyingidentifiers } @Font x
+ }
+ symbol @Yield symbolidentifiersformat {
+ { identifiers @Else symbolidentifiers } @Font x
+ }
+ }
+ }
+
+
+ def @PK # for formatting keywords
+ right x
+ {
+ x @Case {
+ "is" @Yield @Sym equivalence
+ "exists" @Yield @Sym existential
+ "all" @Yield @Sym universal
+ else @Yield style @Case {
+ fixed @Yield fixedkeywordsformat {
+ { keywords @Else fixedkeywords } @Font x
+ }
+ varying @Yield varyingkeywordsformat {
+ { keywords @Else varyingkeywords } @Font x
+ }
+ symbol @Yield symbolkeywordsformat {
+ { keywords @Else symbolkeywords } @Font x
+ }
+ }
+ }
+ }
+
+
+ def @PO # for formatting operators
+ right x
+ {
+ style @Case {
+ fixed @Yield fixedoperatorsformat {
+ { operators @Else fixedoperators } @Font x
+ }
+ varying @Yield varyingoperatorsformat {
+ { operators @Else varyingoperators } @Font x
+ }
+ symbol @Yield symboloperatorsformat {
+ { operators @Else symboloperators } @Font x
+ }
+ }
+ }
+
+
+ def @PN # for formatting numbers
+ right x
+ {
+ style @Case {
+ fixed @Yield fixednumbersformat {
+ { numbers @Else fixednumbers } @Font x
+ }
+ varying @Yield varyingnumbersformat {
+ { numbers @Else varyingnumbers } @Font x
+ }
+ symbol @Yield symbolnumbersformat {
+ { numbers @Else symbolnumbers } @Font x
+ }
+ }
+ }
+
+
+ def @PS # for formatting strings
+ right x
+ {
+ style @Case {
+ fixed @Yield fixedstringsformat {
+ { strings @Else fixedstrings } @Font x
+ }
+ varying @Yield varyingstringsformat {
+ { strings @Else varyingstrings } @Font x
+ }
+ symbol @Yield symbolstringsformat {
+ { strings @Else symbolstrings } @Font x
+ }
+ }
+ }
+
+
+ def @PC # for formatting comments
+ right x
+ {
+ style @Case {
+ fixed @Yield fixedcommentsformat {
+ { comments @Else fixedcomments } @Font x
+ }
+ varying @Yield varyingcommentsformat {
+ { comments @Else varyingcomments } @Font x
+ }
+ symbol @Yield symbolcommentsformat {
+ { comments @Else symbolcomments } @Font x
+ }
+ }
+ }
+
+
+ def @PL # for formatting line numbers
+ right x
+ {
+ style @Case {
+ fixed @Yield fixedlinenumbersformat {
+ { linenumbers @Else fixedlinenumbers } @Font x
+ }
+ varying @Yield varyinglinenumbersformat {
+ { linenumbers @Else varyinglinenumbers } @Font x
+ }
+ symbol @Yield symbollinenumbersformat {
+ { linenumbers @Else symbollinenumbers } @Font x
+ }
+ }
+ }
+
+
+ def @PA # for formatting asterisks
+ {
+ @PO @BackEnd @Case {
+ PlainText @Yield "*"
+ else @Yield { "0.5w" @VShift "*" }
+ }
+ }
+
+
+ def @PM # for formatting minus signs
+ {
+ @PO @BackEnd @Case {
+ PlainText @Yield "-"
+ else @Yield style @Case {
+ fixed @Yield "-"
+ else @Yield { { Symbol Base } @Font @Char "minus" }
+ }
+ }
+ }
+
+
+ def @PD # for formatting dots, if wanted larger
+ {
+ @PO @BackEnd @Case {
+ PlainText @Yield "."
+ else @Yield { "1.4f" @Font "+0.04f" @VShift "." &"0.05f" }
+ }
+ }
+
+
+ def @FA # for formatting characters from the Adobe Symbol font
+ left sym
+ right x
+ {
+ style @Case {
+ symbol @Yield { sym }
+ else @Yield { x }
+ }
+ }
+
+
+ def @A # get characters from the Adobe Symbol font
+ left sym
+ right x
+ {
+ { { Symbol Base } @Font @Char sym } @FA x
+ }
+
+
+ # the following are any sizeable symbols for RSL
+ # i figure they're easier to maintain here than in prg2lout.c
+ def @PartialFn # -~->
+ {
+ @OneRow { &0.2fo @Sym similar ^/0.07f @Sym arrowright }
+ }
+
+
+ def @Map # -m->
+ {
+ @OneRow { @Sym arrowright ^/0.07f &0.2fo 0.7f @Font @I m }
+ }
+
+
+ def @PartialMap # -~m->
+ {
+ @OneRow { &0.2fo @Sym similar ^/0.07f @Sym arrowright /0.07f &0.2fo 0.7f @Font @I m }
+ }
+
+
+ def @IntChoice # |^|
+ {
+ @Sym bracketlefttp &0.5wo @Sym bracketrighttp
+ }
+
+
+ def @ExtChoice # |=|
+ {
+ { @Sym bracketlefttp &0.0fo @Sym bracketleftbt } &0.5wo
+ { @Sym bracketrighttp &0.0fo @Sym bracketrightbt }
+ }
+
+
+ def @InfList # -inflist
+ {
+ @Sup { @Sym omega }
+ }
+
+
+ def @Interlock # ++
+ {
+ { -- } &0.1fo { "||" }
+ }
+
+
+ macro "$>" { {} & }
+
+
+ { @InitFontFamily Base @InitSize } @Font
+ { @InitLine lines nohyphen } @Break @Body
+
+ @End @RSL
+
+@End @RSLSetup
diff --git a/include/save_bookf b/include/save_bookf
deleted file mode 100644
index 001f946..0000000
--- a/include/save_bookf
+++ /dev/null
@@ -1,1358 +0,0 @@
-
-###########################################################################
-# #
-# @BookSetup extension to @DocumentSetup. #
-# #
-# Jeffrey H. Kingston #
-# 17 September 1999 #
-# #
-# This package extends DocumentSetup with definitions for books. #
-# #
-###########################################################################
-
-extend @BasicSetup @DocumentSetup
-export @Book @Preface @Abbreviations @Introduction @Chapter @Appendix
-def @BookSetup
- named @TitlePageFont { Helvetica Base }
- named @SeparateIntroNumbering { Yes }
- named @PrefaceAfterContents { No }
- named @ChapterStartPages { Any }
- named @ReferencesBeforeAppendices { No }
-
- named @PrefaceWord { preface }
- named @ContentsWord { contents }
- named @FigureListWord { figurelist }
- named @TableListWord { tablelist }
- named @IntroductionWord { introduction }
- named @AbbreviationsWord { abbreviations }
- named @ChapterWord { chapter }
- named @AppendixWord { appendix }
- named @GlossaryWord { glossary }
- named @IndexWord { index }
- named @IndexAWord { index }
- named @IndexBWord { index }
- named @ColophonWord { colophon }
-
- named @ChapterNumbers { Arabic }
- named @FirstChapterNumber { 1 }
- named @SectionNumbers { Arabic }
- named @FirstSectionNumber { 1 }
- named @SubSectionNumbers { Arabic }
- named @FirstSubSectionNumber { 1 }
- named @SubSubSectionNumbers { Arabic }
- named @FirstSubSubSectionNumber { 1 }
- named @AppendixNumbers { UCAlpha }
- named @FirstAppendixNumber { 1 }
- named @SubAppendixNumbers { Arabic }
- named @FirstSubAppendixNumber { 1 }
- named @SubSubAppendixNumbers { Arabic }
- named @FirstSubSubAppendixNumber { 1 }
-
- named @PartHeadingFont { Helvetica Base 2.50f }
- named @PartHeadingBreak { clines 1.2fx nohyphen }
- named @PartHeadingFormat
- left number right title { @CD number @DP @CD title }
-
- named @ChapterHeadingFont { Bold 2.00f }
- named @ChapterHeadingBreak { ragged 1.2fx nohyphen }
- named @ChapterHeadingFormat
- left number right title { number @DotSep title }
-
- named @SectionHeadingFont { Bold }
- named @SectionHeadingBreak { ragged 1.2fx nohyphen }
- named @SectionHeadingFormat
- left number right title { number @DotSep title }
-
- named @SubSectionHeadingFont { Bold }
- named @SubSectionHeadingBreak { ragged 1.2fx nohyphen }
- named @SubSectionHeadingFormat
- left number right title { number @DotSep title }
-
- named @SubSubSectionHeadingFont { Slope }
- named @SubSubSectionHeadingBreak { ragged 1.2fx nohyphen }
- named @SubSubSectionHeadingFormat
- left number right title { number @DotSep title }
-
- named @AppendixHeadingFont { Bold 2.00f }
- named @AppendixHeadingBreak { ragged 1.2fx nohyphen }
- named @AppendixHeadingFormat
- left number right title { number @DotSep title }
-
- named @SubAppendixHeadingFont { Bold }
- named @SubAppendixHeadingBreak { ragged 1.2fx nohyphen }
- named @SubAppendixHeadingFormat
- left number right title { number @DotSep title }
-
- named @SubSubAppendixHeadingFont { Slope }
- named @SubSubAppendixHeadingBreak { ragged 1.2fx nohyphen }
- named @SubSubAppendixHeadingFormat
- left number right title { number @DotSep title }
-
- named @AbovePartGap { 4.00f }
- named @AboveChapterGap { 3.00f }
- named @SectionGap { 2.0v @OrIfPlain 3f }
- named @SubSectionGap { 1.5v @OrIfPlain 2f }
- named @SubSubSectionGap { 1.5v @OrIfPlain 2f }
- named @SubAppendixGap { 2.0v @OrIfPlain 3f }
- named @SubSubAppendixGap { 1.5v @OrIfPlain 2f }
-
- named @PrefaceInContents { Yes }
- named @AbbreviationsInContents { Yes }
- named @IntroductionInContents { Yes }
- named @PartInContents { Yes }
- named @ChapterInContents { Yes }
- named @SectionInContents { Yes }
- named @SubSectionInContents { Yes }
- named @SubSubSectionInContents { No }
- named @AppendixInContents { Yes }
- named @SubAppendixInContents { Yes }
- named @SubSubAppendixInContents { No }
- named @ReferencesInContents { Yes }
- named @GlossaryInContents { Yes }
- named @IndexInContents { Yes }
- named @IndexAInContents { Yes }
- named @IndexBInContents { Yes }
- named @ColophonInContents { Yes }
- named @PartContentsIndent { 0.5rt }
-
- named @ChapterNumInTheorems { Yes }
- named @SectionNumInTheorems { No }
- named @SubSectionNumInTheorems { No }
- named @SubSubSectionNumInTheorems { No }
- named @AppendixNumInTheorems { Yes }
- named @SubAppendixNumInTheorems { No }
- named @SubSubAppendixNumInTheorems { No }
-
- named @ChapterNumInDisplays { Yes }
- named @SectionNumInDisplays { Yes }
- named @SubSectionNumInDisplays { No }
- named @SubSubSectionNumInDisplays { No }
- named @AppendixNumInDisplays { Yes }
- named @SubAppendixNumInDisplays { Yes }
- named @SubSubAppendixNumInDisplays { No }
-
- named @ChapterNumInFigures { Yes }
- named @SectionNumInFigures { No }
- named @SubSectionNumInFigures { No }
- named @SubSubSectionNumInFigures { No }
- named @AppendixNumInFigures { Yes }
- named @SubAppendixNumInFigures { No }
- named @SubSubAppendixNumInFigures { No }
-
- named @ChapterNumInTables { Yes }
- named @SectionNumInTables { No }
- named @SubSectionNumInTables { No }
- named @SubSubSectionNumInTables { No }
- named @AppendixNumInTables { Yes }
- named @SubAppendixNumInTables { No }
- named @SubSubAppendixNumInTables { No }
-
- named @SectionNumInRunners { Yes }
- named @SubSectionNumInRunners { No }
- named @SubSubSectionNumInRunners { No }
- named @SubAppendixNumInRunners { Yes }
- named @SubSubAppendixNumInRunners { No }
-
- named @PrefacePrefix { }
- named @ContentsPrefix { }
- named @FigureContentsPrefix { }
- named @TableContentsPrefix { }
- named @AbbreviationsPrefix { }
- named @IntroductionPrefix { }
- named @ChapterPrefix { }
- named @AppendixPrefix { }
- named @ReferencesPrefix { }
- named @GlossaryPrefix { }
- named @IndexPrefix { }
- named @IndexAPrefix { }
- named @IndexBPrefix { }
- named @ColophonPrefix { }
-
-@Begin
-
- #######################################################################
- # #
- # Lists of chapters, sections, sub(-sub)sections, and appendices. #
- # #
- #######################################################################
-
- export num
- def @ChapterList named @Tag {} right num
- {
- @Galley
- // @ChapterList @Next num
- }
-
- export num
- def @SectionList named @Tag {} right num
- {
- @Galley
- //@SectionGap @SectionList @Next num
- }
-
- export num
- def @SubSectionList named @Tag {} right num
- {
- @Galley
- //@SubSectionGap @SubSectionList @Next num
- }
-
- export num
- def @SubSubSectionList named @Tag {} right num
- {
- @Galley
- //@SubSubSectionGap @SubSubSectionList @Next num
- }
-
- export num
- def @AppendixList named @Tag {} right num
- {
- @Galley
- // @AppendixList @Next num
- }
-
- export num
- def @SubAppendixList named @Tag {} right num
- {
- @Galley
- //@SubAppendixGap @SubAppendixList @Next num
- }
-
- export num
- def @SubSubAppendixList named @Tag {} right num
- {
- @Galley
- //@SubSubAppendixGap @SubSubAppendixList @Next num
- }
-
- def @PrefacePlace { @Galley }
- def @AbbreviationsPlace { @Galley }
- def @IntroductionPlace { @Galley }
-
-
- #######################################################################
- # #
- # @Full - this sends text to a full-width place on a new page, even #
- # if @ChapterStartPages is SamePage. #
- # #
- #######################################################################
-
- def @Full right x
- {
- def @Any force into { @FullPlace&&following } right x { x }
- def @Odd force into { @OddFullPlace&&following } right x { x }
- def @Even force into { @EvenFullPlace&&following } right x { x }
-
- @ChapterStartPages @Case {
- { Any SamePage } @Yield @Any x
- Odd @Yield @Odd x
- Even @Yield @Even x
- }
- }
-
-
- #######################################################################
- # #
- # @ChapterFull - this sends text to a full-width place on a new #
- # page, unless @ChapterStartPages is SamePage, in which case it #
- # doesn't send the text anywhere. #
- # #
- #######################################################################
-
- def @ChapterFull right x
- {
- def @Any force into { @FullPlace&&following } right x { x }
- def @Odd force into { @OddFullPlace&&following } right x { x }
- def @Even force into { @EvenFullPlace&&following } right x { x }
-
- @ChapterStartPages @Case {
- Any @Yield @Any x
- Odd @Yield @Odd x
- Even @Yield @Even x
- SamePage @Yield x
- }
- }
-
-
- #######################################################################
- # #
- # @IntroFull - this sends text to a full-width intro place. #
- # #
- #######################################################################
-
- def @IntroFull right x
- {
- def @Any force into { @IntroFullPlace&&following } right x { x }
- def @Odd force into { @IntroOddFullPlace&&following } right x { x }
- def @Even force into { @IntroEvenFullPlace&&following } right x { x }
-
- @ChapterStartPages @Case {
- { Any SamePage } @Yield @Any x
- Odd @Yield @Odd x
- Even @Yield @Even x
- }
- }
-
-
- #######################################################################
- # #
- # @ChooseFull - this sends either to introfull or ordinary full #
- # #
- #######################################################################
-
- def @ChooseFull right x
- {
- @SeparateIntroNumbering @Case {
- No @Yield @Full x
- Yes @Yield @IntroFull x
- }
- }
-
-
- #######################################################################
- # #
- # Book. #
- # #
- #######################################################################
-
- def @Book
- named @Tag {}
- named @Title {}
- named @Author {}
- named @Edition {}
- named @Publisher {}
- named @BeforeTitlePage {}
- named @OnTitlePage {}
- named @AfterTitlePage {}
- named @AtEnd { dft }
- named @InitialFont { @InitialFont }
- named @InitialBreak { @InitialBreak }
- named @InitialOutdent { @InitialOutdent }
- named @InitialSpace { @InitialSpace }
- named @InitialLanguage { @InitialLanguage }
- named @PageOrientation { @PageOrientation }
- named @PageHeaders { @PageHeaders }
- named @ColumnNumber { @ColumnNumber }
- named @FirstPageNumber { @FirstPageNumber }
- named @IntroFirstPageNumber { @IntroFirstPageNumber }
- named @OptimizePages { @OptimizePages }
- named @GlossaryText { @GlossaryText }
- named @IndexText { @IndexText }
- named @IndexAText { @IndexAText }
- named @IndexBText { @IndexBText }
- {
- def @Before
- {
- @BeforeTitlePage @Case {
- "" @Yield @Null
- else @Yield @BeforeTitlePage
- }
- }
-
- def @On
- {
- @OnTitlePage @Case {
- "" @Yield {
- //1i |0.5rt 2.5f @Font {1.2fx clines} @Break @Title |
- //2i |0.5rt clines @Break @Author |
- //1i |0.5rt clines @Break @Edition |
- //1rt @OneRow @Publisher
- }
- else @Yield @OnTitlePage
- }
- }
-
- def @After
- {
- @AfterTitlePage @Case {
- "" @Yield @Null
- else @Yield { @AfterTitlePage // None @Runner }
- }
- }
-
- def @ContentsPart
- named @Tag {}
- {
-
- @LargeScaleStructure
- tag { @Tag }
- type { ExtraMajorIntro }
- initiallanguage { @InitialLanguage }
- title { contents @WordVal @ContentsWord }
- aboveheadinggap { @AboveChapterGap }
- headingfont { @ChapterHeadingFont }
- headingbreak { @ChapterHeadingBreak }
- headingformat { @Num @ChapterHeadingFormat @Body }
- incontents { No }
- pnprefix { @ContentsPrefix }
- inrunners { Yes }
- majortitle { contents @WordVal @ContentsWord }
- sendheader { @ChooseFull @Body }
- innergap { @SectionGap }
- @ContentsSection
- }
-
- def @FigureContentsPart
- named @Tag {}
- {
- @LargeScaleStructure
- tag { @Tag }
- type { ExtraMajorIntro }
- initiallanguage { @InitialLanguage }
- title { figurelist @WordVal @FigureListWord }
- aboveheadinggap { @AboveChapterGap }
- headingfont { @ChapterHeadingFont }
- headingbreak { @ChapterHeadingBreak }
- headingformat { @Num @ChapterHeadingFormat @Body }
- incontents { No }
- pnprefix { @FigureContentsPrefix }
- inrunners { Yes }
- majortitle { figurelist @WordVal @FigureListWord }
- sendheader { @ChooseFull @Body }
- innergap { @SectionGap }
- @FigureContentsSection
- }
-
- def @TableContentsPart
- named @Tag {}
- {
- @LargeScaleStructure
- tag { @Tag }
- type { ExtraMajorIntro }
- initiallanguage { @InitialLanguage }
- title { tablelist @WordVal @TableListWord }
- aboveheadinggap { @AboveChapterGap }
- headingfont { @ChapterHeadingFont }
- headingbreak { @ChapterHeadingBreak }
- headingformat { @Num @ChapterHeadingFormat @Body }
- incontents { No }
- pnprefix { @TableContentsPrefix }
- inrunners { Yes }
- majortitle { tablelist @WordVal @TableListWord }
- sendheader { @ChooseFull @Body }
- innergap { @SectionGap }
- @TableContentsSection
- }
-
- def @ReferencesPart
- named @Tag {}
- {
- @LargeScaleStructure
- tag { @Tag }
- type { ExtraMajor }
- initiallanguage { @InitialLanguage }
- title { @RefHeading @RefListTitle }
- majortitle { @RefHeading @RefListTitle }
- aboveheadinggap { @AboveChapterGap }
- headingfont { @ChapterHeadingFont }
- headingbreak { @ChapterHeadingBreak }
- headingformat { @Num @ChapterHeadingFormat @Body }
- incontents { @ReferencesInContents }
- pnprefix { @ReferencesPrefix }
- inrunners { Yes }
- sendheader { @ChapterFull @Body }
- innergap { @SectionGap }
- @ReferencesSection
-
- }
-
- def @GlossaryPart
- named @Tag {}
- {
- def @Run
- {
- NonStart @Runner
- @MajorNum {}
- @MajorTitle { glossary @WordVal @GlossaryWord }
- @MinorNum {}
- @MinorTitle { glossary @WordVal @GlossaryWord }
- @Owner { @Tag }
- @Prefix { @GlossaryPrefix }
- }
-
- @LargeScaleStructure
- tag { @Tag }
- type { Major }
- initiallanguage { @InitialLanguage }
- title { glossary @WordVal @GlossaryWord }
- aboveheadinggap { @AboveChapterGap }
- headingfont { @ChapterHeadingFont }
- headingbreak { @ChapterHeadingBreak }
- headingformat { @Num @ChapterHeadingFormat @Body }
- headingtext { @GlossaryText }
- incontents { @GlossaryInContents }
- pnprefix { @GlossaryPrefix }
- inrunners { Yes }
- sendheader { @Full @Body }
- innergap { @SectionGap }
- wantindefinite { Yes }
- @GlossarySection @Run
- }
-
- def @IndexPart
- named @Tag {}
- {
- def @Run
- {
- NonStart @Runner
- @MajorNum {}
- @MajorTitle { index @WordVal @IndexWord }
- @MinorNum {}
- @MinorTitle { index @WordVal @IndexWord }
- @Owner { @Tag }
- @Prefix { @IndexPrefix }
- }
-
- @LargeScaleStructure
- tag { @Tag }
- type { Major }
- initiallanguage { @InitialLanguage }
- title { index @WordVal @IndexWord }
- aboveheadinggap { @AboveChapterGap }
- headingfont { @ChapterHeadingFont }
- headingbreak { @ChapterHeadingBreak }
- headingformat { @Num @ChapterHeadingFormat @Body }
- headingtext { @IndexText }
- incontents { @IndexInContents }
- pnprefix { @IndexPrefix }
- inrunners { Yes }
- sendheader { @Full @Body }
- innergap { @SectionGap }
- wantindefinite { Yes }
- @IndexSection @Run
- }
-
- def @IndexAPart
- named @Tag {}
- {
- def @RunA
- {
- NonStart @Runner
- @MajorNum {}
- @MajorTitle { index @WordVal @IndexAWord }
- @MinorNum {}
- @MinorTitle { index @WordVal @IndexAWord }
- @Owner { @Tag }
- @Prefix { @IndexAPrefix }
- }
-
- @LargeScaleStructure
- tag { @Tag }
- type { Major }
- initiallanguage { @InitialLanguage }
- title { index @WordVal @IndexAWord }
- aboveheadinggap { @AboveChapterGap }
- headingfont { @ChapterHeadingFont }
- headingbreak { @ChapterHeadingBreak }
- headingformat { @Num @ChapterHeadingFormat @Body }
- headingtext { @IndexAText }
- incontents { @IndexAInContents }
- pnprefix { @IndexAPrefix }
- inrunners { Yes }
- sendheader { @Full @Body }
- innergap { @SectionGap }
- wantindefinite { Yes }
- @IndexASection @RunA
- }
-
- def @IndexBPart
- named @Tag {}
- {
- def @RunB
- {
- NonStart @Runner
- @MajorNum {}
- @MajorTitle { index @WordVal @IndexBWord }
- @MinorNum {}
- @MinorTitle { index @WordVal @IndexBWord }
- @Owner { @Tag }
- @Prefix { @IndexBPrefix }
- }
-
- @LargeScaleStructure
- tag { @Tag }
- type { Major }
- initiallanguage { @InitialLanguage }
- title { index @WordVal @IndexBWord }
- aboveheadinggap { @AboveChapterGap }
- headingfont { @ChapterHeadingFont }
- headingbreak { @ChapterHeadingBreak }
- headingformat { @Num @ChapterHeadingFormat @Body }
- headingtext { @IndexAText }
- incontents { @IndexBInContents }
- pnprefix { @IndexBPrefix }
- inrunners { Yes }
- sendheader { @Full @Body }
- innergap { @SectionGap }
- wantindefinite { Yes }
- @IndexBSection @RunB
- }
-
- def @BookIntro force into { @IntroColPlace&&preceding }
- named @Optimize { @OptimizePages }
- {
- @NoLinkPageMark @Tag
- // @Before
- //1.1b @TitlePageFont @Font @On
- //1.1b @After
- // Start @Runner @Owner { @Tag }
- //1.1b @PrefaceAfterContents @NoDo @PrefacePlace
- // @MakeContents @Case {
- { Yes Bypass } @Yield @ContentsPart
- else @Yield @Null
- }
- // @MakeFigureContents @Case {
- { Yes Bypass } @Yield @FigureContentsPart
- else @Yield @Null
- }
- // @MakeTableContents @Case {
- { Yes Bypass } @Yield @TableContentsPart
- else @Yield @Null
- }
- //1.1b @PrefaceAfterContents @Do @PrefacePlace
- }
-
- def @BookBody force into { @ColPlace&&preceding }
- named @Optimize { @OptimizePages }
- {
- # The first component of @BookBody must be indefinite, so that
- # its flushing is delayed until we reach the body galleys, either
- # @Introduction or @Chapter. If not, @BookBody will free up
- # @PrefacePlace etc. too soon, producing a "no @PrefacePlace
- # precedes this @PrefacePLace&&preceding" error message.
-
- @AbbreviationsPlace
- // @IntroductionPlace
- // @ChapterList @FirstChapterNumber
- // @ReferencesBeforeAppendices @Do {
- @MakeReferences @Do @ReferencesPart
- }
- // @MakeGlossary @Do @GlossaryPart
- // @AppendixList @FirstAppendixNumber
- // @ReferencesBeforeAppendices @NoDo {
- @MakeReferences @Do @ReferencesPart
- }
- // @MakeIndexA @Do @IndexAPart
- // @MakeIndexA @Case {
- Bypass @Yield @BypassBeginIndexAPlace
- else @Yield @Null
- }
- // @MakeIndexB @Do @IndexBPart
- // @MakeIndexB @Case {
- Bypass @Yield @BypassBeginIndexBPlace
- else @Yield @Null
- }
- // @MakeIndex @Do @IndexPart
- // @MakeIndex @Case {
- Bypass @Yield @BypassBeginIndexPlace
- else @Yield @Null
- }
- }
-
- def @BookCombined force into { @ColPlace&&preceding }
- named @Optimize { @OptimizePages }
- {
- @NoLinkPageMark @Tag
- // @Before
- //1.1b @TitlePageFont @Font @On
- //1.1b @After
- // Start @Runner @Owner { @Tag }
- //1.1b @PrefaceAfterContents @NoDo @PrefacePlace
- // @MakeContents @Case {
- { Yes Bypass } @Yield @ContentsPart
- else @Yield @Null
- }
- // @MakeFigureContents @Case {
- { Yes Bypass } @Yield @FigureContentsPart
- else @Yield @Null
- }
- // @MakeTableContents @Case {
- { Yes Bypass } @Yield @TableContentsPart
- else @Yield @Null
- }
- //1.1b @PrefaceAfterContents @Do @PrefacePlace
- // @AbbreviationsPlace
- // @IntroductionPlace
- // @ChapterList @FirstChapterNumber
- // @ReferencesBeforeAppendices @Do {
- @MakeReferences @Do @ReferencesPart
- }
- // @MakeGlossary @Do @GlossaryPart
- // @AppendixList @FirstAppendixNumber
- // @ReferencesBeforeAppendices @NoDo {
- @MakeReferences @Do @ReferencesPart
- }
- // @MakeIndexA @Do @IndexAPart
- // @MakeIndexA @Case {
- Bypass @Yield @BypassBeginIndexAPlace
- else @Yield @Null
- }
- // @MakeIndexB @Do @IndexBPart
- // @MakeIndexB @Case {
- Bypass @Yield @BypassBeginIndexBPlace
- else @Yield @Null
- }
- // @MakeIndex @Do @IndexPart
- // @MakeIndex @Case {
- Bypass @Yield @BypassBeginIndexPlace
- else @Yield @Null
- }
- }
-
- @InitialFont @Font { @InitialBreak setoutdent @InitialOutdent } @Break
- @InitialLanguage @Language @InitialSpace @Space
- { @ColourCommand @InitialColour } @SetColour
- {
-
- @SeparateIntroNumbering @Case {
-
- No @Yield {
- Yes @BeginAllCounters {}
- Yes @BeginDisplayCounter {}
- Yes @BeginFigureCounter {}
- Yes @BeginTableCounter {}
- // @PageList
- @ColumnNumber { @ColumnNumber }
- @PageHeaders { @PageHeaders }
- @Orient { @PageOrientation }
- @FirstPageNumber
- // @BookCombined
- // NonStart @Runner @Owner { @Tag }
- // @AtEnd @Case {
- dft @Yield @Null
- else @Yield
- @EvenPage @Orient { @PageOrientation } @AtEnd
- }
- }
-
- Yes @Yield {
- Yes @BeginAllCounters {}
- Yes @BeginDisplayCounter {}
- Yes @BeginFigureCounter {}
- Yes @BeginTableCounter {}
- // @IntroPageList
- @ColumnNumber { 1 }
- @PageHeaders { @PageHeaders }
- @Orient { @PageOrientation }
- @IntroFirstPageNumber
- # // NonStart @Runner @Owner { @Tag }
- // None @Runner @Owner { @Tag }
- // @PageList
- @ColumnNumber { @ColumnNumber }
- @PageHeaders { @PageHeaders }
- @Orient { @PageOrientation }
- extra { Yes }
- @FirstPageNumber
- // @BookIntro
- // @BookBody
- // NonStart @Runner @Owner { @Tag }
- // @AtEnd @Case {
- dft @Yield @Null
- else @Yield
- @EvenPage @Orient { @PageOrientation } @AtEnd
- }
- }
- }
- }
- }
-
-
- #######################################################################
- # #
- # Preface. #
- # #
- #######################################################################
-
- def @Preface force into { @PrefacePlace&&preceding }
- named @Tag {}
- named @Title { preface @WordVal @PrefaceWord }
- named @RunningTitle { dft }
- named @InitialLanguage {}
- body @Body
- {
-
- @LargeScaleStructure
- tag { @Tag }
- type { ExtraMajorIntro }
- initiallanguage { @InitialLanguage }
- title { @Title }
- runningtitle { @RunningTitle }
- aboveheadinggap { @AboveChapterGap }
- headingfont { @ChapterHeadingFont }
- headingbreak { @ChapterHeadingBreak }
- headingformat { @Num @ChapterHeadingFormat @Body }
- incontents { @PrefaceInContents }
- pnprefix { @PrefacePrefix }
- sendheader { @ChooseFull @Body }
- innergap { @SectionGap }
- inrunners { Yes }
- @Body
-
- }
-
-
- #######################################################################
- # #
- # Abbreviations. #
- # #
- #######################################################################
-
- def @Abbreviations force into { @AbbreviationsPlace&&preceding }
- named @Tag {}
- named @Title { abbreviations @WordVal @AbbreviationsWord }
- named @RunningTitle { dft }
- named @InitialLanguage {}
- body @Body
- {
-
- @LargeScaleStructure
- tag { @Tag }
- type { Major }
- initiallanguage { @InitialLanguage }
- title { @Title }
- runningtitle { @RunningTitle }
- aboveheadinggap { @AboveChapterGap }
- headingfont { @ChapterHeadingFont }
- headingbreak { @ChapterHeadingBreak }
- headingformat { @Num @ChapterHeadingFormat @Body }
- incontents { @AbbreviationsInContents }
- pnprefix { @AbbreviationsPrefix }
- sendheader { @Full @Body }
- innergap { @SectionGap }
- inrunners { Yes }
- @Body
-
- }
-
-
- #######################################################################
- # #
- # Introduction. #
- # #
- #######################################################################
-
- def @Introduction force into { @IntroductionPlace&&preceding }
- named @Tag {}
- named @Title { introduction @WordVal @IntroductionWord }
- named @RunningTitle { dft }
- named @InitialLanguage {}
- body @Body
- {
-
- @LargeScaleStructure
- tag { @Tag }
- type { Major }
- initiallanguage { @InitialLanguage }
- title { @Title }
- runningtitle { @RunningTitle }
- aboveheadinggap { @AboveChapterGap }
- headingfont { @ChapterHeadingFont }
- headingbreak { @ChapterHeadingBreak }
- headingformat { @Num @ChapterHeadingFormat @Body }
- incontents { @IntroductionInContents }
- pnprefix { @IntroductionPrefix }
- sendheader { @Full @Body }
- innergap { @SectionGap }
- inrunners { Yes }
- @Body
-
- }
-
-
- #######################################################################
- # #
- # Chapters containing sections and subsections. #
- # #
- #######################################################################
-
- export @BeginSections @EndSections @Section
- def @Chapter force into { @ChapterList&&preceding }
- named @Tag {}
- named @Title {}
- named @RunningTitle { dft }
- named @InitialLanguage {}
- named @PartNumber {}
- named @PartTitle {}
- named @PartText {}
- named @BypassNumber { dft }
- body @Body
- {
-
- def @EndSectionsPlace { @Galley }
-
- def @EndSections force into { @EndSectionsPlace&&preceding }
- {}
-
- macro @BeginSections
- { //@SectionGap @SectionList @FirstSectionNumber
- // @EndSectionsPlace //
- }
-
- def @ChapterShortNum
- {
- @ChapterNumbers @Then {
- @BypassNumber @Dft {
- @ChapterNumbers @Num @ChapterList&&@Tag @Open { num }
- }
- }
- }
-
- def @MajorNum
- {
- @ChapterNumbers @Then @InitialLanguage @Language {
- chapter @WordVal @ChapterWord @ChapterShortNum
- }
- }
-
- def @MajorTitle
- {
- @InitialLanguage @Language {
- @RunningTitle @Dft @Title
- }
- }
-
- export @BeginSubSections @EndSubSections @SubSection
- def @Section force into { @SectionList&&preceding }
- named @Tag {}
- named @Title {}
- named @RunningTitle { dft }
- named @InitialLanguage { @InitialLanguage }
- named @BypassNumber { dft }
- body @Body
- {
-
- def @EndSubSectionsPlace { @Galley }
-
- def @EndSubSections force into { @EndSubSectionsPlace&&preceding }
- {}
-
- macro @BeginSubSections
- { //@SubSectionGap @SubSectionList @FirstSubSectionNumber
- // @EndSubSectionsPlace //
- }
-
- def @SectionShortNum
- {
- @SectionNumbers @Then {
- @BypassNumber @Dft {
- @ChapterShortNum @Join @SectionNumbers @Num
- { @SectionList&&@Tag @Open { num } }
- }
- }
- }
-
- export @BeginSubSubSections @EndSubSubSections @SubSubSection
- def @SubSection force into { @SubSectionList&&preceding }
- named @Tag {}
- named @Title {}
- named @RunningTitle { dft }
- named @InitialLanguage { @InitialLanguage }
- named @BypassNumber { dft }
- body @Body
- {
-
- def @EndSubSubSectionsPlace { @Galley }
-
- def @EndSubSubSections force into
- { @EndSubSubSectionsPlace&&preceding }
- {}
-
- macro @BeginSubSubSections
- { //@SubSubSectionGap @SubSubSectionList @FirstSubSubSectionNumber
- // @EndSubSubSectionsPlace //
- }
-
- def @SubSectionShortNum
- {
- @SubSectionNumbers @Then {
- @BypassNumber @Dft {
- @SectionShortNum @Join @SubSectionNumbers @Num
- { @SubSectionList&&@Tag @Open { num } }
- }
- }
- }
-
- def @SubSubSection force into { @SubSubSectionList&&preceding }
- named @Tag {}
- named @Title {}
- named @RunningTitle { dft }
- named @InitialLanguage { @InitialLanguage }
- named @BypassNumber { dft }
- body @Body
- {
-
- @LargeScaleStructure
- tag { @Tag }
- type { Minor }
- initiallanguage { @InitialLanguage }
- title { @Title }
- runningtitle { @RunningTitle }
- headingfont { @SubSubSectionHeadingFont }
- headingbreak { @SubSubSectionHeadingBreak }
- headingformat { @Num @SubSubSectionHeadingFormat @Body }
- incontents { @SubSubSectionInContents }
- contentsindent { 9f }
- numbers { @SubSubSectionNumbers }
- attachnum { @SubSubSectionList&&preceding @Tagged @Tag }
- retrievenum { @SubSubSectionList&&@Tag @Open { num } }
- bypassnumber { @BypassNumber }
- prefix { @SubSectionShortNum }
- majornum { @MajorNum }
- majortitle { @MajorTitle }
- intheorems { @SubSubSectionNumInTheorems }
- indisplays { @SubSubSectionNumInDisplays }
- infigures { @SubSubSectionNumInFigures }
- intables { @SubSubSectionNumInTables }
- inrunners { @SubSubSectionNumInRunners }
- @Body
- }
-
- @LargeScaleStructure
- tag { @Tag }
- type { Minor }
- initiallanguage { @InitialLanguage }
- title { @Title }
- runningtitle { @RunningTitle }
- headingfont { @SubSectionHeadingFont }
- headingbreak { @SubSectionHeadingBreak }
- headingformat { @Num @SubSectionHeadingFormat @Body }
- incontents { @SubSectionInContents }
- contentsindent { 6f }
- numbers { @SubSectionNumbers }
- attachnum { @SubSectionList&&preceding @Tagged @Tag }
- retrievenum { @SubSectionList&&@Tag @Open { num } }
- bypassnumber { @BypassNumber }
- prefix { @SectionShortNum }
- majornum { @MajorNum }
- majortitle { @MajorTitle }
- intheorems { @SubSectionNumInTheorems }
- indisplays { @SubSectionNumInDisplays }
- infigures { @SubSectionNumInFigures }
- intables { @SubSectionNumInTables }
- inrunners { @SubSectionNumInRunners }
- @Body
-
- }
-
- @LargeScaleStructure
- tag { @Tag }
- type { Minor }
- initiallanguage { @InitialLanguage }
- title { @Title }
- runningtitle { @RunningTitle }
- headingfont { @SectionHeadingFont }
- headingbreak { @SectionHeadingBreak }
- headingformat { @Num @SectionHeadingFormat @Body }
- incontents { @SectionInContents }
- contentsindent { 3f }
- numbers { @SectionNumbers }
- attachnum { @SectionList&&preceding @Tagged @Tag }
- retrievenum { @SectionList&&@Tag @Open { num } }
- bypassnumber { @BypassNumber }
- prefix { @ChapterShortNum }
- majornum { @MajorNum }
- majortitle { @MajorTitle }
- intheorems { @SectionNumInTheorems }
- indisplays { @SectionNumInDisplays }
- infigures { @SectionNumInFigures }
- intables { @SectionNumInTables }
- inrunners { @SectionNumInRunners }
- @Body
-
- }
-
- def @Part
- named @Tag {}
- {
- @LargeScaleStructure
- type { VeryMajor }
- initiallanguage { @InitialLanguage }
- title { @PartTitle }
- aboveheadinggap { @AbovePartGap }
- headingfont { @PartHeadingFont }
- headingbreak { @PartHeadingBreak }
- headingformat { @Num @PartHeadingFormat @Body }
- bypassnumber { @PartNumber }
- incontents { @PartInContents }
- sendheader { @Full @Body }
- inrunners { Yes }
- tag { @Tag }
- @PartText
- }
-
- @PartNumber @Case {
- "" @Yield {
- @PartTitle @Case {
- "" @Yield @Null
- else @Yield @Part
- }
- }
- else @Yield @Part
- }
- //
- @LargeScaleStructure
- tag { @Tag }
- type { Major }
- initiallanguage { @InitialLanguage }
- title { @Title }
- runningtitle { @RunningTitle }
- aboveheadinggap { @AboveChapterGap }
- headingfont { @ChapterHeadingFont }
- headingbreak { @ChapterHeadingBreak }
- headingformat { @Num @ChapterHeadingFormat @Body }
- incontents { @ChapterInContents }
- contentsindent { 0f }
- word { chapter @WordVal @ChapterWord }
- numbers { @ChapterNumbers }
- attachnum { @ChapterList&&preceding @Tagged @Tag }
- retrievenum { @ChapterList&&@Tag @Open { num } }
- bypassnumber { @BypassNumber }
- pnprefix { @ChapterPrefix }
- intheorems { @ChapterNumInTheorems }
- indisplays { @ChapterNumInDisplays }
- infigures { @ChapterNumInFigures }
- intables { @ChapterNumInTables }
- sendheader { @ChapterFull @Body }
- innergap { @SectionGap }
- inrunners { Yes }
- @Body
-
- }
-
-
- #######################################################################
- # #
- # Appendices. #
- # #
- #######################################################################
-
- export @BeginSubAppendices @EndSubAppendices @SubAppendix
- def @Appendix force into { @AppendixList&&preceding }
- named @Tag {}
- named @Title {}
- named @RunningTitle { dft }
- named @InitialLanguage {}
- named @PartNumber {}
- named @PartTitle {}
- named @PartText {}
- named @BypassNumber { dft }
- body @Body
- {
-
- def @EndSubAppendicesPlace { @Galley }
-
- def @EndSubAppendices force into { @EndSubAppendicesPlace&&preceding }
- {}
-
- macro @BeginSubAppendices
- { //@SubAppendixGap @SubAppendixList @FirstSubAppendixNumber
- // @EndSubAppendicesPlace //
- }
-
- def @AppendixShortNum
- {
- @AppendixNumbers @Then {
- @BypassNumber @Dft {
- @AppendixNumbers @Num @AppendixList&&@Tag @Open { num }
- }
- }
- }
-
- def @MajorNum
- {
- @AppendixNumbers @Then @InitialLanguage @Language {
- appendix @WordVal @AppendixWord @AppendixShortNum
- }
- }
-
- def @MajorTitle
- {
- @InitialLanguage @Language {
- @RunningTitle @Dft @Title
- }
- }
-
- export @BeginSubSubAppendices @EndSubSubAppendices @SubSubAppendix
- def @SubAppendix force into { @SubAppendixList&&preceding }
- named @Tag {}
- named @Title {}
- named @RunningTitle { dft }
- named @InitialLanguage { @InitialLanguage }
- named @BypassNumber { dft }
- body @Body
- {
-
- def @EndSubSubAppendicesPlace { @Galley }
-
- def @EndSubSubAppendices force into { @EndSubSubAppendicesPlace&&preceding }
- {}
-
- macro @BeginSubSubAppendices
- { //@SubSubAppendixGap @SubSubAppendixList @FirstSubSubAppendixNumber
- // @EndSubSubAppendicesPlace //
- }
-
- def @SubAppendixShortNum
- {
- @SubAppendixNumbers @Then {
- @BypassNumber @Dft {
- @AppendixShortNum @Join @SubAppendixNumbers @Num
- { @SubAppendixList&&@Tag @Open { num } }
- }
- }
- }
-
- def @SubSubAppendix force into { @SubSubAppendixList&&preceding }
- named @Tag {}
- named @Title {}
- named @RunningTitle { dft }
- named @InitialLanguage { @InitialLanguage }
- named @BypassNumber { dft }
- body @Body
- {
-
- @LargeScaleStructure
- tag { @Tag }
- type { Minor }
- initiallanguage { @InitialLanguage }
- title { @Title }
- runningtitle { @RunningTitle }
- headingfont { @SubSubAppendixHeadingFont }
- headingbreak { @SubSubAppendixHeadingBreak }
- headingformat { @Num @SubSubAppendixHeadingFormat @Body }
- incontents { @SubSubAppendixInContents }
- contentsindent { 6f }
- numbers { @SubSubAppendixNumbers }
- attachnum { @SubSubAppendixList&&preceding @Tagged @Tag }
- retrievenum { @SubSubAppendixList&&@Tag @Open { num } }
- bypassnumber { @BypassNumber }
- prefix { @SubAppendixShortNum }
- majornum { @MajorNum }
- majortitle { @MajorTitle }
- intheorems { @SubSubAppendixNumInTheorems }
- indisplays { @SubSubAppendixNumInDisplays }
- infigures { @SubSubAppendixNumInFigures }
- intables { @SubSubAppendixNumInTables }
- inrunners { @SubSubAppendixNumInRunners }
- @Body
-
- }
-
- @LargeScaleStructure
- tag { @Tag }
- type { Minor }
- initiallanguage { @InitialLanguage }
- title { @Title }
- runningtitle { @RunningTitle }
- headingfont { @SubAppendixHeadingFont }
- headingbreak { @SubAppendixHeadingBreak }
- headingformat { @Num @SubAppendixHeadingFormat @Body }
- incontents { @SubAppendixInContents }
- contentsindent { 3f }
- numbers { @SubAppendixNumbers }
- attachnum { @SubAppendixList&&preceding @Tagged @Tag }
- retrievenum { @SubAppendixList&&@Tag @Open { num } }
- bypassnumber { @BypassNumber }
- prefix { @AppendixShortNum }
- majornum { @MajorNum }
- majortitle { @MajorTitle }
- intheorems { @SubAppendixNumInTheorems }
- indisplays { @SubAppendixNumInDisplays }
- infigures { @SubAppendixNumInFigures }
- intables { @SubAppendixNumInTables }
- inrunners { @SubAppendixNumInRunners }
- @Body
-
- }
-
- def @Part
- named @Tag {}
- {
- @LargeScaleStructure
- type { VeryMajor }
- initiallanguage { @InitialLanguage }
- title { @PartTitle }
- aboveheadinggap { @AbovePartGap }
- headingfont { @PartHeadingFont }
- headingbreak { @PartHeadingBreak }
- headingformat { @Num @PartHeadingFormat @Body }
- bypassnumber { @PartNumber }
- incontents { @PartInContents }
- sendheader { @Full @Body }
- inrunners { Yes }
- tag { @Tag }
- @PartText
- }
-
- @PartNumber @Case {
- "" @Yield {
- @PartTitle @Case {
- "" @Yield @Null
- else @Yield @Part
- }
- }
- else @Yield @Part
- }
- //
- @LargeScaleStructure
- tag { @Tag }
- type { Major }
- initiallanguage { @InitialLanguage }
- title { @Title }
- runningtitle { @RunningTitle }
- aboveheadinggap { @AboveChapterGap }
- headingfont { @AppendixHeadingFont }
- headingbreak { @AppendixHeadingBreak }
- headingformat { @Num @AppendixHeadingFormat @Body }
- incontents { @AppendixInContents }
- contentsindent { 0f }
- word { appendix @WordVal @AppendixWord }
- numbers { @AppendixNumbers }
- attachnum { @AppendixList&&preceding @Tagged @Tag }
- retrievenum { @AppendixList&&@Tag @Open { num } }
- bypassnumber { @BypassNumber }
- pnprefix { @AppendixPrefix }
- intheorems { @AppendixNumInTheorems }
- indisplays { @AppendixNumInDisplays }
- infigures { @AppendixNumInFigures }
- intables { @AppendixNumInTables }
- sendheader { @ChapterFull @Body }
- innergap { @SubAppendixGap }
- inrunners { Yes }
- @Body
-
- }
-
-
- def @Colophon force into { @ColophonPlace&&preceding }
- named @Tag {}
- named @InitialLanguage {}
- named @PartNumber {}
- named @PartTitle {}
- named @PartText {}
- named @BypassNumber { dft }
- body @Body
- {
-
- @LargeScaleStructure
- tag { @Tag }
- type { Major }
- initiallanguage { @InitialLanguage }
- aboveheadinggap { @AboveChapterGap }
- headingfont { @AppendixHeadingFont }
- headingbreak { @AppendixHeadingBreak }
- headingformat { @Num @AppendixHeadingFormat @Body }
- incontents { @ColophonInContents }
- contentsindent { 0f }
- word { colophon @WordVal @ColophonWord }
- numbers { None }
- pnprefix { @ColophonPrefix }
- sendheader { @ChapterFull @Body }
- innergap { @SubAppendixGap }
- inrunners { Yes }
- @Body
-
- }
-
-
-@End @BookSetup
diff --git a/include/save_dsf b/include/save_dsf
deleted file mode 100644
index 5e1ee73..0000000
--- a/include/save_dsf
+++ /dev/null
@@ -1,4930 +0,0 @@
-###############################################################################
-# #
-# Lout @DocumentSetup package #
-# #
-# Version 1.0 by Jeffrey H. Kingston, 17 July 1991. #
-# Version 2.0 by Jeffrey H. Kingston, 22 December 1992. #
-# Version 3.0 by Jeffrey H. Kingston, 19 April 1994. #
-# Version 3.03 by Jeffrey H. Kingston, 6 May 1995. #
-# Versions 3.04 and 3.05 by Jeffrey H. Kingston, 11 June 1995. #
-# Version 3.05 by Jeffrey H. Kingston, 25 July 1995. #
-# Version 3.07 by Jeffrey H. Kingston, February 1996. #
-# Version 3.10 by Jeffrey H. Kingston, September 1996. #
-# Version 3.11 by Jeffrey H. Kingston, December 1996. #
-# Version 3.13 by Jeffrey H. Kingston, October 1998. #
-# Version 3.16 by Jeffrey H. Kingston, May 1999. #
-# Version 3.17 by Jeffrey H. Kingston, September 1999. #
-# Version 3.21 by Jeffrey H. Kingston, May 2000. #
-# #
-# This Lout package contains the general definitions used by all types of #
-# documents. It needs to be extended (see docf, reportf, bookf, slidesf, #
-# etc.) with definitions for particular document types. Consult "A User's #
-# Guide to the Lout Document Formatting System" for user information. #
-# #
-###############################################################################
-
-extend @BasicSetup
-
-export
-
- @Runner
-
- @Figure @Table
- @FootNote @AnotherFootNote @EndNote
- @LeftNote @RightNote @OuterNote @InnerNote @Place
- @Theorem @Proof @EndProof
- @Definition @Claim @Proposition @Lemma @Corollary @Example
- @Reference @RefStyle @RefPrint
- @Ref @NoRef @ChapRef @NoChapRef
- @Cite @NoCite @ChapCite @NoChapCite
-
- @Glossary @InGlossary
-
- @IndexA @SubIndexA @SubSubIndexA
- @RawIndexA @RawSubIndexA @RawSubSubIndexA
- @IndexABlanks @IndexASpacer @InitialIndexASpacer @IndexALetters
-
- @IndexB @SubIndexB @SubSubIndexB
- @RawIndexB @RawSubIndexB @RawSubSubIndexB
- @IndexBBlanks @IndexBSpacer @InitialIndexBSpacer @IndexBLetters
-
- @Index @SubIndex @SubSubIndex
- @RawIndex @RawSubIndex @RawSubSubIndex
- @IndexBlanks @IndexSpacer @InitialIndexSpacer @IndexLetters
-
- @BypassContentsEntry @BypassMajorContentsEntry
- @BypassFigureContentsEntry @BypassTableContentsEntry
- @BypassReference @BypassChapReference
- @BypassBeginIndex @BypassRawIndex @BypassEndIndex
- @BypassBeginIndexA @BypassRawIndexA @BypassEndIndexA
- @BypassBeginIndexB @BypassRawIndexB @BypassEndIndexB
-
-
-def @DocumentSetup
- named @PageType { A4 @OrIfPlain Other} # page type (width, height)
- named @PageWidth { 80s } # page width if type Other
- named @PageHeight { 66f } # page height if type Other
- named @PageOrientation { Portrait } # Portrait, Landscape, etc.
- named @PageBackground { } # background of each page
- named @TopMargin { 2.50c @OrIfPlain 6f } # top margin of all pages
- named @FootMargin { 2.50c @OrIfPlain 6f } # bottom margin of all pages
- named @OddLeftMargin { 2.50c @OrIfPlain 10s } # left margin of odd pages
- named @OddRightMargin { 2.50c @OrIfPlain 10s } # right margin of odd pages
- named @EvenLeftMargin { 2.50c @OrIfPlain 10s } # left margin of even pages
- named @EvenRightMargin { 2.50c @OrIfPlain 10s } # right margin of even pages
- named @OddLeftBodyMargin { 0c } # extra margin for page body
- named @OddRightBodyMargin { 0c } # extra margin for page body
- named @EvenLeftBodyMargin { 0c } # extra margin for page body
- named @EvenRightBodyMargin { 0c } # extra margin for page body
- named @PageBoxType { None } # None Box CurveBox ShadowBox
- named @PageBoxMargin { 1.00c } # page box margin
- import @PSLengths named @PageBoxLineWidth
- { } # page box line thickness
- named @PageBoxPaint { none } # page box paint
- named @PageBoxShadow { 0.60c } # shadow margin if ShadowBox
- named @PageEnclose right @Body { @Body } # page enclose
- named @ColumnNumber { 1 } # number of columns (1 to 10)
- named @ColumnGap { 1.00c @OrIfPlain 6s } # column gap
- named @FigureLocation { PageTop } # default figure location
- named @TableLocation { PageTop } # default table location
- named @FigureFormat
- named @II right x { |@DisplayIndent x | }
- named @QQ right x { |@DisplayIndent x |@DisplayIndent }
- named @CC right x { |0.5rt x | }
- named @RR right x { |1.0rt x | }
- right @Body
- { @CC @Body } # default figure format
- named @TableFormat
- named @II right x { |@DisplayIndent x | }
- named @QQ right x { |@DisplayIndent x |@DisplayIndent }
- named @CC right x { |0.5rt x | }
- named @RR right x { |1.0rt x | }
- right @Body
- { @CC @Body } # default table format
- named @FigureWord { figure } # "Figure" word else anything
- named @TableWord { table } # "Table" word else anything
- named @FigureNumbers { Arabic } # method of numbering figures
- named @TableNumbers { Arabic } # method of numbering tables
- named @FigureCaptionPos { Below } # Above or Below
- named @TableCaptionPos { Below } # Above or Below
- named @FigureCaptionFont { -2p } # figure caption font
- named @FigureCaptionBreak { adjust hyphen 1.2fx } # figure caption break
- named @FigureCaptionFormat named word {} named number {} named caption {}
- { {@B { word @NumSep number. &2s }} @Insert caption }
- named @TableCaptionFont { -2p } # figure caption font
- named @TableCaptionBreak { adjust hyphen 1.2fx } # figure caption break
- named @TableCaptionFormat named word {} named number {} named caption {}
- { {@B { word @NumSep number. &2s }} @Insert caption }
- named @MakeFigureContents { No } # list of figures at start
- named @MakeTableContents { No } # list of tables at start
- named @MakeContents { No } # make contents? Yes or No
- named @ContentsGap { 0.20v @OrIfPlain 0f } # extra gap above minor entry
- named @ContentsGapAbove { 0.80v @OrIfPlain 1f } # extra gap above major entry
- named @ContentsGapBelow { 0.00v @OrIfPlain 0f } # extra gap below major entry
- named @ContentsFont { Bold } # font for major entry
- named @ContentsPartGapAbove { 1.00v @OrIfPlain 1f } # extra gap above part entry
- named @ContentsPartGapBelow { 0.00v @OrIfPlain 0f } # extra gap below part entry
- named @ContentsFormat
- left number
- right title
- { number @Sep title } # contents format
- named @ContentsLeader { .. } # leader symbol in contents
- named @ContentsLeaderGap { 4s @OrIfPlain 2s } # gap between leaders
- named @ContentsRightWidth { 3f @OrIfPlain 6s } # page numbers column width
-
- named @MakeReferences { Yes } # make references? Yes or No
- named @RefCiteStyle right cite { [cite] } # citation style
- named @RefCiteLabels
- named @RefNum {}
- named @Tag {}
- named @Type {}
- named @Abstract {}
- named @Address {}
- named @Annote {}
- named @Author {}
- named @Day {}
- named @Edition {}
- named @HowPublished {}
- named @InAuthor {}
- named @InTitle {}
- named @Institution {}
- named @Journal {}
- named @Keywords {}
- named @Label {}
- named @Month {}
- named @Note {}
- named @Number {}
- named @Organization {}
- named @Page {}
- named @Pages {}
- named @Pinpoint {}
- named @Publisher {}
- named @Title {}
- named @TitleNote {}
- named @TRType {}
- named @Volume {}
- named @Year {}
- { @RefNum } # citation items
- named @RefNumbers { Arabic } # reference numbers
-
- named @RefListFormat { Labels } # NoLabels, Labels,
- # DropLabels, IntegrateLabels
- named @RefListLabels
- named @RefNum {}
- named @Tag {}
- named @Type {}
- named @Abstract {}
- named @Address {}
- named @Annote {}
- named @Author {}
- named @Day {}
- named @Edition {}
- named @HowPublished {}
- named @InAuthor {}
- named @InTitle {}
- named @Institution {}
- named @Journal {}
- named @Keywords {}
- named @Label {}
- named @Month {}
- named @Note {}
- named @Number {}
- named @Organization {}
- named @Page {}
- named @Pages {}
- named @Pinpoint {}
- named @Publisher {}
- named @Title {}
- named @TitleNote {}
- named @TRType {}
- named @Volume {}
- named @Year {}
- { [@RefNum] } # ref list label format
- named @RefListTitle { references } # title of reference list
- named @ChapRefListTitle { references } # title of chapter ref list
- named @RefListIndent { 0s } # indent to left of labels
- named @RefListRightIndent { 0s } # indent to right of items
- named @RefListGap { @ListGap } # gap between ref list items
- named @RefListFont { } # font used in reference list
- named @RefListBreak { } # break style of ref list
- named @RefListLabelWidth { @ListLabelWidth } # numeric labels column width
- named @RefListSortKey
- named @Tag {}
- named @Type {}
- named @Abstract {}
- named @Address {}
- named @Annote {}
- named @Author {}
- named @CiteOrder {}
- named @Day {}
- named @Edition {}
- named @HowPublished {}
- named @InAuthor {}
- named @InTitle {}
- named @Institution {}
- named @Journal {}
- named @Keywords {}
- named @Label {}
- named @Month {}
- named @Note {}
- named @Number {}
- named @Organization {}
- named @Page {}
- named @Pages {}
- named @Pinpoint {}
- named @Publisher {}
- named @Title {}
- named @TitleNote {}
- named @TRType {}
- named @Volume {}
- named @Year {}
- named ":" { "\037" }
- { @Tag } # sorting key
-
- named @MakeGlossary { No } # make glossary? Yes or No
- named @GlossaryText { @Null } # initial glossary text
- named @GlossaryFont { } # font for glossary
- named @GlossaryBreak { } # break style for glossary
- named @GlossaryFormat # format for glossary
- named @Name {}
- named @PageNum {}
- named @Body {}
- { +3p @Font @S @Name
- @Right @I { @Word&&page @PageNum }
- @DP @RawIndentedDisplay @Body }
- named @GlossaryGap { @DisplayGap } # gap between glossary items
- named @GlossaryColumnNumber { 2 } # glossary columns (1 to 10)
- named @GlossaryColumnGap { 1.00c @OrIfPlain 6s } # glossary column gap
- named @InGlossaryFont { smallcaps } # font for @InGlossary
- named @InGlossaryFormat right @Body { @Body } # format for @InGlossary
- named @MakeIndex { No } # make index? Yes or No
- named @IndexText { @Null } # initial index text
- named @IndexFont { } # index entries font
- named @IndexBreak { {oragged 1.2fx} @OrIfPlain {oragged 1fx} } # index entries break
- named @IndexFormat
- right @Body { @Body } # @Index format
- named @SubIndexFormat
- right @Body { {1f @Wide}@Body } # @SubIndex format
- named @SubSubIndexFormat
- right @Body { {2f @Wide}@Body } # @SubSubIndex format
- named @IndexColumnNumber { 2 } # index columns (1 to 10)
- named @IndexColumnGap { 1.00c @OrIfPlain 6s } # index column gap
- named @IndexCtd { Yes } # include (ctd.) lines
- named @IndexCtdWord { continued } # "ctd." in current lang
- named @IndexCtdFormat
- left @Body
- right @CtdWord
- { @Body @I (@CtdWord) } # (ctd.) format
- named @IndexSpacerAbove { 2v } # space above index spacer
- named @IndexSpacerBelow { 1v } # space below index spacer
- named @IndexSpacerFont { +3p } # font of index spacer
- named @IndexSpacerFormat
- right @Body { @Body } # format of index spacer
- named @MakeIndexA { No } # make index A? Yes or No
- named @IndexAText { @Null } # initial index text
- named @IndexAFont { } # index A entries font
- named @IndexABreak { {oragged 1.2fx} @OrIfPlain {oragged 1fx} } # index A entries break
- named @IndexAFormat
- right @Body { @Body } # @IndexA format
- named @SubIndexAFormat
- right @Body { {1f @Wide}@Body } # @SubIndexA format
- named @SubSubIndexAFormat
- right @Body { {2f @Wide}@Body } # @SubSubIndexA format
- named @IndexAColumnNumber { 2 } # index A columns (1 to 10)
- named @IndexAColumnGap { 1.00c @OrIfPlain 6s } # index A column gap
- named @IndexACtd { Yes } # include (ctd.) lines
- named @IndexACtdWord { continued } # "ctd." in current lang
- named @IndexACtdFormat
- left @Body
- right @CtdWord
- { @Body @I (@CtdWord) } # (ctd.) format
- named @IndexASpacerAbove { 2v } # space above index A spacer
- named @IndexASpacerBelow { 1v } # space below index A spacer
- named @IndexASpacerFont { +3p } # font of index A spacer
- named @IndexASpacerFormat
- right @Body { @Body } # format of index A spacer
- named @MakeIndexB { No } # make index B? Yes or No
- named @IndexBText { @Null } # initial index text
- named @IndexBFont { } # index B entries font
- named @IndexBBreak { {oragged 1.2fx} @OrIfPlain {oragged 1fx} } # index B entries break
- named @IndexBFormat
- right @Body { @Body } # @IndexB format
- named @SubIndexBFormat
- right @Body { {1f @Wide}@Body } # @SubIndexB format
- named @SubSubIndexBFormat
- right @Body { {2f @Wide}@Body } # @SubSubIndexB format
- named @IndexBColumnNumber { 2 } # index B columns (1 to 10)
- named @IndexBColumnGap { 1.00c @OrIfPlain 6s } # index B column gap
- named @IndexBCtd { Yes } # include (ctd.) lines
- named @IndexBCtdWord { continued } # "ctd." in current lang
- named @IndexBCtdFormat
- left @Body
- right @CtdWord
- { @Body @I (@CtdWord) } # (ctd.) format
- named @IndexBSpacerAbove { 2v } # space above index B spacer
- named @IndexBSpacerBelow { 1v } # space below index B spacer
- named @IndexBSpacerFont { +3p } # font of index B spacer
- named @IndexBSpacerFormat
- right @Body { @Body } # format of index B spacer
- named @TopGap { 0.75c @OrIfPlain 2f } # gap between figures
- named @MidGap { 0.75c @OrIfPlain 2f } # gap above/below body text
-
- named @FootNoteNumbers { Arabic } # footnote numbers
- named @FootNoteThrough { No } # numbered through chapter?
- named @FootNoteLocation { ColFoot } # where the footnote appears
- named @FootNoteFont { 0.80f } # font for footnotes
- named @FootNoteBreak { 1.2fx @OrIfPlain 1fx } # break for footnotes
- named @FootNoteFormat left number right body
- { { number &0.05f } @Insert body } # break for footnotes
- named @FootLen { 2.00c @OrIfPlain 10s } # length of footnote line
- named @FootAboveGap { @DisplayGap } # gap above footnote line
- named @FootGap { 0.20c @OrIfPlain 1fx } # gap between footnotes
-
- named @MarginNoteFont { 0.80f } # font of margin notes
- named @MarginNoteBreak { ragged 1.10fx } # break style of margin notes
- named @MarginNoteHGap { 0.5c } # horizontal gap to notes
- named @MarginNoteVGap { @DisplayGap } # min vertical gap between
- named @MarginNoteWidth { 1.50c } # width of margin notes
-
- named @EndNoteNumbers { Arabic } # endnote numbers
- named @EndNoteFont { 0.80f } # font of endnotes
- named @EndNoteBreak { 1.2fx @OrIfPlain 1fx } # break for endnotes
- named @EndNoteFormat left number right body
- { { number &0.05f } @Insert body } # break for endnotes
- named @EndNoteGap { 0.20c @OrIfPlain 1f } # gap between endnotes
-
- named @TheoremWord { theorem } # "Theorem" word, etc.
- named @TheoremTitleFormat right title
- { (title) } # Theorem title format if present
- named @TheoremFormat named word {} named number {} named title {} named body {} # theorem format
- { { @B { word @NumSep number title: } &2s } @Insert body }
- named @DefinitionWord { definition } # "Definition" word, etc.
- named @DefinitionTitleFormat{ (title) } # Definition title format if present
- named @DefinitionFormat named word {} named number {} named title {} named body {} # definition format
- { { @B { word @NumSep number title: } &2s } @Insert body }
- named @ClaimWord { claim } # "Claim" word, etc.
- named @ClaimTitleFormat { (title) } # Claim title format if present
- named @ClaimFormat named word {} named number {} named title {} named body {} # claim format
- { { @B { word @NumSep number title: } &2s } @Insert body }
- named @PropositionWord { proposition } # "Proposition" word, etc.
- named @PropositionTitleFormat{ (title) } # Proposition title format if present
- named @PropositionFormat named word {} named number {} named title {} named body {} # proposition format
- { { @B { word @NumSep number title: } &2s } @Insert body }
- named @LemmaWord { lemma } # "Lemma" word, etc.
- named @LemmaTitleFormat { (title) } # Lemma title format if present
- named @LemmaFormat named word {} named number {} named title {} named body {} # lemma format
- { { @B { word @NumSep number title: } &2s } @Insert body }
- named @CorollaryWord { corollary } # "Corollary" word, etc.
- named @CorollaryTitleFormat { (title) } # Corollary title format if present
- named @CorollaryFormat named word {} named number {} named title {} named body {} # corollary format
- { { @B { word @NumSep number title: } &2s } @Insert body }
- named @ExampleWord { example } # "Example" word, etc.
- named @ExampleTitleFormat { (title) } # Example title format if present
- named @ExampleFormat named word {} named number {} named title {} named body {} # example format
- { { @B { word @NumSep number title: } &2s } @Insert body }
- named @ProofWord { proof } # "Proof" word, etc.
-
- named @PageHeaders { Simple } # None Simple Titles NoTitles
- named @PageNumbers { Arabic } # page numbers
- named @FirstPageNumber { 1 } # number of first page
- named @IntroPageNumbers { Roman } # intro page numbers
- named @IntroFirstPageNumber { 1 } # number of first intro page
- named @StructPageNums { No } # structured page numbers
-
- named @OddTop right @PageNum { @Centre { - @PageNum - } }
- named @OddFoot right @PageNum { @Null }
- named @EvenTop right @PageNum { @Centre { - @PageNum - } }
- named @EvenFoot right @PageNum { @Null }
- named @StartOddTop right @PageNum { @Null }
- named @StartOddFoot right @PageNum { @Null }
- named @StartEvenTop right @PageNum { @Null }
- named @StartEvenFoot right @PageNum { @Null }
-
- named @IntroOddTop right @PageNum { @Null }
- named @IntroOddFoot right @PageNum { @Centre @PageNum }
- named @IntroEvenTop right @PageNum { @Null }
- named @IntroEvenFoot right @PageNum { @Centre @PageNum }
- named @IntroStartOddTop right @PageNum { @Null }
- named @IntroStartOddFoot right @PageNum { @Null }
- named @IntroStartEvenTop right @PageNum { @Null }
- named @IntroStartEvenFoot right @PageNum { @Null }
-
- named @RunningOddTop
- named @MajorNum {} named @MajorTitle {}
- named @MinorNum {} named @MinorTitle {} right @PageNum
- { @I { @MinorNum @Sep @MinorTitle } @Right @B @PageNum }
-
- named @RunningOddFoot
- named @MajorNum {} named @MajorTitle {}
- named @MinorNum {} named @MinorTitle {} right @PageNum
- { @Null }
-
- named @RunningEvenTop
- named @MajorNum {} named @MajorTitle {}
- named @MinorNum {} named @MinorTitle {} right @PageNum
- { @B @PageNum @Right @I { @MajorNum @Sep @MajorTitle } }
-
- named @RunningEvenFoot
- named @MajorNum {} named @MajorTitle {}
- named @MinorNum {} named @MinorTitle {} right @PageNum
- { @Null }
-
- named @RunningStartOddTop
- named @MajorNum {} named @MajorTitle {}
- named @MinorNum {} named @MinorTitle {} right @PageNum
- { @Null }
-
- named @RunningStartOddFoot
- named @MajorNum {} named @MajorTitle {}
- named @MinorNum {} named @MinorTitle {} right @PageNum
- { @Centre { Bold 0.8f } @Font @PageNum }
-
- named @RunningStartEvenTop
- named @MajorNum {} named @MajorTitle {}
- named @MinorNum {} named @MinorTitle {} right @PageNum
- { @Null }
-
- named @RunningStartEvenFoot
- named @MajorNum {} named @MajorTitle {}
- named @MinorNum {} named @MinorTitle {} right @PageNum
- { @Centre { Bold 0.8f } @Font @PageNum }
-
-
- named @RunningIntroOddTop
- named @MajorNum {} named @MajorTitle {}
- named @MinorNum {} named @MinorTitle {} right @PageNum
- { @Null }
-
- named @RunningIntroOddFoot
- named @MajorNum {} named @MajorTitle {}
- named @MinorNum {} named @MinorTitle {} right @PageNum
- { @Right @PageNum }
-
- named @RunningIntroEvenTop
- named @MajorNum {} named @MajorTitle {}
- named @MinorNum {} named @MinorTitle {} right @PageNum
- { @Null }
-
- named @RunningIntroEvenFoot
- named @MajorNum {} named @MajorTitle {}
- named @MinorNum {} named @MinorTitle {} right @PageNum
- { @PageNum }
-
- named @RunningIntroStartOddTop
- named @MajorNum {} named @MajorTitle {}
- named @MinorNum {} named @MinorTitle {} right @PageNum
- { @Null }
-
- named @RunningIntroStartOddFoot
- named @MajorNum {} named @MajorTitle {}
- named @MinorNum {} named @MinorTitle {} right @PageNum
- { @Null }
-
- named @RunningIntroStartEvenTop
- named @MajorNum {} named @MajorTitle {}
- named @MinorNum {} named @MinorTitle {} right @PageNum
- { @Null }
-
- named @RunningIntroStartEvenFoot
- named @MajorNum {} named @MajorTitle {}
- named @MinorNum {} named @MinorTitle {} right @PageNum
- { @Null }
-
-
-@Begin
-
-
- ###########################################################################
- # #
- # @Protect x #
- # #
- # Like @CNP, this reserves space on the current page or else makes sure #
- # x appears on the following page. Lookahead is proportional to font #
- # size. #
- # #
- ###########################################################################
-
- def @Protect right x { 3.0f @High //0io // x }
-
-
- ###########################################################################
- # #
- # @HLine #
- # #
- # Draws a horizontal line to fill available space. #
- # #
- ###########################################################################
-
- def @HLine
- {
- @BackEnd @Case {
- PlainText @Yield { "-" @PlainGraphic 1f @High }
- PostScript @Yield { {0 0 moveto xsize 0 lineto stroke} @Graphic {} }
- PDF @Yield { {0 0 m __xsize 0 l S} @Graphic {} }
- }
- }
-
-
- ###########################################################################
- # #
- # x @WordVal y #
- # #
- # Returns @Word&&x if x == y, otherwise y. #
- # #
- ###########################################################################
-
- def @WordVal
- left x
- right y
- {
- y @Case {
- x @Yield @Word&&x
- else @Yield y
- }
- }
-
- ###########################################################################
- # #
- # x @Dft y #
- # #
- # This returns x unless its value is "dft", in which case it returns y. #
- # Useful for defaulting the value of one parameter to another. #
- # #
- ###########################################################################
-
- def @Dft
- left x
- right y
- {
- x @Case {
- dft @Yield y
- else @Yield x
- }
- }
-
-
- ###########################################################################
- # #
- # x @Do y #
- # #
- # This returns @Null if x is No or None, otherwise y. #
- # #
- ###########################################################################
-
- def @Do
- left x
- right y
- {
- x @Case {
- { No None } @Yield @Null
- else @Yield y
- }
- }
-
-
- ###########################################################################
- # #
- # x @NoDo y #
- # #
- # Negation of @Do: This returns y if x is No or None, otherwise @Null. #
- # #
- ###########################################################################
-
- def @NoDo
- left x
- right y
- {
- x @Case {
- { No None } @Yield y
- else @Yield @Null
- }
- }
-
-
- ###########################################################################
- # #
- # x @Then y #
- # #
- # This returns the empty object if x is No or None, otherwise y. #
- # #
- ###########################################################################
-
- def @Then
- left x
- right y
- {
- x @Case {
- { No None } @Yield {}
- else @Yield y
- }
- }
-
-
- ###########################################################################
- # #
- # x @NoThen y #
- # #
- # Negation of @Then: returns y if x is No or None, otherwise empty. #
- # #
- ###########################################################################
-
- def @NoThen
- left x
- right y
- {
- x @Case {
- { No None } @Yield y
- else @Yield {}
- }
- }
-
-
- ###########################################################################
- # #
- # Number markers. #
- # #
- ###########################################################################
-
- def @Num
- left numtype
- right num
- {
- numtype @Case {
- None @Yield {}
- Arabic @Yield num
- Roman @Yield @Roman&&num
- UCRoman @Yield @UCRoman&&num
- Alpha @Yield @Alpha&&num
- UCAlpha @Yield @UCAlpha&&num
- }
- }
-
-
- ###########################################################################
- # #
- # @MakePageNum #
- # #
- # Make a page number. #
- # #
- ###########################################################################
-
- def @MakePageNum
- named numbers {}
- named rawnum {}
- named prefix {}
- named owner {}
- {
- def @OwnerNum { @PageMarker&&owner @Open { rawnum } }
-
- def @StructNum { @FirstPageNumber @Plus rawnum @Minus @OwnerNum }
-
- @PageHeaders.@StructPageNums @Case {
- { Titles.Yes NoTitles.Yes } @Yield {
- prefix @Join { numbers @Num @StructNum } }
- else @Yield { numbers @Num rawnum }
- }
- }
-
-
- ###########################################################################
- # #
- # Page size, margins, and boxes. This code culminates in @OddPage x #
- # and @EvenPage x, which produce one odd or even page containing x. #
- # #
- ###########################################################################
-
- def @Width
- {
- @PageType @Case {
- Letter @Yield 612p
- Tabloid @Yield 792p
- Ledger @Yield 1224p
- Legal @Yield 612p
- Statement @Yield 396p
- Executive @Yield 540p
- A3 @Yield 842p
- A4 @Yield 595p
- A5 @Yield 420p
- B4 @Yield 729p
- B5 @Yield 516p
- Folio @Yield 612p
- Quarto @Yield 610p
- 10x14 @Yield 720p
- Other @Yield @PageWidth
- }
- }
-
- def @Height
- {
- @PageType @Case {
- Letter @Yield 792p
- Tabloid @Yield 1224p
- Ledger @Yield 792p
- Legal @Yield 1008p
- Statement @Yield 612p
- Executive @Yield 720p
- A3 @Yield 1190p
- A4 @Yield 842p
- A5 @Yield 595p
- B4 @Yield 1032p
- B5 @Yield 729p
- Folio @Yield 936p
- Quarto @Yield 780p
- 10x14 @Yield 1008p
- Other @Yield @PageHeight
- }
- }
-
- def @OrientedWidth right @Orient
- {
- @Orient @Case {
- { Portrait ReversePortrait } @Yield @Width
- { Landscape ReverseLandscape } @Yield @Height
- }
- }
-
- def @OrientedHeight right @Orient
- {
- @Orient @Case {
- { Portrait ReversePortrait } @Yield @Height
- { Landscape ReverseLandscape } @Yield @Width
- }
- }
-
- def @OrientationAngle right @Orient
- {
- @Orient @Case {
- Portrait @Yield 0d
- Landscape @Yield 90d
- ReversePortrait @Yield 180d
- ReverseLandscape @Yield 270d
- }
- }
-
- def @PageBox right x
- {
- @PageBoxType @Case {
- None @Yield x
- Box @Yield @Box
- margin { @PageBoxMargin }
- paint { @PageBoxPaint }
- linewidth { @PageBoxLineWidth } x
- CurveBox @Yield @CurveBox
- margin { @PageBoxMargin }
- paint { @PageBoxPaint }
- linewidth { @PageBoxLineWidth } x
- ShadowBox @Yield @ShadowBox
- margin { @PageBoxMargin }
- paint { @PageBoxPaint }
- linewidth { @PageBoxLineWidth }
- shadow { @PageBoxShadow } x
- }
- }
-
- def @PageSet right x
- {
-# "LoutPageSet" @Graphic # VT: case PDF produces nothing
- { @BackEnd @Case {
- PostScript @Yield "LoutPageSet"
- else @Yield "% @DoBackground/LoutPageSet UNIMPLEMENTED"
- }
- } @Graphic x
- }
-
- def @MargSet
- left parity
- right x
- {
-# { parity "LoutMargSet" } @Graphic x # VT: case PDF produces nothing
- { @BackEnd @Case {
- PostScript @Yield { parity "LoutMargSet" }
- else @Yield "% @MargSet/LoutMargSet UNIMPLEMENTED"
- }
- } @Graphic x
- }
-
- def @OddPage
- left extra
- named @Orient {}
- right x
- {
- @PageSet
- { @OrientationAngle @Orient } @Rotate
- { @OrientedWidth @Orient } @Wide { @OrientedHeight @Orient } @High
- { //@TopMargin ||@OddLeftMargin
- { // || @PageBackground } @Background
- # 1 @MargSet
- @PageEnclose @PageBox @HExpand { extra // @VExpand x }
- ||@OddRightMargin //@FootMargin
- }
- }
-
- def @EvenPage
- left extra
- named @Orient {}
- right x
- {
- @PageSet
- { @OrientationAngle @Orient } @Rotate
- { @OrientedWidth @Orient } @Wide { @OrientedHeight @Orient } @High
- { //@TopMargin ||@EvenLeftMargin
- { // || @PageBackground } @Background
- # 0 @MargSet
- @PageEnclose @PageBox @HExpand { extra // @VExpand x }
- ||@EvenRightMargin //@FootMargin
- }
- }
-
-
- ###########################################################################
- # #
- # Definitions for page headers and footers. There are 16 symbols here, #
- # in the following arrangement: #
- # #
- # @(- | Running)(- | Intro)(Odd | Even)(Top | Foot)Header #
- # #
- # Running means that running headers are to be used. #
- # Intro means that the header is destined for an introductory page. #
- # Odd or Even means whether the page number will be odd or even. #
- # Top or Foot means whether the header is for the top or foot of page. #
- # #
- ###########################################################################
-
- export @Start @MajorNum @MajorTitle @MinorNum @MinorTitle @Owner @Prefix
- def @Runner
- left @Start
- named @MajorNum {}
- named @MajorTitle {}
- named @MinorNum {}
- named @MinorTitle {}
- named @Owner {}
- named @Prefix {}
- named @Tag {}
- { @Null
- # "(@Runner:"@Start":"@MajorTitle")"
- }
-
- def @DupRunner # duplicate previous runner
- {
- @Runner&&preceding @Open {
- NonStart @Runner
- @MajorNum { @MajorNum }
- @MajorTitle { @MajorTitle }
- @MinorNum { @MinorNum }
- @MinorTitle { @MinorTitle }
- @Owner { @Owner }
- @Prefix { @Prefix }
- }
- }
-
- def @OddTopHeader
- left @PageHeadersAndStart
- right @PageNum
- {
- @PageHeadersAndStart @Case {
- None.Start @Yield @Null
- None.NonStart @Yield @Null
- None.None @Yield @Null
- Simple.Start @Yield @StartOddTop @PageNum
- Simple.NonStart @Yield @OddTop @PageNum
- Simple.None @Yield @Null
- }
- }
-
- def @OddFootHeader
- left @PageHeadersAndStart
- right @PageNum
- {
- @PageHeadersAndStart @Case {
- None.Start @Yield @Null
- None.NonStart @Yield @Null
- None.None @Yield @Null
- Simple.Start @Yield @StartOddFoot @PageNum
- Simple.NonStart @Yield @OddFoot @PageNum
- Simple.None @Yield @Null
- }
- }
-
- def @EvenTopHeader
- left @PageHeadersAndStart
- right @PageNum
- {
- @PageHeadersAndStart @Case {
- None.Start @Yield @Null
- None.NonStart @Yield @Null
- None.None @Yield @Null
- Simple.Start @Yield @StartEvenTop @PageNum
- Simple.NonStart @Yield @EvenTop @PageNum
- Simple.None @Yield @Null
- }
- }
-
- def @EvenFootHeader
- left @PageHeadersAndStart
- right @PageNum
- {
- @PageHeadersAndStart @Case {
- None.Start @Yield @Null
- None.NonStart @Yield @Null
- None.None @Yield @Null
- Simple.Start @Yield @StartEvenFoot @PageNum
- Simple.NonStart @Yield @EvenFoot @PageNum
- Simple.None @Yield @Null
- }
- }
-
- def @IntroOddTopHeader
- left @PageHeadersAndStart
- right @PageNum
- {
- @PageHeadersAndStart @Case {
- None.Start @Yield @Null
- None.NonStart @Yield @Null
- None.None @Yield @Null
- Simple.Start @Yield @IntroStartOddTop @PageNum
- Simple.NonStart @Yield @IntroOddTop @PageNum
- Simple.None @Yield @Null
- }
- }
-
- def @IntroOddFootHeader
- left @PageHeadersAndStart
- right @PageNum
- {
- @PageHeadersAndStart @Case {
- None.Start @Yield @Null
- None.NonStart @Yield @Null
- None.None @Yield @Null
- Simple.Start @Yield @IntroStartOddFoot @PageNum
- Simple.NonStart @Yield @IntroOddFoot @PageNum
- Simple.None @Yield @Null
- }
- }
-
- def @IntroEvenTopHeader
- left @PageHeadersAndStart
- right @PageNum
- {
- @PageHeadersAndStart @Case {
- None.Start @Yield @Null
- None.NonStart @Yield @Null
- None.None @Yield @Null
- Simple.Start @Yield @IntroStartEvenTop @PageNum
- Simple.NonStart @Yield @IntroEvenTop @PageNum
- Simple.None @Yield @Null
- }
- }
-
- def @IntroEvenFootHeader
- left @PageHeadersAndStart
- right @PageNum
- {
- @PageHeadersAndStart @Case {
- None.Start @Yield @Null
- None.NonStart @Yield @Null
- None.None @Yield @Null
- Simple.Start @Yield @IntroStartEvenFoot @PageNum
- Simple.NonStart @Yield @IntroEvenFoot @PageNum
- Simple.None @Yield @Null
- }
- }
-
-
- def @RunningOddTopHeader
- left @PageHeadersAndStart
- named @MajorNum {}
- named @MajorTitle {}
- named @MinorNum {}
- named @MinorTitle {}
- right @PageNum
- {
- @PageHeadersAndStart @Case {
- NoTitles.?? @Yield ??
- NoTitles.Start @Yield @RunningStartOddTop @PageNum
- NoTitles.NonStart @Yield @RunningOddTop @PageNum
- NoTitles.None @Yield @Null
- Titles.?? @Yield ??
- Titles.Start @Yield @RunningStartOddTop
- @MajorNum { @MajorNum } @MajorTitle { @MajorTitle }
- @MinorNum { @MinorNum } @MinorTitle { @MinorTitle }
- @PageNum
- Titles.NonStart @Yield @RunningOddTop
- @MajorNum { @MajorNum } @MajorTitle { @MajorTitle }
- @MinorNum { @MinorNum } @MinorTitle { @MinorTitle }
- @PageNum
- Titles.None @Yield @Null
- }
- }
-
- def @RunningOddFootHeader
- left @PageHeadersAndStart
- named @MajorNum {}
- named @MajorTitle {}
- named @MinorNum {}
- named @MinorTitle {}
- right @PageNum
- {
- @PageHeadersAndStart @Case {
- NoTitles.?? @Yield @Null
- NoTitles.Start @Yield @RunningStartOddFoot @PageNum
- NoTitles.NonStart @Yield @RunningOddFoot @PageNum
- NoTitles.None @Yield @Null
- Titles.?? @Yield @Null
- Titles.Start @Yield @RunningStartOddFoot
- @MajorNum { @MajorNum } @MajorTitle { @MajorTitle }
- @MinorNum { @MinorNum } @MinorTitle { @MinorTitle }
- @PageNum
- Titles.NonStart @Yield @RunningOddFoot
- @MajorNum { @MajorNum } @MajorTitle { @MajorTitle }
- @MinorNum { @MinorNum } @MinorTitle { @MinorTitle }
- @PageNum
- Titles.None @Yield @Null
- }
- }
-
- def @RunningEvenTopHeader
- left @PageHeadersAndStart
- named @MajorNum {}
- named @MajorTitle {}
- named @MinorNum {}
- named @MinorTitle {}
- right @PageNum
- {
- @PageHeadersAndStart @Case {
- NoTitles.?? @Yield ??
- NoTitles.Start @Yield @RunningStartEvenTop @PageNum
- NoTitles.NonStart @Yield @RunningEvenTop @PageNum
- NoTitles.None @Yield @Null
- Titles.?? @Yield ??
- Titles.Start @Yield @RunningStartEvenTop
- @MajorNum { @MajorNum } @MajorTitle { @MajorTitle }
- @MinorNum { @MinorNum } @MinorTitle { @MinorTitle }
- @PageNum
- Titles.NonStart @Yield @RunningEvenTop
- @MajorNum { @MajorNum } @MajorTitle { @MajorTitle }
- @MinorNum { @MinorNum } @MinorTitle { @MinorTitle }
- @PageNum
- Titles.None @Yield @Null
- }
- }
-
- def @RunningEvenFootHeader
- left @PageHeadersAndStart
- named @MajorNum {}
- named @MajorTitle {}
- named @MinorNum {}
- named @MinorTitle {}
- right @PageNum
- {
- @PageHeadersAndStart @Case {
- NoTitles.?? @Yield @Null
- NoTitles.Start @Yield @RunningStartEvenFoot @PageNum
- NoTitles.NonStart @Yield @RunningEvenFoot @PageNum
- NoTitles.None @Yield @Null
- Titles.?? @Yield @Null
- Titles.Start @Yield @RunningStartEvenFoot
- @MajorNum { @MajorNum } @MajorTitle { @MajorTitle }
- @MinorNum { @MinorNum } @MinorTitle { @MinorTitle }
- @PageNum
- Titles.NonStart @Yield @RunningEvenFoot
- @MajorNum { @MajorNum } @MajorTitle { @MajorTitle }
- @MinorNum { @MinorNum } @MinorTitle { @MinorTitle }
- @PageNum
- Titles.None @Yield @Null
- }
- }
-
- def @RunningIntroOddTopHeader
- left @PageHeadersAndStart
- named @MajorNum {}
- named @MajorTitle {}
- named @MinorNum {}
- named @MinorTitle {}
- right @PageNum
- {
- @PageHeadersAndStart @Case {
- NoTitles.?? @Yield ??
- NoTitles.Start @Yield @RunningIntroStartOddTop @PageNum
- NoTitles.NonStart @Yield @RunningIntroOddTop @PageNum
- NoTitles.None @Yield @Null
- Titles.?? @Yield ??
- Titles.Start @Yield @RunningIntroStartOddTop
- @MajorNum { @MajorNum } @MajorTitle { @MajorTitle }
- @MinorNum { @MinorNum } @MinorTitle { @MinorTitle }
- @PageNum
- Titles.NonStart @Yield @RunningIntroOddTop
- @MajorNum { @MajorNum } @MajorTitle { @MajorTitle }
- @MinorNum { @MinorNum } @MinorTitle { @MinorTitle }
- @PageNum
- Titles.None @Yield @Null
- }
- }
-
- def @RunningIntroOddFootHeader
- left @PageHeadersAndStart
- named @MajorNum {}
- named @MajorTitle {}
- named @MinorNum {}
- named @MinorTitle {}
- right @PageNum
- {
- @PageHeadersAndStart @Case {
- NoTitles.?? @Yield @Null
- NoTitles.Start @Yield @RunningIntroStartOddFoot @PageNum
- NoTitles.NonStart @Yield @RunningIntroOddFoot @PageNum
- NoTitles.None @Yield @Null
- Titles.?? @Yield @Null
- Titles.Start @Yield @RunningIntroStartOddFoot
- @MajorNum { @MajorNum } @MajorTitle { @MajorTitle }
- @MinorNum { @MinorNum } @MinorTitle { @MinorTitle }
- @PageNum
- Titles.NonStart @Yield @RunningIntroOddFoot
- @MajorNum { @MajorNum } @MajorTitle { @MajorTitle }
- @MinorNum { @MinorNum } @MinorTitle { @MinorTitle }
- @PageNum
- Titles.None @Yield @Null
- }
- }
-
- def @RunningIntroEvenTopHeader
- left @PageHeadersAndStart
- named @MajorNum {}
- named @MajorTitle {}
- named @MinorNum {}
- named @MinorTitle {}
- right @PageNum
- {
- @PageHeadersAndStart @Case {
- NoTitles.?? @Yield ??
- NoTitles.Start @Yield @RunningIntroStartEvenTop @PageNum
- NoTitles.NonStart @Yield @RunningIntroEvenTop @PageNum
- NoTitles.None @Yield @Null
- Titles.?? @Yield ??
- Titles.Start @Yield @RunningIntroStartEvenTop
- @MajorNum { @MajorNum } @MajorTitle { @MajorTitle }
- @MinorNum { @MinorNum } @MinorTitle { @MinorTitle }
- @PageNum
- Titles.NonStart @Yield @RunningIntroEvenTop
- @MajorNum { @MajorNum } @MajorTitle { @MajorTitle }
- @MinorNum { @MinorNum } @MinorTitle { @MinorTitle }
- @PageNum
- Titles.None @Yield @Null
- }
- }
-
- def @RunningIntroEvenFootHeader
- left @PageHeadersAndStart
- named @MajorNum {}
- named @MajorTitle {}
- named @MinorNum {}
- named @MinorTitle {}
- right @PageNum
- {
- @PageHeadersAndStart @Case {
- NoTitles.?? @Yield @Null
- NoTitles.Start @Yield @RunningIntroStartEvenFoot @PageNum
- NoTitles.NonStart @Yield @RunningIntroEvenFoot @PageNum
- NoTitles.None @Yield @Null
- Titles.?? @Yield @Null
- Titles.Start @Yield @RunningIntroStartEvenFoot
- @MajorNum { @MajorNum } @MajorTitle { @MajorTitle }
- @MinorNum { @MinorNum } @MinorTitle { @MinorTitle }
- @PageNum
- Titles.NonStart @Yield @RunningIntroEvenFoot
- @MajorNum { @MajorNum } @MajorTitle { @MajorTitle }
- @MinorNum { @MinorNum } @MinorTitle { @MinorTitle }
- @PageNum
- Titles.None @Yield @Null
- }
- }
-
-
- ###########################################################################
- # #
- # Helper definitions for laying out pages. #
- # #
- ###########################################################################
-
- def @PageTopPlace { @Galley }
- def @PageFootAndTopPlace { @Galley }
- def @PageFootNotePlace { @Galley }
- def @FullPlace { @Galley }
- def @OddFullPlace { @Galley }
- def @EvenFullPlace { @Galley }
- def @FullPagePlace { @Galley }
- def @EvenFullPagePlace { @Galley }
- def @EvenPagePlace { @Galley }
- def @OddFullPagePlace { @Galley }
- def @ColTopPlace { @Galley }
- def @ColFootAndTopPlace { @Galley }
- def @ColPlace { @Galley }
- def @ColFootNotePlace { @Galley }
- def @IntroFullPlace { @Galley }
- def @IntroOddFullPlace { @Galley }
- def @IntroEvenFullPlace { @Galley }
- def @IntroColPlace { @Galley }
- def @GlossaryPlace { @Galley }
- def @IndexPlace { @Galley }
- def @IndexAPlace { @Galley }
- def @IndexBPlace { @Galley }
- def @AfterLinePlace { @ForceGalley }
-
- def @TryAfterLinePlace right x
- {
- x @Case {
- noforce @Yield @Galley
- force @Yield @ForceGalley
- }
- }
-
- def @EvenFullPageSection
- {
- @OneRow @EvenFullPagePlace
- // @FullPagePlace
- //@MidGap @EvenFullPageSection
- }
-
- def @OddFullPageSection
- {
- @OneRow @OddFullPagePlace
- // @FullPagePlace
- //@MidGap @OddFullPageSection
- }
-
- def @EvenPageTopSect
- {
- @OneRow @EvenPagePlace
- // @PageTopPlace
- //@MidGap @PageFootAndTopPlace
- //@MidGap @EvenPageTopSect
- }
-
- def @OddPageTopSect
- {
- @PageTopPlace
- //@MidGap @PageFootAndTopPlace
- //@MidGap @OddPageTopSect
- }
-
- def @PageOddTopSection right @Orient
- {
- @OddPageTopSect ||{@OrientedWidth @Orient} @FullPlace
- ||{@OrientedWidth @Orient} @OddFullPlace
- }
-
- def @PageEvenTopSection right @Orient
- {
- @EvenPageTopSect ||{@OrientedWidth @Orient} @FullPlace
- ||{@OrientedWidth @Orient} @EvenFullPlace
- }
-
- def @PageIntroOddTopSection right @Orient
- {
- @OddPageTopSect ||{@OrientedWidth @Orient} @IntroFullPlace
- ||{@OrientedWidth @Orient} @IntroOddFullPlace
- }
-
- def @PageIntroEvenTopSection right @Orient
- {
- @EvenPageTopSect
- ||{@OrientedWidth @Orient} @IntroFullPlace
- ||{@OrientedWidth @Orient} @IntroEvenFullPlace
- }
-
- def @PageFootNoteList
- {
- @PageFootNotePlace
- //@FootGap @PageFootNoteList
- }
-
- def @PageFootNoteSection
- {
- @FootLen @Wide @HLine
- //@FootGap @PageFootNoteList
- }
-
- def @PageFootAndTopSect
- {
- @PageFootAndTopPlace
- //@MidGap @PageFootAndTopSect
- }
-
- def @PageFootSection
- {
- //@MidGap @PageFootAndTopSect
- //@FootAboveGap @PageFootNoteSection
- }
-
- def @ColTopSection
- {
- @ColTopPlace
- //@MidGap @ColFootAndTopPlace
- //@MidGap @TryAfterLinePlace noforce
- //@MidGap @ColTopSection
- }
-
- def @RestOfColSection
- {
- @AfterLinePlace
- //@MidGap @TryAfterLinePlace force
- //@MidGap @ColPlace @NotRevealed
- //@MidGap @RestOfColSection
- }
-
- def @IntroRestOfColSection
- {
- @AfterLinePlace
- //@MidGap @TryAfterLinePlace force
- //@MidGap @IntroColPlace @NotRevealed
- //@MidGap @IntroRestOfColSection
- }
-
- def @ColFootAndTopList { @ColFootAndTopPlace //@TopGap @ColFootAndTopList }
-
- def @ColFootNoteList
- {
- @ColFootNotePlace
- //@FootGap @ColFootNoteList
- }
-
- def @ColFootNoteSection
- {
- @FootLen @Wide @HLine
- //@FootGap @ColFootNoteList
- }
-
- def @ColFootSection
- {
- //@TopGap @ColFootAndTopList
- //@FootAboveGap @ColFootNoteSection
- }
-
- def @ColsOf
- left num
- named gap { @ColumnGap }
- right x
- {
- def @Two { x ||gap x }
- def @Four { @Two ||gap @Two }
- def @Eight { @Four ||gap @Four }
-
- num @Case {
- 1 @Yield { x }
- 2 @Yield { @Two }
- 3 @Yield { @Two ||gap x }
- 4 @Yield { @Four }
- 5 @Yield { @Four ||gap x }
- 6 @Yield { @Four ||gap @Two }
- 7 @Yield { @Four ||gap @Two ||gap x }
- 8 @Yield { @Four ||gap @Four }
- 9 @Yield { @Four ||gap @Four ||gap x }
- 10 @Yield { @Four ||gap @Four ||gap @Two }
- }
- }
-
- def @EqualWidth right x { 50c @Wide x } # believe it or not
-
- def @ColList right num
- {
- @HExpand num @ColsOf @EqualWidth @VExpand
- {
- @ColTopSection //@TopGap
- @ColPlace //@MidGap @RestOfColSection // //1rt
- @OneRow { @ColFootSection }
-
- }
- }
-
- def @IntroColList right num
- {
- @HExpand num @ColsOf @EqualWidth @VExpand
- {
- @ColTopSection //@TopGap
- @IntroColPlace //@MidGap @IntroRestOfColSection // //1rt
- @OneRow { @ColFootSection }
- }
- }
-
- def @ZeroColList right num
- {
- @HExpand num @ColsOf @EqualWidth 0c @High @ColPlace
- }
-
- def @ZeroIntroColList right num
- {
- @HExpand num @ColsOf @EqualWidth 0c @High @IntroColPlace
- }
-
- def @GlossaryColList right num
- {
- @HExpand num @ColsOf gap { @GlossaryColumnGap } @EqualWidth @VExpand @GlossaryPlace
- }
-
- def @IndexColList right num
- {
- @HExpand num @ColsOf gap { @IndexColumnGap } @EqualWidth @VExpand @IndexPlace
- }
-
- def @IndexAColList right num
- {
- @HExpand num @ColsOf gap { @IndexAColumnGap } @EqualWidth @VExpand @IndexAPlace
- }
-
- def @IndexBColList right num
- {
- @HExpand num @ColsOf gap { @IndexBColumnGap } @EqualWidth @VExpand @IndexBPlace
- }
-
-
- ###########################################################################
- # #
- # Footnotes. #
- # #
- ###########################################################################
-
- export @Tag count
- def @FootNoteCounterMarker
- named @Tag {}
- named count {}
- {
- @Null
- }
-
- def @FootNoteNum right tag
- {
- @FootNoteCounterMarker&&tag @Open { @Next count }
- }
-
- def @FootNoteCounterIncrement
- right tag
- {
- @FootNoteCounterMarker&&preceding @Tagged tag
- // @FootNoteCounterMarker count { @FootNoteNum tag }
- // @NumberMarker @Tag { tag }
- @Value { @FootNoteNumbers @Num @FootNoteNum tag }
- }
-
- def @BeginFootNoteCounter
- {
- @FootNoteCounterMarker count { 0 }
- }
-
- def @FootNote
- named @Tag {}
- named @Location { @FootNoteLocation }
- named @Another { No }
- named @Label { Numbered }
- right x
- {
-
- def @FootLabelFmt
- right x
- {
- @FootNoteFont @Font @FootNoteBreak @Break
- +0.3v @VShift { Base 0.8f } @Font x
- }
-
- def @FootExtra
- {
- @BackEnd @Case {
- PlainText @Yield ","
- else @Yield @FootLabelFmt ","
- }
- }
-
- def @FootLabel
- {
- @Label @Case {
- "Numbered" @Yield { @BackEnd @Case {
- PlainText @Yield { ({@NumberOf @Tag}) }
- else @Yield @FootLabelFmt @NumberOf @Tag
- } }
- else @Yield { @BackEnd @Case {
- PlainText @Yield @Label
- else @Yield @FootLabelFmt @Label
- } }
- }
- }
-
- def @LongFootLabel
- {
- @Another @Case {
- No @Yield { @FootLabel }
- Yes @Yield { @FootExtra &0iu @FootLabel }
- }
- }
-
- def @FootVal
- {
- @FootNoteFont @Font @FootNoteBreak @Break @Label @Case {
- "Numbered" @Yield {
- { @FootNoteCounterIncrement @Tag & @FootLabel }
- @FootNoteFormat x
- }
- else @Yield { @FootLabel @FootNoteFormat x }
- }
- }
-
- def @PageFootNote into { @PageFootNotePlace&&following } { @FootVal }
- def @ColFootNote into { @ColFootNotePlace&&following } { @FootVal }
-
- @Location @Case {
- ColFoot @Yield { @Null &0iu @LongFootLabel & @ColFootNote }
- PageFoot @Yield { @Null &0iu @LongFootLabel & @PageFootNote }
- }
- }
-
- macro @AnotherFootNote { @FootNote @Another { Yes } }
-
-
- ###########################################################################
- # #
- # Definitions for page lists. There are four symbols here, in the #
- # following arrangement: #
- # #
- # @(Simple | Running)(- | Intro)PageList #
- # #
- # Running means that the page list is to support running headers. #
- # Intro means that the page list is an introductory page list. #
- # These are then packaged into @PageList and @IntroPageList. #
- # #
- ###########################################################################
-
- def @SStart right @PageNum
- {
- @PageNum @Case {
- { 1 0 } @Yield Start
- else @Yield NonStart
- }
- }
-
- def @ChooseColList right colnum
- {
- @OneOf
- {
- @ColList colnum
- @GlossaryColList @GlossaryColumnNumber
- @IndexAColList @IndexAColumnNumber
- @IndexBColList @IndexBColumnNumber
- @IndexColList @IndexColumnNumber
- }
- }
-
- def @ChooseIntroColList right colnum
- {
- @OneOf
- {
- @IntroColList colnum
- @GlossaryColList @GlossaryColumnNumber
- @IndexAColList @IndexAColumnNumber
- @IndexBColList @IndexBColumnNumber
- @IndexColList @IndexColumnNumber
- }
- }
-
- def @OddBodyMargins right x
- {
- @OddLeftBodyMargin @Wide {} || 1 @MargSet x || @OddRightBodyMargin @Wide {}
- }
-
- def @EvenBodyMargins right x
- {
- @EvenLeftBodyMargin @Wide {} || 0 @MargSet x || @EvenRightBodyMargin @Wide {}
- }
-
- def @SimplePageList
- named @ColumnNumber {}
- named @PageHeaders {}
- named extra { No }
- named @Orient {}
- named @AtTop { @Null }
- right @PageNum
- {
-
- def @OrdinaryOddPage
- {
- {@PageHeaders.{@SStart @PageNum}} @OddTopHeader
- { @PageNumbers @Num @PageNum }
- //@MidGap
- @OddBodyMargins {
- @AtTop
- //@MidGap @PageOddTopSection @Orient
- //@MidGap @ChooseColList @ColumnNumber
- }
- //1rt @OneRow
- { // @OddBodyMargins @PageFootSection
- //@MidGap {@PageHeaders.{@SStart @PageNum}} @OddFootHeader
- { @PageNumbers @Num @PageNum }
- }
- }
-
- def @FullPageOddPage
- {
- {@PageHeaders.{@SStart @PageNum}} @OddTopHeader
- { @PageNumbers @Num @PageNum }
- //@MidGap @OddBodyMargins @OddFullPageSection
- //1rt @OneRow
- { //@MidGap {@PageHeaders.{@SStart @PageNum}} @OddFootHeader
- { @PageNumbers @Num @PageNum }
- }
- }
-
- def @SimpleEvenPageList
- named @ColumnNumber {}
- named @PageHeaders {}
- named extra { No }
- right @PageNum
- {
-
- def @OrdinaryEvenPage
- {
- @PageHeaders.NonStart @EvenTopHeader
- { @PageNumbers @Num @PageNum }
- //@MidGap
- @EvenBodyMargins {
- @PageEvenTopSection @Orient
- //@MidGap @ChooseColList @ColumnNumber
- }
- //1rt @OneRow
- { // @EvenBodyMargins @PageFootSection
- //@MidGap @PageHeaders.NonStart @EvenFootHeader
- { @PageNumbers @Num @PageNum }
- }
- }
-
- def @FullPageEvenPage
- {
- @PageHeaders.NonStart @EvenTopHeader
- { @PageNumbers @Num @PageNum }
- //@MidGap @EvenBodyMargins @EvenFullPageSection
- //1rt @OneRow
- { //@MidGap @PageHeaders.NonStart @EvenFootHeader
- { @PageNumbers @Num @PageNum }
- }
- }
-
- @PageMarker
- rawnum { @PageNum }
- num { @PageNumbers @Num @PageNum }
- // @FootNoteThrough @NoDo @BeginFootNoteCounter
- // {} @EvenPage @Orient { @Orient }
- {
- @OrdinaryEvenPage ||{@OrientedWidth @Orient} @FullPageEvenPage
- }
- // @SimplePageList
- @ColumnNumber { @ColumnNumber }
- @PageHeaders { @PageHeaders }
- @Orient { @Orient }
- @Next @PageNum
- }
-
- @PageMarker
- rawnum { @PageNum }
- num { @PageNumbers @Num @PageNum }
- // @FootNoteThrough @NoDo @BeginFootNoteCounter
- // { extra @Then @OddBodyMargins @ZeroColList @ColumnNumber } @OddPage @Orient { @Orient }
- {
- @OrdinaryOddPage ||{@OrientedWidth @Orient} @FullPageOddPage
- }
- // @SimpleEvenPageList
- @ColumnNumber { @ColumnNumber }
- @PageHeaders { @PageHeaders }
- @Next @PageNum
- }
-
- def @SimpleIntroPageList
- named @ColumnNumber {}
- named @PageHeaders {}
- named @Orient {}
- named extra { No }
- named @AtTop { @Null }
- right @PageNum
- {
- @PageMarker
- num { @IntroPageNumbers @Num @PageNum }
- rawnum { @PageNum }
- // @FootNoteThrough @NoDo @BeginFootNoteCounter
- // { extra @Then @OddBodyMargins @ZeroIntroColList @ColumnNumber } @OddPage @Orient { @Orient }
- {
- {@PageHeaders.{@SStart @PageNum}} @IntroOddTopHeader
- { @IntroPageNumbers @Num @PageNum }
- //@MidGap
- @OddBodyMargins {
- @AtTop
- //@MidGap @PageIntroOddTopSection @Orient
- //@MidGap @ChooseIntroColList @ColumnNumber
- }
- //1rt @OneRow
- { // @OddBodyMargins @PageFootSection
- //@MidGap
- {@PageHeaders.{@SStart @PageNum}} @IntroOddFootHeader
- { @IntroPageNumbers @Num @PageNum }
- }
- }
- // @PageMarker
- num { @IntroPageNumbers @Num @Next @PageNum }
- rawnum { @Next @PageNum }
- // @FootNoteThrough @NoDo @BeginFootNoteCounter
- // {} @EvenPage @Orient { @Orient }
- @Runner&&following @Open
- {
- @PageHeaders.NonStart @IntroEvenTopHeader { @IntroPageNumbers @Num @Next @PageNum }
- //@MidGap
- @EvenBodyMargins {
- @PageIntroEvenTopSection @Orient
- //@MidGap @ChooseIntroColList @ColumnNumber
- }
- //1rt @OneRow
- { // @EvenBodyMargins @PageFootSection
- //@MidGap @PageHeaders.NonStart @IntroEvenFootHeader
- { @IntroPageNumbers @Num @Next @PageNum }
- }
- }
- // @SimpleIntroPageList
- @ColumnNumber { @ColumnNumber }
- @PageHeaders { @PageHeaders }
- @Orient { @Orient }
- @Next @Next @PageNum
- }
-
- def @SimpleOddOrEvenIntroPageList
- named @ColumnNumber {}
- named @PageHeaders {}
- named @Orient {}
- named extra { No }
- named @AtTop { @Null }
- right @PageNum
- {
-
- def @SimpleEvenIntroPageList
- named @ColumnNumber {}
- named @PageHeaders {}
- named @Orient {}
- named extra { No }
- named @AtTop { @Null }
- right @PageNum
- {
-
- @PageMarker
- num { @IntroPageNumbers @Num @PageNum }
- rawnum { @PageNum }
- // @FootNoteThrough @NoDo @BeginFootNoteCounter
- // {} @EvenPage @Orient { @Orient }
- @Runner&&following @Open
- {
- @PageHeaders.NonStart @IntroEvenTopHeader { @IntroPageNumbers @Num @PageNum }
- //@MidGap
- @EvenBodyMargins {
- @PageIntroEvenTopSection @Orient
- //@MidGap @ChooseIntroColList @ColumnNumber
- }
- //1rt @OneRow
- { // @EvenBodyMargins @PageFootSection
- //@MidGap @PageHeaders.NonStart @IntroEvenFootHeader
- { @IntroPageNumbers @Num @PageNum }
- }
- }
- // @SimpleOddOrEvenIntroPageList
- @ColumnNumber { @ColumnNumber }
- @PageHeaders { @PageHeaders }
- @Orient { @Orient }
- @Next @PageNum
- }
- @PageMarker
- num { @IntroPageNumbers @Num @PageNum }
- rawnum { @PageNum }
- // @FootNoteThrough @NoDo @BeginFootNoteCounter
- // { extra @Then @OddBodyMargins @ZeroIntroColList @ColumnNumber } @OddPage @Orient { @Orient }
- {
- {@PageHeaders.{@SStart @PageNum}} @IntroOddTopHeader
- { @IntroPageNumbers @Num @PageNum }
- //@MidGap
- @OddBodyMargins {
- @AtTop
- //@MidGap @PageIntroOddTopSection @Orient
- //@MidGap @ChooseIntroColList @ColumnNumber
- }
- //1rt @OneRow
- { // @OddBodyMargins @PageFootSection
- //@MidGap
- {@PageHeaders.{@SStart @PageNum}} @IntroOddFootHeader
- { @IntroPageNumbers @Num @PageNum }
- }
- }
- // @SimpleEvenIntroPageList
- @ColumnNumber { @ColumnNumber }
- @PageHeaders { @PageHeaders }
- @Orient { @Orient }
- @Next @PageNum
- }
-
- def @RunningPageList
- named @ColumnNumber {}
- named @PageHeaders {}
- named extra { No }
- named @Orient {}
- named @AtTop { @Null }
- right @PageNum
- {
-
- def @OrdinaryOddPage
- {
- @Runner&&following @Open
- {
- @PageMarker
- num { @MakePageNum
- numbers { @PageNumbers }
- rawnum { @PageNum }
- prefix { @Prefix }
- owner { @Owner } }
- rawnum { @PageNum }
- // @PageHeaders.@Start @RunningOddTopHeader
- @MajorNum { @MajorNum } @MajorTitle { @MajorTitle }
- @MinorNum { @MinorNum } @MinorTitle { @MinorTitle }
- {
- @MakePageNum
- numbers { @PageNumbers }
- rawnum { @PageNum }
- prefix { @Prefix }
- owner { @Owner }
- }
- //@MidGap
- @OddBodyMargins {
- @AtTop
- //@MidGap @PageOddTopSection @Orient
- //@MidGap @ChooseColList @ColumnNumber
- }
- //1rt @OneRow
- { // @OddBodyMargins @PageFootSection
- //@MidGap @PageHeaders.@Start @RunningOddFootHeader
- @MajorNum { @MajorNum } @MajorTitle { @MajorTitle }
- @MinorNum { @MinorNum } @MinorTitle { @MinorTitle }
- {
- @MakePageNum
- numbers { @PageNumbers }
- rawnum { @PageNum }
- prefix { @Prefix }
- owner { @Owner }
- }
- }
- }
- }
-
- def @FullPageOddPage
- {
- @Runner&&following @Open
- {
- @PageMarker
- num { @MakePageNum
- numbers { @PageNumbers }
- rawnum { @PageNum }
- prefix { @Prefix }
- owner { @Owner } }
- rawnum { @PageNum }
- // @PageHeaders.@Start @RunningOddTopHeader
- @MajorNum { @MajorNum } @MajorTitle { @MajorTitle }
- @MinorNum { @MinorNum } @MinorTitle { @MinorTitle }
- {
- @MakePageNum
- numbers { @PageNumbers }
- rawnum { @PageNum }
- prefix { @Prefix }
- owner { @Owner }
- }
- //@MidGap
- @OddBodyMargins {
- @AtTop
- //@MidGap @OddFullPageSection
- }
- //1rt @OneRow
- {
- //@MidGap @PageHeaders.@Start @RunningOddFootHeader
- @MajorNum { @MajorNum } @MajorTitle { @MajorTitle }
- @MinorNum { @MinorNum } @MinorTitle { @MinorTitle }
- {
- @MakePageNum
- numbers { @PageNumbers }
- rawnum { @PageNum }
- prefix { @Prefix }
- owner { @Owner }
- }
- }
- }
- }
-
- def @RunningEvenPageList
- named @ColumnNumber {}
- named @PageHeaders {}
- right @PageNum
- {
-
- def @OrdinaryEvenPage
- {
- @Runner&&following @Open
- {
- @PageMarker
- num { @MakePageNum
- numbers { @PageNumbers }
- rawnum { @PageNum }
- prefix { @Prefix }
- owner { @Owner } }
- rawnum { @PageNum }
- // @PageHeaders.@Start @RunningEvenTopHeader
- @MajorNum { @MajorNum } @MajorTitle { @MajorTitle }
- @MinorNum { @MinorNum } @MinorTitle { @MinorTitle }
- {
- @MakePageNum
- numbers { @PageNumbers }
- rawnum { @PageNum }
- prefix { @Prefix }
- owner { @Owner }
- }
- //@MidGap
- @EvenBodyMargins {
- @PageEvenTopSection @Orient
- //@MidGap @ChooseColList @ColumnNumber
- }
- //1rt @OneRow
- { // @EvenBodyMargins @PageFootSection
- //@MidGap @PageHeaders.@Start @RunningEvenFootHeader
- @MajorNum { @MajorNum } @MajorTitle { @MajorTitle }
- @MinorNum { @MinorNum } @MinorTitle { @MinorTitle }
- {
- @MakePageNum
- numbers { @PageNumbers }
- rawnum { @PageNum }
- prefix { @Prefix }
- owner { @Owner }
- }
- }
- }
- }
-
- def @FullPageEvenPage
- {
- @Runner&&following @Open
- {
- @PageMarker
- num { @MakePageNum
- numbers { @PageNumbers }
- rawnum { @PageNum }
- prefix { @Prefix }
- owner { @Owner } }
- rawnum { @PageNum }
- // @PageHeaders.@Start @RunningEvenTopHeader
- @MajorNum { @MajorNum } @MajorTitle { @MajorTitle }
- @MinorNum { @MinorNum } @MinorTitle { @MinorTitle }
- {
- @MakePageNum
- numbers { @PageNumbers }
- rawnum { @PageNum }
- prefix { @Prefix }
- owner { @Owner }
- }
- //@MidGap
- @EvenBodyMargins @EvenFullPageSection
- //1rt @OneRow
- {
- //@MidGap @PageHeaders.@Start @RunningEvenFootHeader
- @MajorNum { @MajorNum } @MajorTitle { @MajorTitle }
- @MinorNum { @MinorNum } @MinorTitle { @MinorTitle }
- {
- @MakePageNum
- numbers { @PageNumbers }
- rawnum { @PageNum }
- prefix { @Prefix }
- owner { @Owner }
- }
- }
- }
- }
-
- @FootNoteThrough @NoDo @BeginFootNoteCounter
- // {} @EvenPage @Orient { @Orient }
- {
- @OrdinaryEvenPage ||{@OrientedWidth @Orient} @FullPageEvenPage
- }
- // @RunningPageList
- @ColumnNumber { @ColumnNumber }
- @PageHeaders { @PageHeaders }
- @Orient { @Orient }
- @Next @PageNum
- }
-
- @FootNoteThrough @NoDo @BeginFootNoteCounter
- // { extra @Then @OddBodyMargins @ZeroColList @ColumnNumber } @OddPage @Orient { @Orient }
- {
- @OrdinaryOddPage ||{@OrientedWidth @Orient} @FullPageOddPage
- }
- // @RunningEvenPageList
- @ColumnNumber { @ColumnNumber }
- @PageHeaders { @PageHeaders }
- @Next @PageNum
- }
-
- def @RunningIntroPageList
- named @ColumnNumber {}
- named @PageHeaders {}
- named @AtTop { @Null }
- named @Orient {}
- named extra { No }
- right @PageNum
- {
- @FootNoteThrough @NoDo @BeginFootNoteCounter
- // { extra @Then @OddBodyMargins @ZeroIntroColList @ColumnNumber } @OddPage @Orient { @Orient }
- @Runner&&following @Open
- {
- @PageMarker
- num { @MakePageNum
- numbers { @IntroPageNumbers }
- rawnum { @PageNum }
- prefix { @Prefix }
- owner { @Owner } }
- rawnum { @PageNum }
- // @PageHeaders.@Start @RunningIntroOddTopHeader
- @MajorNum { @MajorNum } @MajorTitle { @MajorTitle }
- @MinorNum { @MinorNum } @MinorTitle { @MinorTitle }
- {
- @MakePageNum
- numbers { @IntroPageNumbers }
- rawnum { @PageNum }
- prefix { @Prefix }
- owner { @Owner }
- }
- //@MidGap
- @OddBodyMargins {
- @AtTop
- //@MidGap @PageIntroOddTopSection @Orient
- //@MidGap @IntroColList @ColumnNumber
- }
- //1rt @OneRow
- { // @OddBodyMargins @PageFootSection
- //@MidGap @PageHeaders.@Start @RunningIntroOddFootHeader
- @MajorNum { @MajorNum } @MajorTitle { @MajorTitle }
- @MinorNum { @MinorNum } @MinorTitle { @MinorTitle }
- {
- @MakePageNum
- numbers { @IntroPageNumbers }
- rawnum { @PageNum }
- prefix { @Prefix }
- owner { @Owner }
- }
- }
- }
- // @FootNoteThrough @NoDo @BeginFootNoteCounter
- // {} @EvenPage @Orient { @Orient }
- @Runner&&following @Open
- {
- @PageMarker
- num { @MakePageNum
- numbers { @IntroPageNumbers }
- rawnum { @Next @PageNum }
- prefix { @Prefix }
- owner { @Owner } }
- rawnum { @Next @PageNum }
- // @PageHeaders.@Start @RunningIntroEvenTopHeader
- @MajorNum { @MajorNum } @MajorTitle { @MajorTitle }
- @MinorNum { @MinorNum } @MinorTitle { @MinorTitle }
- {
- @MakePageNum
- numbers { @IntroPageNumbers }
- rawnum { @Next @PageNum }
- prefix { @Prefix }
- owner { @Owner }
- }
- //@MidGap
- @EvenBodyMargins {
- @PageIntroEvenTopSection @Orient
- //@MidGap @ChooseIntroColList @ColumnNumber
- }
- //1rt @OneRow
- { // @EvenBodyMargins @PageFootSection
- //@MidGap @PageHeaders.@Start @RunningIntroEvenFootHeader
- @MajorNum { @MajorNum } @MajorTitle { @MajorTitle }
- @MinorNum { @MinorNum } @MinorTitle { @MinorTitle }
- {
- @MakePageNum
- numbers { @IntroPageNumbers }
- rawnum { @Next @PageNum }
- prefix { @Prefix }
- owner { @Owner }
- }
- }
- }
- // @RunningIntroPageList
- @PageHeaders { @PageHeaders }
- @ColumnNumber { @ColumnNumber }
- @Orient { @Orient }
- @Next @Next @PageNum
- }
-
- def @PageList
- named @ColumnNumber {}
- named @PageHeaders {}
- named extra { No }
- named @Orient {}
- named @AtTop { @Null }
- right @FirstPageNum
- {
- @PageHeaders @Case {
- { None Simple } @Yield @SimplePageList
- @ColumnNumber { @ColumnNumber }
- @PageHeaders { @PageHeaders }
- @Orient { @Orient }
- extra { extra }
- @AtTop { @AtTop }
- @FirstPageNum
- { Running Titles NoTitles } @Yield @RunningPageList
- @ColumnNumber { @ColumnNumber }
- @PageHeaders { @PageHeaders }
- @Orient { @Orient }
- extra { extra }
- @AtTop { @AtTop }
- @FirstPageNum
- }
- //
- @PageMark last.page
- }
-
- def @IntroPageList
- named @ColumnNumber {}
- named @PageHeaders {}
- named @Orient {}
- named extra { No }
- named @AtTop { @Null }
- right @FirstPageNum
- {
- @PageHeaders @Case {
- { None Simple } @Yield @SimpleIntroPageList
- @ColumnNumber { @ColumnNumber }
- @PageHeaders { @PageHeaders }
- @Orient { @Orient }
- extra { extra }
- @AtTop { @AtTop }
- @FirstPageNum
- { Running Titles NoTitles } @Yield @RunningIntroPageList
- @ColumnNumber { @ColumnNumber }
- @PageHeaders { @PageHeaders }
- @Orient { @Orient }
- extra { extra }
- @AtTop { @AtTop }
- @FirstPageNum
- }
- }
-
- def @ContinuousPageList
- named @Orient {}
- {
- {@OrientedWidth @Orient} @Wide
- { //@TopMargin ||@EvenLeftMargin
- {
- @BeginFootNoteCounter
- // @ColPlace
- //@FootAboveGap @ColFootNoteSection
- //@FootAboveGap @PageFootNoteSection
- }
- ||@EvenRightMargin //@FootMargin
- }
- }
-
-
- ###########################################################################
- # #
- # Table of contents (including lists of figures and tables). #
- # #
- ###########################################################################
-
- def @ContentsItem
- named indent { 0f }
- named crosstag {}
- named number {}
- named title {}
- named pagenum {}
- named pregap { @ContentsGap }
- named postgap { 0c }
- named protect { No }
- {
-# def @Leaders { @ContentsLeader &@ContentsLeaderGap @Leaders }
-
- def @Leaders { @ContentsLeaderGap @Wide {} & @ContentsLeader & @Leaders }
-
- def @OptionalCrossLink right x
- {
- crosstag @Case {
- "" @Yield x
- else @Yield { crosstag @CrossLink x }
- }
- }
-
- def @RightPart
- {
- @ContentsRightWidth @Wide {
- &1rt { @OptionalCrossLink pagenum //0.5vx }
- }
- }
-
-# def @Item
-# {
-# |indent @OptionalCrossLink number @ContentsFormat @HExpand {
-# title & @ContentsLeaderGap @Wide &1rt @OneCol {
-# @Leaders & @RightPart &0io
-# }
-# }
-# |@ContentsRightWidth
-# }
-
- def @Item
- {
- |indent @OptionalCrossLink number @ContentsFormat @HExpand {
- title &1rt @OneCol {
- @Leaders & @RightPart &0io
- }
- }
- |@ContentsRightWidth
- }
-
- //pregap
- //0.5vx
- protect @Case {
- No @Yield @Item
- Yes @Yield @Protect @Item
- }
- //postgap
- }
-
- def @ContentsPlace { @Galley }
- def @FigureContentsPlace { @Galley }
- def @TableContentsPlace { @Galley }
-
- def @SendContents into { @ContentsPlace&&foll_or_prec }
- right x
- {
- x
- }
-
- def @SendFigureContents into { @FigureContentsPlace&&foll_or_prec }
- right x
- {
- x
- }
-
- def @SendTableContents into { @TableContentsPlace&&foll_or_prec }
- right x
- {
- x
- }
-
- def @ContentsEntry
- left wanted
- named indent { 0f }
- named crosstag {}
- named number {}
- named title {}
- named pagenum {}
- named pregap { @ContentsGap }
- named postgap { 0c }
- {
- @MakeContents.wanted @Case {
- Yes.Yes @Yield { @SendContents @ContentsItem
- indent { indent }
- crosstag { crosstag }
- number { number }
- title { title }
- pagenum { pagenum }
- pregap { pregap }
- postgap { postgap }
- }
- else @Yield @Null
- }
- }
-
- def @FigureContentsEntry
- left wanted
- named indent { 0f }
- named crosstag {}
- named number {}
- named title {}
- named pagenum {}
- named pregap { @ContentsGap }
- named postgap { 0c }
- {
- @MakeFigureContents.wanted @Case {
- Yes.Yes @Yield { @SendFigureContents @ContentsItem
- indent { indent }
- crosstag { crosstag }
- number { number }
- title { title }
- pagenum { pagenum }
- pregap { pregap }
- postgap { postgap }
- }
- else @Yield @Null
- }
- }
-
- def @TableContentsEntry
- left wanted
- named indent { 0f }
- named crosstag {}
- named number {}
- named title {}
- named pagenum {}
- named pregap { @ContentsGap }
- named postgap { 0c }
- {
- @MakeTableContents.wanted @Case {
- Yes.Yes @Yield { @SendTableContents @ContentsItem
- indent { indent }
- crosstag { crosstag }
- number { number }
- title { title }
- pagenum { pagenum }
- pregap { pregap }
- postgap { postgap }
- }
- else @Yield @Null
- }
- }
-
- def @MajorContentsEntry
- left wanted
- named indent { 0f }
- named crosstag {}
- named number {}
- named title {}
- named pagenum {}
- named pregap { @ContentsGapAbove }
- named postgap { @ContentsGapBelow }
- {
- @MakeContents.wanted @Case {
- Yes.Yes @Yield { @SendContents @ContentsItem
- indent { indent }
- crosstag { crosstag }
- number { @ContentsFont @Font number }
- title { @ContentsFont @Font title }
- pagenum { pagenum }
- pregap { pregap }
- postgap { postgap }
- protect { Yes }
- }
- else @Yield @Null
- }
- }
-
- def @VeryMajorContentsEntry
- left wanted
- named indent { 0.5rt }
- named title {}
- named pregap { @ContentsPartGapAbove }
- named postgap { @ContentsPartGapBelow }
- {
- def item
- {
- //pregap
- //0.5vx
- |indent @ContentsFont @Font @OneCol title |
- //0.5vx
- //postgap
- }
-
- @MakeContents.wanted @Case {
- Yes.Yes @Yield @SendContents item
- else @Yield @Null
- }
-
- }
-
- def @ContentsSection
- {
- def @ContentsList { @ContentsPlace // @ContentsList }
-
- @MakeContents @Case {
- { Yes Bypass } @Yield @ContentsList
- else @Yield @Null
- }
- }
-
- def @FigureContentsSection
- {
- def @FigureContentsList { @FigureContentsPlace // @FigureContentsList }
-
- @MakeFigureContents @Case {
- { Yes Bypass } @Yield @FigureContentsList
- else @Yield @Null
- }
- }
-
- def @TableContentsSection
- {
- def @TableContentsList { @TableContentsPlace // @TableContentsList }
-
- @MakeTableContents @Case {
- { Yes Bypass } @Yield @TableContentsList
- else @Yield @Null
- }
- }
-
- ###########################################################################
- # #
- # Bypass table of contents. #
- # #
- ###########################################################################
-
- def @BypassContentsEntry into { @ContentsPlace&&preceding }
- named indent { 0f }
- named crosstag {}
- named number {}
- named title {}
- named pagenum {}
- {
- @MakeContents @Case {
- Bypass @Yield { @ContentsItem
- indent { indent }
- crosstag { crosstag }
- number { number }
- title { title }
- pagenum { pagenum }
- pregap { @ContentsGap }
- postgap { 0c }
- }
- else @Yield @Null
- }
- }
-
- def @BypassFigureContentsEntry into { @FigureContentsPlace&&preceding }
- named indent { 0f }
- named crosstag {}
- named number {}
- named title {}
- named pagenum {}
- {
- @MakeFigureContents @Case {
- Bypass @Yield { @ContentsItem
- indent { indent }
- crosstag { crosstag }
- number { number }
- title { title }
- pagenum { pagenum }
- pregap { @ContentsGap }
- postgap { 0c }
- }
- else @Yield @Null
- }
- }
-
- def @BypassTableContentsEntry into { @TableContentsPlace&&preceding }
- named indent { 0f }
- named crosstag {}
- named number {}
- named title {}
- named pagenum {}
- {
- @MakeTableContents @Case {
- Bypass @Yield { @ContentsItem
- indent { indent }
- crosstag { crosstag }
- number { number }
- title { title }
- pagenum { pagenum }
- pregap { @ContentsGap }
- postgap { 0c }
- }
- else @Yield @Null
- }
- }
-
- def @BypassMajorContentsEntry into { @ContentsPlace&&preceding }
- named indent { 0f }
- named crosstag {}
- named number {}
- named title {}
- named pagenum {}
- {
- @MakeContents @Case {
- Bypass @Yield { @ContentsItem
- indent { indent }
- crosstag { crosstag }
- number { @B number }
- title { @B title }
- pagenum { pagenum }
- pregap { @ContentsGapAbove }
- postgap { @ContentsGapBelow }
- }
- else @Yield @Null
- }
- }
-
-
- ###########################################################################
- # #
- # Endnotes. #
- # #
- ###########################################################################
-
- export num
- def @EndNoteList
- named @Tag {}
- right num
- {
- @Galley //@EndNoteGap @EndNoteList @Next num
- }
-
- def endtag right num
- {
- @BackEnd @Case {
- PlainText @Yield {
- ({@EndNoteNumbers @Num num})
- }
- else @Yield {
- +0.3v @VShift 0.8f @Font @EndNoteNumbers @Num num
- }
- }
- }
-
- def @EndNote
- named @Tag {}
- right x
- {
- def ftag
- {
- @EndNoteFont @Font @EndNoteList&&@Tag @Open { endtag num }
- }
-
- def @ENote into { @EndNoteList&&following }
- {
- @EndNoteFont @Font @EndNoteBreak @Break
- { { @EndNoteList&&preceding @Tagged @Tag ftag } @EndNoteFormat x }
- }
-
- @Null & @EndNoteFont @Font ftag & @ENote
- }
-
-
- ###########################################################################
- # #
- # Margin Notes. #
- # #
- ###########################################################################
-
- def @ZeroSize right x
- {
- @HContract @VContract { ^/0io |0io @OneCol @OneRow x |0io /0io }
- }
-
- def @MargPut
- left parity
- right x
- {
- @MarginNoteFont @Font @MarginNoteBreak @Break @ZeroSize {
- @BackEnd @Case {
- PlainText @Yield ""
- PostScript @Yield {
- { parity "LoutMargShift gsave" // "grestore" } @Graphic
- {
- |@MarginNoteHGap @MarginNoteWidth @Wide @OneRow x
- |@MarginNoteHGap //@MarginNoteVGap
- }
- }
- PDF @Yield { "% @MargPut/LoutMargShift UNIMPLEMENTED" @Graphic {
- |@MarginNoteHGap @MarginNoteWidth @Wide @OneRow x
- |@MarginNoteHGap //@MarginNoteVGap
- } # VT: PDF currently has no output
- }
- }
- }
- }
-
- def @LeftNote right x { @Null & 0 @MargPut x }
- def @RightNote right x { @Null & 1 @MargPut x }
- def @OuterNote right x { @Null & 2 @MargPut x }
- def @InnerNote right x { @Null & 3 @MargPut x }
-
-
- ###########################################################################
- # #
- # @Place: places an object at an arbitrary point on the page. #
- # #
- ###########################################################################
-
-#
-# VT: the expressions in the braces will work for PostScript but not for PDF
-# they should be modified in the way the "named c { " cm" }" blocks were modified above
-# but since the point of @Place is to output a matrix (?), I have not implemented this change
-#
- def @Place
- import @PSLengths named x
- named "+" precedence 96 associativity left left a right b { a b "add" }
- named "-" precedence 96 associativity left left a right b { a b "sub" }
- named "/" precedence 97 associativity left left a right b { a b "div" }
- named "*" precedence 98 associativity left left a right b { a b "mul" }
- # named c precedence 99 left a { a "cm" }
- # named i precedence 99 left a { a "in" }
- # named e precedence 99 left a { a "em" }
- # named p precedence 99 left a { a "pt" }
- # named f precedence 99 left a { a "ft" }
- # named s precedence 99 left a { a "sp" }
- # named v precedence 99 left a { a "vs" }
- # named cm precedence 99 left a { a "cm" }
- # named in precedence 99 left a { a "in" }
- # named em precedence 99 left a { a "em" }
- # named pt precedence 99 left a { a "pt" }
- # named ft precedence 99 left a { a "ft" }
- # named sp precedence 99 left a { a "sp" }
- # named vs precedence 99 left a { a "vs" }
- { 0 }
- import @PSLengths named y
- named "+" precedence 96 associativity left left a right b { a b "add" }
- named "-" precedence 96 associativity left left a right b { a b "sub" }
- named "/" precedence 97 associativity left left a right b { a b "div" }
- named "*" precedence 98 associativity left left a right b { a b "mul" }
- # named c precedence 99 left a { a "cm" }
- # named i precedence 99 left a { a "in" }
- # named e precedence 99 left a { a "em" }
- # named p precedence 99 left a { a "pt" }
- # named f precedence 99 left a { a "ft" }
- # named s precedence 99 left a { a "sp" }
- # named v precedence 99 left a { a "vs" }
- # named cm precedence 99 left a { a "cm" }
- # named in precedence 99 left a { a "in" }
- # named em precedence 99 left a { a "em" }
- # named pt precedence 99 left a { a "pt" }
- # named ft precedence 99 left a { a "ft" }
- # named sp precedence 99 left a { a "sp" }
- # named vs precedence 99 left a { a "vs" }
- { 0 }
- right val
- {
- @ZeroSize {
- @BackEnd @Case {
- PlainText @Yield ""
- PostScript @Yield {
- { "LoutPageDict begin matr setmatrix" x y "translate end gsave"
- // "grestore" } @Graphic val
- }
- else @Yield { { "% @Place UNIMPLEMENTED" } @Graphic val # VT: PDF currently has no output
- }
- }
- }
- }
-
-
- ###########################################################################
- # #
- # @Theorem, @Proof, and @EndProof #
- # #
- ###########################################################################
-
- export @Tag val
- def @TheoremCounterMarker
- named @Tag {}
- named val {}
- {
- @Null
- }
-
- def @BeginTheoremCounter
- right prefix
- {
- @TheoremCounterMarker val { prefix @Join 0 }
- }
-
- def @TheoremNum right tag
- {
- @TheoremCounterMarker&&tag @Open { @Next val }
- }
-
- def @TheoremCounterIncrement
- right tag
- {
- @TheoremCounterMarker&&preceding @Tagged tag
- @TheoremCounterMarker val { @TheoremNum tag }
- @NumberMarker @Tag { tag } @Value { @TheoremNum tag }
- }
-
- def @Theorem
- named @Tag {}
- named @Title {}
- right x
- {
- def @TheoremTitle
- {
- @Title @Case {
- "" @Yield @Null
- else @Yield @TheoremTitleFormat @Title
- }
- }
-
- { @PageMark @Tag & @TheoremCounterIncrement @Tag } @Insert
- @TheoremFormat
- word { theorem @WordVal @TheoremWord }
- number { @TheoremNum @Tag }
- title { @TheoremTitle }
- body { x }
- }
-
- macro @Proof { @B { {proof @WordVal @ProofWord}: } &2s }
-
- macro @EndProof { &1rt @Box {} }
-
-
- ###########################################################################
- # #
- # @Definition #
- # #
- ###########################################################################
-
- export @Tag val
- def @DefinitionCounterMarker
- named @Tag {}
- named val {}
- {
- @Null
- }
-
- def @BeginDefinitionCounter
- right prefix
- {
- @DefinitionCounterMarker val { prefix @Join 0 }
- }
-
- def @DefinitionNum right tag
- {
- @DefinitionCounterMarker&&tag @Open { @Next val }
- }
-
- def @DefinitionCounterIncrement
- right tag
- {
- @DefinitionCounterMarker&&preceding @Tagged tag
- @DefinitionCounterMarker val { @DefinitionNum tag }
- @NumberMarker @Tag { tag } @Value { @DefinitionNum tag }
- }
-
- def @Definition
- named @Tag {}
- named @Title {}
- right x
- {
- def @DefinitionTitle
- {
- @Title @Case {
- "" @Yield @Null
- else @Yield (@Title)
- }
- }
-
- { @PageMark @Tag & @DefinitionCounterIncrement @Tag } @Insert
- @DefinitionFormat
- word { definition @WordVal @DefinitionWord }
- number { @DefinitionNum @Tag }
- title { @DefinitionTitle }
- body { x }
- }
-
-
- ###########################################################################
- # #
- # @Claim #
- # #
- ###########################################################################
-
- export @Tag val
- def @ClaimCounterMarker
- named @Tag {}
- named val {}
- {
- @Null
- }
-
- def @BeginClaimCounter
- right prefix
- {
- @ClaimCounterMarker val { prefix @Join 0 }
- }
-
- def @ClaimNum right tag
- {
- @ClaimCounterMarker&&tag @Open { @Next val }
- }
-
- def @ClaimCounterIncrement
- right tag
- {
- @ClaimCounterMarker&&preceding @Tagged tag
- @ClaimCounterMarker val { @ClaimNum tag }
- @NumberMarker @Tag { tag } @Value { @ClaimNum tag }
- }
-
- def @Claim
- named @Tag {}
- named @Title {}
- right x
- {
- def @ClaimTitle
- {
- @Title @Case {
- "" @Yield @Null
- else @Yield (@Title)
- }
- }
-
- { @PageMark @Tag & @ClaimCounterIncrement @Tag } @Insert
- @ClaimFormat
- word { claim @WordVal @ClaimWord }
- number { @ClaimNum @Tag }
- title { @ClaimTitle }
- body { x }
- }
-
-
- ###########################################################################
- # #
- # @Proposition #
- # #
- ###########################################################################
-
- export @Tag val
- def @PropositionCounterMarker
- named @Tag {}
- named val {}
- {
- @Null
- }
-
- def @BeginPropositionCounter
- right prefix
- {
- @PropositionCounterMarker val { prefix @Join 0 }
- }
-
- def @PropositionNum right tag
- {
- @PropositionCounterMarker&&tag @Open { @Next val }
- }
-
- def @PropositionCounterIncrement
- right tag
- {
- @PropositionCounterMarker&&preceding @Tagged tag
- @PropositionCounterMarker val { @PropositionNum tag }
- @NumberMarker @Tag { tag } @Value { @PropositionNum tag }
- }
-
- def @Proposition
- named @Tag {}
- named @Title {}
- right x
- {
- def @PropositionTitle
- {
- @Title @Case {
- "" @Yield @Null
- else @Yield (@Title)
- }
- }
-
- { @PageMark @Tag & @PropositionCounterIncrement @Tag } @Insert
- @PropositionFormat
- word { proposition @WordVal @PropositionWord }
- number { @PropositionNum @Tag }
- title { @PropositionTitle }
- body { x }
- }
-
-
- ###########################################################################
- # #
- # @Lemma #
- # #
- ###########################################################################
-
- export @Tag val
- def @LemmaCounterMarker
- named @Tag {}
- named val {}
- {
- @Null
- }
-
- def @BeginLemmaCounter
- right prefix
- {
- @LemmaCounterMarker val { prefix @Join 0 }
- }
-
- def @LemmaNum right tag
- {
- @LemmaCounterMarker&&tag @Open { @Next val }
- }
-
- def @LemmaCounterIncrement
- right tag
- {
- @LemmaCounterMarker&&preceding @Tagged tag
- @LemmaCounterMarker val { @LemmaNum tag }
- @NumberMarker @Tag { tag } @Value { @LemmaNum tag }
- }
-
- def @Lemma
- named @Tag {}
- named @Title {}
- right x
- {
- def @LemmaTitle
- {
- @Title @Case {
- "" @Yield @Null
- else @Yield (@Title)
- }
- }
-
- { @PageMark @Tag & @LemmaCounterIncrement @Tag } @Insert
- @LemmaFormat
- word { lemma @WordVal @LemmaWord }
- number { @LemmaNum @Tag }
- title { @LemmaTitle }
- body { x }
- }
-
-
- ###########################################################################
- # #
- # @Corollary #
- # #
- ###########################################################################
-
- export @Tag val
- def @CorollaryCounterMarker
- named @Tag {}
- named val {}
- {
- @Null
- }
-
- def @BeginCorollaryCounter
- right prefix
- {
- @CorollaryCounterMarker val { prefix @Join 0 }
- }
-
- def @CorollaryNum right tag
- {
- @CorollaryCounterMarker&&tag @Open { @Next val }
- }
-
- def @CorollaryCounterIncrement
- right tag
- {
- @CorollaryCounterMarker&&preceding @Tagged tag
- @CorollaryCounterMarker val { @CorollaryNum tag }
- @NumberMarker @Tag { tag } @Value { @CorollaryNum tag }
- }
-
- def @Corollary
- named @Tag {}
- named @Title {}
- right x
- {
- def @CorollaryTitle
- {
- @Title @Case {
- "" @Yield @Null
- else @Yield (@Title)
- }
- }
-
- { @PageMark @Tag & @CorollaryCounterIncrement @Tag } @Insert
- @CorollaryFormat
- word { corollary @WordVal @CorollaryWord }
- number { @CorollaryNum @Tag }
- title { @CorollaryTitle }
- body { x }
- }
-
-
- ###########################################################################
- # #
- # @Example #
- # #
- ###########################################################################
-
- export @Tag val
- def @ExampleCounterMarker
- named @Tag {}
- named val {}
- {
- @Null
- }
-
- def @BeginExampleCounter
- right prefix
- {
- @ExampleCounterMarker val { prefix @Join 0 }
- }
-
- def @ExampleNum right tag
- {
- @ExampleCounterMarker&&tag @Open { @Next val }
- }
-
- def @ExampleCounterIncrement
- right tag
- {
- @ExampleCounterMarker&&preceding @Tagged tag
- @ExampleCounterMarker val { @ExampleNum tag }
- @NumberMarker @Tag { tag } @Value { @ExampleNum tag }
- }
-
- def @Example
- named @Tag {}
- named @Title {}
- right x
- {
- def @ExampleTitle
- {
- @Title @Case {
- "" @Yield @Null
- else @Yield (@Title)
- }
- }
-
- { @PageMark @Tag & @ExampleCounterIncrement @Tag } @Insert
- @ExampleFormat
- word { example @WordVal @ExampleWord }
- number { @ExampleNum @Tag }
- title { @ExampleTitle }
- body { x }
- }
-
-
- ###########################################################################
- # #
- # @BeginAllCounters - begin all counters #
- # #
- ###########################################################################
-
- def @BeginAllCounters
- left condition
- right prefix
- {
- condition @Do {
- @BeginTheoremCounter prefix
- // @BeginDefinitionCounter prefix
- // @BeginClaimCounter prefix
- // @BeginPropositionCounter prefix
- // @BeginLemmaCounter prefix
- // @BeginCorollaryCounter prefix
- // @BeginExampleCounter prefix
- }
- }
-
-
- ###########################################################################
- # #
- # @Reference - a reference. #
- # #
- ###########################################################################
-
- export @Tag @Type @Abstract @Address @Annote @Author @Day @Edition
- @HowPublished @InAuthor @InTitle @Institution @Journal @Keywords
- @Label @Month @Note @Number @Organization @Page @Pages @Pinpoint
- @Publisher @Title @TitleNote @TRType @URL @Volume @Year
-
- def @Reference
- named compulsory @Tag {}
- named compulsory @Type {}
- named @Abstract {}
- named @Address {}
- named @Annote {}
- named @Author {}
- named @Day {}
- named @Edition {}
- named @HowPublished {}
- named @InAuthor {}
- named @InTitle {}
- named @Institution {}
- named @Journal {}
- named @Keywords {}
- named @Label {}
- named @Month {}
- named @Note {}
- named @Number {}
- named @Organization {}
- named @Page {}
- named @Pages {}
- named @Pinpoint {}
- named @Publisher {}
- named @Title {}
- named @TitleNote {}
- named @TRType {}
- named @URL
- named "~" { "~" }
- named "/" { "/" &0p }
- named "//" { "//" &0p } {}
- named @Volume {}
- named @Year {}
- { @Null }
-
-
- ###########################################################################
- # #
- # @CiteLabel - the value of the label of a reference within a citation. #
- # #
- ###########################################################################
-
- def @CiteLabel
- left label
- right tag
- {
- tag @CrossLink @RefCiteLabels
- @RefNum { @NumberOf tag }
- @Tag { tag }
- @Type { @Reference&&tag @Open { @Type } }
- @Abstract { @Reference&&tag @Open { @Abstract } }
- @Address { @Reference&&tag @Open { @Address } }
- @Annote { @Reference&&tag @Open { @Annote } }
- @Author { @Reference&&tag @Open { @Author } }
- @Day { @Reference&&tag @Open { @Day } }
- @Edition { @Reference&&tag @Open { @Edition } }
- @HowPublished { @Reference&&tag @Open { @HowPublished } }
- @InAuthor { @Reference&&tag @Open { @InAuthor } }
- @InTitle { @Reference&&tag @Open { @InTitle } }
- @Institution { @Reference&&tag @Open { @Institution } }
- @Journal { @Reference&&tag @Open { @Journal } }
- @Keywords { @Reference&&tag @Open { @Keywords } }
-
- @Label { label @Case {
- "" @Yield {@Reference&&tag @Open {@Label}}
- else @Yield label
- } }
-
- @Month { @Reference&&tag @Open { @Month } }
- @Note { @Reference&&tag @Open { @Note } }
- @Number { @Reference&&tag @Open { @Number } }
- @Organization { @Reference&&tag @Open { @Organization } }
- @Page { @Reference&&tag @Open { @Page } }
- @Pages { @Reference&&tag @Open { @Pages } }
- @Pinpoint { @Reference&&tag @Open { @Pinpoint } }
- @Publisher { @Reference&&tag @Open { @Publisher } }
- @Title { @Reference&&tag @Open { @Title } }
- @TitleNote { @Reference&&tag @Open { @TitleNote } }
- @TRType { @Reference&&tag @Open { @TRType } }
- @Volume { @Reference&&tag @Open { @Volume } }
- @Year { @Reference&&tag @Open { @Year } }
- }
-
-
- ###########################################################################
- # #
- # @ListLabel - the value of the label of a reference within a ref list. #
- # #
- ###########################################################################
-
- def @ListLabel
- left label
- right tag
- {
- @RefListLabels
- @RefNum { @NumberOf tag }
- @Tag { tag }
- @Type { @Reference&&tag @Open { @Type } }
- @Abstract { @Reference&&tag @Open { @Abstract } }
- @Address { @Reference&&tag @Open { @Address } }
- @Annote { @Reference&&tag @Open { @Annote } }
- @Author { @Reference&&tag @Open { @Author } }
- @Day { @Reference&&tag @Open { @Day } }
- @Edition { @Reference&&tag @Open { @Edition } }
- @HowPublished { @Reference&&tag @Open { @HowPublished } }
- @InAuthor { @Reference&&tag @Open { @InAuthor } }
- @InTitle { @Reference&&tag @Open { @InTitle } }
- @Institution { @Reference&&tag @Open { @Institution } }
- @Journal { @Reference&&tag @Open { @Journal } }
- @Keywords { @Reference&&tag @Open { @Keywords } }
-
- @Label { label @Case {
- "" @Yield {@Reference&&tag @Open {@Label}}
- else @Yield label
- } }
-
- @Month { @Reference&&tag @Open { @Month } }
- @Note { @Reference&&tag @Open { @Note } }
- @Number { @Reference&&tag @Open { @Number } }
- @Organization { @Reference&&tag @Open { @Organization } }
- @Page { @Reference&&tag @Open { @Page } }
- @Pages { @Reference&&tag @Open { @Pages } }
- @Pinpoint { @Reference&&tag @Open { @Pinpoint } }
- @Publisher { @Reference&&tag @Open { @Publisher } }
- @Title { @Reference&&tag @Open { @Title } }
- @TitleNote { @Reference&&tag @Open { @TitleNote } }
- @TRType { @Reference&&tag @Open { @TRType } }
- @Volume { @Reference&&tag @Open { @Volume } }
- @Year { @Reference&&tag @Open { @Year } }
- }
-
-
- ###########################################################################
- # #
- # @SortKey - the value of the sort key of a reference. #
- # #
- ###########################################################################
-
- def @SortKey
- left label
- right tag
- {
- @RefListSortKey
- @Tag { tag }
- @Type { @Reference&&tag @Open { @Type } }
- @Abstract { @Reference&&tag @Open { @Abstract } }
- @Address { @Reference&&tag @Open { @Address } }
- @Annote { @Reference&&tag @Open { @Annote } }
- @Author { @Reference&&tag @Open { @Author } }
-
- @CiteOrder { {@NumberOf tag} @Case {
- "??" @Yield "??"
- else @Yield { "1000" @Plus @NumberOf tag }
- }
- }
-
- @Day { @Reference&&tag @Open { @Day } }
- @Edition { @Reference&&tag @Open { @Edition } }
- @HowPublished { @Reference&&tag @Open { @HowPublished } }
- @InAuthor { @Reference&&tag @Open { @InAuthor } }
- @InTitle { @Reference&&tag @Open { @InTitle } }
- @Institution { @Reference&&tag @Open { @Institution } }
- @Journal { @Reference&&tag @Open { @Journal } }
- @Keywords { @Reference&&tag @Open { @Keywords } }
-
- @Label { label @Case {
- "" @Yield {@Reference&&tag @Open {@Label}}
- else @Yield label
- }
- }
-
- @Month { @Reference&&tag @Open { @Month } }
- @Note { @Reference&&tag @Open { @Note } }
- @Number { @Reference&&tag @Open { @Number } }
- @Organization { @Reference&&tag @Open { @Organization } }
- @Page { @Reference&&tag @Open { @Page } }
- @Pages { @Reference&&tag @Open { @Pages } }
- @Pinpoint { @Reference&&tag @Open { @Pinpoint } }
- @Publisher { @Reference&&tag @Open { @Publisher } }
- @Title { @Reference&&tag @Open { @Title } }
- @TitleNote { @Reference&&tag @Open { @TitleNote } }
- @TRType { @Reference&&tag @Open { @TRType } }
- @Volume { @Reference&&tag @Open { @Volume } }
- @Year { @Reference&&tag @Open { @Year } }
- }
-
-
- ###########################################################################
- # #
- # @RefStyle - a reference printing style. #
- # #
- ###########################################################################
-
- export @Style
- def @RefStyle
- left @Tag
- named @Style right reftag {}
- {}
-
-
- ###########################################################################
- # #
- # @RefPrint - prints reference with tag reftag in appropriate style. #
- # #
- ###########################################################################
-
- def @RefPrint right reftag
- { & @RefStyle&&{ @Reference&&reftag @Open { @Type } }
- @Open { @Style reftag } &
- }
-
-
- ###########################################################################
- # #
- # @ReferencesSection and @ChapReferencesSection - a list of references. #
- # #
- ###########################################################################
-
- def @RefPlace { @Galley }
- def @ChapRefPlace { @Galley }
-
- def @BypassRefPlace { @Galley }
- def @BypassChapRefPlace { @Galley }
-
- def @ReferencesSection
- {
- def @RefList right num
- {
- @NumberMarker @Value { @RefNumbers @Num num } & | @RefPlace
- //@RefListGap @RefList @Next num
- }
-
- def @BypassRefList
- {
- @BypassRefPlace //@RefListGap @BypassRefList
- }
-
- @RefList 1
- //@RefListGap
- @BypassRefList
- }
-
- def @ChapReferencesSection
- {
- def @ChapRefList right num
- {
- @NumberMarker @Value { @RefNumbers @Num num } & | @ChapRefPlace
- //@RefListGap @ChapRefList @Next num
- }
-
- def @BypassChapRefList
- {
- @BypassChapRefPlace //@RefListGap @BypassChapRefList
- }
-
- @ChapRefList 1
- //@RefListGap
- @BypassChapRefList
- }
-
-
- ###########################################################################
- # #
- # @RefHeading - heading for reference lists. #
- # #
- ###########################################################################
-
- def @RefHeading right x
- { x @Case {
- references @Yield @Word&&references
- bibliography @Yield @Word&&bibliography
- else @Yield x
- }
- }
-
-
- #######################################################################
- # #
- # @ChapRefSection #
- # #
- #######################################################################
-
- def @ChapRefSection
- {
- @Heading @RefHeading @ChapRefListTitle
- @DP
- @ChapReferencesSection
- }
-
-
- ###########################################################################
- # #
- # @SendRef and @ChapSendRef - send one reference to the reference list. #
- # #
- ###########################################################################
-
- def @RefItem
- left lab
- right ref
- {
- def @ZeroWidth right x { &0io @OneCol x &0io }
-
- @RefListFormat @Case {
- NoLabels @Yield { ref }
- Labels @Yield { @ZeroWidth lab |@RefListLabelWidth ref }
- DropLabels @Yield { lab //1vx |@RefListLabelWidth ref }
- InLabels @Yield { lab & 2s @Wide & ref }
- }
- }
-
-
- def @RefListItem
- left label
- right tag
- {
- @RefListFont @Font @RefListBreak @Break {
- @NumberMarker&&preceding @Tagged tag & @PageMark tag
- |@RefListIndent {label @ListLabel tag} @RefItem {@RefPrint tag}
- |@RefListRightIndent
- }
- }
-
-
- def @SendRef into { @RefPlace&&foll_or_prec }
- left label
- right tag
- {
- def @Key { label @SortKey tag }
-
- # no @Merge i.e. omit duplicates
-
- label @RefListItem tag
- }
-
-
- def @ChapSendRef into { @ChapRefPlace&&foll_or_prec }
- left label
- right tag
- {
- def @Key { label @SortKey tag }
-
- # no @Merge i.e. omit duplicates
-
- label @RefListItem tag
- }
-
-
- ###########################################################################
- # #
- # @Ref (bare citation) and its variants. #
- # #
- ###########################################################################
-
- def @Ref
- named label {}
- right tag
- {
- @MakeReferences @Case {
- Yes @Yield { label @CiteLabel tag & label @SendRef tag }
- else @Yield @Null
- }
- }
-
- def @NoRef
- named label {}
- right tag
- {
- @MakeReferences @Case {
- Yes @Yield { label @SendRef tag }
- else @Yield @Null
- }
- }
-
- def @ChapRef
- named label {}
- right tag
- {
- @MakeReferences @Case {
- Yes @Yield { label @CiteLabel tag & label @ChapSendRef tag }
- else @Yield @Null
- }
- }
-
- def @NoChapRef
- named label {}
- right tag
- {
- @MakeReferences @Case {
- Yes @Yield { label @ChapSendRef tag }
- else @Yield @Null
- }
- }
-
-
- ###########################################################################
- # #
- # Bypass references. #
- # #
- ###########################################################################
-
- def @BypassReference into { @BypassRefPlace&&preceding }
- named label {}
- named value {}
- {
- @MakeReferences @Case {
- Bypass @Yield { label @RefItem value }
- else @Yield @Null
- }
- }
-
- def @BypassChapReference into { @BypassChapRefPlace&&preceding }
- named label {}
- named value {}
- {
- @MakeReferences @Case {
- Bypass @Yield { label @RefItem value }
- else @Yield @Null
- }
- }
-
-
- ###########################################################################
- # #
- # @Cite (citation) and its variants. #
- # #
- ###########################################################################
-
- export "$" "," ";"
- def @Cite body cite
- {
- macro "$" { @Ref }
- def "," precedence 90 left x { x"," }
- def ";" precedence 90 left x { x";" }
-
- @MakeReferences @Case {
- Yes @Yield {
- @RefCiteStyle cite
- }
- else @Yield @Null
- }
- }
-
- export "$" "," ";"
- def @NoCite body cite
- {
- macro "$" { @NoRef }
- def "," precedence 90 left x { x"," }
- def ";" precedence 90 left x { x";" }
-
- @MakeReferences @Case {
- Yes @Yield { cite }
- else @Yield @Null
- }
- }
-
- export "$" "," ";"
- def @ChapCite body cite
- {
- macro "$" { @ChapRef }
- def "," precedence 90 left x { x"," }
- def ";" precedence 90 left x { x";" }
-
- @MakeReferences @Case {
- Yes @Yield { @RefCiteStyle cite }
- else @Yield @Null
- }
- }
-
- export "$" "," ";"
- def @NoChapCite body cite
- {
- macro "$" { @NoChapRef }
- def "," precedence 90 left x { x }
- def ";" precedence 90 left x { x";" }
-
- @MakeReferences @Case {
- Yes @Yield { cite }
- else @Yield @Null
- }
- }
-
- ###########################################################################
- # #
- # Floating figures. #
- # #
- ###########################################################################
-
- export @Tag prefix
- def @FigurePrefixMarker
- named @Tag {}
- named prefix {}
- {
- @Null
- }
-
- export @Tag count
- def @FigureCounterMarker
- named @Tag {}
- named count {}
- {
- @Null
- }
-
- def @RawFigureNum right tag
- {
- @FigureCounterMarker&&tag @Open { @Next count }
- }
-
- def @FigureCounterIncrement
- right tag
- {
- @FigureCounterMarker&&preceding @Tagged tag
- // @FigurePrefixMarker&&preceding @Tagged tag
- // @FigureCounterMarker count { @RawFigureNum tag }
- // @NumberMarker @Tag { tag }
- @Value { { @FigurePrefixMarker&&tag @Open { prefix } }
- @Join {@FigureNumbers @Num @RawFigureNum tag}
- }
- }
-
- def @BeginFigureCounter
- left condition
- right prefix
- {
- condition @Do {
- @FigurePrefixMarker prefix { prefix }
- // @FigureCounterMarker count { 0 }
- }
- }
-
- def @EndFigureList { @Galley //@MidGap @EndFigureList }
-
- def @Figure
- named @Tag {}
- named @Caption { dft }
- named @ShortCaption { dft }
- named @CaptionPos { @FigureCaptionPos }
- named @Format
- named @II right x { |@DisplayIndent x | }
- named @QQ right x { |@DisplayIndent x |@DisplayIndent }
- named @CC right x { |0.5rt x | }
- named @RR right x { |1.0rt x | }
- right @Body { @FigureFormat @Body }
- named @InitialLanguage { @InitialLanguage }
- named @BypassNumber { dft }
- named @OnePage { dft }
- named @Location { @FigureLocation }
- right @Body
- {
- def @FigureNumber
- {
- @BypassNumber @Dft @NumberOf @Tag
- }
-
- def @ContentsCaption
- {
- @ShortCaption @Dft @Caption
- }
-
- def @OnePg
- {
- @OnePage @Case {
- { No no } @Yield No
- { Yes yes } @Yield Yes
- dft @Yield { @Location @Case {
- PageTop @Yield No
- EvenPageTop @Yield No
- FullPage @Yield No
- EvenFullPage @Yield No
- PageFoot @Yield Yes
- ColTop @Yield No
- ColFoot @Yield Yes
- ColEnd @Yield No
- Display @Yield Yes
- AfterLine @Yield Yes
- TryAfterLine @Yield Yes
- Raw @Yield No
- }
- }
- }
- }
-
- def @CaptionState
- {
- @Caption @Case {
- dft @Yield None
- else @Yield { @CaptionPos @Case {
- { Below below } @Yield Below
- { Above above } @Yield Above
- } }
- }
- }
-
- #def @FigureLabel
- #{
- # @FigureNumbers @Case {
- # No @Yield @Null
- # else @Yield {
- # @CaptionFormat { {figure @WordVal @FigureWord} @NumSep @FigureNumber }
- # }
- # }
- #}
-
- def @CaptionVal
- {
- @FigureCaptionFont @Font @FigureCaptionBreak @Break
- { ||0.5rt @FigureCaptionFormat
- word { figure @WordVal @FigureWord }
- number { @FigureNumber }
- caption { @Caption }
- }
- }
-
- def @FigureVal
- {
- @InitialLanguage @Language
- {
- @MakeFigureContents @FigureContentsEntry
- indent { 0f }
- crosstag { @Tag }
- number { @FigureNumber }
- title { @InitialLanguage @Language @ContentsCaption }
- pagenum { @PageOf @Tag }
- // @FigureCounterIncrement @Tag
- // @Body
- // @PageMark @Tag
- }
- }
-
- def @FigureTarget
- {
- @Location @Case {
- PageTop @Yield @PageTopPlace&&following
- EvenPageTop @Yield @PageTopPlace&&following
- FullPage @Yield @FullPagePlace&&following
- EvenFullPage @Yield @FullPagePlace&&following
- PageFoot @Yield @PageFootAndTopPlace&&following
- ColTop @Yield @ColTopPlace&&following
- ColFoot @Yield @ColFootAndTopPlace&&following
- ColEnd @Yield @EndFigureList&&following
- Display @Yield @AfterLinePlace&&following
- AfterLine @Yield @AfterLinePlace&&following
- TryAfterLine @Yield @TryAfterLinePlace&&following
- }
- }
-
- def @SendEncl into { @FigureTarget }
- right x
- {
- def @Enclose right x
- {
- @OnePg @Case {
- No @Yield @Format x
- Yes @Yield x
- }
- }
-
- x
- }
-
- def @Send into { @FigureTarget }
- right x
- {
- x
- }
-
- def @EvenFullPageSend into { @EvenFullPagePlace&&following }
- right x
- {
- @OneRow x
- }
-
- def @EvenPageSend into { @EvenPagePlace&&following }
- right x
- {
- @OneRow x
- }
-
- def @RawFigureVal
- {
- @OnePg.@CaptionState @Case
- {
- Yes.Below @Yield @OneRow { @Format @FigureVal @DP @CaptionVal }
- Yes.Above @Yield @OneRow { @CaptionVal @DP @Format @FigureVal }
- Yes.None @Yield @OneRow { @Format @FigureVal }
- No.Below @Yield { @Format @FigureVal @DP @CaptionVal }
- No.Above @Yield { @CaptionVal @DP @Format @FigureVal }
- No.None @Yield { @Format @FigureVal }
- }
- }
-
- def @NonRawFigureVal
- {
- @OnePg.@CaptionState @Case
- {
- Yes.Below @Yield {
- @Send @OneRow { @Format @FigureVal @DP @CaptionVal // @DupRunner}
- }
- Yes.Above @Yield {
- @Send @OneRow { @CaptionVal @DP @Format @FigureVal // @DupRunner}
- }
- Yes.None @Yield {
- @Send @OneRow { @Format @FigureVal // @DupRunner }
- }
- No.Below @Yield {
- @SendEncl { @FigureVal // @Send { @CaptionVal // @DupRunner } }
- }
- No.Above @Yield {
- @Send { @CaptionVal // @SendEncl { @FigureVal // @DupRunner } }
- }
- No.None @Yield {
- @SendEncl { @FigureVal // @DupRunner }
- }
- }
- }
-
- @Location @Case {
- Raw @Yield @RawFigureVal
- Display @Yield { @NonRawFigureVal &1rt }
- EvenPageTop @Yield @EvenPageSend @NonRawFigureVal
- EvenFullPage @Yield @EvenFullPageSend @NonRawFigureVal
- else @Yield @NonRawFigureVal
- }
- }
-
-
- ###########################################################################
- # #
- # Floating tables (exact clone of figure code immediately above). #
- # #
- ###########################################################################
-
- export @Tag prefix
- def @TablePrefixMarker
- named @Tag {}
- named prefix {}
- {
- @Null
- }
-
- export @Tag count
- def @TableCounterMarker
- named @Tag {}
- named count {}
- {
- @Null
- }
-
- def @RawTableNum right tag
- {
- @TableCounterMarker&&tag @Open { @Next count }
- }
-
- def @TableCounterIncrement
- right tag
- {
- @TableCounterMarker&&preceding @Tagged tag
- // @TablePrefixMarker&&preceding @Tagged tag
- // @TableCounterMarker count { @RawTableNum tag }
- // @NumberMarker @Tag { tag }
- @Value { { @TablePrefixMarker&&tag @Open { prefix } }
- @Join {@TableNumbers @Num @RawTableNum tag}
- }
- }
-
- def @BeginTableCounter
- left condition
- right prefix
- {
- condition @Do {
- @TablePrefixMarker prefix { prefix }
- // @TableCounterMarker count { 0 }
- }
- }
-
- def @EndTableList { @Galley //@MidGap @EndTableList }
-
- def @Table
- named @Tag {}
- named @Caption { dft }
- named @ShortCaption { dft }
- named @CaptionPos { @TableCaptionPos }
- named @Format
- named @II right x { |@DisplayIndent x | }
- named @QQ right x { |@DisplayIndent x |@DisplayIndent }
- named @CC right x { |0.5rt x | }
- named @RR right x { |1.0rt x | }
- right @Body { @TableFormat @Body }
- named @InitialLanguage { @InitialLanguage }
- named @BypassNumber { dft }
- named @OnePage { dft }
- named @Location { @TableLocation }
- right @Body
- {
- def @TableNumber
- {
- @BypassNumber @Dft @NumberOf @Tag
- }
-
- def @ContentsCaption
- {
- @ShortCaption @Dft @Caption
- }
-
- def @OnePg
- {
- @OnePage @Case {
- { No no } @Yield No
- { Yes yes } @Yield Yes
- dft @Yield { @Location @Case {
- PageTop @Yield No
- EvenPageTop @Yield No
- FullPage @Yield No
- EvenFullPage @Yield No
- PageFoot @Yield Yes
- ColTop @Yield No
- ColFoot @Yield Yes
- ColEnd @Yield No
- Display @Yield Yes
- AfterLine @Yield Yes
- TryAfterLine @Yield Yes
- Raw @Yield No
- }
- }
- }
- }
-
- def @CaptionState
- {
- @Caption @Case {
- dft @Yield None
- else @Yield { @CaptionPos @Case {
- { Below below } @Yield Below
- { Above above } @Yield Above
- } }
- }
- }
-
- #def @TableLabel
- #{
- # @TableNumbers @Case {
- # No @Yield @Null
- # else @Yield {
- # @CaptionFormat { {table @WordVal @TableWord} @NumSep @TableNumber }
- # }
- # }
- #}
-
- def @CaptionVal
- {
- @TableCaptionFont @Font @TableCaptionBreak @Break
- { ||0.5rt @TableCaptionFormat
- word { table @WordVal @TableWord }
- number { @TableNumber }
- caption { @Caption }
- }
- }
-
- def @TableVal
- {
- @InitialLanguage @Language
- {
- @MakeTableContents @TableContentsEntry
- indent { 0f }
- crosstag { @Tag }
- number { @TableNumber }
- title { @InitialLanguage @Language @ContentsCaption }
- pagenum { @PageOf @Tag }
- // @TableCounterIncrement @Tag
- // @Body
- // @PageMark @Tag
- }
- }
-
- def @TableTarget
- {
- @Location @Case {
- PageTop @Yield @PageTopPlace&&following
- EvenPageTop @Yield @PageTopPlace&&following
- FullPage @Yield @FullPagePlace&&following
- EvenFullPage @Yield @FullPagePlace&&following
- PageFoot @Yield @PageFootAndTopPlace&&following
- ColTop @Yield @ColTopPlace&&following
- ColFoot @Yield @ColFootAndTopPlace&&following
- ColEnd @Yield @EndTableList&&following
- Display @Yield @AfterLinePlace&&following
- AfterLine @Yield @AfterLinePlace&&following
- TryAfterLine @Yield @TryAfterLinePlace&&following
- }
- }
-
- def @SendEncl into { @TableTarget }
- right x
- {
- def @Enclose right x
- {
- @OnePg @Case {
- No @Yield @Format x
- Yes @Yield x
- }
- }
-
- x
- }
-
- def @Send into { @TableTarget }
- right x
- {
- x
- }
-
- def @EvenFullPageSend into { @EvenFullPagePlace&&following }
- right x
- {
- @OneRow x
- }
-
- def @EvenPageSend into { @EvenPagePlace&&following }
- right x
- {
- @OneRow x
- }
-
- def @RawTableVal
- {
- @OnePg.@CaptionState @Case
- {
- Yes.Below @Yield @OneRow { @Format @TableVal @DP @CaptionVal }
- Yes.Above @Yield @OneRow { @CaptionVal @DP @Format @TableVal }
- Yes.None @Yield @OneRow { @Format @TableVal }
- No.Below @Yield { @Format @TableVal @DP @CaptionVal }
- No.Above @Yield { @CaptionVal @DP @Format @TableVal }
- No.None @Yield { @Format @TableVal }
- }
- }
-
- def @NonRawTableVal
- {
- @OnePg.@CaptionState @Case
- {
- Yes.Below @Yield {
- @Send @OneRow { @Format @TableVal @DP @CaptionVal // @DupRunner}
- }
- Yes.Above @Yield {
- @Send @OneRow { @CaptionVal @DP @Format @TableVal // @DupRunner}
- }
- Yes.None @Yield {
- @Send @OneRow { @Format @TableVal // @DupRunner }
- }
- No.Below @Yield {
- @SendEncl { @TableVal // @Send { @CaptionVal // @DupRunner } }
- }
- No.Above @Yield {
- @Send { @CaptionVal // @SendEncl { @TableVal // @DupRunner } }
- }
- No.None @Yield {
- @SendEncl { @TableVal // @DupRunner }
- }
- }
- }
-
- @Location @Case {
- Raw @Yield @RawTableVal
- Display @Yield { @NonRawTableVal &1rt }
- EvenPageTop @Yield @EvenPageSend @NonRawTableVal
- EvenFullPage @Yield @EvenFullPageSend @NonRawTableVal
- else @Yield @NonRawTableVal
- }
- }
-
-
- ###########################################################################
- # #
- # Glossary. #
- # #
- ###########################################################################
-
- def @GlossaryList { @Galley //@GlossaryGap @GlossaryList }
-
- def @GlossarySection into { @GlossaryPlace&&following }
- right etc
- {
- // @GlossaryList
- // etc
- //1rt
- }
-
- def @DoGlossary into { @GlossaryList&&following }
- left @Key
- named name {}
- named pnum {}
- right body
- {
- @GlossaryFont @Font @GlossaryBreak @Break @GlossaryFormat
- @Name { name }
- @PageNum { pnum }
- @Body { body }
- }
-
- def @Glossary
- left name
- named sortkey { dft }
- right body
- {
- def key { sortkey @Dft name }
-
- @MakeGlossary @Case {
- { Yes yes } @Yield { @PageMark key &
- key @DoGlossary name { name } pnum { @PageOf key } body
- }
- else @Yield @Null
- }
- }
-
- def @InGlossary
- right x
- {
- @MakeGlossary @Case {
- { Yes yes } @Yield { @InGlossaryFormat @InGlossaryFont @Font x }
- else @Yield x
- }
- }
-
-
- ###########################################################################
- # #
- # Index. #
- # #
- ###########################################################################
-
- def @IndexList { @Galley //1vx @IndexList }
- def @BypassIndexList { @Galley //1vx @BypassIndexList }
-
- def @IndexSection into { @IndexPlace&&following }
- right etc
- {
- // @IndexBreak @Break @IndexList
- // @IndexBreak @Break @BypassIndexList
- // @ClearHeaderComponent
- // etc
- //1rt
- }
-
- def @DoIndex into { @IndexList&&following }
- left @Key # sort key
- named pgrange {} # page numbers, or empty if none
- named depth {} # 0, 1, or 2 (@Index, @Sub, or @SubSub)
- right body # body, not including any prefix
- {
- def @Body
- {
- depth @Case {
- 0 @Yield @IndexFormat body
- 1 @Yield @SubIndexFormat body
- 2 @Yield @SubSubIndexFormat body
- }
- }
-
- def @Enclose right x
- {
- @IndexCtd.depth @Case {
-
- Yes.0 @Yield {
- @ClearHeaderComponent
- //1vx
- x
- //1vx
- 1vx @SetHeaderComponent {
- @Body @IndexCtdFormat {continued @WordVal @IndexCtdWord}
- }
- //1vx
- 1vx @BeginHeaderComponent (unused)
- }
-
- Yes.1 @Yield {
- @EndHeaderComponent
- //1vx
- x
- //1vx
- 1vx @BeginHeaderComponent {
- @Body @IndexCtdFormat {continued @WordVal @IndexCtdWord}
- }
- }
-
- else @Yield x
-
- }
- }
-
- def @Merge left lpart right rpart
- {
- { lpart @Rump { lpart @Meld rpart } } @Case
- {
- "" @Yield lpart
- else @Yield { { lpart{@OneCol ,} } @Meld rpart }
- }
-
- }
-
- @IndexFont @Font @IndexBreak @Break pgrange @Case {
- "" @Yield { @Body &"0.03fu" {} }
- else @Yield { @Body &"0.03fu" {}{@OneCol ,} pgrange }
-
- }
- }
-
- def @RawIndex
- left lpart
- named depth { 0 }
- right rpart
- {
- @MakeIndex @Case {
- Yes @Yield { lpart @DoIndex depth { depth } rpart }
- else @Yield @Null
- }
- }
-
- macro @RawSubIndex { @RawIndex depth { 1 } }
- macro @RawSubSubIndex { @RawIndex depth { 2 } }
-
- def @Index
- left lpart
- named @Tag {}
- named depth { 0 }
- named to {}
- right rpart
- {
- def @PgMk right tag
- {
- tag @CrossLink @PageOf tag
- }
-
- def @PgRange
- {
- to @Case
- {
- "" @Yield @PgMk @Tag
- else @Yield {
- { @PageOf @Tag } @Case
- {
- { @PageOf to } @Yield { @PgMk @Tag }
- else @Yield { {@PgMk @Tag}--{@PgMk to} }
- }
- }
- }
- }
-
- @MakeIndex @Case {
- Yes @Yield {
- @PageMark @Tag &
- lpart @DoIndex depth { depth } pgrange { @PgRange } rpart }
- else @Yield @Null
- }
- }
-
- macro @SubIndex { @Index depth { 1 } }
- macro @SubSubIndex { @Index depth { 2 } }
-
- def @IndexBlanks
- {
- b @RawIndex {} c @RawIndex {} d @RawIndex {} e @RawIndex {}
- f @RawIndex {} g @RawIndex {} h @RawIndex {} i @RawIndex {}
- j @RawIndex {} k @RawIndex {} l @RawIndex {} m @RawIndex {}
- n @RawIndex {} o @RawIndex {} p @RawIndex {} q @RawIndex {}
- r @RawIndex {} s @RawIndex {} t @RawIndex {} u @RawIndex {}
- v @RawIndex {} w @RawIndex {} x @RawIndex {} y @RawIndex {}
- z @RawIndex {}
- }
-
- def @IndexSpacer
- left lpart
- named above { @IndexSpacerAbove }
- named below { @IndexSpacerBelow }
- named font { @IndexSpacerFont }
- named format right @Body { @IndexSpacerFormat @Body }
- right rpart
- {
- def @Send into { @IndexList&&following }
- right @Key
- {
- @ClearHeaderComponent
- //
- //above
- @CNP
- @OneRow { font @Font format rpart //below }
- }
-
- @MakeIndex @Case {
- Yes @Yield @Send lpart
- else @Yield @Null
- }
- }
-
- macro @InitialIndexSpacer { @IndexSpacer above { 0i } }
-
- def @IndexLetters
- {
- a @InitialIndexSpacer A
- b @IndexSpacer B c @IndexSpacer C d @IndexSpacer D e @IndexSpacer E
- f @IndexSpacer F g @IndexSpacer G h @IndexSpacer H i @IndexSpacer I
- j @IndexSpacer J k @IndexSpacer K l @IndexSpacer L m @IndexSpacer M
- n @IndexSpacer N o @IndexSpacer O p @IndexSpacer P q @IndexSpacer Q
- r @IndexSpacer R s @IndexSpacer S t @IndexSpacer T u @IndexSpacer U
- v @IndexSpacer V w @IndexSpacer W x @IndexSpacer X y @IndexSpacer Y
- z @IndexSpacer Z
- }
-
- def @BypassBeginIndexPlace { @Galley }
-
- def @BypassBeginIndex force into { @BypassBeginIndexPlace&&preceding } {}
-
- def @BypassRawIndex force into { @BypassIndexList&&preceding }
- named indent { 0f }
- right x
- {
- &indent x
- }
-
- def @BypassEndIndex { @Null }
-
-
- ###########################################################################
- # #
- # IndexA. #
- # #
- ###########################################################################
-
- def @IndexAList { @Galley //1vx @IndexAList }
- def @BypassIndexAList { @Galley //1vx @BypassIndexAList }
-
- def @IndexASection into { @IndexAPlace&&following }
- right etc
- {
- // @IndexABreak @Break @IndexAList
- // @IndexABreak @Break @BypassIndexAList
- // @ClearHeaderComponent
- // etc
- //1rt
- }
-
- def @DoIndexA into { @IndexAList&&following }
- left @Key # sort key
- named pgrange {} # page numbers, or empty if none
- named depth {} # 0, 1, or 2 (@IndexA, @Sub, or @SubSub)
- right body # body, not including any prefix
- {
- def @Body
- {
- depth @Case {
- 0 @Yield @IndexAFormat body
- 1 @Yield @SubIndexAFormat body
- 2 @Yield @SubSubIndexAFormat body
- }
- }
-
- def @Enclose right x
- {
- @IndexACtd.depth @Case {
-
- Yes.0 @Yield {
- @ClearHeaderComponent
- //1vx
- x
- //1vx
- 1vx @SetHeaderComponent {
- @Body @IndexACtdFormat {continued @WordVal @IndexACtdWord}
- }
- //1vx
- 1vx @BeginHeaderComponent (unused)
- }
-
- Yes.1 @Yield {
- @EndHeaderComponent
- //1vx
- x
- //1vx
- 1vx @BeginHeaderComponent {
- @Body @IndexACtdFormat {continued @WordVal @IndexACtdWord}
- }
- }
-
- else @Yield x
-
- }
- }
-
- def @Merge left lpart right rpart
- {
- { lpart @Rump { lpart @Meld rpart } } @Case
- {
- "" @Yield lpart
- else @Yield { { lpart{@OneCol ,} } @Meld rpart }
- }
-
- }
-
- @IndexAFont @Font @IndexABreak @Break pgrange @Case {
- "" @Yield { @Body &"0.03fu" {} }
- else @Yield { @Body &"0.03fu" {}{@OneCol ,} pgrange }
-
- }
- }
-
- def @RawIndexA
- left lpart
- named depth { 0 }
- right rpart
- {
- @MakeIndexA @Case {
- Yes @Yield { lpart @DoIndexA depth { depth } rpart }
- else @Yield @Null
- }
- }
-
- macro @RawSubIndexA { @RawIndexA depth { 1 } }
- macro @RawSubSubIndexA { @RawIndexA depth { 2 } }
-
- def @IndexA
- left lpart
- named @Tag {}
- named depth { 0 }
- named to {}
- right rpart
- {
- def @PgMk right tag
- {
- tag @CrossLink @PageOf tag
- }
-
- def @PgRange
- {
- to @Case
- {
- "" @Yield @PgMk @Tag
- else @Yield {
- { @PageOf @Tag } @Case
- {
- { @PageOf to } @Yield { @PgMk @Tag }
- else @Yield { {@PgMk @Tag}--{@PgMk to} }
- }
- }
- }
- }
-
- @MakeIndexA @Case {
- Yes @Yield {
- @PageMark @Tag &
- lpart @DoIndexA depth { depth } pgrange { @PgRange } rpart }
- else @Yield @Null
- }
- }
-
- macro @SubIndexA { @IndexA depth { 1 } }
- macro @SubSubIndexA { @IndexA depth { 2 } }
-
- def @IndexABlanks
- {
- b @RawIndexA {} c @RawIndexA {} d @RawIndexA {} e @RawIndexA {}
- f @RawIndexA {} g @RawIndexA {} h @RawIndexA {} i @RawIndexA {}
- j @RawIndexA {} k @RawIndexA {} l @RawIndexA {} m @RawIndexA {}
- n @RawIndexA {} o @RawIndexA {} p @RawIndexA {} q @RawIndexA {}
- r @RawIndexA {} s @RawIndexA {} t @RawIndexA {} u @RawIndexA {}
- v @RawIndexA {} w @RawIndexA {} x @RawIndexA {} y @RawIndexA {}
- z @RawIndexA {}
- }
-
- def @IndexASpacer
- left lpart
- named above { @IndexASpacerAbove }
- named below { @IndexASpacerBelow }
- named font { @IndexASpacerFont }
- named format right @Body { @IndexASpacerFormat @Body }
- right rpart
- {
- def @Send into { @IndexAList&&following }
- right @Key
- {
- @ClearHeaderComponent
- //
- //above
- @CNP
- @OneRow { font @Font format rpart //below }
- }
-
- @MakeIndexA @Case {
- Yes @Yield @Send lpart
- else @Yield @Null
- }
- }
-
- macro @InitialIndexASpacer { @IndexASpacer above { 0i } }
-
- def @IndexALetters
- {
- a @InitialIndexASpacer A
- b @IndexASpacer B c @IndexASpacer C d @IndexASpacer D e @IndexASpacer E
- f @IndexASpacer F g @IndexASpacer G h @IndexASpacer H i @IndexASpacer I
- j @IndexASpacer J k @IndexASpacer K l @IndexASpacer L m @IndexASpacer M
- n @IndexASpacer N o @IndexASpacer O p @IndexASpacer P q @IndexASpacer Q
- r @IndexASpacer R s @IndexASpacer S t @IndexASpacer T u @IndexASpacer U
- v @IndexASpacer V w @IndexASpacer W x @IndexASpacer X y @IndexASpacer Y
- z @IndexASpacer Z
- }
-
- def @BypassBeginIndexAPlace { @Galley }
-
- def @BypassBeginIndexA force into { @BypassBeginIndexAPlace&&preceding } {}
-
- def @BypassRawIndexA force into { @BypassIndexAList&&preceding }
- named indent { 0f }
- right x
- {
- &indent x
- }
-
- def @BypassEndIndexA { @Null }
-
-
- ###########################################################################
- # #
- # IndexB. #
- # #
- ###########################################################################
-
- def @IndexBList { @Galley //1vx @IndexBList }
- def @BypassIndexBList { @Galley //1vx @BypassIndexBList }
-
- def @IndexBSection into { @IndexBPlace&&following }
- right etc
- {
- // @IndexBBreak @Break @IndexBList
- // @IndexBBreak @Break @BypassIndexBList
- // @ClearHeaderComponent
- // etc
- //1rt
- }
-
- def @DoIndexB into { @IndexBList&&following }
- left @Key # sort key
- named pgrange {} # page numbers, or empty if none
- named depth {} # 0, 1, or 2 (@IndexB, @Sub, or @SubSub)
- right body # body, not including any prefix
- {
- def @Body
- {
- depth @Case {
- 0 @Yield @IndexBFormat body
- 1 @Yield @SubIndexBFormat body
- 2 @Yield @SubSubIndexBFormat body
- }
- }
-
- def @Enclose right x
- {
- @IndexBCtd.depth @Case {
-
- Yes.0 @Yield {
- @ClearHeaderComponent
- //1vx
- x
- //1vx
- 1vx @SetHeaderComponent {
- @Body @IndexBCtdFormat {continued @WordVal @IndexBCtdWord}
- }
- //1vx
- 1vx @BeginHeaderComponent (unused)
- }
-
- Yes.1 @Yield {
- @EndHeaderComponent
- //1vx
- x
- //1vx
- 1vx @BeginHeaderComponent {
- @Body @IndexBCtdFormat {continued @WordVal @IndexBCtdWord}
- }
- }
-
- else @Yield x
-
- }
- }
-
- def @Merge left lpart right rpart
- {
- { lpart @Rump { lpart @Meld rpart } } @Case
- {
- "" @Yield lpart
- else @Yield { { lpart{@OneCol ,} } @Meld rpart }
- }
-
- }
-
- @IndexBFont @Font @IndexBBreak @Break pgrange @Case {
- "" @Yield { @Body &"0.03fu" {} }
- else @Yield { @Body &"0.03fu" {}{@OneCol ,} pgrange }
-
- }
- }
-
- def @RawIndexB
- left lpart
- named depth { 0 }
- right rpart
- {
- @MakeIndexB @Case {
- Yes @Yield { lpart @DoIndexB depth { depth } rpart }
- else @Yield @Null
- }
- }
-
- macro @RawSubIndexB { @RawIndexB depth { 1 } }
- macro @RawSubSubIndexB { @RawIndexB depth { 2 } }
-
- def @IndexB
- left lpart
- named @Tag {}
- named depth { 0 }
- named to {}
- right rpart
- {
- def @PgMk right tag
- {
- tag @CrossLink @PageOf tag
- }
-
- def @PgRange
- {
- to @Case
- {
- "" @Yield @PgMk @Tag
- else @Yield {
- { @PageOf @Tag } @Case
- {
- { @PageOf to } @Yield { @PgMk @Tag }
- else @Yield { {@PgMk @Tag}--{@PgMk to} }
- }
- }
- }
- }
-
- @MakeIndexB @Case {
- Yes @Yield {
- @PageMark @Tag &
- lpart @DoIndexB depth { depth } pgrange { @PgRange } rpart }
- else @Yield @Null
- }
- }
-
- macro @SubIndexB { @IndexB depth { 1 } }
- macro @SubSubIndexB { @IndexB depth { 2 } }
-
- def @IndexBBlanks
- {
- b @RawIndexB {} c @RawIndexB {} d @RawIndexB {} e @RawIndexB {}
- f @RawIndexB {} g @RawIndexB {} h @RawIndexB {} i @RawIndexB {}
- j @RawIndexB {} k @RawIndexB {} l @RawIndexB {} m @RawIndexB {}
- n @RawIndexB {} o @RawIndexB {} p @RawIndexB {} q @RawIndexB {}
- r @RawIndexB {} s @RawIndexB {} t @RawIndexB {} u @RawIndexB {}
- v @RawIndexB {} w @RawIndexB {} x @RawIndexB {} y @RawIndexB {}
- z @RawIndexB {}
- }
-
- def @IndexBSpacer
- left lpart
- named above { @IndexBSpacerAbove }
- named below { @IndexBSpacerBelow }
- named font { @IndexBSpacerFont }
- named format right @Body { @IndexBSpacerFormat @Body }
- right rpart
- {
- def @Send into { @IndexBList&&following }
- right @Key
- {
- @ClearHeaderComponent
- //
- //above
- @CNP
- @OneRow { font @Font format rpart //below }
- }
-
- @MakeIndexB @Case {
- Yes @Yield @Send lpart
- else @Yield @Null
- }
- }
-
- macro @InitialIndexBSpacer { @IndexBSpacer above { 0i } }
-
- def @IndexBLetters
- {
- a @InitialIndexBSpacer A
- b @IndexBSpacer B c @IndexBSpacer C d @IndexBSpacer D e @IndexBSpacer E
- f @IndexBSpacer F g @IndexBSpacer G h @IndexBSpacer H i @IndexBSpacer I
- j @IndexBSpacer J k @IndexBSpacer K l @IndexBSpacer L m @IndexBSpacer M
- n @IndexBSpacer N o @IndexBSpacer O p @IndexBSpacer P q @IndexBSpacer Q
- r @IndexBSpacer R s @IndexBSpacer S t @IndexBSpacer T u @IndexBSpacer U
- v @IndexBSpacer V w @IndexBSpacer W x @IndexBSpacer X y @IndexBSpacer Y
- z @IndexBSpacer Z
- }
-
- def @BypassBeginIndexBPlace { @Galley }
-
- def @BypassBeginIndexB force into { @BypassBeginIndexBPlace&&preceding } {}
-
- def @BypassRawIndexB force into { @BypassIndexBList&&preceding }
- named indent { 0f }
- right x
- {
- &indent x
- }
-
- def @BypassEndIndexB { @Null }
-
-
- ###########################################################################
- # #
- # @LargeScaleStructure #
- # #
- # The prototype for the value of each large-scale structure symbol #
- # (@Chapter, @Section, etc.) #
- # #
- ###########################################################################
-
- def @LargeScaleStructure
- named tag {} # tag of this large-scale structure sym
- named type {} # MajorIntro, Major, VeryMajor, or Minor
- named initiallanguage {} # its language
- named title {} # its full title
- named runningtitle { dft } # its running title Jeffk 12/11/02 from {}
- named aboveheadinggap { 0f } # gap above heading
- named headingfont {} # its heading font
- named headingbreak {} # its heading break
- named headingformat # its heading format
- left @Num right @Body {}
- named headingtext { @Null } # heading text
- named incontents { No } # entry in table of contents required
- named contentsindent { 0f } # only if type is Major
- named word {}
- named numbers { None }
- named attachnum {} # only if numbers is not None
- named retrievenum {} # only if numbers is not None
- named bypassnumber {} # only if numbers is not None, or VeryMajor
- named prefix {} # prefix of number of this symbol
- named pnprefix {} # prefix for page numbers of this sym
- named majornum { dft }
- named majortitle { dft }
- named minornum { dft }
- named minortitle { dft }
- named intheorems { No }
- named indisplays { No }
- named infigures { No }
- named intables { No }
- named inrunners { No }
- named sendheader right @Body {}
- named innergap {}
- named endifmajor right innergap {
- @EndFigureList
- //innergap @EndNoteList 1
- //innergap @ChapRefSection
- }
- named wantindefinite { No }
- right @Body
- {
-
- def @ShortNum
- {
- numbers @Then {
- bypassnumber @Dft {
- prefix @Join { numbers @Num retrievenum }
- }
- }
- }
-
- def @LongNum
- {
- numbers @Then {
- initiallanguage @Language { word @NumSep @ShortNum }
- }
- }
-
- def @ShortTitle
- {
- initiallanguage @Language { runningtitle @Dft title }
- }
-
- def @IfMajor right x
- {
- type @Case {
- { MajorIntro Major ExtraMajor ExtraMajorIntro } @Yield x
- else @Yield @Null
- }
- }
-
- def @StartIfMajor {
- type @Case {
- { MajorIntro Major ExtraMajor ExtraMajorIntro VeryMajor } @Yield Start
- else @Yield NonStart
- }
- }
-
- def @Run right start
- {
- inrunners @Do type @Case {
-
- { Major MajorIntro } @Yield {
- start @Runner
- @MajorNum { majornum @Dft @LongNum }
- @MajorTitle { majortitle @Dft @ShortTitle }
- @MinorNum {}
- @MinorTitle {}
- @Owner { tag }
- @Prefix { pnprefix @Join @ShortNum }
- }
-
- { ExtraMajor ExtraMajorIntro } @Yield {
- start @Runner
- @MajorNum { majornum @Dft @LongNum }
- @MajorTitle { majortitle @Dft @ShortTitle }
- @MinorNum { majornum @Dft @LongNum }
- @MinorTitle { majortitle @Dft @ShortTitle }
- @Owner { tag }
- @Prefix { pnprefix @Join @ShortNum }
- }
-
- { VeryMajor } @Yield {
- start @Runner
- @MajorNum { majornum @Dft @LongNum }
- @MajorTitle { majortitle @Dft @ShortTitle }
- @MinorNum {}
- @MinorTitle {}
- @Owner { tag }
- @Prefix {}
- }
-
- Minor @Yield {
- start @Runner
- @MajorNum { majornum @Dft @LongNum }
- @MajorTitle { majortitle @Dft @ShortTitle }
- @MinorNum { minornum @Dft @LongNum }
- @MinorTitle { minortitle @Dft @ShortTitle }
- @Owner { tag }
- @Prefix { pnprefix @Join @ShortNum }
- }
- }
- }
-
- def @ContentsStuff
- {
- incontents.type @Case {
-
- Yes.Minor @Yield {
- incontents @ContentsEntry
- indent { contentsindent }
- crosstag { tag }
- number { @LongNum }
- title { initiallanguage @Language title }
- pagenum { @PageOf tag }
- }
-
- { Yes.Major Yes.MajorIntro Yes.ExtraMajor Yes.ExtraMajorIntro } @Yield {
- incontents @MajorContentsEntry
- crosstag { tag }
- number { @LongNum }
- title { initiallanguage @Language title }
- pagenum { @PageOf tag }
- }
-
- { Yes.VeryMajor } @Yield {
- incontents @VeryMajorContentsEntry
- title { initiallanguage @Language {
- bypassnumber @ColonSep title } }
- }
-
- else @Yield @Null
- }
- }
-
- def @Heading
- {
-
- type @Case {
-
- Minor @Yield {
- headingfont @Font
- headingbreak @Break @Protect {@LongNum headingformat title}
- // @Run @StartIfMajor
- // @PageMark tag
- @DP headingtext
- }
-
- { Major MajorIntro ExtraMajor ExtraMajorIntro } @Yield {
- sendheader {
- //aboveheadinggap
- headingfont @Font
- headingbreak @Break { @LongNum headingformat title }
- // @Run @StartIfMajor
- // @PageMark tag
- @DP headingtext
- }
- }
-
- { VeryMajor } @Yield { sendheader {
- //aboveheadinggap
- headingfont @Font
- headingbreak @Break { bypassnumber headingformat title }
- // @Run @StartIfMajor
- // @PageMark tag
- @DP headingtext
- }
- }
- }
- }
-
- initiallanguage @Language {
- @Heading
- // wantindefinite @Case {
- Yes @Yield @Null
- No @Yield ""
- }
- // numbers @Do {
- attachnum & @NumberMarker @Tag { tag } @Value { @ShortNum }
- }
- // @IfMajor { @FootNoteThrough @Do @BeginFootNoteCounter }
- # // @Run @StartIfMajor
- // @ContentsStuff
- // @TitleMarker @Tag { tag } @Value { title }
- // intheorems @BeginAllCounters @ShortNum
- // indisplays @BeginDisplayCounter @ShortNum
- // infigures @BeginFigureCounter @ShortNum
- // intables @BeginTableCounter @ShortNum
- // @Body
- //innergap @IfMajor endifmajor innergap
- // @Run NonStart
- }
- }
-
-@End @DocumentSetup
diff --git a/include/slides b/include/slides
index c9610ea..3d89c4e 100644
--- a/include/slides
+++ b/include/slides
@@ -167,6 +167,9 @@
# @IndexFormat { @Body } # @Index format
# @SubIndexFormat { {1f @Wide}@Body } # @SubIndex format
# @SubSubIndexFormat { {2f @Wide}@Body } # @SubSubIndex format
+ # @IndexTypeOrdinary { @PageNum } # Ordinary pagenum format
+ # @IndexTypeMain { @B @PageNum } # Main pagenum format
+ # @IndexTypeSpecial { @I @PageNum } # Special pagenum format
# @IndexColumnNumber { 2 } # index columns (1 to 10)
# @IndexColumnGap { 1.00c @OrIfPlain 6s } # index column gap
# @IndexCtd { Yes } # include (ctd.) lines
@@ -183,6 +186,9 @@
# @IndexAFormat { @Body } # @IndexA format
# @SubIndexAFormat { {1f @Wide}@Body } # @SubIndexA format
# @SubSubIndexAFormat { {2f @Wide}@Body } # @SubSubIndexA format
+ # @IndexATypeOrdinary { @PageNum } # Ordinary pagenum format
+ # @IndexATypeMain { @B @PageNum } # Main pagenum format
+ # @IndexATypeSpecial { @I @PageNum } # Special pagenum format
# @IndexAColumnNumber { 2 } # index A columns (1 to 10)
# @IndexAColumnGap { 1.00c @OrIfPlain 6s } # index A column gap
# @IndexACtd { Yes } # include (ctd.) lines
@@ -199,6 +205,9 @@
# @IndexBFormat { @Body } # @IndexB format
# @SubIndexBFormat { {1f @Wide}@Body } # @SubIndexB format
# @SubSubIndexBFormat { {2f @Wide}@Body } # @SubSubIndexB format
+ # @IndexBTypeOrdinary { @PageNum } # Ordinary pagenum format
+ # @IndexBTypeMain { @B @PageNum } # Main pagenum format
+ # @IndexBTypeSpecial { @I @PageNum } # Special pagenum format
# @IndexBColumnNumber { 2 } # index B columns (1 to 10)
# @IndexBColumnGap { 1.00c @OrIfPlain 6s } # index B column gap
# @IndexBCtd { Yes } # include (ctd.) lines