diff options
author | Norbert Preining <norbert@preining.info> | 2019-09-02 13:46:59 +0900 |
---|---|---|
committer | Norbert Preining <norbert@preining.info> | 2019-09-02 13:46:59 +0900 |
commit | e0c6872cf40896c7be36b11dcc744620f10adf1d (patch) | |
tree | 60335e10d2f4354b0674ec22d7b53f0f8abee672 /info/laan/pwt |
Initial commit
Diffstat (limited to 'info/laan/pwt')
l--------- | info/laan/pwt/README | 1 | ||||
-rw-r--r-- | info/laan/pwt/pwt.aft | 293 | ||||
-rw-r--r-- | info/laan/pwt/pwt.cus | 433 | ||||
-rw-r--r-- | info/laan/pwt/pwt.fmt | 1467 | ||||
-rw-r--r-- | info/laan/pwt/pwt.his | 84 | ||||
-rw-r--r-- | info/laan/pwt/pwt.ind | 506 | ||||
-rw-r--r-- | info/laan/pwt/pwt.int | 707 | ||||
-rw-r--r-- | info/laan/pwt/pwt.mat | 1167 | ||||
-rw-r--r-- | info/laan/pwt/pwt.obs | 5 | ||||
-rw-r--r-- | info/laan/pwt/pwt.ref | 292 | ||||
-rw-r--r-- | info/laan/pwt/pwt.scr | 452 | ||||
-rw-r--r-- | info/laan/pwt/pwt.sur | 139 | ||||
-rw-r--r-- | info/laan/pwt/pwt.tab | 1875 | ||||
-rw-r--r-- | info/laan/pwt/pwt.tls | 365 | ||||
-rw-r--r-- | info/laan/pwt/pwt.tot | 154 | ||||
-rw-r--r-- | info/laan/pwt/pwt.txt | 1255 | ||||
-rw-r--r-- | info/laan/pwt/readme.fst | 66 |
17 files changed, 9261 insertions, 0 deletions
diff --git a/info/laan/pwt/README b/info/laan/pwt/README new file mode 120000 index 0000000000..966a6277c5 --- /dev/null +++ b/info/laan/pwt/README @@ -0,0 +1 @@ +readme.fst
\ No newline at end of file diff --git a/info/laan/pwt/pwt.aft b/info/laan/pwt/pwt.aft new file mode 100644 index 0000000000..896198cbf8 --- /dev/null +++ b/info/laan/pwt/pwt.aft @@ -0,0 +1,293 @@ +\input blue.tex \loadindexmacros \report + +\bluechapter Afterthoughts + +\beginsummary +This chapter relates BLUe's format to existing formats and styles, +especially \AmS-(La)\TeX, (La)\TeX, LAmS\TeX, and the TUGboat styles. +At the end some statistics about processing PWT has been included. +\endsummary + +Why this work? Is \LaTeX{} not sufficient? +\LaTeX{} was not necessary, the \TeX book contained it all, \smiley. +This advantage turned out to be a severe disadvantage. +\TeX{} was simply too much, too unusual and ahead of its time. +The bad news is, alas, that \TeX{} is very error-prone, +in the hands of the casual layman.\ftn{Don't misunderstand me, + the software itself is as free of errors as bugfree can be. + No, it has all to do with people who partly + understand the system, but need macros. + Many a released macro\Dash the more so for collections of macros\Dash + is immediately followed by an improved version, and so on. The last + observation is due to George Greenwade, and I agree with him.} +One has to be very precise, has to oversee all the consequences, +and has to be utmost, utmost consequent. + +Perhaps because of the latter Lamport dared to do less, +thought that simplifying is the way out. To quote Dijkstra +\begincenter\noindent`Abstraction is our only mental tool to + master complexity' +\endcenter +He provided a system tuned for the end-user, +along with a users' guide. +The latter is the big deal for general acceptance.\ftn{BLUe's format system + not only provides the macros and the users' guide PWT, no it also provides + the background articles, especially the paradigm series, next to articles + which account in detail for some other formats like manmac, AMS, and \TUB.} +\begincenter +If only there had been a users' guide for manmac, +the \AllTeX{} world would have looked much different +from what it is today. {\TB} is +`intended for people who have never used {\TeX} before, +as well as for experienced {\TeX} hackers. +\endcenter +Below I'll very roughly characterize other formats, which enjoy a general +acceptance, in relation to BLUe's format. +The AMS and TUG styles, and the work of Spivak, have been +surveyed\Dash and commented in depth\Dash in separate articles. + + +^^{\AmSTeX} +\bluehead \AmS-(La)\TeX + +These formats are not personal but provided and maintained by the \AMS. +It is a rich and wealthy source. My comments date back to {\oldstyle1992}, +when I studied the formats in detail. +Their user and installation guides are very good. +The coding is clever, very clever, but tends to be monolithic. +It is not easy to borrow parts from it. The formatting of references +in \bluetex{} has been inspired upon \AmSTeX's preprint style. + +^^{\LAMSTeX} +\bluehead \LAMSTeX + +Michael Spivak did a great job. +His macros for tables and commutative diagrams +are impressive, very impressive. +The way he recast the \LaTeX{} functionality looks very promising. +It is only a pity that his code does not enjoy general acceptance, +as far as I know. +It is even sadder that his codings have not been +studied nor borrowed from.\ftn{I must confess that I was put off by + his argument for why an \cs{else} is needed within \cs{loop} \cs{repeat}. + Not true, IMHO, with all respect. A little Boolean arithmetic will do, + and is useful for other purposes too. I explained that in `Syntactic + Sugar,' and showed codes for that.} + + +^^{\LaTeX} +\bluehead La\TeX + +Indeed, \LaTeX{} is not sufficient, although much of +the functionality of BLUe's format was already provided by \LaTeX. +The setup of BLUe's format is much different though. +\LaTeX{} does not suit my purposes. +Its Achilles heel is customization. +Some features of BLUe's format are +its open eye for change, +its openendedness, +next to +its turtle graphics, +its databases,\ftn{This is much more general than {\em separately stored\/} + style files.} +and last but not least its (mini-)indexing on the fly, +that is what I need. +I understand \bluetex{} and feel happy with it, \winksmiley, +probably for the rest of my life. +The great\Dash not to be underestimated\Dash virtues of \LaTeX{} are +\begincenter +separate style files +users' guide +general acceptance +\endcenter +BLUe's format is stable, compatible with plain \TeX, +well-organized, and reasonably compact. +I have tried to combine the best of both worlds. +\begincenter +Stay with Knuth with respect to his unsurpassed markup, and +borrow Lamport's awareness of the necessity of a users' guide. +\endcenter +If you ponder about a manmac users' guide, it is mandatory to pay attention +to developments since.\ftn{However, I must confess that I'm not + completely up to date with \PS, Adobe's Photoshop, nor Acrobat.} +That is how BLUe's format emerged. +A tribute to manmac and some more, that is the royal road I passed by. +Reality shows that manmac.tex has been neglected by the \AllTeX{} +community. +Given the reputation of Don Knuth, and the wide-spread use of \LaTeX, +I'm realistic about the acceptance of BLUe's format.\ftn{Thinking aloud: + I would be happy if {\oldstyle50}\% of NTG's members finds something of + interest in BLUe's format, be it the system, a nice macro, or just + an eye-opener with respect to markup or computer-assisted + typesetting in general. From CyrTUG I expect that even {\oldstyle75}\% of their + members can take advantage of the system. + And what about {\oldstyle10}\% of the {\it unorganized\/} \TeX{} users, + \winksmiley?} +Nevertheless, I hope that BLUe's format will find its niche within the spectrum of +tools for computer-assisted production and consumption of information. +IMHO, with all respect, it deserves it. \winksmiley. + +In the past I used \LaTeX{} but was unhappy with +the layout, and therefore added modifications, like many of us. +The results did not satisfy me, because +I never got the feeling that I understood the coding. +Even worse, I never felt happy with the coding of \LaTeX. + +Since then, I have become more and more enthusiastic about Knuth's markup, +especially about the subtleness of plain and manmac. +Understanding his macros is a real challenge, but once mastered +you feel like in heaven. It gave me such a pleasure. +The beneficial spinoff of this thorough study was that +the knowledge gained contributed much to the compactness of +BLUe's format. + +At the Euro\TeX{} {\oldstyle94} the new, long-awaited +\LaTeX{\oldstyle2}$\epsilon$ went public. +During the conference I was asking myself over and over the same questions, +to uncover the reasons why I don't believe that the approach taken +is the right one, especially for self-publishing authors. +My septicisms come down to the following. + +\bitem \LaTeX{} is essentially quasi-static in contrast with + plain, which is frozen and hence stable. I know that dynamics is the + nature of progress, but only a small amount needs change. + The lack of the awareness to separate the quasi-static part + from the stable part, is what I don't like. +\bitem The macros are essentially one-part macros with flexibility + via optional and ordinary parameters. The mechanism of parsing + optional arguments, is a non-\TeX{} approach, at the expense of + cumbersome and monolithic coding. + Two-part macros should be at the basis, + with options via token variables. As far as my experience goes + this will yield simpler coding, with the benefits of + easier maintenance. +\bitem \LaTeX{} is verbose and far from minimal markup +\bitem \LaTeX{} is not easy to customize +\bitem \LaTeX's macros are incompatible with plain, even the use of + \cs{def} is not possible\ftn{I know of the annoyance + of silently redefined macros, but nevertheless.} +\bitem \LaTeX{} turns out to be a cuckoo's egg +\bitem \LaTeX{} tends to represent the establishment, + not what individuals really need, IMHO, with all respect. + The imposing character is believed to be beneficial for + publishers, to ascertain that authors don't use markup + different from the standard style. Much truth in there, but the + world is changing. I favour simple tools, + which I understand to a high degree, and which are cooperative. +\smallbreak +I only hope that the \LaTeX{} developers can take advantage of my views. + +^^{TUGboat styles} +\bluehead TUGboat styles + +I learned a lot from those. The functionality of the OTR has +been taken over in BLUe's format. +It is just a pity that a preprint style is lacking. +I also consider the approach of the separate streams +\TeX{} next to \LaTeX, cumbersome to maintain. +At the lower level separate collections are in use next to each other. +For example the verbatim macros for \TeX{} differ from those for \LaTeX. +A common picture environment for both streams is not there either. +Similar to the AMS formats the coding is monolithic. +It is not easy to borrow parts from it. + +\displaycenterline{Not a common \TeX{} format with a \LaTeX{} + user interface on top.} + +I have used them for quite a while, but once I looked into the code, +I decided to go over to the manmac line of thought, back to the roots, +so to say, with all respect. + +\bluehead The future + +More important, and thinking positively, is to day-dream about the future +and especially to ponder about the new media to assist information +production and consumption. + +It is a little peculiar that I sympathize so much with the new media, +the newer developments, which will make it possible for the + \displaycenterline{masses to access information easily,} +the more so because this file is much like a traditional book. +It does not combine different media like text, sound, colours or graphics +in general. Not even does it allow you to click through the file +in a hyperlink sense. I'm not ashamed of that. +There are so many problems to be solved, +before we come even close to coping better +with information, I mean taking real advantage of the information. + +The buzzword which goes along +with this is the `electronic highway,' +having rapid and cheap access to +information stored digitally. +Perhaps the words `database publishing,' and +`multi-media' appeal even more. +Whatever the value of these approaches and promises, +let us down-to-earth ponder +about electronic equivalents of the old goodies, such as +a table of contents, +an index, +and cross-references. + + +\thissubhead{\runintrue} +\bluesubhead A Table of Contents\par is getting more and more important. +When tables of contents, ToCs for short, are generated automatically, +which is nice, they can't be searched for in a script. +A surprising consequence is to store a ToC also explicitly, +and perhaps separately from the work, because +people first like to browse through a table of contents or +read.me file. +For electronic use the page numbers attached are not that important. +How to access parts is more important. Therefore the ToC should contain +hyperlinks to the real information. + +\thissubhead{\runintrue} +\bluesubhead An Index\par is also no longer tied up with one book. +Databases can be searched on keywords, or more selectively browsed via queries, +to spot what one is looking for, whatever the context. +When we have spotted what we are looking for, +another click would be all that is needed to get +into it.\ftn{Let us forget, for the moment, the reality of + the morning-after invoice.} + +\thissubhead{\runintrue} +\bluesubhead Cross-referencing\par is really outdated. +Electronically, we are not limited by the traditional sequential +order of numbered pages. Relational links are there to +bring you immediately to the material required, be it to more details or +to just the opposite, a survey, with fewer details, +or, \dots\thinspace another representation, like spoken +in a different language. + +\thissubhead{\runintrue} +\bluesubhead The bad news\par is that none of those goodies mentioned are +part of this work. Just an afterthought, some wishful thinking, +pondering about future work. + +Frank Poppe communicated that he would be happy with the \TeX book script +with hyperlinks. That he could easily click through the related material +spread over the file. Indeed that would be nice. + +\bluehead Statistics about processing PWT + +The booklet contains in the draft version of spring {\oldstyle1995}, +{\oldstyle125} odd pages and some +{\oldstyle400} index entries, +all processed in one pass. +The sorting of the index did take an hour on my Mac Classic II, +and {\oldstyle10}K words of memory. +For re-runs without page changes one can do without \cs{sortindex} +because \cs{pasteupindex} reads from index.elm. +\begincenterblock +{\oldstyle967} strings out of {\oldstyle5259} +{\oldstyle4438} string characters out of {\oldstyle31539} +{\oldstyle63053} words of memory out of {\oldstyle65536} +{\oldstyle2531} multiletter control sequences out of {\oldstyle10000} +{\oldstyle18} hyphenation exceptions out of {\oldstyle307} +{\oldstyle22}i,{ \oldstyle21}n,{\oldstyle16}p, {\oldstyle216}b,% + {\oldstyle1015}s stack positions +out of {\oldstyle200}i, {\oldstyle60}n,{\oldstyle60}p, {\oldstyle5000}b, {\oldstyle2000}s +\endcenterblock +Remark. The needed save-stack size is larger than the usual default\Dash + as of {\oldstyle1995}\Dash for a PC. +\endinput diff --git a/info/laan/pwt/pwt.cus b/info/laan/pwt/pwt.cus new file mode 100644 index 0000000000..2e713ac06e --- /dev/null +++ b/info/laan/pwt/pwt.cus @@ -0,0 +1,433 @@ +\input blue.tex \loadindexmacros \report + +\bluepictures\bluepagepic + +\bluechapter Customization + +\beginsummary +Adaptation of BLUe's format with respect to the look-and-feel +has been discussed, i.e., adapting +the page size, +the headlines and footlines, +and the various headings. +Transformation of a BLUe script into a MAPS submission +has been touched upon. +At the end a quick look has been given +into the Pandora box of processing +scripts in other languages. +\endsummary + +The first thing to do is to personalize the format. Make yourself known. +In order to do so look in the file \bluetex{} for the comment line that +starts with |%Personalization|, and adjust what follows. + +Customization comes down to adapting \TeX's and \bluetex's parameters. +The big deal of ^{customization} is to adapt BLUe's format for processing +scripts in your language. +Apart from trivia this is beyond the scope of this guide. + +\bluehead Changing the look-and-feel + +Much of the ^{look-and-feel} is determined by +the page size, +the headline and footline, +the section beginnings, +and the opening part. + + +\bluesubhead Adapting the page size + +A page is composed of the page proper block, +$\cs{pagewd}{\times}\cs{vsize}$, preceded by the headline +and followed by the footline. +^|\hsize| is the width of a column. +^|\vsize| is the length of a column with footnotes included.\ftn{The + length of the page can actually become a little shorter or longer + because of the depth of the last box.} +Customization of the page dimensions can be done by adapting +|\A4|.\ftn{Customization of the + page composition is beyond the scope of this guide + and requires knowledge of the output routine. ^|\A5|, or other sizes, + can be added.} +^|\twocol| has been included below, along with the picture ^|\bluepagepic|. +^^|\onecol| + +\blueexample Page layout, and two-column settings + +{\gutter6em +\begindemo +\def\twocol{\maxcols=2 \xcol=1 + \onecolfalse\A4 + \hyphenchar\tentt='055 + \hyphenchar\ninett='055 + \hyphenchar\eighttt='055 + \tolerance500 + \hbadness=499 + \hfuzz=5pt +} +!yields +\bluepagepic +\enddemo} +Names are inherited from \TUB's output routine. +^|\xcol| denotes the number of the actual column. +The value of the ^|\hyphenchar| +allows hyphenation for words in those fonts. +The tolerance and badnesses are set to circumvent superfluous messages, +at the expense of less optimum results.\ftn{For the pragmatic approach + of getting rid of overfull boxes, I'm much indepted to Phil Taylor.} + +^|\hoffset| and ^|\voffset|, the offsets +of the left upper corner of the page to the boundary of the paper, +are both {\oldstyle1}\thinspace cm less than plain's +default of {\oldstyle1}\thinspace in. + +^|\A4| reads as follows. +\beginverbatim +\def\A#1{\csname A#1\endcsname} +\ea\def\A4{\ifonecol\hsize16cm\pagewd\hsize + \else\hsize9cm\intercolwd.5cm + \pagewd\hsize\advance\pagewd\hsize\advance\pagewd\intercolwd + \fi\colwd\hsize \vsize25cm} +!endverbatim + +\thissubhead{\runintrue} +\bluesubhead The header and footer\par are generated from the + token variables \cs{headline}, and \cs{footline}. + Default they read as follows. + +\blueexample Default headline and footline code + +\begincenterverbatim +\headline={\hbox to\pagewd{\it\the\issue\hfill\the\title}} +% +\footline={\hbox to\pagewd{\fiverm\rlap{Draft \today}\hfill + \dash\the\pagenumber\dash\hfill\llap{\copyright cgl}}} +!endcenterverbatim +An extra dimension ^|\pagewd| is needed +in order to have a quantity independent of the number of columns. +\exercise What are the ^|\headline| and ^|\footline| for \cs{report}? +\answer The regular headlines and footlines are as above with a few + elements altered. + However, there is a complication in the sense that + the headline is suppressed for the first page + of the chapter. This is handled in \cs{postchapterhead}. + Consult the formatbase, especially the report format. + +\exercise How can we use the \cs{headline} for transparencies? +\answer Similar to the running head of a book the headline\Dash well, the header + part\Dash can be put in a headline with contextual information + dynamically coupled. See the formatbase, especially the transparencies + format. + +\exercise In a book the footline contains usually the page number away from + the back, that is, right on right-hand pages and left on left-hand + pages. How can we achieve this? +\answer Provide +\beginverbatim +\footline{\hbox to\pagewd{\ifodd\pageno\null\hfill\fi\number\pageno\hfil}} +!endverbatim + + +\bluesubhead Title part + +The markup of the beginning\Dash title part\Dash +and the markup of the end\Dash closing part\Dash +of a regular BLUe script are implemented as follows. + +\blueexample Beginscript and endscript code + +^^|\beginscript| %^^|\endscript| +^^|\beginkeywords|%^^|\endkeywords| +^^|\beginabstract|%^^|\endabstract| +^^|\begincontents|%^^|\endcontents| +\thisverbatim{\catcode`\!=12 \catcode`\*=0 } +\beginverbatim +\def\beginscript{\lastscript\the\everyscript\begingroup + \the\thisscript + \hrule\kern2ex\noindent + {\titlefont\the\title}\if!\the\subtitle!\else + {\subtitlefont\the\subtitle}\fi + \medskip\the\author + \medskip\pasteupkeywords + \medskip\pasteupabstract + \medbreak\pasteupcontents\smallbreak} + +\def\endscript{\makesignature\xcol=\maxcols \vfil\eject\endgroup + \tracingstats1\stop\thisscript{}} +%with at the lower level +\def\beginkeywords{\setbox\keywordsbox\vbox\bgroup\subhead{\sevenbf + \the\keywordsname: }\small} +\def\endkeywords{\egroup} + +\def\beginabstract{\setbox\abstractbox\vbox\bgroup\centerline{\sevenbf + \the\abstractname}\beginquote\small} +\def\endabstract{\endquote\egroup} + +\def\begincontents{\setbox\contentsbox\vbox\bgroup\small\noindent + \the\contentsname\par\obeylines} +\def\endcontents{\egroup} + +\def\pasteupkeywords{\box\keywordsbox} +\def\pasteupabstract{\box\abstractbox} +\def\pasteupcontents{\unvbox\contentsbox} +*endverbatim + +Customization can be done by changing the above. +I have omitted the macros, which allow the use |\<tag>{...}|, +the short variant. +Whatever your change of |\begin<tag>| or |\end<tag>|, +the short variant |\<tag>{...}| remains invariant, that is, +complies automatically with your change.\ftn{Consult the paper + `Paradigms: Two-part macros' for the explanation.} +\exercise How can we suppress the author information at + the end of the document? +\answer Let \cs{makesignature} equal to \cs{relax}. + +%end answer +\exercise Enumerate the token variables which + contain language-dependent names. +\answer The token variables |\<tag>name|: + \cs{abstractname}, + \cs{keywordsname}, + \cs{contentsname}. + +%end answer +\exercise How can we obtain ^{Roman\ numerals} as page numbers? ^^|\folio| +\answer The control sequence to obtain Roman numerals is \cs{romannumeral}. + In plain \TeX{} Roman numerals are obtained automatically for + page numbers when \cs{folio} is used instead of \cs{pageno} provided + the number is negative. + From \TB{} 252, 362 the following. +\thisverbatim{\unmc} +\beginverbatim +\def\folio{\ifnum\pageno<0 \romannumeral-\pageno + \else\number\pageno \fi} +!endverbatim +See also page 40 and 41 of \TB, especially when uppercase +roman numerals are needed. +In \bluetex{} I introduced the token variable |\pagenumber{\folio}|. + +%end answer +\exercise How can we suppress the headline on the first page? +\answer This is a very common \TeX ing paradigm. The idea is + to redefine the responsible control sequence in such a way that + on first invocation the only action is to define itself by the + regular replacement text. For example in the report format, + in order to suppress the headline on the first page of each chapter, + I defined \cs{headline} in \cs{postchapter} as follows. +\beginverbatim +\postchapterhead={\vskip3pc\headno=0 \exno=0 \exano=0 + \headline={\global\headline={\hbox to\pagewd + {\sevenrm\the\chaptername\hfill\it\the\title}}}} +!endverbatim + +%end answer +\exercise How come that more than one script can be formatted + despite \cs{stop} in \cs{endscript}? +\answer The explanation is in the definition of \cs{notlastscript} + and \cs{lastscript}, which read as follows. +\beginverbatim +\def\notlastscript{\let\stop\relax} +\def\lastscript{\let\stop\end} +!endverbatim + +%end answer +For parameters which govern special constructs, such as +the shape of paragraphs, items, tables, or \dots\thinspace, +see the chapters on the issue. + +\bluesubhead Section beginnings + +^|\head| can be customized by adaptation of the parameters +^|\prehead| and ^|\posthead|, to position the head within context. +^|\ignorewhitespace| does what its name suggests.\ftn{It + gobbles white space after \cs{beginhead} up to the head title.} +The font used is parameterized in ^|\headfont|. + +\blueexample Head code + +\begincenterverbatim +\prehead{\vskip0pt plus5ex\penalty-250\vskip0pt plus1ex + \bigskip\noindent} +\posthead{\medskip\nobreak\noindent\ignorewhitespace} +\def\beginhead{\the\prehead\bgroup\headfont} +\def\endhead{\egroup\the\posthead} +!endcenterverbatim +\cs{subhead} and \cs{subsubhead} are constructed similarly. + +\exercise How can we ^{center\ heading}s? +\answer It looks like to extend \cs{prehead} and \cs{posthead}, + something like +\beginverbatim +\prehead\ea{\the\prehead\centerline\bgroup} +\posthead\ea{\ea\egroup\theposthead} +!endverbatim +However, this does not work\Dash explain why the head flushes right\Dash +because we can't use \cs{bgroup} and \cs{egroup} to enclose an argument. +A solution is to append \cs{hfil} to \cs{prehead} as follows. +\beginverbatim +\prehead\ea{\the\prehead\hfil} +!endverbatim + +%end answer + +\bluesubhead Raster layout and \TeX + +As Nico Temme communicated to me publishers require sometimes +fixed white space between headings and the surrounding text. +How to achieve this? +Naively this looks simple, just provide \cs{prehead} and \cs{posthead} +with the fixed skips. +The problem is, however, that \TeX{} likes some freeway +to shrink or stretch a little. + +\bluehead BLUe script into MAPS submission + +^^{BLUe\ script\ into\ MAPS} +In principle this is not too laborious, because only a handful of +outer-level control sequences need adaptation.\ftn{In general + transformation is very complex and confusing, + for example if we also consider automatic generation of an index. + It is next to impossible to do this automatically. + When submissions to (various) journals are + in sight, keep the markup as simple as possible. + And why not stick to simplicity as a rule?} + +MAPS.sty is \LaTeX{} biased. +To give you an impression of the amount of work +a template for a MAPS submission and a transformation table is +given below.\ftn{I don't use + times fonts, + don't use Babel (no dutch.sty, nor english.sty), + no fancyheadings are involved, + don't need + Mittelbach's multicolumn, nor Sch\"opf's verbatim facilities, + and the like. + Until today MAPS has used \LaTeX{\oldstyle2}.{\oldstyle09}. + Minimal markup tags have been neglected.} +Because BLUe's format is a personalized format you have to add +|\author{...}| and the like. + +Globals deserve special attention, because they might +interfere with other submissions. +%The MAPS style is not of an active type, and %in the sense of an active +%therefore retrograde adaptations are needed. %document. (cgl) + +The title block is filled in or simply reused +from the template. No problem at all. +A table of contents can be moved to the back part. + +I fell back upon +\LaTeX's bibliography handling.\ftn{Nowadays, I tend to omit the + references in a MAPS submission, and refer to my database + lit.dat.} +My use of so-called `run-in' heads requires special attention.\ftn{The + (sub)subhead title is part of the first sentence of the section.} +Important is that \bluetex's verbatim suite, tables and pictures +can be reused as such, similar to plain's math constructs. +For other things like my way of citation\Dash |<author>|, |<year>|\Dash +no adaptation is needed. + + +\blueexample BLUe script into MAPS submission + +\begindemo +%Template for MAPS submissions +\documentstyle[twocolumn]{maps} +\begin{document} +\title{...} +\subtitle{...} +\author{...} +\date{} +\maketitle + +\begin{abstract}...\end{abstract} +\begin{keywords}...\end{keywords} +%Contents table +%Copy proper +\head{...}%et cetera +%back matter, LaTeX's +\begin{thebibliography}{abcde} +... +\end{thebibliography} +\end{document} +!yields +\small\def\rowstblst{} +\def\x{\lower1ex\null} +\vruled\fll\def\colsep{$\longrightarrow$} +\def\btablecaption{} \def\footer{} +\def\header{BLUe script\cs MAPS.sty script} +\beginbtable +$\vcenter{\hbox{\tstrut|\begin|} + \hbox{|\end|\x}}$\ abstract + \cs$\vcenter{\hbox{|\begin{abstract}|\tstrut} + \hbox{|\end{abstract}|\x}}$\rs +$\vcenter{\hbox{|\begin|\tstrut} + \hbox{|\end|\x}}$\ keywords + \cs$\vcenter{\hbox{|\begin{keywords}|\tstrut} + \hbox{|\end{keywords}|\x}}$\rs +|\beginscript| \cs|\begin{bijlage}| \rs +|\head| \cs|\let\head\section|\rs +$\vcenter{\hbox{|\bitem|} + \hbox{\raise2ex\null\lower1ex\null\dots} + \hbox{|\bitem|\x} + \hbox{|\smallbreak|}}$ + \cs$\vcenter{\hbox{|\begin{itemize}|\tstrut} + \hbox{|\item...|\strut} + \hbox{|\item...|\strut} + \hbox{|\end{itemize}|\x}}$\rs +$\vcenter{\hbox{\tstrut|\begin|} + \hbox{|\end|\x}}$\ quote + \cs$\vcenter{\hbox{|\begin{quote}|\tstrut} + \hbox{|\end{quote}|\x}}$\rs +|\ftn| \cs|\footnote|\rs +$\vcenter{\hbox{|\begin|\tstrut} + \hbox{|<escape char>end|\x}}$\ verbatim + \cs$\vcenter{\hbox{|\begin{verbatim}|\tstrut} + \hbox{|\end{verbatim}|\x}}$\rs +|\endscript| \cs$\vcenter{\hbox{\tstrut + |\end{bijlage}|} + \hbox{|\end{document}|\x}}$ +\endbtable +\enddemo +^^{BLUeto you-name-it} +In general the mapping of a BLUe script into a you-name-it script +is near to impossible to automate completely, because of the +incompatibilities. +As far as I know\ftn{As of {\oldstyle1995}} +BLUe's format is the only formatting \TeX-like system +which has embraced the database idea at large, +has provided macros for `Turtle graphics.' and which +can produce indexes on the fly. + +However, when BLUe's format will be adopted by publishers +the conversion problem is no longer there, because the publisher +might issue the default as a ^{preprint format}, +with result that authors and publishers use the same markup tags, +while the formatted result is in agreement with the context, because +the publisher can best customize the various replacement texts +to their wishes. +As usual a hard \TeX nical problem can be +solved more elegantly non-\TeX nically. + +\bluehead Other languages + +The Pandora box of customization is to tailor BLUe's format +towards processing scripts in your language. +Knuth adapted \TeX{} in {\oldstyle1989}, +and provided \cs{language} to handle hyphenation per language, +and smarter ligatures, if I'm not mistaken. +The trivia for adaptation are changing the names +for document parts, like `Abstract, Keywords,' and similar things. +In BLUe's format the latter are parameterized in token variables. + +More complicated is creating an index on-the-fly in your language via +BLUe's format.\ftn{For the time being this is open. + The language-dependent ordering of letters has been parameterized + in an ordering table though.} + +An interesting application of formatting simultaneously two (or more) +languages is: two-column, with each column devoted to a language. +That is beyond the scope of this guide. +\endinput + diff --git a/info/laan/pwt/pwt.fmt b/info/laan/pwt/pwt.fmt new file mode 100644 index 0000000000..df373a78e7 --- /dev/null +++ b/info/laan/pwt/pwt.fmt @@ -0,0 +1,1467 @@ +\input blue \loadindexmacros \report \hfuzz=15pt +%\telephone{{\oldstyle31\thinspace{\rm(}0{\rm)}% +% 594\thinspace62\thinspace1525}} + +\bluechapter Formats + +\beginsummary +Next to the regular format BLUe's format contains the +report and transparencies formats. +The letter and concert format from the \TeX book have been +reviewed and the goodies in there have been borrowed. +The letter format makes use of the address.dat database. +Treated are among other things +how to use the formats, +how to proof separate chapters of a report, +how to create and update a set of transparencies, +how to format letters, make address labels, and +how to extend the databases by a format, tool, or address of your own. +A table of main tags and a list of the Frequently Used Tags, +for the letter, report and transparencies format, have been included. +\endsummary + +Before delving into the details of the database approach, +I'm happy to let you know that you can do without it, can fall +back on the traditonal method of file inclusion, if for some reason +or other you don't feel comfortable with databases. +For example, if you like to make use of the transparencies macros from +BLUe's format, copy the relevant part from fmt.dat into, +say, trspar.tex. Then proceed as usual, for example as follows. +\begincenterverbatim +\input blue.tex +\input trspar.tex +<restofbluescript> +!endcenterverbatim +On the other hand those who like the database approach can peruse +`BLUe's Format databases.' + +^^{database,\ fmt.dat} +\bluehead Use of formats from fmt.dat database + +To use a format just start a script with\ftn{Inclusion of files etc. + is handled behind the scenes. Default the format is suited for an article.} +\displaycenterline{|\input blue.tex \<formatname>|} +The markup tags are upwards compatible, i.e., +the tags from the regular \bluetex{} are still there, +but extended with extra tags. +The coding of the tags from the default format +have been adapted to the look-and-feel of |\<formatname>|, +the design if I may say so. + +\bluesubhead Adding a format + +To ^{add\ a\ format} to the BLUe's format system the following has to be done. +\bitem separate the storage-allocating + control sequences from the format, + i.e., treat \cs{newtoks} and the like separately +\bitem add the allocation control sequences to \bluetex +\bitem add the format with an `opening' and `closing' to fmt.dat +\bitem add a load macro to \bluetex. +\smallbreak +In actual fact this comes down to the following. Add to fmt.dat +\begincenterverbatim +\tool\<yourformat>fmt%Opening +<themacros> +\endinput %Closing +!endcenterverbatim +and include in the kernel \bluetex{} the load macro and the storage allocations +^^{entry\ for\ fmt.dat} +\thisverbatim{\catcode`\|=12 + \catcode`\!=12 + \catcode`\~=0 + } +\begincenterverbatim +%load macro +\def\<yourformat>{\let\<yourformat>fmt=x +\loadformat +\let\<yourformat>fmt=\undefined +} +%storage allocations +\new<type>\<name> +%<type> is one of box count dimen fam insert language skip +% muskip read toks write +%et cetera +~endcenterverbatim +Note the difference between |\<yourformat>| and |\<yourformat>fmt|. +Take care that |\<yourformat>fmt| remains undefined afterwards. +Now and then I safeguarded formats from double loading. + +There are a few restrictions on the macros, as a consequence +of the skipping mechanism used, via \TeX's argument processing. +\bitem no outer defs, i.e., \cs{newtoks} and the like should + be declared in regular \bluetex +\bitem no \cs{par}, use \cs{endgraf}, or |\csname par\endcsname| +\bitem no blank lines, insert \% +\smallbreak +Remarks. +The restriction with respect to your outer defs can be circumvented by +\bitem define all macros non-outer, or +\bitem use |\csname newtoks\endcsname\<tag>|, and the like, or +\bitem extend \cs{unouterdefs} by your outer defs, i.e., + include \cs{newtoks} and similars. When these are + part of the format or tool, multiple use + reallocates memory, and because \TeX{} + lacks a garbage collector this will cost extra + memory locations. +\smallbreak + +\bluesubsubhead Check for data integrity + +After a format has been added one can check whether the file can be scanned by +\TeX{} via making a table of contents as follows. +\begincenterverbatim +\input blue.tex +\contentstoolsorfmt{fmt} +\bye +!endcenterverbatim +This script produces no pages of output (that is OK). +The file contentsfmt will be created though. + +\bluesubsubhead Verbatim listing of a format + +This problem is induced by my multi-file approach. Of course +one can extract the format by an editor et cetera as alternative. + +\blueexample Verbatim listing of letter format + +\begincenterverbatim +\input blue.tex \let\letterfmt=x +\long\def\tool#1{\ifx#1\undefined\bgroup\unouterdefs\ea\gobbletool + \else\ea\toolverbatim\fi} +%\def\toolverbatim{\thisverbatim{\baselineskip12pt plus2pt minus1pt +% \lineskip1pt plus1pt minus1pt}\beginverbatim} +\def\cgl{\endverbatim\endinput} +\input fmt.dat \bye +!endcenterverbatim + +\bluesubsubhead Conventions for entries fmt.dat + +come down to +\bitem update the contents at the beginning of the file fmt.dat +\bitem supply |\message{ ---<...> format, <date>, <owner>--- }| in the beginning +\bitem take care of visual layout for print out +\bitem provide additional comments which contain markup for line numbering +\bitem add history of changes +\bitem add a table of contents with line numbers. +\smallbreak +The layout is aimed at printing in two columns and starts in a new column. +The selective line numbering is controlled by the following control sequences +\item{}\cs{numvrb}, to start line numbering +\item{}\cs{vrblin} = |<number>|, to adjust line counter, and +\item{}\cs{nonum} to switch off line numbering. +\smallbreak +Do remember that the escape char is the semi-colon. + +\blueexample Template for an entry in fmt.dat + +\begincenterverbatim +%end%%%%%<lastlinepreviousformat>%;newcol +% +% +%begin%%%%%%%%%%%%%%%%%%%%%<....>%;numvrb +\tool\<...>fmt +\message{ ---<...> format, <date>, + <owner>--- } +%<authorinformation> +%<theformatproper> +\endinput %;nonum +%Contents +%<item>...................<pagenumber(s)> +%etc +%History of changes +%<date> <change> +%etc +%end%%%%%%%%%%%%%%%%%%%%%%%<....>%!!cgl;newcol +!endcenterverbatim + +\bluehead Concert format + +Please open \TB{} on page {\oldstyle411}. What about this concert announcement? +I never received such a leaflet when attending a concert. ^^{format,\ concert} +The ones I got are prettier, so there is no use in copying this template.\ftn{I + have included the macros in the format \cs{concert} nevertheless, + for your convenience.} +This is more or less in agreement with what +Knuth states +\beginquote\noindent +\llap`Notice that the \cs{composition} and \cs{movements} and \cs{soloists} + macros do not include any special provision for vertical spacing; the + user is supposed to insert \cs{smallskip}, \cs{medskip}, and + \cs{bigskip} as desired. This was done deliberately, because different + concert programs seem to demand different spacing; no automatic scheme + actually works very well in practice, since musical literature is + so varied.' +\endquote +What can we learn from the format, especially the macros? +Usually a lot. Here we go. +\bitem The simple ^{size-switching macros} are nice, intelligible, + and compact, because we don't deal with math in this context. + The tags are just \cs{smalltype}, \cs{medtype}, and \cs{bigtype}. + A pedagogical stepping stone for size-switching macros in general. +\bitem The ^|\tsaologo| is nice too. I have used it for + delineating parts in `Math into BLUes.' My variant is the macro + ^|\partlogo| with the text as argument. The latter is part of \bluetex. +\bitem The ^|\soloists| macro deserves more general use. It shows + how to use \cs{halign} to {\sl center a block of text}. Moreover, it + can be recast into a two-part macro. + Note that \cs{centerline} has been used, but + the \cs{vbox} could have been replaced by math display markup with + the automatic insertion of \cs{displayskip} before and aft. + And why not get rid of the \cs{cr}? Natural input? + A matter of taste? I agree partly. The advantage + is the extra option possibility after the opening keyword. In this + case we can parameterize over the font to be used. +\smallbreak + +\bluesubhead Centering a block + +The coding of \cs{soloists} can be combined with the coding of +\cs{begindisplay}, \TB{} {\oldstyle421}, to yield a two-part macro for centering a block, +with the flexibility to specify the font after \cs{begincenterblock}. +Moreover, I incorporated the natural markup idea. No \cs{cr} has to be +supplied by the user, \TeX{} will insert those. +The macro is part of \bluetex. ^^|\begincenterblock|%^^|\endcenterblock| +\begincenterverbatim +\def\begincenterblock{\bgroup + \let\par\cr\obeylines\startcenterblock} +{\obeylines\gdef\startcenterblock#1 + {$$#1\vbox\bgroup\halign\bgroup&##\hfil\cr}} +\def\endcenterblock{\egroup\egroup$$\egroup} +!endcenterverbatim + +\blueexample The soloists macro; block centering + +\begindemo +\begincenterblock\bf +Ben Lee User, horn +Peter Schickele, hardart +\endcenterblock +!yields +\begincenterblock\bf +Ben Lee User, horn +Peter Schickele, hardart +\endcenterblock +\enddemo +Remark. The disadvantage of this macro is that no + page break will occur within the vbox. +% As usual there are advantages and disadvantages. + +\bluehead Letter format + +Please open \TB{} on page {\oldstyle403}, and you will see a marvel of natural markup. +Only {\oldstyle5} tags are needed to mark up a letter. +^^{format,\ letter} +\begincenterverbatim +\letterhead \address \body \closing \endletter +!endcenterverbatim +If this is such a great approach, +how come that it has not been taken over? +IMHO, with all respect, it was too difficult to customize. +At the time \TeX ies were busy porting the system to the various +platforms. +Moreover, nowadays I would like to +\bitem store addressees in a database, and use them from there +^^{database,\ address.dat} +\bitem have a simpler letterhead +\bitem let ^|\headline| take care of the headers +\bitem use fewer fonts, prevent suffering from fontitus +\bitem use the known sender\Dash remember BLUe's format is yours, + it knows about your context +\bitem use window envelopes +\bitem introduce token variables for ^|\subject|, ^|\yourreference|, + and ^|\ourreference| +\bitem make positioning of the address flexible in such a way + that it can move to adjust to your window envelope +\bitem adapt \cs{makelabel}\ftn{I named it \cs{makelabels}.} + to work independenly with the address.dat database + (Handy for address labels for carbon copies among other things) +\bitem substitute \cs{beginscript} for \cs{beginletter} and ditto for the + \cs{endscript}.\ftn{Well, \dots\thinspace I allowed \cs{beginletter} + as alias, ditto for \cs{endletter}.} +^^|\makelabels|\smallbreak +Because of the above, it is of no use to +include the letter format literally from \TB. +Furthermore, I simplified the approach a little, \smiley, to facilitate +customization. +The variant has been incorporated as \cs{letter} format in the fmt.dat +database. + +Note. The \cs{footline} on the first page is free to contain business +information like giro, Chamber of Commerce number and the like. +BLUe's format contains a toks variable \cs{businessaccount} for that +purpose. See NTG's letter format. + +\bluesubhead Use of the letter format + +In order to use this format the user has to customize his letter +format and make sure address.dat is available.\ftn{Well, + the latter can be circumvented + if \cs{loadreference} is replaced by a def with + the name of the addressee, followed by + the affiliation of which each line is preceded by |\\|, + as replacement text.} +^^{script,\ letter} +\begincenterverbatim +\input blue.tex \letter %Knows about logo, sender +\subject{...} +\yourreference{...} \ourreference{...}%just numbers +\addresses{\<name>} %load list of address{es} +\addressee{\<name>} +\beginscript +\dear +.... +\sincerely %knows about you +\cc ... %Optional set cc. .... +\ps ... %Optional set P.S. .... +\appendix{<appendixtitle>} +<appendixmaterial> +\endscript +!endcenterverbatim +The \cs{appendix} control sequence takes one argument. +It starts a new page but continues numbering. +%The material will be set after an \cs{item}. + +If the letter proper is stored in letter.tex, then the use looks even simpler. +\begincenterverbatim +\input blue.tex \letter %Knows about logo, sender +\subject{...} +\yourreference{...} \ourreference{...}%just numbers +\letterto{\<name>...} +!endcenterverbatim + +\blueexample A letter script; a letter to Don Knuth + +\beginverbatim +\input blue.tex \letter %Preliminary initializations +\subject{\TeX{} for BLU} +\ourreference{22 1 95} +\yourreference{\TB} +\addresses{\knuthde} +\addressee{\knuthde} %Initializes \addresseename \affiliationbox + %\thisscript{\notlastscript} +\beginscript %\beginletter is an alias +\dear +First of all I'm much obliged to your works especially \TB. +As you know roughly 10k organized users profit from your system +in getting their work out. It is estimated that the number of +{\sl unorganized\/} users is a tenfold. +I like your Ben Lee User character very much, +and hope he will benefit from my work towards understanding +and using \TeX{} with confidence. +\bigskip +What puzzles me is that manmac has been neglected so much. +Is it because a user's guide was lacking? +Was \TeX{} too far ahead of its time? +Too unusual? +\bigskip +I'm also puzzled about the neglectance of the letter format. +Was it too difficult for \TeX ies to customize at the time? +I mean, it is confusing to mix the line mode and the par mode. +As you can see from the \cs{letter} format I included, as part of +BLUe's format, I refrained from those and concentrated on +customization. +I also made use of a database of addresses, but that is +a minor \TeX nical point, because the markup abstracts from +that detail as it should. Just |\adressee\<name>|. +\bigskip +Whatever the reasons, I hope that my work will ease the use of manmac, +or even better BLUe's format. +The latter has manmac assimilated, and taken notice of +experience gained since the release of manmac. +\bigskip +After this work on using \TeX{} I intend to write +another booklet on \TeX{} macro writing, to emphasize two-part macros, +because two-part macros are in the dark in the \TeX book. +They are lacking in the chapter on macro writing\Dash except for \cs{beginbold} + and \cs{endbold}\Dash but have been used in manmac, and +therefore are dealt with in Appendix~E. +IHMO, with all respect, they deserve more attention. +By that time, I hope to be familiar with `\TeX{} The Program' too. +\bigskip +In near future I'll direct myself to \MF, well META{\smc post}, +and pay attention to {\oldstyle2}.{\oldstyle5}-D applications. +I have in mind to emulate the works of Naum Gabo, a sculptor, +whose objects I like very much. The exciting thing in there is +that I can emulate the work in {\oldstyle2}.{\oldstyle5}-D +with only {\oldstyle1}-D information. +The latter is quite obvious because he used regular surfaces. +However, it is apparently me who arrived at the crossroads. +\bigskip +I would appreciate it very much if you would let me know +that you have received this work, and of course, +I welcome suggestions. +\sincerely +\ps When I entered `Het Nederlands Rekenmachine Genootschap,' + in {\oldstyle1967}, the first volume of the Art of Computer + Programming was given to me, because of my lucky membership + number, {\oldstyle1024}. + I really could not foresee at the time that my interest in your work + would take this turn +\cc NTG +\endscript +!endverbatim +\storedpageno\count0 +\storedheadline\headline +\storedfootline\footline +\newpage +{\letter +%Preliminary initializations +\subject{\TeX{} for BLU} +\ourreference{22 1 95} +\yourreference{\TB} +\addresses{\knuthde} +\addressee{\knuthde} %Initializes \addresseename \affiliationbox + \thisscript{\notlastscript} +\beginscript +\dear +First of all I'm much obliged to your works especially \TB. +As you know roughly 10k organized users profit from your system +in getting their work out. It is estimated that the number of +{\sl unorganized\/} users is a tenfold. +I like your Ben Lee User character very much, +and hope he will benefit from my work towards understanding +and using \TeX{} with confidence. +\bigskip +What puzzles me is that manmac has been neglected so much. +Is it because a user's guide was lacking? +Was \TeX{} too far ahead of its time? +Too unusual? +\bigskip +I'm also puzzled about the neglectance of the letter format. +Was it too difficult for \TeX ies to customize at the time? +I mean, it is confusing to mix the line mode and the par mode. +As you can see from the \cs{letter} format I included, as part of +BLUe's format, I refrained from those and concentrated on +customization. +I also made use of a database of addresses, but that is +a minor \TeX nical point, because the markup abstracts from +that detail as it should. Just |\adressee\<name>|. +\bigskip +Whatever the reasons, I hope that my work will ease the use of manmac, +or even better BLUe's format. +The latter has manmac assimilated, and taken notice of +experience gained since the release of manmac. +\bigbreak +After this work on using \TeX{} I intend to write +another booklet on \TeX{} macro writing, to emphasize two-part macros, +because two-part macros are in the dark in the \TeX book. +They are lacking in the chapter on macro writing\Dash except for \cs{beginbold} +and \cs{endbold}\Dash but have been used in manmac, +and therefore are dealt with in Appendix~E. +IHMO, with all respect, they deserve more attention. +By that time, I hope to be familiar with `\TeX{} The Program' too. +\bigskip +In near future I'll direct myself to \MF, well META{\smc post}, +and pay attention to {\oldstyle2}.{\oldstyle5}-D applications. +I have in mind to emulate the works of Naum Gabo, a sculptor, +whose objects I like very much. The exciting thing in there is +that I can emulate the work in {\oldstyle2}.{\oldstyle5}-D +with only {\oldstyle1}-D information. +The latter is quite obvious because he used regular surfaces. +However, it is apparently me who arrived at the crossroads. +\bigskip +I would appreciate it very much if you would let me know +that you have received this work, and of course, +I welcome suggestions. +\sincerely +\ps When I entered `Het Nederlands Rekenmachine Genootschap,' + in {\oldstyle1967}, the first volume of the Art of Computer + Programming was given to me, because of my lucky membership + number, {\oldstyle1024}. + I really could not foresee at the time that my interest in your work + would take this turn +\cc NTG +\endscript +\newpage} +%Restore previous values +\count0\storedpageno\advance\count0by3 +\headline\storedheadline +\footline\storedfootline +\onecol%Restore \vsize + +\bluesubsubhead Syntax entries address database + +The address.dat database contains addresses sorted on name. +Each entry obeys the syntax, as shown by the following example. +^^{entry\ for\ address.dat} +\begincenterverbatim +\lst\<name>{<salutationname> + %Each line preceded by \\ + \\<fullname> + \\<affiliation> + \email{...}%optional + \phone{...}%Optional +} +!endcenterverbatim + +\blueexample Entry address.dat database + +\begincenterverbatim +\lst\ntg{NTG +\\Nederlandstalige \TeX{} + Gebruikersgroep +\\Postbus 394 +\\1740 AJ Schagen +\\The Netherlands +\email{ntg@nic.surfnet.nl} +\registeredbluetrue +} +!endcenterverbatim + +To ^{add\ an\ address} just adhere to the syntax, and include +the new address in address.dat, in the right order. +Note that it is also possible to introduce fields, which can be used in a query and +otherwise don't hinder, like \cs{registeredbluetrue}. ^^{field of database} + +\bluesubsubhead Check for data integrity + +After an address has been added one can check +whether the file can be scanned by +\TeX{} via making a table of contents as follows. +\begincenterverbatim +\input blue.tex +\contentsdatabase{address} +\bye +!endcenterverbatim +This script produces no pages of output (that is OK). +The file contentsaddress will be created though. +If you have a file with addresses of your own, say abc.dat, provide also +\cs{newwrite} \cs{tocabc}. + +\bluesubsubhead Multiple letters + +Erik Frambach asked me how to format ^{multiple letters}, with each letter +personalized by incorporating the address. +If we are talking of a few letters there is no problem at all. +Store the letter in a file and repeat the formatting for each letter. + +Let us assume that we wish to address a list of addressees, and that these +addressees are already in our database address.dat. + +The approach to solve this is to go through the list of adressees, via +FIFO, and `process' each with the letter. ^^{fifo} +\begincenterverbatim +\input blue.tex \letter +\subject{\TeX{} for BLU} +\yourreference{\TB} +\ourreference{1$\,$2$\,$95} +\letterto{\knuthde\ntg} +\bye +!endcenterverbatim +This scheme also works for one letter. +Note that after Dear the salutation name is used, +which gives a personal flavour. + +\bluesubsubhead And what about a letter to the complete address database? + +Logically, this is simple. Make a list of all the names of +the database elements and supply this list to ^|\letterto|. +We can let \TeX{} do all the work, by using ^|\lettertoall| +as follows. +\begincenterverbatim +\input blue.tex \letter +\subject{\TeX{} for BLU} +\yourreference{\TB} +\ourreference{1 2 95} +\lettertoall +\bye +!endcenterverbatim +An interesting application is that for example NTG can send a\Dash more or less +personalized\Dash letter to all its members. + +\bluesubsubhead Address labels + +Especially for the case of carbon copies separate address labels are wanted. +For that purpose I modified Knuth's \cs{makelabel} into +^|\makelabels|. ^^|\makealllabels| +\begincenterverbatim +\input blue.tex \letter +\makelabels{\knuthde\ntg} +%and all address labels +%can be obtained via +\makealllabels +\bye +!endcenterverbatim +If you prefer smaller address labels provide \cs{twocol}. + +\bluesubsubhead Searching the address.dat database by pattern + +^^{search\ of\ database} +BLUe's format provides a \cs{search} macro with +a search pattern as argument. +The purpose is to search the database file provided in +the toks variable \cs{searchfile}, +for this search pattern. +The result of the search is a list of names, of which +the replacement text contains the search pattern. +This list of names is delivered in the toks var \cs{namelist}, +and for the time being they are also written to the log file. + +\blueexample Search for addresses from RUSSIA in the database address.dat + +In order to justify my use of the word +database in relation to \TeX, I provided the search macro +to browse the databases lit.dat and address.dat. +Below the input and result have been given of the search of address.dat +for the pattern RUSSIA. The result is contained in the toks variable +\cs{namelst}. The names are also written to the log file +to give you a check for whether the right names have been selected. + +\begindemo +\input blue.tex +\searchfile{address} +\search{RUSSIA} +\bye +!yields +\cs{lst}\cs{gorbunovai} +\cs{lst}\cs{grinevaoa} +\cs{lst}\cs{makhovayai} +\enddemo + +This is handy for making address labels grouped per country. +\begincenterverbatim +\input blue.tex \letter +\search{RUSSIA} +\makesearchlabels +\bye +!endcenterverbatim +^^|\makesearchlabels| +^^|\makesearchletters| +\exercise Do you see the extension for sending letters to all those people? +\answer BLUe's format system contains the command \cs{makesearchletters}, similar + to \cs{makesearchlabels}. + +Remarks. A search pattern should not contain a period. + The search is case sensitive. + +\bluesubsubhead Sorting the address.dat database + +^^{sorting\ of\ database} +With databases a convenient aspect while reporting is the possibility of sorting +the database on secondary keys. Below I have included by example how this +can be achieved.\ftn{In `Sorting in BLUe' + I have shown how address labels can be sorted all within \TeX. + At that time I had not yet incorporated the database idea within \TeX.} + +The idea is that the `list' of names of the database entries are +sorted according to the criterion. +Because blue.tex's sorting macros sort an array, +the list is stored in an array. + +The major steps for typesetting the membership database sorted on +(membership) number, are that the {\em names\/} of the database entries are +\bitem stored in the array |\1, \2, ... , \<n>| +\bitem redefined with the value of \cs{no} as replacement text +\bitem sorted +\bitem redefined with the database entry as replacement text, and +\bitem typeset. +\smallbreak + +\blueexample Sorting address.dat on number + +The sorting of address.dat on (membership) number can be achieved with blue.tex as follows. +\beginverbatim +\loadindexmacros %Contains sorting macros +\def\lst#1#2{%Function: \def\<k>{#1} \def#1{<number>}, with + % \no{<number>} last item in each database entry + \advance\k1 \ea\def\csname\the\k\endcsname{#1}% + \ea\def\ea#1\gobbletono#2} +\def\gobbletono#1\no{} +\k0 +\input toy.dat %The test database +\n\k %number of items +No unsorted: \1, \2, \3, \4, \5, \6. %A snapshot + +\let\cmp\cmpn\sort +Sorted on no value: \1, \2, \3, \4, \5, \6. + +\def\lst#1#2{\def#1{#2}}%Redefine names by their database entry +\input toy.dat +Database entries sorted on no value: +%For typesetting we need +\let\\\par \def\no{\\Number=} \def\phone{\\Phone: } \def\email{\\Email: } +%Typeset entries with increasing membership number +\smallskip\1\smallskip\2\smallskip\3\smallskip\4\smallskip\5\smallskip\6. +\bye +!endverbatim +Each entry of the database is a triple \cs{lst}, |\<name>|, and a group, +with the group structured as shown in the syntax of an entry of the +(toy) membership database given below. +\beginverbatim +\lst\<name>{<forename> +\\<full name> +\\<address> +\email{<address>} +\phone{<number>} +\no{<number>} +} +!endverbatim + +\bluesubhead Customization + +If there is one format which is candidate for customization this is the one. +However, much information is already known by the system, like +\cs{author}, \cs{address}, \cs{logo}, et cetera. +Also addressees are known because of the address database. +What is left is to position the address in the address window. +BLUe's format provides the skip variables +\cs{haoffset} and \cs{vaoffset}. +These determine the shifts of the address within the window, +horizontally or vertically, respectively. + +When you are not satisfied with the basic layout then the \cs{headline} +and \cs{footline} have to be rewritten, because how the +information is pasted up will be taken form these token variables. +How to design your own letter format +is beyond the scope of this user's guide. + +\bluesubsubhead And what about a letter on behalf? + +Suppose your letter has to be sent by fax and signed by a formal organization +instead of yourself. How can we achieve this? A real-life example is a letter +I sent to the ISF signed by the secretary of the NTG. The key to the solution is +to know which variables to adjust. It is not that difficult to look for those +in the fmt.dat file in the letter part. ^^{letter on behalf} +Tht letter format comprises a {\oldstyle100} lines or so. +Here they are anyway: + \cs{address}, + \cs{netaddress}, + \cs{businessaccount}, + \cs{fullname} and + \cs{affiliationbox}. + (In general redefine also \cs{ntglogobox}.) +The greetings is inserted explicitly. +\beginverbatim +\input blue.tex \letter %\fax{(202)342-2765} +\subject{Request J. Soros travel grant} +\ourreference{5} +\yourreference{} +%\addresses\isf\addressee\isf %Switched off, details exlicitly provided +%To override defaults from BLUe.tex +%address sender +\address{Postbus {\oldstyle394}\\{\oldstyle1740}AJ Schagen\\The Netherlands} +\netaddress{ntg@nic.surfnet.nl} +\businessaccount{\vtop{\hbox{\strut KvK Groningen nr V{\oldstyle025936}} + \hbox{\strut GIRO {\oldstyle1306238}, NTG}}} +%addressee +\setbox\affiliationbox\hbox{International Science Foundation\\ + Washington\\USA} +\fullname{ISF} %Used in headline follow pages +\beginscript %\beginletter is an alias +L.S., +\bigskip +The NTG ---Dutch language-oriented \TeX{} Users Group--- +is organizing the Euro\TeX{} {\oldstyle95} meeting, +September {\oldstyle4}--{\oldstyle8}, at Arnhem. +\bigskip +Our plan is to facilitate participation from East and Mid European countries, +i.e., from CSTUG, CyrTUG, GUST, and HunTUG, not on an individual basis +but for some 50 members in total of those groups. +\bigskip +We are convinced that this project will stimulate scientific cooperation +between East and West and hope that the ISF will also support this effort by +a grant. +\begingroup%local re-assignation +\author{G.J.H. van Nes\smallskip + {\small secretary NTG}} +\sincerely +\endgroup +\ps \TeX{} is the revolutionary computer-assisted typesetting system designed by D.E. Knuth. +\cc CSTUG: Matematick\'y \'ustav UK, Sokolovsk\'a 83, CS-186 00 Prague, + CZECH Republic\\(The Czech \TeX{} Users Group. horakk@earn.cvut.cz)\\ + CyrTUG: MIR publishers, 2 Pervy Rizhsky pereulok, Moscow 129820, RUSSIA\\ + (The Cyrillic \TeX{} Users Group from CIS{}. cyrtug@mir.msk.su)\\ + GUST: Institut Bada\'n Systemowych PAN, ul.~Newelska 6, 01-447, Warszawa, + POLAND\\(The Polish \TeX{} Users Group. tomasz@panda.bg.univ.gda.pl)\\ + HunTUG: Institute of Mathematics and Informatics, Lajos Kossuth University + of Debrecen, H-4010 Debrecen, P.O.B. 12, HUNGARY\\ + (The Hungary \TeX{} Users Group. ludens@tigris.klte.hu)\\ +\endscript +!endverbatim + +Remark. Maybe I should make it possible to allow for multiple users, read senders +of letters. + +\bluesubsubhead And what about enclosures? + +I was so preoccupied by letters completely processed by \TeX{} or its ilks, +that I simply overlooked the wish to specify ^{enclosures} and include these fysically. +Well, \dots no problem. Just define +\beginverbatim +\def\enclosures{\bigskip Enclosures: \small } +!endverbatim +and use this for example at the end\Dash just before \cs{endscript}\Dash as follows +\beginverbatim +\enclosures{Copy of bank payment} +!endverbatim +Creeping featurism? Let us put it positively: +no unnecessary issues have been implemented, and +when something is needed we can easily add it. + + +\bluesubsubhead Your summary of main markup tags for letters + +The Frequently Used Tags, FUTs for short\Dash indeed a handful, as already indicated in + the template in the `Introduction'\Dash for personalizing. +Use it as crib. + +\beginverbatim +!bf +Letter proper!tt +\addresses{...} +\addressee{...} +\subject{...} +\yourreference{...} +\ourreference{...}%only digits +\letterto{...} +\lettertoall +\vaoffset +\haoffset +!bf +Copy Proper!tt +\beginscript +\endscript +\dear +\sincerely +\cc +\ps +\appendix{...} +!bf +Address labels!tt +\makelabels{...} +\makealllabels +\makesearchlabels +!endverbatim + + +\newpage +\bluehead Report format + +A report is set in one-column, with per page a header and footer. +The header is suppressed for the preliminary pages and +for every first page of a chapter. ^^{format,\ report} +The latter starts with a +title and summary followed by the copy proper. +The footer is suppressed for the preliminary pages, i.e., +these pages lack numbering, among other things. + +^^|\chapterhead|^^|\summary| +^^|\begindemo|%^^|\enddemo| +^^|\yields| +^^|\displaycenterline| +^^|\begincenterdisplay|%^^|\endcenterdisplay| +Some new control sequences are +\begincenterdisplay +\cs{preface} &for a preface\cr +\cs{chapterhead} &for chapter title\cr +\cs{setupappendices} &for letters as numbers\cr +\cs{pasteup...} &to paste up elements\cr +\endcenterdisplay +Next to the coding of the new control sequences several existing control +sequences had to be recoded to comply with \cs{report}. +The reimplementation of ^|\beginscript| was tedious work, because +it takes care of the preliminary pages: +the cover page, +the inside cover page, +the title page, +the preface page, and +the table of contents page. +|\endscript| takes care of the back cover pages. + +The implementation of \cs{(chapter)head} was tough work because of the wish +to process on the fly and to store the title. +On second thoughts I realized the more +modest wish to allow for math in the titles, +especially to handle the circumflex appropriately. + +Next to the a priori and physical table of contents +in the front matter of the report, +a table of contents with page numbers attached dynamically, +is generated on the fly and appended at the end of the +typeset report. +The latter supports `drafting,' much in the spirit of developing +a program supported by literate programming tools. +A ToC, a ToE, or the set of answers, are generated on +the fly and can be called up via \cs{pasteuptoc}, \cs{pasteuptoe}, +respectively \cs{pasteupanswers}. The contents file can be edited and used +for the static table of contents, finally. + +\bluesubhead Template + +The file for this report has all chapters included. +However, while writing and proofing all chapters were kept +in separate files. +The latter structure, stripped from redundancies, +has been included below as a template. ^^{script,\ report} + +If the preliminary matter is a little overwhelming, skip this section, and continue +with `Proofing a single chapter.' + +\blueexample A report script; the outer markup for this report + +The template reads as follows. +\thisverbatim{\catcode`\!=12 + \catcode`\~=0 } +\beginverbatim +\input blue.tex %\loadindexmacros %When creating an index too +\report + %Cover data +\bluetitle Publishing with \TeX + +\bluesubtitle BLUe's Selection + +\bluepictures \bluemodelpic + + %Inside cover data +\bluekeywords Bibliography, \bluetex, ... + +\bibliographydata{ISBN: \dots\par ...} +\beginacknowledgements +First of all +\displaycenterline{Don Knuth, Thank You!} +... +\rightline{I'm grateful to all of you.} +\endacknowledgements + %Title page data (next to title&author) +\beginabstract +The use of \bluetex{} has been documented in a user's guide, +... +\endabstract + %Preface page data +\beginpreface \vskip2\bigskipamount +Dear User, \bigskip +It occurred to me that my detailed studies +... +will be beneficial for new-and-old \AllTeX ies alike. + \bigskip +\rightline{\the\author} +\endpreface + %Contents Page data + %Because of \valign use, \contents{...} + %is not possible. +\begincontents %\se is subentry descriptive tag +Preface +Table of contents +Introduction +\se BLUe's format +... +\se J: Table of Contents +\endcontents +\let\coverpic=\bluemodelpic %BLUe script proper +\beginscript +\input pwt.int %Introduction +\input pwt.txt %Text +%\endscript %For testing, to make script smaller +\input pwt.mat %Mathematics +\input pwt.tab %Tabular material +\input pwt.grf %Pictures +\input pwt.ref %References +\input pwt.ind %Index creation +\input pwt.cus %Customization +\input pwt.aft %Afterthoughts +% +\setupappendices %From now on A, B, C,... +\pasteupanswers %A: Answer to Exercises +\input pwt.fmt %B: Formats +\input pwt.tls %C: Tools +\input pwt.sur %D: Backgrounds +\pasteuptoe %E: Table of Examples +\input pwt.tot %F: Table of tags +\input pwt.his %G: History of changes +\input pwt.obs %H: Obselete macros +%\sortindex\pasteupindex %I: Index +\pasteuptoc %J: Table of Contents +\endscript +~endverbatim + +\bluesubhead Proofing a single chapter + +^^{proofing single chapter} +Chapters can be proofed separately, not only for their contents but also for what +will come in +the Answers to the Exercises, +the List of Examples, +the Index, and +the Table of Contents. + +The markup where also +a ^{mini-ToE}, +a ^{mini-index}, and +a ^{mini-ToC} will be obtained, +reads as follows. +\beginverbatim +\input blue.tex %\loadindexmacros +\report +\input <filewithchapter> + %\pasteupanswers + %\pasteuptoe + %\sortindex\pasteupindex + %\pasteuptoc +\bye +!endverbatim +Perhaps the easiest way to get results is to forget about the preliminary +matter to start with. The above script formats your chapter and why not +begin with + +|\chapterhead{...}| right away, instead of |\input <filewithchapter>|? + +We can easily test a few chapters in a row as follows. +Omit \cs{bye} and when \TeX{} prompts for an +\cs{end} insert `i' for insert and after the insert prompt supply +\cs{input} |<nextchapter>|. + +\bluesubhead Main tags for report format + +A table of main tags for \cs{report} has been included ^^{report format, main tags} +to provide a survey of what outer tags\Dash and to what extent\Dash +they have been implemented for the \cs{report} format.\ftn{More + control sequences and symbols are available, + especially for the lower level markup, + if not for the undocumented features of manmac, + and the wealth of plain \TeX.} +The table also illustrates the naming convention of +a root name with affixes. + +The header fields indicate, +the prefixes pre-, post-, this-, every-, pasteup-, and +the suffixes -font, -name and -box. +The first column contains the various root names, with a marker +to denote to what extent the minimal one-part macro +has been implemented. + +\begingroup +\def\first{\hfil\thispicture{\unitlength=6ex \xdim{1.4}\ydim{1}}% + \lower1.5ex\hbox\beginpicture%(1.4, 1)(0,-.1) + \put( 0.0, 0.0){\small \strut Root}% + \put( 1.4, 0.575){\llap{\small Affix}}% + \put( 1.4, 0.1){\line(-2, 1){1.4}}% +\endpicture\lower3ex\null} +\def\header{pre-\cs post-\cs this-\cs every- \cs pasteup- + \cs -font\cs -name + \cs -box} +\def\btablecaption{Main tags for report scripts} + +\catcode`/=13 +\def/{\leavevmode\thinspace\hbox{% + \vrule\vtop{\vbox{\hrule\kern1pt\hbox{% + \vphantom{\tt e}\thinspace%{\tt#1}% + \thinspace}}\kern1pt\hrule}\vrule}% + \thinspace} % control sequence token +\catcode`-13 \def-{$\neg$} +\def\footer{\qquad\vtop{\small\rlap{- not implemented} + \rlap{${}^+$ implemented} + \rlap{/ implemented without processing on the fly}}} +\def\rowstblst{ +{abstract\hfill\ \tiny+} +{acknowledgements\hfill\ \tiny+} +{btable \hfill\ \tiny/} +{center \hfill\ \tiny+} +{chapterhead \hfill\ \tiny+} +{contents\hfill\ \tiny+} +{(sub(sub))head\hfill\ \tiny+} +{keywords\hfill\ \tiny+} +{picture \hfill\ \tiny-} +{pictures\hfill\ \tiny/} +{preface \hfill\ \tiny+} +{quote \hfill\ \tiny+} +{references\hfill\ \tiny/} +{script \hfill\ \tiny+} +%{syntax\hfill\ \tiny-} %Although there, not so relevant for the table +{summary \hfill\ \tiny+} +{verbatim\hfill\ \tiny-}} +\def\data{% + -\cs-\cs-\cs-\cs+\cs-\cs+\cs+\rs%abstract + +\cs+\cs+\cs-\cs+\cs-\cs+\cs+\rs%abstract + +\cs+\cs+\cs+\cs-\cs-\cs-\cs+\rs%btable + -\cs-\cs-\cs-\cs-\cs-\cs-\cs-\rs%center + +\cs+\cs+\cs+\cs-\cs+\cs-\cs-\rs%chapterhead + -\cs-\cs-\cs-\cs+\cs-\cs+\cs+\rs%contents + +\cs+\cs-\cs-\cs-\cs+\cs-\cs-\rs%head + -\cs-\cs-\cs-\cs+\cs-\cs+\cs+\rs%keywords + -\cs-\cs+\cs+\cs-\cs-\cs-\cs-\rs%picture + -\cs-\cs-\cs-\cs-\cs-\cs-\cs-\rs%pictures + +\cs+\cs-\cs-\cs-\cs+\cs-\cs-\rs%preface + -\cs-\cs-\cs-\cs-\cs-\cs-\cs-\rs%quote + +\cs+\cs+\cs+\cs+\cs-\cs+\cs+\rs%references + +\cs+\cs-\cs-\cs-\cs+\cs-\cs-\rs%summary + -\cs-\cs+\cs+\cs-\cs-\cs-\cs-\rs%script +% -\cs-\cs-\cs-\cs-\cs-\cs-\cs-\rs%syntax + +\cs+\cs+\cs+\cs-\cs-\cs-\cs-%\rs%verbatim +} +$$\vbox{\nonruled\nonframed + \btable\data}$$ +\endgroup +Remarks. +\bitem ^|\title|, ^|\subtitle|, ^|\author| and the like, are token + variables and associated with the script +\bitem ^|\pictures| and ^|\references| have been implemented in a + straightforward way, + because their use doesn't need processing on the fly. +\smallbreak + +\bluesubsubhead Your summary of main markup tags for reports + +The Frequently Used Tags, FUTs\Dash indeed a handful, as already indicated in + the template in the `Introduction'\Dash +for personalizing. + + +\beginverbatim +!bf +Preliminary matter!tt +\title{...} +\subtitle{...} +\keywords{...} +\abstract{...} +\contents{...} +\issue{...} +\acknowledgements{...} +\references{...} +\pictures{...} +!bf +Copy Proper!tt +\beginscript +\endscript +\chapterhead{...} +\summary{...} +\head{ ...} +\thissubhead{...} +\subhead{...} +\thissubsubhead{...} +(the \this<headkind>{...} especially together with \runintrue) +\subsubhead{...} +!bf +Inner level!tt +\begindemo...<escapechar>yields...\enddemo +\thisverbatim{...} +\beginverbatim +<escapechar>endverbatim +(and in-line !vrt!thinspace...!thinspace!vrt) +\beginquote +\endquote +\begindisplay +\enddisplay +(with & and \cr) +\displaycenterline{...} +\begincenterdisplay +\endcenterdisplay +(with & and \cr) +\btable +(with \data{...\cs...\rs...\cs...\rs...} + \header{...} + \footer{...} + \rowstblst{...} + \vruled{...} ) +\ref\<name> +\crsref\<name> +\ftn{...} +\item{...} +\itemitem{...} +\aitem +\Aitem +\bitem +\nitem +\example{...} +\thispicture{...} +(with \unitlength=...) +\cs{<tagname>} +!bf +Back matter!tt +\setupappendices +\pasteupanswers +\pasteuptoe +\pasteupreferences +\sortindex\pasteupindex +\pasteuptoc +!endverbatim + +\bluesubhead Addition of a format to BLUe's format system + +\blueexample Addition of report format to the fmt.dat database + +The following has been added to fmt.dat. ^^{add\ a\ format} +\begincenterverbatim +\tool\reportfmt +<themacros> +\endinput +!endcenterverbatim +\bluetex{} has been extended with +\thisverbatim{\catcode`\|=12 + \catcode`\!=12 + \catcode`\~=0 } +\begincenterverbatim +\def\report{\ifx\undefined\reportfmt\let\reportfmt=x\fi + \ifnum\reportloadcnt=0 \ea\loadformat\fi + \advance\reportloadcnt1 \let\reportfmt=\undefined} +%Storage allocations for \report come next +\newtoks\prefacename +%et cetera +~endcenterverbatim + +\newpage +\bluehead Transparencies format + +BLUe's format transparencies have a centered flavour, with +a header part which reflects the series, and the context. +^^{format,\ transparencies} +There is also room for a user logo to be printed in the header. + +Very error-prone is the line-by-line nature of a transparencies script. +Beware! +For example when providing a macro one should remember +that each line end is special. Perhaps I should provide +also \cs{disobeylines} to undo the \cs{obeylines}. + +\bluesubhead Template + +I like to start from an example, a template, which shows what +has to be provided. + +^^{script,\ transparencies} +\blueexample Transparencies script + +\thisverbatim{\catcode`\|=12 } +\beginverbatim +\input blue.tex \pictures\bluemodelpic +\transparencies \vfuzz=15pt \everyverbatim{\emc} +\hsize14cm +\leftskiptrs.2\hsize \rightskiptrs.1\hszie + +\title{BLUe's Format} +\subtitle{the best of both worlds} + +\contents{WAF? + Outer vs Inner markup + Template + Customization + Coding + Transparencies + Tags survey + Conclusions +} + +\beginscript +\head{WAF? } %Starts a new transparency, implicitly +$$\thispicture{\xoffset{-1}}\bluemodelpic$$ + +\head{Markup language} %Starts a new transparency, implicitly +\bitem |\begin<tag>...\end<tag>| |\<tag>| \hfill defs +\bitem |\this<tag>| |\every<tag>| \hfill token vars +\bitem \cs{title} \dots \hfill token vars +\bitem |\pre<tag>| |\post<tag>| \hfill token vars +\bitem |\pasteup<tag>| \hfill defs +\smallskip +\vfill +\loadxyz$$\xyz{Alias tags}{Options}{Place within context}$$ +\endscript +!endverbatim + +The following pages contain the results. +\cs{transparencies} has been used locally, and because of the nested use +I inserted |\thisscript{\notlastscript}|. Note that \cs{pictures} +has to be supplied before \cs{transparencies} because the latter +turns \cs{obeylines} on. +\newpage +\subheadtitle{} +\subsubheadtitle{} +\storedpageno\count0 +{\pictures\bluemodelpic + \transparencies + \hsize14cm + \leftskiptrs.2\hsize\relax + \rightskiptrs.1\hsize\relax + \hfuzz30pt \vfuzz=15pt \everyverbatim{\emc} + +\title{BLUe's Format} +\subtitle{the best of both worlds} + +\begincontents WAF? + Outer vs Inner markup + Template + Customization + Coding + Transparencies + Tags survey + Conclusions +\endcontents + +\thisscript{\notlastscript} +\beginscript +\head{WAF? } +$$\thispicture{\xoffset{-1}}\bluemodelpic$$ + +\head{Markup language} +\bitem |\begin<tag>...\end<tag> \<tag>| \hfill defs +\bitem |\this<tag>| |\every<tag>| \hfill token vars +\bitem \cs{title} \hfill token vars +\bitem |\pre<tag>| |\post<tag>| \hfill token vars +\bitem |\pasteup<tag>| \hfill defs +\smallskip +\vfill +\loadxyz +$$\vbox{\xyz{Alias tags}{Options}{Place within context}}$$ +\endscript +%\nxttrs +}%end transparencies intermezzo +\count0\storedpageno\advance\count0 by3 + +\def\bluehead#1\par{\head{#1}} +\def\bluesubhead#1\par{\subhead{#1}} +\def\bluesubsubhead#1\par{\subsubhead{#1}} +%kludge, admitted. March adaptation in trs is not robust, alas. + +\bluesubhead Use your logo + +^|\logo| is a def, and invoked within \cs{line}. +In order to have your logo, supply +\begincenterverbatim +\def\logo{\vbox to0pt{\vss +... %Your logo +}} +!endcenterverbatim + +\bluesubhead Maintenance + +This section is in a certain sense artificial, ^^{maintenance transparencies} +introduced by the automatisms which come with my choices for +the `header' and `footer,' especially the context-dependent +information in there. +The following might be helpful for modifying or extending +single transparencies. +The idea is to follow the script +setup and handle the \cs{header}, \cs{pagenumber} and +\cs{identification} for the particular transparency. +In the example below the task was to add a transparency +in between.\ftn{Without automatically gathering of context + information the modifications are a trifle.} +\begincenterverbatim +\title{Literate Programming} +\beginscript +\head{Tools} +\nxttrs +\identification{feb94} +\pagenumber{13a} +\subhead{FWEB} +LP tool by John Krommes +\endscript +!endcenterverbatim + +\bluesubhead Main tags for transparencies + +A table of main tags has been included ^^{transparencies format, main tags} +to provide a survey of what outer tags\Dash and to what extent\Dash +they have been implemented for the \cs{ transparencies} format. +The table also illustrates the naming convention adopted +via a root name with prefixes and suffixes. + +The header fields indicate, +the prefixes pre-, post-, this-, every-, pasteup-, and +the suffixes -font, -name and -box. +The first column contains the various root names, with a marker +to denote to what extent the minimal one-part macro +has been implemented. + +\begingroup +\def\first{\hfil\thispicture{\unitlength=6ex \xdim{1.4}\ydim{1}}% + \lower1.5ex\hbox\beginpicture%(1.4, 1)(0,-.1) + \put( 0.0, 0.0){\small \strut Root}% + \put( 1.4, 0.575){\llap{\small Affix}}% + \put( 1.4, 0.1){\line(-2, 1){1.4}}% +\endpicture\lower3ex\null} +\def\header{pre-\cs post-\cs this-\cs every- \cs pasteup- + \cs -font\cs -name%\cs -title + \cs -box} +\def\btablecaption{Main tags for transparencies scripts} + +\catcode`/=13 +\def/{\leavevmode\thinspace\hbox{% + \vrule\vtop{\vbox{\hrule\kern1pt\hbox{% + \vphantom{\tt e}\thinspace%{\tt#1}% + \thinspace}}\kern1pt\hrule}\vrule}% + \thinspace} % control sequence token +\catcode`-13 \def-{$\neg$} +\def\footer{\qquad\vtop{\small\rlap{- not implemented} + \rlap{${}^+$ implemented} + \rlap{/ implemented without processing on the fly}}} +\def\rowstblst{ +{btable \hfill\ \tiny/} +{center \hfill\ \tiny+} +{contents\hfill\ \tiny+} +{(sub(sub))head \hfill\ \tiny+} +{picture \hfill\ \tiny-} +{pictures\hfill\ \tiny/} +{quote \hfill\ \tiny+} +{script \hfill\ \tiny+} +%{syntax\hfill\ \tiny-} %Although there, not so relevant for the table +{verbatim\hfill\ \tiny-}} +\def\data{% + +\cs+\cs+\cs+\cs-\cs-\cs-\cs+\rs%btable + -\cs-\cs-\cs-\cs-\cs-\cs-\cs-\rs%center + -\cs-\cs-\cs-\cs+\cs-\cs+\cs+\rs%contents + +\cs+\cs-\cs-\cs-\cs+\cs-\cs-\rs%head + -\cs-\cs+\cs+\cs-\cs-\cs-\cs-\rs%picture + -\cs-\cs-\cs-\cs-\cs-\cs-\cs-\rs%pictures + -\cs-\cs-\cs-\cs-\cs-\cs-\cs-\rs%quote + -\cs-\cs+\cs+\cs-\cs-\cs-\cs-\rs%script +% -\cs-\cs-\cs-\cs-\cs-\cs-\cs-\rs%syntax + +\cs+\cs+\cs+\cs-\cs-\cs-\cs-%\rs%verbatim +} +$$\vbox{\nonruled\nonframed + \btable\data}$$ +\endgroup +Remarks. +\bitem ^|\title|, ^|\subtitle|, ^|\author| and the like, are token + variables and associated with the script +\bitem ^|\pictures| has been implemented in a straightforward way, + because it doesn't need processing on the fly. +\smallbreak +\newpage +\bluesubsubhead Your summary of markup tags for transparencies + +\beginverbatim +!bf +Token vars!tt +\address\author\crowner%Default, already personalized +\every... %See default blue.tex +\footline +\headline +\headtitle +\identification +\pagenumber +\posthead +\postsubhead +\postsubsubhead +\prehead +\presubhead +\presubsubhead +\subheadtitle +\subsubheadtitle +\subtitle +\this...%See blue.tex +\title + +!bf +Control sequences with root name!tt +center %default +contents +head +pictures +script + +!bf +Auxiliaries!tt +\continue +\nxttrs + +!bf +Lower level!tt +\bitem +\beginverbatim +<escape char>endverbatim +!endverbatim +For inner markup the macros from plain +and those from \bluetex{} can be used. +Load what you need before \cs{transparencies} because the latter turns +\cs{obeylines} on. +\displaycenterline{Do remember the line-by-line character of the script} +\endinput diff --git a/info/laan/pwt/pwt.his b/info/laan/pwt/pwt.his new file mode 100644 index 0000000000..2ef1b7ff88 --- /dev/null +++ b/info/laan/pwt/pwt.his @@ -0,0 +1,84 @@ +\input blue.tex +\report +\bluechapter History of Changes + +\beginsummary +An account of the history of BLUe's format has been provided. +Milestones in the development have been listed. +\endsummary + +In {\oldstyle1994} BLUe's format was introduced at CyrTUG and Euro\TeX. +The article was published in MAPS {\oldstyle94}.{\oldstyle1}, +and also in the Euro\TeX{} proceedings (abbreviated). +The fall article and a pre-release of \bluetex{} +have been sent to the world, i.e., to the CTAN. +At that time only a default format and the transparencies format +were available. It has been extended by report and letter format. +The design of BLUe's format accounted for personalization, open-endedness, +minimal markup and a discipline to cope with progress. + +The major extension of {\oldstyle 1995} was this user's guide, +which entailed the \cs{report} format, and the inclusion of Knuth's +letter and concert formats, \TB{} Appendix~E. +Both were finished in January {\oldstyle1995}. +Important was how to cope with the multitude of +formats, macros and tools out there. +The files have been organized in databases. +Not only a database for references, pictures, and addresses, no, +also for tools and formats. +What is needed will be loaded selectively from these, behind the scenes, +and\dots\thinspace by \TeX. Neat! + +\newpage + +\def\btablecaption{}\def\footer{} +$$\def\first{Date} +\def\header{\hfil Change\hfil\lower1.25ex\null}%To put on 1/3th +\nonframed\fll +%Beware of the name clash \cs: control sequence and column separator. +% +\def\template{\colsepsurround ##\hfil\raise4ex\null&\lft##\rgt& + \lft\vtop\bgroup\noindent\hsize.75\hsize + \baselineskip12pt\openup2pt + \obeylines##\egroup\rgt\cr} +\thisbtable{\let\tstrut\relax\def\par{\strut\endgraf}} +% +%Data to be extended. Remember that \obeylines is on. +\def\rowstblst{{Future} + {Spring {\oldstyle1996}} + {Summer {\oldstyle1995}} + {Spring {\oldstyle1995}} + {Dec {\oldstyle1994}} +} +\beginbtable +Updates to come +%Another line +%The 3th jolly line +\rs +BLUe-2-\LaTeX{} Convertor Assistant emerged +\rs +PASCAL tool improved, one-pass ToC added +Graphics has been extended by turtle graphics, fractals, and smileys +\rs %No \cs{name} possible; name clash with column separator + %Next are lines within one entry. Natural input. +page size for index flexible; plnindex can be used loose from blue.tex +|\nxttrs| |\continue| consistent with |\newpage| (|\vfill\eject|) +\rs +list element tag in address.dat, lit.dat and pic.dat changed into |\lst| +|\oldstyle| is introduced for the page numbers in the index etc. +Font handling for transparencies has been cleaned up +Addresses are stored in address.dat to cooperate with |\letter| +Tools are stored in the database tools.dat +Formats are stored in a database fmt.dat +\bluetex{} has been extended to BLUe's format system +|\report| and |\letter| have been designed +|\nitem| uses |\prenum| and |\postnum| for embellishments +|\create| in math cross-refs stores also |\prenum| and |\postnum| +|\rowstblst|'s last argument is no longer an exception +Partitioned matrix markup is short and elegant via |\btable| +Space-saving variant of continued fraction looks much better now +D\"urer's magic square has a better |\dotboxit|. +Bridge form details have been improved. +\endbtable +$$ +\endinput
\ No newline at end of file diff --git a/info/laan/pwt/pwt.ind b/info/laan/pwt/pwt.ind new file mode 100644 index 0000000000..85508d814d --- /dev/null +++ b/info/laan/pwt/pwt.ind @@ -0,0 +1,506 @@ +\input blue.tex \loadindexmacros \report + + \bluepictures\indmodelpic + +\bluechapter Creating an Index + +\beginsummary +The creation of a modest index within +a one-pass \TeX{} job has been treated. +In general a proof run and a final run are needed. +\endsummary + +Making an index is an art. The fundamental problem is +\bluedisplaycenterline What to include in an index? + +Computer-assisted indexing is not simple either. +Issues are +\bitem the markup of keywords or phrases +\bitem to associate page numbers +\bitem to sort and compress raw Index Reminders (^{IR}s), and +\bitem to typeset the result. +\smallbreak +My approach is to create proof indexes\Dash also called mini-indexes\Dash +for each chapter and +learn from those what should be included in the total index. +I perceived this as very pleasant in practice. +Even if you prefer \cs{makeindex} for the real index, this +processing on the fly of a chapter index can be of great help.\ftn{It is said + that the automatic generation of an index is a feature of the Literate Programming tools. + For LP with \TeX{} as such, as for example Gurari's Pro\TeX, this on-the-fly indexing + within \TeX{} can be used.} + +\bluehead Use + +I'll show how to mark up Knuth's four types of IRs, +how to mark up accents, +how to mark up font switching, and +how to mark up spaces as part of the IR. + +\blueexample Markup, commands and resulting index + +The right column has been obtained via +\bitem ^|\loadindexmacros|, at the beginning of the script +\bitem ^|\sortindex|, at the place of indexing, and +\bitem ^|\pasteupindex|, for the pasteup of + the index. +\smallbreak + \thisverbatim{\catcode`\|=12 + \catcode`!=12 \unmc + \catcode`\*=0 } +\begindemo +Types of IR + 0 ^{return} + 1 ^|verbatim| + 2 ^|\controlsequence| + 3 ^\<syntactic quantity> +Accents ^{\'el\`eve!}, +font changing ^{\bf bold} +and spaces ^{control\ symbol} +Control sequences + ^{\TeX, and \AmSTeX} + ^{Lamport and \LaTeX} +brackets ^{\tt< \rm and \tt>} +\newpage ^{return} +\newpage ^{return}%on purpose +\sortindex\pasteupindex\bye +*yields\obeylines +\quad {\tt {}< \rm {}and \tt {}>}{} {\oldstyle1} +\quad {\bf {}bold}{} {\oldstyle1} +\quad {control\ symbol}{} {\oldstyle1} +\quad {\tt \char 92\hbox {controlsequence}}{} {\oldstyle1} +\quad {\'el\`eve!}{} {\oldstyle1} +\quad {Lamport and \LaTeX{}} {\oldstyle1} +\quad {\TeX, and \AmSTeX{}} {\oldstyle1} +\quad {return}{} {\oldstyle1}--{\oldstyle3} +\quad $\langle \hbox {syntactic\ + quantity}\rangle ${} {\oldstyle1} +\quad {\tt verbatim}{} {\oldstyle1} +\enddemo +The representation of page numbers as a range comes out automatically. + +\exercise What makes a good index? Of course this is a million-dollar + question. Let us concentrate on the number of entries and on the + number of page numbers per entry. Which of the two extremes + sketched below is the better one in your opinion? + One with many entries pointing to issues spread throughout the book\Dash + like \TB{} ;-))), and pushing the limits just for the imagination, + an index with pointers to related work on the internet, accessible + by just clicking the mouse\Dash + or one with few page numbers per entry\ftn{Courtesy Erik Frambach.}? +\answer As usual it all depends on your application. End of answer. + But\Dash there is always a but\Dash the complaint I heard + most about \TB{} was that the information is spread all over, + and that it is hard to find what you are looking for. + Therefore I consider a few page numbers per entry beneficial. + (Let us forget about the intrinsic complexity of the + subject, certainly at the time.) + BLUe's format supports scrutinizing parts of an index, + because it is so easy to generate an index per chapter on the fly. + It is hardly not more difficult than generating a table of contents. + An index per chapter can be scrutinized more easily, and + redundancies removed. + That the index provides a mechanism + to link things over chapters is a good thing, however. + Don't misunderstand me. + But don't overuse it, IMHO, with all respect. Remember DeVinne's + adage `The last thing to learn is simplicity.' + +%end answer + +\bluehead Markup of Index Reminders + +IR-s are at the heart of the process. ^^{IR,\ markup} +Knuth distinguished {\oldstyle4} types to facilitate the outside processing. +I'll adopt his IRs syntax and types. + +\bluesubhead Syntax + +Knuth's IRs obey the following syntax. ^^{IR,\ syntax} +\begincenterverbatim +<word(s)>!]!!<digit>!]<page number>. +!endcenterverbatim +The digits {\oldstyle0}, {\oldstyle1}, {\oldstyle2}, or {\oldstyle3} +denote the types: +words, +verbatim words, +control sequences, and +syntactic quantities. +A user does not have to bother about the digits nor about the +page numbers. +Knuth has adopted the accompanying conventions for +the word(s) of IRs.\ftn{See \TB{} {\oldstyle424}, for the IR types, + and what is typeset in the result. + In \cs{vref} the markup is inserted as replacement + text of \cs{next}. What is set in the index is governed by the macros + which are included after \cs{begindoublecolumns} in the \TeX book script.} +$$\vbox{\offinterlineskip\def\tstrut{\vrule height2.5ex depth.5ex width0pt} +\halign{\tstrut#\hfill\quad\vrule\quad&#\hfill\quad\vrule\quad&#\hfill\cr +Mark up&Typeset in copy$^*$&IR \cr +\noalign{\hrule} +|^{...}| &\dots &|... !!0 |$\langle page\, no\rangle$.\cr +|^!vrt...!vrt| &|!vrt...!vrt|& + |... !!1 |$\langle page\, no\rangle$.\cr +|^!vrt\...!vrt| &|!vrt\...!vrt| & + |... !!2 |$\langle page\, no\rangle$.\cr +|^\<...>|&$\langle\dots\rangle^{**}$& + |... !!3 |$\langle page\, no\rangle$.\cr +\noalign{\vskip.5ex\hrule width1cm\relax\vskip1ex} +\multispan3{\quad$^*\,$\vrt\dots\vrt\ denotes manmac's, TUGboat's,\dots + verbatim \hfil}\cr +\multispan3{\quad$^{**}\,$in \cs{rm} \hfil}\cr +}}$$ +For the user the word(s) is (are) important. +The markup allowed for the IRs and the result in the copy are +given in the accompanying table. + +\bluesubhead Markup + +The markup for IRs is near to natural. +Precede the entry by a circumflex, or a double one in case of +a silent\ftn{Silent IRs mean that these will appear + only in the index, not on the page.} +index entry. + +\blueexample IR markup + +\thisverbatim{\catcode`\|=12 \catcode`\^=12 + \catcode`!=12 \catcode`*=0 \unmc} +\beginverbatim +^{\'el\`eve!}^|verbatim text|^|\controlsequence|^\<a metalinguistic variable> +^^\<a metalinguistic variable> %for silent ones, double the ^ +{\sl^{ligatures}} |'$|^|\,||$''|%from the TeX book script +^^{markup commands, see control sequences} +^{Lamport and \LaTeX} %text and control sequences with sort keys +*endverbatim + +\thissubsubhead{\runintrue} +\bluesubsubhead Spaces \par are difficult as always. ^^{IR\ and\ spaces} +In the IR they separate parts of the IR and are used +in the word part. + +\bitem Just typing a space has as an effect that + it will be neglected during sorting +\bitem The markup `\cs{\char32}', a control space, + will yield a space subject to sorting, according to + the ordering table +\bitem \cs{space} as markup will be neglected during sorting. + This token is default member of + the set of control sequences to be ignored. + It will be set in the index as \cs{\char32}. +\smallbreak + +\exercise What to do when part of a title should reappear in the index? +\answer The naive approach is to enclose that part by braces and precede + it by a circumflex. However, that goes wrong because a title + is stored and reused in many places. So copy the words and + mark them as a silent IR. + +\blueexample Spaces + +\thisverbatim{\catcode`\|=12 } +\begindemo +^{\space}%an ignored cs +^{a\ a} %control space +^{aa} +^{a\ b} +^{a \TeX} +^{a\ \bf a} +^{\TeX book} +^{xyz beta}%space neglected in + %sorting +^{xyza} +^|\space| +\sortindex\pasteupindex\bye +!yields +\noindent Sorted result in file index.srt +\thisverbatim{\catcode`\!=12 + \catcode`\;=0 } +\beginverbatim +\space {} !0 1. +a\ \bf a{} !0 1. +a\ a{} !0 1. +a\ b{} !0 1. +aa{} !0 1. +a \TeX {} !0 1. +space{} !2 1. +\TeX book{} !0 1. +xyza{} !0 1. +xyz beta{} !0 1. +;endverbatim +\enddemo +Explanation. \cs{space} belongs to the set of control sequences +to be ignored, ^^{ignored\ control\ sequences} +ICSs for short. +This means that it is skipped with respect to sorting, +except when it occurs as the last token of the word part. +In that case they are ordered as a space, +i.e., according to the lowest value. +This explains the position of `\cs{space}.' + +`\cs{TeX},' and `\cs{TeX} book,' are subject to the default sorting keys. + +`xyza' precedes `xyz beta,' because the space is silent. +When word ordering is preferred a \cs{\char32}, a control space, must +be included. + +\bluehead Special tokens + +Tokens are either neglected +or replaced by another sequence while sorting. +\bluetex{} provides two sets of tokens to be ignored while sorting: +^|\conseqs| and ^|\consyms|.\ftn{There are two sets because of + the handling of the space after the token in the result.} +Replacing a control sequence by another sequence +is called associating a sorting key to the +control sequence. + +Active symbols can't be part of the IR, for the moment. + +\bluesubhead Tokens to be ignored + +In practice I needed things like \cs{tt} +as part of the IR, which must be neglected while sorting.\ftn{The reason is + that {\tt <, and >} are used, and printed wrongly.} +I decided to ignore those tokens while sorting and to include +the tokens in the final index.elm as such. +Default \bluetex{} knows about the following sets of tokens to be ignored. +\begincenterverbatim +\conseqs{\c\space\bf\it\rm\tt\sub\relax} +\consyms{\`\'\"\^\~} +!endcenterverbatim + +\bluesubhead Sorting keys + +In order to extend a set, use the macro \cs{add}. + +\blueexample Use of sorting keys + +Default \bluetex{} provides the following +sorting keys. +\begincenterverbatim +\srtkeypairs{\AmSTeX{amstex} + \LAMSTeX{lamstex} + \LaTeX{latex} + \TeX{tex} + \PS{PostScript}} +!endcenterverbatim +Suppose that we have \cs{fourtex} and that we like this to be sorted +as `4tex.' +This can be done by extending the set of ^|\srtkeypairs|, ^^|\add| +as follows. +\thisverbatim{\unmc} +\begindemo +\add\fourtex{4tex}to\srtkeypairs +Copy with ^{IR \fourtex} +^{IR 1} +^{IR 5} +^{IR a} +% +\sortindex %with 4tex for \fourtex +\pasteupindex%Set `IR \fourtex{} + %<pagenumbers>' +\bye +!yields +then the file index.srt will contain the IRs +\thisverbatim{\catcode`\!=12 + \catcode`\;=0 } +\beginverbatim +IR 1 !0 <pageno>. +IR \fourtex{} !0 <pageno>. +IR 5 !0 <pageno>. +IR a !0 <pageno>. +;endverbatim +\enddemo +with \cs{fourtex} sorted on 4tex. + +\exercise What to do when `to' is part of the sorting key? +\answer Add an extra level of braces. + + +\bluehead Ordering + +A fundamental issue with indexes is the ordering. ^^{ordering} +The ^{ASCII} table is not suited because lowercase and uppercase +letters differ by 32. I decided to rank these as equal, more +precisely to assign the lowercase ASCII values to both. I prefer +from the accompanying table the {\oldstyle1}$^{st}$ column to the +{\oldstyle2}$^{nd}$ one. + +Moreover, accented letters are not part of ASCII. How should we +order for example e, \'e, \`e, \^e, \"e? +I decided to rank accented letters equal to those without an accent, +because I prefer from the accompanying table +the {\oldstyle3}$^{rd}$ column to the {\oldstyle4}$^{th}$ one. + +I know that non-letters precede letters, but what about their relative +ordering? I decided to stay as close as possible to the ASCII ordering. + +Then there is the problem of digits. In IRs they come as part of the +word(s) and as page numbers. For the latter I used the numerical ordering. +For the former I used the alphabetical ordering.\ftn{I could have applied + a look ahead mechanism and use numerical ordering throughout. + Maybe another time.} + +Furthermore, a user can select +the so-called ^{word\ ordering},\ftn{This means that a space precedes + all letters. A space as such is neglected in the ordering.} +by \cs{\char32}, \TeX nically a control space, as markup for a space. +Personally, I like from the accompanying table +the {\oldstyle5}$^{th}$ column better than the {\oldstyle6}$^{th}$. +\def\btablecaption{} +\def\footer{} +\nonframed +\def\rowstblst{} +$$\def\header{lower vs.\ upper case\cs + accents vs.\ unaccented\cs + word ordering} +\vruled\btable{\vtop{\halign{&\tstrut\quad#\hfil\cr +el & el \cr +El\`eve & em \cr +em & El\`eve \cr}}\cs +\vtop{\halign{&\tstrut\quad#\hfil\cr +el & el \cr +\hbox{\'el\`eve} & em \cr +em & \hbox{\'el\`eve} \cr}} +\cs\vtop{\halign{&\tstrut\quad#\hfil\cr +sea lion & seal \cr +seal & sea lion\cr}} +}%end \btable +$$ + +\bluehead Typesetting the index + +The specifications for typesetting a \bluetex{} index are +\bitem represent the four IR types the same as in the \TeX book +\bitem set in two-columns, balanced, possibly preceded + by one-column copy +\bitem set subsidiary entries analogous to the \TeX book +\bitem indent continuation lines by {\oldstyle2}em +\bitem indent subsidiary entries by {\oldstyle1}em +%\bitem underline page numbers which represent the definition or +% the main source of information +%\bitem represent a page number in italics when that page contains +% an instructive example of the concept in question. +\smallbreak +Users can edit index.elm\Dash read: add markup\Dash and +provide the necessary macros in for example \cs{preindex}. +In short follow Knuth. To please Frans Goddijn I introduced the tag +^|\numberstyle|, by default equal to \cs{oldstyle}. + +\exercise And what about subentries? +\answer My approach is to consider subentries as a typesetting problem in the sense + that the full entries are specified and only when sorted and typeset redundant first + parts can be suppressed, if one considers this better. This is similar to how + BLUe's format system typesets references, inspired by the \AMS. + For the moment I did not implement subentries handling, because as of {\oldstyle1995} + I consider it of low priority. + +\bluehead Customization + +A user might wish to interfere in places +\bitem to include other tokens to be ignored while sorting +\bitem to supply an ordering of his/her own +\bitem to enrich the sorted and compressed file index.elm. +\smallbreak + +\bluesubhead Adding tokens + +What are reasonable requirements to impose upon the handling of +markup control sequences (cs for short)? In my opinion +\bitem the cs must be defined +\bitem ^|\makexref| writes the cs unexpanded +\bitem ordering? unknown, and therefore must be supplied +\bitem ^|\setupnxtokens| guards that the cs-s are written %, unexpanded, + to ^{index.srt} and ^{index.elm}. +\smallbreak +As a consequence I decided to neglect the `in between' +control sequences while sorting. +For those who favour a one-pass job, I have provided the following, +though.\ftn{It is simpler to add those control sequences to + index.elm.} + +The extension of a set of tokens can be done via ^^|\add| +\beginverbatim +\add\hfil to\conseqs or \add\`to\consyms or \add\hfil{hfil}to\srtkeypairs +%with auxiliary \def\add#1to#2{...} +!endverbatim +Each element from \cs{conseqs} is redefined in such a way +that the control sequence token is written to the file +with a space appended.\ftn{\cs{noexpand} is used instead of \cs{string}.} + +\bluesubhead Modifying ordering + +A general way is to `copy' the ordering table +and to modify it.\ftn{My \cs{fifo} is just a shortcut, which also + prevents typos in assigning the ASCII values. For \cs{fifo}, see + my `FIFO and LIFO sing the BLUes.'} + +And what about a macro to add to the table? +This can be done easily, and superficially looks convenient +for an innocent user. +At the moment I don't trust the macros to be worthwhile +for an innocent user, unless a very modest index has to be made. +And this completes the circle: different ordering is not wanted, I guess. + +\bluesubhead The process and files involved + +Like in manmac, \bluetex{} stores the raw IRs in the file index. +^^{IR,\ processes\ and\ files} +The file index^^{index,\ file}\ftn{Default index is the value of + the toks variable ^|\irfile|, which is used in \cs{sortindex}.} +is read and stored in an array for internal sorting. +After sorting, the number of entries is +reduced,\ftn{Those which differ by page + number are collected in one entry.} +and the result is written to the file ^{index.srt}. +Then, index.srt is transformed into the file +index.elm.\ftn{Default ^{index.elm} is the value of the toks variable + ^|\indexfile|, which is used in |\pasteupindex|. + The transformation abandons the IR syntax. + The part which specifies the kind of IR + is deleted and the word part marked up + accordingly.} +The result is typeset via ^|\pasteupindex|. +Schematically it comes down to the following. +\bigskip +$$\vbox{\hsize.5\hsize% +\indmodelpic +}$$ +^|\loadindexmacros| loads the index and sorting macros, and performs +initializations. It is safeguarded against double loading.\ftn{I introduced + this because I start each chapter with \cs{loadindexmacros}, + independent from whether it is run on its own or as part of the total.} + + +\bluesubhead Enriching the index + +This use is necessary when for example ^^{index,\ enrich} +\bitem control sequences have to be typeset +\bitem special symbols are needed, or +\bitem cross-references within the index are required. +\smallbreak +The best way is to start from the ^{index.elm} file. + +\bluesubhead Typesetting the enriched file + +When the default name is used\Dash index.elm\Dash +just say \cs{pasteupindex}. +For another file name assign this name to the toks +variable \cs{indexfile}, +prior to the invocation of \cs{pasteupindex}. + +\bluehead Extras + +Ubdoubtedly people favour their own subset of \TeX, or more likely \LaTeX. +There is good news. You don't have to use BLUe's format system. I gathered the sorting +and indexing stuff as an independent self-contained set in the file plainindex.tpl. + +The bad news is that up till now I did not do much about preventing name clashes. + +\bluesubhead \TeX nical details + +The details with respect to indexing have been treated in `BLUe's Indexes,' and +the sorting aspects have been treated in `Sorting in BLUe,' both available from the CTAN. +\endinput +\bye
\ No newline at end of file diff --git a/info/laan/pwt/pwt.int b/info/laan/pwt/pwt.int new file mode 100644 index 0000000000..f242bad747 --- /dev/null +++ b/info/laan/pwt/pwt.int @@ -0,0 +1,707 @@ +\input blue.tex +\loadindexmacros \report \vfuzz1000pt +\bluepictures\bluemodelpic + +\bluechapter Introduction + +\pageno1 +\beginsummary +A plea is made for simplicity after having made the right a priori choices. +The aim is to provide a user's guide such that \bluetex{} can be used +with confidence. +\TeX{} and its benefits are explained in a nutshell. +The contents of each chapter is summarized and +the audience addressed. +The model of BLUe's format is given. +The concept, syntax and template of a BLUe script are touched upon. +At the end a list of notations and definitions has been included. +\endsummary + +Scientific tradition has it that simplicity can be attained +once the right a priori choices have been made. + +In relation to using \TeX{} this means to get your priorities right, +to keep in mind that it is all about what you have to say, +to what you developed and wish to communicate. + +Next to the a priori choices, selection is important. +The `handful' of tags needed in practice most of +the time, at least by me, will be treated. +\TeX{} is just one of the tools needed for computer-assisted information +exchange, and therefore there is no use in (sub)optimizing. +\displaycenterline{Understand BLUe's format sufficiently and + use \TeX{} with confidence!} +The spirit of this work on using \TeX{} is to guide a user +towards preparing documents with as little knowledge of +the nitty-gritty of \TeX{} as possible. +A tool should not become part of the problem.\ftn{My adage is + {\oldstyle80}\% of the quality with {\oldstyle20}\% of the energy. + Relevancy prevailed highbrowness. + Common scripts marked up by sound, non-esoteric \TeX niques.} +To quote {\TB} `\dots If you are preparing a simple manuscript, you won't +need to learn much about {\TeX} at all; on the other hand \dots' + +\TeX\Dash designed in the late seventies and frozen in the early nineties\Dash +is a tool for formatting documents by computer. +Together with its twin sister \MF{} it has revolutionized +computer-assisted typesetting. +The benefits of ^{\TeX{}} are +\bitem quality +\bitem availability on most if not all computers (in the Public Domain, + turn-key) +\bitem independence from input and ouput devices +\bitem open-endedness, to cooperate with EP tools, and + last but not least +\bitem stability. +\smallbreak +Because of this, an ASCII script with \TeX{} markup is portable +in place and time. + +I'll show that \TeX{} is suited for structural markup. This in +contrast with the widespread belief that this is the virtue of +\LaTeX. Not true, IMHO, with all respect. \LaTeX{} provided a +user's guide along with its macros and +emphasized the concept of separate style files. + +From the ample \TeX{} commands I'll select BLUe's subset +for practical day-to-day use. +To format an article\Dash a set of transparencies, and some more\Dash +with \bluetex, that is what it is all about. +These representations of a script are common. +Write down the results, and support the aftertalks by transparencies. + +The `^{BLUe's\ format}' section defines the structure of a ^{BLUe\ script}, and +provides a template, to be filled in. +How to mark up copy in detail, is subject of the chapters +`Text,' +`Mathematics,' +`Tables,' and +`Pictures.' +How to add a list of references and how to make citations +to that list is treated in the chapter `References.' +The chapter `Index,' is about how to create and include an index. +The chapter `Customization' is about modifying \bluetex. +Each chapter contains exercises. +As Appendices I included +`Solution to the Exercises,' +`Formats,' +`Tools,' +`BLUe's, BLUes, and Paradigms,' +`List of Examples,\ftn{Although this work is not a cookbook, + it's handy to have a quick access to the examples, because + it has all to do with using, not in the least by example.}' +`Table of Tags,' +`History of Changes,' +`Obsolete stuff,' +`Index,' and +`Table of Contents.' +A similar approach as in `Publiceren met \LaTeX' has been on my mind. +Ideally, the material dealt with should have been the same, +with only the \LaTeX{} tool exchanged for \TeX. +The underlying idea is that the functionalities required, +and the essence of the exercises, should be independent +of the tool used. +The same setup and exercises should allow a treatise on +you-name-it word processor.\ftn{The main difference with + the early work on \LaTeX{} is that now + the markup of a BLUe script is the issue.} + +Floating aspects have been used in a special sense. +Information is set in a box and inserted via a pasteup control sequence +at your place of choice. +Of course the usual inserts of plain for floats, \cs{topinsert}, +\cs{midsert} closed by \cs{endinsert}, are still there to be used + +I did not include a chapter on basic notions in publishing or book +production, because that information can be found elsewhere, +and would otherwise unduly increase the size of this work. +I did not include a survey of +`\TeX{} flavours and worlds' either, for similar reasons +although it comes closer to the subject. +For \TeX{} flavours et cetera, consult the archives of the worldwide +electronic networks to find for example +`What is \TeX{} and \MF{} all about?' + +Nothing of the world of \PS{} coupled to \TeX{} has been included, +jeopardizing \PS's scalability of fonts, +its rotation capabilities, +and its possibilities with colours. +I take the fonts which come with \TeX{} for granted, +assuming English as the lingua franca +for scientific communication. +The latter implies that (multi-)lingual issues have not +been touched upon either. + +Font switching and {font\ selection} has been treated poorly, to put it mildly. +For the moment I stay with Knuth and copied his size-switching macros. +BLUe's format contains the size-switching macros +\cs{Large}, $\approx${\oldstyle17}pt, used for chapter headings, +\cs{large}, $\approx${\oldstyle14}.{\oldstyle5}pt, +used for transparencies, +and \cs{small}, i.e., {\oldstyle8}pt, used for footnotes. +Next to these \cs{tenpoint}, \cs{ninepoint}, and +\cs{eightpoint} have been inherited from manmac. +However, the abstraction of mapping the linear space of fonts onto a logical +{\oldstyle5} dimensional space, which is the basic idea in NFFS, +is nice and might become very useful some day. + +Because of these a priori choices this guide remained small +and will hopefully be perceived as simple. + +The audience in mind consists of scientific workers, especially the +growing breed of self-publishing authors, with substantially complex copy, +especially complex math and tables. +Authors who concentrate on the contents +welcome a reasonable print-out, +exchange their works via electronic networks, +submit \AllTeX{} scripts to publishers, +like to understand their tool, and +last but not least aim to use +it confidently with minimal markup.\ftn{\TeX{} markup is extremely + tolerant. Many ways are possible, opening the door to quick-and-dirty + markup. A discipline is needed.} +In netland one can't rely much on publishers for the moment, +one is on one's own. +There is even the danger of becoming a \TeX hacker after some years, +because \TeX{} will serve your lifetime. + +For running a BLUe script with text not much \TeX{} knowledge is required. +When details of math, tables, and graphics come into play, +familiarity with David Salomon's courseware\Dash MAPS special {\oldstyle1992}, +also available on NTG's CD-ROM\Dash is assumed.\ftn{Advanced \TeX, {\oldstyle1995}, + Springer-Verlag, ISBN {\oldstyle0}-{\oldstyle387}-{\oldstyle94556}-{\oldstyle3}.} + +\bluehead The key to understanding Knuth's markup + +^^{Knuth's\ markup} +It did take me quite a while to understand Knuth's markup, \winksmiley. +Biased by my programming experience, and +influenced by SGML and \dots\thinspace\LaTeX, I was on the wrong track. +My mind was full of block structures with rigorous opening and closing tags, +and parameterization via arguments of procedures. +I was blocked for the simple approach of {\sl text replacement}, and +had to unlearn much, in order to become innocent again, +to open my mind for Knuth's approach. +\begincenter +ASCII text with visual layout +and +minimal markup tags added +\endcenter +The royal road to understanding and appreciating Knuth's markup is starting +from ASCII text, what you would write by hand. +The next step is inserting markup tags, as few as possible, +that is, enriching the ASCII file with minimal markup.\ftn{It is + quite another task to implement those minimal tags, however.} + +An example? Undo the examples in the Example Formats chapter of \TB{} +of the markup, and insert your own markup, and you will know what I'm +talking about. +I hope you will come to the same conclusion as I did +\displaycenterline{ Knuth's markup is unsurpassed!} +I'll come back to the matter in the chapter `Text' and in the Appendix +`Formats,' especially with the letter format. + +\bluehead BLUe's format + +The format is a personalized system to format compuscripts. +It is a compatible extension of plain \TeX{} and +organized as a `kernel + modules,' +similar to the setup of FORTRANxx. +It is designed to be supportive, to suit your needs. +You are Ben Lee User. +It is not imposing.\ftn{I know of the defensive attitude of publishers. + They welcome the benefits of imposing formats to prevent + the use of macros which hinder production. + There is much truth in there, given the reality of the complex\Dash + or better, the unusual\Dash \TeX{} markup language. + However, there is no use in protecting an author + against himself. + Simple supporting tools should make the imposing attitude superfluous.} + +The concept of a BLUe script is at the heart. +\bluetex{} allows one or more scripts to be processed\ftn{Either in sequence + or nested. The former is handy when several contributions have to be run + in one job, for a journal for example. + The latter has been used in this script to switch temporarily + to \cs{letter}, casu quo \cs{transparencies}.} +in one run, even non-BLUe scripts. +As an example of the latter +\displaycenterline{Thank you. \cs{bye}} +runs with \bluetex. +This tolerance is handy while proofing parts. + +\blueexample BLUe script + +^^{BLUe\ script,\ template} +Generally, I use a template, an empty script as a fill-in form, +with the main markup tags already there.\ftn{The order does not matter + much for the elements before \cs{beginscript}. +% They can be supplied in any order. + Because of the short markup tags + the feature to let the computer prompt the |\end<tag>|, + once the |\begin<tag>| has been typed in, + is not so relevant. + The \cs{contents} can be used to provide a wired-in ToC, + to facilitate browsing of the script, + next to the dynamically generated one.} +\thisverbatim{\catcode`\~=14 + \catcode`\_=8 } +\begincenterverbatim +%Template BLUe script---outer level markup + %Preliminary part, with + %elements in arbitrary order +\issue{MAPS 94.2} +\title{BLUe's Format} +\subtitle{The best of both worlds} +\keywords{...} +\abstract{...} +\contents{Introduction + \se Why? %\se acronym for subelement + ... + Acknowledgements, Conclusion, References} +\references{~ +\!math!langle!,name_1!rangle!dots!endmath~ +\!math!langle!,name_n!rangle!endmath} +\pictures{~ +\!math!langle!,name_1!rangle!,pic!dots!endmath~ +\!math!langle!,name_n!rangle!,pic!endmath} +\acknowledgements{...} +\beginscript %Marked up copy proper comes next +\head{Introduction} + %Various parts with inner markup +... + %Ended by the following back matter +\pasteupacknowledgements +\pasteupreferences +\endscript +!endcenterverbatim +Once used to the template, the outer markup is a trifle. +Of course, in order to process the script it should be preceded by +\cs{input} {\tt \bluetex}. +On my Mac Classic II \bluetex{} is a format. +One could even think of a bluetex command similar to \LaTeX. +\exercise How to override the defaults for \cs{author} and the like? +\answer To override the defaults assign values to the token variables +\cs{author}, \cs{address}, \cs{netaddress}, and \cs{issue}. + +\exercise How can we process more scripts in one run? +\answer Provide |\everyscript{\notlastscript}| and precede the last + script by |\thisscript| |{| \cs{lastscript} |}|. This holds for scripts in + sequence. For nested scripts see this script file for + the examples of a letter and + a few transparencies run within this script. + +Default the look-and-feel in print resembles much \TUB's (two-column) layout. + +\thissubhead{\runintrue} +\bluesubhead The syntax + +^^{BLUe\ script,\ syntax}for a BLUe script reads +as follows.\ftn{I used the same + Backus-Naur formalism for the syntax diagrams, + as adopted by Knuth and explained in \TB{} {\oldstyle268}, + {\oldstyle269}.} + +\beginsyntax +<BLUe script>\is|\input|\thinspace \bluetex\thinspace<language><scripts> +<language>\is<default>\alt|\english|\alt|\russian|\ftn{In progress as % + spinoff of the translation effort. Default is English.}% + \alt|\<yourlanguage>| +<scripts>\is<script>\alt<script><scripts> +<script>\is<preliminary><scriptoptions>|\beginscript|<sections>% + <indexing>|\endscript| +\endsyntax +with refinements +\beginsyntax +<preliminary>\is<index><format>|\title|<infopart> +<index>\is<empty>\alt|\loadindexmacros| +<format>\is<empty>\alt|\concert|\alt|\letter|% + \alt|\report|\alt|\transparencies|\alt|\<yourformat>| +<infopart>\is<empty>\alt<infoelement><infopart> +<infoelement>\is|\subtitle|\alt|\issue|\alt|\input|\alt<TeXcode> + \alt|\author|\alt|\address|\alt|\netaddress|\ftn{Defaults.} + \alt|\keywords|\alt|\abstract|\alt|\contents|\alt|\references|\alt|\pictures| + \alt|\acknowledgements| +<scriptoptions>\is<empty>\alt|\everyscript|\alt|\thisscript|% + \alt|\everyscript||\thisscript| +\endsyntax +The sections consist of the tree of head +structures with IM copy, inner marked up copy proper. +\beginsyntax +<sections>\is<empty>\alt<section><sections>\ftn{To be repeated for subsections and subsubsections.} +<section>\is<head><paragraphs> +<head>\is|\head|\alt|\bluehead|\ftn{A minimal markup alias % + as a tribute to manmac.} +<paragraphs>\is<empty>\alt<paragraph><paragraphs> +<paragraph>\is<subsections>\alt<IM copy> +<indexing>\is<empty>\alt|\sortindex||\pasteupindex| +\endsyntax + +\bluesubhead Variants + +By a control sequence\Dash called an attribute in the SGML world\Dash +the format used can be changed, resulting in a different look-and-feel +in print. +For example, via \cs{onecolumn} within the default format. +This is meant for a script in total. +However, two-column and one-column scripts can be processed +in one run. + +The control sequence \cs{transparencies} changes the result +into a representation suited for copying on transparencies. +Adaptation of the script is mainly about deleting. + +Especially for PWT I designed the report format. +It is essentially one-column, and a mod on top of the default. +The control sequence \cs{report} yields the report layout. +The path `From-report-to-transparencies' +comes down to stripping off the superfluous. +See the Appendix `Formats' for details. + +I also included Knuth's letter format, \cs{letter},\ftn{Well, I updated + Knuth's approach a little, if I'm allowed to say so. Important is to + provide for mail merge and in general to let the format cooperate with + an address database. And of course I simplified the macros a little. + No different modes of text processing.} +and concert format, \cs{concert}. + +\bluesubhead Extras + +The Appendix `Tools' is mainly about the lower level extras. +It provides a method to organize all your macros. +It is not part of \bluetex, but can cooperate smoothly without overhead, +respecting the `little user,' i.e., the user with modest demands. + +It is also important to think of a garbage bin. Somewhere to keep +your obsolete stuff, macros or formats, in order that your scripts +can still be formatted without change in future. +For that purpose I introduced the obsolete.dat database. + +Finally, I coupled my address.dat database, that is letters can +find addresses in that database, similar to a bibliography +which will take the references from a bibliography database. + + +\bluehead The model + +^^{BLUe's\ format\ model} +BLUe's format is a personalized formatting system. It's yours! +It knows about your context. +It is based on ^{manmac}, ^{gkppic}, and the use of databases. +$$\qquad\qquad\bluemodelpic$$ +What does the model say? +One way of looking at it is to think of inner and outer worlds.\ftn{Knuth + had the outer-inner duality on his mind already, as can be deduced + from his \cs{outer} \cs{def}-s.} +The extras part reflects the outer world in general. +Your publisher and his tools, casu quo formats, and your colleagues +who provide macros for general use. +The BLUe's format part\Dash your inner world\Dash +divides the markup tags into two clusters, +supported by databases.\ftn{Database in this context means essentially + a multi-file file. Each tool or macro set is part of a file. + I prefer to have separate clusters for + formats, tools, references + pictures and addresses. + The global structure has been simplified. + What is needed will be loaded selectively. + The best of both worlds.} +These databases not only support the handling of +the usual collection of references. +It also provides the mechanism for elegantly storing pictures. +Even newer is using the database approach +to manipulate formats and tools. +We don't need all those separate files any longer. +This approach can also clean up the organization of +the multitude of font files, I presume. + +Another way of looking at the model is that +the model provides a structure for +keeping pace with change and progress. + +You have to do the work. +Polish what you have to say. +Mark up, as naturally as possible, +by using formatting goodies from the past like manmac and picmac. +I like minimal markup, that is +\displaycenterline{supprematism in markup} +in the spirit of Malevich's `White cross on a white background,' +let us say. + +Build up your collection of works relatively independently of +context.\ftn{This looks trivial but experience has it that early + \TUB{} articles, for example, can't be formatted without adaptation, + because the formats used are obsolete. + An intrinsic question is whether we should update + or republish old work. Up till now I have updated my works. + All my \AllTeX{} articles run with \bluetex. + When composing this work, I decided not to update + old works any longer. That is history from now on. + This work contains the improvements, if any \smiley.} +Communicate what you have lived through, and keep in touch with developments. + +When you are a self-publishing author, that is all there is. +If not, you have to obey the wishes of your institute or publisher, +meaning that outer-level issues have to be adapted. +Outer-level commands govern +the title part and the global page layout, +like headings of sections, +running headers and footers, +the font(s) used, +the number of columns, +the page size, +paragraph indentation and separation, +and the like. + +The aim of the inner level set of markup tags is to remain invariant, +with the purpose that these tags can be used in any context now and in future. + +The borderline between inner and outer markup +is context dependent, and therefore undefined. +I like to think in terms of overlapping clusters. +What you might call outer I might call inner, and vice versa, +not to mention your publisher's opinion. +A pragmatic description of the group of your outer commands are those +which you have to change when you submit your work to your publisher or +a second publisher. + +The wish to modify has been anticipated in BLUe's format. +For that purpose either control sequences, +which represent a different format, can be invoked, +or a handful of outer level markup commands, casu quo parameters, +can be customized. + +Also the open-endedness is there. +At the higher level the number of mappings from +BLUe's format into publisher formats can grow. +At the lower level you can add macros. +And what about the old stuff? +The old versions can be stored in the obsolete.dat database, +with the purpose that BLUe scripts can still be +formatted in future, without change.\ftn{Well, \dots\thinspace let us hope + little change.} +And if you have a database of your own, +just make the connection. + +Portability and reusability are served by writing macros in plain \TeX, +the lowest common and documented \TeX{} language of all the flavours. +The multitude of tools have been organized in a database +to load selectively from. + +The reusability of formats, tools, references, pictures, and addresses +has been eased by storing these in databases. +By this way I obeyed the ^{Samelson\ principle}, which comes down to +\displaycenterline{ Don't pay for what you don't use.} + +\bluehead Notations and definitions + +^{Acrobat} is Adobe's .pdf tool suite, which the consumer of scripts +can use independent from the preparation tool used, to browse +scripts, to add hyperlinks and so on. + +^{address.dat} is the address database to cooperate smoothly with \cs{letter}. + +^{\AmSTeX} denotes the \AllTeX{} system in use by the \AMS. + +^{ASCII} is an acronym for American Standard Code for Information Interchange. + +BLU is Knuth's nickname for Ben Lee User. I adopted his cousin BLUe.^^{BLU, BLUe} + +^{BLUe\ script} is an ASCII file with \TeX{} markup inserted, to be processed +by \bluetex. + +^{BLUe's\ format} is the collection of the formatting tools: + ^{blue.tex}{} file (the kernel), + and the databases fmt.dat, tools.dat, address.dat, + lit.dat, pic.dat (modules). + +\bluetex{} denotes the kernel format to typeset scripts. + +^{CTAN} is the acronym for Comprehensive \TeX{} Archive Network. The resource +of \AllTeX{} materials on the internet. It comprises various sites with their +contents automatically mirrored. + +Customization occurs a lot in this work. On the one hand it is explained what +to do, and on the other hand it is indicated how to customize the macros. + +^{DTP} an acronym for Desktop Publishing, an interactive approach orthogonal +to markup-oriented systems. + +^{EP} is an acronym for Electronic Publishing. + +^{fmt.dat} denotes the database of formats to be used along with \bluetex. + +^{gkppic} is the acronym for the macros used by Graham, Knuth and Pastashnik +to format `Concrete Mathematics.' + +^{HTML} is the acronym for HyperText Markup Language and facilitates clicking +through a fragmented script. + +^{IMHO} stands for In My Honest Opinion, usually with all respect. + +^{\LaTeX} is Lamport's system on top of \TeX{} to format articles, reports, +letters, books and so on. + +^{lit.dat} is the literature database to cooperate smoothly with \bluetex. + +^{manmac} stands for the macros used by Knuth to format \TB. + +^^{markup, automatic, descriptive, functional, inner, Knuth's, logical, minimal, + outer, recursive, structural, visual} +Markup stands for the insertion of instructions in a script. +There are various markup notions. +\item{}Automatic markup is used by me when the computer generates the markup. +\item{}Descriptive markup abstracts from concrete printers and emphasizes + the descriptional nature. Agreed a little vague \smiley. +\item{}Functional markup emphasizes the functional character of the elements. +\item{}Inner markup tags is the set of markup tags that remains invariant + when processing a script with another \TeX{} flavour. +\item{}Logical markup is all about the logics of the script. +\item{}Minimal markup stands for markup with as few as possible markup tags. +\item{}Outer markup tags is the set of markup tags which needs to be + customized when processing a script with another \TeX{} flavour. +\item{}Recursive markup is used by me especially when the markup is generated + by the computer by means of recursion. +\item{}Structural markup emphasizes the structure of the script. +\item{}Visual markup denotes the implicit markup by white space. +\smallbreak +I'm not claiming that these descriptions enjoy general acceptance; +no, it helps to indicate the various backgrounds and intentions, as I +have perceived them and hinted at in this script. +IMHO, there is a lot of overlap, and no generally accepted list of +definitions. + +^^{miniature} +Miniature is an initial of a chapter. Historically, a nice painting. +In compuscripts generally a character from a special font. + +^{NFSS} is the acronym for New Font Selection Scheme. Its purpose is to +describe the selection of fonts logically. A mapping of the {\oldstyle1} +dimensional space of fonts onto the logical {\oldstyle5} dimensional space +as introduced by NFSS, with dimensions +encoding scheme, family, series, shape, and size. + +^{OTR} acronym for OutpuT Routine. + +^{PDF} acronym for Adobe's Portable Document Format. + +^{pic.dat} is the picture database to cooperate smoothly with \bluetex. + +^|\PiCTeX| a system to format pictures with plain \TeX, due to Wichura. + +Parameterization denotes ways to parameterize a macro. + +^{\PS} denotes Adobe's\Dash de facto standard\Dash page description language. + +References are stored in lit.dat, which contain even the works I don't remember + explicitly but have built upon undoubtedly. + +Script is my term of a file with (\TeX) markup. + +Section is a document element, that is, + a head followed by paragraphs.\ftn{Analogous for \cs{subsection} + and \cs{subsubsection}.} + +^{SGML} Standardized Generalized Markup Language. The ISO standard activity + for markup, ISO{\oldstyle8879}. + +^^{sorting\ keys} +Sorting keys are pairs consisting of a control sequences and +the replacement for sorting the item in the index. + +Syntax for tags: +|\begin<tag>|, |\end<tag>|, |\<tag>|; +|\pre<tag>|, |\post<tag>| placement within context; +|\this<tag>|, |\every<tag>| handling of options + +^{tools.dat} is the database of tools to cooperate smoothly with \bluetex. + +^{WYSIWYG} What You See Is What You Get. +An interactive way of working via what is seen on the display. +It is at the heart of DTP systems, to counteract the +difference of what is seen on the screen and what will be printed on the paper, especially +with respect to the fonts. + +\bluehead Markup conventions adopted + +The preliminary pages are treated separately, don't take numbering, and have +a label in the margin. There are two ToCs. A static one at the beginning to facilitate +browsing the script file and the dynamically generated one at the end which takes page numbers. + +The chapter headings are set in a larger type. The title is used in +the headline (without number), +the list of examples, and +the table of contents. +The (hidden) number of the chapter has been used in +the exercises, +the table of contents, and +the list of examples. +Chapter headings and section headings are centered and +don't take a number. +The appendix headings have their number printed as a capital letter. + +Headings don't take a period. +Run-in text can be recognized from the context. + +Headlines have the title of the chapter left and the title of the report right. +They are both set in slanted type. + +\cs{parindent} has been set to {\oldstyle0}. +Because of this the footnote numbers hang out. +A \cs{generalindent} has been used. + +Exercises take a number, no further indication has been used. + +Examples are not numbered in the text, but labeled by the word +`Example' and take a label to characterize the example. +The label is reused in the list of examples, next to the hidden number. +Punctuation marks and footnote markers are used in such a way that the +footnote marker appears after the punctuation mark. (Except for question +marks and exclamations.) +Quotation closings come after that. + +Now and then an explicit \cs{newpage} has been inserted to prevent +underfull vbox messages. No floats have been used, in order not to +disturb the sequential ordering. + +\bluehead Copyrights BLUe's Format system + +The software +$$\def\data{blue.tex\rs + fmt.dat \rs + tools.dat} +\btable\data$$ +is shareware available from CTAN and NTG's 4All\TeX{} CD-ROM. +It is not allowed to make any profit on it. +A happy user is requested to send +US\$\thinspace{\oldstyle25} to the author. +However, people in financial disadvantaged countries can send an amount +according to the macindex, that is the amount in dollars equivalent +to {\oldstyle20} breads. +No check please, because of banking overhead. + +The contributors will be added to my address database, +with field \cs{registeredbluetrue}. +Russian users are relieved for the moment from +the shareware request, with respect to personal use. + +Auxiliary and personalized files are the databases +$$\def\data{address.dat\cs addresses \rs + lit.dat \cs references\rs + pic.dat \cs pictures.\hfill} +\btable\data$$ + +The main reason for asking shareware support is to +protect myself against too many request, and +to raise some funds to continue my \TeX{} and \MP{} work. + +The user's guide `Publishing with \TeX,' and the +accompanying articles are free for personal use, and can be +plucked from the CTAN\ftn{Directory: pub/archive/info/pwt/\dots} +or NTG's 4All\TeX{} CD-ROM. + + +{\def\copyright{March, {\oldstyle1995}} + \makesignature} + +\endinput diff --git a/info/laan/pwt/pwt.mat b/info/laan/pwt/pwt.mat new file mode 100644 index 0000000000..9ad24d59b5 --- /dev/null +++ b/info/laan/pwt/pwt.mat @@ -0,0 +1,1167 @@ +\input blue.tex +\loadindexmacros +\report +\font\grkop=cmr12 scaled\magstep3 +\bluechapter Mathematics + +\beginsummary +On top of plain \TeX{} \bluetex{} provides facilities for: +automatic numbering, +cross-referencing for formulas, +matrix icons, +multi-alignment points in eqalign, +primed summation symbols, +arrows for commutative diagrams, and +some special symbols. +Examples borrowed from literature are incfluded to illustrate +how \TeX{} can be used to mark up mathematics. +This anthology shows that many details have to be prescribed. +To give a math manuscript to a keyboarder without markup guidance +is doomed to yield mediocre results. +\endsummary + +\noindent^{Swanson} {\oldstyle1986} is a good source for what math should +look like in print. +Very nice is also `^{Mathematical Writing},' a report from +a Stanford Workshop organized by Knuth. +\TeX{} is already very rich for math markup, +because in his Preface to \TB{} Knuth states +\beginquote +\noindent\llap`\dots \TeX, a new typesetting system intended for the +creation of beautiful books\Dash and especially +for books that contain a lot of mathematics.' +\endquote + +\bluehead What's the problem, Doc? + +If we assume that mathematicians write math manuscripts +in the classical sense, then there is a problem when those mathematicians +wish to have their work formatted via computer-assisted +document-preparation tools like \TeX. +What has to be keyboarded looks much different from the manuscript. +Examples of this phenomenon are omni-present in this work. + +\blueexample Disparity math notation and markup notation + +\thisverbatim{\catcode`!=12 + \catcode`~=0 } +\begindemo +x=1+\left({y^2\over k+1} + \right)^{\!\!1/3} +~yields +$$x=1+\left({y^2\over k+1}\right)^ + {\!\!1/3}$$ +\enddemo +Because of this disparity, the problem is how to get a correct\ftn{Not + only in the sense that the \TeX{} formatter does not complain, + no, correct in the sense of complying with tradition of mathematical + typesetting.} +\TeX script, starting from a mathscript. +This is difficult\ftn{In the example at hand the keyboarder has to be + aware of \cs{over} and $/$ respectively, and when to use which. + Moreover, the correct size of the parentheses must be supplied, and + some kernings have to be inserted!} +due to the inherent complexity of math typesetting, and due to +the unusual nature of \TeX, if not because of the bewildering and +confusing flavours of \TeX-based products. +Even a fancy and friendly, {\smc wysiwyg} user-interface is not enough. +Optical scanners of math\Dash or systems which understand + spoken mathematics\Dash are still science fiction. + +\bluehead The extras + +\bluetex{} provides as extras to plain {\TeX} facilities for: +automatic numbering, +cross-referencing for (display) formulas, +macros for ^{matrix icons}, +an extension of ^|\eqalign| with respect to multi-alignment points, +primed summation symbols, +arrows for commutative diagrams, +^|\beginmathdemo| and |\endmathdemo| from manmac, and +poor man's ^{blackboard bold} and some other special symbols. +These extras are introduced via examples. + +\blueexample Automatic numbering and cross-referencing + +^^{formula,\ cross-referencing} +^^{formula,\ automatic numbering} +^^{formula,\ labeled} +This is a compatible extension. +For the markup of math ^{cross-referencing} insert +instead of plain's explicit (reference) number + +\bitem \noindent^|\ref|, for creation of the number, and + \thisverbatim{\emc}|\ref\<name>|, for attaching + a name to the automatically generated number, and +\bitem ^|\crsref||\<name>|, for cross-referencing. +\smallbreak + +\begindemo +%Automatic numbering +$$a+b\eqno\ref$$ +!yields +$$a+b\eqno\ref$$ +\enddemo + + +\begindemo +%Automatic numbering, and +%symbolic cross-referencing +$$c*d\eqno\ref\cgl$$ +Text, \crsref\cgl +!yields +$$c*d\eqno\ref\cgl$$ +Text, \crsref\cgl +\par\noindent +\enddemo +\exercise And what about forward referencing? +\answer This is not possible in a one-pass job. Therefore a note + is printed in the margin while proofing. The correct + number has to be filled in ultimately. + +%end answer +Handy token variables are ^|\prenum| +and ^|\postnum|.\ftn{Courtesy Michael Spivak.} +Their contents is inserted before, respectively +after, the automatically generated number in \cs{ref} and \cs{crsref}. +Because of this one can get labels and crossrefs like {\oldstyle13}a, +or enclosing numbers by parenthesis. +The latter are the defaults of these token variables. +If in such a case the formula counter must keep its value, provide +|\advancefalse|. +\exercise How can we retain the number, and suffix a letter, as + label of a formula to come? +\answer Provide \cs{advancefalse}, and |\postnum{a)}|. + +\blueexample Matrix icons + +Useful icons concern the matrices: +rectangular, via ^|\icmat|, +triangular (lower left and upper right), +via ^|\icllt| or ^|\icurt|, and +upper Hessenberg, via ^|\icuh|. +The arguments are dimensionless numbers. +The first argument reflects the vertical size, and +the second the horizontal size. +In case of \cs{icuh} the second argument is the Hessenberg bandwidth +and the third is the difference between the first and the second. + + +\begindemo +\unitlength1ex +$$\icmat44\kern\unitlength\icllt44= + \icllt44\icuh413\qquad + \hbox{AL}=\hbox{LH}$$ +!yields +\unitlength1ex +$$\icmat44\kern\unitlength\icllt44= + \icllt44\icuh413\qquad + \hbox{AL}=\hbox{LH}$$ +\enddemo + +\exercise Another matrix factorization reads +\begincenterverbatim +$$\icmat63=\icmat63\kern\unitlength + \icurt63\qquad\hbox{A}=\hbox{QR}$$ +!endcenterverbatim +When used together with the example above, +align on the =-signs, that is, on the =-sign in the icons and on the +=-sign in the formulas. +\answer Use \cs{eqalign} as follows. +\beginverbatim +$$\unitlength1ex + \eqalign{ + \icmat44\kern\unitlength\icllt44={}& + \icllt44\icuh413& + \qquad \hbox{AL${}={}$LH}\cr + \icmat63={}& + \icmat63\kern\unitlength\icurt63& + \qquad \hbox{\phantom{A}A${}={}$QR}} +$$ +!endverbatim + +\blueexample Compatible extension of eqalign % + with multiple alignment points + +^^|\eqalign| +\begindemo +$$\eqalign{ +\cos(z\sin\theta)={}& + J_0(z)& + {}+2\sum_{n=1}^\infty + J_{2n}(z)\cos2n\theta\cr + \sin(z\sin\theta)={}& + & + {}+2\sum_{n=1}^\infty +J_{2n+1}(z)\sin(2n+1)\theta\cr +}$$ +!yields +$$\eqalign{ +\cos(z\sin\theta)={}&J_0(z)& + {}+2\sum_{n=1}^\infty J_{2n}(z)\cos2n\theta\cr +\sin(z\sin\theta)={}& & + {}+2\sum_{n=1}^\infty +J_{2n+1}(z)\sin(2n+1)\theta\cr +}$$ +\enddemo +\exercise Why is the empty formula used in the markup? +\answer The empty formula $\{\}$ is used to coerce the + to behave + as a dyadic operator, and the = to behave similarly. + In other words to yield the correct spacing. + +\blueexample Macros for showing math markup and the result + +^|\beginmathdemo| (and variants) and |\endmathdemo|, +are used in the \TB{} script, {\oldstyle444}--{\oldstyle466}, +for indented display Math, see \TB{} chapters +{\oldstyle16}--{\oldstyle19}.\ftn{There + is only one second part macro for all these cases. + Its replacement text is modified into \cs{crcr}\cs{egroup}\$\$.} +^^|\begindemo|^^|\yields| +They are used to typeset the marked up copy and the +typeset result side-by-side. +The user does not have to bother about the template for the +alignment display used. +The functionality provided is similar, but a little restricted, +to the (\LaTeX) styles for switching from +one-column to two-column format and vice versa. +But, \dots\thinspace it is much simpler and more efficient\Dash +IMHO with all respect\Dash +because it does not entail OTR processing. + +\thisverbatim{\catcode`\|=12 } +\begindemo +%TeXbook 128 +\beginmathdemo + \it Input&\it Output\cr + \noalign{\vskip2pt} + |$x^2$|&x^2\cr +\endmathdemo +!yields +\beginmathdemo + \it Input&\it Output\cr + \noalign{\vskip2pt} + |$x^2$|&x^2\cr +\endmathdemo +\enddemo + +\thisverbatim{\catcode`\|=12 } +\begindemo +%TeXbook 139 +\begindisplaymathdemo + |$$x+y^2\over k+1$$|& + x+y^2\over k+1\cr + \noalign{\vskip2pt} + |$${x+y^2\over k}+1$$|& + {x+y^2\over k}+1\cr +\endmathdemo +!yields +\begindisplaymathdemo + |$$x+y^2\over k+1$$|& + x+y^2\over k+1\cr + \noalign{\vskip2pt} + |$${x+y^2\over k}+1$$|& + {x+y^2\over k}+1\cr + \noalign{\vskip-1pt} +\endmathdemo +\enddemo +Remark. Note that we have to supply the input and the output, +due the \TeX's rigidness of the category codes once assigned. + +\blueexample Poor man's blackboard bold and some special symbols + +^^{blackboard bold} +Now and then other symbols than those provided in the font tables +of Appendix~F of \TB{} are needed.\ftn{Generally, non-standard fonts are + already available somewhere. For math consult AMS.} +These can be constructed approximately. + +{\gutter4em +\def\boxit#1{\vbox{\hrule\hbox{\vrule + #1\vrule}\hrule}} +\begindemo +$$\halign{#\hfil\quad& + \hfil#\hfil\cr + natural numbers &$\IN$ \cr + integers &$\Z$ \cr + rational numbers &$\Q$ \cr + reel numbers &$\R$ \cr + and complex numbers&$\C$ \cr + next to\cr + greater or less &$\gtrless$\cr + external tensor product& + $\boxtimes$\cr}$$ +!yields +$$\def\IN{{\rm I\kern-.5ex N}} +\halign{#\hfil\quad&\hfil#\hfil\cr + natural numbers &$\IN$ \cr + integers &$\Z$ \cr + rational numbers &$\Q$ \cr + reel numbers &$\R$ \cr + and complex numbers&$\C$ \cr + next to\cr + greater or less &$\gtrless$\cr + external tensor product& + $\boxtimes$\cr}$$ +\enddemo} +\cs{IN}, \cs{Z}, et cetera are incorporated in \bluetex. +\exercise On the \TeX-NL network there was a request for the pro mille + token. How to get it? +\answer It is in the wasy font. A poor man's version is an open problem + as yet, because the lower 0 is neither 5pt, nor 6pt, and therefore + the symbol can't be built from \% and an appropriate sized 0. + A very, very poor man's version reads |\%\lower.2ex\hbox{\fiverm 0}|, + in fact unacceptible. + Building it from \cs{frac}, |\frac0/{00}|, is different from \%. + +\bluehead Use + +Many ingredients are supplied by plain. +It is just a matter of what-and-how, what to use from the wealth offered. +It has all to do with what the script should look like in print +{\em within the context}. +In the sequel some more math markup will be shown, not restricted to +markup tags from \bluetex{}. +A classical example is the markup for the various uses of O. + +Noteworthy is further that +punctuation symbols are also used with spacing before them, +ditto for the vertical bars and the backslash. +The size of delimiters is dependent on the context, +which can't be completely automated. +The variants can be obtained via special markup, for example via + +\bitem ^{coercion macro}s + (to guide \TeX{} with respect to spacing before and after, + for example via \cs{mathdelimiter}, + or to positioning of embellishments below and on top, + for example via \cs{mathop}) +\bitem the use of the ^{empty formula}, $\{\}$, + to coerce binary behaviour of the operator +\bitem macros to impose the size of delimiters + (\cs{biggl} et cetera) +\bitem special control sequences + (like \cs{colon}). +\smallbreak + +\bluesubhead Plain's display maths + +Most displays belong to one of the categories given below. + +\blueexample A labeled formula in display + +Spaces are neglected in math mode. ^^{formula,\ labeled} +The kern |\,| is needed to coerce the correct spacing. +\begindemo +$$\sin2x=2\sin x\,\cos x + \eqno({\rm TB186})$$ +!yields +$$\sin2x=2\sin x\,\cos x + \eqno({\rm TB186})$$ +\enddemo + +\blueexample Formula hyphenation; shifting of lines + +A hyphenated formula via \cs{displaylines}. ^^{formula,\ hyphenation} +With the use of \cs{hfill} we can shift lines to the +left or right. +\begindemo +$$\displaylines{F(z)= +a_0+{a_1\over z}+{a_2\over z^2} + +\cdots+{a_{n-1}\over z^{n-1}} + +R_n(z),\hfill\cr +\hfill n=0,1,2,\dots\,,\cr +F(z)\sim\sum_{n=0}^\infty + a_nz^{-n},\quad z\to\infty + \hfill\llap{(TB ex19.16)}}$$ +!yields +$$\displaylines{F(z)= +a_0+{a_1\over z}+{a_2\over z^2} + +\cdots+{a_{n-1}\over z^{n-1}} + +R_n(z),\hfill\cr +\hfill n=0,1,2,\dots\,,\cr +F(z)\sim\sum_{n=0}^\infty + a_nz^{-n},\quad z\to\infty + \hfill\llap{(TB ex19.16)}}$$ +\enddemo + +\blueexample Alignment and centered labeling + +\begindemo +$$\eqalign{\cos2x + &=2\cos^2x-1\cr + &=\cos^2x-\sin^2x} + \eqno({\rm TB193})$$ +!yields +$$\eqalign{\cos2x + &=2\cos^2x-1\cr + &=\cos^2x-\sin^2x} + \eqno({\rm TB193})$$ +\enddemo + +\blueexample Alignment and labels per line + +\begindemo +$$\eqalignno{\cosh2x + &=2\cosh^2x-1&({\rm TB192})\cr + &=\cosh^2x+\sinh^2x}$$ +!yields +$$\eqalignno{\cosh2x + &=2\cosh^2x-1&({\rm TB192})\cr + &=\cosh^2x+\sinh^2x}$$ +\enddemo + +Remark. %In not too narrow columns the last formulas + %are both centered. +If one wants \cs{eqalignno} to behave like +\cs{displaylines}\Dash that is, left-justified\Dash +then modify in \cs{eqalignno} the first +\cs{tabskip}=\cs{centering} assignation into +\cs{tabskip}= \cs{z@skip}. + +\blueexample Subscripts + +The depth of a ^{subscript} depends on whether there is +a superscript. With a superscript a subscript sinks a little. +In order to obtain uniformly placed subscripts +the solution is to adjust the following font dimension +parameters, see \TB{} {\oldstyle179}. +\begindemo +\fontdimen16\textfont2=2.7pt +\fontdimen17\textfont2=2.7pt +$$X_1+Y_1^2=1$$ +!yields +\fontdimen16\textfont2=2.7pt +\fontdimen17\textfont2=2.7pt +$$X_1+Y_1^2=1$$ +\enddemo + +\thissubhead{\runintrue} +\bluesubhead A snapshot of examples\par borrowed from \TB, +to illustrate the need for extra markup. +\TB{} chapters {\oldstyle16}\dash{\oldstyle19} contain many examples, +well-ordered and appropriately explained. + +\blueexample Dots and the comma after + +^^{dots and the comma after} +\begindemo +$${\bf S^{\rm-1}TS=dg}(\lambda_1, + \ldots\,,\lambda_n)=\bf\Lambda$$ +!yields +$${\bf S^{\rm-1}TS=dg}(\lambda_1, + \ldots\,,\lambda_n)=\bf\Lambda$$ +\enddemo + +\blueexample Summation with limits + +\begindemo +$$\sum_{k=1}^\infty{1\over2^k}=1$$ +!yields +$$\sum_{k=1}^\infty{1\over2^k}=1$$ +\enddemo +\exercise In line we usually have subscripts and superscripts. + How can we get those? +\answer Automatically! \TB{} 144: ` A displayed sum usually occurs + with `limits,' i.e., with subformulas that are to appear above + and below it. \dots\thinspace According to the normal conventions + of mathematical typesetting, \TeX{} will change this to + `$\sum_{k=1}^\infty{1\over2^k}=1$' (i.e., without limits) if it + occurs in text style rather than in displaystyle.' Explicit control + is possible via the control sequences \cs{limits}, respectively + \cs{nolimits}. + +%end answer + +\blueexample Overlining; accents + +If there is an example with various markup possibilities, this is the one, +although the various O-s comes close. ^^{overlining}^^{accents in math} +\begindemo +$$\bar z,\ \overline z,\ +\bar P,\ \overline P,\ +\bar h,\ \hbar,\ +\overline{AB}$$ +!yields +$$\bar z,\ \overline z,\ +\bar P,\ \overline P,\ +\bar h,\ \hbar,\ +\overline{AB}$$ +\enddemo + +\blueexample Square roots + +\begindemo +$$\sqrt{1+\sqrt{1+\sqrt{1+x}}}$$ +!yields +$$\sqrt{1+\sqrt{1+\sqrt{1+x}}}$$ +\enddemo + +\blueexample Roman texts in math, \TB~{\oldstyle163}; accents + +^^{roman texts in math} +\begindemo +$${f(x+\Delta x)-f(x)\over + \Delta x}\to f'(x)\quad + {\rm as}\quad\Delta x\to0$$ +!yields +$${f(x+\Delta x)-f(x)\over + \Delta x}\to f'(x)\quad + {\rm as}\quad\Delta x\to0$$ +\enddemo +Remark. \TeX{} uses special conventions for accents in formulas, so the +accents in ordinary text and the ^{accents in math} have different markup, +\TB~{\oldstyle135}. + + +\blueexample Kerning; positive and negative + +^^{kerning; positive and negative} +\thisverbatim{\catcode`\!=12 + \catcode`\~=0 } +\begindemo +$$ \int\!f(x)\,dx, \quad + \Gamma_{\!2}+\Delta^{\!2},\quad + \sum^\infty_{n=-\infty}\! + \!\!\cos nt$$ +~yields +$$ \int\!f(x)\,dx, \quad + \Gamma_{\!2}+\Delta^{\!2}, \quad +\sum^\infty_{n=-\infty}\!\!\!\cos nt$$ +\enddemo + +\blueexample Empty formula and subscripting + +^^{empty formula and subscripting} +\begindemo +(\lambda)_2\,{}_2F_1 +!yields +$$(\lambda)_2\,{}_2F_1$$ +\enddemo + +\blueexample Math operator + +^^{math\ operator} +\begindemo +$$\mathop{\hbox{\rm Res}}_ + {s=e^{i\pi}}f(s)=-e^{i\pi z}$$ +!yields +$$\mathop{\hbox{\rm Res}}_ + {s=e^{i\pi}}f(s)=-e^{i\pi z}$$ +\enddemo + +\blueexample Colon markup; punctuation vs.\ operator + +^^{colon markup} +\begindemo +$$f\colon A\to B,\quad \{x:x>5\}$$ +!yields +$$f\colon A\to B,\quad \{x:x>5\}$$ +\enddemo + +\blueexample Context-dependent size + +\begindemo +$$\bigl\!vrt\,\alpha(\sqrt + {\mathstrut a}+\sqrt + {\mathstrut b}\,)\, + \bigr\!vrt +\leq!vrt\alpha!vrt\, + \bigl\!vrt\sqrt + {\mathstrut a}+\sqrt + {\mathstrut b}\, + \bigr\!vrt$$ +!yields +$$\bigl\Vert\,\alpha(\sqrt{\mathstrut a}+ + \sqrt{\mathstrut b}\,)\,\bigr\Vert + \leq\vert\alpha\vert\, + \bigl\Vert\sqrt{\mathstrut a}+ + \sqrt{\mathstrut b}\,\bigr\Vert$$ +\enddemo +It is tempting to insert a multiplication dot. Don't! + +\blueexample Vertical bars, \TB{} {\oldstyle146}, {\oldstyle147}, + ex{\oldstyle18}.{\oldstyle21} + +\begindemo +$$\big\{\,x^3\bigm\vert h(x)\in + \{-1,0,+1\}\,\bigr\}$$ +!yields +$$\bigl\{\,x^3\,\bigm\vert\,h(x)\in + \{-1,0,+1\}\,\bigr\}$$ +\enddemo + +\blueexample Halves variety \TB{} ex{\oldstyle11}.{\oldstyle6}, ex{\oldstyle19}.{\oldstyle2} + +Essential is the use of \cs{textstyle}. +\begindemo +$$D^\lambda_0(z)= + 4a_\lambda\, z\,{}_2F_1(% + \textstyle + \lambda+{1\over2},{1\over2}; + {3\over2};z)$$ +%Typographer's 1/2 +Typographer's $\fracdek1/2$, +(recipes), which works better +than a mathematician's $1\over2$ +!yields +$$D^\lambda_0(z)= +4a_\lambda\, z\,{}_2F_1(\textstyle\lambda+{1\over2},{1\over2}; +{3\over2};z)$$ +Typographer's $\fracdek1/2$, +(recipes), which works better +than a mathematician's $1\over2$ +\enddemo + +\blueexample Under and overbraces + +Subtle use of fonts, and \cs{mathstrut} to enforce size. +For under and over parentheses see TTN 3.4. ^^{underbraces}^^{overbraces} +\begindemo +$$\{\underbrace{\overbrace + {\mathstrut a,\ldots,a}^ + {k\;a\mathchar`'\rm s}, + \overbrace{\mathstrut b,\ldots + ,b}^{l\;b\mathchar`'\rm s}} + _{k+l\rm\;elements}\}$$ +!yields +$$\{\underbrace{\overbrace{\mathstrut + a, \ldots,a}^{k\;a\mathchar`'\rm s}, + \overbrace{\mathstrut b,\ldots,b} + ^{l\;b\mathchar`'\rm s}} + _{k+l\rm\;elements}\}$$ +\enddemo + +\blueexample Diagonal dots, coercions, \TB{} ex{\oldstyle18}.{\oldstyle45} + +^^{diagonal dots} +\begindemo +$$2\uparrow\uparrow k + \mathrel{\mathop=^{\rm def}} + 2^{2^{2^{\cdot^{\cdot^ + {\cdot^2}}}}}\vbox + {\hbox{$\Big\}\scriptstyle k$} + \kern0pt}$$ +!yields +$$2\uparrow\uparrow k\mathrel{\mathop= + ^{\rm def}} + 2^{2^{2^{\cdot^{\cdot^{\cdot^2}}}}} + \vbox{\hbox{$\Big\}\scriptstyle k$} + \kern0pt}$$ +\enddemo + +\exercise What is the function of the \cs{kern}0pt? +\answer To set the curly brace on the baseline. + +\exercise Can the \cs{cdot} be replaced by just a period? +\answer It looks like it. Used within the picture environment + I stumbled on lack of scaling invariance for the latter case?!? + As far as I see it now the \cs{cdot} yields nicer result anyway. + Because of the explicit \cs{Big} the above markup is not + scaling invariant. + +\blueexample Undoing mathsurround space + +\begindemo +$2{\times}3$-matrix +!yields +\hfil$2{\times}3$-matrix +\enddemo + +\blueexample All those O-s + +\begindemo +$\emptyset$, (the empty set) +$f\circ g\colon + x\mapsto f\bigl(g(x)\bigr)$, + (composition), and + order symbols +$o(h^2)$, +$O(h^2)$. +!yields +\par $\emptyset$, {(the empty set)}, +\par $f\circ g\colon x\mapsto f\bigl(g(x)\bigr)$ +(composition), +\par and the order symbols $o(h^2)$ and $O(h^2)$ +\enddemo + +\blueexample Set difference vs.\ cosets + +^^{set difference}^^{cosets} +\begindemo +$A\setminus A=\emptyset, + \hbox{and the cosets of $G$ + by $H$:\ }G\backslash H$ +!yields +$A\setminus A=\emptyset, +\hbox{and the cosets of $G$ by $H$:\ } + G\backslash H$ +\enddemo + +\blueexample The Cardano solution to third-order equation + +\begindemo +%x^3+px=q, p,q\ge0 +$$\root3\of{\sqrt{p^3/27-q^2/4}+ + q/2}-\root3\of{\sqrt{p^3/27+ + q^2/4}-q/2}$$ +!yields +$$\root3\of{\sqrt{p^3/27-q^2/4}+q/2}- + \root3\of{\sqrt{p^3/27+q^2/4}-q/2}$$ +\enddemo + +\blueexample Derivatives + +The problem is the three dotted derivative, ^^{derivatives} +\TB~{\oldstyle136}. +\begindemo +$$\dot y\,\ddot y\, + \skew3\dot{\ddot y}\quad + y'\,y''\,y''' \quad +\partial_xy\,\partial_x^2y\, +\partial_x^3y$$ +!yields +$$\dot y\,\ddot y\, + \dot{\ddot y\kern2pt}\quad + y'\,y''\,y''' \quad +\partial_xy\,\partial_x^2y\, +\partial_x^3y$$ +\enddemo + +\blueexample Bessel equation + +^^{Bessel equation} +\begindemo +$$z^2w''+zw'+(z^2-\nu^2)w=0$$ +solutions: +$J_{\pm\nu}(z)$, +$Y_{\pm\nu}(z)$, +$H_\nu^{(1)}(z)$, +$H_\nu^{(2)}(z)$ +!yields +$$z^2w''+zw'+(z^2-\nu^2)w=0$$ +solutions: +$J_{\pm\nu}(z)$, +$Y_{\pm\nu}(z)$, +$H_\nu^{(1)}(z)$, +$H_\nu^{(2)}(z)$ +\enddemo + +\blueexample Primed summation symbols and split formula + +Subtle use of the prime and the right font. +Nice is the nested use of the coercions \cs{mathop} and +\cs{mathrel}. A minor detail is to preserve the dyadic +character of the + in the last term. \cs{acclap} is +incorporated in \bluetex. See \TB{} ex{\oldstyle18}.{\oldstyle44}. +\begindemo +$$\displaylines{ + \mathop{{\sum}\acclap'}_{k=0}^n + a_kT_k(x) + \mathrel{\mathop=^{\rm def}} + .5\kern1pt a_0+a_1 x+a_2T_2(x)+ + \cdots \hss\cr + \hfill{}+a_nT_n(x)}$$ +!yields +$$\displaylines{ + \mathop{{\sum}\acclap'}_{k=0}^n + a_kT_k(x)\mathrel{\mathop=^{\rm def}} + .5\kern1pt a_0+a_1 x+a_2T_2(x)+\cdots + \hss\cr + \hfill{}+a_nT_n(x)}$$ +\enddemo +\exercise How can we prevent the line distance from growing larger + than the regular value? +\answer Give the summation symbol depth 0. + +\blueexample Hypergeometric function + +^^{hypergeometric function} +Subtle subscripting, size of parentheses, and positioning of arguments. +\begindemo +$$M_n(z)={}_{n+1}F_n\Bigl({k+a_0, + \atop\phantom{kc_1}} + {k+a_1,\dots,k+a_n + \atop k+c_1,\dots,k+c_n};z\Bigr) +$$ +!yields +$$M_n(z)={}_{n+1}F_n\Bigl({k+a_0, + \atop\phantom{kc_1}} + {k+a_1,\dots,k+a_n + \atop k+c_1,\dots,k+c_n};z\Bigr) +$$ +\enddemo +\exercise Why has the \cs{phantom} argument |kc_1|? +\answer It could have been anything representative for the lower part. + With the k and the subscript in the \cs{phantom} we are sure + that the vertical positioning will be OK. + +%end answer +\blueexample From \TB{} {\oldstyle177}, (p)matrix as formula part. % + proclaim is used too + +\begindemo +\proclaim Definition. $x$ is called +an eigenvector with +eigenvalue $\lambda$ of the matrix +$$A=\pmatrix{ + a_{11}&a_{12}&\ldots&a_{1n}\cr + a_{21}&a_{22}&\ldots&a_{2n}\cr + \vdots&\vdots&\ddots&\vdots\cr + a_{n1}&a_{n2}&\ldots&a_{nn}\cr}$$ +if $Ax=\lambda x$. +\par +!yields +\proclaim Definition. $x$ is called +an eigenvector with +eigenvalue $\lambda$ +of the matrix +$$A=\pmatrix{ + a_{11}&a_{12}&\ldots&a_{1n}\cr + a_{21}&a_{22}&\ldots&a_{2n}\cr + \vdots&\vdots&\ddots&\vdots\cr + a_{n1}&a_{n2}&\ldots&a_{nn}\cr}$$ +if $Ax=\lambda x$. + +\enddemo%blank line is necessary + +\blueexample Split equation and context-sized delimiters + +\begindemo +From Swanson (1986, Section 3.3 + Math in Display) +Because it is a large formula +I used \displaylines. +For the integral we need \nolimits +to inactivate the default placement +of limits. +Furthermore, there is subtle use of +subscripting and delimiters of +varying sizes. +Finally the shifting of parts +has to handled corrrectly. +See the script for the details. +!yields +$$\displaylines{ + \int\nolimits_U\delta(I)\mu(I) + \leq{}\hfill\cr + \quad{}\sum_{{\cal D}} + \sum_{{\cal D}_{I'}} + \biggl[\int\nolimits_J + \alpha(J')\mu(J')-\alpha(J)\mu(J) + \hfill\cr + \hfill {}-\int\nolimits_J + [\{s(\alpha\eta)(J')\} + /\eta(J')]\mu(J')\biggr]\cr + \quad{}+\biggl[ + \sum_{{\cal D}} + \sum_{{\cal D}_{I'}} + |\alpha(J)-[\{s(\alpha\eta)(J)\} + /\eta(J)]|\mu(J)\biggr]\hfill\cr + \hfill + {}\times\biggl[ + \sum_{{\cal D}} + \sum_{{\cal D}_{I'}} + |\alpha(J)-[\{s(\alpha\eta)(J)\} + /\eta(J)]|\eta(J)\biggr] \cr} $$ +\enddemo + +\blueexample Rhombus scheme + +^^{rhombus\ scheme} +\begindemo +The idea is to align vertically. +Pseudo markup reads +\setbox\ru={</ line>} +\setbox\rl={<\ line>} +$$\halign{<template>\cr +1st & &e...\cr + &\ru& &\rl& \cr +q...& & & &q...\cr + &\rl& &\ru& \cr + & &e...&\omit... + \hidewidth\cr}$$ +For the details consult the script. +!yields +{\hfuzz=30pt +\newbox\ru % +\newbox\rl % +\setbox\ru=\hbox{\unitlength=1ex + \xdim{4}\ydim{2} + \beginpicture + \put(0,0){\line(2,1){4}} + \endpicture} +%\diagline . 4ex wd +2ex ht\relax}% +\setbox\rl=\hbox{\unitlength=1ex + \xdim{4}\ydim{2} + \beginpicture + \put(0,2){\line(2,-1){4}} + \endpicture} +%\diagline . 4ex wd -2ex ht\relax}% +$$\quad\vbox{\offinterlineskip +\halign to\displaywidth +{\tabskip=0pt \hfil$#$%left element +&\hfil$\vcenter{#}$\hfil%left lines +&\hfil$#$\hfil %middle elements +&\hfil$\vcenter{#}$\hfil%right lines +&$#$\hfil %right elements +\tabskip=\centering\cr %end template +1^{st}\/{\rm RS}\hfill + & &e^{(s)}_k&& \cr +&\copy\ru& &\copy\rl& \cr +q^{(s+1)}_k&&&&q^{(s)}_{k+1}\cr +&\copy\rl& &\copy\ru& \cr +& &e^{(s+1)}_k + &\omit$={q^{(s)}_{k+1}\over q^{(s ++1)}_k}\,e^{(s)}_k$\hfil\hidewidth\cr +\noalign{\vskip1ex} +2^{nd}\/{\rm RS}\hfill + & &q^{(s)}_k&& \cr +&\copy\ru& &\copy\rl& \cr +e^{(s+1)}_{k+1}&&&&e^{(s)}_k\cr +&\copy\rl& &\copy\ru& \cr +& &q^{(s+1)}_k + &\omit$=q^{(s)}_k+(e^{(s)}_k- + e^{(s+1)}_{k+1})$\hfil\hidewidth + \cr}%end halign +}% end vbox element +$$} +\enddemo + +\blueexample Commutative diagram, confer \TB{} ex{\oldstyle18}.{\oldstyle46} + +Nice use of two-sided \cs{hidewidth}, ^^{commutative diagram} +and the subtle \cs{strut} to place the superscript of {$\cal F$}. +There is no strict alignment. The elements at the nodes overflow +into the space of the arrows. As a consequence we need arrows of +various lengths. +\begindemo +\let\normalbaselines + \adaptedbaselines +$$\matrix{ + f&\lmapright\otimes&a_f\cr + \mapdown{{\cal F}}&&\mapup{% + {\cal F}\strut^{-}}\cr + \hidewidth{\cal F}(f)\hidewidth + &\mapright\times\hfil& + \hidewidth\bigl({\cal F}(f) + \bigr)^2\hidewidth\cr}$$ +!yields +\let\normalbaselines\adaptedbaselines +$$%Diagram +\matrix{f&\lmapright\otimes&a_f\cr + \mapdown{{\cal F}}&&\mapup{% + {\cal F}\strut^{-}}\cr + \hidewidth{\cal F}(f)\hidewidth + &\mapright\times\hfil& + \hidewidth\bigl({\cal F}(f) + \bigr)^2\hidewidth\cr}$$ +\enddemo + +\blueexample Partitioning + +^^{partitioning} +\begindemo +$$\def\data{$I_{n-r}$\cs 0 \rs + 0\cs $I-2v_rv_r^T$} +P_r=\left(\vcenter{\ruled + \btable\data}\right)$$ +!yields +$$\def\lft{\hfil$}\def\rgt{$\hfil} +\def\data{I_{n-r}\cs 0 \rs + 0\cs I-2v_rv_r^T} +P_r=\left(\vcenter{\ruled + \btable\data}\right)$$ +\enddemo +\exercise How can we avoid \$-s in the markup of the data? +\answer Define \cs{lft} and \cs{rgt} equal to \$ with + \cs{hfil} added left, respectively right, for centering. + +\exercise How can we construct partitioned matrices in general? +\answer Make use of nested tables. Consider the partitioned matrix, + a \cs{ruled}\cs{btable}, to be built from blocks + with each block a non-ruled matrix. + +%end answer + +\blueexample Continued fractions with alignment on =, and interruption + +^^{continued fraction} +\begindemo +Many details come together in +this markup. Not in the least +the alignment on = where one is +an =-def. Also the space +saving variants, borrowed from +literature are relevant. +The special `\over'-line is a +poor man's use of \atop and +\over, because \over is a +primitive. +Peruse the script. +!yields +\def\cfsym{\mathop{\grkop \Phi}} +$$\eqalignno{ +1+\cfsym_{k=1}^n{a_k\over b_k} +&{}\buildrel{\rm def}\over= + 1+{a_1\over\displaystyle b_1+ + {\strut a_2\over\strut + \vrule height3ex width0pt\relax + \displaystyle b_2 + + \lower2.0ex\hbox{$\ddots\, + \lower1.25ex\hbox{$+ + {\displaystyle a_{n-1}\over + \displaystyle b_{n-1}+ + {\strut a_n\over + \displaystyle b_n}}$} + $} + } + }\cr +\noalign{%\noindent %not necessary +with (space saving) + variant notations} +&{}\buildrel{\rm\phantom{def}}\over= +1+\cf{a_1}{b_1}+\cf{a_2}{b_2}+\cdots+\cf{a_n}{b_n}\cr +% +&{}\buildrel{\rm\phantom{def}}\over= +1+ +{a_1\over\textstyle\strut + \vrule height2.5ex width0pt + b_1\,+\,} +{a_2\over\textstyle\strut + \vrule height2.5ex width0pt + b_2\,+\,} + \cdots +{a_n\over\textstyle\strut + \vrule height2.5ex width0pt + b_n} +\cr}%end\eqalignno +$$ +\enddemo +\exercise How can we replace the division line by $\cf{}{}$ \ ? +\answer This is an open problem. If you have an elegant solution, + let me know. + +%end answer +\blueexample Context sensitivity + +Certain accents can grow a little with what has to be accented, \TB~{\oldstyle136}. +^^{context sensitivity}^^{accents in math} +\begindemo +$$\widehat{xy}, + \widetilde{xyz}$$ +!yields +$$\widehat{xy}, + \widetilde{xyz}$$ +\enddemo + +\blueexample Matrix equation + +^^{matrix equation} +\begindemo +$$\displaylines{\indent +\bordermatrix{ + & &\rm A & \cr + &\times&\times&\times\cr + &\times&\times&\times\cr + &\times&\times&\times} +\bordermatrix{ + & &\rm N & \cr + &1& & \cr + &0&1 & \cr + &0&\times&1} +\hfill\cr\hfill= +\bordermatrix{& &\rm N & \cr + &1& & \cr + &0&1 & \cr + &0&\times&1} +\bordermatrix{ + & &\rm H & \cr + &\times&\times&\times\cr + &\times&\times&\times\cr + &0 &\times&\times} +}$$ +!yields +$$\displaylines{\indent +\bordermatrix{& &\rm A & \cr + &\times&\times&\times\cr + &\times&\times&\times\cr + &\times&\times&\times\cr} +\bordermatrix{& &\rm N & \cr + &1& & \cr + &0&1 & \cr + &0&\times&1\cr}\hfill\cr +\hfill= +\bordermatrix{& &\rm N & \cr + &1& & \cr + &0&1 & \cr + &0&\times&1\cr} +\bordermatrix{& &\rm H & \cr + &\times&\times&\times\cr + &\times&\times&\times\cr + &0 &\times&\times\cr} +}$$ +\enddemo + + +\blueexample Braces and matrices + +^^{braces and matrices} +\begindemo +This is a complex problem, with a lot +of fine-tuning. However, it is +possible to systemize much. +The approach is to look at it as +a bordered table with a +parenthesized matrix as data. +The handling of the row stub and +the header are separated from +the data (the pmatrix). +The pseudo code reads as follows. +\setbox1=\hbox{$\pmatrix{<data>}$} +Define header and row stub list, and +switch off defaults of btable, +especially the separators. +Finally invoke +$$\btable{$\vcenter{\copy1}$}$$. +Alignment left braces courtesy +Alan Jeffrey communicated by +J\"org Knappen. +For the details see the script. +!yields +\def\fatlbrace{\delimiter"4000338 } +%Set the block +\setbox1=\hbox{$\pmatrix{% +\times&\times&\times&\times&\times&\times&\times\cr +0 &\times&\times&\times&\times&\times&\times\cr +0 &0 &\times&\times&\times&\times&\times\cr +0 &0 &0 &\times&\times&\times&\times\cr +0 &0 &0 &0 &\times&\times&\times\cr +0 &0 &0 &0 &\times&\times&\times\cr +0 &0 &0 &0 &\times&\times&\times}$} +%Define header and row stub list (each one element) +\def\header{\hbox to\wd1{\hfil +$\overbrace{\vrule height0pt width.4\wd1 depth0pt}^p$\hfil +$\overbrace{\vrule height0pt width.3\wd1 depth0pt}^{n-p}$\hfil}} +\tvsize=\ht1\advance\tvsize\dp1 +\def\rowstblst{{$\vcenter to\tvsize{\vss + \hbox{${\scriptstyle\phantom{n{-}}p} + \left\fatlbrace\vrule height.55\ht1 width0pt depth 0pt\right.$}\vss + \hbox{${\scriptstyle n{-}p} + \left\fatlbrace\vrule height.15\ht1 width0pt depth 0pt\right.$}\vss}$}} +% +\def\data{$\vcenter{\copy1}$} +%Switch off defaults in btable +\let\rowstbsep\relax%kind of row stub separator +\let\headersep\relax%kind of header separator +\let\colsepsurround\relax%space around column separator +\def\hs{\cr\nxtrs}%function of header separator: yield next row stub +$$\vcenter{\btable\data}$$ +\enddemo + +\exercise Add partitioning to the braces and matrices example. +\answer In pic.dat a trial-and-error solution is included. + Not elegant. Improve, enjoy, and let me know! + +\endinput +\bye
\ No newline at end of file diff --git a/info/laan/pwt/pwt.obs b/info/laan/pwt/pwt.obs new file mode 100644 index 0000000000..a8cd565fc9 --- /dev/null +++ b/info/laan/pwt/pwt.obs @@ -0,0 +1,5 @@ +\report +\bluechapter Obsolete Database + +To be filled in. +\endinput
\ No newline at end of file diff --git a/info/laan/pwt/pwt.ref b/info/laan/pwt/pwt.ref new file mode 100644 index 0000000000..bbc786cc66 --- /dev/null +++ b/info/laan/pwt/pwt.ref @@ -0,0 +1,292 @@ +\input blue.tex +\loadindexmacros +\report +\bluechapter Coping with References + +\beginsummary +\bluetex{} makes use of the database of references +lit.dat. The references have to be specified by name. +Prior to the formatting of the script the specified +references are set and kept in a box. +This box is pasted up on command. +The layout of the references has been inspired upon AMS +and can be customized at a lower level. +\endsummary + +Most if not all of your references should be part of your\ftn{And + hopefully of your publisher as well.} +database of literature. +This starting point makes things simpler and definitely +facilitates reuse. + +\bluetex{} makes use of lit.dat, a database of references, +organized as a list. ^^{database,\ lit.dat} +The names of the list elements\Dash primary keys in database jargon\Dash +identify the entries. +Each list entry consists of a +list element tag, +a name, and the +(marked up) bibliography item proper. +The structure of the marked up of the bibliography item proper is modest and +prompted by my use: + author name, year of publication, and + rest part, +next to some adopted conventions. +In the field I'm working I know the publication by heart, once +I know the name of the author(s) and the year of publication. +For my own use I don't need further tagging. + +\bluehead Using references + +With \bluetex{} the use comes down to specifying the names of +the references in the preliminary part of the script, via +^^|\beginreferences|%^^|\endreferences|^^|\references| +\begincenterblock +\cs{beginreferences} +$\cs{}\langle\,name_1\rangle\dots% + \cs{}\langle\,name_n\rangle\qquad% + \hbox{or}\qquad% + \cs{references}\{\cs{}\langle\,name_1\rangle\dots% + \cs{}\langle\,name_n\rangle\}$ +\cs{endreferences} +\endcenterblock +and paste up the references via ^|\pasteupreferences|, +at your place of choice. +\exercise What is the effect of |\references{}|? +\answer Via this empty specification we can typeset what has + been supplied in \cs{thisreferences}. Agreed, a little + unusual. + +Placement within context can be handled via +the token variables ^|\prereferences| and ^|\postreferences|. +Default \cs{prereferences} takes care of the heading via +\displaycenterline{|\prereferences{\head{\the\referencesname}}|.} +The token variables ^|\thisreferences| and ^|\everyreferences| +can be used for customization. + +\thissubhead{\runintrue} +\bluesubhead Cross-referencing\par can always be done via the +convention of |<author name(s)>| |<year>|. ^^{cross-referencing} +This approach facilitates reading, +at least for me, at the expense of a little more space in print +than the system of numbers. +The latter system is possible with \bluetex. +Once the references have been set by \cs{references}, +each name is redefined by its sequence number. + +After +$\cs{references}\{\dots\cs{}\langle\,name_n\rangle\dots\}$ +then +$\cs{}\langle\,name_n\rangle$ +denotes the number |<n>|. + +\thissubhead{\runintrue} +\bluesubhead Robustness\par is there too. +Most likely users will now and then mistype +a name supplied in \cs{references}. +\bluetex{} reacts very elegantly to this. +First, it continues, it does not stop. +A message is provided in the log file, and as reference +an error message is printed by |\pasteupreferences|. + +\bluehead Adding a reference to the database lit.dat + +^^{add\ a\ reference} +The structure of the bibliography items in lit.dat is modest, +a list of elements and each element starting with the list +element tag, \cs{lst}, and a name. ^^{entry\ for\ lit.dat} +\begincenterverbatim +\lst\<name><extension> +{<name part> (<date part>): + <title part> + <rest> +} +!endcenterverbatim +This syntax leaves freedom and flexibility, although +the essentials\Dash name, date, title\ftn{I consider it + important to delineate the main fields, however.} +\Dash have prescribed positions. +The number of authors does not matter, +nor is it prescribed how the author names should be specified. +That is up to you. +The representation of the date is free too, +leaving room for things like `in progress' or `priv. comm.' +I don't like to prescribe structurally the title in more detail. +The rest part is not further prescribed either, +because of the great variety of sources---publishers, books, journal series, +proceedings, theses, technical reports, and the like. +At the end of the rest part I added, within parentheses, +annotations, now and then.\ftn{There is + usually too much formatting in a bibliography for my taste. + Why discriminate between a title of a book and an article? + Given the context that is clear enough. + Especially, when for a book the ISBN (or ISSN) number is provided. + And why so much (superfluous) punctuation? + For me there should be as little punctuation as is + functionally needed to separate the elements within the entry.} + +For the name I chose to use lowercase letters only: +the (first) name followed by the initials. +For the |<extension>| I chose extra letter(s). +The latter are there to tell the difference between more than one publication +per author, and to allow insertions, when one stumbles on some +early work of an author. As an example of an entry, I'm pleased to +take \TB.\ftn{In practice I hardly use this one, because in + \cs{prereferences} I supply the note + `I assume \TB{} to be omni-present.'} + +\blueexample lit.dat entry + +\begincenterverbatim +\lst\knuthded +{Knuth D.E (1984): + \TB. + \AW. ISBN 0-201-13448-9. + \annotation{Soft cover edition + of book A in the series + Computers and Typesetting.} +} +!endcenterverbatim +The list of references is ordered alphabetically on +|<name><extension>|. Prepare your bibliography and insert the +items in your personalized version of lit.dat, and that is it. + +\exercise How can we format the complete lit.dat database, with + each entry preceded with numbers enclosed in square brackets? +\answer Recognize that the file consists of triples. +BLUe's format provides \cs{setdatabase} for this purpose. +That macros comes down to the following. +\beginverbatim +\input blue.tex \onecol +\prenum{[\thinspace}\postnum{\thinspace]} +\def\lst#1{\nitem} +\input lit.dat +\smallbreak +\bye +!endverbatim +An older fifo-oriented solution reads as follows. +\beginverbatim +\newcount\bcnt +\def\prt{\medskip\noindent\advance\bcnt1 + \llap{[\number\bcnt]\quad}} +\def\fifo#1#2#3{\ifx#1\ofif\ofif\fi +\prt#3\fifo} +%a blank line +\fifo\lst\<name1>{...} + \lst\<name2>{...} + ... + \lst\<namen>{...} +\ofif\relax\relax +\bye +!endverbatim +Note the difference. + +^^{list\ of\ database} +\exercise How can we get a list of names of the references in the database? +\answer \bluetex{} contains a macro \cs{contentsdatabase} + that writes the list of names of + a lit, pic, or address database to the file contentslit, + contentspic, or contentsaddress.\\ +Let us assume that we wish the list of names in a toks +variable \cs{namelst}. To facilitate processing of \cs{namelst} +\cs{lst} has been inserted before each name in the list. +\beginverbatim +\newtoks\namelst +\def\lst#1#2{\namelst\ea{\the\namelst\lst#1}} +\input lit.dat +%and to verify the contents +\baselineskip12pt plus2pt minus1pt +\lineskip1pt plus 1pt minus1pt +\def\lst#1{{\tt\string#1}\endgraf} +\the\namelst +!endverbatim + +\exercise When a reference has been added to lit.dat a simple check + for verifying that the file can still be processed is + the following. What would you expect as outcome? + +\begincenterverbatim +\input blue.tex +\references\zusek +\zusek +\bye +!endcenterverbatim +\answer The number 1. Once the reference has been found, + it will be used, and the name will be + overwritten by its sequence number. + +%end answer + +\bluesubhead Check for data integrity + +After a reference has been added one can check whether the file can be scanned by +\TeX{} via making a table of contents as follows. +\begincenterverbatim +\input blue.tex +\contentsdatabase{lit} +\bye +!endcenterverbatim +This script produces no pages of output (that is OK). +The file contentslit will be created, though. +If you have a file with references of your own, +say abc.dat, provide also \cs{newwrite} \cs{tocabc}. + +\bluehead Customization + +Each entry is typeset by \cs{ls} which is activated by ^|\lsams| +in \cs{references}. +The default formatting has been inspired upon AMS. + +\bluesubhead How to provide your way of formatting? + +To illustrate how a user can specify his own convention +\bluetex{} contains the template +\begincenterverbatim +\def\lsstraight{\let\ls\nitem} +!endcenterverbatim + +\blueexample Formatting references your way + +Provide your variant of \cs{lsstraight} and supply +^^{formatting\ references} +\begincenterverbatim +\thisreferences{\let\lsams\lsstraight}. +!endcenterverbatim + +\bluehead Searching the lit.dat database by pattern + +^^{search\ of\ database} +BLUe's format provides a \cs{search} macro with +as argument a search pattern. +The purpose is to search the database file provided in +the toks variable \cs{searchfile}, +for this search pattern. +The result of the search is the list of names of which +the replacement texts contain the search pattern. +This list of names is delivered in the toks var \cs{namelist}, +and for the time being they are also written to the log file. + +\blueexample Search for references of {\oldstyle1973} in lit.dat + +In order to justify my use of the word +database in relation to \TeX, I provided the search macro +to browse the databases lit.dat and address.dat. +Below the input and result have been given of the search of lit.dat +for the pattern {\oldstyle1973}. +The result is contained in the toks variable +\cs{namelst}. The names are also written to the log file +to give you a check for whether the right names have been selected. + +\begindemo +\input blue.tex +\searchfile{lit} +\search{1973} +\bye +!yields +\cs{lst}\cs{knuthdec} +\cs{lst}\cs{schumacherefa} +\cs{lst}\cs{wirthna} +\enddemo +Remarks. A search pattern should not contain a period. + The search is case sensitive. +\endinput diff --git a/info/laan/pwt/pwt.scr b/info/laan/pwt/pwt.scr new file mode 100644 index 0000000000..54c6366648 --- /dev/null +++ b/info/laan/pwt/pwt.scr @@ -0,0 +1,452 @@ +%Copyright: C.G. van der Laan, cgl@rc.service.rug.nl, 31 59462 1525 +%Started 22 November, 1994 %Version September 1995 +\input blue.tex +%Conventions +%-Titles of other work (also references by name to chapters) within single quotes +%Spelling +%-alphabetically or lexicographically +%-appendices, contrast with prefixes, suffixes, affixes +%-ascertain +%-BLUe's format, BLUe script, blue.tex +%-cross-referencing +%-controlled (l always doubles) +%-developed +%-flavour, favour +%-file name, not filename, similar type name +%-govern +%-macro writing +%-mark up (verb), the markup (noun) +%-occasionally +%-one pass and one-pass job (similar two-part macro; in line in-line text +% on line on-line documentation) +%-open-ended, open-endedness +%-page number, page size +%-parenthesize +%-rhombus-framed, similar pseudo-code +%-setup (similar to markup (noun)) +%-shortcut +%-size-switching macros (not size switching) +%-user's guide (not user guide, nor users' guide) +%-user-friendly +%-uppercase letters (similar lowercase), upperright corner +%-word processor + +\loadsmileys%Not necessary per se, but now these are globally available +\loadindexmacros +\report %Format to be selected from the fmt.dat database + +\bluetitle Publishing with \TeX %Cover data + +\bluesubtitle BLUe's Selection + +\bluepictures \bluemodelpic + +\def\coverpic{\qquad\qquad\bluemodelpic} +%\translator{Irina Gorbunova} + + %Inside cover data +\bluekeywords Bibliography, \bluetex{}, + citations, compatible extension, cross-referencing, customization, + databases, data integrity, education, fractals, + index, letter, manmac, mark up, math, minmal markup, pictures, no-nonsense, + plain \TeX, programs, publishing, + report, reuseable software parts, + software engineering, supprematism, + tables, table of contents, table of examples, transparencies, trees, turtle graphics, + verbatim. + +%endkeywords + +\bibliographydata{ISBN: \dots\par + Classification: \dots\par + Date: September {\oldstyle1995} +}%end bibliography data + +\beginacknowledgements +First of all + $$\hbox{Don Knuth, Thank You!}$$ +for what you gave to the world, and to me in particular. +I enjoyed so much studying your \TeX{} works. +I never perused a book so many times as \TB. + +I owe many thanks to numerous anonymous people +who contributed to my \AllTeX{} knowledge. +I'm very grateful to NTG for bringing out early notes in MAPS, +and to Erik Frambach and Wietse Dol for disseminating +BLUe's Format system on the 4All\TeX{} CD-ROM. +With pleasure I look back at Bacho\TeX{} {\oldstyle 94}, where among +others Bogus\l aw Jackowski stimulated me to work on a manmac user's guide. +This emerged in BLUe's Format system and fitted well with my ideas about +a `Publishing with you-name-it' series. + +The macros and styles of the \TUG, and the \AMS{} have been very inspiring. +Of the former I borrowed the abbreviations and the approach of the OTR. +The latter inspired me how to format references. +I'm not aware to what extent the excellent user and installation guides of +the AMS have influenced me. I like those for sure. +Amy Hendrickson made me familiar with two-part macros. +Amy's \cs{diagline} macro is part of \bluetex, although +it is not much used by other macros, because of \LaTeX's line fonts. +David Salomon's courseware has been a wealthy source, especially for +macro writing. +Phil Taylor familiarized me with sequences of \cs{expandafter}s. +His \cs{ignorewhitespace} has been incorporated in \bluetex. +Bernd Raichle mentioned en-passant how to look at triples of \cs{noexpand}s. +Joseph Romanovsky stressed the importance of memory management, which resulted +in the general database approach. +Frans Goddijn made me appreciate the frisky \cs{oldstyle} numbers. +My perception of compuscripts has its roots in the SGML world. +And, of course, I learned a lot from \LaTeX. + +Frank Poppe, Eric Veldhuyzen, and Jos Winnink, thank you +for proofreading and for the useful comments. +Peter Frambach polished my use of English.\ftn{Any abuses left have to do + with later versions he did not see.} +Erik Frambach, again, was of great help in the proofing phase. +Many a suggestion with respect to the layout was prompted by him. +Irina Gorbunova%\the\translator +, my host when attending CyrTUG {\oldstyle93}, {\oldstyle94}, +translated the script into Russian. + +Last but not least thank you Ina Kooi for your friendship, support +and patience. +\medskip +\rightline{\vbox{\noindent\hsize.4\hsize I'm grateful to all of you.}} +\endacknowledgements + + %Title page data (next to title&author) +\beginabstract +The use of BLUe's format has been documented in a user's guide, +to be released electronically in English and in Russian. +\par +The functionalities provided are similar to those of \LaTeX, to mark up +a note, an article, a set of transparencies, a report, and a letter. +The attitude is much different though. An example of the +latter is processing of a modest index in one pass, +completely within \TeX, on-the-fly. +\par +The concept of two clusters of markup tags is introduced, +called the outer level markup tags and the inner level markup tags. +The former are responsible for the look-and-feel, +and are kept to a minimum to cope with the inevitable change. +The latter constitute the lower level issues, and are aimed at stability, +invariance of representation and implementation, much in the spirit of +the frozen kernel of \TeX. +\par +Many examples, exercises and answers have been included. +\par +The basic attitude has been to make \TeX{} +simpler to use, to let it look less confusing. +To select from the multitude of commands a handful, and to +elucidate what we need most of the time. +\par +New details treated are: +the script concept, +the separation of outer and inner level markup, +using databases\Dash + formats, tools, references, pictures, and addresses\Dash +in a one-pass job with \TeX, +macros to format Pascal programs, +a verbatim suite of macros to cooperate with Any\TeX, +selective line-numbering of verbatims, +a compatible extension of math cross-referencing, +some matrix icons, +a compatible extension of \cs{equalign} with multi-alignment points, +a simple approach to formatting of partitioned matrices, +a refined bordered table macro with the awareness of logical +rows and columns and attributes to control layout, +various codings of deterministic tables, +a new look at manmac's \cs{samplebox}, +creation of a modest index in one pass, +design of a report format on top of \bluetex, and +last but not least +a uniform coding approach to start from two-part macros and +to build one-part macros on top of those, parameterized +by |\this<tag>|, |\every<tag>|, |\pre<tag>|, |\post<tag>|, and +occasionally |\<tag>name|. + +I have built upon manmac and gkppic, and developed most of the macros myself. +Ideas have been borrowed from the styles of TUG, AMS, from the +proceedings of the Euro\TeX{} and TUG meetings, +and from the articles in the bulletins of the various user groups. +Of course, many an idea came to mind when talking to friends at the various +\TeX{} User Group meetings. +The markup of examples released earlier has been improved, simplified, +or made more consistent. +\endabstract + %Foreword translator data +\beginforewordtranslator + +This guide is about BLUe's Format, aimed at +formatting documents in English via plain \TeX. +\medskip +What do we mean by a translation? +\medskip +For the time being it is just a translation of the +English into Russian, {\sl not\/} a transliteration +of the contents. +The latter entails that an index in Russian +is {\sl not\/} generated on the fly. +Another consequence is that this guide +is {\sl not\/} about the use of Cyr\TeX. +\medskip +Hopefully, the future will give birth to a real +Russian BLUe's Format project. +\endforewordtranslator + %Preface page data +\beginpreface +\vskip2\bigskipamount +Dear User, +\bigskip +It occurred to me that my detailed studies +as published in NTG's MAPS, such as +the BLUes series\Dash Manmac, TUGboat, AMS\Dash +did not attract the attention it deserved, \winksmiley, +let alone that people read it. +They simply lack the time. +Similarly, the BLUe's series enjoys a modest audience. +Most \TeX ies are just busy using \LaTeX. +Therefore, `Publishing with \TeX,' PWT for short, is not so much about +reading, but has all to do with using. + +My experience in macro writing comes from +perusing Knuth's books, +attending Amy's and David's advanced \TeX{} classes, +looking into the works of colleagues, +and inevitably experimenting. +The fundamental macro writing \TeX niques I have assimilated +will be reported in NTG's MAPS, in +backside of the envelope contributions, +in what I call the Paradigm series. + +BLUe's format, its extensions and this user guide +`Publishing with \TeX,' are shareware available,\ftn{I would welcome + \$\thinspace{\oldstyle25} from each happy user, + to facilitate investment in hardware to maintain the format. + The PWT booklet alone is worth it \smiley. + Of course, you will be added to my address database with filed + \cs{registeredbluetrue}. Do provide + complete affiliation, email included. Users in Russia can just send me + a nice mail with their affiliation for the time being.} +and will be distributed electronically +on diskette, via NTG's CD-ROM, or +can be plucked from the CTAN. +The relation between the various BLUe's articles and PWT is that the latter +is a user's guide, while the former explain the coding too, +are about the whys-and-hows, about insights and hindsights. +However, remember that PWT is not an introduction to \TeX{} +nor a treatise on macro writing. + +PWT has been available in February {\oldstyle 1995}, in English. +A version in Russian is scheduled to be released +before Euro\TeX\ {\oldstyle95}, and CyrTUG {\oldstyle95}. +For the latter I'm dependent on my host for my various stays in Moscow, +Irina Gorbunova%\the\translator +, who volunteered to translate the work. + +My aim has been to make PWT as useful as possible, +even for those who don't intend to use \bluetex. +Numerous examples show how to mark up in \TeX{} +various typographic challenges known in the computer-assisted +information processing and dissemination world. +The above does not imply that the PWT script can't be printed. +No, not at all, it can, and you will be surprised, hopefully, by the +thin booklet of {\oldstyle125} odd pages, +which will come off your selfpublishing press, some day. + +I strove for a logically and physically thin system. The user's guide +is physically thin and even thinner logically. If you are not interested +in the math markup, just skip the chapter. Within a chapter examples +can be skipped of course. The chapters are independent with `thin' +interrelations. The files, especially the databases, allow you to +load only what you need. + +The layout has been kept simple. The page width has been determined by my +MAC screen. A large page length is there to reduce the number of +pages and to prevent underfull vboxes. The primary medium is a file, +not a book. + +For future releases, I intend to include `markup pearls' from readers. +In the meantime, I'm pondering about hyperlinking the script to the +\TeX book script, and acquainting myself with \MF{} and +{\manual META}\-{\smc post}. +Another challenge, but fun. +For the time-being, a printed version of PWT, +with the \TeX book at your elbow, or with windows open +on each of the files needed, will hopefully ease your \TeX ing task. +If not, let me know\dots\thinspace And for the rest + +\displaycenterline{let us \TeX{} with confidence} + +I hope that my approach to publishing with \TeX +\Dash a result of some {\oldstyle7} years of \TeX{} use and of some + {\oldstyle20} years of programming numerical software\Dash +will be beneficial to new and old \AllTeX ies alike. +\bigskip +\rightline{Kees van der Laan} +\endpreface + %Contents Page data + %Because of \valign use, \contents{...} +\let\he\quad \let\she\qquad\def\sshe{\qquad\quad}%not possible. +\begincontents +Preface +Table of contents +Introduction +\he Understanding Knuth's markup +\he BLUe's format +\she The syntax +\she Variants +\he The Model +\he Notations and definitions +\he Markup conventions adopted +\he Copyrights BLUe's format +\separator +Text +\he Introduction +\he Headings +\he Paragraphs +\she Parameterization +\she Special paragraphs +\she Customization +\he Use of special text elements +\she Items +\she Centering +\she Quotations +\she Non-centered displays +\she Setting text apart +\she Pascal programs +\she Syntax diagrams +\she Verbatims +\she Exercises and answers +\she Footnotes +\he Fonts and size switching +\he Table of Contents +\separator +Mathematics +\he What is the problem, Doc? +\he The extras +\he Use +\she Plain's display maths +\she A snapshot of examples +\separator +Tabular material +\he Bordered table +\she Model +\she Markup tags +\she Customization +\he Use of btable macro +\he Kaleidoscope +\she Font charts +\separator +Pictures +\he The roots +\he Creating pictures +\she Turtle Graphics +\she \TeX's stacking of boxes +\she Samplebox diversions +\she Picture environment +% +\newcol +% +\sshe Line thickness +\sshe Picture objects +\sshe Curves +\he Adding a picture to pic.dat +\he Using pictures +\he Fractals +\separator +Coping with References +\he Using references +\he Cross-referencing +\he Adding a reference to lit.dat +\he Customization +\separator +Creating an Index +\he Use +\he Markup of IR-s +\she Syntax +\she Markup +\she Spaces +\he Special tokens +\she Sorting keys +\he Ordering +\he Typesetting the index +\he Customization +\she Adding tokens to be ignored +\she Modifying ordering +\she Enriching the index +\she Typesetting the enriched file +\she Processes and files +\separator +Customization +\he Changing look-and-feel +\she The page size +\she The header and footer +\she Section beginnings +\he BLUe script into MAPS +\he Other languages +\separator +Afterthoughts +\separator +Appendices +A: Answers to the exercises +B: Formats +\she Use +\she Concert +\she Letter +\she Report +\she Transparencies +C: Tools +D: BLUe's, BLUes and Paradigms +E: List of Examples +F: Main Tags +G: Obsolete database +H: History of Changes +I: Index +J: Table of Contents +\endcontents + +\let\backcover\pwtbackcover +\beginscript %BLUe script proper +%The next three have been included in +%\report to facilitate mini-ToCs +%\immediate\openout\ans=answers +%\immediate\openout\toe=examples +%\immediate\openout\toc=contents +\input pwt.int %Introduction +%\pasteuptoe\pasteuptoc\endscript %test probe +\input pwt.txt %Text +%\setupappendices\pasteupanswers +%\sortindex\pasteupindex%\pasteuptoc%\endscript +\input pwt.mat %Mathematics +\input pwt.tab %Tabular material +\input pwt.grf %Pictures +\input pwt.ref %References +\input pwt.ind %Index preparation +\input pwt.cus %Customization +\input pwt.aft %Afterthoughts +%From now on A, B, C,... +%And in order not to disturb the current +%number, and its use +\setupappendices +\pasteupanswers +\input pwt.fmt %B: Formats +\input pwt.tls %C: Tools +\input pwt.sur %D: Backgrounds + %E: Table of examples +\pasteuptoe +\input pwt.tot %F: Table of tags +\input pwt.his %G: History of changes +\input pwt.obs %H: Obsolete macros + %I: Index +\sortindex +\preindex\ea{\the\preindex + In this index \cs{end}$<tag>$s + have been excluded, only the \cs{begin}$<tag>$s are there.} +\pasteupindex + %J: Table of contents +\pasteuptoc +\let\backcover\pwtbackcover +\endscript + + diff --git a/info/laan/pwt/pwt.sur b/info/laan/pwt/pwt.sur new file mode 100644 index 0000000000..32966e8cb8 --- /dev/null +++ b/info/laan/pwt/pwt.sur @@ -0,0 +1,139 @@ +\input blue.tex \report \hfuzz40pt% I allow overflow + +\bluechapter Blues, BLUe`s \& Paradigms + +\beginsummary +The BLUe's format material and accompanying articles, which explain details +and show examples, have been listed. +\endsummary + +Originally this note was sent along with \bluetex{} +to inform a user about background and related articles. +\TB{} is assumed to be omni-present. +For other references consult lit.dat. + +\bluehead The files + +BLUe's format has been organized as a `kernel with modules.' +The files are named as follows. +{\parindent4.5\generalindent +\item{the format} \hbox to21ex{\bf \bluetex\hss} the kernel +\item{the databases} +\vtop{\noindent\advance\hsize-1.1\parindent + \hbox to21ex{\bf fmt.dat\hss} the formats\\ + \hbox to21ex{\bf tools.dat\hss} the macros and environments\\ + \hbox to21ex{\bf address.dat\hss} the addresses\\ + \hbox to21ex{\bf lit.dat\hss} the references\\ + \hbox to21ex{\bf pic.dat\hss} the pictures\\ + \hbox to21ex{\bf obsolete.dat\hss} obsolete macros and formats. +}\smallskip} +A handy auxiliary is pfile\Dash and the more general pgfile\Dash +to print \bluetex{} with appropriate line numbers in two-column layout. +The general macro prompts for the file name. It is suited to print +\bluetex, tools.dat, or fmt.dat, all with the appropriate line numbers. + +This `Publishing with \TeX' is the user's guide. + +No profit may be made on it. The articles are free for personal use. +The files are shareware.\ftn{When you are happy with it and wish to support + maintenance, send me \$ {\oldstyle25} to support my hardware, to maintain + BLUe's format system. Of course you will be added to my register.blu database. + Users from Russia can just send me their address, for the time being.} + +When the results are used a proper credit\Dash + be it Knuth or the authors of gkpmac, + or me for the composition and the fill-ins\Dash +is the least a happy publishing user can do. + +\bluehead Background + +\begindisplay +BLUe's Format\Dash The best of both worlds + &The umbrella article about \bluetex. \hidewidth\cr +BLUe's Graphs\Dash Simplicity, aha! + &The gkppic macros are explained. \hidewidth\cr +BLUe's Cross-Refs\Dash A one-pass approach + &One-pass cross-referencing with math.\hidewidth\cr +BLUe's Bibliography\Dash Selective loading + &One-pass bibliography handling. \hidewidth\cr +BLUe's Verbatim\Dash The selection + &Handling verbatims in TeX. \hidewidth\cr +BLUe's Transparencies\Dash To finish up with + &The making of transparencies. \hidewidth\cr +BLUe's Index\Dash The principle and some more + &The making of indexes in a one-pass job.\hidewidth\cr +BLUe's Typesetting of PASCAL\Dash Mean and lean + &The formatting of PASCAL programs. \hidewidth\cr +BLUe's Letters\Dash With love + &The formatting of letters. \hidewidth\cr +BLUe's Reports\Dash Good work + &The formatting of reports. \hidewidth\cr +BLUe's Format databases + \Dash Stay organized&The database approach explained. \hidewidth\cr +BLUe-2-|<younameit>| + &Acceptance and conversion. \hidewidth\cr +Math into BLUes &The typesetting of math via \TeX.\hidewidth\cr +\quad I: Mourning \cr +\quad\llap II: Sing your song \cr +Icons via lfonts &Common matrix icons via \LaTeX's fonts.\hidewidth\cr +Table Diversions &The typesetting of tables via \TeX. \hidewidth\cr +Sorting in BLUe &The basics for making a simple index. \hidewidth\cr +FIFO and LIFO sing the BLUes\Dash Got it &FIFO paradigm, fundamental. \hidewidth\cr +Syntactic Sugar &Discusses various approaches to macros.\hidewidth\cr +`Van tekst naar transparant'&About the life-cycle of documents, + {\oldstyle1984}.\hidewidth\cr +BLUe-2-\LaTeX &Convertor Assistant, {\oldstyle1996}\cr +% +\noalign{\bluehead Related material\par} +% +Manmac BLUes &Is all about manmac, as-is. \hidewidth\cr +\quad\Dash Or how to typeset a book via \TeX \cr + +AMS BLUes &Details with AMS practice, \cs{lsams} for\hidewidth\cr +\quad\Dash Professionals at work + &\null\ formatting references is inspired upon AMS.\hidewidth\cr +TUGboat BLUes &TUGboat styles. ppt.tex emerged from this\hidewidth\cr +\quad\Dash How \TeX ies do it + &\null\ which is at the heart of \bluetex. \hidewidth\cr +% +\noalign{\medskip\noindent An overview is supplied in `What is \TeX{} and \MF{} + all about?' NLUUG, {\oldstyle1993}. + The relation with SGML is in `SGML(\TeX,\dots\thinspace),' + Cork {\oldstyle1990}. + The work of Michael Spivak has been surveyed in Spivak's \OE uvre. +% + \bluehead For fun\par +% + Added are the following, + which also show macro writing by example.\medskip} +% +Typesetting bridge via \TeX & \maps{91}2\hidewidth\cr +Typesetting crosswords via \TeX& \maps{92}2\hidewidth\cr +Tower of Hanoi, revisited & \maps{91}2\hidewidth\cr +% +\noalign{\bluehead The Paradigm series\par} +% +Paradigm: Plain's \cs{item} extended & \maps{94}2\hidewidth\cr +Paradigm: Headache? & \maps{94}2\hidewidth\cr +Paradigm: Two-part macros & \maps{95}1\hidewidth\cr +Paradigm: Parameterization I \hidewidth\cr +\phantom{Paradigm: }\Dash Options & \maps{95}1\hidewidth\cr +Paradigm: Winds and halfwinds \hidewidth\cr +\phantom{Paradigm: }\Dash Details matter & \maps{96}1\hidewidth\cr +Paradigm: It's all in the game & \maps{96}1\hidewidth\cr +Paradigm: Loops & \maps{96}2\hidewidth\cr +Paradigm: Searching & \maps{96}2\hidewidth\cr +Paradigm: Sorting & \maps{96}2\hidewidth\cr +Paradigm: Naming conventions & \maps{97}?\hidewidth\cr +Paradigm: Alignment & \maps{97}?\hidewidth\cr +Paradigm: Eating and preserving & \maps{97}?\hidewidth\cr +\enddisplay +Of course all the articles run up till {\oldstyle1995}, with BLUe's format +in plain TeX. + +\bluehead Availability + +It is disseminated on NTG's 4All\TeX{} CD-ROM (edition {\oldstyle1995}), and +the most recent versions can be plucked from a CTAN in directory +pub/archive/info/pwt/\dots +\endinput
\ No newline at end of file diff --git a/info/laan/pwt/pwt.tab b/info/laan/pwt/pwt.tab new file mode 100644 index 0000000000..43a535c135 --- /dev/null +++ b/info/laan/pwt/pwt.tab @@ -0,0 +1,1875 @@ +\input blue.tex \loadindexmacros \report \hfuzz15pt + +\bluechapter Tabular Material + +\beginsummary +BLUe's format provides btable for the class of (simple) bordered tables. +It will be shown that this model can be used to format a wide variety +of tables. +Difference in representation can be obtained via attributes, i.e., +without changing the markup. +Customization of the macro can be done by modification of the separators +for the caption, the columns, and the like. +The diversity of tabular material in general has been illustrated by +a kaleidoscope of tables borrowed from literature. +For the latter group the markup is not necessarily restricted to +btable or halign. +The example of how Knuth marked up real-life tables is illustrated by +his font charts. +\endsummary + +The backbone of \bluetex's tables is |\btable|, to format a bordered table. +Other \TeX niques for formatting tables will be dealt with too. +The formatting of tables with simultaneous row and column spans +is a subject for the `educated layman,' not for the faint-hearted. + +\bluehead Bordered table + +A bordered table consists of +a caption, +a header, +row stubs, +a table proper, and +a footer, all with parameterized separators. +Special cases occur when some of the elements are absent. + +Abstraction from a ruled and a non-ruled table is realized at +the user level. +Ruled can be specified either as horizontal, vertical or both. +Dotted rules, also the partial ones, can be specified. +No variation in the line thicknesss has been coded. +Framing has been treated just as if a general document element +has to be framed. +I chose to leave the caption and the footer outside the frame.\ftn{However, + we can frame any document element, can't we?} +The positioning of the elements can be specified as +centered, flushed left, or flushed right. +A ^{template} is provided by default. +Caption, border (first, header, row stubs), and footer can be specified; +all mutual orthogonal and independent of \cs{data}. +^^{bordered table model} + +\bluesubhead Model + +{\def\btablecaption{$\leftarrow$\hfill C a p t i o n\hfill$\rightarrow$} +\def\first{\hbox to6ex{\hss First\hss}} +\def\header{\hbox to18ex{\hss Header\hss}} +\def\rowstblst{{\hfil$\vcenter to20ex{\vss\offinterlineskip + \fifo rowstblst\ofif\vss}$}} +\def\data{$\vcenter{\offinterlineskip\hbox{Table}\kern1ex\hbox{Proper}}$} +\def\footer{$\leftarrow$\hfill{\small F o o t e r}\hfill\hfill\hfill$\rightarrow$} +\def\fifo#1{\ifx\ofif#1\ofif\fi\process{#1}\fifo}\def\ofif#1\fifo{\fi} +\def\process#1{\hbox to0pt{\hss#1\hss}\kern.5ex} +\nonframed +$$\vcenter{\btable\data}$$ +}%end scope +\TeX nically caption and footer are \cs{hbox}-es and table proper is an \cs{vbox}. +The separators of caption and footer are default \cs{medskip} and \cs{smallskip}. + +\bluesubhead Markup tags + +\bitem tags ^|\beginbtable| and |\endbtable|, or the shortcut |\btable|, + and the column and row separator ^|\cs|, and ^|\rs| +\bitem defs to be redefined ^|\btablecaption|, ^|\first|, + ^|\header|, ^|\footer|, ^|\rowstblst|, + (all defined empty by default) +\bitem table markup tags, ^|\logms|, ^{logical multispan} to + span a number of {\em logical\/} columns +\bitem attributes +\itemitem{--} ^|\ruled|, ^|\hruled|, ^|\vruled|, ^|\dotruled| \hfill + Default:\hbox to13ex{\hfil^|\nonruled|} +\itemitem- ^|\framed|, ^|\dotframed| \hfill + Default:\hbox to13ex{\hfil^|\nonframed|} +\itemitem- ^|\fll| (flushed left), ^|\flr| (flushed right) \hfill + Default:\hbox to13ex{\hfil^|\ctr|} +\bitem token variables ^|\prebtable|, ^|\postbtable| for positioning +the table within the context.{\parindent0pt\ftn{In practice the math display is used + most of the time.}} +\smallbreak + +By the way the above model is an example of the markup +of a bordered table.\ftn{Admittedly a little complicated. Simpler + examples will follow.} +The markup reads as follows. + +\beginverbatim +\def\btablecaption{$\leftarrow$\hfill C a p t i o n\hfill$\rightarrow$} +\def\first{\hbox to6ex{\hss First\hss}} +\def\header{\hbox to18ex{\hss Header\hss}} +\def\rowstblst{{\hfil$\vcenter to20ex{\vss\offinterlineskip + \fifo rowstblst\ofif\vss}$}} +\def\process#1{\hbox to0pt{\hss#1\hss}\kern.5ex} +\def\data{$\vcenter{\offinterlineskip\hbox{Table}\kern1ex\hbox{Proper}}$} +\def\footer{$\leftarrow$\hfill{\small F o o t e r}\hfill\hfill\hfill + $\rightarrow$} +$$\vcenter{\btable\data}$$ +!endverbatim + +\thissubhead{\runintrue} +\bluesubhead Customization\par +\cs{$\langle X\rangle$sep} are parameters, +which govern the kind of ^{separators}. +The following are defaults to be customized. + +\beginverbatim +\def\cellsize{\cvsize=4ex\tsht=.775\cvsize\tsdp=.225\cvsize} +\def\colsepsurround{\kern.5em}\def\captionsep{\medskip}\def\rowstbsep{\vrule} +\def\headersep{\hrule}\def\footersep{\smallskip}\def\template{} +!endverbatim + +The positioning of the elements in the cells is parameterized +by \cs{lft} and \cs{rgt}. They are equal to \cs{hfil} by default. +A nice application is to make these equal to \$ in such a way that data +can be processed in math mode. + +The empty template looks curious. +The explanation is: when empty\Dash i.e., a user did not provide one\Dash +a standard template will be used. + +\vfill\eject +\bluehead Use of btable macro + +There are some pitfalls that I know of and that +a user might like to be aware of. ^^{btable, pitfalls} +\bitem When \cs{header}, \cs{footer} and the like are defined + they keep their value. + So when you don't have a header in the next table, be sure that + this definition is empty. +\bitem Most of the time I used definitions with \cs{btable} instead of + token variables. Beware. +\bitem To specify the row stub list separately from the data might yield + a first column and a data part of unequal size. +\bitem The ^|\cs| is ambiguous. In \bluetex{} it has the function to + yield the argument as control sequence, while within btable + the meaning is the column separator. +\bitem When verbatims are also part of the data process the table on the + fly via \cs{beginbtable} \dots\thinspace \cs{endbtable}. However, + there is a problem when the header and footer have to be processed + on the fly too. +\bitem In the markup of the table in the appendix `History of + Changes,' the problems are the right line distances in a \cs{vtop}. + The latter as element in the table. + It is caused by the \cs{tstrut}, table strut, + which is inserted at the end of each table row. + See the script how to circumvent this problem. +\bitem The attribute \cs{dotruled} is not so general as \cs{ruled} + or \cs{vruled}, because we lack the primitive \cs{vdotfill} + as a dotted alternative for \cs{vrule}. + For horizontal rules \TeX{} provides the primitives + \cs{hrule} with the dotted variant \cs{dotfill}. +\smallbreak + +In the examples of use below the invocation of \cs{data} could have been +hidden. +However, in order to remain compatible with the situation where a user +wishes to forget about \cs{data} and provide the table entries directly +as argument to \cs{btable}, I refrained from that. + +\blueexample Just data, magic squares + +$$\def\data{2\cs7\cs6\rs + 9\cs5\cs1\rs + 4\cs3\cs8} +\vcenter{\framed\ruled\btable\data}\qquad\qquad\qquad + \def\data{16\cs 3\cs 2\cs13\rs + 5\cs 10\cs 11\cs 8\rs + 9\cs 6\cs 7\cs12\rs + 4\cs 15\cs 14\cs 1} + \def\template{\colsepsurround\lft{\oldstyle##}\rgt + &&\lft##\rgt&\lft{\oldstyle##}\rgt\cr} + \ruled\framed\setbox0=\btable\data%for measuring sizes + \vcenter{\dotruled\dotframed\btable\data}\qquad$$ +via +\begincenterverbatim +$$\def\data{2\cs7\cs6\rs + 9\cs5\cs1\rs + 4\cs3\cs8} +\vcenter{\framed\ruled\btable\data}\qquad\qquad\qquad + \def\data{16\cs 3\cs 2\cs13\rs + 5\cs 10\cs 11\cs 8\rs + 9\cs 6\cs 7\cs12\rs + 4\cs 15\cs 14\cs 1} + \def\template{\colsepsurround\lft{\oldstyle##}\rgt + &&\lft##\rgt&\lft{\oldstyle##}\rgt\cr} + \ruled\framed\setbox0=\btable\data%for measuring sizes + \vcenter{\dotruled\dotframed\btable\data}\qquad$$ +!endcenterverbatim +Remark. To introduce the ^|\oldstyle| elegantly I added +a template for the ^|\halign|. For doing this, awareness of +the physical columns is needed. Logically we are talking about +a {\oldstyle3}${*}${\oldstyle3} and {\oldstyle4}${*}${\oldstyle4} table. +Note that for dotted variants much more work has to be done. + +\blueexample Data plus header, \TB{} {\oldstyle246} + +^^{data with header} +$$\def\header{\hfill Year\hfill\cs + \hfill World Population\hfill} +\def\data{8000 B.C.\cs 5,000,000\rs + 50 A.D.\cs200,000,000} +\flr\nonframed\vruled\vcenter{\btable\data}\qquad + \ruled\vcenter{\framed\btable\data}$$ +via the nearly descriptive markup + +\beginverbatim +\def\header{\hfill Year\hfill\cs \hfill World Population\hfill} +\def\data{8000 B.C.\cs 5,000,000\rs 50 A.D.\cs200,000,000} +$$\flr\vruled\vcenter{\btable\data}\qquad\ruled\framed\vcenter{\btable\data}$$ +!endverbatim + +\exercise How come that the left table contains a \cs{hrule}? +\answer The header separator is not influenced by the ruled + attributes. + +\blueexample Data with row stubs, \TB{} {\oldstyle232} + +^^{data with row stubs} +\nonruled\nonframed\ctr%defaults +\begindemo +\def\rowstblst{{Horizontal lists} + {Vertical lists}{Math lists}} +\def\rowstbsep{}%Customization +\def\data{Chapter 14\rs + Chapter 15\rs + Chapter 17} +$$\btable\data$$ +!yields +\def\rowstblst{{Horizontal lists} + {Vertical lists} + {Math lists}} + \def\rowstbsep{} + \def\data{Chapter 14\rs + Chapter 15\rs + Chapter 17} +\btable\data +\enddemo + +\exercise How can we obtain the same table without the use of \cs{rowstblst}? +\answer Just consider all as data. +\beginverbatim +Alternative +\def\data{Horizontal lists \cs Chapter 14\rs + Vertical lists\hfill\cs Chapter 15\rs + Math lists\hfill \cs Chapter 16} +$$\btable\data$$ +!endverbatim + +%end exercise + +\blueexample Data, row stubs, header, caption and footer + +^^{data with header, row stubs, caption and footer} +\nonruled\nonframed +$$\def\data{11\cs12\rs + 21\cs22} + \vcenter{\framed\btable\data} \qquad + \def\header{\logms2\hfill Header\hfill} + \def\rowstblst{{$1^{st}$ row} + {$2^{nd}$ row}} + \vcenter{\btable\data} \qquad + \def\btablecaption{Caption} + \def\footer{Footer} + \vcenter{\dotruled\btable\data} \qquad + \vcenter{\ruled\framed\btable\data} +$$ +after data definition, |\def\data| |{11\cs12\rs| |21\cs22}|, +via\ftn{Note the invariance of the + {\tt\char92data} specification.} +\begincenterverbatim +$$\vcenter{\framed\btable\data} \qquad + \def\header{\logms2\hfill Header\hfill} + \def\rowstblst{{$1^{st}$ row} + {$2^{nd}$ row}} + \vcenter{\btable\data} \qquad + \def\btablecaption{Caption} + \def\footer{Footer} + \vcenter{\dotruled\btable\data} \qquad + \vcenter{\ruled\framed\btable\data}$$ +!endcenterverbatim +The above example shows in a nutshell the essential possibilities of +the \cs{btable} macro. It is my favorite, although other nice +and powerful examples are still to come. + +\blueexample Walter's spreadsheet, \TB{} {\oldstyle244} + +No preamble has to be defined. ^^{spreadsheet} +$$ +\def\data{1\cs\logms2Adjusted gross income \dotfill\cs \$4,000\rs + 2\cs Zero bracket amount for \rs + \cs a single individual \dotfill\cs\hfill\$2,300\cs \rs + 3\cs Earned income \dotfill\cs + \hfill\underbar{ 1,500}\cs \rs + 4\cs\logms2Substract line 3 from line 2 + \dotfill\cs\hfill\underbar{ 800}\rs + 5\cs Add lines 1 and 4. Enter here \rs + \cs\logms2and on Form 1040, line 35 \dotfill\cs\$4,800} +\def\colsepsurround{\kern.5ex}\cvsize=3ex +\fll\btable\data +$$ +The above is marked up, as a 4-column table, via +\beginverbatim +\def\data{1\cs\logms2Adjusted gross income \dotfill\cs \$4,000\rs + 2\cs Zero bracket amount for \rs + \cs a single individual \dotfill\cs\hfill\$2,300\cs \rs + 3\cs Earned income \dotfill\cs + \hfill\underbar{ 1,500}\cs \rs + 4\cs\logms2Substract line 3 from line 2 + \dotfill\cs\hfill\underbar{ 800}\rs + 5\cs Add lines 1 and 4. Enter here \rs + \cs\logms2and on Form 1040, line 35 \dotfill\cs\$4,800} +\def\colsepsurround{\kern.5ex}\cvsize=3ex +$$\fll\btable\data$$ +!endverbatim + +\blueexample Spreadsheet digression + +It happens that tables\Dash read budgets\Dash set by \AllTeX{} suffer from +a simple addition flaw. +Can't we add a {\em little\/} spreadsheet functionality to \TeX, i.e., +let \TeX{} do the additions?\ftn{Courtesy + Phil Taylor's Trigonometry \TeX, for the idea to use dimen vars and + how to remove the pt. + Remember that \TeX{} allows {\oldstyle16} bit fixed-point arithmetic. + It is limited to absolute values $<$ {\oldstyle16384}.} +\begingroup +\newdimen\a\newdimen\b\newdimen\c +\begindemo +\def\data{r1\cs \ass\a{1.23} \rs + r2\cs\ubp{\ass\b{4.56}}\rs + \cs\cs\sumup{\a\b}\global\c\dimen0\rs + \cs\cs\ubm{\ass\a{3.14}}\rs + \cs\cs\minus\c\a} +$$\btable\data$$ +!yields +\def\ass#1#2{\global#1=#2pt#2} +\def\sumup#1{\global\dimen0=0pt + \let\process\processsum\fifo#1\ofif} +\def\processsum#1{\global\advance\dimen0#1\relax} +\def\ofif#1\fifo{\fi\nodim\the\dimen0} +\def\minus#1#2{\global +\dimen0#1\global\advance\dimen0-#2 +\nodim\the\dimen0} +%\nodim, i.e. \xs, strips pt from +% dimension quantity +{\catcode`\p=12 \catcode`\t=12 + \gdef\xs#1pt{#1}} +\def\nodim{\expandafter\xs} +%\underbar extended by + and - +\def\ubp#1{\underbar{#1}\rlap + {\lower.8ex\hbox{\thinspace\small$+$}}} +\def\ubm#1{\underbar{#1}\rlap + {\lower.8ex\hbox{\thinspace\small$-$}}} +% +\def\data{r1 \cs \ass\a{1.23} \rs + r2 \cs\ubp{\ass\b{4.56}}\rs + \cs\cs\sumup{\a\b}\global\c\dimen0\rs + \cs\cs\ubm{\ass\a{3.14}}\rs + \cs\cs\minus\c\a} +$$\btable\data$$ +\enddemo +\endgroup +with auxiliaries +\beginverbatim +\newdimen\a\newdimen\b\newdimen\c +\def\ass#1#2{\global#1=#2pt#2} +\def\sumup#1{\global\dimen0=0pt\let\process\processsum\fifo#1\ofif} +\def\processsum#1{\global\advance\dimen0#1\relax} +\def\ofif#1\fifo{\fi\nodim\the\dimen0} +\def\minus#1#2{\global\dimen0#1\global\advance\dimen0-#2\nodim\the\dimen0} +%\nodim, i.e. \xs, strips pt from +% dimension quantity +{\catcode`\p=12 \catcode`\t=12 \gdef\xs#1pt{#1}} +\def\nodim{\expandafter\xs} +%\underbar extended by + and - +\def\ubp#1{\underbar{#1}\rlap{\lower.8ex\hbox{\thinspace\small$+$}}} +\def\ubm#1{\underbar{#1}\rlap{\lower.8ex\hbox{\thinspace\small$-$}}} +!endverbatim + +\blueexample Part of AAP's table, AAP {\oldstyle1989} + +Subtle is the header part and the alignments on the signs. ^^{AAP table} +\def\nl{\hfil\strut\break\strut} +{% +\catcode`?=\active \def?{\kern1.1ex} +% +\def\btablecaption{AAP's table:\qquad Job Changes + 1973--1980\hfill} +\def\rowstblst{{Texas}{Maryland}} +\def\header{\copy1\cs\copy2\cs\copy3} + \setbox1=\vtop{\noindent\hsize14ex + Gain/Loss of\nl hospitals \nl since 1973} + \setbox2=\vtop{\noindent\hsize13ex + Total No\nl + of CEO Job\nl + Changes\nl + 1973--90\strut} + \setbox3=\vtop{\noindent\hsize10ex + Survival\nl Rate of\nl CEO's} +\def\data{$+20$\cs---\cs22\%\rs + $+?5$\cs 42\cs24\%} +\def\footer{Source: David Kinzer, `Turnover etc.} +$$\btable\data$$ +}obtained via +\beginverbatim +\def\btablecaption{AAP's table:\qquad Job Changes 1973--1980\hfill} +\def\rowstblst{{Texas}{Maryland}} +\def\header{\copy1\cs\copy2\cs\copy3} +\def\data{$+20$\cs---\cs22\%\rs + $+?5$\cs 42\cs24\%} +\def\footer{Source: David Kinzer, `Turnover etc.} +$$\btable\data$$ +!endverbatim +with auxiliaries +\beginverbatim +\def\nl{\hfil\strut\break\strut} +\catcode`?=\active \def?{\kern1.1ex} +\setbox1=\vtop{\noindent\hsize14ex Gain/Loss of\nl hospitals \nl since 1973} +\setbox2=\vtop{\noindent\hsize13ex Total No\nl of CEO Job\nl Changes\nl 1973--90} +\setbox3=\vtop{\noindent\hsize10ex Survival\nl Rate of\nl CEO's} +!endverbatim +Remark. With longer footnotes put the text in a \cs{vtop}, +with \cs{hsize} set to \cs{thsize}.\ftn{The table proper is first set + in a box, and this box is measured yielding \cs{thsize} and \cs{tvsize}. + After this the \cs{header} and \cs{footer} are set using the + \cs{thsize}.} + +\blueexample AT\&T table diversions, \TB{} {\oldstyle247} + +Subtle is the alignment on the dot via the use of `?', \`a la Knuth, +and the |\llap\$|, and |\rlap*|. +^^{ATT table} +\def\rowstblst{} +{\def\btablecaption{AT\&T Common Stock\hfill} +\def\header{Year\cs Price\cs Dividend} +\catcode`?=\active \def?{\kern1.1ex} +\def\data{1971\cs41--54\cs\llap\$2.60\rs + 2\cs41--54\cs 2.70\rs + 3\cs46--55\cs 2.87\rs + 4\cs40--53\cs 3.24\rs + 5\cs45--52\cs 3.40\rs + 6\cs51--59\cs ?.95\rlap*} +\def\footer{* (first quarter only)} +$$\framed\vcenter{\vbox{\small\btable\data}}\qquad\qquad + \def\btablecaption{} + \def\header{\logms3 \hfil AT\&T Common Stock\hfil\rs + \hfill Year\hfill\cs\hfill Price\hfill\cs \hfill Dividend\hfill} + \vcenter{\flr\ruled\btable\data}$$ +} +via +\begincenterverbatim +\def\btablecaption{AT\&T Common Stock} +\def\header{Year\cs Price\cs Dividend} +\catcode`?=\active \def?{\kern1.1ex} +\def\data{1971\cs41--54\cs\llap\$2.60\rs + 2\cs41--54\cs 2.70\rs + 3\cs46--55\cs 2.87\rs + 4\cs40--53\cs 3.24\rs + 5\cs45--52\cs 3.40\rs + 6\cs51--59\cs ?.95\rlap*} +\def\footer{* (first quarter only)} +$$\framed\vcenter{\vbox{\small + \btable\data}}\qquad\qquad +% +\def\btablecaption{} +\def\header{\logms3 + \hfil AT\&T Common Stock\hfil\rs + \hfill Year\hfill\cs + \hfill Price\hfill\cs + \hfill Dividend\hfill} +\vcenter{\flr\ruled\btable\data}$$ +!endcenterverbatim + +\blueexample Pittman's deterministic multiplication table + +Typographically and in other programming languages a trifle. +In \TeX\ the coding matters. ^^{multiplication table} + +\def\header{} +\def\rowstblst{} +\def\btablecaption{}\def\first{}\def\footer{} +\newcount\rcnt \newcount\ccnt \newcount\tnum +\newcount\mrow \newcount\mcol +\rcnt1 \ccnt1 +\def\rows{\global\ccnt1 \cols \global\advance\rcnt1 + \ifnum\rcnt>\mrow\swor\fi\rs\rows} +\def\swor#1\rows{\global\rcnt1 \global\ccnt1 \fi} +\def\cols{\tnum\rcnt \multiply\tnum\ccnt \the\tnum + \global\advance\ccnt1 \ifnum\ccnt>\mcol\sloc\fi\cs\cols} +\def\sloc#1\cols{\fi} +% +\mrow2 \mcol3 $$\nonruled\nonframed +\vcenter{\btable\rows}\qquad\qquad +\def\first{$\times$} \def\header{\row} +\def\row{\the\ccnt\global\advance\ccnt1 + \ifnum\ccnt>\mcol\wor\fi\cs\row} +\def\wor#1\row{\fi} +\def\rowstblst{{Anything, non-empty}} +\def\nxtrs{\the\rcnt\rss} +\vcenter{\btable\rows}\qquad\qquad +% +\mrow3 \mcol4 \def\rowstblst{{Anything, non-empty}} +\framed\vcenter{\btable\rows} +$$ +via +\beginverbatim +\newcount\rcnt\newcount\ccnt\newcount\tnum\newcount\mrow\newcount\mcol +\rcnt1 \ccnt1 \mrow2 \mcol3 +\def\rows{\global\ccnt1 \cols \global\advance\rcnt1 + \ifnum\rcnt>\mrow\swor\fi\rs\rows} +\def\swor#1\rows{\global\rcnt1 \global\ccnt1 \fi} +\def\cols{\tnum\rcnt\multiply\tnum\ccnt\the\tnum\global\advance\ccnt1 + \ifnum\ccnt>\mcol\sloc\fi\cs\cols} \def\sloc#1\cols{\fi} +$$\mrow2 \mcol3 \vcenter{\btable\rows}\qquad\qquad +% +\def\first{$\times$} \def\header{\row} +\def\row{\the\ccnt\global\advance\ccnt1 \ifnum\ccnt>\mcol\wor\fi\cs\row} +\def\wor#1\row{\fi} %\def\rowstblst{{1}{2}}%Fully automated via the two defs + \def\rowstblst{{Anything, non-empty}} \def\nxtrs{\the\rcnt\rss} +\vcenter{\btable\rows}\qquad\qquad +% +\mrow3 \mcol4 %\def\rowstblst{{1}{2}{3}}%Fully automated via the two defs + \def\rowstblst{{Anything, non-empty}} \def\nxtrs{\the\rcnt\rss} +\framed\vcenter{\btable\rows}$$ +!endverbatim + +%Back to defaults +\def\header{}\def\rowstblst{}\def\btablecaption{}\def\first{}\def\footer{} + +\vfill\eject +\bluehead Kaleidoscope + +Some examples of special tables are given in order to illustrate the +diversity. The markup is not restricted to the use of \cs{btable}. +With respect to programming, the deterministic tables and +the tables which update the computer memory, deserve special attention. +The latter category is induced by {\em computer\/} typography. + +\blueexample Young tableaux, irregular shape, Knuth {\oldstyle1973} + +^^{Young tableaux} +\begindemo +\newdimen\csize\csize=3ex +\newcount\cnt +\def\young#1{\hbox{\vrule\vtop{\hrule + \offinterlineskip\halign{&\vbox + {\hbox to\csize{\strut\hss##\hss + \vrule}\hrule}\cr%template +#1\crcr}}}}%end \young +\catcode`'=13\relax +\def'{\global\advance\cnt1 \the\cnt} +\def\data{'&'&'&'\cr'&'&'\cr'} +\young\data +\def\data{7&8&9&10\cr9&11\cr16\cr} +\young\data +!yields +\newdimen\csize\csize=3ex +\newcount\cnt +\def\young#1{\hbox{\vrule\vtop{\hrule + \offinterlineskip\halign{&\vbox + {\hbox to\csize{\strut\hss##\hss + \vrule}\hrule}\cr%template +#1\crcr}}}}%end \young +\catcode`'=13\relax +\def'{\global\advance\cnt1 \the\cnt} +\def\data{'&'&'&'\cr'&'&'\cr'} +\leavevmode\qquad\young\data\qquad +\def\data{7&8&9&10\cr9&11\cr16\cr} +\young\data +\enddemo + +\blueexample Pascal triangle, a deterministic table + +^^{Pascal triangle} +\begindemo +$$\displaylines{1\cr + 1\quad1\cr + 1\quad2\quad1\cr + 1\quad3\quad3\quad1\cr}$$ +!yields\hsize=10em +$$\displaylines{1\cr + 1\quad1\cr + 1\quad2\quad1\cr + 1\quad3\quad3\quad1\cr}$$ +\enddemo +\exercise The Pascal triangle is deterministic. Write a macro + |\def\pascal#1{...}| which provides the table with the + order as argument. +\answer The macro and auxiliaries read as follows. +\thisverbatim{\unmc} +\beginverbatim +\newcount\n +\newcount\rcnt \newcount\ccnt +\newcount\tentry\newcount\prev +% +\def\pascal#1{\n#1 \def\0{1} \ccnt1 + \loop\ea\xdef\csname\the\ccnt\endcsname{0} + \ifnum\ccnt<\n \advance\ccnt1 + \repeat\rcnt0 \ccnt0 + \displaylines{\rows}} +% +\def\rows{\global\advance\rcnt1 + \ifnum\rcnt>\n \swor\fi + \nxtrow\rows} +% +\def\swor#1\rows{\fi} +% +\def\nxtrow{1 \ccnt1 \prev1 + \loop\ifnum\ccnt<\rcnt + \tentry\prev + \prev\csname\the\ccnt\endcsname + \advance\tentry\prev + \ea\xdef\csname\the\ccnt\endcsname{\the\tentry} + \quad\the\tentry + \advance\ccnt1 + \repeat\cr} +!endverbatim + +%above blank line terminates answer. + +\blueexample Tower of Hanoi, deterministic + +The process of replacement of the disks will be printed +by the invocation of |\hanoi<n>|, $n$ an integer. +No user markup is needed. ^^{tower\ of\ Hanoi} +\begindemo +\hanoi2 +%or +\beginhanoi2\endhanoi +!yields +\hanoi2 +\enddemo + +\blueexample Chart, \TB{} ex{\oldstyle22}.{\oldstyle14} {\oldstyle248} + +^^{chart}%but elaborated differently. +{\small +\newdimen\dist \dist=2\baselineskip +\def\ent#1{\hbox{\vbox to 0pt +{\vss\hbox to10ex{\quad\strut#1\hss} + \hrule}}} +\def\vl#1{\hbox{\vrule height#1\dist +depth0pt}}%Vertical Line of prop. size +\def\bl#1{\kern#1\dist}%BLank of prop. size +%Balanced +$$\offinterlineskip + \vcenter{\ent{abc}} + \vcenter{\ent{de} + \vl2 + \ent{fg}} + \vcenter{\ent{hij} + \vl1 + \ent{klm} + \bl1 + \ent{nop} + \vl1 + \ent{qrs}} +\quad%Nearly balanced tree; pruning a branch + \vcenter{\ent{abc}} + \vcenter{\ent{de} + \vl2 + \ent{fg}} + \vcenter{\ent{hij} + \vl{.5} %\bl{.5}<-| + % \ent{klm} | + \bl{1.5}% <-| + \ent{nop} + \vl1 + \ent{qrs}}$$ }%end scope + +via the following alternative code without \cs{halign} + +\begincenterverbatim +\newdimen\dist \dist=2\baselineskip +\def\ent#1{\hbox{\vbox to0pt{\vss\hbox to10ex{\quad + \strut#1\hss}\hrule}}} +\def\vl#1{\hbox{\vrule height#1\dist depth0pt}} +\def\bl#1{\kern#1\dist}%BLank of proper size +%Balanced +$$\offinterlineskip + \vcenter{\ent{abc}} + \vcenter{\ent{de} \vl2\ent{fg}} + \vcenter{\ent{hij}\vl1\ent{klm}\bl1\ent{nop}\vl1\ent{qrs}} +\quad%Nearly balanced tree; pruning a branch + \vcenter{\ent{abc}} + \vcenter{\ent{de} \vl2\ent{fg}} + \vcenter{\ent{hij}\vl{.5}%\bl{.5}\ent{klm} + \bl{1.5}\ent{nop}\vl1\ent{qrs}}$$ +!endcenterverbatim + +\blueexample Binary tree + +The nodes are identified via Dewey's decimal notation, similar to +a ToC in a book. +For example, node {\oldstyle11} is the left most node at the first level. +The user must supply within the environment ^|\beginbintree| \cs{endbintree} +the pairs of node numbers and node contents, with at the end the +level of the tree. +A node which is not specified will not show. + +The syntax of the invocation reads +\begincenterverbatim +\beginbintree<nodeno><nodevalue> + ... + <nodeno><nodevalue> +<levelno>\endbintree +!endcenterverbatim +$$\thisbintree{\tophns13ex} + \beginbintree{00}1{11}6{12}7{21}2{22}3{23}4 + 2\endbintree + \raise13ex\hbox{$\buildrel heap\over \longrightarrow$} + \thisbintree{\tophns13ex} + \beginbintree{00}7{11}6{12}4{21}3{22}2{23}1 + 2\endbintree +$$ +\begincenterverbatim +$$\thisbintree{\tophns13ex} + \beginbintree{00}1{11}6{12}7{21}2{22}3{23}4 + 2\endbintree + \raise13ex\hbox{$\buildrel heap\over \longrightarrow$} + \thisbintree{\tophns13ex} + \beginbintree{00}7{11}6{12}4{21}3{22}2{23}1 + 2\endbintree +$$ +!endcenterverbatim + +\blueexample Dewey's decimal notation + +$$\beginbintree{00}{$root$} + {11}{$n_{11}$} + {12}{$n_{12}$} + {21}{$n_{21}$} + {22}{$n_{22}$} + {23}{$n_{23}$} + {24}{$n_{24}$} + {35}{$n_{35}$} + {36}{$n_{36}$} + {49}{$n_{49}$} + {410}{$n_{410}$} +4\endbintree$$ +\vskip-2.5\bigskipamount +\begincenterverbatim +$$\beginbintree{00}{$root$} + {11}{$n_{11}$}{12}{$n_{12}$} + {21}{$n_{21}$}{22}{$n_{22}$}{23}{$n_{23}$}{24}{$n_{24}$} + {35}{$n_{35}$}{36}{$n_{36}$} + {49}{$n_{49}$}{410}{$n_{410}$} +4\endbintree$$ +!endcenterverbatim + +\blueexample Bitstreams as names of nodes + +^^|\beginbt|\thisbt{\xoffset{-400}}%Interactive binary tree traversal +\beginbt 1 NTG member? +10 Plain TeX ie? +100 Honoured? +1000 cgl +1001 HH +101 On board? +1010 Chair? +10100 Erik +10101 Secretary? +101010 Gerard +101011 Treasurer? +1010110 Wietse +1010111 Dark? +10101110 JLB +10101111 FG +1011 Anonymous +11 Just a friend +8 \endbt +The above b(inary)t(ree)\ftn{Courtesy Bernd Raichle.} is not foolproof and suffers from +overprinting of the leaves with a tree of depth {\oldstyle10} or so. +Note that the specification of the nodes is on a line by line basis\Dash + \cs{obeylines} is on\Dash and +that each node and its contents is separated by a space. +The last line must contain the number of levels\Dash + used to create the niche for the tree\Dash +and the closing tag \cs{endbt}, again separated by a space. +By adopting these conventions no curly braces were needed.\ftn{The above ideas + emerged from an interactive traversal of a binary tree in a guess + who-is-who game. The programming is such that it can be extended easily to + a trinary or higher-order tree. The overprinting drawback remains, however. + Alexander Calder might have appreciated these `mobiles,' \winksmiley.} +\begincenterverbatim +\thisbt{\xoffset{-400}} +\beginbt 1 NTG member? +10 Plain TeX ie? +100 Honoured? +1000 Kees +1001 HH +101 On board? +1010 Chair? +10100 Erik +10101 Secretary? +101010 Gerard +101011 Treasurer? +1010110 Wietse +1010111 Dark? +10101110 JLB +10101111 FG +1011 Anonymous +11 Just a friend +8 \endbt +\bye +!endcenterverbatim +There are some special tree packages. Gurari is strong with respect to +diagrams in general and trees in particular. + +\blueexample Maze + +%Labyrinth via TeX, just an experiment feb 92. +%Assumed is a closed rule on top and to the right +%| and _ denote the rules to mark the labyrinth +%Labyrinth proper +\thisverbatim{\catcode`\|=12 } ^^{maze} +\begindemo +\catcode`|=13 \def|{\vrule} +\catcode`_=13 \def_{\hrulefill} +$$\vcenter{\hbox{\vtop{\hrule +\offinterlineskip +\halign{&\hbox to\csize{\vrule + height\csize width0pt#\hfil}\cr + |&_&|_& \cr + &|&_& \cr + |&|_&_&|\cr + |_& &_&_\cr}%end \halign + }\vrule%end \vbox + }%end \hbox +!yields +\newdimen\csize \csize=3ex +\catcode`|=13 \def|{\vrule} +\catcode`_=13 \def_{\hrulefill} +\qquad\hbox{\vtop{\offinterlineskip + \hrule\halign{&\hbox to\csize + {\vrule height\csize width0pt + #\hfil}\cr + |&_&|_& \cr + &|&_& \cr + |&|_&_&|\cr + |_& &_&_\cr}%end \halign + }\vrule%end \vbox + }%end \hbox +\enddemo + +\blueexample Crosswords: puzzle, clues and solution + +^^{crosswords} +\begincrosswords +$$\bdata% +P*On +DEk* +*n*S +Edit +\edata +\vcenter{\sevenrm\csize=3ex\crw} +\vcenter{\parindent=5ex +\vtop{\hsize=21ex\obeylines Across +2 Switch mode +3 Knuth +6 Prior to \TeX}} +\vcenter{\parindent=3ex +\vtop{\hsize=25ex\obeylines Down +1 Public domain +2 All right +4 All comes to it +5 Atari type}} +\vcenter{\fiverm\csize=3ex\sol}$$ +\endcrosswords +The above is obtained essentially via +\begincenterverbatim +\begincrosswords +$$\bdata% +P*On +DEk* +*n*S +Edit +\edata +\vcenter{\sevenrm\csize=3ex\crw} +<Clues> +\vcenter{\fiverm\csize=3ex\sol}$$ +\endcrosswords +!endcenterverbatim + +\blueexample Much alignment occurs in typesetting mathematics + +Aligned equations in display, matrices, and +the complex commutative diagrams. +This has been dealt with elsewhere, +for example Knuth {\oldstyle1984}, and Spivak {\oldstyle1989}. +Also typesetting of program texts requires vertical alignment. + +\blueexample Chess boards + +The first board has been marked up via ^|\leaders|,\ftn{Courtesy + David Salomon.} +horizontally and vertically. ^^{chess} +The second is obtained via (a degenerate use of \winksmiley ) +the crossword macro. +{\newdimen\unitlength \unitlength3ex +\begindemo +\unitlength3ex +\boxit{\vbox{\leaders + \vbox{\offinterlineskip + \hbox{\leaders\hbox{% + \kern\unitlength + \vrule width\unitlength + height\unitlength + }\hskip8\unitlength + }\hbox{\leaders\hbox{\vrule + width\unitlength + height\unitlength + \kern\unitlength + }\hskip8\unitlength + }}\vskip8\unitlength}} +!yields +\boxit{\vbox{\leaders + \vbox{\offinterlineskip + \hbox{\leaders\hbox{% + \kern\unitlength + \vrule width\unitlength + height\unitlength + }\hskip8\unitlength + }\hbox{\leaders\hbox{\vrule + width\unitlength + height\unitlength + \kern\unitlength + }\hskip8\unitlength + }}\vskip8\unitlength}} +\enddemo} + +\begindemo +\begincrosswords +\obeyspaces\let =\space +\csize=3ex +\bdata% +8 * * * * +7* * * * +6 * * * * +5* * * * +4 * * * * +3* * * * +2 * * * * +1* * * * +*ABCDEFGH +\edata +\sol +\endcrosswords +!yields +\begincrosswords +\obeyspaces\let =\space +\csize=3ex +\bdata% +8 * * * * +7* * * * +6 * * * * +5* * * * +4 * * * * +3* * * * +2 * * * * +1* * * * +*ABCDEFGH +\edata +\sol +\endcrosswords +\enddemo +\exercise How can we add field indicators on top and to the right? +\answer Extend the data by the numbers at the end of each row, and + copy the last row also on top. +\beginverbatim +\bdata% +*ABCDEFGH* +8 * * * *8 +7* * * * 7 +6 * * * *6 +5* * * * 5 +4 * * * *4 +3* * * * 3 +2 * * * *2 +1* * * * 1 +*ABCDEFGH* +\edata +!endverbatim + +\exercise How can we diminish the ^{optical illusion} + of the border? +\answer Make the border thicker. For example via + |\boxit{\boxit{\sol}}|. Why don't you develop a nice border macro? + +\exercise How can we add pieces to the board? +\answer Chess pieces are available in a font. Similar to the letters in the + solution of the crosswords we can put in pieces. For example let us + assume for simplicity's sake that K denotes the white king then + the following yields the requested result. +\beginverbatim +\begincrosswords +\obeyspaces\let =\space +\csize=3ex +\bdata% +8 * * * * +7* * * * +6 * * * * +5* * * * +4 *K* * * +3* * * * +2 * * * * +1* * * * +*ABCDEFGH +\edata +\boxit{\boxit{\sol}} +\endcrosswords +!endverbatim + +%blank line is needed, to close answer. +The above entails that we are on the way to generate any board and +just add the pieces, all based on the crosswords macro approach. + +\blueexample Optical illusion + +Again a nice application of the use of ^|\leaders|,\ftn{For \cs{soto} and + and \cs{sot} see the script file.} +horizontally and vertically. When I submitted my crosswords macro to \TUB{} +it was refused because of the wiggling of the frame!?! There the similar +effect is on with neighbouring black and white squares. +The black squares look smaller than the white squares, +yielding a ^{wiggling illusion}. + +\newdimen\unitlength \unitlength5ex +\newbox\soto\setbox\soto\vbox{\hrule height1exwidth5ex\relax + \hbox to5ex{\vrule width1exdepth0pt\relax + \hss\vrule height3exwidth1exdepth0pt}% + \hrule height1exwidth5ex\relax} +{\newdimen\unitlength \unitlength5ex +\newbox\sot +\setbox\sot\vbox to\unitlength{\vss + \hbox to\unitlength{\hss + \vrule height.6\unitlength + width.6\unitlength + depth0pt\hss}% + \vss} + +\smallskip +\begindemo +\boxit{\vbox{\leaders\vbox{% + \offinterlineskip\hbox{\leaders + \hbox{\copy\soto\copy\sot}% + \hskip30ex}% + \hbox{\leaders + \hbox{\copy\sot\copy\soto}% + \hskip30ex}}% + \vskip30ex}} +!yields +\boxit{\vbox{\leaders\vbox{\offinterlineskip + \hbox{\leaders\hbox{\copy\soto\copy\sot}\hskip30ex}% + \hbox{\leaders\hbox{\copy\sot\copy\soto}\hskip30ex}}% + \vskip30ex}} +\enddemo + +\blueexample Soto's kinetic art + +\begindemo +\leavevmode +%background +\hbox{\xleaders\hbox to.5ex{\hss + \vrule height6\unitlength\hss + }\hskip6\unitlength + }\kern-6\unitlength +%the squares +\boxit{\vbox{\offinterlineskip + \leaders\hbox{\leaders\copy\sot + \hskip6\unitlength + }\vskip6\unitlength}} +!yields +\leavevmode +\hbox{\xleaders\hbox to.5ex{\hss + \vrule height6\unitlength\relax\hss + }\hskip6\unitlength}\kern-6\unitlength +%the squares +\boxit{\vbox{\offinterlineskip + \leaders\hbox{\leaders\copy\sot + \hskip6\unitlength}\vskip6\unitlength}} +\enddemo +} + +\blueexample Row and/or column spans, partial horizontal rules + +^^{row\ and\ column\ spans} +%Fill-in form bridge +\nonruled\ctr\framed \def\rowstblst{} +{\small%\defaults +\newcount\bcnt +\def\lines{\global\advance\bcnt by1 \ifnum\bcnt=3 et cetera\hidewidth + \senil\fi\the\bcnt.\cs\cs\cs\cs\cs\cs\rs\lines} +\def\senil#1\lines{\fi} +\thisbtable{ +\def\ghostrow{\omit\colsepsurround% + \vbox to0pt{\vss\hbox to5ex{\hss Pair\hss}\vskip.5ex + \hbox to5ex{\hss No\hss}\vss}\prs\logms2\lineglue\srp + \vbox to0pt{\vss\hbox to5ex{\hss Re-\hss}\vskip.5ex + \hbox to5ex{\hss sults\hss}\vss}\prs\logms2\lineglue\srp + \vbox to0pt{\vss\hbox to15ex{\hss Game \dots\hss}\vskip1.5ex + \hbox to15ex{\hss MP$\,$s\hss}\vss}\colsepsurround\cr} +\def\header{\cs\logms2\hfil Contract\hfil\cs + \cs\logms2\hfil Scores\hfil\cs\grs + \cs N--S\cs E--W\cs\cs N--S\cs E--W\cs} +} +$$ \framed\ruled\btable\lines$$ +}%end scope +\beginverbatim +\newcount\bcnt +\def\lines{\global\advance\bcnt by1 \ifnum\bcnt=3 et cetera\hidewidth + \senil\fi\the\bcnt.\cs\cs\cs\cs\cs\cs\rs\lines} +\def\senil#1\lines{\fi} +\thisbtable{ +\def\ghostrow{\omit\colsepsurround% + \vbox to0pt{\vss\hbox to5ex{\hss Pair\hss}\vskip.5ex + \hbox to5ex{\hss No\hss}\vss}\prs\logms2\lineglue\srp + \vbox to0pt{\vss\hbox to5ex{\hss Re-\hss}\vskip.5ex + \hbox to5ex{\hss sults\hss}\vss}\prs\logms2\lineglue\srp + \vbox to0pt{\vss\hbox to15ex{\hss Game \dots\hss}\vskip1.5ex + \hbox to15ex{\hss MP$\,$s\hss}\vss}\colsepsurround\cr} +\def\header{\cs\logms2\hfil Contract\hfil\cs + \cs\logms2\hfil Scores\hfil\cs\grs + \cs N--S\cs E--W\cs\cs N--S\cs E--W\cs} +} +$$ \framed\ruled\btable\lines$$ +!endverbatim +\exercise How many rows does the header have? +\answer Descriptive {\oldstyle1}, visual {\oldstyle2}, and for + plain \TeX\ formatting {\oldstyle3}. + It is all a matter of point of view. + +\exercise The above ^{recursive markup} of the data is elegant, especially + when the table is large. + Simplify the markup by abandoning the independence of size, + i.e., provide the data explicitly instead of recursively. +\answer The `data' can be defined as follows. +\beginverbatim +\def\data{1.\cs\cs\cs\cs\cs\cs\rs + 2.\cs\cs\cs\cs\cs\cs\rs + et cetera\hidewidth} +!endverbatim + +\blueexample Bridge pair match scheme, with special `first' element + +$$\def\first{\thispicture{\unitlength=6ex \xdim{1.4}\ydim{1}}% + \lower1.5ex\hbox\beginpicture%(1.4, 1)(0,-.1) + \put( 0.0, 0.0){\small \strut Round}% + \put( 1.4, 0.575){\llap{\small Game}}% + \put( 1.4, 0.1){\line(-2, 1){1.4}}% +\endpicture\lower2ex\null} +\def\header{% + 1--3 \cs 4--6 \cs 7--9 \cs 10--12\cs13--15\cs 16--18 \cs 19--21} +\def\rowstblst{{1.}{2.}{et cetera}} +\def\data{% +1--2 \cs \cs \cs2: 3--4\cs \cs3: 5--6 \cs4: 7--8\rs +4: 8--3\cs1: 1--6\cs \cs \cs2: 5--7 \cs \cs3: 2--4\rs + %\cs \cs \cs \cs \cs \cs \rs +} +\framed\ruled\btable\data +$$via +\beginverbatim +\def\first{\thispicture{\unitlength=6ex\xdim{1.4}\ydim{1}}% + \lower1.5ex\hbox\beginpicture%(1.5, 1)(0,-.1) + \put( 0.0, 0.0){\small \strut Round}% + \put( 1.4, 0.575){\llap{\small Game}}% + \put( 1.4, 0.1){\line(-2, 1){1.4}}% +\endpicture +\lower2ex\null +} +\def\header{% + 1--3 \cs 4--6 \cs 7--9 \cs 10--12\cs13--15\cs 16--18 \cs 19--21} +\def\rowstblst{{1.}{2.}{et cetera}} +\def\data{% +1--2 \cs \cs \cs2: 3--4\cs \cs3: 5--6 \cs4: 7--8\rs +4: 8--3\cs1: 1--6\cs \cs \cs2: 5--7 \cs \cs3: 2--4\rs + %\cs \cs \cs \cs \cs \cs \rs +} +\framed\ruled\btable\data +!endverbatim +Remark. The need for centering the first row is induced by +\cs{first}. It is elegant to solve the problem for that in ^|\first|. + +\exercise How can we center the numbers in the first column? +\answer Add \cs{hfil} in the \cs{rowstblst} via + \beginverbatim + \def\rowstblst{{\hfil1.}{\hfil2.}{et cetera}} + !endverbatim + Another solution is the following template + \beginverbatim + \def\template{\colsepsurround\hfil##\hfil&&\lft##\rgt\cr} + !endverbatim + +\blueexample Alignment at decimal points + +Generally this is done by introducing an extra column for the dot, +and flushing right the digits left and +flushing left the digits right of it. +It comes from the wish not to print +non-significant leading zeroes, and to suppress +zeroes behind the point for exact numbers. +{\oldstyle3}.{\oldstyle5} means exactly 3${1\over2}$. +{\oldstyle3}.{\oldstyle500} means accurate to three digits. +I would mark up the numbers separately and +insert Knuth's `?', \TB{} {\oldstyle240}\dash{\oldstyle241}, +for non-signicant zeroes, automatically. +The latter can also be done by programming the editor by a template +consisting of sufficient ?-s followed by the decimal point. +The numbers required can be brought in by overtyping +the template. +Related to ^{alignment at decimal point}s is + ^{alignment at number sign}s,\ftn{Another column for the signs + offends the structure. + At a lower level one could think of {\tt\char92scs}, + a Sign Column Separator, but that is not nice either.} +see the AAP table. + +\blueexample Nested table + +A ruled table with unruled tables as data is incorporated in the chapter +`Creating an index,' to illustrate the ordering choices. See the script. + +^^{nested table} +\blueexample Nested, and interrupted table with updating of memory + +From the user level one would say: +aligned material connected by text, where the latter +in the case at hand is the status of the play. +For the markup see the script. + +\beginbridge +{\small +%bridge data +\def\LFTINF{Puzzle} +\def\RGTINF{\vtop{\hbox{6NT,} + \hbox{by East}}} +% +\Ns={KQ76}\Es={T9}\Ss={8542}\Ws={AJ3} +\Nh={J98} \Eh={A2}\Sh={QT74}\Wh={K653} +\Nd={J942}\Ed={T5}\Sd={Q876}\Wd={AK3} +\Nc={65}\Ec={KJ9xxxx}\Sc={2}\Wc={AQT} +\showgame +\LEADS\bplay +h4! & hK & h8 & h2 & --& 1\LEADW\cr +cA & c5 & cx & c2 & --& 2\cr +cQ & c6 & cx & s2 & --& 3\cr +cT & h9 & cK & s4 & --& 4\LEADE\cr +cJ & s5 & s3 & s6 & --& 5\cr +c9 & s8 & h5 & s7 & --& 6\cr +cx & d6 & sJ & d2 & --& 7\cr +\bintermezzo +\def\RGTINF{\vtop{\hbox to 0pt{NS squeezed on\hss} + \hbox to 0pt{\cl\ continuation?\hss} + \hbox to 7ex{\hss}}} %phantom for alignment +\Ec={{\ooalign{\hfil\raise.07ex% + \hbox{x}\hfil\crcr\mathhexbox20D}}} +\showgame \Ec={x} +\eintermezzo +cx & h7 & h6 & hJ & --& 8\cr +\omit et cetera \hidewidth \cr +\eplay +}%end of scope +\endbridge + +Tables which also require updating of memory +occur with typesetting of chess, +for example Tutelaers {\oldstyle1992}, or +GO, Ko{\l}odziejska {\oldstyle1991}. + +\blueexample Fill-in forms + +The registration forms for the various \TeX{} conferences are captivating. +Now and then I ponder about the +e-mail equivalents of the traditional snail forms, especially what +(and how they) should be filled in. +Redefine a list of empty definitions? + +\blueexample Time tables + +Railway, bus, \dots\thinspace, and the use of rotated fonts. +This is a \PS{} issue. + +\blueexample No markup + +For simple tables the data can be specified {\em without\/} +\cs{cs}-s, and \cs{rs}-s, +i.e., without explicit markers for column and row separators. +These can be inserted by \TeX, see \TB{} {\oldstyle249}. +For special cases, for example centering texts\ftn{See the implementation + of \cs{center} in the file.} +and crosswords, this is handy. ^^{no markup} + +\thissubhead{\runintrue} +\bluesubhead Pondering about lists\par makes you realize that the table proper data forms +a nested list with \cs{rs} and \cs{cs}, respectively first level +and second level separators. One could also adopt |<cr>| +and {\tt\char32} for that, in other words allow natural data provision. + +\blueexample Simultaneous row spans + +Simultaneous column spans can be marked up in \cs{btable} by +\cs{logms}---for logical columns, +as an extension to \cs{multispan} for \cs{halign}. ^^{row\ spans} +For row spans start from \cs{valign}, the transposition of \cs{halign}. +A little more than the analogy of transposition is needed. +From the \TeX-nl list the following example of spans over rows. +\begindemo +\hbox{\vrule\valign{&\hrule\vfil + \noindent\hsize15ex\strut + \xsp#\xsp\vfil\hrule\cr +\multispan3{\hrule\vfil + \vbox{\noindent\hsize15ex\strut + \xsp This\\ + \xsp looks\\ + \xsp problematic}}\vfil + \hrule& + Doesn't it?\cr +\noalign{\vrule} +\hfill22 &%space needed +\hfill12 & +\hfill1943 & +\hfill190 \cr}\vrule} +%with auxiliary +\def\xsp{\hbox{ }} +!yields +\def\xsp{\hbox{ }} +\hbox{\vrule\valign{&\hrule\vfil + \noindent\hsize15ex\strut + \xsp#\xsp\vfil\hrule\cr +\multispan3{\hrule\vfil + \vbox{\noindent\hsize15ex\strut + \xsp This\\ + \xsp looks\\ + \xsp problematic}}\vfil + \hrule& + Doesn't it?\cr +\noalign{\vrule} +\hfill22 &%space needed +\hfill12 & +\hfill1943 & +\hfill190 \cr}\vrule} +\enddemo +As can be seen from this difficult example, we have to fall back +on lower level details now and then. +\exercise Modify the above towards a ^|\vtable| macro, such that we can use + the attributes \cs{ruled}, \cs{vruled}, \cs{hruled}, with + default \cs{nonruled}, and \cs{framed} and \cs{nonframed}.^^|\valign| +\answer As a parameter I provided the \cs{hsize} of the table entries. + For row spans the \cs{logms}, logical multispan, has been used, + similar as for \cs{btable}. +\beginverbatim +\def\xsp{\hbox{ }} +\def\vruled{\def\colsep{\vrule}\def\rowsep{}} +\def\hruled{\def\colsep{}\def\rowsep{\hrule}} +\def\ruled{\def\colsep{\vrule}\def\rowsep{\hrule}} +\def\nonruled{\def\colsep{}\def\rowsep{}} +\def\framed{\let\frameit\boxit} +\def\nonframed{\def\frameit##1{##1}} +\def\rs{&\null\rowsepsurround\rowsep\rowsepsurround&} +\def\cs{\lcs\noalign{\colsep}} +\def\lcs{\rowsepsurround\cr} +\def\top{\null\vskip.5em} +\def\bot{\vskip.5em} +\def\ctr{\def\lft{\hfil}} +\def\fll{\def\lft{}} +\def\flr{\def\lft{\hfill}} +%Macro +\def\vtable#1{\frameit{\hbox{\valign{\top\noindent + \hsize#1\lft##\bot + &&##&\hsize#1\top\noindent\lft##\bot\cr + \data}}}} +%Defaults +\nonframed\nonruled\ctr +\def\rowsepsurround{\vskip.1ex} +%Examples +\def\data{1 \rs 2\rs 3\cs + 4 \rs 5\rs 6\cs + 314\rs271\rs \lcs} +\vtable{7ex} +\smallskip +\def\data{\logms3{\hsize7ex\null +\vfil\noindent\hfil1\hfil\vfil}\cs + C\rs G\rs L\cs + 22\rs12\rs1943\lcs} +\ruled\vtable{7ex} +\smallskip +\def\data{\logms3{\hsize15ex\null +\vfil\noindent\xsp This\\ + \xsp looks\\ + \xsp problematik\vfil}\cs + O\rs A\rs G\cs + 16\rs11\rs1954\lcs} +\framed\ruled\vtable{5ex} +!endverbatim + +%end answer +\blueexample Macroscopic markup vtable, based on valign + +{%Example with macroscopic \vtable markup +\def\xsp{\hbox{ }} +\def\vruled{\def\colsep{\vrule}\def\rowsep{}} +\def\hruled{\def\colsep{}\def\rowsep{\hrule}} +\def\ruled{\def\colsep{\vrule}\def\rowsep{\hrule}} +\def\nonruled{\def\colsep{}\def\rowsep{}} +\def\framed{\let\frameit\boxit} +\def\nonframed{\def\frameit##1{##1}} +\def\rs{&\null\rowsepsurround\rowsep\rowsepsurround&} +\def\cs{\lcs\noalign{\colsep}} +\def\lcs{\rowsepsurround\cr} +\def\top{\null\vskip.5em} +\def\bot{\vskip.5em} +\def\ctr{\def\lft{\hfil}} +\def\fll{\def\lft{}} +\def\flr{\def\lft{\hfill}} +%Macro +\def\vtable#1{\frameit{\hbox{\valign{\top\noindent + \hsize#1\lft##\bot + &&##&\hsize#1\top\noindent\lft##\bot\cr + \data}}}} +%Defaults +\nonframed\nonruled\ctr +\def\rowsepsurround{\vskip.1ex} +\begindemo +\def\data{\logms3{\hsize15ex + \vfil\noindent\xsp This\\ + \xsp looks\\ + \xsp problematic + \vfil}\rs\omit\hsize15ex + \vfil\noindent + \xsp Doesn't it?\vfil\cs + O\rs A\rs G\rs 189\cs + \rs 16\rs11\rs1954\lcs} +\framed\ruled\vtable{5ex} +!yields +\def\data{\logms3{\hsize15ex + \vfil\noindent\xsp This\\ + \xsp looks\\ + \xsp problematic +\vfil}\rs +\omit\hsize15ex\vfil\noindent + \xsp Doesn't it?\vfil\cs + O\rs A\rs G\rs \cs + \rs16\rs11\rs1954\lcs} +\framed\ruled\vtable{5ex} +\enddemo} + +\blueexample Regular use vtable based on valign + +{\begindemo +\def\vtable#1{\frameit{\hbox + {\valign{\top\noindent + \hsize#1\lft##\bot + &&##&\hsize#1\top + \noindent\lft + ##\bot\cr + \data}}}} +\def\data{anatoly\rs + andre\rs + alex + \cs + beatrici\rs + bernd\lcs} +\nonframed\vtable{20ex} +!yields +\def\vruled{\def\colsep{\vrule}\def\rowsep{}} +\def\hruled{\def\colsep{}\def\rowsep{\hrule}} +\def\ruled{\def\colsep{\vrule}\def\rowsep{\hrule}} +\def\nonruled{\def\colsep{}\def\rowsep{}} +\def\framed{\let\frameit\boxit} +\def\nonframed{\def\frameit##1{##1}} +\def\rs{&\null\rowsepsurround\rowsep\rowsepsurround&} +\def\cs{\lcs\noalign{\colsep}} +\def\lcs{\rowsepsurround\cr} +\def\top{\null\vskip.1em} +\def\bot{\vskip.1em} +\def\ctr{\def\lft{\hfil}} +\def\fll{\def\lft{}} +\def\flr{\def\lft{\hfill}} +% +\def\rowsepsurround{\vskip.1ex} +% +\def\vtable#1{\frameit{\hbox + {\valign{\top\noindent + \hsize#1\lft##\bot + &&##&\hsize#1\top + \noindent\lft + ##\bot\cr + \data}}}} +\def\data{anatoly\rs + andre\rs + alex + \cs + beatrici\rs + bernd\lcs} +\nonframed\vtable{20ex} +\enddemo} +The advantage of \cs{valign} for this case is that when a name is +inserted in a column that column can grow without +adaptation of the markup for the other cells. + +\blueexample Simultaneous row and column spans + +These require more work. ^^{row\ and\ column\ spans} +\newbox\block +\setbox\block=\hbox{$2*3$} +\def\data{\logms3\cs14\grs + \logms3\cs24\rs + 31\cs32\cs33\cs34} +\def\btablecaption{Caption} +\def\rowstblst{{row 1}{row 2}{\hfil + $\Rightarrow$}} +\def\header{\logms4 Header\hfil$\Downarrow$} +\def\footer{Footer} +\thisbtable{\def\ghostrow{\ifx\empty\rowstblst + \else\omit\lineglue\ea\srp\fi + \logms3\hfil\vbox to0pt{\vss + \copy\block\vss}\hfil\prs\lineglue\cr\nxtrs} +} +$$\vcenter{\framed\ruled\btable\data} +\qquad\qquad +%\setbox\block=\hbox{$3*3$} +\def\data{\logms3\hfil\cs14\grs +\logms3\hfil$3*3$\hfil\cs24\grs + \logms3\hfil\cs34\rs + 41\cs42\cs43\cs44} +\thisbtable{\def\ghostrow{\ifx\empty\rowstblst + \else\omit\lineglue\ea\srp\fi + \logms3\hfil\prs\lineglue\cr + \ifx\empty\rowstblst\else\ea\nxtrs\fi}} +\def\btablecaption{Caption} +\def\header{\logms4 Header\hfil$\Downarrow$\ } +\def\rowstblst{{row 1}{row 2}{row 3}{\hfil$\Rightarrow$}} +\def\footer{Footer} +\vcenter{\ruled\framed\btable\data} +$$ +\exercise How to markup the above with simultaneous row and column spans? +\answer Because of the separation of concerns we only have to concentrate + on the data. My approach is to look at a block\Dash here $2{*}3$\Dash + as a ghost to be overprinted. + A natural way is to introduce the concept of a ghostrow, + which will be invoked by the ghostrow separator \cs{grs}. + So first mark up for the data with the hole in the table and + include the \cs{grs}. Then provide \cs{ghostrow}. + In order to do the latter gracefully, + we also need the concept of partial row separator, \cs{prs}, + and its mirror, \cs{srp}, to handle partial lines. + \beginverbatim + \setbox\block=\hbox{$2*3$} + \def\data{\logms3\cs14\grs + \logms3\cs24\rs + 31\cs32\cs33\cs34} + \def\btablecaption{Caption} + \def\rowstblst{{row 1}{row 2}{\hfil + $\Rightarrow$}} + \def\header{\logms4 Header\hfil$\Downarrow$} + \def\footer{Footer} + \thisbtable{\def\ghostrow{\ifx\empty\rowstblst + \else\omit\lineglue\ea\srp\fi + \logms3\hfil\vbox to0pt{\vss + \copy\block\vss}\hfil\prs\lineglue\cr\nxtrs} + }\vcenter{\framed\ruled\btable\data}$$ + % + %and the 3*3 block can be obtained via + % + %\setbox\block=\hbox{$3*3$} + \def\data{\logms3\hfil\cs14\grs + \logms3\hfil$3*3$\hfil\cs24\grs + \logms3\hfil\cs34\rs + 41\cs42\cs43\cs44} + \thisbtable{\def\ghostrow{\ifx\empty\rowstblst + \else\omit\lineglue\ea\srp\fi + \logms3\hfil\prs\lineglue\cr + \ifx\empty\rowstblst\else\ea\nxtrs\fi}} + \def\btablecaption{Caption} + \def\header{\logms4 Header\hfil$\Downarrow$\ } + \def\rowstblst{{row 1}{row 2}{row 3}{\hfil$\Rightarrow$}} + \def\footer{Footer} + $$\vcenter{\ruled\framed\btable\data}$$ + !endverbatim + +\begingroup +\blueexample Gnonoms + +In \TUB{} a discussion about the following kind of +rules within tables\Dash so-called ^{gnonoms}\Dash emerged. +\newcount\rowno \rowno1 +\thisverbatim{\unmc} +\begindemo +\newcount\columnno \columnno1 +\def\data{1\cs3\cs5\rs + 1\cs4\cs7\rs + 1\cs5\cs9\lrs} +\def\cs{\hss\vrule\ifnum + \columnno<\rowno width0pt\fi\relax + &\global\advance\columnno1 } +\def\rs{\hss\vrule\relax\cr + \global\advance\rowno1 + \global\columnno1 } +\def\lrs{\hss\vrule\relax\cr} +\halign{&\vbox to12pt{\hbox to12pt + {\hss\strut#}\vss\hrule\ifnum + \rowno<\columnno width0pt\fi}\cr + \data} +!yields\offinterlineskip +\newcount\columnno \columnno1 +\def\data{1\cs3\cs5\rs + 1\cs4\cs7\rs + 1\cs5\cs9\lrs} +\def\cs{\hss\vrule\ifnum + \columnno<\rowno width0pt\fi\relax + &\global\advance\columnno1 } +\def\rs{\hss\vrule\relax\cr + \global\advance\rowno1 + \global\columnno1 } +\def\lrs{\hss\vrule\relax\cr} +$$\vbox{\halign{&\vbox to12pt{\hbox to12pt{\hss\strut#}\vss\hrule + \ifnum\rowno<\columnno width0pt\fi\relax}\cr + \data}}\qquad\qquad$$ +\enddemo +% +%Coding with the deterministic behaviour absorbed, reads as follows. +\newcount\rowno \rowno1 +\newcount\columnno \columnno1 +\newcount\tnum +\newcount\diff \diff1 +\newcount\n +\def\rows{\global\tnum1 + \global\advance\diff1 + \cols + \ifnum\rowno=\n\lrs\swor\fi + \rs\rows} +\def\swor#1\rows{\fi} +\def\cols{\the\tnum + \global\advance\tnum\diff + \ifnum\columnno=\n\sloc\fi + \cs\cols} +\def\sloc#1\cols{\fi} +\def\cs{\hss\vertrule \ifnum + \columnno<\rowno width0pt\fi\relax + &\global\advance\columnno1 } +\def\rs{\hss\vertrule\relax\cr + \global\advance\rowno1 + \global\columnno1 } +\def\lrs{\hss\vertrule\relax + \global\columnno1 + \global\rowno1 + \global\diff1 \cr} +% +\def\gnonoms#1{\n#1 \offinterlineskip +\halign{&\vbox to12pt{\hbox to15pt + {\hss\strut\oldstyle##}\vss\horrule + \ifnum\rowno<\columnno + width0pt\fi\relax}\cr + \rows}} +\let\vertrule\vrule +\let\horrule\hrule +\exercise Each entry of the table obeys the formula + $$entry_{i,j}=2j-1+(i-1)(j-1).$$ + A little backside of the envelope calculation-\Dash or just + look closer at the table\Dash shows + that elements in neighbouring columns differ by $i+1$. + Format this table as function of the size, i.e., + with the elements generated automatically. +\answer A solution reads as follows (Similar approach as to Pittman's + multiplication tables.) +\thisverbatim{\unmc} +\beginverbatim +\newcount\rowno \rowno1 +\newcount\columnno \columnno1 +\newcount\tnum +\newcount\diff \diff1 +\newcount\n +\def\rows{\global\tnum1 + \global\advance\diff1 + \cols + \ifnum\rowno=\n\lrs\swor\fi + \rs\rows} +\def\swor#1\rows{\fi} +\def\cols{\the\tnum + \global\advance\tnum\diff + \ifnum\columnno=\n\sloc\fi + \cs\cols} +\def\sloc#1\cols{\fi} +\def\cs{\hss\vertrule \ifnum + \columnno<\rowno width0pt\fi\relax + &\global\advance\columnno1 } +\def\rs{\hss\vertrule\relax\cr + \global\advance\rowno1 + \global\columnno1 } +\def\lrs{\hss\vertrule\relax + \global\columnno1 + \global\rowno1 + \global\diff1 \cr} +% +\def\gnonoms#1{\n#1 \offinterlineskip +\halign{&\vbox to12pt{\hbox to15pt + {\hss\strut\oldstyle##}\vss\horrule + \ifnum\rowno<\columnno + width0pt\fi\relax}\cr + \rows}} +\let\vertrule\vrule +\let\horrule\hrule +$$\vtop{\gnonoms2}\qquad + \vtop{\gnonoms5}\qquad + \vtop{\gnonoms{10}}$$ +\bye +!endverbatim + +\exercise Playing longer with the gnonoms can yield the following + graphical results. Modify the above in order to obtain this + graph. +\def\vertrule{\vrule width1ex} +\def\horrule{\hrule height 1ex} +\def\cols{\ifnum\columnno=\n\sloc\fi + \cs\cols} +$$\vtop{\gnonoms3}\qquad + \vtop{\gnonoms5}\qquad + \vtop{\gnonoms{7}}$$ +\answer The following redefinitions yield the results. +\beginverbatim +\def\vertrule{\vrule width1ex} +\def\horrule{\hrule height 1ex} +\def\cols{\ifnum\columnno=\n\sloc\fi + \cs\cols} +$$\vtop{\gnonoms3}\qquad + \vtop{\gnonoms5}\qquad + \vtop{\gnonoms7}$$ +!endverbatim + +\endgroup + +\bluesubhead Font charts + +Font tables can be formatted via +^|\beginchart| and |\endchart|. +This markup is used in \TB{} {\oldstyle468}--{\oldstyle526}, +for the font tables of the Appendices C and F, and +in {\tt testfont.tex}, which comes along with \MF. + +\blueexample ASCII table, \TB{} {\oldstyle367} + +\beginverbatim +\beginchart{\global\count@='41\tentt + \def\chartstrut{\lower4.3pt\vbox to13.6pt{}}} +&\oct{00x}&&NUL&&SOH&&STX&&ETX&&EOT&&ENQ&&ACK&&BEL&&\oddline0 +&\oct{03x}&&CAN&&EM&&SUB&&ESC&&FS&&GS&&RS&&US&\evenline +&\oct{04x}&&SP&&\:&&\:&&\:&&\:&&\:&&\:&&\:&&\oddline2 +&\oct{05x}&&\:&&\:&&\:&&\:&&\:&&\:&&\:&&\:&\evenline +\noalign{\vskip2ex\line{\hfil et cetera\hfil} + \vskip2.5ex\hrule + \global\advance\count@ 64 } +&\oct{16x}&&\:&&\:&&\:&&\:&&\:&&\:&&\:&&\:&&\oddline7 +&\oct{17x}&&\:&&\:&&\:&&\:&&\:&&\:&&\:&&DEL&\evenline +\endchart +!endverbatim +resulting in the partial ASCII table +{\catcode`\@=11 +\beginchart{\global\count@='41\postdisplaypenalty=0 \tentt + \def\chartstrut{\lower4.3pt\vbox to13.6pt{}}} +&\oct{00x}&&NUL&&SOH&&STX&&ETX&&EOT&&ENQ&&ACK&&BEL&&\oddline0 +&\oct{03x}&&CAN&&EM&&SUB&&ESC&&FS&&GS&&RS&&US&\evenline +&\oct{04x}&&SP&&\:&&\:&&\:&&\:&&\:&&\:&&\:&&\oddline2 +&\oct{05x}&&\:&&\:&&\:&&\:&&\:&&\:&&\:&&\:&\evenline +\noalign{\vskip2ex\line{\hfil et cetera\hfil} + \vskip2.5ex\hrule\global\advance\count@ 64 } +&\oct{16x}&&\:&&\:&&\:&&\:&&\:&&\:&&\:&&\:&&\oddline7 +&\oct{17x}&&\:&&\:&&\:&&\:&&\:&&\:&&\:&&DEL&\evenline +\endchart +} + +%Blank line is needed +\bluesubsubhead Why bother about font charts? + +Well, \dots\thinspace a lot can be learned from \cs{beginchart} +for the markup of classes of tables. + +\bitem Font charts belong to the class of bordered tables +\bitem the template is hidden from the user +\bitem the data can be provided separately and processed on the fly +\bitem the default value of \cs{displaypenalty} can be redefined + via \cs{displaypenalty} |<number>| as argument of + \cs{beginchart} +\bitem \cs{beginchart} is parameterized over the fonts +\bitem ^|\normalchart| keeps automatically track of the positions + in the font chart. +\smallbreak +In short, the macros show how +\bitem to mark up classes of tables +\bitem to hide an \cs{halign} template +\bitem to use two-part macros +\bitem to cope with options and defaults +\bitem to parameterize over fonts, and +\bitem to minimize markup. +\smallbreak + +\blueexample Markup for Appendix F {\oldstyle427}\dash{\oldstyle432} + +\beginverbatim +\beginchart{\postdisplaypenalty=0 \tenrm} + %or \tenit, \tentt, \tenit, \tensy, \tenex + \normalchart +\endchart +!endverbatim +resulting in, for the ^{font chart} \cs{tenrm} +\beginchart{\postdisplaypenalty=0 \tenrm} + \normalchart +\endchart +\noindent The default value of \cs{postdisplaypenalty} is -{\oldstyle10000}, +to enforce a page break. + +\exercise How can we get a print of \LaTeX's ^{line\ font}s? + Why don't you print ^|\oldstyle| too, just for the fun of it? +\answer Similarly, as follows. +\beginverbatim +\font\tenln=line10 +\font\tenlnw=linew10 +\beginchart{\postdisplaypenalty=0 + \tenln} + \normalchart +\endchart +\beginchart\tenlnw + \normalchart +\endchart +!endverbatim + +%end of answer + +The argument of \cs{beginchart} is used among other things to control +the kind of table: \cs{tenrm}, \cs{tenit}, \cs{tentt}, + \cs{teni}, \cs{tensy}, or \cs{tenex}. +The data for normal font tables is provided via |\def\normalchart{...}|. +As a consequence the markup for the +other tables in \TB{} Appendix F is surprisingly simple. +\exercise How come that Knuth decided to implement an ordinary argument + after \cs{beginchart}? If you look at \cs{begindisplay} + nearly the same coding structure is used, but there the argument is + optional. Subtle, very subtle these coding schemes. +\answer There is no much use in providing an optional one. + The font is needed and {\sl must\/} be specified. + +%end answer +\bluesubhead Ordering table for indexing + +The most curious of all tables is not a table but generated +each time. ^^{ordering table} +\thisverbatim{\catcode`\|=12 \catcode`\!=12 \catcode`\~=0 } +\begincenterverbatim +\def\otindex{%Parameters: Ordering `table' +\ea\chardef\csname ot \endcsname=0 +%Bulk according to ASCII +\def\process##1{\ea\chardef + \csname ot##1\endcsname=`##1 } +% +\fifo abcdefghijklmnopqrstuvwxyz\ofif +\chardef\otij=`y \chardef\otIJ=`y +% +\fifo!"##$&'()*+,-./0123456789:;<=>?@ + []_`\ofif +% +\def\process##1{\ea\chardef + \csname ot##1\endcsname=\lccode`##1 } +\uppercase{\fifo + abcdefghijklmnopqrstuvwxyz\ofif}} +~endcenterverbatim +%Back to defaults +\def\header{}\def\rowstblst{}\def\btablecaption{}\def\first{}\def\footer{} +\endinput
\ No newline at end of file diff --git a/info/laan/pwt/pwt.tls b/info/laan/pwt/pwt.tls new file mode 100644 index 0000000000..62a1be6840 --- /dev/null +++ b/info/laan/pwt/pwt.tls @@ -0,0 +1,365 @@ +\input blue.tex \loadindexmacros \report + +\bluechapter Tools + +\beginsummary +BLUe's format comprises tools.dat, a database of tools, +available at your fingertips, which doesn't hinder when not needed. +\endsummary + +At the moment tools.dat, the database of tools, contains macros for +typesetting +bridge, +crosswords, +the tower of hanoi game, +creation of an index (and in there sorting macros), +ntglogo, +Pascal, and +xyz-axes. +Most likely this database will grow. + +\bluehead Use + +Nobody would be surprised to hear that the ease of use of a tool +has all to do with the tool's jargon as implemented by its author. +However, how to access the tool is also important, and we would +love a uniform approach to that, wouldn't we? +Alas, consistency at the outer level\Dash how the tools can be +accessed from the database tools.dat\Dash is too heavy a demand, +as can be seen from the index tool in relation with the other tools. +The tools are just too varied. ^^{database,\ tools.dat} + +\bluesubhead Adding a tool + +First we have to decide what it is that we like to add. +A format? A picture? Or just a tool? +I had to add the \cs{xyz} picture to tools.dat, because it is not a format +and it does not obey the syntax of pic.dat entries, although +it looks like a picture in print to me.\ftn{Remember that the entries + in the address.dat, lit.dat, and pic.dat database obey the syntax + |\lst\<name>{| |<replacement text>}|.} + +The entries of fmt.dat and tools.dat obey the syntax ^^{entry\ for\ tools.dat} +\begincenterverbatim +\tool\<name>fmt \tool\<name>tool +... or ... +\endinput \endinput +!endcenterverbatim + + +To ^{add\ a\ tool} the following has to be done. +\bitem separate the storage-allocating + control sequences from the tool, + i.e., treat \cs{newtoks} and the like separately +\bitem add the storage-allocating control sequences to \bluetex +\bitem add the tool as a definition to tools.dat +\bitem add a load macro to \bluetex. +\smallbreak +\blueexample Add xyz macro to tools.dat + +Suppose we wish to use the \cs{xyz} macro (with three arguments). +What to do? +The use could simply be \cs{loadxyz}, followed by the invocation +|\xyz{...}{...}{...}|. + +In order to make this possible, I have added to tools.dat +\begincenterverbatim +\tool\xyztool +\def\xyz#1#2#3{%the macro +...} +\endinput +!endcenterverbatim +and to \bluetex +\begincenterverbatim +\def\loadxyz{\let\xyztool=x + \loadtool + \let\xyztool\undefined} +!endcenterverbatim +Confusing, isn't it? + +\blueexample Add an environment to tools.dat + +Suppose we wish to make use of the environment +\begincenterverbatim +\begin<yourtoolname> +... +\end<yourtoolname> +!endcenterverbatim +In order to make this possible we have to do several things. +First, add to tools.dat the following `file' +\begincenterverbatim +\tool\<yourtoolname>tool%Opening +<themacros> +\endinput %Closing +!endcenterverbatim +Second, include in \bluetex{} the environment opening and closing, +next to the needed allocations +\thisverbatim{\catcode`\|=12 + \catcode`\!=12 + \catcode`\~=0 + } +\begincenterverbatim +%Tool environment macro +\def\begin<yourtoolname>{\begingroup + \let\end<yourtoolname>\endgroup + \let\<yourtoolname>tool=x + \loadtool +} +%storage allocation +\new<type>\<name> +%<type> is box count dimen fam +% insert language skip +% muskip read toks write +etc. +~endcenterverbatim +Fourth, verify the data integrity. (See later.) + +There are a few restrictions on the macros, as a consequence +of the skipping technique used, i.e., +via \TeX's argument-reading mechanism. +\bitem no outer defs, i.e, \cs{newtoks} and the like, should + be declared in regular \bluetex +\bitem no \cs{par}, use \cs{endgraf}, or |\csname par\endcsname|. +\smallbreak +Remarks. +The restriction with respect to your outer defs can be circumvented by +\bitem defining all macros non-outer, or +\bitem using |\csname newtoks\endcsname\<tag>|, or +\bitem extending \cs{unouterdefs} by your outer defs, i.e., + including \cs{newtoks}, and similars. When these are + part of the format or tool, multiple use + reallocates memory, and because \TeX{} + lacks a garbage collector this will cost extra + memory locations +\bitem sometimes a different macro name for \bluetex{} is needed, such as + the index tool. +\smallbreak +The \cs{tool} macro accepts any |<yourtoolname>| + +\bluesubhead And what about double loading? + +At the moment it is printed in the log file, whenever a tool is loaded. +Sometimes we wish to load a tool anew, for example the pascal +environment. +The index tool is only loaded once.\ftn{Very handy when after + having proofed chapters with an index generated on the fly, + we don't have to delete the \cs{loadindexmacros} tag in the chapters.} +A load counter is maintained to control this. + +\bluesubhead Check for data integrity + +After a tool has been added one can check whether the file can be scanned by +\TeX{} via making a table of contents as follows. +\begincenterverbatim +\input blue.tex +\contentstoolsorfmt{tools} +\bye +!endcenterverbatim +This script produces no pages of output (that is OK). +The file contentstools will be created though. + +\bluesubhead Verbatim listing of a tool + +This problem is induced by my multi-file approach. Of course +one can extract the tool by an editor et cetera as alternative. + +\blueexample Verbatim listing of macros of pascaltool + +\begincenterverbatim +\input blue.tex \let\pascaltool=x +\long\def\tool#1{\ifx#1\undefined\bgroup\unouterdefs\ea\gobbletool + \else\ea\toolverbatim\fi} +%\def\toolverbatim{\thisverbatim{\baselineskip12pt plus2pt minus1pt +% \lineskip1pt plus1pt minus1pt}\beginverbatim} +\def\cgl;newcol{\endverbatim\endinput} +\input tools.dat \bye +!endcenterverbatim + +\thissubhead{\runintrue} +\bluesubhead Conventions for entries fmt.dat\par come down to + +\bitem update the contents at the beginning of the file tools.dat +\bitem |\message{ ---<...>tool, <date>, <owner>--- }| in the beginning +\bitem visual layout for print out +\bitem additional comments which contain markup for line numbering +\bitem addition of table of contents with cross-ref line numbers +\bitem addition of history of changes. +\smallbreak +The layout is aimed at printing in two columns, and start a new column. +The selective line numbering is controlled by the control sequences +\cs{numvrb}, to start line numbering +\cs{vrblin} = |<number>|, to adjust line counter, and +\cs{nonum} to switch off line numbering. +Do remember that the escape char is the semi-colon. + +\blueexample Template for an entry in tools.dat + +\begincenterverbatim +%end%%%%%%<lastlineprevioustool>%;newcol +% +% +%begin%%%%%%%%%%%%%%%%%%%%<....>%;numvrb +\tool\<...>tool +\message{ ---<...>tool, <date>, + <(cr)owner>--- } +%<authorinformation> +%<thetoolproper> +\endinput %;nonum +%Contents +%<item>...................<pagenumber(s)> +%etc +%History of changes +%<date> <change> +%etc +%end%%%%%%%%%%%%%%%%%%%%%%%<....>%!!cgl;newcol +!endcenterverbatim + +\bluehead Binary tree + +^^|\beginbinarytree|^^|\beginbt| +The syntax of the invocation reads +\thisverbatim{\unmc} +\begincenterverbatim +\beginbintree<nodeno><nodevalue> + ... + <nodeno><nodevalue> +<levelno>\endbintree +!endcenterverbatim +See the Tabulair Material chapter for an example. +There is also an example about \cs{beginbt}\dots\cs{endbt}, +a variant\Dash and smarter\Dash implementation of typesetting a binary tree. +The specification of the nodes and their contents +contains less curly braces.\ftn{blue.tex also contains + \cs{bintree} \cs{eertnib}, see the Pictures chapter for an example.} + +\bluehead Bridge + +^^|\beginbridge|%^^|\endbridge| +This is available within the environment +\displaycenterline{|\beginbridge...\endbridge|.} +the following has been copied from the \cs{bridgetool}. +\beginverbatim +%Typesetting bridge publications via (plain) TeX. Version May 92. +%The macros can als be used within LaTeX. +%Version: 1.1 March 1994 (basically unmodified since publication in 1990) +%Author: Kees van der Laan,Hunzeweg 57, 9893PB, Garnwerd (Gr) +% The Netherlands. 05941-1525, cgl@rc.service.rug.nl +%Examples of use have been published in TUGboat, 11, 2, 265--276, and +%MAPS 91.2. +%The macros consist of 3 independent parts: +%- dec.tex ((language) declarations, register used and control sequences) +%- bid.tex (macros for bidding and layout of games) +%- play.tex (macros for discussing the course of a play) +!endverbatim + +\blueexample Bridge bidding, and play + +The following has been copied from the \cs{bridgetool}. The `course of play' +has been printed in the chapter `Tabular Material.' +\beginverbatim +%Examples: diagram, bidding, course of play. +%1. Diagram +$$\crdima{N/None}{\vtop{\hbox{Deal:}\hbox{demo}}}% + {\hand{J74}{AJ}{QJT2}{Q874}}%N + {\hand{K86}{T9542}{874}{T3}}%E + {\hand{QT952}{Q83}{AK5}{A6}}%S + {\hand{A3}{K76}{963}{KJ952}}%W +$$ +%2. Bidding +$$\bbid +1\cl\alert& ? no& 1\sp&\think no\cr + 2\sp& no& 4\sp& a.p.\cr +\noalign{\vskip.5ex}%With the explanation +\alert\ means Alert, conventional bid\hidewidth\cr +? means explanation asked \hidewidth\cr +\think means think pause \hidewidth\cr +\ebid $$ +%3. Course of play +\def\LFTINF{Puzzle} \def\RGTINF{\vtop{\hbox{6NT,}\hbox{by East}}} +\Ns={KQ76}\Es={T9}\Ss={8542}\Ws={AJ3} +\Nh={J98} \Eh={A2}\Sh={QT74}\Wh={K653} +\Nd={J942}\Ed={T5}\Sd={Q876}\Wd={AK3} +\Nc={65}\Ec={KJ9xxxx}\Sc={2}\Wc={AQT} +% +\showgame +% +*Problem* How must NS defend in order to guarantee 1 trick? +*Solution* Start with a \h\ lead in order to break communication. +N must discard \h s and S must discard \sp s. +\smallskip\noindent +\LEADS\bplay +h4! & hK & h8 & h2 & --& 1\LEADW\cr +cA & c5 & cx & c2 & --& 2\cr +cQ & c6 & cx & s2 & --& 3\cr +cT & h9 & cK & s4 & --& 4\LEADE\cr +cJ & s5 & s3 & s6 & --& 5\cr +c9 & s8 & h5 & s7 & --& 6\cr +cx & d6 & sJ & d2 & --& 7\cr +\bintermezzo +\def\RGTINF{\vtop{\hbox to 0pt{NS squeezed on\hss} + \hbox to 0pt{\cl\ continuation?\hss} + \hbox to 7ex{\hss}}} %phantom for alignment +\Ec={{\ooalign{\hfil\raise.07ex% + \hbox{x}\hfil\crcr\mathhexbox20D}}} +\showgame \Ec={x} +\eintermezzo +cx & h7 & h6 & hJ & --& 8\cr +\omit et cetera \hidewidth \cr +\eplay +!endverbatim + +\bluehead Crosswords + +^^|\begincrosswords|%^^|\endcrosswords| +This is available within the environment +\displaycenterline{|\begincrosswords...\endcrosswords|.} +For an example of use see the `Tabular Material' chapter. + +\bluehead Tower of Hanoi + +^^|\hanoi| +This is available as a command but acts as an environment. +\displaycenterline{|\hanoi{...}|.} +An example is provided in the `Tabular Material' chapter. + +\bluehead Creation of an Index + +This is different. ^|\loadindexmacros| should be provided +at the beginning of the script. +At the end supply ^|\sortindex|, followed by ^|\pasteupindex|. +See the `Creation of an Index' chapter for more details. + +\bluehead NTG logo + +When ^|\loadntglogo| is invoked, the logo will be set in a vbox, +\cs{ntglogobox}, for multiple use via for example |\copy\ntglogobox|. + +\blueexample Use NTG logo from tools.dat + +\begindemo +\loadntglogo +\copy\ntglogobox +!yields +\loadntglogo +\copy\ntglogobox +\enddemo + +\bluehead Pascal texts + +^^|\beginpascal|%^^|\endpascal| +This is available within the environment +\displaycenterline{|\beginpascal...\endpascal|.} +An example has been provided in the `Text' chapter. + +\bluehead Smileys + +Just provide \cs{smiley}, \cs{winksmiley}, or \cs{sadsmiley} for +\smiley +\winksmiley +\sadsmiley. + +\bluehead xyz-axes + +This is available as macro \cs{xyz} with three (text label) arguments. +The macro can be invoked after \cs{loadxyz}. +\endinput
\ No newline at end of file diff --git a/info/laan/pwt/pwt.tot b/info/laan/pwt/pwt.tot new file mode 100644 index 0000000000..fc3cc6a988 --- /dev/null +++ b/info/laan/pwt/pwt.tot @@ -0,0 +1,154 @@ +%\input blue.tex +\report +\bluechapter Main Tags + +\beginsummary +A table of main tags of \bluetex{} has been included +to provide a survey of what outer tags +have been implemented for the regular format. +More control sequences and symbols are available, +especially for the lower level markup, +if not for the undocumented features of manmac, +and the wealth of plain \TeX. +The table also illustrates the naming convention adopted +via a root name with prefixes and suffixes. +\endsummary + +The header fields indicate, +the prefixes pre-, post-, this-, every-, pasteup-, and +the suffixes -font, -name and -box. +The first column contains the various root names, with a marker +to denote to what extent the minimal one-part macro +has been implemented. + +\begingroup +\def\first{\hfil\thispicture{\unitlength=6ex \xdim{1.4}\ydim{1}}% + \lower1.5ex\hbox\beginpicture%(1.4, 1)(0,-.1) + \put( 0.0, 0.0){\small \strut Root}% + \put( 1.4, 0.575){\llap{\small Affix}}% + \put( 1.4, 0.1){\line(-2, 1){1.4}}% +\endpicture\lower3ex\null} +\def\header{pre-\cs post-\cs this-\cs every- \cs pasteup- + \cs -font\cs -name%\cs -title + \cs -box} +\def\btablecaption{Main tags for regular scripts} + +\catcode`/=13 +\def/{\leavevmode\thinspace\hbox{% + \vrule\vtop{\vbox{\hrule\kern1pt\hbox{% + \vphantom{\tt e}\thinspace%{\tt#1}% + \thinspace}}\kern1pt\hrule}\vrule}% + \thinspace} % control sequence token +\catcode`-13 \def-{$\neg$} +\def\footer{\qquad\vtop{\small\rlap{- not implemented} + \rlap{${}^+$ implemented} + \rlap{/ implemented without processing on the fly}}} +\def\rowstblst{ +{abstract\hfill\ \tiny+} +{acknowledgements\hfill\ \tiny+} +{btable \hfill\ \tiny/} +{center \hfill\ \tiny+} +{contents\hfill\ \tiny+} +{(sub(sub))head\hfill\ \tiny+} +{keywords\hfill\ \tiny+} +{picture \hfill\ \tiny-} +{pictures\hfill\ \tiny/} +{quote \hfill\ \tiny+} +{references\hfill\ \tiny/} +{script \hfill\ \tiny+} +%{syntax\hfill\ \tiny-} %Although there, not so relevant for the table +{verbatim\hfill\ \tiny-}} +\def\data{% + -\cs-\cs-\cs-\cs+\cs-\cs+\cs+\rs%abstract + +\cs+\cs+\cs-\cs+\cs-\cs+\cs+\rs%abstract + +\cs+\cs+\cs+\cs-\cs-\cs-\cs+\rs%btable + -\cs-\cs-\cs-\cs-\cs-\cs-\cs-\rs%center + -\cs-\cs-\cs-\cs+\cs-\cs+\cs+\rs%contents + +\cs+\cs-\cs-\cs-\cs+\cs-\cs-\rs%head + -\cs-\cs-\cs-\cs+\cs-\cs+\cs+\rs%keywords + -\cs-\cs+\cs+\cs-\cs-\cs-\cs-\rs%picture + -\cs-\cs-\cs-\cs-\cs-\cs-\cs-\rs%pictures + -\cs-\cs-\cs-\cs-\cs-\cs-\cs-\rs%quote + +\cs+\cs+\cs+\cs+\cs-\cs+\cs+\rs%references + -\cs-\cs+\cs+\cs-\cs-\cs-\cs-\rs%script +% -\cs-\cs-\cs-\cs-\cs-\cs-\cs-\rs%syntax + +\cs+\cs+\cs+\cs-\cs-\cs-\cs-%\rs%verbatim +} +$$\vbox{\nonruled\nonframed + \btable\data}$$ +\endgroup +Remarks +\bitem \cs{title}, \cs{subtitle}, \cs{author} and the like, are token + variables and associated with the script +\bitem \cs{pictures} and \cs{references} have been implemented in a + straightforward way, because their use doesn't need processing on the + fly +\bitem In the Appendix Formats similar tables for \cs{transparencies} + and \cs{report} have been included. The latter contains some + more tags. +\smallskip + +\bluesubhead Your summary of markup tags + +Perhaps it is a good idea to add my +Frequently Used Tags, FUTs\Dash indeed a handful, as already +indicated in the template in the `Introduction'\Dash +for personalizing.\ftn{I consider this + very appropriate. At school the irony of cribs was when + prepared carefully they made themselves superfluous. + Transform these summary lists into your personal cribs.} + +\beginverbatim +!bf +Preliminary matter!tt +\title{...} +\subtitle{...} +\keywords{...} +\abstract{...} +\contents{...} +\issue{...} +\acknowledgements{...} +\references{...} +\pictures{...} +!bf +Copy Proper!tt +\beginscript +\endscript +\head{...} +\thissubhead{...} +\subhead{...} +\thissubsubhead{...} +(the \this<headkind>{...} especially together with \runintrue) +\subsubhead{...} +!bf +Inner level!tt +\thisverbatim{...} +\beginverbatim +<escapechar>endverbatim +(and in-line !vrt!thinspace...!thinspace!vrt) +\begincenterverbatim +<escapechar>endcenterverbatim +\beginquote +\endquote +\begindisplay +\enddisplay +(with & and \cr) +\displaycenterline{...} +\btable +(with \data{...\cs...\rs...\cs...\rs...} + \header{...} + \footer{...} + \rowstblst{...} + \vruled{...} ) +\ftn{...} +\bitem +\example{...} +\thispicture{...} +(with \unitlength=...) +\cs{<tagname>} +!bf +Back matter!tt +\pasteupacknowledgements +\pasteupreferences +!endverbatim +\endinput diff --git a/info/laan/pwt/pwt.txt b/info/laan/pwt/pwt.txt new file mode 100644 index 0000000000..1f36d82ebb --- /dev/null +++ b/info/laan/pwt/pwt.txt @@ -0,0 +1,1255 @@ +\input blue.tex \loadindexmacros \loadsmileys \report + \hfuzz=25pt\vbadness=1000 + +\bluechapter Text + +\beginsummary +An introduction to the markup of text has been given. +BLUe's format structure of text is nested to three levels, +each preceded by a title. +The building block is a paragraph. +The markup for \TeX's standard paragraph shape, +the markup for the headings and +the markup for some special text elements have been given. +Examples of the latter are: +items, +quotations, +display text, +centering, +text to be set apart preceded and followed by lines, +PASCAL programs, +verbatims, +exercises and answers, and +footnotes. +\endsummary + +\bluehead Introduction + +Let us assume that we have ordinary text, to be typeset by computer. +What to do? Let us begin by the beginning and write it down. +\begincenterverbatim +An unexpected party + +In a hole in the ground there lived a hobbit. +Not a nasty, dirty, wet hole filled with the ends +of worms and an oozy smell, nor yet a dry, bare +sandy hole with nothing in it to sit down on or +to eat: +it was a hobbit-hole and that means comfort. + +It had a perfectly round door like a porthole, +painted green,... +!endcenterverbatim +We must instruct the computer\Dash that is, supply markup\Dash +to make something nice out of it. How? + +As far as I understand it, ^{Knuth's\ markup} comes down to +just preceding the title by \cs{beginchapter}?!? +That is all. He makes use of the already available +visual markup of blank lines. These blank lines +separate document parts, be it a title from the text +or paragraphs from each other. + +Is that all? Essentially, yes. But\Dash there is always a but\Dash +the role which \cs{beginchapter} has to play is not simple. +Happily, that is not our concern. That is the job of +the book designer in cooperation with the programmer. +I take for granted the niceties of \TeX's text processing\Dash +and which a regular user tends to forget\Dash +such as automatic handling of ligatures, +justification and hyphenation over paragraphs, and +ignoring of superfluous blanks (spaces and lines) in text. +All this is not necessarily restricted to English. + +However, to quote {\TB} `and when you are using plain {\TeX} format, + you need to know that the ten characters +\begincenterverbatim +\ { } $ & # ^ _ % ~ +!endcenterverbatim +cannot be used in the ordinary way when you are typing; each of them +will cause {\TeX} to do something special, \dots' + +After this oversimplification let us go back to BLUe scripts, +full of the right spirit. + +\bluehead BLUe script + +BLUe's format allows text in print to be nested up to {\oldstyle3} levels deep. +The layout of the titles and the shapes of the paragraphs +contribute much to the look-and-feel. +The nesting is reflected in the markup tags +\cs{head}, \cs{subhead} and \cs{subsubhead}. +Also \cs{title} and \cs{subtitle} are there. +The tag \cs{author} has been filled-in by default, +meaning that you don't have to pay attention to it. +It's {\em your\/} format. +You are Ben Lee User. + +\bluehead Headings + +As a tribute to ^{manmac}, BLUe's format provides the following +outer level markup tags as an extra user-interface +on top of the rigorous two-part macros. +\begincenterverbatim +\blue(sub)title <(sub)titletext> + +\bluekeywords <listofkeywords> + +\blue(sub(sub))head <(sub(sub))sectionheadtext> + +\blueexample <exampleheadtext> +!endcenterverbatim +A handful, but\Dash there is always a but\Dash the ^{processing on the fly} +has been lost. +Note that all have a blank line\Dash implicit markup\Dash or +\cs{par} as end separator. Reread page {\oldstyle202} of \TB, please. +I used them in this script, because they counter the ^{curly braces mania}, +or to put it in Knuth's words +\displaycenterline{`\dots you needn't always enclose arguments in braces.'} + +^^{heading,\ markup} +The regular markup for headings reads as follows.\ftn{Of course the long forms + |\begin<tag>| and |\end<tag>| can be used too.} +\displaycenterline{|\head{<headtext>}|} +Similar for \cs{subhead} and \cs{subsubhead}. +No terminating periods are automatically typeset. + +\bluesubhead Parameterization + +The text of a heading is preceded by \cs{prehead} and followed by \cs{posthead}. +Again, similarly for \cs{subhead} and \cs{subsubhead}. +By default the placement within context\Dash that is, +the tokens contained in |\pre<tag>| and |\post<tag>|\Dash +is determined by the following, apart from (stretchable) glue.\ftn{See for + those \TB{}{\oldstyle355}, especially \cs{beginsection}. `The macro first emits glue + and penalties designed to start a new page if the present page is nearly + full, \dots' This mechanism has been borrowed for the various + |\pre(sub(sub))head|-s.} +The latter fills up the page by a page break +to prevent an underfull \cs{vbox} message. + +{\let\css\cs +\def\rowstblst{{\css{head}}{\css{sh}}{\css{ssh}}} +\def\data{\css{bigskip} \cs\css{nobreak}\css{medskip}\css{noindent}\rs + \css{medbreak}\css{noindent}\css{shindent} \cs\css{quad}\rs + \css{smallbreak}\css{noindent}\css{sshindent}\cs\css{quad}\rs} +\def\rowstbsep{\quad} +\def\tag{${<}tag{>}$} +\def\first{\css{}\tag} +\def\header{\css{}pre\tag\cs \css{}post\tag} +\def\footer{{\small*sh stands for subhead, ssh for subsubhead}} +\def\headersep{\kern.5ex\hrule\kern.75ex} +$$\fll\btable\data$$} + +With defaults \cs{subheadindent}{\oldstyle0}pt and +\cs{subsubheadindent}\cs{generalindent}. +I used to mark up headings by the short form, i.e., +by |\head{...}| instead of ^|\beginhead| \dots \cs{endhead}. +From now on\Dash back to the roots\Dash I will use manmac's minimal forms. +In headings I don't need much processing on the fly. + +Automatic numbering is provided in the \cs{report} format. +The idea is to use |\<tag>numbering| token variables. + +The above is only part of the story, just the top of the iceberg +In a document we also like to reuse the head titles for table of contents, +the index, and undoubtedly we need the head numbers sooner or later, +whether they are hidden or not. +So on the one hand we like to process a title on the fly, and +on the other hand we like to store head information, as general as possible, +for reuse. +In the \cs{report} format I had to face the music and deal with those issues. +Happily, the {\bluetex} kernel could do without it. +^^{heading,\ automatic numbering} + +\bluehead Paragraphs + +\TeX's building block is the ^{paragraph}. +This unit is split up into lines to be mapped on pages. +The markup for a paragraph is minimal, i.e., +it is generally implicit and near to natural. +An occasional user is hardly aware of the markup. +In most cases +\begincenterblock +a paragraph starts by the first letter, and +ends by a blank line. +\endcenterblock +The blank line is substituted by \cs{par} automatically. +Explicit markup for a paragraph reads +\begincenterverbatim +\indent %starts a paragraph, an empty box (size \parindent) is inserted + %or \noindent, which just starts a paragraph +<paragraph> +\par %ends the paragraph, and resets defaults of par shape pars + %\hangindent and \hangafter +!endcenterverbatim +On encountering a vertical command in a paragraph, +like \cs{smallskip} and its ilks, +\TeX{} automatically inserts \cs{par}, and because of this +the paragraph is ended. +Each script, and this one is no exception, contains a lot of +ordinary paragraphs.\ftn{For an extensive treatment of paragraphs see + {\TB} chapter~{\oldstyle14}.} + +\bluesubhead Parameterization + +The parameters which govern the standard paragraph shape are given in the +following model.\ftn{Courtesy David Salomon. (A white lie, any + migrated vertical material has been omitted.)} +\def\Xfil{\xleaders\hbox{X}\hfil} +\beginquote\advance\leftskip.25\hsize + \advance\rightskip.25\hsize\small\noindent +\hfil\cs{parskip}\\\null +\hfil\cs{(base)lineskip}\\\null +\cs{parindent}\Xfil\break\null +\hfil\cs{clubpenalty}\\\null +\hfil\cs{(base)lineskip}\\\null +\Xfil\break\null +\hfil\cs{interlinepenalty}\\\null +\hfil\cs{(base)lineskip}\\\null +\hfil$\vdots$\\\null +\Xfil\break\null +\hfil\cs{widowpenalty}\\\null +\hfil\cs{(base)lineskip}\\\null +\Xfil\cs{parfillskip}\break\null +$\longleftarrow$\hfill\cs{hsize}\hfill$\longrightarrow$ +\endquote +The left margin is \cs{hoffset} from the left. +The distance from the left side of the paragraph +to the left margin is the glue \cs{leftskip}. +At the right side the glue has the name \cs{rightskip}. +Between words the glue is \cs{spaceskip} and between +sentences \cs{xspaceskip}. + +The contents of the token variable \cs{everypar} is inserted before +the paragraph text. + +\exercise How can the parameters be set such that the last line + of a paragraph is centered\ftn{Courtesy Anne Br\"uggeman-Klein.}? +\answer \cs{leftskip}0pt plus1fil, + \cs{rightskip}0pt plus$-1$fil, + and \cs{parfillskip}0pt plus2fil. + End the paragraph with |\hskip0pt plus1fil|. + +\exercise One of the problems induced by paragraphs as building blocks is that + it is not easy to provide for line numbering. + How can we achieve this\ftn{Courtesy Jan Kybic.}? +\answer Jan Kybic reported about the several ways he received as answers + to this problem on comp.text.tex. + Below is the solution due to Petr Olsak. Beware it is limited. + The general idea in the solutions collected by Kybic + is to take apart the lines set in a vbox either + starting at the end via \cs{lastbox} or starting at the begin + via \cs{vsplit}, collect these + lines extended by their line numbers, and reinsert these later. + \beginverbatim +%Due to Petr Olsak +%Disclaimer: Macros for plain prose line +%numbering only for ordinary paragraphs +%without display mathematics or other +%specialities. +%(Note added: no \footnote, \centerline.) +\newcount\linenum +\newcount\worknum +\newbox\allparagraph +\def\beginnum{\begingroup\linenum0 + \def\par{\ifhmode\completepar\fi}% + \setbox\allparagraph\vbox\bgroup} +% +\def\endnum{\par\egroup\endgroup} +% +\def\completepar{\endgraf \global + \advance\linenum\prevgraf + \worknum\linenum \setbox0\null + \loop\unskip\unpenalty + \setbox2\lastbox + \ifhbox2 \global\setbox0\hbox + {\llap{$\scriptstyle\the\worknum.$ + }\box2\penalty0\unhbox0}% + \advance\worknum-1 + \repeat\egroup\noindent + \unhbox0\unpenalty\endgraf + \setbox\allparagraph\vbox\bgroup} +!endverbatim +The numbering of verbatim lines has been treated separately. +Another variant is mentioned by Salomon to number the lines on +{\it each page}. +This is handy for proofers to indicate more precisely the commented parts. +See his OTR articles as published in \TUB +\Dash or his courseware `Insights \& Hindsights' + MAPS Special {\oldstyle1992}\Dash +for the modified OTR. +Knuth in \tubissue8(2) {\oldstyle1987}\Dash about letting text +flow around figures\Dash provided the basics for +Hoenig's approach \tubissue{15}(3) {\oldstyle1994}, to let the OTR +create one-line pages\Dash i.e., one can lay hands on each line\Dash +and introduce a `mock'-\cs{everyline}. Promising. + + +\bluesubhead Why a paragraph as unit for line breaking? + +Knuth did choose a paragraph as next larger unit than a line for line +breaking, i.e., for mapping the horizontal list onto lines. +This gives better results than using roughly a line. + +\exercise What happens to accented words? +\answer They hyphenate, but only the part of the word up to the accent control + sequence is subject to hyphenation as such. + However, we can do much better and + use \cs{allowhyphens}\Dash from Appendix~D + {\sl Hanging punctuation}\Dash to be inserted after the place + where the hyphenation stopped. The conclusion is that \TeX{} + can hyphenate properly accented words. + For example the Dutch word + `|onge\"emancipeerde|' can better be input as `|onge\ee{}mancipeerde|' + with\ftn{Courtesy Bernd Raichle and Bas Romeny, + and a wink to dutch.sty.} +\beginverbatim +\def\ee{\nobreak\discretionary{e-}{e}{\"e}\allowhyphens} +\newskip\zzz\def\allowhyphens{\nobreak\hskip\zzz} +\hyphenation{man-ci-peer-de} +!endverbatim +Note that because of the Dutch rules with respect to a dieresis +use has to be made of \cs{discretionary} as well. +The explanation is that the search for hyphenation patterns is stopped +when an explicit kern, induced by the accent, is encountered. +To let \TeX{} resume hyphenation of the remainder +the zero glue \cs{hskip} is inserted. A line break is inhibited +by \cs{nobreak}. The first \cs{nobreak} is needed to isolate the effect +of the \cs{discretionary}. Normally when a discretionary is encountered +\TeX{} stops hyphenating the complete word. + + +\exercise What is wrong with |pretext\par\llap`Quotation'|? +\answer \cs{llap} does not start the horizontal mode. Insert \cs{leavevmode} + after \cs{par}. + +\exercise What is the unexpected result of |\par{\bf New paragraph} blah blah| + with |\everypar{\hang}| active\ftn{Courtesy Alan Reese}? + And why?\ftn{Courtesy Jeremy Henty.} + Note that \cs{bf} is only there to make the pitfall look + realistic. +\answer Without braces the text comes out as a block. With the braces at the + beginning there is no effect of the automatically inserted \cs{hang}. + The explanantion reads as follows. + When processing ordinary text, \TeX{} does not enter horizontal mode + until it encounters a letter. In the troublesome paragraph the first + letter is inside a group. When the group ends all local assignments + are undone, and the effect of the \cs{hang} instruction\Dash + the contents of \cs{everypar} is inserted within the group\Dash + is forgotten. + A solution is to precede the group by \cs{leavevmode}, + because the \cs{everypar} will be executed before the group then. + + +\exercise How can we allow for hyphenation in teletype font? +\answer This is handy when we set control sequences in \cs{tt} + in two-column. Provide +\beginverbatim +\hyphenchar\tentt=`- +!endverbatim + +\exercise And what about page breaks? +\answer The fact is that Knuth did not implement a spread or a chapter + as next larger unit than a little more than `a page' for page breaking, + i.e., for mapping the main vertical list onto pages. + Perhaps this was dictated by the status of the hardware technology + when \TeX{} was designed. + +\noindent The ^{hyphenation} process can be customized by +\beginverbatim +\lefthyphenmin=<number> \righthyphenmin=<number> +!endverbatim +which are {\oldstyle2} and {\oldstyle3} by default, +and via exceptions as argument to +\cs{hyphenation}. For \TB{} Knuth used as exceptions +\beginverbatim +\hyphenation{man-u-script man-u-scripts ap-pen-dix} +!endverbatim +Hyphenation assignments are global and cumulative. +For more details start with Appendix~H of \TB. + +\bluesubhead Special paragraphs + +\TeX{} provides \cs{parshape}, \cs{hangindent} and \cs{hangafter} +for special paragraph shapes. A captivating example is provided +in \TB{} {\oldstyle101}. + +\blueexample Miniature + +History has it to start the first paragraph of a chapter +with a `Miniature.' ^^{miniature} +Knuth in his `Preface' showed how to mark up such kinds of paragraphs. +This is an illustration of the use +of \cs{hangindent}\ftn{\cs{hang} assigns the value + of \cs{parindent} to \cs{hangindent}.} +and \cs{hangafter}, as well as of the use of +\cs{smash} outside math mode. +There is no need for a special `^{dropped capital}' macro, because it is +really simple. + +\cs{cglpic} is the minitiature used from the picture database pic.dat. +For an nice application\ftn{Courtesy Huub Mulders.} see the miniature in the +NTG information, on the inside of the back cover.\ftn{Knuth in \tubissue8(2), + {\oldstyle1987}, touched upon the general problem how to + let text {\it flow around\/} figures. + Hoenig \tubissue{15}(3), {\oldstyle1994}, provided user-friendly macros.} +\begindemo +\pictures{\gpic}%load gpic +\parindent=24pt +\noindent\hang\hangafter-2 +\smash{\lower13pt\hbox to0pt{% +\hskip-\hangindent\gpic +\hfil}}{\smc entle Reader}: +This is a handbook about \TeX, +a new typesetting system +intended for the creation of +beautiful books\Dash and +especially for books that +containa lot of mathematics. +!yields +\pictures{\gpic} +\parindent=24pt +\noindent\hangindent\parindent +\hangafter-2 +\smash{\lower13pt\hbox to0pt{\hskip + -\hangindent\gpic\hfil}}{\smc entle Reader}: +This is a handbook about \TeX, +a new typesetting +system intended for the creation of beautiful +books\Dash and especially for books that contain +a lot of mathematics. +\par\noindent +\enddemo + +Remark. Realize that the reference point for the \cs{smash} + is where the {\smc e} starts, and that the first ({\oldstyle2}) lines are + indented. + Within the \cs{smash} you can move around as you wish, leaving the + reference point and the other things outside invariant. +Note the use of \cs{smc} to smooth the transition from the miniature to the +rest of the text. + +\exercise Compare the above simplified version of Knuth's opening + sentence with the real one in \TB{} script. + +\exercise At the end of each paragraph \TeX{} resets the paragraph shape + parameters. How can we retain these values\ftn{Courtesy + Marek Ry\'cko and Bogus{\l}aw Jackowski.}? +\answer Use |{\par}| instead of \cs{par}. See + their article `From \cs{indent} to \cs{par},' + MAPS{\oldstyle94}.{\oldstyle2}, among other things. + The point is they are changed, but\Dash + there is always a but\Dash on encountering + a \cs{par} the paragraph shape parameters are reset {\sl locally}, + within the group so to say. + After the group closing, the right curly brace, + the old values pop up again, which yields the effect. + Note. This method was first elucidated by the author of \TeX{} + and communicated in a private letter to Elizabeth Barnhart, of + {\oldstyle1987}. + + +\exercise Is the scope of \cs{leftskip} and \cs{rightskip} restricted + to a paragraph? +\answer No, it is not. + +\blueexample Flushed right paragraphs + +At the end of each chapter in \TB{} +quotations are set as flushed paragraphs. ^^{paragraphs,\ flushed} +A little simplified the following will +do the job. The key issue is the +use of \cs{leftskip} and the zero value +of \cs{rightskip} and \cs{parfillskip}. +\cs{manmacauthor} is the \cs{author} macro from manmac to +set the author part in those quotations. + +\begindemo +\leftskip0pt plus40pc + minus\parindent +\rightskip0pt\parfillskip0pt +\everypar{\sl}\obeylines +I got the BLUes, +but I like it +\manmacauthor{Anonymous} + (20th Century) +\bigskip +It contains all +\manmacauthor{DeK}(1978) \TB +!yields +\leftskip 0pt plus 40pc minus\parindent +\rightskip0pt\parfillskip0pt +\everypar{\sl}\obeylines +I got the BLUes, +but I like it +\manmacauthor{Anonymous}(20th Century) +\bigskip +It contains all +\manmacauthor{DeK}(1978) \TB +\enddemo + +\exercise Why is |\everypar{\sl}| needed, instead of just \cs{sl}\ftn{Courtesy + Staszek Wawrykiewicz}? +\answer In \cs{manmacauthor} \cs{rm} is switched on for the special + paragraph of the author line. + The next quotation, if there is one, takes \cs{sl} again, automatically. + Note that the \cs{noindent} in \cs{manmacauthor} is mandatory, + because it starts the new paragraph and therefore \cs{rm} will + be in effect. It will come after the automatically inserted + \cs{sl}. + +\bluesubhead Customization + +The hook for customization of paragraphs is +the token variable \cs{everypar}. +A nice application of \cs{everypar}, next to \cs{sl} above, +is to number lines automatically in verbatim texts. + +\bluehead Accents and ligatures + +Some ligatures come automatically while others have to marked up for. +\begindemo +TB ex9.2-3 +{\AE}sop's {\OE}uvres en fran\c cais\\ +p\^at\'es +!yields +$$\hbox{{\AE}sop's {\OE}uvres en fran\c cais}$$ +$$\hbox{p\^at\'es}$$ +\enddemo +Remark. From \TB~{\oldstyle54}. \dots`It's important to remember that these +conventions for ^{accents} and special letters are not built into {\TeX} itself; +they belong to the plain {\TeX} format, which uses the Computer Modern fonts.' + +\bluehead Paragraphs with digits + +^^{numbers in paragraphs} +When numbers occur in paragraphs they look irregular, they exceed the size +of lowercase letters. Typographers advise to use \cs{oldstyle}. +Minimal markup can be achieved via \cs{on}, for example |\on3|.\ftn{When a space +should follow the number end the number by |{}|{\tt\char32}.} + +\bluehead Use of special text elements + +Examples of special text elements are: + items, labeled by a bullet, by a number, or alphabetically; + centering, + quotations; + (non-centered) displays; + text to be set apart, preceded and followed by a line; + PASCAL text; + syntax diagrams; + verbatims; + exercises and answers; and + footnotes. + +The markup for these elements will be shown by examples. + +\bluesubhead Items + +At the basis are plain's one-parameter \cs{item} and \cs{itemitem}, +which take as argument the item marker. +The bulleted item, ^|\bitem|, comes from \TB{} ex{\oldstyle14}.{\oldstyle20}. +^|\nitem|\Dash numbered items\Dash +^|\aitem|\Dash alphabetically labeled items, lowercase\Dash +^|\Aitem|\Dash alphabetically labeled items, uppercase\Dash and +^|\eitem|\Dash enumerated items, +are similar extensions. +The extensions provide the marker automatically, no argument is needed. +Note that the closing tag is \cs{smallbreak}.\ftn{Knuth advised \cs{medskip} + before and after, \TB{} {\oldstyle102}. I sobered this and made use of + \cs{smallbreak}'s paragraph terminating function.} + +\blueexample Items + +\begindemo +\bitem first item +\itemitem{--} subitem +\bitem second item +\smallbreak +!yields +{\parindent=1pc +\bitem first item +\itemitem{--} subitem +\bitem second item +\smallbreak} +\enddemo + +\bluesubhead Quotations + +A special case of centering a block is the so-called quotation, indented +on the left and the right by the same (fixed) amount, usually the value +of \cs{parindent}. ^^|\beginquote| + +\blueexample Quotations + +\begindemo +pretext +\beginquote +Some text to be set apart, +indented on the left and +on the right +\endquote +posttext +!yields +pretext +\beginquote +Some text to be set apart, +indented on the left and on the right. +\endquote posttext +\enddemo +Add a little to this to obtain \cs{beginsummary} and +\cs{endsummary}, abstracting in the markup from formatting details. +A step towards descriptive or functional markup. The summaries +at the beginning of each chapter of PWT have been marked up in this way. +Perhaps it is also good to mention here that accents don't start horizontal +mode. If you like to quote then start with \cs{leavevmode}\Dash to enforce +horizontal mode\Dash followed by |\llap`| or so. + +\bluesubhead Setting text apart + +^|\beginlines| and |\endlines|, \TB{} {\oldstyle583}--{\oldstyle591}, +is in display (zero-indented), +which obeys the line structure and inserts a \cs{hrule} for and aft. +For an example of use I borrowed the following from \TB, where it is +used in combination with in-line verbatim. +\cs{obeylines} is on.\ftn{Variant \cs{endlines} are + \cs{weak\-end\-li\-nes}, \cs{fi\-nal\-end\-li\-nes}. + The former uses a \cs{medskip} instead of a \cs{medbreak}.} + +\blueexample Setting text apart + +\thisverbatim{\catcode`\|=12 } +\begindemo +%TB 343 +\beginlines +|%This is the plain TeX format | +|%that's described in The TeXbook.| +\dots +\endlines +!yields +\beginlines +|%This is the plain TeX format| +|%that's described in The TeXbook.| +\dots +\endlines +\enddemo + +\bluesubhead Centering in display + +Plain \TeX{} provides \cs{centerline}. +BLUe's format provides the extension ^|\displaycenterline|, +to center a line with display glue for and aft, and +^|\begincenter| \dots \cs{endcenter}, and ^|\begincenterblock| \dots +\cs{endcenterblock} to center each line of the block. +^^|\begincenterdisplay| + +\blueexample Centering in display + +\begindemo +pretext +\displaycenterline{I $\heartsuit$ + \TeX{} \winksmiley} +text in between +\begincenterblock +Sign of times? +The extraordinary rate of change. +\endcenterblock +intermediate text +\begincenter +TLC +tender loving care +that is all there is +\endcenter +posttext +!yields +pretext +\displaycenterline{I $\heartsuit$ \TeX{} \winksmiley} +text in between +\begincenterblock +Sign of times? +The extraordinary rate of change. +\endcenterblock +intermediate text +\begincenter +TLC +tender loving care +that is all there is +\endcenter +posttext +\enddemo +Remarks. +Agreed, \cs{displaycenterline} is a special case and therefore superfluous. +An alternative for centering of a block\Dash although a little different\Dash +is \cs{raggedcenter} +`that partitions the words of a paragraph into as few as possible lines + of approximately equal size and centers each individual line. + Hyphenation should be avoided if possible.' +{\TB} ex{\oldstyle14}.{\oldstyle34}. + +\exercise Do |\begincenter...\endcenter| and +|\begincenterblock...\endcenterblock| allow for page breaks? +\answer |\begincenter...\endcenter| does. + |\begincenterblock...\endcenterblock| does not, + because it is a \cs{vbox}. + +\bluesubhead Non-centered displays: one-line, multi-lines and multi-columns + +^|\begindisplay| and |\enddisplay|, \TB{} {\oldstyle434}--{\oldstyle439}, +yields an indented display. Very powerful and user-friendly. + +\blueexample Non-centered displays: one-line, multi-lines and multi-columns + +\begindemo +pretext +%TB 3 +\begindisplay + ``I understand.'' +\enddisplay +posttext +!yields +pretext\begindisplay + ``I understand.'' +\enddisplay posttext +\enddemo + +Multi-line displays can be handled by ending each line +in the environment by the control sequence \cs{cr}. ^^{multi-line displays} +The indentation is the value of \cs{displayindent}, +default {\oldstyle0}pt, next to the |\hbox to\parindent{}| because of the +\cs{indent} in the (hidden) template. + +\begindemo +pretext +%TB 4 +\begindisplay + a hyphen (-);\cr + an en-dash (--);\cr + an em-dash (---);\cr + a minus sign ($-$).\cr +\enddisplay +posttext +!yields +pretext +\begindisplay + a hyphen (-);\cr + an en-dash (--);\cr + an em-dash (---);\cr + a minus sign ($-$).\cr +\enddisplay +posttext +\enddemo + +Another subtle point is that more-column copy can be displayed, +because a repetitive template has been used. + +\begindemo +pretext +%TB 29 +\begindisplay \hbadness10000 + \hbox spread-.666667em{The + badness of this line is 100.}& + (very tight)\cr + \hbox spread-.333333em{The + badness of this line is 12.}& + (somewhat tight)\cr + ... +\enddisplay +posttext +!yields +pretext +\begindisplay \hbadness10000 + \hbox spread-.666667em{The + badness of this line is 100.}& + \ (very tight)\cr + \hbox spread-.333333em{The + badness of this line is 12.}& + \ (somewhat tight)\cr + ... +\enddisplay +posttext +\enddemo + +\exercise How can we center a \cs{begindisplay}\dots \cs{enddisplay}? +\answer Enclosing the construct with a \cs{vbox} in math display does + not work, which is the usual way to center a \cs{halign}. + This comes from the fact that the construct is recognized as an + alignment display. A solution is +\beginverbatim +{\def\enddisplay{\crcr\egroup\egroup$$} + \begindisplay\vbox\bgroup + <displaymaterial> + \enddisplay} +!endverbatim +Perhaps it is simpler for those cases to fall back on the following +usual markup +\beginverbatim +$$\vbox{\halign{<template> + <displaymaterial> + }}$$ +!endverbatim + +%end answer +\bluesubhead Syntax diagrams + +Markup tags are +\begincenterdisplay +^|\beginsyntax|\dots |\endsyntax| &the environment\cr +^|\alt| &to start an alternative\cr +^|\is| &to define left element\cr +\thisverbatim{\unmc}|<| and \thisverbatim{\unmc}|>| + &to start and end a unit.\cr +\endcenterdisplay +When a line starts with +\thisverbatim{\unmc}|<| it is assumed +that a new rule starts. \cs{obeylines} is on. +The end-of-line is redefined to take the appropriate action. +In the example below a \cs{quad} is +used in the markup to prevent starting a new rule. +The \% sign at the end of a line annihilates the effect of +the e-o-l, and prevents a new rule to start. + +\blueexample Syntax diagrams + +\thisverbatim{\unmc} +\begindemo +%TB 268 +\beginsyntax +<unitofmeasure>\is +\quad<optionalspaces>% + <internalunit> +\alt<optional {\tt true}>% + <physicalunit> +\endsyntax +!yields +\beginsyntax +<unit of measure>\is +\quad<optionalspaces><internalunit> +\alt<optional {\tt true}><physicalunit> +\endsyntax +\enddemo + +\bluesubhead Programs + +Program texts are special, due to the use of non-monospaced fonts. +\bluetex{} assumes that the ^{PASCAL texts} have been prepared in such +a way that they are insensitive to font spacing.\ftn{Courtesy Wilson + and Addyman. Compare the markup with \TB{} {\oldstyle234} and + ex{\oldstyle18}.{\oldstyle9}, + and you will appreciate + the approach of BLUe's format typesetting of PASCAL.} +^^|\beginpascal| + +\blueexample Programs + +\begindemo +\beginpascal +(*Print length of third side of + triangle given two sides and + enclosed angle*) +program EX4A(input, output); +var a, b, c angle : real; +begin read(a, b, angle); + c:=sqrt(sqr(a)+sqr(b)- + 2*a*b*cos(angle)); + writeln('The third side is', c) +end. +\endpascal +!yields +\beginpascal +(*Print length of third side of + triangle given two sides and + enclosed angle*) +program EX4A(input, output); +var a, b, c, angle : real; +begin read(a, b, angle); + c:=sqrt(sqr(a)+sqr(b)- + 2*a*b*cos(angle)); + writeln('The third side is', c) +end. +\endpascal +\enddemo + +Perhaps it is not nice to have the types in the same font as variables. +PASCAL can be extended with types, +and therefore names of types are also variable. +An open problem is the vertical alignment because of the monotype fonts in the input +and the variable-width fonts used in the typeset result. Proofing needed. + +\exercise How can we use the macros for typesetting program fragments + in other languages? +\answer The set of reserved words has to be customized, next to + the handling of special symbols. + +%end exercise + +\bluesubhead Verbatims + +The functionalities are ^{verbatim\ text} (in-line and in display), +and file verbatim inclusion. + +The markup starts with ^|\beginverbatim| and ends with +^|<escapechar>endverbatim|. The default escape character is `!'. +`Options,' for among other things numbering and enabling of metacode, +are handled via the token variables +\cs{thisverbatim}, or globally via \cs{everyverbatim}. + +The place within context is controlled via +the token variables ^|\preverbatim| and ^|\postverbatim|. + +It is true that verbatims are heavily used +by authors who write in \AllTeX{} about \AllTeX, +and perhaps not so relevant for math authors. + +\blueexample Verbatims: escape char use + +\thisverbatim{\catcode`\|=12 \let\-=- + \catcode`\!=12 + \catcode`\<=12 + \catcode`\-=0 } +^^{verbatim,\ escape char} +\begindemo +%To handle via ! (escape char) +% -- other fonts +% -- emc (enable metacode) +\thisverbatim={\emc} +\beginverbatim +Some <metacode> and +blah, blah, ... !it +Now text in italics!tt +and back again in tt +!endverbatim +-yields +\thisverbatim={\emc} +\beginverbatim +Some <metacode> and +blah, blah, ... !it +Now text in italics!tt +and back again in tt +!endverbatim +\enddemo + +\blueexample Verbatims: line numbering and file inclusion + +\thisverbatim{\catcode`\|=12 + \let\-=- \catcode`\!=12 + \catcode`\<=12 + \catcode`\-=0 } +^^{verbatim,\ line numbering} +^^{verbatim,\ file inclusion} +\begindemo +pretext +\everyverbatim={\numvrb} +\thisverbatim={% + \catcode`\!=12 + \catcode`\|=12 +% \input vrb.tex %<file> + \makeescape\*}%To terminate +\beginverbatim +Extras after file +*endverbatim +\noindent posttext +-yields\noindent +pretext +\everyverbatim={\numvrb} +\thisverbatim={\emc + \catcode`\!=12 + \catcode`\|=12 +% \input vrb.tex + \makeescape\*}%To terminate +\beginverbatim +<file> +Extras after file*nonum +*endverbatim +\noindent posttext +\enddemo + +\blueexample Verbatims: line numbering + +\thisverbatim{\catcode`\|=12 + \let\-=- \catcode`\!=12 + \catcode`\<=12 + \catcode`\-=0 } +\begindemo +\thisverbatim={\numvrb + \catcode`\~=9 + \catcode`\*=14 } +\beginverbatim +Just some text with +ligatures such as ?` switched +off (TB 381). +line numbers restarted via +<escapechar>numvrb.!nonum +<escapechar>nonum switches off +line numbering. +<escapechar>vrblin<number> +assigns +<number> to the line counter. + + +!numvrb~After two blank* +lines.!nonum +!endverbatim +-yields +\thisverbatim={\numvrb + \catcode`\~=9 + \catcode`\*=14 } +\beginverbatim +Just some text with +ligatures such as ?` switched +off (TB 381). +line numbers restarted via +<escapechar>numvrb.!nonum +<escapechar>nonum switches off +line numbering. +<escapechar>vrblin<number> assigns +<number> to the line counter. + + +!numvrb~After two blank* +lines.!nonum +!endverbatim +\enddemo + +\blueexample Verbatims: in line + +\thisverbatim{\catcode`\|=12 + \let\-=- %\catcode`\!=12 + \catcode`\<=12 + \catcode`\-=0 } +^^{verbatim,\ in-line} +{\def\-{\hbox{-}} +\begindemo +\thisverbatim{\emc} +Before |<in!-lineverbatim>| after. +-yields\indent +\thisverbatim{\emc} +Before |<in!-lineverbatim>| after. +\enddemo} +Also provided is \cs{unmc} to unable metacode. + +For ^{long\ verbatim\ listing}s supply +\beginverbatim +\everyverbatim{\baselineskip12ptplus2ptminus1pt\lineskip1ptplus1ptminus1pt} +!endverbatim +to prevent underfull vbox messages. +\exercise How can we put \cs{it}, and \cs{tt} at the beginning of + the lines? +\answer The naive way introduces an unwanted space. We can get rid of + a space after a control sequence via the use of a control symbol + with category code 9 (to be ignored) after those control sequences. + +\exercise How can we center verbatims? ^^|\begincenterverbatim| +\answer This is included in BLUe's format and reads as follows. +\thisverbatim{\catcode`\~=0 \catcode`\!=12 } +\beginverbatim +\def\boxlines{\obeyspaces\fifol} +%\gdef\fifol#1^^M{\ifx\lofif#1\lofif\fi +% \processl{#1}\fifol} +\def\begincenterverbatim{$$% + \def\processl##1{\hbox{##1}}% + \def\lofif##1\fifol{\fi\egroup + \egroup$$\thisverbatim{}} + \let\endcenterverbatim\lofif + \bgroup\tt\setupcopy + \let\!=!\catcode`\!=0 + \the\everyverbatim\the\thisverbatim + \vbox\bgroup\boxlines} +~endverbatim + +\exercise A math display does not end a paragraph, it is part of the + paragraph with the effect that paragraph parameters + are not reset to their defaults. What about \cs{beginverbatim} + |!!endverbatim|? +\answer It looks although all depends on the values of \cs{preverbatim} and + \cs{postverbatim}. The defaults are \cs{medskip} and + \cs{smallbreak}. The former does not insert a \cs{par} + while the latter does. As is well-known a \cs{par} + terminates a paragraph. However, the subtleness is that + \cs{begingroup} and \cs{endgroup} enclose the verbatim + which, \TB{} 279 `don't change the mode.' On reading I did not + understand the consequences of the quoted sentence. + A small experiment taught me that the paragraph parameters are not + reset. Therefore the \cs{beginverbatim} |<escapechar>endverbatim| + just {\it interrupt\/} the paragraph, similar to the math display. + +%end exercise + +Remark. As known \TeX{} makes use of special characters. For example +when \% is input the \% is not obtained in print, but rather the rest of +the input line is considered as comment. +Similar for $<$, $>$ and \vrt{} in horizontal mode, although for a different reason. +Because of this the less than and greater than symbols can be used nicely +for syntax charts and the vertical bar for in-line verbatim. + +\bluesubsubhead Pitfalls + +There are some pitfalls that I know of and that +a user might like to be aware of. ^^{verbatim,\ pitfalls} +\bitem Default \cs{emc} and when the less than and greater than signs are + used curious error messages occur. Remedy |\thisverbatim{\unmc}|. +\bitem Long verbatims give a bunch of underfull vbox messages. + Remedy |\everyverbatim{|\\ + |\baselineskip12pt plus2pt minus1pt|\\ + |\lineskip1ptplus1ptminus1pt}| +\bitem And \dots don't forget ! is the default escape character. +!endverbatim +\smallbreak + +\bluesubhead Exercise and answer + +Exercises and answers have to be marked up as follows. +\blueexample Exercise and answer + +\begincenterverbatim +\exercise<exercisetext> +\answer<answertext> + +%followed by a blank line +!endcenterverbatim + +\bluesubhead Footnotes + +Plain \TeX{} provides the \cs{footnote} command. ^^{footnote, + automatic numbering} +\TB{} ex{\oldstyle15}.{\oldstyle12} deals with how to number a footnote +automatically. +In \bluetex{} the markup for the latter is ^|\ftn||{<footnotetext>}|. + +In the title part of an article\Dash or report\Dash +BLUe falls back on \cs{footnote}, because those footnotes +are some sort of out of order. That use reads as follows. + +\blueexample Footnotes + +\begincenterverbatim +\footnote*{<titlefootnotetext>} +%or +\footnote{**}{<titlefootnotetext>} +%etc. +!endcenterverbatim +The above is regular \TeX. Because of me using \cs{oldstyle} for the numbering +the {\oldstyle*} symbol will be obtained instead of *. To correct this +provide |{\rm *}|, or just forget about a marker and provide an empty group. +From the context it is clear enough that the note is about the title. +The footnotes are set in {\oldstyle8}pt. + +^^{margin notes} +\exercise And what about notes in the margin? +\answer This is not implemented in \bluetex's OTR. + It is rather difficult to combine that with flexibility + with the number of columns. + If needed occasionally use \cs{vadjust}. + +%end exercise + +\bluehead Fonts and size switching + +Default {\oldstyle10}pt is used. ^^{fonts\ and\ size\ switching\ macros} +For the moment I stay with Knuth and copied his size-switching +macros.\ftn{Because of this attitude + I could easily kameleon \cs{oldstyle} to all those sizes. + To achieve this with NFSS would have cost me much more time, + I guess.} +BLUe's format contains the size-switching macros +\cs{Large}, $\approx$\thinspace{\oldstyle17}pt, used for chapter headings, +\cs{large}, $\approx$\thinspace{\oldstyle14}.{\oldstyle5}pt, +used for transparencies, +and \cs{small}, that is, {\oldstyle8}pt, used for footnotes. +Next to these \cs{tenpoint}, \cs{ninepoint}, and +\cs{eightpoint} have been inherited from manmac. + +\cs{tiny} has size {\oldstyle5}pt and has been setup similar to the +\cs{...type} macros from Knuth's concert format, Appendix~E of \TB. +A pedagogical stepping stone for size-switching macros, +and sufficient for just text. +\beginverbatim +\def\tiny{\fiverm\baselineskip7pt\let\it\fivei\let\bf\fivebf\let\oldstyle\it} +!endverbatim +\exercise How to setup a general \cs{twelvepoint} size-switching macro? +\answer Copy Knuth's \cs{tenpoint} and adjust for the size. +\beginverbatim +\def\twelvepoint{\def\rm{\fam0\twelvenrm}% + \textfont0=\twelverm\scriptfont0=\ninerm + \scriptscriptfont0=\sevenrm + \textfont1=\twelvi \scriptfont1=\ninei + \scriptscriptfont1=\seveni + \textfont2=\twelvesy\scriptfont2=\ninesy + \scriptscriptfont2=\sevensy + \textfont3=\twelveex\scriptfont3=\tenex + \scriptscriptfont3=\tenex + \def\it{\fam\itfam\twelveit}\def\oldstyle + {\fam1 \twelvei}\textfont\itfam=\twelveit + \def\sl{\fam\slfam\twelvesl}% + \textfont\slfam=\twelvesl + \def\bf{\fam\bffam\twelvebf}% + \textfont\bffam=\twelvebf + \scriptfont\bffam=\sevenbf + \scriptscriptfont\bffam=\fivebf + \def\tt{\fam\ttfam\twelvett}% + \textfont\ttfam=\twelvett + \tt \ttglue=.5em plus.25em minus.15em + \normalbaselineskip=14pt minus1pt + \def\MF{{\manual META}\-{\manual FONT}}%fixed + \let\sc=\tenrm + \let\big=\fourteenbig + \setbox\strutbox=\hbox{\vrule + height10pt depth4pt width\z@}% + \normalbaselines\rm} +\def\fourteenbig#1{{\hbox{$\left#1\vbox + to12pt{}\right.\n@space$}}} +!endverbatim +Make sure all the used fonts are available, otherwise +provide scaled versions. See the script for \cs{Large}. + +%end answer +\exercise What is the effect of |\bf\it|? And of |\it\bf|? +\answer Once you realize that \cs{bf} and \cs{it} are shortcuts + to the fonts \cs{tenbf} and \cs{tenit}, actually to the family, + the answer prompts itself: the last font, that is italics + respectively bold face roman. + One of the features of NFSS is that you will get bold italics + in both cases, that is these tags commute, or am I mistaken? + +\exercise Experiment with the difference between \cs{twelvepoint} + and the use of \cs{magstep1}.\ftn{Courtesy Nico Temme.} + +\bluehead Table of Contents + +I must confess that my way of writing has changed. +Now I start keyboarding with a vague idea of the sections and their +structural dependence. +This style of working badly needs an automatically generated +table of contents, ^{ToC} for short. +The markup to achieve a ToC in the default {\bluetex} reads as follows. +\begincenterverbatim +\input blue.tex \loadtocmacros +\beginscript +<copyproper> +\pasteuptoc +\endscript +!endcenterverbatim +Remark. +The example titles are interspersed with the sections in the ToC, +because my purpose is to supply an overview while writing, and +not for finding the appropriate section to assist the reader. +However, this dynamically generated ToC can be inserted as part of the copy, +eventually enriched by hand, for the convenience of the reader. + +For the \cs{report} format \cs{loadtocmacros} {\em must\/} be omitted. +The necessary macros come already with \cs{report}. +This ToC is aimed at the reader. + +\bluehead Index + +The \cs{report} format has been designed to provide also an index on the fly +if one wishes. There is nothing against it to play also with it +in the default format. +\begincenterverbatim +\input blue.tex \loadindexmacros +\beginscript +<copyproper>%marked up with IRs +\sortindex\pasteupindex +\endscript +!endcenterverbatim +\endinput diff --git a/info/laan/pwt/readme.fst b/info/laan/pwt/readme.fst new file mode 100644 index 0000000000..a965934c9e --- /dev/null +++ b/info/laan/pwt/readme.fst @@ -0,0 +1,66 @@ +What is't? (the collection of pwt.*** files) %June, 1996 +----------- + +Publishing with TeX (pwt for short) +is the user's guide which comes with BLUe's format system. + +How to process the PWT user's guide? (also available on NTG's 4AllTeX CD-ROM and +------------------------------------ TUG/ukTuG/GUTenberg Tex-alive CD-ROM) + +Copy Blue's format files +(blue.tex, fmt.dat, tools.dat, pic.dat) +in addition to the PWT files you wish. + +pwt.scr is the root script which invokes all the other chapters: + pwt.int Introduction + pwt.txt Text + pwt.mat Mathematics + pwt.tab Tables + pwt.grf Graphics + pwt.ref References + pwt.ind Indexing + pwt.cus Customization + pwt.aft Afterthoughts + pwt.fmt Appendix: formats + pwt.tls Appendix: Tools + pwt.sur Appendix: Survey (of related material) + pwt.his Appendix: History of changes + pwt.tot Appendix: Table of Tags + pwt.obs Appendix: Obsolete items + +A preview or print can be obtained after + + tex pwt.scr + +(Each chapter can be processed independently such as + tex pwt.int +for example. (close after prompt with \end or \pasteupindex\sortindex\end).) + +Contents BLUe's format system (also available on NTG's 4AllTeX CD-ROM and +----------------------------- TUG/ukTuG/GUTenberg Tex-alive CD-ROM) + + +The files are: blue.tex (format) + fmt.dat (variant formats) + tools.dat (tools like indexing) + address.dat, lit.dat, pic.dat (databases addresses, literature, pictures) +Its user's guide is called Publishing with TeX. +TeX nical aspects have been explained in the Paradigm series. + +Articles in the Paradigm series +------------------------------- + +Paradigms: Headache? +Paradigms: Plain's item extended +Paradigms: Two-part macros +Paradigms: Parameterization I Options +Paradigms: Winds and halfwinds---Details matter +Paradigms: It's all in the game +Paradigms: Loops +Paradigms: Searching (in BLUe) +Paradigms: Sorting (in TeX) +Paradigms: Just a little bit of PostScript (with a few .eps files) + + +Kees van der Laan, Hunzeweg 57, 9893PB, Garnwerd, The Netherlands. +Phone: (31) (0)594 62 1525, email: cgl@rc.service.rug.nl. |