From 73d840b9f14b65166b92e6b43f930fd0ef7b8267 Mon Sep 17 00:00:00 2001 From: "Jeffrey H. Kingston" Date: Tue, 14 Sep 2010 19:38:17 +0000 Subject: Lout 3.19. git-svn-id: http://svn.savannah.nongnu.org/svn/lout/trunk@7 9365b830-b601-4143-9ba8-b4a8e2c3339c --- data/README | 2 +- data/standard.ld | 21 ++++ doc/expert/README | 2 +- doc/expert/det_gall | 9 ++ doc/expert/det_lexi | 8 +- doc/expert/mydefs | 174 +++++++++++++------------- doc/expert/pre | 1 + doc/expert/pre_head | 113 +++++++++++++++++ doc/expert/preface | 2 +- doc/slides/README | 2 +- doc/user/README | 6 +- doc/user/all | 4 +- doc/user/equ_summ | 2 + doc/user/preface | 2 +- doc/user/str_indx | 61 ++++++--- doc/user/tbl | 7 +- doc/user/tbl_alig | 52 ++++---- doc/user/tbl_inde | 19 ++- doc/user/tbl_intr | 34 ++--- doc/user/tbl_marg | 4 +- doc/user/tbl_mark | 33 ++--- doc/user/tbl_mult | 95 +++++++++++++- doc/user/tbl_rows | 4 +- doc/user/tbl_rule | 43 ++++--- doc/user/tbl_summ | 21 +++- doc/user/tbl_widt | 4 +- doc/user/vtbl | 4 +- externs.h | 347 ++++++++++++++++++++++++++++------------------------ include/README | 2 +- include/bluef | 1 - include/book | 9 ++ include/cprintf | 5 +- include/doc | 9 ++ include/dsf | 256 +++++++++++++++++--------------------- include/eqf | 6 +- include/picture | 9 ++ include/progf | 34 ++++- include/report | 9 ++ include/slides | 9 ++ include/tblf | 26 +++- makefile | 14 +-- man/c2lout.1 | 133 -------------------- man/c2lout.txt | 95 -------------- man/lout.1 | 10 +- man/lout.txt | 12 +- prg2lout.c | 6 +- whatsnew | 11 +- z01.c | 6 +- z02.c | 2 +- z03.c | 2 +- z04.c | 6 +- z05.c | 6 +- z06.c | 12 +- z07.c | 10 +- z08.c | 22 +++- z09.c | 2 +- z10.c | 2 +- z11.c | 2 +- z12.c | 17 ++- z13.c | 13 +- z14.c | 2 +- z15.c | 4 +- z16.c | 6 +- z17.c | 2 +- z18.c | 10 +- z19.c | 13 +- z20.c | 63 +++++++++- z21.c | 2 +- z22.c | 140 +++++++++++++++++++-- z23.c | 69 +++++++---- z24.c | 2 +- z25.c | 29 ++++- z26.c | 6 +- z27.c | 2 +- z28.c | 2 +- z29.c | 2 +- z30.c | 2 +- z31.c | 6 +- z32.c | 6 +- z33.c | 2 +- z34.c | 2 +- z35.c | 2 +- z36.c | 2 +- z37.c | 2 +- z38.c | 2 +- z39.c | 2 +- z40.c | 2 +- z41.c | 6 +- z42.c | 2 +- z43.c | 2 +- z44.c | 2 +- z45.c | 2 +- z46.c | 2 +- z47.c | 2 +- z48.c | 2 +- 95 files changed, 1349 insertions(+), 889 deletions(-) create mode 100644 doc/expert/pre_head delete mode 100644 man/c2lout.1 delete mode 100644 man/c2lout.txt diff --git a/data/README b/data/README index 47a7cb8..c498f16 100644 --- a/data/README +++ b/data/README @@ -11,4 +11,4 @@ Corresponding .li files will be created during the initializing "lout -x" run, or else the first time each database is accessed. Jeffrey H. Kingston -30 March 1999 +9 March 2000 diff --git a/data/standard.ld b/data/standard.ld index 23934c2..c003905 100644 --- a/data/standard.ld +++ b/data/standard.ld @@ -645,6 +645,27 @@ } } +{ continued @Word @CurrLang @Case { + Czech @Yield { ?? } + Danish @Yield { ?? } + Dutch @Yield { ?? } + English @Yield { ctd. } + EnglishUK @Yield { ctd. } + Finnish @Yield { ?? } + French @Yield { suite } + German @Yield { ?? } + Hungarian @Yield { folyt. } + Italian @Yield { cont. } + Norwegian @Yield { ?? } + Polish @Yield { ?? } + Portuguese @Yield { cont. } + Russian @Yield { ?? } + Slovenian @Yield { ?? } + Spanish @Yield { ?? } + Swedish @Yield { ?? } + } +} + { am @Word @CurrLang @Case { Czech @Yield { a.m. } Danish @Yield { a.m. } diff --git a/doc/expert/README b/doc/expert/README index d066d57..a69bf2b 100644 --- a/doc/expert/README +++ b/doc/expert/README @@ -16,4 +16,4 @@ copy of the final outfile.ps is included. There should be no warning messages on the fifth run. Jeffrey H. Kingston -26 February 2000 +9 March 2000 diff --git a/doc/expert/det_gall b/doc/expert/det_gall index e5e6e99..371a6d8 100644 --- a/doc/expert/det_gall +++ b/doc/expert/det_gall @@ -353,6 +353,15 @@ of any symbol that is available at that point, in the usual way. The of the galley symbol, rather than an inner definition as shown above, if desired. @PP +It makes sense for sorted galleys containing a @Code "@Merge" symbol +(Section {@NumberOf sorted}) to also have an @Code "@Enclose" symbol. The +meaning is that after all merging is done, each resulting galley has +an @Code "@Enclose" symbol which is applied in the usual way. The value +of this @Code "@Enclose" symbol will be the value of an @Code "@Enclose" +symbol from one of the contributing galleys, but exactly which one +is not defined. So it is safest if all such @Code "@Enclose" symbols +produce the same result. +@PP A @Code "following" galley may fail to find a first target lying in a following component of the same galley as its invocation point. This is a deficiency of Basser Lout, which occurs if the target has not been diff --git a/doc/expert/det_lexi b/doc/expert/det_lexi index 4f98875..d488917 100644 --- a/doc/expert/det_lexi +++ b/doc/expert/det_lexi @@ -91,8 +91,10 @@ do so. The complete list of predefined identifiers is { "@BackEnd" @JL "@Background" @JL "@Begin" + @JL "@BeginHeaderComponent" @JL "@Break" @JL "@Case" + @JL "@ClearHeaderComponent" @JL "@Common" @JL "@Char" @JL "@CurrFace" @@ -102,6 +104,7 @@ do so. The complete list of predefined identifiers is @JL "@CurrZUnit" @JL "@Database" @JL "@End" + @JL "@EndHeaderComponent" @JL "@Enclose" @JL "@Filter" @JL "@FilterErr" @@ -118,9 +121,9 @@ do so. The complete list of predefined identifiers is @JL "@High" @JL "@HLimited" @JL "@HScale" - @JL "@HShift" } |4.4cx { - "@HSpan" + "@HShift" + @JL "@HSpan" @JL "@Include" @JL "@IncludeGraphic" @JL "@Insert" @@ -157,6 +160,7 @@ do so. The complete list of predefined identifiers is @JL "@Scale" @JL "@SetColor" @JL "@SetColour" + @JL "@SetHeaderComponent" @JL "@Space" @JL "@StartHSpan" @JL "@StartHVSpan" diff --git a/doc/expert/mydefs b/doc/expert/mydefs index 0a4d364..92f9871 100644 --- a/doc/expert/mydefs +++ b/doc/expert/mydefs @@ -14,91 +14,95 @@ # # ################################################### - def @@BackEnd { @Code "@BackEnd" } - def @@Background { @Code "@Background" } - def @@Begin { @Code "@Begin" } - def @@Break { @Code "@Break" } - def @@Case { @Code "@Case" } - def @@Char { @Code "@Char" } - def @@Common { @Code "@Common" } - def @@CurrLang { @Code "@CurrLang" } - def @@CurrFamily { @Code "@CurrFamily" } - def @@CurrFace { @Code "@CurrFace" } - def @@CurrYUnit { @Code "@CurrYUnit" } - def @@CurrZUnit { @Code "@CurrZUnit" } - def @@Database { @Code "@Database" } - def @@End { @Code "@End" } - def @@Enclose { @Code "@Enclose" } - def @@Font { @Code "@Font" } - def @@ForceGalley { @Code "@ForceGalley" } - def @@Galley { @Code "@Galley" } - def @@Graphic { @Code "@Graphic" } - def @@HAdjust { @Code "@HAdjust" } - def @@HCover { @Code "@HCover" } - def @@HContract { @Code "@HContract" } - def @@HExpand { @Code "@HExpand" } - def @@HLimited { @Code "@HLimited" } - def @@High { @Code "@High" } - def @@HScale { @Code "@HScale" } - def @@HShift { @Code "@HShift" } - def @@HSpan { @Code "@HSpan" } - def @@Include { @Code "@Include" } - def @@IncludeGraphic { @Code "@IncludeGraphic" } - def @@KernShrink { @Code "@KernShrink" } - def @@Key { @Code "@Key" } - def @@Language { @Code "@Language" } - def @@LClos { @Code "@LClos" } - def @@LEnv { @Code "@LEnv" } - def @@LInput { @Code "@LInput" } - def @@LUse { @Code "@LUse" } - def @@LVis { @Code "@LVis" } - def @@Meld { @Code "@Meld" } - def @@Merge { @Code "@Merge" } - def @@Moment { @Code "@Moment" } - def @@Next { @Code "@Next" } - def @@NotRevealed { @Code "@NotRevealed" } - def @@Null { @Code "@Null" } - def @@OneCol { @Code "@OneCol" } - def @@OneOf { @Code "@OneOf" } - def @@OneRow { @Code "@OneRow" } - def @@Open { @Code "@Open" } - def @@Outline { @Code "@Outline" } - def @@PAdjust { @Code "@PAdjust" } - def @@PageLabel { @Code "@PageLabel" } - def @@PlainGraphic { @Code "@PlainGraphic" } - def @@PrependGraphic { @Code "@PrependGraphic" } - def @@RawVerbatim { @Code "@RawVerbatim" } - def @@Rotate { @Code "@Rotate" } - def @@Rump { @Code "@Rump" } - def @@Insert { @Code "@Insert" } - def @@Scale { @Code "@Scale" } - def @@SetColor { @Code "@SetColor" } - def @@SetColour { @Code "@SetColour" } - def @@Space { @Code "@Space" } - def @@StartHSpan { @Code "@StartHSpan" } - def @@StartVSpan { @Code "@StartVSpan" } - def @@StartHVSpan { @Code "@StartHVSpan" } - def @@SysDatabase { @Code "@SysDatabase" } - def @@SysInclude { @Code "@SysInclude" } - def @@SysIncludeGraphic { @Code "@SysIncludeGraphic" } - def @@SysPrependGraphic { @Code "@SysPrependGraphic" } - def @@Tag { @Code "@Tag" } - def @@Tagged { @Code "@Tagged" } - def @@Underline { @Code "@Underline" } - def @@Use { @Code "@Use" } - def @@VAdjust { @Code "@VAdjust" } - def @@VContract { @Code "@VContract" } - def @@VCover { @Code "@VCover" } - def @@VExpand { @Code "@VExpand" } - def @@Verbatim { @Code "@Verbatim" } - def @@VLimited { @Code "@VLimited" } - def @@VScale { @Code "@VScale" } - def @@VShift { @Code "@VShift" } - def @@VSpan { @Code "@VSpan" } - def @@Wide { @Code "@Wide" } - def @@Yield { @Code "@Yield" } - def @@YUnit { @Code "@YUnit" } - def @@ZUnit { @Code "@ZUnit" } + def @@BackEnd { @Code "@BackEnd" } + def @@Background { @Code "@Background" } + def @@Begin { @Code "@Begin" } + def @@BeginHeaderComponent { @Code "@BeginHeaderComponent" } + def @@Break { @Code "@Break" } + def @@Case { @Code "@Case" } + def @@Char { @Code "@Char" } + def @@ClearHeaderComponent { @Code "@ClearHeaderComponent" } + def @@Common { @Code "@Common" } + def @@CurrLang { @Code "@CurrLang" } + def @@CurrFamily { @Code "@CurrFamily" } + def @@CurrFace { @Code "@CurrFace" } + def @@CurrYUnit { @Code "@CurrYUnit" } + def @@CurrZUnit { @Code "@CurrZUnit" } + def @@Database { @Code "@Database" } + def @@End { @Code "@End" } + def @@EndHeaderComponent { @Code "@EndHeaderComponent" } + def @@Enclose { @Code "@Enclose" } + def @@Font { @Code "@Font" } + def @@ForceGalley { @Code "@ForceGalley" } + def @@Galley { @Code "@Galley" } + def @@Graphic { @Code "@Graphic" } + def @@HAdjust { @Code "@HAdjust" } + def @@HCover { @Code "@HCover" } + def @@HContract { @Code "@HContract" } + def @@HExpand { @Code "@HExpand" } + def @@HLimited { @Code "@HLimited" } + def @@High { @Code "@High" } + def @@HScale { @Code "@HScale" } + def @@HShift { @Code "@HShift" } + def @@HSpan { @Code "@HSpan" } + def @@Include { @Code "@Include" } + def @@IncludeGraphic { @Code "@IncludeGraphic" } + def @@KernShrink { @Code "@KernShrink" } + def @@Key { @Code "@Key" } + def @@Language { @Code "@Language" } + def @@LClos { @Code "@LClos" } + def @@LEnv { @Code "@LEnv" } + def @@LInput { @Code "@LInput" } + def @@LUse { @Code "@LUse" } + def @@LVis { @Code "@LVis" } + def @@Meld { @Code "@Meld" } + def @@Merge { @Code "@Merge" } + def @@Moment { @Code "@Moment" } + def @@Next { @Code "@Next" } + def @@NotRevealed { @Code "@NotRevealed" } + def @@Null { @Code "@Null" } + def @@OneCol { @Code "@OneCol" } + def @@OneOf { @Code "@OneOf" } + def @@OneRow { @Code "@OneRow" } + def @@Open { @Code "@Open" } + def @@Outline { @Code "@Outline" } + def @@PAdjust { @Code "@PAdjust" } + def @@PageLabel { @Code "@PageLabel" } + def @@PlainGraphic { @Code "@PlainGraphic" } + def @@PrependGraphic { @Code "@PrependGraphic" } + def @@RawVerbatim { @Code "@RawVerbatim" } + def @@Rotate { @Code "@Rotate" } + def @@Rump { @Code "@Rump" } + def @@Insert { @Code "@Insert" } + def @@Scale { @Code "@Scale" } + def @@SetColor { @Code "@SetColor" } + def @@SetColour { @Code "@SetColour" } + def @@SetHeaderComponent { @Code "@SetHeaderComponent" } + def @@Space { @Code "@Space" } + def @@StartHSpan { @Code "@StartHSpan" } + def @@StartVSpan { @Code "@StartVSpan" } + def @@StartHVSpan { @Code "@StartHVSpan" } + def @@SysDatabase { @Code "@SysDatabase" } + def @@SysInclude { @Code "@SysInclude" } + def @@SysIncludeGraphic { @Code "@SysIncludeGraphic" } + def @@SysPrependGraphic { @Code "@SysPrependGraphic" } + def @@Tag { @Code "@Tag" } + def @@Tagged { @Code "@Tagged" } + def @@Underline { @Code "@Underline" } + def @@Use { @Code "@Use" } + def @@VAdjust { @Code "@VAdjust" } + def @@VContract { @Code "@VContract" } + def @@VCover { @Code "@VCover" } + def @@VExpand { @Code "@VExpand" } + def @@Verbatim { @Code "@Verbatim" } + def @@VLimited { @Code "@VLimited" } + def @@VScale { @Code "@VScale" } + def @@VShift { @Code "@VShift" } + def @@VSpan { @Code "@VSpan" } + def @@Wide { @Code "@Wide" } + def @@Yield { @Code "@Yield" } + def @@YUnit { @Code "@YUnit" } + def @@ZUnit { @Code "@ZUnit" } ################################################### diff --git a/doc/expert/pre b/doc/expert/pre index 02320cc..c21b866 100644 --- a/doc/expert/pre +++ b/doc/expert/pre @@ -34,6 +34,7 @@ @Include { pre_mome } @Include { pre_null } @Include { pre_gall } +@Include { pre_head } @Include { pre_notr } @Include { pre_cros } @Include { pre_tagg } diff --git a/doc/expert/pre_head b/doc/expert/pre_head new file mode 100644 index 0000000..eb3d397 --- /dev/null +++ b/doc/expert/pre_head @@ -0,0 +1,113 @@ +@Section + @Title { "@BeginHeaderComponent", "@EndHeaderComponent", +"@SetHeaderComponent", and "@ClearHeaderComponent" } + @Tag { header_comp } +@Begin +@PP +Informally, header components are running headers that appear at the +header.component @Index { Header component of galley } +top of the displayed segments of galleys. They are used, for example, +by the @Code "@Tbl" table formatting package to place running headers +at the top of each page of a multi-page table, after the first page. +@PP +Formally, a header component of a galley is an ordinary component of +a galley (Section {@NumberOf targets}) together with an indication +that the component is a header component. When printed, a header +component looks exactly like it would have done as an ordinary +component; the difference is in whether the component is printed at all, +and if so where. +@PP +Every ordinary component of every galley has associated with it a +sequence of zero or more header components. Whenever a new target +is attached to which does not itself occupy an entire component +of its galley, copies of the header components associated with the +first ordinary component to be promoted into that target are +promoted into it first. +@PP +The condition `which does not itself occupy an entire component +of its galley' ensures that, for example, when part of a section +has header components, these are not printed where the section is +promoted into its chapter, but rather where the chapter is promoted +onto pages. If the target occupies the whole component, then the +incoming galley will not split at all, so headers would be of no +interest there. +@PP +The one remaining question is `How is the sequence of header +components of each ordinary component determined?' By default, +the header components of one component are the same as those +of the previous component. We can show this graphically as +follows: +@ID lines @Break @Eq { +C sub i : H sub 1 , H sub 2 ,..., H sub n +"/" +C sub i+1 : H sub 1 , H sub 2 ,..., H sub n +} +which may be read: `If ordinary component @E { C sub i } has +header component sequence @E { H sub 1 , H sub 2 ,..., H sub n }, +then its successor component @E { C sub i+1 } has header component +sequence @E { H sub 1 , H sub 2 ,..., H sub n } also.' Using this +notation, we may now define the four symbols that affect header +component sequences: +@ID lines @Break @Eq { +C sub i : H sub 1 , H sub 2 ,..., H sub n +"/" +gap `` @@BeginHeaderComponent `` H sub n+1 +"/" +C sub i+1 : H sub 1 , H sub 2 ,..., H sub n , H sub n+1 +} +That is, @@BeginHeaderComponent occupying an entire +begin.header.component.sym @Index { @@BeginHeaderComponent symbol } +component appends a header component to the sequence of the +following ordinary components. When printed, this header +component is separated by @E { gap } from the following component; +if @E { gap } is empty it denotes @Code { 0ie } as usual with +concatenation gaps. The appearance of the header component will be +exactly as it would have been had it occurred alone at that point, +rather than after @@BeginHeaderComponent. +@PP +Next comes @@EndHeaderComponent: +@ID lines @Break @Eq { +C sub i : H sub 1 , H sub 2 ,..., H sub n , H sub n+1 +"/" +@@EndHeaderComponent +"/" +C sub i+1 : H sub 1 , H sub 2 ,..., H sub n +} +That is, @@EndHeaderComponent (which has no parameters) occupying an +end.header.component.sym @Index { @@EndHeaderComponent symbol } +entire component deletes the last header component. If the sequence is +empty, a warning message is printed and it remains +empty. @@BeginHeaderComponent and @@EndHeaderComponent are naturally +used in matching (possibly nested) pairs, to introduce and subsequently +retract a header component. +@PP +Next comes @@SetHeaderComponent: +@ID lines @Break @Eq { +C sub i : H sub 1 , H sub 2 ,..., H sub n +"/" +gap `` @@SetHeaderComponent `` H sub n+1 +"/" +C sub i+1 : H sub n+1 +} +@@SetHeaderComponent clears any current header components +set.header.component.sym @Index { @@SetHeaderComponent symbol } +and replaces them by one of its own. Finally we have +@@ClearHeaderComponent: +@ID lines @Break @Eq { +C sub i : H sub 1 , H sub 2 ,..., H sub n +"/" +@@ClearHeaderComponent +"/" +C sub i+1 : +} +This symbol clears any header components, leaving the sequence empty. These +clear.header.component.sym @Index { @@ClearHeaderComponent symbol } +last two symbols combine less cleanly than the first two (either will +wreck any enclosing @@BeginHeaderComponent -- @@EndHeaderComponent pair), +but they are useful in situations where the range of one header is +terminated by the start of the range of the next. +@PP +All four symbols yield the value @@Null where they appear. If they +do not occupy entire components of their galley, they are silently +ignored. +@End @Section diff --git a/doc/expert/preface b/doc/expert/preface index 9e37913..826487f 100644 --- a/doc/expert/preface +++ b/doc/expert/preface @@ -21,7 +21,7 @@ This manual presents Version 3 of Basser Lout, publicly released in September 1994 @Cite { $kingston1995lout.program }. This manual was rendered into PostScript postscript @Index { PostScript } -by Version 3.18 of the Basser Lout interpreter, using the symbols +by Version 3.19 of the Basser Lout interpreter, using the symbols described in the User's Guide @Cite { $kingston1995lout.user }. @DP @Heading { Acknowledgment. } Version 3 has benefited from hundreds of diff --git a/doc/slides/README b/doc/slides/README index 66d5a78..9279092 100644 --- a/doc/slides/README +++ b/doc/slides/README @@ -15,4 +15,4 @@ after the second run. A copy of the final outfile.ps is included. Jeff Kingston -26 February 2000 +9 March 2000 diff --git a/doc/user/README b/doc/user/README index 2363b0c..0fc5704 100644 --- a/doc/user/README +++ b/doc/user/README @@ -6,7 +6,7 @@ type the command lout all > op -in this directory. This must be done five times to completely +in this directory. This must be done six times to completely resolve all cross references, although the PostScript file op is printable after the first run. Auxiliary files with .li and .ld suffixes will be created in this directory. @@ -31,7 +31,7 @@ repeated failure to converge, caused by footnotes and floating figures close to large unbreakable displays. A copy of the final PostScript output file (A4 paper size) is -stored at "ftp://ftp.cs.su.oz.au/jeff/lout/lout-3.18.user.ps.gz". +stored at "ftp://ftp.cs.su.oz.au/jeff/lout/lout-3.19.user.ps.gz". Jeffrey H. Kingston -23 February 2000 +9 March 2000 diff --git a/doc/user/all b/doc/user/all index ef7fcdf..a4bb049 100644 --- a/doc/user/all +++ b/doc/user/all @@ -20,8 +20,8 @@ Lout Document Formatting System } @Author { Jeffrey H. Kingston } - @Edition { Version 3.18 -February, 2000 } + @Edition { Version 3.19 +March, 2000 } @Publisher { Copyright @CopyRight 1991, 2000 Jeffrey H. Kingston, Basser Department of Computer Science, diff --git a/doc/user/equ_summ b/doc/user/equ_summ index b1e6fbc..9f9bf66 100644 --- a/doc/user/equ_summ +++ b/doc/user/equ_summ @@ -516,6 +516,8 @@ ragged @Break { "ddots" @Dbl @Eq { ddots } "del" @Dbl @Eq { del } "grad" @Dbl @Eq { grad } +"triangleup" @Dbl @Eq { triangleup } +"triangledown" @Dbl @Eq { triangledown } "..." @Dbl @Eq { ... } ",...," @Dbl @Eq { ,..., } "half" @Dbl @Eq { half } diff --git a/doc/user/preface b/doc/user/preface index 9b3e964..3634a89 100644 --- a/doc/user/preface +++ b/doc/user/preface @@ -18,7 +18,7 @@ gnu. @Index { GNU Public License } primary source is directory @ID @Code "ftp://ftp.cs.usyd.edu.au/jeff/lout" in which may be found a gzipped tar file containing the main distribution -(currently {@Code "lout-3.18.tar.gz"}), and various other things including +(currently {@Code "lout-3.19.tar.gz"}), and various other things including a PostScript version of this guide. The distribution contains source code, libraries, documentation, license, and installation instructions. @PP diff --git a/doc/user/str_indx b/doc/user/str_indx index c9ea2de..3c15c09 100644 --- a/doc/user/str_indx +++ b/doc/user/str_indx @@ -161,20 +161,13 @@ trial of, 205--211 trial of, 242 trial of, 395 } -must be merged, what does Lout do? It takes the second entry, discards -any initial part that is the same as the first entry ({@Code "trial of,"} -in this case), and, if anything remains, it adds a comma, a space, and -the remainder to the first entry, producing -@ID { trial of, 205--211, 242 } -in this case. This process is repeated on this and the third entry, -producing -@ID { trial of, 205--211, 242, 395 } -in this case, and so on. The entries are merged in the order in which -their points of origin appear in the final printed document. +must be merged, what does Lout do? Without being too formal, it +finds the shortest larger entry that contains everything in the +given entries, more or less, preserving the order in which +the entries' points of origin appear in the final printed document. @PP -If nothing remains after discarding the common initial part, nothing is -added to the growing merged entry; in effect, the entry that could -contribute nothing new is deleted. With this in mind, let us return to +If the entries are not different at all, then the result will be +the same as each of them. With this in mind, let us return to our initial, ambitious example: @ID @OneRow lines @Break { Galileo Galilei @@ -260,14 +253,17 @@ The remainder of this section describes how to change the appearance of the index by setting options in the setup file. For setup files and their options in general, consult Section {@NumberOf setup}. @PP -There are five setup file options for the index. Here they are with +There are eight setup file options for the index. Here they are with their default values: -@ID @OneRow @Code { -"@MakeIndex { No }" -"@IndexFont { }" -"@IndexBreak { oragged 1.2fx }" -"@IndexColumnNumber { 2 }" -"@IndexColumnGap { 1.00c }" +@ID @OneRow @Code @Verbatim { +@MakeIndex { No } +@IndexFont { } +@IndexBreak { oragged 1.2fx } +@IndexColumnNumber { 2 } +@IndexColumnGap { 1.00c } +@IndexCtd { Yes } +@IndexCtdWord { continued } +@IndexCtdFormat { @Body @I (@CtdWord) } } The @Code "@MakeIndex" option, which may be @Code Yes or {@Code No}, makeindex. @Index @Code "@MakeIndex" @@ -291,6 +287,31 @@ number of index columns per page, and the gap between them, and are exactly analogous to the @Code "@ColumnNumber" and @Code "@ColumnGap" options described in Section {@NumberOf columns}. @PP +The last three options work together to control the appearance of +running headers +@FootNote { +Index running headers are new in Version 3.19 of Lout. +} +in the index. If an @Code "@Index" entry has @Code "@SubIndex" entries +that run over to the next column, Lout will print an unobtrusive running +header at the top of that column, something like this in English: +@ID { procrastination @I (ctd.) } +It will print two running headers if a @Code "@SubIndex" entry has +@Code "@SubSubIndex" entries that run over, one for the main entry and an +indented one for the sub-entry. You can turn off these running headers by +setting @Code "@IndexCtd" to {@Code No}. A particular word is associated +with index running headers; by default it is @Code "ctd." in English and +its equivalent in other languages. This is what the default value, +{@Code "continued"}, of the @Code "@IndexCtdWord" option gives you; if you +want some other word, change that option to the word you want. Finally, +you can control the format of the running headers using +{@Code "@IndexCtdFormat"}. Within this option, the symbol @Code "@Body" +stands for the value of the index entry that is running over (minus any +page numbers), and @Code "@CtdWord" stands for the word produced by the +@Code "@IndexCtdWord" option. The default value of {@Code "@IndexCtdFormat"}, +shown above, yields the index entry followed by @Code "@IndexCtdWord" in +italics and parentheses. +@PP Lout offers the possibility of having up to three independent indexes (useful for glossaries, author indexes, etc.). The other two are called index A and index B, and they precede the main index in the diff --git a/doc/user/tbl b/doc/user/tbl index 5ed15e1..545e867 100644 --- a/doc/user/tbl +++ b/doc/user/tbl @@ -9,6 +9,7 @@ tables. @Index { tables } aindent { ctr } arulebelow { double } aformat { @StartHSpan @Cell @B X | | @HSpan } + bindent { align } bformat { @Cell rr { no } @I A | @Cell rl { no } B | @Cell C } rule { yes } { @@ -39,14 +40,14 @@ Section {@NumberOf tbl_alig} for the details. @Include { tbl_intr } # introduction @Include { tbl_cell } # basic cell formatting: font, break, width, paint @Include { tbl_rows } # row formats and the @Row symbol +@Include { tbl_rule } # rules @Include { tbl_marg } # margins @Include { tbl_widt } # width and height @Include { tbl_inde } # indenting and struts -@Include { tbl_rule } # rules -@Include { tbl_span } # spanning columns and rows -@Include { tbl_mult } # multi-page tables @Include { tbl_alig } # aligned columns and headings over them +@Include { tbl_span } # spanning columns and rows @Include { tbl_mark } # @MarkRow +@Include { tbl_mult } # multi-page tables @Include { tbl_plai } # plain text tables @Include { tbl_setu } # setup file options @Include { tbl_summ } # summary diff --git a/doc/user/tbl_alig b/doc/user/tbl_alig index 0032e86..69e5588 100644 --- a/doc/user/tbl_alig +++ b/doc/user/tbl_alig @@ -28,21 +28,19 @@ each entry: @Rowa A { 5772^ } } } -The equals signs of equations can be aligned in the same way (see the -example at the start of this chapter). +The equals signs of equations can be aligned in the same way. @PP Owing to problems behind the scenes, in a column in which one cell is labelled {@Code "indent { align }"}, all the other cells have to be so labelled, otherwise Lout make a mess of things. This is a problem when we want to get a heading over the top of an aligned column: if -we follow the rule, the @I heading gets aligned, which is wrong; but -if we don't, Lout makes a mess of things. There is no ideal solution -to this problem. +we follow the rule, the @I heading gets aligned, which is wrong. There +is no ideal solution to this problem. @PP What most people want is for the heading to be centred in the column, and the aligned entries to be centred in the column as a block, but Lout cannot do this. One approximation is to make the heading cell a spanning -cell with centring, like this: +cell (Section {@NumberOf tbl_span}) with centring, like this: @FootNote { Lout does not currently accept single-column tables with {@Code "@StartHSpan"}, so we've had to add an empty second column. } @@ -50,22 +48,22 @@ an empty second column. } @Tbl marginvertical { 0.5vx } aformat { @StartHSpan @Cell indent { ctr } @B A | } - bformat { @Cell A | } + bformat { @Cell indent { align } A | } { -@Rowa A { Heading } +@Rowa A { Head } @Rowb A { 5^.46 } @Rowb A { 3^.4159 } @Rowb A { 5772^ } } } -The spanning quarantines the centred cell from the aligned cells, -permitting @Code "indent { ctr }" to work: +The spanning quarantines the centred cell, permitting +@Code "indent { ctr }" to work: @CD @OneRow @Tbl marginvertical { 0.5vx } aformat { @StartHSpan @Cell indent { ctr } @B A | } - bformat { @Cell A | } + bformat { @Cell indent { align } A | } { -@Rowa A { V } marginabove { 0i } +@Rowa A { Head } marginabove { 0i } @Rowb A { 5^.46 } @Rowb A { 3^.4159 } @Rowb A { 5772^ } marginbelow { 0i } @@ -74,7 +72,7 @@ But if the heading cell is wider than the aligned cells, you get this: @CD @OneRow @Tbl marginvertical { 0.5vx } aformat { @StartHSpan @Cell indent { ctr } @B A | } - bformat { @Cell A | } + bformat { @Cell indent { align } A | } { @Rowa A { A Wider Heading } marginabove { 0i } @Rowb A { 5^.46 } @@ -87,17 +85,19 @@ respect to a heading. In these cases you could forget about @Code "@StartHSpan" and treat the heading as an aligned entry, either by placing a @Code "^" within it or by using @ID @Code "@Cell 0.5w @HShift A" -which places the alignment point in the centre of the entry. -#@CD @OneRow @Tbl -# marginvertical { 0.5vx } -# aformat { @Cell 0.5w @HShift @B A } -# bformat { @Cell A } -#{ -#@Rowa A { A Wider Heading } marginabove { 0i } -#@Rowb A { 5^.46 } -#@Rowb A { 3^.4159 } -#@Rowb A { 5772^ } marginbelow { 0i } -#} -You can move the alignment point about by changing the 0.5. Of course, -all this is a poor substitute for the real thing. +which places the alignment point in the centre of the entry: +@CD @OneRow @Tbl + indent { align } + marginvertical { 0.5vx } + aformat { @Cell 0.5w @HShift @B A } + bformat { @Cell A } +{ +@Rowa A { A Wider Heading } marginabove { 0i } +@Rowb A { 5^.46 } +@Rowb A { 3^.4159 } +@Rowb A { 5772^ } marginbelow { 0i } +} +You can move the alignment point about by changing the 0.5 to something +smaller or larger. Of course, all this is a poor substitute for the +real thing. @End @Section diff --git a/doc/user/tbl_inde b/doc/user/tbl_inde index 22f89cc..62080c0 100644 --- a/doc/user/tbl_inde +++ b/doc/user/tbl_inde @@ -7,20 +7,21 @@ By default, entries appear at the left within cells, not counting the cell margin. The @Code indent option causes entries to be indented horizontally. For example, @ID @OneRow @Code "@Cell indent { ctr }" -horizontally centres the entry within the cell. The other possible values +horizontally centres the entry within the cell. Other possible values centred.entries @Index { centred entries in tables } right.justified.entries @Index { right justified entries in tables } -of this option are {@Code "left"} (the default value), {@Code "right"}, +are {@Code "left"} (the default value), {@Code "right"}, {@Code "align"} (Section {@NumberOf tbl_alig}), or any length (for example, {@Code 2f}) meaning that much indent. @PP There is a corresponding @Code "indentvertical" option for vertical indenting within the cell. It takes the same values except that @Code "left" is -renamed {@Code "top"}, @Code "right" is renamed {@Code foot}. A common -problem with vertical placement is that words that lack ascenders (parts -of letters that rise up) or descenders (parts that sink down) can easily -become misaligned with words that don't. Looking at +renamed {@Code "top"} (the default), and @Code "right" is renamed +{@Code foot}. A common problem with vertical placement is that words that +lack ascenders (parts of letters that rise up) or descenders (parts that +sink down) can easily become misaligned. Looking at @CD @Tbl + mv { 0i } aformat { @Cell A | @Cell B | @Cell C } { @Rowa @@ -39,10 +40,8 @@ which is the result of C { title } } } -we see that the words are aligned correctly despite the absence of -ascenders from the first two words, and of descenders from the first -and last; and this despite the fact that these words are vertically -placed at the top of the cell. This is because by default +we see that the words are aligned correctly despite these +worries. This is because by default @Code "@Tbl" adds a @I { vertical strut } to each entry: an invisible object of zero width and height {@Code "1f"}, which covers for any absent ascenders and descenders. The option diff --git a/doc/user/tbl_intr b/doc/user/tbl_intr index a46da18..51524cb 100644 --- a/doc/user/tbl_intr +++ b/doc/user/tbl_intr @@ -50,23 +50,23 @@ tbl. @Index @Code "@Tbl" C { Homer } } is produced by the following input: -@ID @OneRow @Code { -"@Tbl" -" aformat { @Cell A | @Cell B | @Cell C }" -"{" -"@Rowa" -" A { Austen }" -" B { Chaucer }" -" C { Donne }" -"@Rowa" -" A { Balzac }" -" B { Darwin }" -" C { Goethe }" -"@Rowa" -" A { Byron }" -" B { Dickens }" -" C { Homer }" -"}" +@ID @OneRow @Code @Verbatim { +@Tbl + aformat { @Cell A | @Cell B | @Cell C } +{ +@Rowa + A { Austen } + B { Chaucer } + C { Donne } +@Rowa + A { Balzac } + B { Darwin } + C { Goethe } +@Rowa + A { Byron } + B { Dickens } + C { Homer } +} } Immediately after the @Code "@Tbl" symbol, which introduces the table, comes a @I { format option }, {@Code "aformat"}, describing the format of diff --git a/doc/user/tbl_marg b/doc/user/tbl_marg index 89e63cd..ddbab55 100644 --- a/doc/user/tbl_marg +++ b/doc/user/tbl_marg @@ -61,7 +61,7 @@ We've used abbreviated versions of the options' names: @Code "ml" for has such an abbreviated name, made from the first letters of the parts of its full name (Section {@NumberOf tbl_summ} lists all these names). The result is -@CD @Tbl +@DP @RCD @Tbl paint { lightgrey } aformat { @Cell ml { 0i } A | @Cell B | @Cell mr { 0i } C } { @@ -70,5 +70,5 @@ result is B { Column B } C { Column C } } -with the painting showing the reduced margins. +# with the painting showing the reduced margins. @End @Section diff --git a/doc/user/tbl_mark b/doc/user/tbl_mark index fcd4768..51d71e7 100644 --- a/doc/user/tbl_mark +++ b/doc/user/tbl_mark @@ -9,21 +9,21 @@ and right becomes an issue. Examples are hard to find, but let's say that we need to construct a symbol @ID @AmberLight and include it in running text. The obvious first attempt at a table -with three rows produces -#@ID @OneRow @Code @Verbatim { -#@Tbl -# aformat { @Cell A } -# margin { 0i } -# strut { no } -#{ -#@Rowa A { @OpenCircle } -#@Rowa A { @ClosedCircle } -#@Rowa A { @OpenCircle } -#} -#} -#where @Code "@OpenCircle" and @Code "@ClosedCircle" produce open and -#closed circles (they may be defined using the @Code "@Diag" package); -#but this produces +with three rows is +@ID @OneRow @Code @Verbatim { +@Tbl + aformat { @Cell A } + margin { 0i } + strut { no } +{ +@Rowa A { @OpenCircle } +@Rowa A { @ClosedCircle } +@Rowa A { @OpenCircle } +} +} +where @Code "@OpenCircle" and @Code "@ClosedCircle" produce open and +closed circles (they may be defined using the @Code "@Diag" package); +but this produces @Tbl aformat { @Cell A } margin { 0i } @@ -47,7 +47,8 @@ def @AmberLight aformat { @Cell indentvertical { align } A } margin { 0i } strut { no } - paint { no } rule { no } + paint { no } + rule { no } { @Rowa A { @OpenCircle } @MarkRowa A { @ClosedCircle } diff --git a/doc/user/tbl_mult b/doc/user/tbl_mult index 84ce363..3b83b8b 100644 --- a/doc/user/tbl_mult +++ b/doc/user/tbl_mult @@ -34,10 +34,95 @@ rightmost column to the full page width; one way to prevent this is to add a @Code "|" after the last cell within each {@Code format} option, creating an empty extra column. @PP -The simplest way to get rules right in multi-page tables is to set -@Code "rulehorizontal" to {@Code yes}. This places a rule above every -row including the first on each page, and a rule below every row including -the last on each page. +One practical problem with multi-page tables is that of getting a +heading over every page after the first. This is easy if you know where +the page breaks are going to fall (if you are using {@Code "@NP"}, for +example), but you usually don't. To solve this problem, @Code {"@Tbl"} +offers the @Code "@HeaderRowa" ... @Code "@HeaderRowh" and +@Code "@EndHeaderRow" symbols. For example, the multi-page table in +Section {@NumberOf tbl_summ} is arranged like this: +@ID @OneRow @Code @Verbatim { +@Tbl + ... +{ +@Rowd + A { Option names } + B { Default in PS, PDF } + C { Default in plain text } + D { Allowed values } + rulebelow { yes } +@HeaderRowd + A { Option names (ctd.) } + B { Default in PS, PDF } + C { Default in plain text } + D { Allowed values } + rulebelow { yes } +@Rowa + A { paint p } + B { nopaint } + D { any colour from Section {@NumberOf colour} } +... +@Rowa + A { ruleplainchar rpc } + C { . } + D { any simple word e.g. @Code + } + rulebelow { yes } +@EndHeaderRow +} +} +where we have omitted a lot of irrelevant things. @Code "@HeaderRowd" +is exactly like {@Code "@Rowd"}, except that the row is not printed at +all where it occurs; instead, it is saved up and used as a running header +on subsequent pages. +@PP +The @Code "@EndHeaderRow" symbol goes where a @Code "@Row" symbol might +go. Notice that it does not end with a letter between {@Code a} and +{@Code h}, and that it has no options. Its meaning is that the most +recent running header is not wanted on pages after this point: in other +words, it cancels the previous @Code "@HeaderRowa" ... @Code "@HeaderRowh" +symbol. Forgetting @Code "@EndHeaderRow" is disastrous, because every page +from this point on will then have the running header, even though the table +ended long before. +@PP +There may be any number of header rows saved up at any moment, all to be +printed at the top of subsequent pages. Having @Code "@EndHeaderRow" +allows them to be `nested.' For example, just schematically, +@ID @OneRow @Code @Verbatim { +@HeaderRowa ... +@HeaderRowb ... +@EndHeaderRow +@HeaderRowb ... +@EndHeaderRow +@EndHeaderRow +} +could be used in a table to say that the entire table has the first +header row; and that the first part also has the second header row, +but the second part of the table has a different second header row, +but still the same first header row. +@PP +These header symbols have some peculiarities not likely to trouble the +ordinary user, but worth pointing out. Each copy of a running header +will be identical to every other copy, so any attempt to use cross +references to add (say) page numbers to the running header is doomed to +disappointment. (If you want to change the header, use +@Code "@EndHeaderRow" followed by a new header row.) Basser Lout +copies running header rows into the table after each page break, +with no check on whether the next page has enough space to +accommodate them, so if your running headers are so high that +there is no room for ordinary rows on the page after they are +inserted, then the document will never end. Finally, header +rows are taken account of by Lout when deciding column widths, +whether they are actually printed or not. +@PP +Another practical problem in multi-page tables is getting the rules +right. The simplest way to do this is to set @Code "rulehorizontal" +to {@Code yes}. This places a rule above every row including the +first on each page, and a rule below every row including the last +on each page. There is nothing equivalent to running headers +at the bottom of the page -- nothing that would allow you to +insert a rule after the last line of each page, but not +elsewhere. (However, if you are using the @Code "@Table" +symbol, its @Code "@Enclose" option can be used to do this.) @PP To prevent page breaks within a table, precede the @Code "@Tbl" symbol by {@Code "@OneRow"}: @@ -46,7 +131,7 @@ symbol by {@Code "@OneRow"}: object into a single, unbreakable row. Make sure your table is small enough to fit on one page when you do this, otherwise an error message will be printed and it will be scaled to fit. Of course, we -have just said that display symbols like @Code "@CD" do this anyway, +said earlier that display symbols like @Code "@CD" do this anyway, but that might change some day. @PP To prevent a page break between two particular rows, but not in diff --git a/doc/user/tbl_rows b/doc/user/tbl_rows index 7d26b75..d7950b1 100644 --- a/doc/user/tbl_rows +++ b/doc/user/tbl_rows @@ -5,11 +5,11 @@ @PP We've seen that the @Code aformat option of @Code "@Tbl" determines the format of the rows introduced by the @Code "@Rowa" symbol. There are -eight of these row format options: {@Code aformat}, +eight row format options: {@Code aformat}, row.formats @Index { row formats in tables } {@Code bformat}, and so on up to {@Code hformat}, and for each there is a corresponding {@Code "@Row"} symbol: {@Code "@Rowa"}, {@Code "@Rowb"}, -and so on up to {@Code "@Rowh"}: +and so on: @ID @OneRow @Code @Verbatim { @Tbl aformat { @Cell @I A | @Cell @I B } diff --git a/doc/user/tbl_rule b/doc/user/tbl_rule index 383ffab..25858df 100644 --- a/doc/user/tbl_rule +++ b/doc/user/tbl_rule @@ -5,9 +5,9 @@ @PP There is a @Code "rule" option for drawing a rule around a cell: @ID @OneRow @Code "@Cell rule { yes }" -The other possible values are {@Code no} (the default), -{@Code single} (the same as {@Code yes}), and {@Code double}, which -draws a double rule. +Other values are {@Code no} (the default), +{@Code single} (the same as {@Code yes}), and {@Code double} (for a +double rule). @PP There are @Code "rulehorizontal" and @Code "rulevertical" options which draw only horizontal or vertical rules, and also {@Code "ruleabove"}, @@ -83,7 +83,7 @@ above, below, left, and right rules: B { rulerightgap } C { rulerightcolour } } -As usual, all these options have abbreviated names; and @Code { colour } +All these options have alternative, abbreviated names; and @Code { colour } may be spelt @Code { color } wherever it appears. Section {@NumberOf tbl_summ} has a complete summary of all spellings of all options. @@ -91,19 +91,22 @@ options. To clarify exactly where the rules are drawn, let's start with a cell with no rules at all: @CD @Tbl - aformat { @Cell width { 3c } height { 1.5c } paint { lightgrey } A } + mv { 0i } + aformat { @Cell width { 3c } height { 1.2c } paint { lightgrey } A } { @Rowa } Above rules and left rules are drawn within the cell boundary, just touching it, with any above rule overstriking any left rule: @CD { @Tbl - aformat { @Cell width { 3c } height { 1.5c } paint { lightgrey } A } + mv { 0i } + aformat { @Cell width { 3c } height { 1.2c } paint { lightgrey } A } { @Rowa } @Background @Tbl - aformat { @Cell width { 3c } height { 1.5c } A } + mv { 0i } + aformat { @Cell width { 3c } height { 1.2c } A } ruleleft { yes } ruleabove { yes } rulehorizontalwidth { 0.8v } @@ -116,18 +119,20 @@ touching it, with any above rule overstriking any left rule: } Below and right rules are drawn just outside the boundary of the cell, also touching it: -@CD @Tbl aformat { @Cell A | @Cell | @Cell B } +@CD @Tbl mv { 0i } aformat { @Cell A | @Cell | @Cell B } { @Rowa A { @Tbl - aformat { @Cell width { 3c } height { 1.5c } paint { lightgrey } A } + mv { 0i } + aformat { @Cell width { 3c } height { 1.2c } paint { lightgrey } A } { @Rowa } @Background @Tbl - aformat { @Cell width { 3c } height { 1.5c } A } + mv { 0i } + aformat { @Cell width { 3c } height { 1.2c } A } rulebelow { yes } rulehorizontalwidth { 0.8v } ruleverticalwidth { 0.5v } @@ -139,13 +144,15 @@ cell, also touching it: } B { @Tbl - aformat { @Cell width { 3c } height { 1.5c } paint { lightgrey } A } + mv { 0i } + aformat { @Cell width { 3c } height { 1.2c } paint { lightgrey } A } { @Rowa } @Background @Tbl - aformat { @Cell width { 3c } height { 1.5c } A } + mv { 0i } + aformat { @Cell width { 3c } height { 1.2c } A } ruleright { yes } rulehorizontalwidth { 0.8v } ruleverticalwidth { 0.5v } @@ -161,13 +168,15 @@ When a right rule is present, any above and below rules are extended by the width of the right rule, and they overstrike it: @CD { @Tbl - aformat { @Cell width { 3c } height { 1.5c } paint { lightgrey } A } + mv { 0i } + aformat { @Cell width { 3c } height { 1.2c } paint { lightgrey } A } { @Rowa } @Background @Tbl - aformat { @Cell width { 3c } height { 1.5c } A } + mv { 0i } + aformat { @Cell width { 3c } height { 1.2c } A } ruleabove { yes } ruleright { yes } rulebelow { yes } @@ -186,7 +195,7 @@ rules of width @Code 0.8v drawn in black, and vertical rules of width rules produce clean corners, and also that a right rule and a neighbouring left rule exactly overstrike each other, as do a below rule and its neighbouring above rule. -@PP -For information about rules in plain text tables, consult Section -{@NumberOf tbl_plai}. +# @PP +# For information about rules in plain text tables, consult Section +# {@NumberOf tbl_plai}. @End @Section diff --git a/doc/user/tbl_summ b/doc/user/tbl_summ index 53f957e..f5d5343 100644 --- a/doc/user/tbl_summ +++ b/doc/user/tbl_summ @@ -37,6 +37,14 @@ PS, PDF } plain text } D { Allowed values } rulebelow { yes } +@HeaderRowd + A { Option names (ctd.) } + B { Default in +PS, PDF } + C { Default in +plain text } + D { Allowed values } + rulebelow { yes } @Rowa A { paint p } B { nopaint } @@ -75,7 +83,7 @@ plain text } C { no } D { {@Code no}, {@Code yes}, or any length } @Rowa -@Rowa + ma { 1v } A { margin m } B { } C { } @@ -103,7 +111,7 @@ plain text } A { marginbelow mb } D { any length } @Rowa -@Rowa + ma { 1v } A { rule r } B { no } C { no } @@ -127,7 +135,7 @@ plain text } A { ruleright rr } D { {@Code no}, {@Code yes}, {@Code single}, or {@Code double} } @Rowa -@Rowa + ma { 1v } A { rulewidth rw } B { 0.05f } D { any length } @@ -152,7 +160,7 @@ plain text } A { rulerightwidth rrw } D { any length } @Rowa -@Rowa + ma { 1v } A { rulegap rg } B { 0.15f } D { any length } @@ -177,7 +185,7 @@ plain text } A { rulerightgap rrg } D { any length } @Rowa -@Rowa + ma { 1v } A { rulecolour rulecolor rc } B { black } D { any colour from Section {@NumberOf colour} } @@ -200,11 +208,12 @@ plain text } A { rulerightcolour rulerightcolor rrc } D { any colour from Section {@NumberOf colour} } @Rowa -@Rowa + ma { 1v } A { ruleplainchar rpc } C { . } D { any simple word e.g. @Code + } rulebelow { yes } +@EndHeaderRow } @DP There are seven places where these options may be given, counting the diff --git a/doc/user/tbl_widt b/doc/user/tbl_widt index b2e39ad..f988962 100644 --- a/doc/user/tbl_widt +++ b/doc/user/tbl_widt @@ -21,8 +21,8 @@ Distributed widely throughout Australia except in the most arid parts; many varieties. } } -This usually looks good, but if you need something else, the @Code width -option may be used to give a particular width to a cell: +This usually looks good, but if you need something else, there is +the @Code width option: @ID @OneRow @Code "@Cell width { 3c }" Here we have asked for a cell width of three centimetres; this includes the cell margins. When using @Code width to fine-tune the appearance of diff --git a/doc/user/vtbl b/doc/user/vtbl index 24f6a4d..164c3f6 100644 --- a/doc/user/vtbl +++ b/doc/user/vtbl @@ -1,2 +1,2 @@ -vi tbl tbl_intr tbl_cell tbl_rows tbl_marg tbl_widt tbl_inde tbl_rule \ - tbl_span tbl_mult tbl_alig tbl_mark tbl_plai tbl_setu tbl_summ +vi tbl tbl_intr tbl_cell tbl_rows tbl_rule tbl_marg tbl_widt tbl_inde \ + tbl_alig tbl_span tbl_mark tbl_mult tbl_plai tbl_setu tbl_summ diff --git a/externs.h b/externs.h index 7e64b36..0ee9b59 100644 --- a/externs.h +++ b/externs.h @@ -1,6 +1,6 @@ /*@externs.h:External Declarations:Directories and file conventions@**********/ /* */ -/* THE LOUT DOCUMENT FORMATTING SYSTEM (VERSION 3.18) */ +/* THE LOUT DOCUMENT FORMATTING SYSTEM (VERSION 3.19) */ /* COPYRIGHT (C) 1991, 2000 Jeffrey H. Kingston */ /* */ /* Jeffrey H. Kingston (jeff@cs.usyd.edu.au) */ @@ -95,7 +95,7 @@ extern nl_catd MsgCat; /* */ /*****************************************************************************/ -#define LOUT_VERSION AsciiToFull("Basser Lout Version 3.18 (February 2000)") +#define LOUT_VERSION AsciiToFull("Basser Lout Version 3.19 (March 2000)") #define CROSS_DB AsciiToFull("lout") #define SOURCE_SUFFIX AsciiToFull(".lt") #define INDEX_SUFFIX AsciiToFull(".li") @@ -135,9 +135,9 @@ extern nl_catd MsgCat; /* LOUT_EPS Name of temporary uncompressed EPS file */ /* */ /* There is one further call to system() in the Lout source code: the one */ -/* that implements filtered parameters such as c2lout. The strings passed */ -/* to this call to system() are the values of @Filter symbols within Lout */ -/* definitions. */ +/* that implements filtered parameters such as prg2lout. The strings */ +/* passed to this call to system() are the values of @Filter symbols */ +/* within Lout definitions. */ /* */ /*****************************************************************************/ @@ -1050,6 +1050,7 @@ typedef union /* foll_or_prec Direction of search for target (forward, back, etc.) */ /* whereto Symbol this galley is targeted at */ /* seen_nojoin TRUE if // op found within galley anywhere */ +/* headers either nilobj or an ACAT of header components */ /* */ /* SPLIT - a split object, used for building tables */ /* */ @@ -1115,6 +1116,9 @@ typedef union /* spanner_broken TRUE after BreakObject() applied to this object */ /* spanner_count Number of columns (rows) spanned by this spanner */ /* spanner_sized Number of cols (rows) of this spanner sized so far */ +/* spanner_fixed Number of cols (rows) of this spanner fixed so far */ +/* save_mark used temporarily by FixAndPrintObject */ +/* constraint Space available for this object as known to MinSize */ /* first child The object that is doing the spanning */ /* */ /* COL_THR (ROW_THR) - object representing all objects on a col (row) mark */ @@ -1170,6 +1174,18 @@ typedef union /* vert_sized TRUE if vertical size of object is known */ /* first child The right parameter of this symbol */ /* */ +/* BEGIN_HEADER, SET_HEADER - @BeginHeaderComponent, @SetHeaderComponent */ +/* */ +/* TOKEN While still being parsed */ +/* SIZED The size of the object (will be 0) */ +/* first child The gap for after this header (before manifesting) */ +/* last child The right parameter of this symbol */ +/* */ +/* END_HEADER, CLEAR_HEADER - @EndHeaderComponent, @ClearHeaderComponent */ +/* */ +/* TOKEN While still being parsed */ +/* SIZED The size of the object (will be 0) */ +/* */ /* ONE_COL (ONE_ROW) - @OneCol (@OneRow) object */ /* HCOVER (VCOVER) - @HCover (@VCover) object */ /* HCONTRACT (VCONTRACT) - @HContract (@VContract) object */ @@ -1181,7 +1197,7 @@ typedef union /* */ /* TOKEN While still being parsed */ /* SIZED The size of the object */ -/* first child The right parameter of this symbol */ +/* first child The right parameter of this symbol (if any) */ /* */ /* PADJUST (HADJUST, VADJUST) - @PAdjust (@HAdjust, @VAdjust) symbols */ /* */ @@ -1290,7 +1306,7 @@ typedef union /* */ /* TOKEN While still being parsed */ /* */ -/* DEAD - an index of a dead galley */ +/* DEAD - the index of a dead galley */ /* */ /* UNATTACHED - the index of an unattached galley */ /* */ @@ -1491,6 +1507,7 @@ typedef union rec union rec *oopt_counts; union rec *olimiter; union rec *oenclose_obj; + union rec *oheaders; int oopt_comps_permitted; } os2a; @@ -1608,7 +1625,8 @@ typedef union rec #define spanner_sized(x) word_colour(x) #define word_outline(x) (x)->os1.ou2.os22.oword_outline #define word_language(x) (x)->os1.ou2.os22.oword_language -#define spanner_broken(x) word_language(x) +#define spanner_fixed(x) word_language(x) +#define spanner_broken(x) word_outline(x) #define underline(x) (x)->os1.ou2.os22.ounderline #define word_hyph(x) (x)->os1.ou2.os22.oword_hyph #define filter_use_begin(x) (x)->os1.ou2.os22.oword_colour @@ -1700,6 +1718,7 @@ typedef union rec #define opt_counts(x) (x)->os2a.oopt_counts #define limiter(x) (x)->os2a.olimiter #define enclose_obj(x) (x)->os2a.oenclose_obj +#define headers(x) (x)->os2a.oheaders #define opt_comps_permitted(x) (x)->os2a.oopt_comps_permitted #define number(x) (x)->os4.onumber @@ -1836,149 +1855,154 @@ typedef struct mapvec { #define LINK 0 /* a link between objects */ #define GAP_OBJ 1 /* o a gap object */ #define CLOSURE 2 /* to n a closure of a symbol */ -#define UNDER_REC 3 /* o n record of underlining */ -#define PAGE_LABEL 4 /* to sn @PageLabel */ -#define NULL_CLOS 5 /* to sn @Null */ -#define CROSS 6 /* to sn && (a cross reference obj) */ -#define FORCE_CROSS 7 /* to sn &&& (a forcing cross ref.) */ -#define HEAD 8 /* o n a galley header */ -#define SPLIT 9 /* o @Split */ -#define PAR 10 /* o a parameter of a closure */ -#define WORD 11 /* o a word */ -#define QWORD 12 /* o a word (was quoted in i/p) */ -#define HSPANNER 13 /* o a horizontal spanner */ -#define VSPANNER 14 /* o a vertical spanner */ -#define ROW_THR 15 /* o a row thread */ -#define COL_THR 16 /* o a column thread */ -#define ACAT 17 /* to s a sequence of &-ed objs */ -#define HCAT 18 /* to s a sequence of |-ed objs */ -#define VCAT 19 /* to s a sequence of /-ed objs */ -#define ONE_COL 20 /* to s @OneCol */ -#define ONE_ROW 21 /* to s @OneRow */ -#define WIDE 22 /* to s @Wide */ -#define HIGH 23 /* to s @High */ -#define HSHIFT 24 /* to s @HShift */ -#define VSHIFT 25 /* to s @VShift */ -#define HSCALE 26 /* to s @HScale */ -#define VSCALE 27 /* to s @VScale */ -#define HCOVER 28 /* to s @HCover */ -#define VCOVER 29 /* to s @VCover */ -#define SCALE 30 /* to s @Scale */ -#define KERN_SHRINK 31 /* to s @KernShrink */ -#define HCONTRACT 32 /* to s @HContract */ -#define VCONTRACT 33 /* to s @VContract */ -#define HLIMITED 34 /* to s @HLimited */ -#define VLIMITED 35 /* to s @VLimited */ -#define HEXPAND 36 /* to s @HExpand */ -#define VEXPAND 37 /* to s @VExpand */ -#define START_HSPAN 38 /* to s @StartHSpan */ -#define START_VSPAN 39 /* to s @StartVSpan */ -#define START_HVSPAN 40 /* to s @StartHVSpan */ -#define HSPAN 41 /* to s @HSpan */ -#define VSPAN 42 /* to s @VSpan */ -#define PADJUST 43 /* to s @PAdjust */ -#define HADJUST 44 /* to s @HAdjust */ -#define VADJUST 45 /* to s @VAdjust */ -#define ROTATE 46 /* to s @Rotate */ -#define BACKGROUND 47 /* to s @Background */ -#define CASE 48 /* to s @Case */ -#define VERBATIM 49 /* to s @Verbatim */ -#define RAW_VERBATIM 50 /* to s @RawVerbatim */ -#define YIELD 51 /* to s @Yield */ -#define BACKEND 52 /* to s @BackEnd */ -#define FILTERED 53 /* to s filtered object (no name) */ -#define XCHAR 54 /* to s @Char */ -#define FONT 55 /* to s @Font */ -#define SPACE 56 /* to s @Space */ -#define YUNIT 57 /* to s @YUnit */ -#define ZUNIT 58 /* to s @ZUnit */ -#define BREAK 59 /* to s @Break */ -#define UNDERLINE 60 /* to s @Underline */ -#define COLOUR 61 /* to s @SetColour and @SetColor */ -#define OUTLINE 62 /* to s @Outline */ -#define LANGUAGE 63 /* to s @Language */ -#define CURR_LANG 64 /* to s @CurrLang */ -#define CURR_FAMILY 65 /* to s @CurrFamily */ -#define CURR_FACE 66 /* to s @CurrFace */ -#define CURR_YUNIT 67 /* to s @CurrYUnit */ -#define CURR_ZUNIT 68 /* to s @CurrZUnit */ -#define COMMON 69 /* to s @Common */ -#define RUMP 70 /* to s @Rump */ -#define MELD 71 /* to s @Meld */ -#define INSERT 72 /* to s @Insert */ -#define ONE_OF 73 /* to s @OneOf */ -#define NEXT 74 /* to s @Next */ -#define PLUS 75 /* to s @Plus */ -#define MINUS 76 /* to s @Minus */ -#define ENV_OBJ 77 /* to s object with envt (no name) */ -#define ENV 78 /* to s @LEnv */ -#define ENVA 79 /* to s @LEnvA */ -#define ENVB 80 /* to s @LEnvB */ -#define ENVC 81 /* to s @LEnvC */ -#define ENVD 82 /* to s @LEnvD */ -#define CENV 83 /* to s @LCEnv */ -#define CLOS 84 /* to s @LClos */ -#define LVIS 85 /* to s @LVis */ -#define LUSE 86 /* to s @LUse */ -#define LEO 87 /* to s @LEO */ -#define OPEN 88 /* to s @Open */ -#define TAGGED 89 /* to s @Tagged */ -#define INCGRAPHIC 90 /* to s @IncludeGraphic */ -#define SINCGRAPHIC 91 /* to s @SysIncludeGraphic */ -#define PLAIN_GRAPHIC 92 /* to s @PlainGraphic */ -#define GRAPHIC 93 /* to s @Graphic */ -#define TSPACE 94 /* t a space token, parser only */ -#define TJUXTA 95 /* t a juxta token, parser only */ -#define LBR 96 /* t s left brace token */ -#define RBR 97 /* t s right brace token */ -#define BEGIN 98 /* t s @Begin token */ -#define END 99 /* t s @End token */ -#define USE 100 /* t s @Use */ -#define NOT_REVEALED 101 /* t s @NotRevealed */ -#define GSTUB_NONE 102 /* t a galley stub, no rpar */ -#define GSTUB_INT 103 /* t galley stub internal rpar */ -#define GSTUB_EXT 104 /* t galley stub external rpar */ -#define UNEXPECTED_EOF 105 /* t unexpected end of file */ -#define INCLUDE 106 /* s @Include */ -#define SYS_INCLUDE 107 /* s @SysInclude */ -#define PREPEND 108 /* s @Prepend */ -#define SYS_PREPEND 109 /* s @SysPrepend */ -#define DATABASE 110 /* s @Database */ -#define SYS_DATABASE 111 /* s @SysDatabase */ -/* #define START 112 */ /* s \Start */ -#define DEAD 113 /* i a dead galley */ -#define UNATTACHED 114 /* i an inner, unsized galley */ -#define RECEPTIVE 115 /* i a receptive object index */ -#define RECEIVING 116 /* i a receiving object index */ -#define RECURSIVE 117 /* i a recursive definite obj. */ -#define PRECEDES 118 /* i an ordering constraint */ -#define FOLLOWS 119 /* i other end of ordering c. */ -#define CROSS_LIT 120 /* i literal word cross-ref */ -#define CROSS_FOLL 121 /* i following type cross-ref */ -#define CROSS_FOLL_OR_PREC 122 /* i follorprec type cross-ref */ -#define GALL_FOLL 123 /* i galley with &&following */ -#define GALL_FOLL_OR_PREC 124 /* i galley with &&following */ -#define CROSS_TARG 125 /* i value of cross-ref */ -#define GALL_TARG 126 /* i target of these galleys */ -#define GALL_PREC 127 /* i galley with &&preceding */ -#define CROSS_PREC 128 /* i preceding type cross-ref */ -#define PAGE_LABEL_IND 129 /* i index of PAGE_LABEL */ -#define SCALE_IND 130 /* i index of auto SCALE */ -#define COVER_IND 131 /* i index of HCOVER or VCOVER */ -#define EXPAND_IND 132 /* i index of HEXPAND or VEXPD */ -#define THREAD 133 /* a sequence of threads */ -#define CROSS_SYM 134 /* cross-ref info */ -#define CR_ROOT 135 /* RootCross */ -#define MACRO 136 /* a macro symbol */ -#define LOCAL 137 /* a local symbol */ -#define LPAR 138 /* a left parameter */ -#define NPAR 139 /* a named parameter */ -#define RPAR 140 /* a right parameter */ -#define EXT_GALL 141 /* an external galley */ -#define CR_LIST 142 /* a list of cross references */ -#define DISPOSED 143 /* a disposed record */ +#define BEGIN_HEADER 3 /* to sn @BeginHeaderComponent */ +#define END_HEADER 4 /* to sn @EndHeaderComponent */ +#define SET_HEADER 5 /* to sn @SetHeaderComponent */ +#define CLEAR_HEADER 6 /* to sn @ClearHeaderComponent */ +#define UNDER_REC 7 /* o n record of underlining */ +#define PAGE_LABEL 8 /* to sn @PageLabel */ +#define NULL_CLOS 9 /* to sn @Null */ +#define CROSS 10 /* to sn && (a cross reference obj) */ +#define FORCE_CROSS 11 /* to sn &&& (a forcing cross ref.) */ +#define HEAD 12 /* o n a galley header */ +#define SPLIT 13 /* o @Split */ +#define PAR 14 /* o a parameter of a closure */ +#define WORD 15 /* o a word */ +#define QWORD 16 /* o a word (was quoted in i/p) */ +#define HSPANNER 17 /* o a horizontal spanner */ +#define VSPANNER 18 /* o a vertical spanner */ +#define ROW_THR 19 /* o a row thread */ +#define COL_THR 20 /* o a column thread */ +#define ACAT 21 /* to s a sequence of &-ed objs */ +#define HCAT 22 /* to s a sequence of |-ed objs */ +#define VCAT 23 /* to s a sequence of /-ed objs */ +#define ONE_COL 24 /* to s @OneCol */ +#define ONE_ROW 25 /* to s @OneRow */ +#define WIDE 26 /* to s @Wide */ +#define HIGH 27 /* to s @High */ +#define HSHIFT 28 /* to s @HShift */ +#define VSHIFT 29 /* to s @VShift */ +#define HSCALE 30 /* to s @HScale */ +#define VSCALE 31 /* to s @VScale */ +#define HCOVER 32 /* to s @HCover */ +#define VCOVER 33 /* to s @VCover */ +#define SCALE 34 /* to s @Scale */ +#define KERN_SHRINK 35 /* to s @KernShrink */ +#define HCONTRACT 36 /* to s @HContract */ +#define VCONTRACT 37 /* to s @VContract */ +#define HLIMITED 38 /* to s @HLimited */ +#define VLIMITED 39 /* to s @VLimited */ +#define HEXPAND 40 /* to s @HExpand */ +#define VEXPAND 41 /* to s @VExpand */ +#define START_HSPAN 42 /* to s @StartHSpan */ +#define START_VSPAN 43 /* to s @StartVSpan */ +#define START_HVSPAN 44 /* to s @StartHVSpan */ +#define HSPAN 45 /* to s @HSpan */ +#define VSPAN 46 /* to s @VSpan */ +#define PADJUST 47 /* to s @PAdjust */ +#define HADJUST 48 /* to s @HAdjust */ +#define VADJUST 49 /* to s @VAdjust */ +#define ROTATE 50 /* to s @Rotate */ +#define BACKGROUND 51 /* to s @Background */ +#define CASE 52 /* to s @Case */ +#define VERBATIM 53 /* to s @Verbatim */ +#define RAW_VERBATIM 54 /* to s @RawVerbatim */ +#define YIELD 55 /* to s @Yield */ +#define BACKEND 56 /* to s @BackEnd */ +#define FILTERED 57 /* to s filtered object (no name) */ +#define XCHAR 58 /* to s @Char */ +#define FONT 59 /* to s @Font */ +#define SPACE 60 /* to s @Space */ +#define YUNIT 61 /* to s @YUnit */ +#define ZUNIT 62 /* to s @ZUnit */ +#define BREAK 63 /* to s @Break */ +#define UNDERLINE 64 /* to s @Underline */ +#define COLOUR 65 /* to s @SetColour and @SetColor */ +#define OUTLINE 66 /* to s @Outline */ +#define LANGUAGE 67 /* to s @Language */ +#define CURR_LANG 68 /* to s @CurrLang */ +#define CURR_FAMILY 69 /* to s @CurrFamily */ +#define CURR_FACE 70 /* to s @CurrFace */ +#define CURR_YUNIT 71 /* to s @CurrYUnit */ +#define CURR_ZUNIT 72 /* to s @CurrZUnit */ +#define COMMON 73 /* to s @Common */ +#define RUMP 74 /* to s @Rump */ +#define MELD 75 /* to s @Meld */ +#define INSERT 76 /* to s @Insert */ +#define ONE_OF 77 /* to s @OneOf */ +#define NEXT 78 /* to s @Next */ +#define PLUS 79 /* to s @Plus */ +#define MINUS 80 /* to s @Minus */ +#define ENV_OBJ 81 /* to s object with envt (no name) */ +#define ENV 82 /* to s @LEnv */ +#define ENVA 83 /* to s @LEnvA */ +#define ENVB 84 /* to s @LEnvB */ +#define ENVC 85 /* to s @LEnvC */ +#define ENVD 86 /* to s @LEnvD */ +#define CENV 87 /* to s @LCEnv */ +#define CLOS 88 /* to s @LClos */ +#define LVIS 89 /* to s @LVis */ +#define LUSE 90 /* to s @LUse */ +#define LEO 91 /* to s @LEO */ +#define OPEN 92 /* to s @Open */ +#define TAGGED 93 /* to s @Tagged */ +#define INCGRAPHIC 94 /* to s @IncludeGraphic */ +#define SINCGRAPHIC 95 /* to s @SysIncludeGraphic */ +#define PLAIN_GRAPHIC 96 /* to s @PlainGraphic */ +#define GRAPHIC 97 /* to s @Graphic */ +#define TSPACE 98 /* t a space token, parser only */ +#define TJUXTA 99 /* t a juxta token, parser only */ +#define LBR 100 /* t s left brace token */ +#define RBR 101 /* t s right brace token */ +#define BEGIN 102 /* t s @Begin token */ +#define END 103 /* t s @End token */ +#define USE 104 /* t s @Use */ +#define NOT_REVEALED 105 /* t s @NotRevealed */ +#define GSTUB_NONE 106 /* t a galley stub, no rpar */ +#define GSTUB_INT 107 /* t galley stub internal rpar */ +#define GSTUB_EXT 108 /* t galley stub external rpar */ +#define UNEXPECTED_EOF 109 /* t unexpected end of file */ +#define INCLUDE 110 /* s @Include */ +#define SYS_INCLUDE 111 /* s @SysInclude */ +#define PREPEND 112 /* s @Prepend */ +#define SYS_PREPEND 113 /* s @SysPrepend */ +#define DATABASE 114 /* s @Database */ +#define SYS_DATABASE 115 /* s @SysDatabase */ +/* #define START 116 */ /* s \Start */ +#define DEAD 117 /* i a dead galley */ +#define UNATTACHED 118 /* i an inner, unsized galley */ +#define RECEPTIVE 119 /* i a receptive object index */ +#define RECEIVING 120 /* i a receiving object index */ +#define RECURSIVE 121 /* i a recursive definite obj. */ +#define PRECEDES 122 /* i an ordering constraint */ +#define FOLLOWS 123 /* i other end of ordering c. */ +#define CROSS_LIT 124 /* i literal word cross-ref */ +#define CROSS_FOLL 125 /* i following type cross-ref */ +#define CROSS_FOLL_OR_PREC 126 /* i follorprec type cross-ref */ +#define GALL_FOLL 127 /* i galley with &&following */ +#define GALL_FOLL_OR_PREC 128 /* i galley with &&following */ +#define CROSS_TARG 129 /* i value of cross-ref */ +#define GALL_TARG 130 /* i target of these galleys */ +#define GALL_PREC 131 /* i galley with &&preceding */ +#define CROSS_PREC 132 /* i preceding type cross-ref */ +#define PAGE_LABEL_IND 133 /* i index of PAGE_LABEL */ +#define SCALE_IND 134 /* i index of auto SCALE */ +#define COVER_IND 135 /* i index of HCOVER or VCOVER */ +#define EXPAND_IND 136 /* i index of HEXPAND or VEXPD */ +#define THREAD 137 /* a sequence of threads */ +#define CROSS_SYM 138 /* cross-ref info */ +#define CR_ROOT 139 /* RootCross */ +#define MACRO 140 /* a macro symbol */ +#define LOCAL 141 /* a local symbol */ +#define LPAR 142 /* a left parameter */ +#define NPAR 143 /* a named parameter */ +#define RPAR 144 /* a right parameter */ +#define EXT_GALL 145 /* an external galley */ +#define CR_LIST 146 /* a list of cross references */ +#define DISPOSED 147 /* a disposed record */ #define is_indefinite(x) ((x) >= CLOSURE && (x) <= HEAD) +#define is_header(x) ((x) >= BEGIN_HEADER && (x) <= CLEAR_HEADER) #define is_definite(x) ((x) >= SPLIT && (x) <= GRAPHIC) #define is_par(x) ((x) >= LPAR && (x) <= RPAR) #define is_index(x) ((x) >= DEAD && (x) <= EXPAND_IND) @@ -2041,9 +2065,9 @@ typedef struct mapvec { #define SMALL_CAPS_ON 1 /* small capitals */ /* sides of a mark */ -#define BACK 144 /* means lies to left of mark */ -#define ON 145 /* means lies on mark */ -#define FWD 146 /* means lies to right of mark */ +#define BACK 148 /* means lies to left of mark */ +#define ON 149 /* means lies on mark */ +#define FWD 150 /* means lies to right of mark */ /* statuses of thread objects */ #define NOTSIZED 0 /* this thread object is not sized */ @@ -2051,15 +2075,15 @@ typedef struct mapvec { #define FINALSIZE 2 /* thread object size is now final */ /* constraint statuses */ -#define PROMOTE 147 /* this component may be promoted */ -#define CLOSE 148 /* must close dest before promoting */ -#define BLOCK 149 /* cannot promote this component */ -#define CLEAR 150 /* this constraint is now satisfied */ +#define PROMOTE 151 /* this component may be promoted */ +#define CLOSE 152 /* must close dest before promoting */ +#define BLOCK 153 /* cannot promote this component */ +#define CLEAR 154 /* this constraint is now satisfied */ /* gap increment types */ -#define GAP_ABS 151 /* absolute, e.g. 3p */ -#define GAP_INC 152 /* increment, e.g. +3p */ -#define GAP_DEC 153 /* decrement, e.g. -3p */ +#define GAP_ABS 155 /* absolute, e.g. 3p */ +#define GAP_INC 156 /* increment, e.g. +3p */ +#define GAP_DEC 157 /* decrement, e.g. -3p */ /* file types */ #define SOURCE_FILE 0 /* input file from command line */ @@ -2201,6 +2225,10 @@ typedef struct mapvec { #define KW_HIGH AsciiToFull("@High") #define KW_HSHIFT AsciiToFull("@HShift") #define KW_VSHIFT AsciiToFull("@VShift") +#define KW_BEGIN_HEADER AsciiToFull("@BeginHeaderComponent") +#define KW_END_HEADER AsciiToFull("@EndHeaderComponent") +#define KW_SET_HEADER AsciiToFull("@SetHeaderComponent") +#define KW_CLEAR_HEADER AsciiToFull("@ClearHeaderComponent") #define KW_ONE_COL AsciiToFull("@OneCol") #define KW_ONE_ROW AsciiToFull("@OneRow") #define KW_HSCALE AsciiToFull("@HScale") @@ -2975,6 +3003,7 @@ extern void SizeGalley(OBJECT hd, OBJECT env, BOOLEAN rows, extern void Interpose(OBJECT z, int typ, OBJECT x, OBJECT y); extern void FlushInners(OBJECT inners, OBJECT hd); extern void ExpandRecursives(OBJECT recs); +extern void HandleHeader(OBJECT hd, OBJECT link, OBJECT header); extern void Promote(OBJECT hd, OBJECT stop_link, OBJECT dest_index, BOOLEAN join_after); extern void KillGalley(OBJECT hd, BOOLEAN optimize); diff --git a/include/README b/include/README index dc2cd91..008aac8 100644 --- a/include/README +++ b/include/README @@ -78,4 +78,4 @@ Miscellaneous Jeffrey H. Kingston -26 February 2000 +9 March 2000 diff --git a/include/bluef b/include/bluef index 5d4a06d..2966814 100644 --- a/include/bluef +++ b/include/bluef @@ -213,7 +213,6 @@ def @BlueSetup } def @O # for formatting operators - named symb {} right x { operators @Test diff --git a/include/book b/include/book index 4a8a5a8..22a3ab9 100644 --- a/include/book +++ b/include/book @@ -142,16 +142,25 @@ # @IndexBreak { {oragged 1.2fx} @OrIfPlain {oragged 1fx} } # and break # @IndexColumnNumber { 2 } # index columns (1 to 10) # @IndexColumnGap { 1.00c @OrIfPlain 6s } # index column gap + # @IndexCtd { Yes } # include (ctd.) lines + # @IndexCtdWord { continued } # "ctd." in current lang. + # @IndexCtdFormat { @Body @I (@CtdWord) } # format of ctd. # @MakeIndexA { No } # make index A? Yes or No # @IndexAFont { } # index A entries font # @IndexABreak { {oragged 1.2fx} @OrIfPlain {oragged 1fx} } # and break # @IndexAColumnNumber { 2 } # index A columns (1 to 10) # @IndexAColumnGap { 1.00c @OrIfPlain 6s } # index A column gap + # @IndexACtd { Yes } # include (ctd.) lines + # @IndexACtdWord { continued } # "ctd." in current lang. + # @IndexACtdFormat { @Body @I (@CtdWord) } # format of ctd. # @MakeIndexB { No } # make index B? Yes or No # @IndexBFont { } # index B entries font # @IndexBBreak { {oragged 1.2fx} @OrIfPlain {oragged 1fx} } # and break # @IndexBColumnNumber { 2 } # index B columns (1 to 10) # @IndexBColumnGap { 1.00c @OrIfPlain 6s } # index B column gap + # @IndexBCtd { Yes } # include (ctd.) lines + # @IndexBCtdWord { continued } # "ctd." in current lang. + # @IndexBCtdFormat { @Body @I (@CtdWord) } # format of ctd. # @TopGap { 0.75c @OrIfPlain 2f } # gap between figures # @MidGap { 0.75c @OrIfPlain 2f } # gap above/below body text # @FootNoteNumbers { Arabic } # footnote numbers diff --git a/include/cprintf b/include/cprintf index 311369c..313b110 100644 --- a/include/cprintf +++ b/include/cprintf @@ -15,8 +15,8 @@ export @CP def @CPSetup named style - named @OrIfPlain left x right y - { @BackEnd @Case { PlainText @Yield y else @Yield x } } + named @OrIfPlain left x right y + { @BackEnd @Case { PlainText @Yield y else @Yield x } } { fixed } # print style named pipe { } # pipe through this first @@ -214,7 +214,6 @@ def @CPSetup } def @O # for formatting operators - named symb {} right x { operators @Test diff --git a/include/doc b/include/doc index cf483ef..85fd92c 100644 --- a/include/doc +++ b/include/doc @@ -142,16 +142,25 @@ # @IndexBreak { {oragged 1.2fx} @OrIfPlain {oragged 1fx} } # and break # @IndexColumnNumber { 2 } # index columns (1 to 10) # @IndexColumnGap { 1.00c @OrIfPlain 6s } # index column gap + # @IndexCtd { Yes } # include (ctd.) lines + # @IndexCtdWord { continued } # "ctd." in current lang. + # @IndexCtdFormat { @Body @I (@CtdWord) } # format of ctd. # @MakeIndexA { No } # make index A? Yes or No # @IndexAFont { } # index A entries font # @IndexABreak { {oragged 1.2fx} @OrIfPlain {oragged 1fx} } # and break # @IndexAColumnNumber { 2 } # index A columns (1 to 10) # @IndexAColumnGap { 1.00c @OrIfPlain 6s } # index A column gap + # @IndexACtd { Yes } # include (ctd.) lines + # @IndexACtdWord { continued } # "ctd." in current lang. + # @IndexACtdFormat { @Body @I (@CtdWord) } # format of ctd. # @MakeIndexB { No } # make index B? Yes or No # @IndexBFont { } # index B entries font # @IndexBBreak { {oragged 1.2fx} @OrIfPlain {oragged 1fx} } # and break # @IndexBColumnNumber { 2 } # index B columns (1 to 10) # @IndexBColumnGap { 1.00c @OrIfPlain 6s } # index B column gap + # @IndexBCtd { Yes } # include (ctd.) lines + # @IndexBCtdWord { continued } # "ctd." in current lang. + # @IndexBCtdFormat { @Body @I (@CtdWord) } # format of ctd. # @TopGap { 0.75c @OrIfPlain 2f } # gap between figures # @MidGap { 0.75c @OrIfPlain 2f } # gap above/below body text # @FootNoteNumbers { Arabic } # footnote numbers diff --git a/include/dsf b/include/dsf index fda93f9..56b2a51 100644 --- a/include/dsf +++ b/include/dsf @@ -234,16 +234,34 @@ def @DocumentSetup named @IndexBreak { {oragged 1.2fx} @OrIfPlain {oragged 1fx} } # index entries break 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 @MakeIndexA { No } # make index A? Yes or No named @IndexAFont { } # index A entries font named @IndexABreak { {oragged 1.2fx} @OrIfPlain {oragged 1fx} } # index A entries break 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 @MakeIndexB { No } # make index B? Yes or No named @IndexBFont { } # index B entries font named @IndexBBreak { {oragged 1.2fx} @OrIfPlain {oragged 1fx} } # index B entries break 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 @TopGap { 0.75c @OrIfPlain 2f } # gap between figures named @MidGap { 0.75c @OrIfPlain 2f } # gap above/below body text @@ -3961,14 +3979,51 @@ def @DocumentSetup right etc { // @IndexBreak @Break @IndexList - // @IndexBreak @Break @BypassIndexList // etc + // @IndexBreak @Break @BypassIndexList + # //1vx --- "@Clear" + // @ClearHeaderComponent + // etc } def @DoIndex into { @IndexList&&following } left @Key named indent { 0f } + named stem {} right @Body { + def @Enclose right x + { + @IndexCtd.indent @Case { + + Yes.0f @Yield { + @ClearHeaderComponent + //1vx + x + //1vx + 1vx @SetHeaderComponent { + indent @Wide & + stem @IndexCtdFormat {continued @WordVal @IndexCtdWord} + } + //1vx + 1vx @BeginHeaderComponent (unused) + } + + Yes.1f @Yield { + @EndHeaderComponent + //1vx + x + //1vx + 1vx @BeginHeaderComponent { + indent @Wide & + stem @IndexCtdFormat {continued @WordVal @IndexCtdWord} + } + } + + else @Yield x + + } + } + def @Merge left x right y { {x @Rump y} @Case @@ -3977,19 +4032,6 @@ def @DocumentSetup else @Yield { { x &"0.03fu" , } @Meld y } } -################################ obsolete ################################### -# {x @Rump y} @Case -# { -# "" @Yield x -# else @Yield { -# { {x @Rump y} @Common "," } @Case -# { -# "," @Yield { x &"0.03fu" x @Rump y } -# else @Yield { x &"0.03fu" , x @Rump y } -# } -# } -# } -############################################################################# } @IndexFont @Font @IndexBreak @Break { indent @Wide & @Body } @@ -4002,7 +4044,7 @@ def @DocumentSetup right y { @MakeIndex @Case { - Yes @Yield { {@PageMark @Tag} x @DoIndex indent { indent } y } + Yes @Yield { {@PageMark @Tag} x @DoIndex stem { y } indent { indent } y } else @Yield @Null } } @@ -4017,39 +4059,8 @@ def @DocumentSetup named to {} right y { - def numval + def pagerange { -# to @Case -# { -# "" @Yield @PageOf @Tag -# else @Yield { -# { @PageOf @Tag } @Case -# { -# { @PageOf to } @Yield { @PageOf @Tag } -# else @Yield { {@PageOf @Tag}--{@PageOf to} } -# } -# } -# } - @BackEnd @Case { - { PlainText PostScript } @Yield { - to @Case - { - "" @Yield @PageOf @Tag - else @Yield { - { @PageOf @Tag } @Case - { - { @PageOf to } @Yield { @PageOf @Tag } - else @Yield { {@PageOf @Tag}--{@PageOf to} } - } - } - } - } -# -# PDF: Index entries produce a blue underlined hyperlink for the page number -# - PDF @Yield { - { "__link_source=<<"@Tag">>" } - @Graphic { blue @Colour @Underline { to @Case { "" @Yield @PageOf @Tag @@ -4061,29 +4072,26 @@ def @DocumentSetup } } } - } - } - } - } } + @MakeIndex @Case { - Yes @Yield { - @BackEnd @Case { - { PostScript PlainText } @Yield { - @PageMark @Tag - x @DoIndex indent { indent } { y &"0.03fu" , numval } - } - PDF @Yield { - {"__link_target=<<"@Tag">>"} @Graphic {""} - @PageMark @Tag - x @DoIndex indent { indent } { y &"0.03fu" , numval } - } - } - } -# Yes @Yield { @PageMark @Tag -# x @DoIndex indent { indent } { y &"0.03fu" , numval } -# } + Yes @Yield { @BackEnd @Case { + + { PostScript PlainText } @Yield { + @PageMark @Tag + x @DoIndex stem { y } indent { indent } { y &"0.03fu" , pagerange } + } + + PDF @Yield { + {"__link_target=<<"@Tag">>"} @Graphic {""} + @PageMark @Tag + x @DoIndex stem { y } indent { indent } { + y &"0.03fu" , { "__link_source=<<"@Tag">>" } + @Graphic { blue @Colour @Underline pagerange } + } + } + } } else @Yield @Null } } @@ -4171,39 +4179,8 @@ def @DocumentSetup named to {} right y { - def numval + def pagerange { -# to @Case -# { -# "" @Yield @PageOf @Tag -# else @Yield { -# { @PageOf @Tag } @Case -# { -# { @PageOf to } @Yield { @PageOf @Tag } -# else @Yield { {@PageOf @Tag}--{@PageOf to} } -# } -# } -# } - @BackEnd @Case { - { PostScript PlainText } @Yield { - to @Case - { - "" @Yield @PageOf @Tag - else @Yield { - { @PageOf @Tag } @Case - { - { @PageOf to } @Yield { @PageOf @Tag } - else @Yield { {@PageOf @Tag}--{@PageOf to} } - } - } - } - } -# -# PDF: Index entries produce a blue underlined hyperlink for the page number -# - PDF @Yield { - { "__link_source=<<"@Tag">>" } - @Graphic { blue @Colour @Underline { to @Case { "" @Yield @PageOf @Tag @@ -4215,16 +4192,26 @@ def @DocumentSetup } } } - } - } - } - } } + @MakeIndexA @Case { - Yes @Yield { @PageMark @Tag - x @DoIndexA indent { indent } { y &"0.03fu" , numval } - } + Yes @Yield { @BackEnd @Case { + + { PostScript PlainText } @Yield { + @PageMark @Tag + x @DoIndexA indent { indent } { y &"0.03fu" , pagerange } + } + + PDF @Yield { + {"__link_target=<<"@Tag">>"} @Graphic {""} + @PageMark @Tag + x @DoIndexA indent { indent } { + y &"0.03fu" , { "__link_source=<<"@Tag">>" } + @Graphic { blue @Colour @Underline pagerange } + } + } + } } else @Yield @Null } } @@ -4312,39 +4299,8 @@ def @DocumentSetup named to {} right y { - def numval + def pagerange { -# to @Case -# { -# "" @Yield @PageOf @Tag -# else @Yield { -# { @PageOf @Tag } @Case -# { -# { @PageOf to } @Yield { @PageOf @Tag } -# else @Yield { {@PageOf @Tag}--{@PageOf to} } -# } -# } -# } - @BackEnd @Case { - { PostScript PlainText } @Yield { - to @Case - { - "" @Yield @PageOf @Tag - else @Yield { - { @PageOf @Tag } @Case - { - { @PageOf to } @Yield { @PageOf @Tag } - else @Yield { {@PageOf @Tag}--{@PageOf to} } - } - } - } - } -# -# PDF: Index entries produce a blue underlined hyperlink for the page number -# - PDF @Yield { - { "__link_source=<<"@Tag">>" } - @Graphic { blue @Colour @Underline { to @Case { "" @Yield @PageOf @Tag @@ -4356,16 +4312,26 @@ def @DocumentSetup } } } - } - } - } - } } + @MakeIndexB @Case { - Yes @Yield { @PageMark @Tag - x @DoIndexB indent { indent } { y &"0.03fu" , numval } - } + Yes @Yield { @BackEnd @Case { + + { PostScript PlainText } @Yield { + @PageMark @Tag + x @DoIndexB indent { indent } { y &"0.03fu" , pagerange } + } + + PDF @Yield { + {"__link_target=<<"@Tag">>"} @Graphic {""} + @PageMark @Tag + x @DoIndexB indent { indent } { + y &"0.03fu" , { "__link_source=<<"@Tag">>" } + @Graphic { blue @Colour @Underline pagerange } + } + } + } } else @Yield @Null } } diff --git a/include/eqf b/include/eqf index e03bb3e..68a902b 100644 --- a/include/eqf +++ b/include/eqf @@ -88,6 +88,8 @@ export "`" "``" "```" bin rel punct non vctr big small gcd hom inf ker lg lim liminf limsup ln log max min Pr sec sin sinh supr tan tanh mod ldots cdots vdots ddots del grad "..." ",...," "'" "''" "'''" "''''" empty + + triangleup triangledown leftarrow longleftarrow dblleftarrow dbllongleftarrow rightarrow longrightarrow dblrightarrow dbllongrightarrow @@ -584,7 +586,6 @@ def @Eq } } - def triangledown { 180d @Rotate triangle } ################################################################### # # @@ -1207,6 +1208,9 @@ def @Eq # # ################################################################### + def triangleup { 0.8f @Font triangle } + def triangledown { 180d @Rotate 0.8f @Font triangle } + ################################################################### # # # Symbols with parameters. # diff --git a/include/picture b/include/picture index 42c5c3f..abe6d43 100644 --- a/include/picture +++ b/include/picture @@ -141,16 +141,25 @@ # @IndexBreak { {oragged 1.2fx} @OrIfPlain {oragged 1fx} } # and break # @IndexColumnNumber { 2 } # index columns (1 to 10) # @IndexColumnGap { 1.00c @OrIfPlain 6s } # index column gap + # @IndexCtd { Yes } # include (ctd.) lines + # @IndexCtdWord { continued } # "ctd." in current lang. + # @IndexCtdFormat { @Body @I (@CtdWord) } # format of ctd. # @MakeIndexA { No } # make index A? Yes or No # @IndexAFont { } # index A entries font # @IndexABreak { {oragged 1.2fx} @OrIfPlain {oragged 1fx} } # and break # @IndexAColumnNumber { 2 } # index A columns (1 to 10) # @IndexAColumnGap { 1.00c @OrIfPlain 6s } # index A column gap + # @IndexACtd { Yes } # include (ctd.) lines + # @IndexACtdWord { continued } # "ctd." in current lang. + # @IndexACtdFormat { @Body @I (@CtdWord) } # format of ctd. # @MakeIndexB { No } # make index B? Yes or No # @IndexBFont { } # index B entries font # @IndexBBreak { {oragged 1.2fx} @OrIfPlain {oragged 1fx} } # and break # @IndexBColumnNumber { 2 } # index B columns (1 to 10) # @IndexBColumnGap { 1.00c @OrIfPlain 6s } # index B column gap + # @IndexBCtd { Yes } # include (ctd.) lines + # @IndexBCtdWord { continued } # "ctd." in current lang. + # @IndexBCtdFormat { @Body @I (@CtdWord) } # format of ctd. # @TopGap { 0.75c @OrIfPlain 2f } # gap between figures # @MidGap { 0.75c @OrIfPlain 2f } # gap above/below body text # @FootNoteNumbers { Arabic } # footnote numbers diff --git a/include/progf b/include/progf index 5ca3f81..ec864df 100644 --- a/include/progf +++ b/include/progf @@ -7,11 +7,11 @@ # Adapted from the original @CPrint package. # # # # This package uses a filtered body parameter to convert program source # -# code into Lout source. The filter program is prog2lout, which is # +# code into Lout source. The filter program is prg2lout, which is # # distributed with Lout and should be compiled and installed wherever # # Lout itself is. # # # -# This package is intended for use by prog2lout's stand-alone mode. # +# This package is intended for use by prg2lout's stand-alone mode. # # If you are adding a new language, a better place to start would be # # files eiffelf and eiffel rather than progf. # # # @@ -66,7 +66,7 @@ def @ProgSetup export - "$>" @S @D @C @K @N @O @A @M + "$>" @S @D @C @K @N @O @A @ST @ED @M def @Prog named language { language } # language @@ -124,12 +124,12 @@ def @ProgSetup { pipe @Case { "" @Yield { - "prog2lout -r -l" language -i{@FilterIn} -o{@FilterOut} -e{@FilterErr} + "prg2lout -r -l" language -i{@FilterIn} -o{@FilterOut} -e{@FilterErr} -t{@InitTab} -T{@InitTabWidth} } else @Yield { "cat" @FilterIn "|" pipe "|" - "prog2lout -r -l" language -o{@FilterOut} + "prg2lout -r -l" language -o{@FilterOut} -e{@FilterErr} -t{@InitTab} -T{@InitTabWidth} } } @@ -220,7 +220,6 @@ def @ProgSetup } def @O # for formatting operators - named symb {} right x { operators @Test @@ -240,6 +239,29 @@ def @ProgSetup } } + def @ST # for formatting asterisks + right x + { + operators @Test + iffixed { fixedoperators } + ifvarying { varyingoperators } + ifsymbol { symboloperators } + @Font "0.5w" @VShift x + } + + def @ED # for formatting larger dots + right x + { + operators @Test + iffixed { fixedoperators } + ifvarying { varyingoperators } + ifsymbol { symboloperators } + @Font @BackEnd @Case { + PlainText @Yield x + else @Yield { "1.2f" @Font "+0.05f" @VShift @O x &"0.05f" } + } + } + macro "$>" { {} & } def @M right x diff --git a/include/report b/include/report index 4905980..8c80944 100644 --- a/include/report +++ b/include/report @@ -146,16 +146,25 @@ # @IndexBreak { {oragged 1.2fx} @OrIfPlain {oragged 1fx} } # and break # @IndexColumnNumber { 2 } # index columns (1 to 10) # @IndexColumnGap { 1.00c @OrIfPlain 6s } # index column gap + # @IndexCtd { Yes } # include (ctd.) lines + # @IndexCtdWord { continued } # "ctd." in current lang. + # @IndexCtdFormat { @Body @I (@CtdWord) } # format of ctd. # @MakeIndexA { No } # make index A? Yes or No # @IndexAFont { } # index A entries font # @IndexABreak { {oragged 1.2fx} @OrIfPlain {oragged 1fx} } # and break # @IndexAColumnNumber { 2 } # index A columns (1 to 10) # @IndexAColumnGap { 1.00c @OrIfPlain 6s } # index A column gap + # @IndexACtd { Yes } # include (ctd.) lines + # @IndexACtdWord { continued } # "ctd." in current lang. + # @IndexACtdFormat { @Body @I (@CtdWord) } # format of ctd. # @MakeIndexB { No } # make index B? Yes or No # @IndexBFont { } # index B entries font # @IndexBBreak { {oragged 1.2fx} @OrIfPlain {oragged 1fx} } # and break # @IndexBColumnNumber { 2 } # index B columns (1 to 10) # @IndexBColumnGap { 1.00c @OrIfPlain 6s } # index B column gap + # @IndexBCtd { Yes } # include (ctd.) lines + # @IndexBCtdWord { continued } # "ctd." in current lang. + # @IndexBCtdFormat { @Body @I (@CtdWord) } # format of ctd. # @TopGap { 0.75c @OrIfPlain 2f } # gap between figures # @MidGap { 0.75c @OrIfPlain 2f } # gap above/below body text # @FootNoteNumbers { Arabic } # footnote numbers diff --git a/include/slides b/include/slides index f740c84..60088dd 100644 --- a/include/slides +++ b/include/slides @@ -144,16 +144,25 @@ # @IndexBreak { {oragged 1.2fx} @OrIfPlain {oragged 1fx} } # and break # @IndexColumnNumber { 2 } # index columns (1 to 10) # @IndexColumnGap { 1.00c @OrIfPlain 6s } # index column gap + # @IndexCtd { Yes } # include (ctd.) lines + # @IndexCtdWord { continued } # "ctd." in current lang. + # @IndexCtdFormat { @Body @I (@CtdWord) } # format of ctd. # @MakeIndexA { No } # make index A? Yes or No # @IndexAFont { } # index A entries font # @IndexABreak { {oragged 1.2fx} @OrIfPlain {oragged 1fx} } # and break # @IndexAColumnNumber { 2 } # index A columns (1 to 10) # @IndexAColumnGap { 1.00c @OrIfPlain 6s } # index A column gap + # @IndexACtd { Yes } # include (ctd.) lines + # @IndexACtdWord { continued } # "ctd." in current lang. + # @IndexACtdFormat { @Body @I (@CtdWord) } # format of ctd. # @MakeIndexB { No } # make index B? Yes or No # @IndexBFont { } # index B entries font # @IndexBBreak { {oragged 1.2fx} @OrIfPlain {oragged 1fx} } # and break # @IndexBColumnNumber { 2 } # index B columns (1 to 10) # @IndexBColumnGap { 1.00c @OrIfPlain 6s } # index B column gap + # @IndexBCtd { Yes } # include (ctd.) lines + # @IndexBCtdWord { continued } # "ctd." in current lang. + # @IndexBCtdFormat { @Body @I (@CtdWord) } # format of ctd. # @TopGap { 0.75c @OrIfPlain 2f } # gap between figures # @MidGap { 0.75c @OrIfPlain 2f } # gap above/below body text # @FootNoteNumbers { Arabic } # footnote numbers diff --git a/include/tblf b/include/tblf index 9a2da6e..d3929cf 100644 --- a/include/tblf +++ b/include/tblf @@ -177,6 +177,18 @@ def @TblSetup @NoBreakRowg @NoBreakRowh + @HeaderRow + @HeaderRowa + @HeaderRowb + @HeaderRowc + @HeaderRowd + @HeaderRowe + @HeaderRowf + @HeaderRowg + @HeaderRowh + + @EndHeaderRow + @NP def @Tbl @@ -1253,7 +1265,7 @@ def @TblSetup named gap {} right thick { - @OneRow { col @VRule thick /gap col @VRule thick } + @OneRow { col @VRule thick |gap col @VRule thick } } def @MakeHRule @@ -3123,6 +3135,18 @@ def @TblSetup macro @NoBreakRowg { /0iu @DoRowg } macro @NoBreakRowh { /0iu @DoRowh } + macro @HeaderRow { / @BeginHeaderComponent @DoRow } + macro @HeaderRowa { / @BeginHeaderComponent @DoRowa } + macro @HeaderRowb { / @BeginHeaderComponent @DoRowb } + macro @HeaderRowc { / @BeginHeaderComponent @DoRowc } + macro @HeaderRowd { / @BeginHeaderComponent @DoRowd } + macro @HeaderRowe { / @BeginHeaderComponent @DoRowe } + macro @HeaderRowf { / @BeginHeaderComponent @DoRowf } + macro @HeaderRowg { / @BeginHeaderComponent @DoRowg } + macro @HeaderRowh { / @BeginHeaderComponent @DoRowh } + + macro @EndHeaderRow { / @EndHeaderComponent } + macro @NP { /"1.1b" } @Body diff --git a/makefile b/makefile index ded9538..6da7cad 100644 --- a/makefile +++ b/makefile @@ -1,6 +1,6 @@ ############################################################################### # # -# Make file for installing Basser Lout Version 3.18 # +# Make file for installing Basser Lout Version 3.19 # # # # Jeffrey H. Kingston # # 14 February 2000 # @@ -252,10 +252,10 @@ DBFIX = 0 USESTAT = 1 SAFEDFT = 0 -BINDIR = /usr/staff/jeff/bin -LIBDIR = /usr/staff/jeff/lout.lib -DOCDIR = /usr/staff/jeff/lout.doc -MANDIR = /usr/staff/jeff/lout.man +BINDIR = /export/home/6monthspace/jeff/bin +LIBDIR = /export/home/6monthspace/jeff/lout.lib +DOCDIR = /export/home/6monthspace/jeff/lout.doc +MANDIR = /export/home/6monthspace/jeff/lout.man LIBFONT = font LIBMAPS = maps @@ -281,8 +281,8 @@ CC = gcc RCOPY = cp -r -# COPTS = -ansi -pedantic -Wall -O3 -COPTS = -ansi -pedantic -Wall +COPTS = -ansi -pedantic -Wall -O3 +# COPTS = -ansi -pedantic -Wall CFLAGS = -DOS_UNIX=$(OSUNIX) \ -DOS_DOS=$(OSDOS) \ diff --git a/man/c2lout.1 b/man/c2lout.1 deleted file mode 100644 index 472e530..0000000 --- a/man/c2lout.1 +++ /dev/null @@ -1,133 +0,0 @@ -.TH C2LOUT 1 -.SH NAME -c2lout - convert C and C++ source code into Lout -.SH SYNOPSIS -\fBc2lout\fR [ \fIoptions\fR ] \fIC\(en\&files\fR... -.SH DESCRIPTION -Reformat C and C++ source code for input to the Lout document formatting -system, taking care of comments, character strings, tab characters, etc. -.LP -.B c2lout -reads the named C and C++ files and produces output -suitable for input to -.BR "lout -s" . -Thus, -.LP -.RS -.B "c2lout foo.c | lout -s | lpr" -.RE -.LP -will print -.B foo.c -on a PostScript printer. Each file will start on a new page, preceded -by its name in bold. -.SH OPTIONS -.TP -.B \-pfixed -Use a fixed width font (the default). -.TP -.B \-pvarying -Use a varying-width italic font with non-italic bold keywords. -.TP -.B \-psymbol -Use a varying-width italic font with mathematical symbols and -non-italic bold keywords. -.TP -.B \-n -Do not print the file name before each C or C++ file. -.TP -.BI \-f " font" -Select a font family. -The default is -.B \-fCourier -for -.BR \-pfixed , -and -.B \-fTimes -for -.B \-pvarying -and -.BR \-psymbol . -.TP -.BI \-s " size" -Select a Lout font size. The default is -.B -s9p -(meaning 9 points) for -.BR \-pfixed , -and -.B \-s10p -for -.B \-pvarying -and -.BR \-psymbol . -These work well with 80-character-wide programs. -.TP -.BI \-v " vsize" -Select a Lout vertical inter-line gap. The default is -.B -v1.1fx -meaning 1.1 times the font size measured from baseline to baseline. -.TP -.BI \-t " num" -Set the tab interval to -.I num -characters (default is -.BR \-t8 ). -.TP -.BI \-T " width" -Without this option, -.B c2lout -simulates tabs with spaces. With this option, -.B c2lout -simulates tabs with Lout tabulation operators; -.I width -is the width of one tab interval in the final print, measured in Lout -units. This guarantees alignment of characters following tabs even -with varying-width fonts, provided -.I width -is sufficiently large. For example, -.B -T0.5i -produces half-inch tab intervals. -.TP -.B \-u -Print usage information on stderr and exit. -.TP -.B \-V -Print version information on stderr and exit. -.SS Raw Mode -There is a \(lq\&raw mode\(rq usage of -.B c2lout -invoked by a -.B -r -flag (must be the first argument). This converts one C file into -Lout-readable source without any heading or trailing information. -Synopsis: -.LP -.RS -.B c2lout -.B \-r -.BI \-i \ infile -.BI \-o \ outfile -.BI \-e \ errfile -.BI \-t \ num -.BI \-T \ width -.RE -.LP -Users should never need this mode; it is invoked automatically -from within Lout by the -.B @CP -symbol from the -.B cprint -package (see reference). -.SH SEE ALSO -.BR lout (1), -.BR lpr (1), -.BR ghostview (1). -.SH REFERENCES -.LP -Jeffrey H. Kingston, -.I -\(lq\&A User's Guide to the Lout Document Formatting System\(rq\c -\&, Chapter 11. -.SH AUTHOR -.LP -Jeffrey H. Kingston diff --git a/man/c2lout.txt b/man/c2lout.txt deleted file mode 100644 index 47349d6..0000000 --- a/man/c2lout.txt +++ /dev/null @@ -1,95 +0,0 @@ - - - -User Commands C2LOUT(1) - - - -NAME - c2lout - convert C and C++ source code into Lout - -SYNOPSIS - c2lout [ options ] Cfiles... - -DESCRIPTION - Reformat C and C++ source code for input to the Lout docu- - ment formatting system, taking care of comments, character - strings, tab characters, etc. - - c2lout reads the named C and C++ files and produces output - suitable for input to lout -s. Thus, - - c2lout foo.c | lout -s | lpr - - will print foo.c on a PostScript printer. Each file will - start on a new page, preceded by its name in bold. - -OPTIONS - -pfixed - Use a fixed width font (the default). - - -pvarying - Use a varying-width italic font with non-italic bold - keywords. - - -psymbol - Use a varying-width italic font with mathematical sym- - bols and non-italic bold keywords. - - -n Do not print the file name before each C or C++ file. - - -f font - Select a font family. The default is -fCourier for - -pfixed, and -fTimes for -pvarying and -psymbol. - - -s size - Select a Lout font size. The default is -s9p (meaning - 9 points) for -pfixed, and -s10p for -pvarying and - -psymbol. These work well with 80-character-wide pro- - grams. - - -v vsize - Select a Lout vertical inter-line gap. The default is - -v1.1fx meaning 1.1 times the font size measured from - baseline to baseline. - - -t num - Set the tab interval to num characters (default is - -t8). - - -T width - Without this option, c2lout simulates tabs with spaces. - With this option, c2lout simulates tabs with Lout tabu- - lation operators; width is the width of one tab inter- - val in the final print, measured in Lout units. This - guarantees alignment of characters following tabs even - with varying-width fonts, provided width is suffi- - ciently large. For example, -T0.5i produces half-inch - tab intervals. - - -u Print usage information on stderr and exit. - - -V Print version information on stderr and exit. - - Raw Mode - There is a raw mode usage of c2lout invoked by a -r flag - (must be the first argument). This converts one C file into - Lout-readable source without any heading or trailing infor- - mation. Synopsis: - - c2lout -r -i infile -o outfile -e errfile -t num - -T width - - Users should never need this mode; it is invoked automati- - cally from within Lout by the @CP symbol from the cprint - package (see reference). - -SEE ALSO - lout(1), lpr(1), ghostview(1). - -REFERENCES - Jeffrey H. Kingston, A User's Guide to the Lout Document - Formatting System, Chapter 11. - -AUTHOR - Jeffrey H. Kingston diff --git a/man/lout.1 b/man/lout.1 index 5b9b6bc..b20ea36 100644 --- a/man/lout.1 +++ b/man/lout.1 @@ -8,7 +8,7 @@ .SH NAME lout - prepare Lout document for printing .SH SYNOPSIS -\fBlout\fR [ \fIoption\fR ] \fIfile\fR... +\fBlout\fR [ \fIoptions\fR ] \fIfile\fR... .SH DESCRIPTION Invoke the Basser Lout interpreter on the concatenation of the named files, producing a PostScript file on standard output suitable for @@ -16,7 +16,7 @@ printing on PostScript printers using .IR lpr (1). If no files are named, stdin is used instead. The special file name .RB ` \|\-\| ' -may be used to denote standard input. There white space between flags +may be used to denote standard input. White space between flags and their associated option values is optional. .LP An optional @@ -42,8 +42,8 @@ Use "\c .IR linenum :\c .IR colnum :\c .I message\c -\&" alternative error message format useful with Emacs compilation -mode and other tools. +\&" alternative error message format (useful with Emacs compilation +mode and other tools). .SS Output format .TP \" \n(oi .B \-EPS @@ -244,7 +244,7 @@ can be changed by setting environment variable to an alternative directory name. .SH SEE ALSO .LP -.BR c2lout (1), +.BR prg2lout (1), .BR lpr (1), .BR ghostview (1) .SH MAILING LIST diff --git a/man/lout.txt b/man/lout.txt index 9638390..c09a943 100644 --- a/man/lout.txt +++ b/man/lout.txt @@ -9,7 +9,7 @@ NAME lout - prepare Lout document for printing SYNOPSIS - lout [ option ] file... + lout [ options ] file... DESCRIPTION Invoke the Basser Lout interpreter on the concatenation of @@ -17,8 +17,8 @@ DESCRIPTION output suitable for printing on PostScript printers using lpr(1). If no files are named, stdin is used instead. The special file name `-' may be used to denote standard input. - There white space between flags and their associated option - values is optional. + White space between flags and their associated option values + is optional. An optional .lt suffix may be used for Lout source and include files. When invoking files ending in this suffix @@ -33,8 +33,8 @@ OPTIONS Direct error messages to filename instead of to stderr. -a Use "filename:linenum:colnum:message" alternative error - message format useful with Emacs compilation mode and - other tools. + message format (useful with Emacs compilation mode and + other tools). Output format -EPS Produce output in the form of an EPS (Encapsulated @@ -170,7 +170,7 @@ FILES AND ENVIRONMENT VARIABLE alternative directory name. SEE ALSO - c2lout(1), lpr(1), ghostview(1) + prg2lout(1), lpr(1), ghostview(1) MAILING LIST A public mailing list for discussion of Lout exists. To diff --git a/prg2lout.c b/prg2lout.c index 4df2187..c8ba048 100644 --- a/prg2lout.c +++ b/prg2lout.c @@ -1,6 +1,6 @@ /*****************************************************************************/ /* */ -/* PROG2LOUT: A PROGRAM TO CONVERT PROGRAM SOURCES INTO LOUT (VERSION 1.0) */ +/* PRG2LOUT: A PROGRAM TO CONVERT PROGRAM SOURCES INTO LOUT (VERSION 1.0) */ /* COPYRIGHT (C) 2000 Jeffrey H. Kingston */ /* */ /* Jeffrey H. Kingston (jeff@cs.su.oz.au) */ @@ -483,7 +483,7 @@ LANGUAGE *languages[] = { #define DEBUG_EMIT 0 #define DEBUG_MAIN 0 -#define PROG2LOUT_VERSION "prg2lout Version 1.0 (February 2000)" +#define PRG2LOUT_VERSION "prg2lout Version 1.0 (February 2000)" #define BOOLEAN unsigned #define FALSE 0 #define TRUE 1 @@ -1604,7 +1604,7 @@ int main(int argc, char *argv[]) { fprintf(err_fp, "%s: -V illegal with -r option\n", ErrorHeader()); exit(1); } - fprintf(err_fp, "%s\n", PROG2LOUT_VERSION); + fprintf(err_fp, "%s\n", PRG2LOUT_VERSION); exit(0); break; diff --git a/whatsnew b/whatsnew index 82e2d1e..dae0477 100644 --- a/whatsnew +++ b/whatsnew @@ -229,12 +229,19 @@ Changes and new features introduced in Version 3.18 [26 February 2000] @Outline symbol for printing words in outline rather than filled A few extra @Eq symbols: filledcircle, small, trieq +Changes and new features introduced in Version 3.19 [9 March 2000] + + Bug fixes + Four @HeaderComponent symbols for running headers (expert users) + Running headers in multi-page tables + Running headers in indexes + Two extra @Eq symbols: triangleup, triangledown + Things that ought to be done but haven't been done yet PDF-like features in PostScript output Various improvements/bug fixes for PDF output Review Uwe's proposal for moving word row marks to the baseline - Running headers for tables [much more feasible than previously thought] Jeff Kingston -23 February 2000 +9 March 2000 diff --git a/z01.c b/z01.c index 0d64479..f276900 100644 --- a/z01.c +++ b/z01.c @@ -1,6 +1,6 @@ /*@z01.c:Supervise:StartSym, AllowCrossDb, Encapsulated, etc.@****************/ /* */ -/* THE LOUT DOCUMENT FORMATTING SYSTEM (VERSION 3.18) */ +/* THE LOUT DOCUMENT FORMATTING SYSTEM (VERSION 3.19) */ /* COPYRIGHT (C) 1991, 2000 Jeffrey H. Kingston */ /* */ /* Jeffrey H. Kingston (jeff@cs.usyd.edu.au) */ @@ -766,6 +766,10 @@ int main(int argc, char *argv[]) load(KW_HIGH, HIGH, TRUE, TRUE, FALSE, DEFAULT_PREC); load(KW_HSHIFT, HSHIFT, TRUE, TRUE, FALSE, DEFAULT_PREC); load(KW_VSHIFT, VSHIFT, TRUE, TRUE, FALSE, DEFAULT_PREC); + load(KW_BEGIN_HEADER, BEGIN_HEADER, TRUE, TRUE, FALSE, DEFAULT_PREC); + load(KW_END_HEADER, END_HEADER, FALSE, FALSE, FALSE, DEFAULT_PREC); + load(KW_SET_HEADER, SET_HEADER, TRUE, TRUE, FALSE, DEFAULT_PREC); + load(KW_CLEAR_HEADER, CLEAR_HEADER, FALSE, FALSE, FALSE, DEFAULT_PREC); load(KW_ONE_COL, ONE_COL, FALSE, TRUE, FALSE, DEFAULT_PREC); load(KW_ONE_ROW, ONE_ROW, FALSE, TRUE, FALSE, DEFAULT_PREC); load(KW_HSCALE, HSCALE, FALSE, TRUE, FALSE, DEFAULT_PREC); diff --git a/z02.c b/z02.c index 2ccb67d..4f787f6 100644 --- a/z02.c +++ b/z02.c @@ -1,6 +1,6 @@ /*@z02.c:Lexical Analyser:Declarations@***************************************/ /* */ -/* THE LOUT DOCUMENT FORMATTING SYSTEM (VERSION 3.18) */ +/* THE LOUT DOCUMENT FORMATTING SYSTEM (VERSION 3.19) */ /* COPYRIGHT (C) 1991, 2000 Jeffrey H. Kingston */ /* */ /* Jeffrey H. Kingston (jeff@cs.usyd.edu.au) */ diff --git a/z03.c b/z03.c index a834a8b..caa10d1 100644 --- a/z03.c +++ b/z03.c @@ -1,6 +1,6 @@ /*@z03.c:File Service:Declarations, no_fpos@******************************** */ /* */ -/* THE LOUT DOCUMENT FORMATTING SYSTEM (VERSION 3.18) */ +/* THE LOUT DOCUMENT FORMATTING SYSTEM (VERSION 3.19) */ /* COPYRIGHT (C) 1991, 2000 Jeffrey H. Kingston */ /* */ /* Jeffrey H. Kingston (jeff@cs.usyd.edu.au) */ diff --git a/z04.c b/z04.c index e6ccb88..e41fb2b 100644 --- a/z04.c +++ b/z04.c @@ -1,6 +1,6 @@ /*@z04.c:Token Service:NewToken(), CopyTokenList()@***************************/ /* */ -/* THE LOUT DOCUMENT FORMATTING SYSTEM (VERSION 3.18) */ +/* THE LOUT DOCUMENT FORMATTING SYSTEM (VERSION 3.19) */ /* COPYRIGHT (C) 1991, 2000 Jeffrey H. Kingston */ /* */ /* Jeffrey H. Kingston (jeff@cs.usyd.edu.au) */ @@ -150,6 +150,10 @@ FULL_CHAR *EchoToken(OBJECT x) case PAGE_LABEL: case CROSS: case FORCE_CROSS: + case BEGIN_HEADER: + case END_HEADER: + case SET_HEADER: + case CLEAR_HEADER: case ONE_COL: case ONE_ROW: case WIDE: diff --git a/z05.c b/z05.c index 2858006..556844e 100644 --- a/z05.c +++ b/z05.c @@ -1,6 +1,6 @@ /*@z05.c:Read Definitions:ReadFontDef()@**************************************/ /* */ -/* THE LOUT DOCUMENT FORMATTING SYSTEM (VERSION 3.18) */ +/* THE LOUT DOCUMENT FORMATTING SYSTEM (VERSION 3.19) */ /* COPYRIGHT (C) 1991, 2000 Jeffrey H. Kingston */ /* */ /* Jeffrey H. Kingston (jeff@cs.usyd.edu.au) */ @@ -242,6 +242,10 @@ static void ReadTokenList(OBJECT token, OBJECT res) case FORCE_CROSS: case NULL_CLOS: case PAGE_LABEL: + case BEGIN_HEADER: + case END_HEADER: + case SET_HEADER: + case CLEAR_HEADER: case ONE_COL: case ONE_ROW: case WIDE: diff --git a/z06.c b/z06.c index a8da7af..967bef4 100644 --- a/z06.c +++ b/z06.c @@ -1,6 +1,6 @@ /*@z06.c:Parser:PushObj(), PushToken(), etc.@*********************************/ /* */ -/* THE LOUT DOCUMENT FORMATTING SYSTEM (VERSION 3.18) */ +/* THE LOUT DOCUMENT FORMATTING SYSTEM (VERSION 3.19) */ /* COPYRIGHT (C) 1991, 2000 Jeffrey H. Kingston */ /* */ /* Jeffrey H. Kingston (jeff@cs.usyd.edu.au) */ @@ -396,8 +396,12 @@ static BOOLEAN Reduce(void) case NULL_CLOS: case PAGE_LABEL: - case ONE_ROW: + case BEGIN_HEADER: + case END_HEADER: + case SET_HEADER: + case CLEAR_HEADER: case ONE_COL: + case ONE_ROW: case WIDE: case HIGH: case HSHIFT: @@ -975,6 +979,10 @@ BOOLEAN defs_allowed, BOOLEAN transfer_allowed) case FORCE_CROSS: case NULL_CLOS: case PAGE_LABEL: + case BEGIN_HEADER: + case END_HEADER: + case SET_HEADER: + case CLEAR_HEADER: case ONE_COL: case ONE_ROW: case WIDE: diff --git a/z07.c b/z07.c index 6043127..f9ab995 100644 --- a/z07.c +++ b/z07.c @@ -1,6 +1,6 @@ /*@z07.c:Object Service:SplitIsDefinite(), DisposeObject()@*******************/ /* */ -/* THE LOUT DOCUMENT FORMATTING SYSTEM (VERSION 3.18) */ +/* THE LOUT DOCUMENT FORMATTING SYSTEM (VERSION 3.19) */ /* COPYRIGHT (C) 1991, 2000 Jeffrey H. Kingston */ /* */ /* Jeffrey H. Kingston (jeff@cs.usyd.edu.au) */ @@ -177,6 +177,10 @@ OBJECT CopyObject(OBJECT x, FILE_POS *pos) case PAGE_LABEL: case CROSS: case FORCE_CROSS: + case BEGIN_HEADER: + case END_HEADER: + case SET_HEADER: + case CLEAR_HEADER: case ONE_COL: case ONE_ROW: case WIDE: @@ -338,6 +342,10 @@ OBJECT InsertObject(OBJECT x, OBJECT *ins, STYLE *style) case NULL_CLOS: + case BEGIN_HEADER: + case END_HEADER: + case SET_HEADER: + case CLEAR_HEADER: case HEAD: case CROSS: case FORCE_CROSS: diff --git a/z08.c b/z08.c index ddc431e..99efc43 100644 --- a/z08.c +++ b/z08.c @@ -1,6 +1,6 @@ /*@z08.c:Object Manifest:ReplaceWithSplit()@**********************************/ /* */ -/* THE LOUT DOCUMENT FORMATTING SYSTEM (VERSION 3.18) */ +/* THE LOUT DOCUMENT FORMATTING SYSTEM (VERSION 3.19) */ /* COPYRIGHT (C) 1991, 2000 Jeffrey H. Kingston */ /* */ /* Jeffrey H. Kingston (jeff@cs.usyd.edu.au) */ @@ -753,6 +753,7 @@ OBJECT *enclose, BOOLEAN fcr) AttachEnv(env, x); SetTarget(hd); enclose_obj(hd) = (has_enclose(sym) ? BuildEnclose(hd) : nilobj); + headers(hd) = nilobj; x = hd; threaded(x) = bthr[COLM] != nilobj || fthr[COLM] != nilobj; ReplaceWithSplit(x, bthr, fthr); @@ -1395,6 +1396,25 @@ OBJECT *enclose, BOOLEAN fcr) break; + case BEGIN_HEADER: + case SET_HEADER: + + /* first manifest gap, which is left parameter */ + Child(y, Down(x)); + y = Manifest(y, env, style, nbt, nft, &ntarget, crs, FALSE, FALSE, + &nenclose, fcr); + y = ReplaceWithTidy(y, FALSE); + GetGap(y, style, &line_gap(save_style(x)), &res_gap); + + /* now the right parameter */ + Child(y, LastDown(x)); + y = Manifest(y, env, style, bthr, fthr, target, crs, ok, need_expand, + enclose, fcr); + break; + + + case END_HEADER: + case CLEAR_HEADER: case HSPAN: case VSPAN: diff --git a/z09.c b/z09.c index 34584f1..1bcd77f 100644 --- a/z09.c +++ b/z09.c @@ -1,6 +1,6 @@ /*@z09.c:Closure Expansion:SearchEnv()@***************************************/ /* */ -/* THE LOUT DOCUMENT FORMATTING SYSTEM (VERSION 3.18) */ +/* THE LOUT DOCUMENT FORMATTING SYSTEM (VERSION 3.19) */ /* COPYRIGHT (C) 1991, 2000 Jeffrey H. Kingston */ /* */ /* Jeffrey H. Kingston (jeff@cs.usyd.edu.au) */ diff --git a/z10.c b/z10.c index 4865a63..1dc5b78 100644 --- a/z10.c +++ b/z10.c @@ -1,6 +1,6 @@ /*@z10.c:Cross References:CrossInit(), CrossMake()@***************************/ /* */ -/* THE LOUT DOCUMENT FORMATTING SYSTEM (VERSION 3.18) */ +/* THE LOUT DOCUMENT FORMATTING SYSTEM (VERSION 3.19) */ /* COPYRIGHT (C) 1991, 2000 Jeffrey H. Kingston */ /* */ /* Jeffrey H. Kingston (jeff@cs.usyd.edu.au) */ diff --git a/z11.c b/z11.c index 135f5b0..ae1b437 100644 --- a/z11.c +++ b/z11.c @@ -1,6 +1,6 @@ /*@z11.c:Style Service:EchoStyle()@*******************************************/ /* */ -/* THE LOUT DOCUMENT FORMATTING SYSTEM (VERSION 3.18) */ +/* THE LOUT DOCUMENT FORMATTING SYSTEM (VERSION 3.19) */ /* COPYRIGHT (C) 1991, 2000 Jeffrey H. Kingston */ /* */ /* Jeffrey H. Kingston (jeff@cs.usyd.edu.au) */ diff --git a/z12.c b/z12.c index 7f36359..16789a5 100644 --- a/z12.c +++ b/z12.c @@ -1,6 +1,6 @@ /*@z12.c:Size Finder:MinSize()@***********************************************/ /* */ -/* THE LOUT DOCUMENT FORMATTING SYSTEM (VERSION 3.18) */ +/* THE LOUT DOCUMENT FORMATTING SYSTEM (VERSION 3.19) */ /* COPYRIGHT (C) 1991, 2000 Jeffrey H. Kingston */ /* */ /* Jeffrey H. Kingston (jeff@cs.usyd.edu.au) */ @@ -107,12 +107,12 @@ static BOOLEAN BuildSpanner(OBJECT x) Error(12, 11, "%s symbol out of place", FATAL, &fpos(x), Image(type(x))); } assert(type(prnt) == ROW_THR, "BuildSpanner: type(prnt)!"); - spanner_sized(hspanner) = 0; + spanner_sized(hspanner) = spanner_fixed(hspanner) = 0; spanner_count(hspanner) = 1; end_link = NextDown(UpDim(x, ROWM)); for( link = NextDown(UpDim(x, ROWM)); link != prnt; link = NextDown(link) ) { Child(y, link); - debug2(DSF, DD, " examining ver %s %s", Image(type(y)), y); + debug2(DSF, DD, " examining ver %s %s", Image(type(y)), EchoObject(y)); if( type(y) == HSPAN ) end_link = NextDown(link); else if( type(y) == START_HVSPAN || type(y) == START_HSPAN || @@ -156,7 +156,7 @@ static BOOLEAN BuildSpanner(OBJECT x) /* @StartHVSpan or @StartHSpan or @StartVSpan or @HSpan or end of column */ Parent(prnt, UpDim(x, COLM)); assert(type(prnt) == COL_THR, "BuildSpanner: type(prnt)!"); - spanner_sized(vspanner) = 0; + spanner_sized(vspanner) = spanner_fixed(vspanner) = 0; spanner_count(vspanner) = 1; end_link = NextDown(UpDim(x, COLM)); for( link = NextDown(UpDim(x, COLM)); link != prnt; link = NextDown(link) ) @@ -586,6 +586,15 @@ OBJECT MinSize(OBJECT x, int dim, OBJECT *extras) break; + case END_HEADER: + case CLEAR_HEADER: + + back(x, dim) = fwd(x, dim) = 0; + break; + + + case BEGIN_HEADER: + case SET_HEADER: case PLAIN_GRAPHIC: case GRAPHIC: diff --git a/z13.c b/z13.c index 59e6c18..b853ab5 100644 --- a/z13.c +++ b/z13.c @@ -1,6 +1,6 @@ /*@z13.c:Object Breaking:BreakJoinedGroup()@**********************************/ /* */ -/* THE LOUT DOCUMENT FORMATTING SYSTEM (VERSION 3.18) */ +/* THE LOUT DOCUMENT FORMATTING SYSTEM (VERSION 3.19) */ /* COPYRIGHT (C) 1991, 2000 Jeffrey H. Kingston */ /* */ /* Jeffrey H. Kingston (jeff@cs.usyd.edu.au) */ @@ -604,8 +604,8 @@ OBJECT BreakObject(OBJECT x, CONSTRAINT *c) case VLIMITED: case HEXPAND: case VEXPAND: - case ONE_ROW: case ONE_COL: + case ONE_ROW: case HSPANNER: assert( Down(x) == LastDown(x), "BreakObject: downs!" ); @@ -668,6 +668,15 @@ OBJECT BreakObject(OBJECT x, CONSTRAINT *c) break; + case END_HEADER: + case CLEAR_HEADER: + + /* these have size zero anyway, so not likely to reach this point */ + break; + + + case BEGIN_HEADER: + case SET_HEADER: case PLAIN_GRAPHIC: case GRAPHIC: diff --git a/z14.c b/z14.c index c148755..d2c75ee 100644 --- a/z14.c +++ b/z14.c @@ -1,6 +1,6 @@ /*@z14.c:Fill Service:Declarations@*******************************************/ /* */ -/* THE LOUT DOCUMENT FORMATTING SYSTEM (VERSION 3.18) */ +/* THE LOUT DOCUMENT FORMATTING SYSTEM (VERSION 3.19) */ /* COPYRIGHT (C) 1991, 2000 Jeffrey H. Kingston */ /* */ /* Jeffrey H. Kingston (jeff@cs.usyd.edu.au) */ diff --git a/z15.c b/z15.c index a2bdedf..d79f677 100644 --- a/z15.c +++ b/z15.c @@ -1,6 +1,6 @@ /*@z15.c:Size Constraints:MinConstraint(), EnlargeToConstraint()@*************/ /* */ -/* THE LOUT DOCUMENT FORMATTING SYSTEM (VERSION 3.18) */ +/* THE LOUT DOCUMENT FORMATTING SYSTEM (VERSION 3.19) */ /* COPYRIGHT (C) 1991, 2000 Jeffrey H. Kingston */ /* */ /* Jeffrey H. Kingston (jeff@cs.usyd.edu.au) */ @@ -480,6 +480,8 @@ void Constrained(OBJECT x, CONSTRAINT *xc, int dim, OBJECT *why) case PLAIN_GRAPHIC: case GRAPHIC: case KERN_SHRINK: + case BEGIN_HEADER: + case SET_HEADER: case ONE_COL: case ONE_ROW: case HCONTRACT: diff --git a/z16.c b/z16.c index 55c705d..184e710 100644 --- a/z16.c +++ b/z16.c @@ -1,6 +1,6 @@ /*@z16.c:Size Adjustment:SetNeighbours(), CatAdjustSize()@********************/ /* */ -/* THE LOUT DOCUMENT FORMATTING SYSTEM (VERSION 3.18) */ +/* THE LOUT DOCUMENT FORMATTING SYSTEM (VERSION 3.19) */ /* COPYRIGHT (C) 1991, 2000 Jeffrey H. Kingston */ /* */ /* Jeffrey H. Kingston (jeff@cs.usyd.edu.au) */ @@ -390,6 +390,10 @@ void AdjustSize(OBJECT x, FULL_LENGTH b, FULL_LENGTH f, int dim) case VCONTRACT: case HEXPAND: case VEXPAND: + case BEGIN_HEADER: + case END_HEADER: + case SET_HEADER: + case CLEAR_HEADER: case ONE_COL: case ONE_ROW: case PLAIN_GRAPHIC: diff --git a/z17.c b/z17.c index 0338f29..3e17148 100644 --- a/z17.c +++ b/z17.c @@ -1,6 +1,6 @@ /*@z17.c:Gap Widths:GetGap()@*************************************************/ /* */ -/* THE LOUT DOCUMENT FORMATTING SYSTEM (VERSION 3.18) */ +/* THE LOUT DOCUMENT FORMATTING SYSTEM (VERSION 3.19) */ /* COPYRIGHT (C) 1991, 2000 Jeffrey H. Kingston */ /* */ /* Jeffrey H. Kingston (jeff@cs.usyd.edu.au) */ diff --git a/z18.c b/z18.c index 036cfae..5063a06 100644 --- a/z18.c +++ b/z18.c @@ -1,6 +1,6 @@ /*@z18.c:Galley Transfer:Declarations@****************************************/ /* */ -/* THE LOUT DOCUMENT FORMATTING SYSTEM (VERSION 3.18) */ +/* THE LOUT DOCUMENT FORMATTING SYSTEM (VERSION 3.19) */ /* COPYRIGHT (C) 1991, 2000 Jeffrey H. Kingston */ /* */ /* Jeffrey H. Kingston (jeff@cs.usyd.edu.au) */ @@ -90,7 +90,7 @@ void TransferInit(OBJECT InitEnv) /* construct destination for root galley */ New(up_hd, HEAD); force_gall(up_hd) = FALSE; - actual(up_hd) = enclose_obj(up_hd) = limiter(up_hd) = nilobj; + actual(up_hd) = enclose_obj(up_hd) = headers(up_hd) = limiter(up_hd) = nilobj; opt_components(up_hd) = opt_constraints(up_hd) = nilobj; gall_dir(up_hd) = ROWM; New(dest_index, RECEIVING); @@ -108,6 +108,7 @@ void TransferInit(OBJECT InitEnv) New(root_galley, HEAD); force_gall(root_galley) = FALSE; enclose_obj(root_galley) = limiter(root_galley) = nilobj; + headers(root_galley) = nilobj; opt_components(root_galley) = opt_constraints(root_galley) = nilobj; gall_dir(root_galley) = ROWM; FposCopy(fpos(root_galley), *no_fpos); @@ -198,6 +199,7 @@ OBJECT TransferBegin(OBJECT x) AttachEnv(env, x); SetTarget(hd); enclose_obj(hd) = (has_enclose(actual(hd)) ? BuildEnclose(hd) : nilobj); + headers(hd) = nilobj; /* search for destination for hd and release it */ Link(Up(target), index); @@ -296,7 +298,7 @@ void TransferComponent(OBJECT x) /* make the component into a galley */ New(hd, HEAD); force_gall(hd) = FALSE; - enclose_obj(hd) = limiter(hd) = nilobj; + enclose_obj(hd) = limiter(hd) = headers(hd) = nilobj; opt_components(hd) = opt_constraints(hd) = nilobj; gall_dir(hd) = ROWM; FposCopy(fpos(hd), fpos(x)); @@ -399,7 +401,7 @@ void TransferEnd(OBJECT x) /* make the component into a galley */ New(hd, HEAD); FposCopy(fpos(hd), fpos(x)); force_gall(hd) = FALSE; - enclose_obj(hd) = limiter(hd) = nilobj; + enclose_obj(hd) = limiter(hd) = headers(hd) = nilobj; opt_components(hd) = opt_constraints(hd) = nilobj; gall_dir(hd) = ROWM; actual(hd) = whereto(hd) = ready_galls(hd) = nilobj; diff --git a/z19.c b/z19.c index 23d3a08..f9262ab 100644 --- a/z19.c +++ b/z19.c @@ -1,6 +1,6 @@ /*@z19.c:Galley Attaching:DetachGalley()@*************************************/ /* */ -/* THE LOUT DOCUMENT FORMATTING SYSTEM (VERSION 3.18) */ +/* THE LOUT DOCUMENT FORMATTING SYSTEM (VERSION 3.19) */ /* COPYRIGHT (C) 1991, 2000 Jeffrey H. Kingston */ /* */ /* Jeffrey H. Kingston (jeff@cs.usyd.edu.au) */ @@ -323,6 +323,7 @@ int AttachGalley(OBJECT hd, OBJECT *inners, OBJECT *suspend_pt) New(target_galley, HEAD); force_gall(target_galley) = FALSE; enclose_obj(target_galley) = limiter(target_galley) = nilobj; + headers(target_galley) = nilobj; opt_components(target_galley) = opt_constraints(target_galley) = nilobj; gall_dir(target_galley) = external_hor(target) ? COLM : ROWM; FposCopy(fpos(target_galley), fpos(target)); @@ -511,6 +512,16 @@ int AttachGalley(OBJECT hd, OBJECT *inners, OBJECT *suspend_pt) break; + case BEGIN_HEADER: + case END_HEADER: + case SET_HEADER: + case CLEAR_HEADER: + + /* do nothing until actually promoted out of here */ + underline(y) = underline(dest); + break; + + case CLOSURE: case CROSS: case FORCE_CROSS: diff --git a/z20.c b/z20.c index f563a33..e6e1492 100644 --- a/z20.c +++ b/z20.c @@ -1,6 +1,6 @@ /*@z20.c:Galley Flushing:DebugInnersNames()@**********************************/ /* */ -/* THE LOUT DOCUMENT FORMATTING SYSTEM (VERSION 3.18) */ +/* THE LOUT DOCUMENT FORMATTING SYSTEM (VERSION 3.19) */ /* COPYRIGHT (C) 1991, 2000 Jeffrey H. Kingston */ /* */ /* Jeffrey H. Kingston (jeff@cs.usyd.edu.au) */ @@ -128,6 +128,7 @@ void FlushGalley(OBJECT hd) FULL_LENGTH stop_perp_fwd; /* fwd(dest_encl) in other direction */ BOOLEAN prnt_flush; /* TRUE when the parent of hd needs a flush */ BOOLEAN target_is_internal; /* TRUE if flushing into an internal target */ + BOOLEAN headers_seen; /* TRUE if a header is seen at all */ OBJECT zlink, z, tmp, prnt; int attach_status; BOOLEAN remove_target; OBJECT why; FULL_LENGTH perp_back, perp_fwd; /* current perp size of dest_encl */ @@ -313,6 +314,7 @@ void FlushGalley(OBJECT hd) if( underline(dest) == UNDER_UNDEF ) underline(dest) = UNDER_OFF; target_is_internal = (dim==ROWM && !external_ver(dest)) || (dim==COLM && !external_hor(dest)); + headers_seen = FALSE; debug1(DGF, DD, " dest_index: %s", EchoObject(dest_index)); @@ -403,8 +405,11 @@ void FlushGalley(OBJECT hd) underline(y) = underline(dest); prec_gap = y; if( target_is_internal ) - { assert( dest_encl != nilobj, "FlushGalley/GAP_OBJ: dest_encl!" ); - if( !nobreak(gap(prec_gap)) ) + { + /* *** not necessarily true + assert( dest_encl != nilobj, "FlushGalley/GAP_OBJ: dest_encl!" ); + *** */ + if( dest_encl != nilobj && !nobreak(gap(prec_gap)) ) { stop_link = link; stop_back = dest_back; @@ -482,6 +487,16 @@ void FlushGalley(OBJECT hd) break; + case BEGIN_HEADER: + case END_HEADER: + case SET_HEADER: + case CLEAR_HEADER: + + /* do nothing except take note, until actually promoted out of here */ + headers_seen = TRUE; + break; + + case NULL_CLOS: case PAGE_LABEL: case WORD: @@ -776,7 +791,12 @@ void FlushGalley(OBJECT hd) REJECT: - /* reject this component and move to a new dest */ + /* reject this component and move to a new dest; at this point, link is */ + /* the link to the rejected component; its child is either y or else it */ + /* is a SPLIT whose child is y */ + debug3(DGF, D, "at REJECT now (stop_link %s); headers(%s) = %s", + stop_link != nilobj ? "non-nil" : "nil", + SymName(actual(hd)), EchoObject(headers(hd))); assert(actual(dest) != PrintSym, "FlushGalley: reject print!"); if( inners != nilobj ) DisposeObject(inners); if( stop_link != nilobj ) @@ -787,6 +807,40 @@ void FlushGalley(OBJECT hd) AdjustSize(dest_encl, stop_perp_back, stop_perp_fwd, 1-dim); } } + + /* if headers_seen, handle any headers not already handled by Promote() */ + if( target_is_internal && headers_seen ) + { OBJECT z, zlink; + for( zlink = hd; NextDown(zlink) != link; ) + { + Child(z, NextDown(zlink)); + debug2(DGF, D, "FlushGalley(%s)/REJECT header-examining %s", + SymName(actual(hd)), EchoObject(z)); + if( type(z) == SPLIT ) + Child(z, DownDim(z, dim)); + if( is_header(type(z)) ) + HandleHeader(hd, NextDown(zlink), z); + else + zlink = NextDown(zlink); + } + } + + /* now, if there are headers, dump them into the galley */ + if( headers(hd) != nilobj ) + { + /* dump new copy of headers into top of galley */ + assert(Down(headers(hd))!=headers(hd), "FlushGalley/REJECT: headers!"); + tmp = Down(hd); + assert( tmp != hd, "FlushGalley/REJECT: first_link!" ); + for( link=Down(headers(hd)); link != headers(hd); link=NextDown(link) ) + { Child(y, link); + debug2(DGF, D, "FlushGalley(%s)/REJECT linking %s", + SymName(actual(hd)), EchoObject(y)); + Link(tmp, y); + } + } + + /* now detach and resume */ DetachGalley(hd); assert( type(dest_index) == RECEIVING, "FlushGalley/REJECT: dest_index!" ); prnt_flush = prnt_flush || blocked(dest_index); @@ -838,6 +892,7 @@ void FlushGalley(OBJECT hd) SetTarget(hd2); foll_or_prec(hd2) = GALL_FOLL; enclose_obj(hd2) = (has_enclose(actual(hd2)) ? BuildEnclose(hd2) : nilobj); + headers(hd2) = nilobj; Link(Up(y), index2); /* set up the next ready galley for reading next time */ diff --git a/z21.c b/z21.c index cb565af..21fb4d4 100644 --- a/z21.c +++ b/z21.c @@ -1,6 +1,6 @@ /*@z21.c:Galley Maker:SizeGalley()@*******************************************/ /* */ -/* THE LOUT DOCUMENT FORMATTING SYSTEM (VERSION 3.18) */ +/* THE LOUT DOCUMENT FORMATTING SYSTEM (VERSION 3.19) */ /* COPYRIGHT (C) 1991, 2000 Jeffrey H. Kingston */ /* */ /* Jeffrey H. Kingston (jeff@cs.usyd.edu.au) */ diff --git a/z22.c b/z22.c index 09090fe..acb3a69 100644 --- a/z22.c +++ b/z22.c @@ -1,6 +1,6 @@ /*@z22.c:Galley Service:Interpose()@******************************************/ /* */ -/* THE LOUT DOCUMENT FORMATTING SYSTEM (VERSION 3.18) */ +/* THE LOUT DOCUMENT FORMATTING SYSTEM (VERSION 3.19) */ /* COPYRIGHT (C) 1991, 2000 Jeffrey H. Kingston */ /* */ /* Jeffrey H. Kingston (jeff@cs.usyd.edu.au) */ @@ -206,7 +206,7 @@ void ExpandRecursives(OBJECT recs) /* expand body of target, convert to galley, and check size */ New(hd, HEAD); actual(hd) = actual(target); must_expand(hd) = TRUE; force_gall(hd) = FALSE; - enclose_obj(hd) = limiter(hd) = nilobj; + enclose_obj(hd) = limiter(hd) = headers(hd) = nilobj; opt_components(hd) = opt_constraints(hd) = nilobj; gall_dir(hd) = horiz_galley(actual(target)); whereto(hd) = ready_galls(hd) = nilobj; @@ -308,8 +308,17 @@ static OBJECT FindSplitInGalley(OBJECT hd) break; + case BEGIN_HEADER: + case SET_HEADER: + + Child(y, LastDown(y)); + break; + + case CLOSURE: case NULL_CLOS: + case END_HEADER: + case CLEAR_HEADER: case PAGE_LABEL: case HCAT: case WORD: @@ -355,6 +364,99 @@ static OBJECT FindSplitInGalley(OBJECT hd) return y; } /* end FindSplitInGalley */ + +/*@::HandleHeader()@**********************************************************/ +/* */ +/* HandleHeader(hd, link, header) */ +/* */ +/* Given galley hd containing header object header, this routine handles */ +/* the header, i.e. it updates headers(hd) to reflect the effect of the */ +/* header, then deletes the header and its following gap object. */ +/* */ +/* Link is the link from hd to the header (it may actually link to a */ +/* split object which then links to the header, but no matter). */ +/* */ +/*****************************************************************************/ + +void HandleHeader(OBJECT hd, OBJECT link, OBJECT header) +{ OBJECT g, y, z; + debug3(DGS, D, "HandleHeader(%s, link, %s); headers = %s", + SymName(actual(hd)), EchoObject(header), EchoObject(headers(hd))); + assert(is_header(type(header)), "HandleHeader: type(header)!"); + switch( type(header) ) + { + + case CLEAR_HEADER: + + /* clear out old headers, if any */ + if( headers(hd) != nilobj ) + { + DisposeObject(headers(hd)); + headers(hd) = nilobj; + } + break; + + + case SET_HEADER: + + /* clear out old headers, if any */ + if( headers(hd) != nilobj ) + { + DisposeObject(headers(hd)); + headers(hd) = nilobj; + } + /* NB NO BREAK! */ + + + case BEGIN_HEADER: + + /* make new headers if required */ + if( headers(hd) == nilobj ) + New(headers(hd), gall_dir(hd) == ROWM ? VCAT : ACAT); + + /* construct a gap object from the left parameter */ + New(g, GAP_OBJ); + underline(g) = FALSE; + MoveLink(Down(header), g, PARENT); + Child(z, Down(g)); + GapCopy(gap(g), line_gap(save_style(header))); + + /* move header and gap into headers() */ + MoveLink(LastDown(header), headers(hd), PARENT); + Link(headers(hd), g); + break; + + + case END_HEADER: + + if( headers(hd) == nilobj ) + Error(22, 11, "no header for %s to remove", WARN, &fpos(hd), + KW_END_HEADER); + else + { + DisposeChild(LastDown(headers(hd))); + assert(LastDown(headers(hd))!=headers(hd), "Promote/END_HEADER!"); + DisposeChild(LastDown(headers(hd))); + if( Down(headers(hd)) == headers(hd) ) + { DisposeObject(headers(hd)); + headers(hd) = nilobj; + } + } + break; + + } + + /* get rid of header object and following gap now */ + Child(y, NextDown(link)); + assert(type(y) == GAP_OBJ, "Promote/HEADER: type(y) != GAP_OBJ!"); + DisposeChild(NextDown(link)); + DisposeChild(link); + debug2(DGS, D, "HandleHeader returning; headers(%s) now %s", + SymName(actual(hd)), EchoObject(headers(hd))); + +} /* end HandleHeader */ + + /*@::Promote()@***************************************************************/ /* */ /* Promote(hd, stop_link, dest_index, join_after) */ @@ -368,6 +470,10 @@ static OBJECT FindSplitInGalley(OBJECT hd) /* Whether to make this a joining gap or not is a tricky question which */ /* Promote answers by referring to join_after. */ /* */ +/* Any BEGIN_HEADER, END_HEADER, SET_HEADER, or CLEAR_HEADER objects in */ +/* the promoted components are diverted to headers(hd), if the target */ +/* is internal. */ +/* */ /*****************************************************************************/ void Promote(OBJECT hd, OBJECT stop_link, OBJECT dest_index, BOOLEAN join_after) @@ -470,14 +576,6 @@ void Promote(OBJECT hd, OBJECT stop_link, OBJECT dest_index, BOOLEAN join_after) else if( is_indefinite(type(y)) ) { /* indefinite, always skip these */ - /* *** - New(z, NULL_CLOS); - FposCopy(fpos(z), fpos(y)); - back(z, COLM) = 0; - fwd(z, COLM) = 0; - Link(opt_components(hd), z); - debug1(DOG, DD, " adding %s", KW_NULL); - *** */ } else if( is_definite(type(y)) ) { @@ -626,6 +724,17 @@ void Promote(OBJECT hd, OBJECT stop_link, OBJECT dest_index, BOOLEAN join_after) break; + case BEGIN_HEADER: + case END_HEADER: + case SET_HEADER: + case CLEAR_HEADER: + + Error(22, 10, "%s symbol ignored (out of place)", WARN, &fpos(y), + Image(type(y))); + DisposeChild(NextDown(link)); + break; + + case WORD: case QWORD: case ONE_COL: @@ -750,9 +859,16 @@ void Promote(OBJECT hd, OBJECT stop_link, OBJECT dest_index, BOOLEAN join_after) { link = Up(dest_index); } else - { for( link = hd; NextDown(link) != stop_link; ) + { + dim = gall_dir(hd); + for( link = hd; NextDown(link) != stop_link; ) { Child(y, NextDown(link)); - if( is_index(type(y)) ) + debug1(DGS, D, "ordinary promote examining %s", EchoObject(y)); + if( type(y) == SPLIT ) + Child(y, DownDim(y, dim)); + if( is_header(type(y)) ) + HandleHeader(hd, NextDown(link), y); + else if( is_index(type(y)) ) MoveLink(NextDown(link), Up(dest_index), PARENT); else link = NextDown(link); } diff --git a/z23.c b/z23.c index 2cf04bc..177fa3c 100644 --- a/z23.c +++ b/z23.c @@ -1,6 +1,6 @@ /*@z23.c:Galley Printer:ScaleFactor()@****************************************/ /* */ -/* THE LOUT DOCUMENT FORMATTING SYSTEM (VERSION 3.18) */ +/* THE LOUT DOCUMENT FORMATTING SYSTEM (VERSION 3.19) */ /* COPYRIGHT (C) 1991, 2000 Jeffrey H. Kingston */ /* */ /* Jeffrey H. Kingston (jeff@cs.usyd.edu.au) */ @@ -128,11 +128,11 @@ void FixAndPrintObject(OBJECT x, FULL_LENGTH xmk, FULL_LENGTH xb, { OBJECT y, link, prev, g, uplink, z, face, thr; FULL_LENGTH mk, ymk, frame_size, back_edge, yb, yf, inc, f; int i; float scale_factor; BOOLEAN jn; - debug7(DGP, DD, "[ FixAndPrintObject(%s %s, %s, %s,%s, %s, %s, pg )", + debug8(DGP, DD, "[ FixAndPrintObject(%s %s, %s, %s,%s, %s, %s, pg, %d)", Image(type(x)), ((type(x) == WORD || type(x) == QWORD) ? string(x) : STR_EMPTY), EchoLength(xmk), EchoLength(xb), EchoLength(xf),dimen(dim), - (suppress == SUPPRESS ? "suppress" : "no_suppress")); + (suppress == SUPPRESS ? "suppress" : "no_suppress"), count); debug2(DGP, DD, " size(x) = %s,%s; x =", EchoLength(back(x, dim)), EchoLength(fwd(x, dim))); ifdebug(DGP, DD, DebugObject(x)); @@ -169,27 +169,19 @@ void FixAndPrintObject(OBJECT x, FULL_LENGTH xmk, FULL_LENGTH xb, { Child(z, Down(y)); Parent(thr, UpDim(x, dim)); - debug7(DGP, DD, " calling SPAN %s(xmk %s, x %s,%s, cons %s, z %s,%s)", - dimen(dim), EchoLength(xmk), - EchoLength(back(x, dim)), EchoLength(fwd(x, dim)), - EchoConstraint(&constraint(y)), - EchoLength(back(z, dim)), EchoLength(fwd(z, dim))); - /* *** - f = find_max(xf, fwd(z,dim)); - FixAndPrintObject(z, xmk - back(thr, dim) + back(z, dim), back(z, dim), - find_max(f, bfc(constraint(y)) - back(z, dim)), - dim, FALSE, pg, 1); - *** */ - debug5(DGP, DD, " calling FAPO from %s (y = %s, bfc = %s, z = %s,%s", - Image(type(x)), Image(type(y)), EchoLength(bfc(constraint(y))), - EchoLength(back(z, dim)), EchoLength(fwd(z, dim))); - /* *** - FixAndPrintObject(z, xmk - back(thr, dim) + back(z, dim), back(z, dim), - bfc(constraint(y)) - back(z, dim), dim, FALSE, pg, 1); - *** */ - FixAndPrintObject(z, xmk - back(thr, dim) + back(z, dim), back(z, dim), - find_max(fwd(z, dim), bfc(constraint(y)) - back(z, dim)), - dim, FALSE, pg, 1); + save_mark(y) = xmk - back(thr, dim) + back(z, dim); + + /* do the fix now if the first column is also the last one */ + if( ++spanner_fixed(y) == spanner_count(y) ) + { + debug6(DGP, DD, " f+last SPAN: yf = max(%s + %s - %s, %s, %s - %s)", + EchoLength(xmk), EchoLength(xf), EchoLength(save_mark(y)), + EchoLength(fwd(z, dim)), + EchoLength(bfc(constraint(y))), EchoLength(back(z, dim))); + yf = find_max(xmk + xf - save_mark(y), fwd(z, dim)); + yf = find_max(yf, bfc(constraint(y)) - back(z, dim)); + FixAndPrintObject(z, save_mark(y), back(z, dim), yf, dim,FALSE,pg,1); + } } else { @@ -202,7 +194,22 @@ void FixAndPrintObject(OBJECT x, FULL_LENGTH xmk, FULL_LENGTH xb, case HSPAN: case VSPAN: - /* nothing to print, spanner beneath is already done */ + /* do the fix on the last one */ + CountChild(y, DownDim(x, dim), count); + if( type(y) == HSPANNER || type(y) == VSPANNER ) + { + if( ++spanner_fixed(y) == spanner_count(y) ) + { + Child(z, Down(y)); + debug6(DGP, DD, " last SPAN: yf = max(%s + %s - %s, %s, %s - %s)", + EchoLength(xmk), EchoLength(xf), EchoLength(save_mark(y)), + EchoLength(fwd(z, dim)), + EchoLength(bfc(constraint(y))), EchoLength(back(z, dim))); + yf = find_max(xmk + xf - save_mark(y), fwd(z, dim)); + yf = find_max(yf, bfc(constraint(y)) - back(z, dim)); + FixAndPrintObject(z, save_mark(y), back(z, dim), yf, dim,FALSE,pg,1); + } + } break; @@ -1226,11 +1233,23 @@ void FixAndPrintObject(OBJECT x, FULL_LENGTH xmk, FULL_LENGTH xb, break; + case BEGIN_HEADER: + case END_HEADER: + case SET_HEADER: + case CLEAR_HEADER: + + if( dim == COLM ) + Error(23, 8, "%s symbol ignored (out of place)", WARN, &fpos(x), + Image(type(x))); + break; + + default: assert1(FALSE, "FixAndPrintObject:", Image(type(x))); break; + } /* end switch */ debug2(DGP, DD, "] FixAndPrintObject returning (size now %s,%s).", EchoLength(back(x, dim)), EchoLength(fwd(x, dim))); diff --git a/z24.c b/z24.c index cdfd62f..c587bbb 100644 --- a/z24.c +++ b/z24.c @@ -1,6 +1,6 @@ /*@z24.c:Print Service:PrintInit()@*******************************************/ /* */ -/* THE LOUT DOCUMENT FORMATTING SYSTEM (VERSION 3.18) */ +/* THE LOUT DOCUMENT FORMATTING SYSTEM (VERSION 3.19) */ /* COPYRIGHT (C) 1991, 2000 Jeffrey H. Kingston */ /* */ /* Jeffrey H. Kingston (jeff@cs.usyd.edu.au) */ diff --git a/z25.c b/z25.c index cc172a7..fee43d9 100644 --- a/z25.c +++ b/z25.c @@ -1,6 +1,6 @@ /*@z25.c:Object Echo:aprint(), cprint(), printnum()@**************************/ /* */ -/* THE LOUT DOCUMENT FORMATTING SYSTEM (VERSION 3.18) */ +/* THE LOUT DOCUMENT FORMATTING SYSTEM (VERSION 3.19) */ /* COPYRIGHT (C) 1991, 2000 Jeffrey H. Kingston */ /* */ /* Jeffrey H. Kingston (jeff@cs.usyd.edu.au) */ @@ -121,7 +121,7 @@ static void newline(void) static void echo(OBJECT x, unsigned outer_prec, int count) { OBJECT link, y, tmp, sym, z; - char *op; int prec, i, childcount; + char *op; int prec, i, childcount, ycount; BOOLEAN npar_seen, name_printed, lbr_printed, braces_needed; switch( type(x) ) @@ -234,6 +234,7 @@ static void echo(OBJECT x, unsigned outer_prec, int count) break; + /* *** case COL_THR: aprint("{C "); @@ -241,7 +242,25 @@ static void echo(OBJECT x, unsigned outer_prec, int count) if( link != x ) { CountChild(y, link, count); echo(y, HCAT_PREC, count); - /* newline(); */ + } + aprint(" C}"); + break; + *** */ + + + case COL_THR: + + aprint("{C "); + newline(); + for( i=1, link = Down(x); link != x; link = NextDown(link), i++ ) + { + if( i == count ) + aprint("C@ "); + else + aprint("C: "); + CountChild(y, link, ycount); + echo(y, HCAT_PREC, ycount); + newline(); } aprint(" C}"); break; @@ -665,6 +684,8 @@ static void echo(OBJECT x, unsigned outer_prec, int count) break; + case BEGIN_HEADER: + case SET_HEADER: case ONE_COL: case ONE_ROW: case HCONTRACT: @@ -774,6 +795,8 @@ static void echo(OBJECT x, unsigned outer_prec, int count) case PAGE_LABEL: case HSPAN: case VSPAN: + case END_HEADER: + case CLEAR_HEADER: /* predefined symbols that have (or may have) no parameters */ cprint(Image(type(x))); diff --git a/z26.c b/z26.c index 72f42e7..d018a57 100644 --- a/z26.c +++ b/z26.c @@ -1,6 +1,6 @@ /*@z26.c:Echo Service:BeginString()@******************************************/ /* */ -/* THE LOUT DOCUMENT FORMATTING SYSTEM (VERSION 3.18) */ +/* THE LOUT DOCUMENT FORMATTING SYSTEM (VERSION 3.19) */ /* COPYRIGHT (C) 1991, 2000 Jeffrey H. Kingston */ /* */ /* Jeffrey H. Kingston (jeff@cs.usyd.edu.au) */ @@ -180,6 +180,10 @@ FULL_CHAR *Image(unsigned int c) case PAGE_LABEL: return KW_PAGE_LABEL; case CROSS: return KW_CROSS; case FORCE_CROSS: return KW_FORCE_CROSS; + case BEGIN_HEADER: return KW_BEGIN_HEADER; + case END_HEADER: return KW_END_HEADER; + case SET_HEADER: return KW_SET_HEADER; + case CLEAR_HEADER: return KW_CLEAR_HEADER; case ONE_COL: return KW_ONE_COL; case ONE_ROW: return KW_ONE_ROW; case WIDE: return KW_WIDE; diff --git a/z27.c b/z27.c index fe84413..4785a6e 100644 --- a/z27.c +++ b/z27.c @@ -1,6 +1,6 @@ /*@z27.c:Debug Service:Debug flags@*******************************************/ /* */ -/* THE LOUT DOCUMENT FORMATTING SYSTEM (VERSION 3.18) */ +/* THE LOUT DOCUMENT FORMATTING SYSTEM (VERSION 3.19) */ /* COPYRIGHT (C) 1991, 2000 Jeffrey H. Kingston */ /* */ /* Jeffrey H. Kingston (jeff@cs.usyd.edu.au) */ diff --git a/z28.c b/z28.c index c9b1990..85b4b41 100644 --- a/z28.c +++ b/z28.c @@ -1,6 +1,6 @@ /*@z28.c:Error Service:ErrorInit(), ErrorSeen()@******************************/ /* */ -/* THE LOUT DOCUMENT FORMATTING SYSTEM (VERSION 3.18) */ +/* THE LOUT DOCUMENT FORMATTING SYSTEM (VERSION 3.19) */ /* COPYRIGHT (C) 1991, 2000 Jeffrey H. Kingston */ /* */ /* Jeffrey H. Kingston (jeff@cs.usyd.edu.au) */ diff --git a/z29.c b/z29.c index feacb92..283ee7f 100644 --- a/z29.c +++ b/z29.c @@ -1,6 +1,6 @@ /*@z29.c:Symbol Table:Declarations, hash()@***********************************/ /* */ -/* THE LOUT DOCUMENT FORMATTING SYSTEM (VERSION 3.18) */ +/* THE LOUT DOCUMENT FORMATTING SYSTEM (VERSION 3.19) */ /* COPYRIGHT (C) 1991, 2000 Jeffrey H. Kingston */ /* */ /* Jeffrey H. Kingston (jeff@cs.usyd.edu.au) */ diff --git a/z30.c b/z30.c index 752b8df..59cd591 100644 --- a/z30.c +++ b/z30.c @@ -1,6 +1,6 @@ /*@z30.c:Symbol uses:InsertUses()@********************************************/ /* */ -/* THE LOUT DOCUMENT FORMATTING SYSTEM (VERSION 3.18) */ +/* THE LOUT DOCUMENT FORMATTING SYSTEM (VERSION 3.19) */ /* COPYRIGHT (C) 1991, 2000 Jeffrey H. Kingston */ /* */ /* Jeffrey H. Kingston (jeff@cs.usyd.edu.au) */ diff --git a/z31.c b/z31.c index c63cdba..a3d8bda 100644 --- a/z31.c +++ b/z31.c @@ -1,6 +1,6 @@ /*@z31.c:Memory Allocator:DebugMemory()@**************************************/ /* */ -/* THE LOUT DOCUMENT FORMATTING SYSTEM (VERSION 3.18) */ +/* THE LOUT DOCUMENT FORMATTING SYSTEM (VERSION 3.19) */ /* COPYRIGHT (C) 1991, 2000 Jeffrey H. Kingston */ /* */ /* Jeffrey H. Kingston (jeff@cs.usyd.edu.au) */ @@ -186,6 +186,10 @@ void MemInit(void) zz_lengths[ ACAT ] = zz_lengths[ HCAT ] = zz_lengths[ VCAT ] = + zz_lengths[ BEGIN_HEADER ] = + zz_lengths[ END_HEADER ] = + zz_lengths[ SET_HEADER ] = + zz_lengths[ CLEAR_HEADER ] = zz_lengths[ ONE_COL ] = zz_lengths[ ONE_ROW ] = zz_lengths[ WIDE ] = diff --git a/z32.c b/z32.c index 1407049..98ae4ae 100644 --- a/z32.c +++ b/z32.c @@ -1,6 +1,6 @@ /*@z32.c:Counter Service:Next()@**********************************************/ /* */ -/* THE LOUT DOCUMENT FORMATTING SYSTEM (VERSION 3.18) */ +/* THE LOUT DOCUMENT FORMATTING SYSTEM (VERSION 3.19) */ /* COPYRIGHT (C) 1991, 2000 Jeffrey H. Kingston */ /* */ /* Jeffrey H. Kingston (jeff@cs.usyd.edu.au) */ @@ -83,10 +83,14 @@ OBJECT Next(OBJECT x, int inc, BOOLEAN *done) case START_VSPAN: case HSPAN: case VSPAN: + case END_HEADER: + case CLEAR_HEADER: break; + case BEGIN_HEADER: + case SET_HEADER: case ONE_COL: case ONE_ROW: case WIDE: diff --git a/z33.c b/z33.c index c66717d..be65fc4 100644 --- a/z33.c +++ b/z33.c @@ -1,6 +1,6 @@ /*@z33.c:Database Service:OldCrossDb(), NewCrossDb(), SymToNum()@*************/ /* */ -/* THE LOUT DOCUMENT FORMATTING SYSTEM (VERSION 3.18) */ +/* THE LOUT DOCUMENT FORMATTING SYSTEM (VERSION 3.19) */ /* COPYRIGHT (C) 1991, 2000 Jeffrey H. Kingston */ /* */ /* Jeffrey H. Kingston (jeff@cs.usyd.edu.au) */ diff --git a/z34.c b/z34.c index 9e8cadc..3d7e770 100644 --- a/z34.c +++ b/z34.c @@ -1,6 +1,6 @@ /*@z34.c:Rotation Service:Declarations@***************************************/ /* */ -/* THE LOUT DOCUMENT FORMATTING SYSTEM (VERSION 3.18) */ +/* THE LOUT DOCUMENT FORMATTING SYSTEM (VERSION 3.19) */ /* COPYRIGHT (C) 1991, 2000 Jeffrey H. Kingston */ /* */ /* Jeffrey H. Kingston (jeff@cs.usyd.edu.au) */ diff --git a/z35.c b/z35.c index cabfd0a..b637cce 100644 --- a/z35.c +++ b/z35.c @@ -1,6 +1,6 @@ /*@z35.c:Time Keeper: MomentSym(), TimeString()@******************************/ /* */ -/* THE LOUT DOCUMENT FORMATTING SYSTEM (VERSION 3.18) */ +/* THE LOUT DOCUMENT FORMATTING SYSTEM (VERSION 3.19) */ /* COPYRIGHT (C) 1991, 2000 Jeffrey H. Kingston */ /* */ /* Jeffrey H. Kingston (jeff@cs.usyd.edu.au) */ diff --git a/z36.c b/z36.c index f4c4866..2f3f669 100644 --- a/z36.c +++ b/z36.c @@ -1,6 +1,6 @@ /*@z36.c:Hyphenation: Declarations@*******************************************/ /* */ -/* THE LOUT DOCUMENT FORMATTING SYSTEM (VERSION 3.18) */ +/* THE LOUT DOCUMENT FORMATTING SYSTEM (VERSION 3.19) */ /* COPYRIGHT (C) 1991, 2000 Jeffrey H. Kingston */ /* */ /* Jeffrey H. Kingston (jeff@cs.usyd.edu.au) */ diff --git a/z37.c b/z37.c index 8b94f87..b541475 100644 --- a/z37.c +++ b/z37.c @@ -1,6 +1,6 @@ /*@z37.c:Font Service:Declarations@*******************************************/ /* */ -/* THE LOUT DOCUMENT FORMATTING SYSTEM (VERSION 3.18) */ +/* THE LOUT DOCUMENT FORMATTING SYSTEM (VERSION 3.19) */ /* COPYRIGHT (C) 1991, 2000 Jeffrey H. Kingston */ /* */ /* Jeffrey H. Kingston (jeff@cs.usyd.edu.au) */ diff --git a/z38.c b/z38.c index d183a9c..e08f2c2 100644 --- a/z38.c +++ b/z38.c @@ -1,6 +1,6 @@ /*@z38.c:Character Mappings:Declarations@*************************************/ /* */ -/* THE LOUT DOCUMENT FORMATTING SYSTEM (VERSION 3.18) */ +/* THE LOUT DOCUMENT FORMATTING SYSTEM (VERSION 3.19) */ /* COPYRIGHT (C) 1991, 2000 Jeffrey H. Kingston */ /* */ /* Jeffrey H. Kingston (jeff@cs.usyd.edu.au) */ diff --git a/z39.c b/z39.c index ce4a511..6d86278 100644 --- a/z39.c +++ b/z39.c @@ -1,6 +1,6 @@ /*@z39.c:String Handler:AsciiToFull(), StringEqual(), etc.@*******************/ /* */ -/* THE LOUT DOCUMENT FORMATTING SYSTEM (VERSION 3.18) */ +/* THE LOUT DOCUMENT FORMATTING SYSTEM (VERSION 3.19) */ /* COPYRIGHT (C) 1991, 2000 Jeffrey H. Kingston */ /* */ /* Jeffrey H. Kingston (jeff@cs.usyd.edu.au) */ diff --git a/z40.c b/z40.c index 362f017..02cc61d 100644 --- a/z40.c +++ b/z40.c @@ -1,6 +1,6 @@ /*@z40.c:Filter Handler:FilterInit()@*****************************************/ /* */ -/* THE LOUT DOCUMENT FORMATTING SYSTEM (VERSION 3.18) */ +/* THE LOUT DOCUMENT FORMATTING SYSTEM (VERSION 3.19) */ /* COPYRIGHT (C) 1991, 2000 Jeffrey H. Kingston */ /* */ /* Jeffrey H. Kingston (jeff@cs.usyd.edu.au) */ diff --git a/z41.c b/z41.c index 389168b..3a3b68a 100644 --- a/z41.c +++ b/z41.c @@ -1,6 +1,6 @@ /*@z41.c:Object Input-Output:AppendToFile, ReadFromFile@**********************/ /* */ -/* THE LOUT DOCUMENT FORMATTING SYSTEM (VERSION 3.18) */ +/* THE LOUT DOCUMENT FORMATTING SYSTEM (VERSION 3.19) */ /* COPYRIGHT (C) 1991, 2000 Jeffrey H. Kingston */ /* */ /* Jeffrey H. Kingston (jeff@cs.usyd.edu.au) */ @@ -487,6 +487,10 @@ static void WriteObject(OBJECT x, int outer_prec, int *linecount, FILE_NUM fnum) case NULL_CLOS: name = KW_NULL; goto SETC; case PAGE_LABEL: name = KW_PAGE_LABEL; goto SETC; + case BEGIN_HEADER: name = KW_BEGIN_HEADER; goto SETC; + case END_HEADER: name = KW_END_HEADER; goto SETC; + case SET_HEADER: name = KW_SET_HEADER; goto SETC; + case CLEAR_HEADER: name = KW_CLEAR_HEADER; goto SETC; case ONE_COL: name = KW_ONE_COL; goto SETC; case ONE_ROW: name = KW_ONE_ROW; goto SETC; case WIDE: name = KW_WIDE; goto SETC; diff --git a/z42.c b/z42.c index 6a31b99..046f8b2 100644 --- a/z42.c +++ b/z42.c @@ -1,6 +1,6 @@ /*@z42.c:Colour Service:ColourChange, ColourCommand@**************************/ /* */ -/* THE LOUT DOCUMENT FORMATTING SYSTEM (VERSION 3.18) */ +/* THE LOUT DOCUMENT FORMATTING SYSTEM (VERSION 3.19) */ /* COPYRIGHT (C) 1991, 2000 Jeffrey H. Kingston */ /* */ /* Jeffrey H. Kingston (jeff@cs.usyd.edu.au) */ diff --git a/z43.c b/z43.c index 009594d..ca5562d 100644 --- a/z43.c +++ b/z43.c @@ -1,6 +1,6 @@ /*@z43.c:Language Service:LanguageChange, LanguageString@*********************/ /* */ -/* THE LOUT DOCUMENT FORMATTING SYSTEM (VERSION 3.18) */ +/* THE LOUT DOCUMENT FORMATTING SYSTEM (VERSION 3.19) */ /* COPYRIGHT (C) 1991, 2000 Jeffrey H. Kingston */ /* */ /* Jeffrey H. Kingston (jeff@cs.usyd.edu.au) */ diff --git a/z44.c b/z44.c index f0ec457..1fff7a5 100644 --- a/z44.c +++ b/z44.c @@ -1,6 +1,6 @@ /*@z44.c:Vertical Hyphenation:VerticalHyphenate()@****************************/ /* */ -/* THE LOUT DOCUMENT FORMATTING SYSTEM (VERSION 3.18) */ +/* THE LOUT DOCUMENT FORMATTING SYSTEM (VERSION 3.19) */ /* COPYRIGHT (C) 1991, 2000 Jeffrey H. Kingston */ /* */ /* Jeffrey H. Kingston (jeff@cs.usyd.edu.au) */ diff --git a/z45.c b/z45.c index 72cf90c..5a05897 100644 --- a/z45.c +++ b/z45.c @@ -1,6 +1,6 @@ /*@z45.c:External Sort:SortFile()@********************************************/ /* */ -/* THE LOUT DOCUMENT FORMATTING SYSTEM (VERSION 3.18) */ +/* THE LOUT DOCUMENT FORMATTING SYSTEM (VERSION 3.19) */ /* COPYRIGHT (C) 1991, 2000 Jeffrey H. Kingston */ /* */ /* Jeffrey H. Kingston (jeff@cs.usyd.edu.au) */ diff --git a/z46.c b/z46.c index 6056203..5a32d22 100644 --- a/z46.c +++ b/z46.c @@ -1,6 +1,6 @@ /*@z46.c:Optimal Galleys:FindOptimize()@**************************************/ /* */ -/* THE LOUT DOCUMENT FORMATTING SYSTEM (VERSION 3.18) */ +/* THE LOUT DOCUMENT FORMATTING SYSTEM (VERSION 3.19) */ /* COPYRIGHT (C) 1991, 2000 Jeffrey H. Kingston */ /* */ /* Jeffrey H. Kingston (jeff@cs.usyd.edu.au) */ diff --git a/z47.c b/z47.c index 78f931f..fe2e0b9 100644 --- a/z47.c +++ b/z47.c @@ -1,6 +1,6 @@ /*@z47.c:Environment Table:EnvReadRetrieve()@*********************************/ /* */ -/* THE LOUT DOCUMENT FORMATTING SYSTEM (VERSION 3.18) */ +/* THE LOUT DOCUMENT FORMATTING SYSTEM (VERSION 3.19) */ /* COPYRIGHT (C) 1991, 2000 Jeffrey H. Kingston */ /* */ /* Jeffrey H. Kingston (jeff@cs.usyd.edu.au) */ diff --git a/z48.c b/z48.c index 46d5882..71e1e84 100644 --- a/z48.c +++ b/z48.c @@ -1,6 +1,6 @@ /*@z48.c:PDF back end@********************************************************/ /* */ -/* THE LOUT DOCUMENT FORMATTING SYSTEM (VERSION 3.18) */ +/* THE LOUT DOCUMENT FORMATTING SYSTEM (VERSION 3.19) */ /* COPYRIGHT (C) 1991, 2000 Jeffrey H. Kingston */ /* */ /* Jeffrey H. Kingston (jeff@cs.usyd.edu.au) */ -- cgit