From cbfc368620bf1ec89c0feff3230ec1c082999975 Mon Sep 17 00:00:00 2001 From: Karl Berry Date: Thu, 24 Apr 2014 17:50:01 +0000 Subject: lollipop, new format git-svn-id: svn://tug.org/texlive/trunk@33658 c570f23f-e606-0410-a88d-b1316a301751 --- Master/texmf-dist/doc/otherformats/lollipop/README | 80 ++ .../doc/otherformats/lollipop/lollipop.tex | 129 ++++ .../doc/otherformats/lollipop/manual/address.tex | 187 +++++ .../doc/otherformats/lollipop/manual/appendix.tex | 69 ++ .../doc/otherformats/lollipop/manual/btxmac.tex | 812 +++++++++++++++++++++ .../doc/otherformats/lollipop/manual/comm.tex | 642 ++++++++++++++++ .../doc/otherformats/lollipop/manual/comment.tex | 129 ++++ .../doc/otherformats/lollipop/manual/example.tex | 4 + .../doc/otherformats/lollipop/manual/extern.tex | 428 +++++++++++ .../doc/otherformats/lollipop/manual/head.tex | 118 +++ .../doc/otherformats/lollipop/manual/list.tex | 442 +++++++++++ .../lollipop/manual/lollipop-manual.bib | 59 ++ .../lollipop/manual/lollipop-manual.pdf | Bin 0 -> 335036 bytes .../lollipop/manual/lollipop-manual.tex | 99 +++ .../doc/otherformats/lollipop/manual/mandefs.tex | 225 ++++++ .../doc/otherformats/lollipop/manual/opt.tex | 408 +++++++++++ .../doc/otherformats/lollipop/manual/out.tex | 349 +++++++++ .../doc/otherformats/lollipop/manual/prelim.tex | 361 +++++++++ .../doc/otherformats/lollipop/manual/struct.tex | 264 +++++++ .../doc/otherformats/lollipop/manual/titlepag.tex | 84 +++ .../doc/otherformats/lollipop/manual/trace.tex | 61 ++ .../doc/otherformats/lollipop/tex-inde.xen | 259 +++++++ 22 files changed, 5209 insertions(+) create mode 100644 Master/texmf-dist/doc/otherformats/lollipop/README create mode 100644 Master/texmf-dist/doc/otherformats/lollipop/lollipop.tex create mode 100644 Master/texmf-dist/doc/otherformats/lollipop/manual/address.tex create mode 100644 Master/texmf-dist/doc/otherformats/lollipop/manual/appendix.tex create mode 100644 Master/texmf-dist/doc/otherformats/lollipop/manual/btxmac.tex create mode 100644 Master/texmf-dist/doc/otherformats/lollipop/manual/comm.tex create mode 100644 Master/texmf-dist/doc/otherformats/lollipop/manual/comment.tex create mode 100644 Master/texmf-dist/doc/otherformats/lollipop/manual/example.tex create mode 100644 Master/texmf-dist/doc/otherformats/lollipop/manual/extern.tex create mode 100644 Master/texmf-dist/doc/otherformats/lollipop/manual/head.tex create mode 100644 Master/texmf-dist/doc/otherformats/lollipop/manual/list.tex create mode 100644 Master/texmf-dist/doc/otherformats/lollipop/manual/lollipop-manual.bib create mode 100644 Master/texmf-dist/doc/otherformats/lollipop/manual/lollipop-manual.pdf create mode 100644 Master/texmf-dist/doc/otherformats/lollipop/manual/lollipop-manual.tex create mode 100644 Master/texmf-dist/doc/otherformats/lollipop/manual/mandefs.tex create mode 100644 Master/texmf-dist/doc/otherformats/lollipop/manual/opt.tex create mode 100644 Master/texmf-dist/doc/otherformats/lollipop/manual/out.tex create mode 100644 Master/texmf-dist/doc/otherformats/lollipop/manual/prelim.tex create mode 100644 Master/texmf-dist/doc/otherformats/lollipop/manual/struct.tex create mode 100644 Master/texmf-dist/doc/otherformats/lollipop/manual/titlepag.tex create mode 100644 Master/texmf-dist/doc/otherformats/lollipop/manual/trace.tex create mode 100644 Master/texmf-dist/doc/otherformats/lollipop/tex-inde.xen (limited to 'Master/texmf-dist/doc/otherformats/lollipop') diff --git a/Master/texmf-dist/doc/otherformats/lollipop/README b/Master/texmf-dist/doc/otherformats/lollipop/README new file mode 100644 index 00000000000..51cc0b3cd3e --- /dev/null +++ b/Master/texmf-dist/doc/otherformats/lollipop/README @@ -0,0 +1,80 @@ +About Lollipop and its manual. + +You have obtained a package containing the Lollipop format +and its manual. + + +The manual uses only Computer Modern, but there are a few +lines in `lollipop-manual.tex' that allow you to switch easily to Times +and Helvetica on Macintosh and Unix systems. + +The manual is a pretty good illustration of the power of +Lollipop, but there is also a file 'address.tex' which +contains example macros for an address book. + +Lollipop is still under development. The manual contains +some remarks about what is still to be done. If you have any +questions, remarks, suggestions (or if you want to voice +your appreciation :-) , feel free to contact me: + + Vafa Khalighi + persian-tex@tug.org + +Here is how much of TeX's memory you used: + 1194 strings out of 495844 + 16212 string characters out of 6190699 + 74602 words of memory out of 5000000 + 3495 multiletter control sequences out of 15000+600000 + 11241 words of font info for 40 fonts, out of 8000000 for 9000 + 19 hyphenation exceptions out of 8191 + 27i,4n,24p,187b,448s stack positions out of + 5000i,500n,10000p,200000b,80000s +Output written on lollipop-manual.pdf (59 pages, 334502 bytes). + + +History so far: + +0.9 October 1992, first public release + +0.91 Unannounced update + TeX3 based lolplain + penalties and white space in embedded constructs + splittopskip set equal to topskip + +0.92 November 1992, update for friends and family + Copyright notices added + math family setting for \rm, \bf, \tt + bugs in penalties corrected + +0.93 December 1992, official update + Lots of nobreaks in pre/post-tex material of constructs + Synonym counters repaired + Topskip and raggedbottom in state of repair + +0.94 December 1992, unofficial update + Adaptive distances + +0.95 January 1993, unofficial update + Short titles, rewritten external files, + address book example format. + +0.97 4 April 2014, organized and updated + files and also generated various formats. + +0.98 6 April 2014, changed all lollipop filenames + to start with `lollipop' prefix, and fixed typewriter font. + +0.99 9 April 2014, improved ini files, and the error in + address.tex example fixed. + +1.00 11 April 2014, updated lollipop-plain.tex and manual. + +1.01 12 April 2014, Updated lollipop-text.tex (changed "#1 cs to \"#1 cs + to be compatible with plain; also we can not make + " active since it is used by xetex for font selection, new ini + file xelollipop.ini + +1.02 16 April 2014, Updated lollipop-text.tex (defined \EveryParagraph, + \EveryMath, and \EveryDisplay), defined \PointSizeScriptSizes:12 + +1.03 19 April 2014, Fixed the wrong numbering of nested enumerate lists \ No newline at end of file diff --git a/Master/texmf-dist/doc/otherformats/lollipop/lollipop.tex b/Master/texmf-dist/doc/otherformats/lollipop/lollipop.tex new file mode 100644 index 00000000000..842b0123407 --- /dev/null +++ b/Master/texmf-dist/doc/otherformats/lollipop/lollipop.tex @@ -0,0 +1,129 @@ +% lollipop.tex; master file for the Lollipop tex format. +% This file and all input files and all files for the manual +% (with the exception of hyphen.tex and btxmac.tex) +% copyright 1992/3 Victor Eijkhout +% copyright 2014 Vafa Khalighi +% +% +% This program is free software: you can redistribute it and/or modify +% it under the terms of the GNU General Public License as published by +% the Free Software Foundation, either version 3 of the License, or +% (at your option) any later version. +% +% This program is distributed in the hope that it will be useful, +% but WITHOUT ANY WARRANTY; without even the implied warranty of +% MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the +% GNU General Public License for more details. +% +% You should have received a copy of the GNU General Public License +% along with this program. If not, see . +% +% +%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%% +%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%% +%%%%%%%%%%%%%%%% L O L L I P O P T E X %%%%%%%%%%%%%%%%%% +%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%% +%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%% +% +% o +% L O L L I P O P +% | | +% +\catcode`\@=11 + +\input lollipop-plain + +\input lollipop-tools + +\input lollipop-define + +\input lollipop-fonts +\input lollipop-fontdefs + +\input lollipop-text + +\input lollipop-document + +\input lollipop-heading + +\input lollipop-output + +\input lollipop-float + +\input lollipop-lists + +%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%% +\frenchspacing +\showboxdepth=7 \showboxbreadth=300 +\errorcontextlines=\maxdimen + +\let\willbeunhskip\unhskip + +\Typeface:ComputerModern +\Pointsize:10 +\Style:bold \Style:slant \Style:italic \Style:roman + +\Distance:verbatimwhiteleft=levelindent +\Distance:verbatimwhitebefore={0pt plus 1pt} +\Distance:verbatimwhiteafter={0pt plus 1pt} + +%\tracingmacros=2\tracingcommands\tracingmacros +\DefineTextBlock:Ver + whitebefore:verbatimwhitebefore whiteafter:verbatimwhiteafter + breakbefore:200 breakafter:-100 + whiteleft:verbatimwhiteleft + command:vVer text Stop + +\DefinePageGrid:RightPage height:page=8in width:page=5in + textband:start text textband:stop + vwhite:12pt + band:start PageCounter band:stop + Stop +\RightPage + +\hyphenation{Eijk-hout dis-cre-tio-na-ry al-ign-ment met-hod + met-hods} + +% v0.9 First public release October 1992 +% v0.91 TeX3 based lolplain, penalties in embedded constructs, +% splittopskip +% v0.92 Copyright notices added, math family setting, +% bugs in penalties corrected +% v0.93 Nobreaks in constructs, synonym counters, start floats +% v0.94 Adaptive distances and counters +% v0.95 BibTeX, short titles, improved external handling, +% \CurrentOutput changed +% v0.96 repair: counters, ToExternal, option:title=Smthng, +% changed copyright status! fontdefs file, late externals +% EmptyList -> IsEmp... +% +% v0.97 Update and organized files and generated various +% formats for Lollipop. +% +% v0.98 Changed filenames; the new filename has now +% "lollipop-" prefix, and fixed typewriter font. +% +% v0.99 Improved ini files, and the error in address.tex +% example fixed. +% +% v1.00 Updated lollipop-plain.tex. +% +% v1.01 Updated lollipop-text.tex (changed "#1 cs to \"#1 cs +% to be compatible with plain; also we can not make +% " active since it is used by xetex for font selection, +% new ini file xelollipop.ini +% +%v1.02 Updated lollipop-text.tex (defined \EveryParagraph, +% \EveryMath, and \EveryDisplay), defined +% \PointSizeScriptSizes:12 +% +%v1.03 Fixed the wrong numbering of nested enumerate lists +% +\edef\fmtname{\lolli@name}%defined in Tools +\def\fmtversion{v1.03, 19 April 2014} +\append@to@list{everyjob}{\message{ +>>>> This is Lollipop TeX (\fmtversion) <<<<}} + +\makeatother +\errorstopmode +\endinput diff --git a/Master/texmf-dist/doc/otherformats/lollipop/manual/address.tex b/Master/texmf-dist/doc/otherformats/lollipop/manual/address.tex new file mode 100644 index 00000000000..26da950a505 --- /dev/null +++ b/Master/texmf-dist/doc/otherformats/lollipop/manual/address.tex @@ -0,0 +1,187 @@ +% address book macros +% copyright 1993 Victor Eijkhout +% copyright 2014 Vafa Khalighi +% +% +% This program is free software: you can redistribute it and/or modify +% it under the terms of the GNU General Public License as published by +% the Free Software Foundation, either version 3 of the License, or +% (at your option) any later version. +% +% This program is distributed in the hope that it will be useful, +% but WITHOUT ANY WARRANTY; without even the implied warranty of +% MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the +% GNU General Public License for more details. +% +% You should have received a copy of the GNU General Public License +% along with this program. If not, see . +% +% +% These macros are based on the Lollipop macro package, +% copyright 1992/3 Victor Eijkhout +% copyright 2014 Vafa Khalighi +% +% Format this file twice to get external files right. +% + +% Some general options. +% Please use another typeface if you have it! +% +\Distance:whitebefore=0pt \Distance:whiteafter=0pt +\AlwaysIndent:no \FlushRight:no +%\TypeFace:macHelvetica \PointSize:7 \Style:roman +\TypeFace:ComputerSans \PointSize:8 \Style:roman +\def\\{,\Spaces:1 } + +% The page is four columns, no footers etc +% +\DefinePageGrid:ThePage width:page=6.5in height:page=5in + textband:start text white:10pt text white:10pt + text white:10pt text textband:stop Stop + +% The main macro is the text block \Entity, representing one item +% in the address book. +% +\DefineTextBlock:Entity HasTitle:short + whitebefore:{6pt plus 6pt minus 3pt} whiteafter:whitebefore + line:start rule:v={height 7pt width7pt depth0pt} Spaces:2 + Style:italic title line:stop Stop + +% Data in an entity is formatted as a number of headings. +% We declare all headings to be embedded, ie, they form a paragraph. +% The 'nomarks' option is to prevent memory overflow. +% +\OptionsMacro:embed=embedded:yes nomarks + whitebefore:0pt whiteafter:0pt Stop +\DefineHeading:phone HasTitle:short macro:embed + literal:phone : Spaces:1.5 title , Spaces:2 Stop +\DefineHeading:fax HasTitle:short macro:embed + literal:fax : Spaces:1.5 title , Spaces:2 Stop +\DefineHeading:Address HasTitle:short macro:embed + title , Spaces:2 Stop +\DefineHeading:Note HasTitle:short macro:embed + ( title ) Spaces:2 Stop + +% Here's an example of non-standard handling of the title: +% email addresses are set in \tt, and can be broken differently +% +\def\breakemail{\hyphenchar\font=`. } +\DefineHeading:email HasTitle:short macro:embed + begingroup tt breakemail title endgroup , Spaces:2 Stop + +% This is invisible information; maybe later we'll do something +% with it. +\DefineHeading:Route HasTitle:short Stop + +% Here is the first really cute application. +% If a person is declared to be \At a certain company, then +% that fact is written out to an external file, which can be loaded +% later. +% +\DefineExternalFile:companies=ats +\def\WorksAt{Works at: } +\DefineHeading:At macro:embed + HasTitle:short WorksAt title Spaces:2 + external:companies title unhskip title:Entity unhskip external:stop Stop +% When the 'companies' file gets loaded the title only gets +% parsed by the macro \CompNam, and nothing else happens. +% The title is split into company and person; #1 becomes the name +% of a list to which #2 is added. +% +\def\CompNam#1\unhskip#2\unhskip{ + \if\UndefinedCS{#1}\NewList:{#1} \fi + \AppendToList:#1={#2\unhskip, } } +\DefineExternalItem:At file:companies + expandafter CompNam title Stop +% The company lists are later simply loaded; see below. + +% Even more complicated: birthdays. +% All birthdays are written to an external file. +% +\DefineExternalFile:births=brt +\DefineHeading:birthday HasTitle:short macro:embed + literal:Born : title Spaces:2 + external:births title unhskip title:Entity unhskip external:stop Stop +% Later every month becomes something like an entity; +% here is how we generate a token list for each month. +% +\def\month#1{\ifcase#1\or jan\or feb\or mar\or apr\or may\or jun\or + jul\or aug\or sep\or oct\or nov\or dec\fi} +\tempcounta=1 \loop\ifnum\tempcounta<13 + \xp\NewList\xp:\xp{\month\tempcounta} + \advance\tempcounta1 \repeat +% Formatting the caboodle means: +% -- loading the 'births' file +% -- formatting each month separately by \OneMonth +% which is essentially a call to the text block \Month +% +\def\AllBirths{\LoadExternalFile:births + \tempcounta=1 \loop\ifnum\tempcounta<13 + \OneMonth \advance\tempcounta1 \repeat} +\def\OneMonth{\xp\Month\month\tempcounta\par + \TheList:{\month\tempcounta} \>} +% Month is much like \Entity, just a bit different visually. +% +\DefineTextBlock:Month + whitebefore:{6pt plus 6pt minus 3pt} whiteafter:whitebefore + line:start rule:v={height 7pt width7pt depth0pt} Spaces:2 + Style:italic title Spaces:2 + fillup rule:v={height 7pt width7pt depth0pt} line:stop + Stop +% When the external file is loaded, every birthday is processed +% by \BirNam which splits it into #1 year #2 month #3 day and +% #4 person's name. This is then written to the list for the +% appropriate month. +% +\def\BirNam#1 #2 #3\unhskip #4\unhskip + {\tempcounta#2\relax + \AppendToList:{\month\tempcounta}={\JollyFellow #3 #4 (#1)\par} + } +\DefineExternalItem:birthday file:births + expandafter BirNam title Stop +\DefineHeading:JollyFellow title nomarks Stop + +% Phooeew! Now we can get down to business! + +\WriteExtern:yes +\Start +\LoadExternalFile:companies + +\Entity Adam Aardvark +\Address Page~1, English Language Dictionary +\> + +\Entity Barbara Beeton +\At Tugbt +\Note Editor in chief +\> + +\Entity Jane Doe +\email doe@re.mi.sol +\> + +\Entity John Doe +\phone +1 212 555 4141 +\> + +\Entity Victor Eijkhout +\Address Department of Computer Science, University of Tennessee +\phone +1 615 974 8298 +\At Tugbt +\Note merely associate editor +\email eijkhout@cs.utk.edu +\birthday 1959 11 29 +\> + +\Entity Elvis Presley +\birthday 1938(?) 01 08 +\> + +\Entity Tugboat +\TheList:Tugbt +\> + +\AllBirths + +\Stop + diff --git a/Master/texmf-dist/doc/otherformats/lollipop/manual/appendix.tex b/Master/texmf-dist/doc/otherformats/lollipop/manual/appendix.tex new file mode 100644 index 00000000000..80a998443fd --- /dev/null +++ b/Master/texmf-dist/doc/otherformats/lollipop/manual/appendix.tex @@ -0,0 +1,69 @@ +% appendix.tex copyright1992 Victor Eijkhout +% copyright 2014 Vafa Khalighi +% +% +% This program is free software: you can redistribute it and/or modify +% it under the terms of the GNU General Public License as published by +% the Free Software Foundation, either version 3 of the License, or +% (at your option) any later version. +% +% This program is distributed in the hope that it will be useful, +% but WITHOUT ANY WARRANTY; without even the implied warranty of +% MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the +% GNU General Public License for more details. +% +% You should have received a copy of the GNU General Public License +% along with this program. If not, see . +% +% +\Chapter Example styles + +To show you the strength of \Lollipop, this chapter collects a few +example style definitions. The first one is that of this manual. + +\Section The style definition for this book + +In case you were wondering how this book was typeset, here is the +full style definition. By the standards of what Lollipop can do it is +pretty pedestrian. + +One thing that may have provide intellectual titilation is the +definition of \cs{Example} and \cs{OutExample}. +It allowed me to keep the examples in sync with their output. + +Of course that +doesn't really rely on \Lollipop. It does illustrate the fact that +\Lollipop\ is interfaceable to arbitrary macros. (But don't try +loading \Lollipop\ on top of \LaTeX! On second thought, do. It +disables most of \LaTeX. Just kidding.) + +\begingroup \PointSize:8 \tt +\verbatimfile{mandefs.tex}\endgroup + +\Section[sec:address] Address book + +The following macros generate an address book. Several noteworthy +features: +\Itemize\item Most titles are short, that is, delimited by the line +end. + \item Since a page will now have several dozens of headings, the +number of marks placed will become a problem, therefore the option +\opt{nomarks} is included everywhere. Without this you would easily +have memory overflows. + \item The \cs{At} heading writes its information to an external +file. This is then parsed by the macro \cs{CompNam}. A~slight amount +of knowledge of Lollipop internals is used here for parameter parsing, +but not more than can be gleaned from simply looking at the external +file.\par + Then a token list is created for each company, and these lists are +printed somewhere down the file. This is a bit of \TeX\ programming +that is not quite elementary, but still \Lollipop saves you a lot of +work. + \> +If you want to see the output, run \TeX\ with Lollipop twice on the +\file{address.tex} file. + + \begingroup \PointSize:8 \tt +\verbatimfile{address.tex}\endgroup + +\endinput \ No newline at end of file diff --git a/Master/texmf-dist/doc/otherformats/lollipop/manual/btxmac.tex b/Master/texmf-dist/doc/otherformats/lollipop/manual/btxmac.tex new file mode 100644 index 00000000000..3093ed1a833 --- /dev/null +++ b/Master/texmf-dist/doc/otherformats/lollipop/manual/btxmac.tex @@ -0,0 +1,812 @@ +%% @texfile{ +%% author = "Karl Berry and Oren Patashnik", +%% version = "0.99h", +%% date = "24 Apr 1991", +%% filename = "btxmac.tex", +%% address = "Please use electronic mail", +%% checksum = "812 4053 30557", +%% email = "opbibtex@neon.stanford.edu", +%% codetable = "ISO/ASCII", +%% supported = "yes", +%% docstring = "Defines macros that make BibTeX work with plain TeX", +%% } +% BibTeX-for-TeX macros, version 0.99h, for BibTeX 0.99c, TeX 3.0 or later. +% Copyright (C) 1990--91 by Karl Berry and Oren Patashnik; all rights reserved. +% You may copy this file provided: that it's accompanied by the +% "BibTeXing" document, whose text is contained in the file `btxdoc.tex'; +% that any documentation you write for these macros also gives a +% reference for "BibTeXing"; and that either you make absolutely no +% changes to your copy, or if you do make changes, (1) you name the file +% something other than `btxmac.tex' and you remove all occurrences of +% `btxmac.tex' from the file, (2) you put, somewhere in the first twenty +% lines of the file, your name, along with an electronic address at which +% others who might use the file may reach you, and (3) you remove each +% occurrence of Oren's name and electronic address from this file. These +% restrictions help ensure that all standard versions of these macros are +% identical, and that Oren doesn't get deluged with inappropriate e-mail. +% +% This file, btxmac.tex, contains TeX macros that allow BibTeX, a +% bibliography program that was originally designed for use with LaTeX, +% to work with plain TeX. Please report any bugs (outright goofs, +% improvable macros, misfeatures, or unclear documentation) to Oren +% Patashnik (opbibtex@neon.stanford.edu). These macros will become +% frozen shortly after BibTeX version 1.00 is released. +% +% To use these macros you should be familiar with how BibTeX interacts +% with LaTeX, since BibTeX's interaction with TeX is very similar; that +% interaction is explained in the LaTeX manual. It also helps to +% have read "BibTeXing", the documentation that accompanies BibTeX. +% Then, if you want, you should redefine any of the macros that begin +% with `\bbl' or `\biblabel' or `\print' that you need to get formatting +% different from the default (the default settings are designed to +% accompany a bibliography style like BibTeX's standard style `plain'). +% The macros you might want to change are described briefly a few +% paragraphs hence. Finally, as long as you follow the guidelines given +% by the LaTeX manual and "BibTeXing", you simply \input btxmac. +% [Remember the general scheme: Running (La)TeX writes information on +% the .aux (auxiliary) file; then running BibTeX reads information from +% the .aux, .bst (style), and .bib (database) files, and writes +% information (the bibliography) on a .bbl file; then running (La)TeX +% incorporates the bibliography; then running (La)TeX once more fixes +% the remaining forward references into the bibliography. Thus, to get +% everything incorporated into your output, you'll have to run (La)TeX, +% BibTeX, (La)TeX, (La)TeX. (Standup, sitdown, fight, fight, fight.)] +% +% These macros can stand alone or they can be \input into macro packages +% like Eplain. If you want to try out these macros on the 0.99 version +% of the xampl.bib file that's distributed with BibTeX (that version of +% the file has no self-identification), you'll need to define \mbox, +% which is a LaTeX command, to be \hbox. +% +% +% HISTORY +% +% Karl Berry wrote the original version of these macros in 1989 and +% 1990, for use in his `Eplain' package. Oren Patashnik modified them +% slightly in July 1990, as part of the official BibTeX distribution. +% +% 1-Aug-90 Version 0.99a, not released to the general public. +% 14-Aug-90 0.99b, first general release. +% 26-Aug-90 0.99c, made \@undefinedmessage work with other macro packages. +% 6-Sep-90 0.99d, allowed for general formatting of bibliography labels, +% for general formatting of (in-text) citations, and for +% changing certain catcodes while reading the .aux file. +% 14-Nov-90 0.99e, changed the way \@setletters works, made some \new...'s +% non-outer, and changed the way Eplain reads this file. +% 12-Dec-90 0.99f, made \@resetnumerals change the `,' and `.' catcodes; and +% added \biblabelextrahang, \@getoptionalarg, and \bblsc. +% 11-Mar-91 0.99g, made a few minor changes required by the way Eplain reads +% this file, but no functional changes. +% 24-Apr-91 0.99h, inhibited the reading and writing of the .aux file if it +% isn't used or if the \noauxfile macro is defined, and +% removed some .aux-file-opening detritus; printed the +% cite-key of undefined citations in \tt font; changed the +% catcode of `_' inside \cite; and called \@resetnumerals +% from inside a group. +% +% +% The LaTeX-related commands defined in this file include (a) the four +% commands that a user types (\bibliography, \bibliographystyle, \cite, +% and \nocite); (b) the three commands that BibTeX looks for in the .aux +% file (\bibdata, \bibstyle, and \citation---there is a fourth command +% that BibTeX looks for, but that command is related to LaTeX's \include +% facility, so these macros ignore that command); and (c) a LaTeX +% command (\newcommand) that's written by one of the four standard +% bibliography styles (alpha). The definitions here are not exactly the +% same as the corresponding LaTeX definitions (those eight LaTeX +% definitions depend on a significant fraction of LaTeX itself). But +% the only substantial differences are with \newcommand, which here, +% without complaining, lets you redefine a preexisting control sequence +% (in LaTeX, \newcommand won't let you redefine a preexisting command), +% and which here doesn't make the control sequences it defines \long (in +% LaTeX, that happens automatically); there may also be other minor +% differences. To summarize: Unless you know what you're doing, you +% shouldn't define any control sequences with these eight names: +% +% \bibdata +% \bibliography +% \bibliographystyle +% \bibstyle +% \citation +% \cite +% \newcommand +% \nocite +% +% There are three other commands written by one or more of the four +% standard (plain, abbrv, alpha, unsrt) or four semistandard (acm, +% apalike, ieeetr, siam) bibliography styles; they take effect only +% within the bibliography, and are redefinable, as explained later: +% +% \em +% \newblock +% \sc +% +% There's one control sequence you might want to use (but not redefine) +% in redefining \biblabelprint: +% +% \biblabelwidth +% +% There are twelve other control sequences (explained later in more detail) +% that the macros of this file will use if you define them---you should +% define them after the \input btxmac command but before the \bibliography +% command. The first five begin with `\bbl' and affect fonts, spacing, +% and perhaps other characteristics of the bibliography; the next three +% begin with `\biblabel' and determine how labels are formatted in the +% bibliography; and the last four begin with `\print' and determine how +% the in-text citations are formatted: +% +% \bblem +% \bblhook +% \bblnewblock +% \bblrm +% \bblsc +% \biblabelcontents +% \biblabelextrahang +% \biblabelprint +% \printbetweencitations +% \printcitefinish +% \printcitenote +% \printcitestart +% +% If it's defined before the \input btxmac command, the control sequence +% below inhibits the reading and writing of the .aux file(s), and the +% issuing of related warning messages. Any definition will do. This +% feature might help when you're working on draft stages of a document: +% +% \noauxfile +% +% Here's another control sequence (it's described later), with an `@' +% in its name, that you probably won't want to redefine unless you are +% writing another macro package; if you do redefine it, however, do it +% before the \input btxmac command: +% +% \@undefinedmessage +% +% And here are still more control sequences that, should you already have +% them defined, might conflict with the way the btxmac.tex macros use them +% (but since each of these has an `@' in its name, it's unlikely that such +% conflicts will arise unless you intend them): +% +% \@auxfile \@auxfiledonefalse \@auxfiledonetrue +% \@bracketcheck \@citation \@cite +% \@citedef \@citelabel \@citewarningfalse +% \@citewarningtrue \@commandname \@continuenewcommand +% \@emptymarkA \@emptymarkB \@fileexistsfalse +% \@fileexiststrue \@finishcitedef \@finishtestfileexistence +% \@for \@forloop \@fornoop +% \@fortmp \@getoptionalarg \@@getoptionalarg +% \@gobble \@if@auxfiledone \if@citewarning +% \@ifempty \@@ifempty \if@fileexists +% \if@notfirstcitation \@iforloop \@innerdef +% \@innernewcount \@innernewdimen \@innernewif +% \@innernewwrite \@itemnum \@letter +% \@linenumber \@newcommandwithargs \@newcommand +% \@next \@nextwhile \@nil +% \@nnil \@notfirstcitationfalse \@notfirstcitationtrue +% \@numparams \@oldatcatcode \@onecitation +% \@optionalarg \@other \@paramdef +% \@readauxfile \@readbblfile \@resetnumerals +% \@scfont \@setletters \@spacesub +% \@startdef \@testfileexistence \@tokstostring +% \@ttsA \@ttsB \@ttsmarkA +% \@ttsmarkB \@undefined \@writeaux +% +% +% So to start things off we turn `@' into a letter (category code 11), +% keeping track of the old category code for future restoration. +% (Simply resetting it to 12 when we leave these macros is +% insufficient.) The use of `\cite' as a temporary control sequence is +% a kludge, but it's a reasonably simple way to accomplish what we need +% without possibly overwriting something (without an `@' in its name) +% that might already be defined. +% +\edef\cite{\the\catcode`@}% +\catcode`@ = 11 +\let\@oldatcatcode = \cite +\chardef\@letter = 11 +\chardef\@other = 12 +% +% +% Next come some things that will be useful later. +% +% Make an outer definition into an inner one (due to Chris Thompson). +% The arguments should be the control sequence to be defined, and the +% new of the \outer control sequence, as characters; the control +% sequence #1 is defined to be just the same as \csname#2\endcsname, but +% not \outer. For example, \@innerdef\innernewcount{newcount} would +% define \innernewcount to be a non-outer version of \newcount. +% +\def\@innerdef#1#2{\edef#1{\expandafter\noexpand\csname #2\endcsname}}% +% +% We use \@innerdef to make some of our allocations local, because +% Eplain includes our code inside a conditional. We put @'s in the +% names to minimize the (already small) chance of conflicts. +% +\@innerdef\@innernewcount{newcount}% +\@innerdef\@innernewdimen{newdimen}% +\@innerdef\@innernewif{newif}% +\@innerdef\@innernewwrite{newwrite}% +% +% +% Swallow one parameter. +% +\def\@gobble#1{}% +% +% +% Use TeX 3.0's \inputlineno to get the line number, for better error +% messages, but if we're using an old version of TeX, don't do anything. +% +\ifx\inputlineno\@undefined + \let\@linenumber = \empty % Pre-3.0. +\else + \def\@linenumber{\the\inputlineno:\space}% +\fi +% +% +% \@getoptionalarg\CS gets an optional argument from the input, enclosed +% in brackets, then expands \CS. We set \@optionalarg to \empty if we +% don't find one, otherwise to the text of the argument. This assumes +% the brackets don't have a funny category code. +% +\def\@getoptionalarg#1{\let\temp = #1\futurelet\next\@bracketcheck}% +\def\@bracketcheck{\begingroup + \if [\next + \aftergroup\@@getoptionalarg + \else + \global\let\@optionalarg = \empty + % + % We can't do the \aftergroup\temp after the \fi, because then the + % \temp gets in the way of reading the optional argument from the + % input, if we do have one. + \aftergroup\temp + \fi +\endgroup}% +% +\def\@@getoptionalarg[#1]{% + \def\@optionalarg{#1}% + \temp +}% +% +% +% \@tokstostring converts its argument into a list of character tokens. +% It uses no commands that are executed in the stomach, only expansions +% handled in the gullet. (This is necessary for use with \edef). +% +% Control sequences in the argument are not expanded. Blanks become a +% \spacesub. The argument shouldn't contain other special characters. +% +\def\@tokstostring#1{\@ttsA#1 \@ttsmarkA}% +% +% \@ttsA partitions a sequence of tokens into portions delimited by blanks. +% +\def\@ttsA#1 #2\@ttsmarkA{% + \@ifempty{#1}\else + \@ttsB #1\@ttsmarkB + % + \@ifempty{#2}\else + \@spacesub\@ttsA#2\@ttsmarkA + \fi + \fi +}% +% +% \@ttsB processes a sequence of tokens with no contained blanks. +% +\def\@ttsB#1{% + \ifx #1\@ttsmarkB\else + \string #1% + \expandafter\@ttsB + \fi +}% +% +% This is just so \ifx won't complain about an undefined control sequence. +% +\def\@ttsmarkB{\@ttsmarkB}% should never be expanded +% +% The expansion of this macro replaces spaces. +% +\def\@spacesub{+}% +% +% +% \@ifempty tests if it is given an argument. +% +\def\@ifempty#1{\@@ifempty #1\@emptymarkA\@emptymarkB}% +\def\@@ifempty#1#2\@emptymarkB{\ifx #1\@emptymarkA}% +% +\def\@emptymarkA{\@emptymarkA}% Again, so \ifx won't complain. +% +% +% From LaTeX. +% +\def\@nnil{\@nil}% +\def\@fornoop#1\@@#2#3{}% +% +\def\@for#1:=#2\do#3{% + \edef\@fortmp{#2}% + \ifx\@fortmp\empty \else + \expandafter\@forloop#2,\@nil,\@nil\@@#1{#3}% + \fi +}% +% +\def\@forloop#1,#2,#3\@@#4#5{\def#4{#1}\ifx #4\@nnil \else + #5\def#4{#2}\ifx #4\@nnil \else#5\@iforloop #3\@@#4{#5}\fi\fi +}% +% +\def\@iforloop#1,#2\@@#3#4{\def#3{#1}\ifx #3\@nnil + \let\@nextwhile=\@fornoop \else + #4\relax\let\@nextwhile=\@iforloop\fi\@nextwhile#2\@@#3{#4}% +}% +% +% +% This macro tests if a file \jobname.#1 exists, and sets +% \if@fileexists appropriately. If an optional argument is given, it is +% used as the root part of the filename instead of \jobname. +% +\@innernewif\if@fileexists +% +\def\@testfileexistence{\@getoptionalarg\@finishtestfileexistence}% +\def\@finishtestfileexistence#1{% + \begingroup + \def\extension{#1}% + \immediate\openin0 = + \ifx\@optionalarg\empty\jobname\else\@optionalarg\fi + \ifx\extension\empty \else .#1\fi + \space + \ifeof 0 + \global\@fileexistsfalse + \else + \global\@fileexiststrue + \fi + \immediate\closein0 + \endgroup +}% +% +% +%% [[[start of BibTeX-specific stuff]]] +% +% Now come the four main LaTeX commands and their associated .aux +% commands. Just as in LaTeX, \bibliographystyle defines the BibTeX +% style name (.bst file, that is), and \bibliography defines the +% database (.bib) file(s). The corresponding .aux-file commands are +% \bibstyle and \bibdata, which are there only for BibTeX's (but not +% LaTeX's) use. +% +\def\bibliographystyle#1{% + \@readauxfile + \@writeaux{\string\bibstyle{#1}}% +}% +\let\bibstyle = \@gobble +% +% As well as writing the \bibdata command to tell BibTeX +% which .bib files to read, we read the .bbl file that +% BibTeX (or a person, conceivably) has produced. +% +\def\bibliography#1{% + \@readauxfile + \@writeaux{\string\bibdata{#1}}% + \@testfileexistence{bbl}% + \if@fileexists + \@readbblfile + \fi +}% +\let\bibdata = \@gobble +% +% The \nocite{label,label,...} command writes its argument to \@auxfile, +% unless instructed not to, but produces no text in the document. Both +% the \nocite and \cite commands produce \citation commands in the .aux file. +% +\def\nocite#1{% + \@readauxfile + \@writeaux{\string\citation{#1}}% +}% +% +\@innernewif\if@notfirstcitation +% +% \cite[note]{label,label,...} produces the citations for the labels as +% well. If the optional argument `note' is present, it's added after +% the labels. Since \cite calls \nocite before doing any writing, it +% doesn't need to call \@readauxfile. We change the category code of +% `_' so that the dummy definition given to the citation label doesn't +% include a subcript character; that would cause TeX to complain. +% +\def\cite{\begingroup\catcode`_ = \@letter \@getoptionalarg\@cite}% +% +% Typeset the citations for the labels in #1, followed by the note, if +% it exists. To change the citation's format in the text, redefine one +% or more `\print...' macros, whose defaults appear later in this file. +% +\def\@cite#1{% + \nocite{#1}% + % Start printing the text, beginning with a left bracket by default. + % + \printcitestart + \@notfirstcitationfalse + \@for \@citation :=#1\do + {% + \expandafter\@onecitation\@citation\@@ + }% + \ifx\empty\@optionalarg\else + \printcitenote{\@optionalarg}% + \fi + \printcitefinish + \endgroup +}% +% +\def\@onecitation#1\@@{% + \if@notfirstcitation + \printbetweencitations + \fi + % + \expandafter \ifx \csname\@citelabel{#1}\endcsname \relax + \if@citewarning + \message{\@linenumber Undefined citation `#1'.}% + \fi + % Give it a dummy definition: + \expandafter\gdef\csname\@citelabel{#1}\endcsname{% + {\tt \nobreak\hskip0pt#1\nobreak\hskip0pt}}% + \fi + % Now produce the text, whether it was undefined or not. + \csname\@citelabel{#1}\endcsname + \@notfirstcitationtrue +}% +% +% Given a label `foo', the macro `\b@foo' is supposed to +% hold the text that should be produced. +% +\def\@citelabel#1{\@tokstostring{b@#1}}% +% +% So, how does a citation label get defined? When we read the .bbl file +% (below), a \bibitem writes out a \@citedef command. And when we read +% the \@citedef, we define \@citelabel{#1}, where #1 is the user's +% label. But we have to be careful when reading the \@citedef, because +% the second argument might have accents or other commands with numbers +% as arguments. We have given the numerals category code 11 for reading +% the .aux file, and that prevents them from being recognized as TeX +% s. Similarly for the other characters that can be part of a +% . So we have to reset the category codes before reading the +% second argument. We also have to reset them back to letters when we +% finish reading the \@citedef's, because there might be more labels +% with numerals in them defined afterwards in the .aux file, put there +% by Eplain or whatever. +% +\def\@citedef#1{% + \begingroup + \@resetnumerals + \@finishcitedef{#1}% +}% +\def\@finishcitedef#1#2{% + \expandafter\gdef\csname\@citelabel{#1}\endcsname{#2}% + \endgroup +}% +\def\@resetnumerals{% + \catcode`0 = \@other \catcode`1 = \@other \catcode`2 = \@other + \catcode`3 = \@other \catcode`4 = \@other \catcode`5 = \@other + \catcode`6 = \@other \catcode`7 = \@other \catcode`8 = \@other + \catcode`9 = \@other \catcode`" = \@other \catcode`' = \@other + \catcode`` = \@other \catcode`, = \@other \catcode`. = \@other +}% +% +% +% Reading the .bbl file also produces the typeset bibliography. Please +% notice, however, that we do not produce the title for the references +% (e.g., `References'), as LaTeX does. The formatting and spacing of +% that title, whether it should go into the headline, and so on, are all +% things determined by your format. We cannot know those things in +% advance. If you wish, you can define \bblhook to produce the title. +% Or just do it before the \bibliography command. +% +\def\@readbblfile{% + % Define a counter to tell us which item number we are on. + \@innernewcount\@itemnum + % + \begingroup + \def\begin##1##2{% + % ##1 is just `thebibliography'. + % ##2 is the widest label. + % We set (new dimen) \biblabelwidth based on the widest label + \setbox0 = \hbox{\biblabelcontents{##2}}% + \biblabelwidth = \wd0 + }% + \def\end##1{}% ##1 is `thebibliography' again. + % + % Here we have two possibilities: + % \bibitem[typesetlabel]{citationlabel} + % \bibitem{citationlabel} + % If we have the second of these, the citations are numbered, starting + % from one; we use our own count register \@itemnum for this. + % + \@itemnum = 0 + \def\bibitem{\futurelet\next\@bibitem}% + \def\@bibitem{% + \begingroup \if [\next + \aftergroup\@alphabibitem + \else + \aftergroup\@numberedbibitem + \fi \endgroup + }% + \def\@alphabibitem[##1]##2{% + % Need \xdef here for various reasons. + \expandafter \xdef\csname\@citelabel{##2}\endcsname {##1}% + \@finishbibitem{##2}% + }% + % + \def\@numberedbibitem##1{% + \advance\@itemnum by 1 + \expandafter \xdef\csname\@citelabel{##1}\endcsname{\number\@itemnum}% + \@finishbibitem{##1}% + }% + % + \def\@finishbibitem##1{% + \biblabelprint{\csname\@citelabel{##1}\endcsname}% + \@writeaux{\string\@citedef{##1}{\csname\@citelabel{##1}\endcsname}}% + \ignorespaces + }% + % + % Do the printing (we're producing the bibliography, remember). + % + \let\em = \bblem + \let\newblock = \bblnewblock + \let\sc = \bblsc + % Punctuation won't affect spacing; + \frenchspacing + % the penalties below are from LaTeX's [article,book,report].sty; + \clubpenalty = 4000 \widowpenalty = 4000 + % the next two values come from LaTeX's \sloppy command; + \tolerance = 10000 \hfuzz = .5pt + \everypar = {\hangindent = \biblabelwidth + \advance\hangindent by \biblabelextrahang}% + \bblrm + % the \parskip is a guess at what looks good; + \parskip = 1.5ex plus .5ex minus .5ex + % and the .5em matches the \enspace of \biblabelprint below. + \biblabelextrahang = .5em + \bblhook + % + \input \jobname.bbl + \endgroup +}% +% +% The widest label's width is useful for redefining \biblabelprint; you +% redefine \biblabelwidth, in effect, by redefining the +% \biblabelcontents macro that appears below. And \biblabelextrahang, +% which is redefinable inside \bblhook, is added to \biblabelwidth to +% determine the amount of hanging indentation. +% +\@innernewdimen\biblabelwidth +\@innernewdimen\biblabelextrahang +% +% Now come the main macros that are related to the printing of the +% bibliography. Since you might want to redefine them, they are given +% default definitions outside of \@readbblfile. +% +% The first one controls the printing of a bibliography entry's label. +% If you change it, make sure that it starts with something like +% \noindent or \indent that puts TeX into horizontal mode (even if the +% label itself is empty); otherwise, the hanging indentation will get +% messed up in certain circumstances. +% +\def\biblabelprint#1{% + \noindent\hbox to \biblabelwidth{\biblabelcontents{#1}\hss}\enspace}% +% +% By default the labels are typeset in \bblrm, and enclosed in brackets. +% +\def\biblabelcontents#1{\bblrm [#1]}% +% +% The main text, too, is typeset using \bblrm, which is \rm by default. +% +\def\bblrm{\rm}% +% +% Emphasis for producing, e.g., titles, is done with \it by default. +% +\def\bblem{\it}% +% +% Some styles use a caps-and-small-caps font for author names. LaTeX +% defines an \sc command but plain TeX doesn't, so we need one here. +% The definition below doesn't load the font unless it's needed, but it +% tries to load only the 10pt version, because it might not exist at +% other point sizes. +% +\def\bblsc{\ifx\@scfont\@undefined + \font\@scfont = cmcsc10 + \fi + \@scfont +}% +% +% The major parts of an entry are separated with \bblnewblock. The +% numbers below are taken from LaTeX's `article' style. +% +\def\bblnewblock{\hskip .11em plus .33em minus .07em}% +% +% Here's where you stick any other bibliography-formatting goodies, or +% redefine the values above. +% +\let\bblhook = \empty +% +% +% Here are the four default definitions for formatting the in-text +% citations. These are what you redefine (after your \input btxmac but +% before your \bibliography) to get parens instead of brackets, or +% superscripts, or footnotes, or whatever. +% +\def\printcitestart{[}% left bracket +\def\printcitefinish{]}% right bracket +\def\printbetweencitations{, }% comma, space +\def\printcitenote#1{, #1}% comma, space, note (if it exists) +% +% That scheme is pretty flexible. For example you could use +% \def\printcitestart{$^\bgroup} +% \def\printcitefinish{\egroup$} +% \def\printbetweencitations{,} +% \def\printcitenote#1{\hbox{\sevenrm\space (#1)}} +% to get superscripted in-text citations. To get something radically +% different, however, you'll have to define your own \cite command. +% +% When we read this from the .aux file, \citation means nothing. +% +\let\citation = \@gobble +% +% +% Now comes the stuff for dealing with LaTeX's \newcommand. As +% mentioned earlier, this \newcommand will redefine a preexisting +% command; that's different from how LaTeX's \newcommand behaves. +% +\@innernewcount\@numparams +% +% \newcommand{\foo}[n]{text} defines the control sequence \foo to have +% n parameters, and replacement text `text'. +% +\def\newcommand#1{% + \def\@commandname{#1}% + \futurelet\@next\@continuenewcommand +}% +% +% Figure out if this definition has parameters. +% +\def\@continuenewcommand{\begingroup + \if [\@next + \aftergroup\@newcommandwithargs + \else + \global\@numparams = 0 + \aftergroup\@newcommand + \fi +\endgroup}% +% +\def\@newcommandwithargs[#1]{% + \global\@numparams = #1 + \@newcommand +}% +% +% \@numparams is how many arguments this command has. The name of the +% command is \@commandname. The replacement text for the new macro is #1. +% +\def\@newcommand#1{% + \def\@startdef{\expandafter\edef\@commandname}% + \ifnum\@numparams=0 + \let\@paramdef = \empty + \else + \ifnum\@numparams>9 + \errmessage{\the\@numparams\space is too many parameters}% + \else + \ifnum\@numparams<0 + \errmessage{\the\@numparams\space is too few parameters}% + \else + \edef\@paramdef{% + % This is disgusting, but \loop doesn't work inside \edef, + % because \body isn't defined. + % + \ifcase\@numparams + \empty No arguments. + \or ####1% + \or ####1####2% + \or ####1####2####3% + \or ####1####2####3####4% + \or ####1####2####3####4####5% + \or ####1####2####3####4####5####6% + \or ####1####2####3####4####5####6####7% + \or ####1####2####3####4####5####6####7####8% + \or ####1####2####3####4####5####6####7####8####9% + \fi + }% + \fi + \fi + \fi + \expandafter\@startdef\@paramdef{#1}% +}% +% +%% [[[end of BibTeX-specific stuff]]] +% +% +% Names of references (arguments given in the \cite and \nocite +% commands) and file names (arguments given in the \bibliography and +% \bibliographystyle commands) are recorded in \jobname.aux, called the +% \@auxfile in these macros. Here's how they get read in. +% +\def\@readauxfile{% + \if@auxfiledone \else % remember: \@auxfiledonetrue if \noauxfile is defined + \global\@auxfiledonetrue + \@testfileexistence{aux}% + \if@fileexists + \begingroup + % Because we might be in horizontal mode when \@readauxfile + % is called (if it's in response to a \cite or \nocite), we + % want to ignore all the would-be spaces at the ends of + % lines in the aux file. Fortunately, there are never any + % (non-pathological) cases where an end-of-line might + % actually be desired. If you really need to do something + % strange, you can redefine \@setletters to do something + % besides what it does now (this is intentionally left as + % being somewhat painful to do). + \endlinechar = -1 + \@setletters + \input \jobname.aux + \endgroup + \else + \message{\@undefinedmessage}% + \global\@citewarningfalse + \fi + \immediate\openout\@auxfile = \jobname.aux + \fi +}% +% +% The \@readauxfile macro does all that work the first time it's called. +% Since it's called once for every \cite, \nocite, \bibliography, and +% \bibliographystyle command that the user issues, we need to remember +% whether the work's been done. It's considered done if we're not to do +% it---that is, if \noauxfile is defined. +% +\newif\if@auxfiledone +\ifx\noauxfile\@undefined \else \@auxfiledonetrue\fi +% +% Since lots of characters are allowable inside reference names, and +% since a reference name can get converted into a control sequence, +% \@readauxfile must treat many characters as letters. It does that by +% calling \@setletters, which changes the category code of all \@other +% characters to \@letter. The 128/256 business arises because character +% codes go up to 256 starting with TeX 3.0, but up to only 128 with +% earlier versions. +% +\def\@setletters{% + \count255 = 0 + \edef\temp{\ifx\inputlineno\@undefined 128\else 256\fi}% + \loop + \ifnum\catcode\count255 = \@other + \catcode\count255 = \@letter + \fi + \advance\count255 by 1 + \ifnum\count255<\temp + \repeat + % The Eplain package uses underscores to construct the label names. + \catcode`\_ = \@letter +}% +% +% It's conceivable you'd want to change how other characters are read; +% to do that, change their category code before doing \input btxmac. +% +% +% After reading the .aux file, \@readauxfile opens it for writing. +% The \@writeaux macro does the actual writing (as long as +% \noauxfile is undefined). +% +\@innernewwrite\@auxfile +\def\@writeaux#1{\ifx\noauxfile\@undefined \write\@auxfile{#1}\fi}% +% +% +% A macro package that uses btxmac.tex might define +% \@undefinedmessage (before doing an \input btxmac). +% +\ifx\@undefinedmessage\@undefined + \def\@undefinedmessage{No .aux file; I won't give you warnings about + undefined citations.}% +\fi +% +% Even if citations are undefined, we want to complain only if +% \@citewarningtrue. The default is to set \@citewarningtrue unless +% \noauxfile is defined. Again, a macro package that uses +% btxmac.tex might want to redefine this. +% +\@innernewif\if@citewarning +\ifx\noauxfile\@undefined \@citewarningtrue\fi +% +% +% Finally, before leaving we restore @'s old category code. +% +\catcode`@ = \@oldatcatcode diff --git a/Master/texmf-dist/doc/otherformats/lollipop/manual/comm.tex b/Master/texmf-dist/doc/otherformats/lollipop/manual/comm.tex new file mode 100644 index 00000000000..5fba81be50d --- /dev/null +++ b/Master/texmf-dist/doc/otherformats/lollipop/manual/comm.tex @@ -0,0 +1,642 @@ +% comm.tex copyright 1992 Victor Eijkhout +% copyright 2014 Vafa Khalighi +% +% +% This program is free software: you can redistribute it and/or modify +% it under the terms of the GNU General Public License as published by +% the Free Software Foundation, either version 3 of the License, or +% (at your option) any later version. +% +% This program is distributed in the hope that it will be useful, +% but WITHOUT ANY WARRANTY; without even the implied warranty of +% MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the +% GNU General Public License for more details. +% +% You should have received a copy of the GNU General Public License +% along with this program. If not, see . +% +% +\Chapter Commands + +\Section[sec:counters] Counters + +Counters can be declared explicitly by the user, but more often they +are defined automatically in some generic construct: + +The \cs{Foo} defined by +\Ver>\DefineBar:Foo ... + counter:i ... + Stop\NewCounter:Things +for instance +\Ver>\CounterRepresentation:Things=i\CounterRepresentation:Theorem=Lemma\StartCounter:things\StepCounter:things\BackStepCounter:things\SetCounter:things=5\AddToCounter:things=7\NewCounter:Favourite +\AddToCounter:things=FavouriteValue\NewCounter:MyThings\GoverningCounter:SubSection=Section\label[bar]> will make +\ver>\ref[bar]> refer to the value of the counter most recently +changed. The way the counter is referenced can be altered by the +\opt{label} option in generic constructs; see +section~\ref[sec:opt:label]. + +For generic constructs with a counter no explicit \refcs{label} commands +need to be given; such commands take an optional argument with the +label key: +\Ver>\Section[sec:examples] Examples\AdaptiveCounter:LastPage\SetCounter:LastPage=PageValue +\Enumerate \SetCounter:item=-1 +\item ... + +The most common change of font is a change in style. Therefore, +issuing a command such as \Ver>\Style:bold\Typeface:GoudyOldStyle\PointSize:28 +L\kern -.3em\raise .35ex\hbox {\script A}\kern -.1em\TeX\PointSizeScriptSizes:10=10,7,5 + +Here is the definition of the Computer Modern typeface: + +\Ver> +\DefineTypeface{ComputerModern}{cm} + {roman:r; slant:sl; italic:ti; mitalic:mi; bold:bx; typewriter:tt; + default:r;} + {<6:5; <7:6; <8:7; <9:8; <10:9; <11:10; + <12:10 \scaled\magstephalf; + <14:10 \scaled\magstep1; <16:10 \scaled\magstep2; + <20:10 \scaled\magstep3; >19:10 \scaled\magstep4; + default:10;}\makeatletter +\DefineTypeface{Compu ... + ... + default:10;} + [\ifStyle:italic \ifnum\Fsize<7 ti7\fi\fi + \ifStyle:typewriter \ifnum\Fsize<8 tt8\fi\fi]\makeatletter +\DefineTypeface{psHelvetica}{helv} + {roman:; italic:i; mitalic:i; bold:b; default:;} + {default: at \Fsize pt;} +\makeatother\DefineFont:name=face,size,style\def\name{\TypeFace:face \PointSize:size \Style:style } +\def\tt{\Typeface:ComputerModern \Style:typewriter }\BaselineSkipPointSizeRatio:1.3\SetPointSizeBaselineSkip:9=12\AlwaysIndent:no>. + +\SubSection[sec:basic-indent] Basic indent + +There is a quantity \refcs{basicindent} that is used on the first +indentation level (see the next section for an explanation of these +levels). At the start of a document it is set to the then current +value of \cs{parindent}. You can override that by +\refcs{BasicIndentIsSet}: give +\Ver>\BasicIndentIsSet:no] +\Distance:basicindent=25pt +\TestList\item Level one \TestList\item Level two +\TestList\item Level three\>] +\ExampleStop + +The amount of +indentation on a certain level can be set explicitly with +\refcs{LevelIndent}. + +\Example +\Distance:basicindent=15pt +\LevelIndent:2=20pt +\DefineList:TestList item:left itemCounter item:stop Stop +\TestList\item Level one \TestList\item Level two +\TestList\item Level three\>] +\ExampleStop + +In fact, sometimes you may want to know the name of the indentation +on a certain level. This is a control sequence such as +\refcs{levelindentii} for the second level. You get the idea. + +\SubSection Manipulating the indentation level + +Every once in a while it can be useful to move to a next indentation +level, or to return to a previous level. For this +the two commands \refcs{PushIndentLevel} and \refcs{PopIndentLevel} are +available. One application is for `interrupted lists': + +\Example +\Itemize\item One +{\par\PopIndentLevel Interrupted text!\par} +\item Two\> +\ExampleStop + +See chapter~\ref[chap:external-files] for examples of the use of +\cs{PushIndentLevel} + +\Section Margins + +By default, \Lollipop\ tries to keep straight margins. You can change +its mind about that by \refcs{FlushRight} and \refcs{FlushLeft} +which are tests: +\Ver>\FlushRight:no \FlushLeft:no\vwhite:15pt\hwhite:{15pt minus 3pt} line:start litteral:foo fillup litteral:bar line:stop\def\white:#1 {\@white{#1}}\Distance:oneline=15pt\DefineFoo:Bar whitebefore:oneline whiteafter:oneline\Distance:oneline={15pt plus 2pt minus 3pt}\Distance:whitebefore=oneline\DefineHeading:Section ... + block:start [...] fillupto:widelabel title\AdaptiveDistance:WidestLabel=15pt +\def\MeasureLabel{\ifdim\BlockWidth>\WidestLabel + \global\WidestLabel\BlockWidth\fi} +\DefineHeading:Section + whitebefore:{20pt plus 2pt} whiteafter:14pt + line:start PointSize:14 Style:italic + block:start block:start ChapterCounter . SectionCounter + Spaces:1 block:stop MeasureLabel + fillupto:WidestLabel + title line:stop + external:contents title external:stop + label:start ChapterCounter . SectionCounter label:stop + Stop\StartCommand{\Distance:parindent=WidestLabel }\InputFile:parta +\InputFile:partb\DefineTest:SomethingTheMatter\SomethingTheMatter:yes\SomethingTheMatter:no\ifSomethingTheMatter ... \else ... \fi\DefineFoo:Bar [...] + ifSomethingTheMatter [...] fi + [...] Stop\NewList:mylist\TheList:mylist\AppendToList:mylist={my data} + +\SubSection Programming Tools + +A few commands are useful for the Lollipop style designer who wants +to write more sophisticated macros (see for instance the address book +macros in the last chapter). + +\Description\item \refcs{UndefinedCS} +is a test on control sequences. + \Ver>\if\UndefinedCS{testcs} ... \else ... \fi\if\EqualString{one}{two} ... \else ... \fi\if\EqualStringX{one}{two} ... \else ... \fi\if\StringBefore{one}{two} ... \else ... \fi\if\NextChar[{\macro}{\macro[default]} ...\if\IsEmptyList{#1} ...\macro{}>. + \item\refcs{loop} +can be used for repeated execution of statements. (Users of plaing +\TeX\ may recognize this macro; it is slightly extended here +to include the \cs{else} case.) It is +used as: + \Ver>\loop ... \if ... \repeat\loop ... \if ... \else ... \repeat + +\SubSection[sec:everypar] \cs{everypar} + +The \TeX\ primitive \cs{everypar} should not be used any more. +Instead use the command \refcs{EveryParagraph} as if you are setting +a token list: + \Ver>\EveryParagraph{ ... }\EveryMath{ ... }\EveryDisplay{ ... }. +% +% + +\def\makeinnocent#1{\catcode`#1=12 } +\def\csarg#1#2{\expandafter#1\csname#2\endcsname} + +\def\TreatAsComment#1{\begingroup + \def\CurrentComment{#1}% + \let\do\makeinnocent \dospecials + \makeinnocent\^^L% and whatever other special cases + \endlinechar`\^^M \catcode`\^^M=12 \xComment} +{\catcode`\^^M=12 \endlinechar=-1 % + \gdef\xComment#1^^M{\def\test{#1} + \csarg\ifx{PlainEnd\CurrentComment Test}\test + \def\next{\endgroup\AfterComment}% + \else \csarg\ifx{LolliEnd\CurrentComment Test}\test + \def\next{\endgroup\AfterComment}% + \else \csarg\ifx{LaLaEnd\CurrentComment Test}\test + \edef\next{\endgroup\noexpand\AfterComment + \noexpand\end{\CurrentComment}} + \else \ThisComment{#1}\let\next\xComment + \fi \fi \fi \next} +} + +\def\includecomment + #1{\message{Including comment '#1'}% + \expandafter\def\csname#1\endcsname{}% + \expandafter\def\csname end#1\endcsname{}} +\def\excludecomment + #1{\message{Excluding comment '#1'}% + \csarg\def{#1}{\let\AfterComment\relax + \def\ThisComment####1{}\TreatAsComment{#1}}% + {\escapechar=-1\relax + \csarg\xdef{PlainEnd#1Test}{\string\\end#1}% + \csarg\xdef{LolliEnd#1Test}{\string\\#1Stop}% + \csarg\xdef{LaLaEnd#1Test}{\string\\end\string\{#1\string\}}% + }} +\long\def\specialcomment + #1#2#3{\message{Special comment '#1'}% + \csarg\def{#1}{\def\ThisComment{}\def\AfterComment{#3}#2% + \TreatAsComment{#1}}% + {\escapechar=-1\relax + \csarg\xdef{PlainEnd#1Test}{\string\\end#1}% + \csarg\xdef{LolliEnd#1Test}{\string\\#1Stop}% + \csarg\xdef{LaLaEnd#1Test}{\string\\end\string\{#1\string\}}% + }} +\excludecomment{comment} + +\endinput + +% a test of the special comments +\newcount\comlines +\specialcomment{countedcomment} + {\comlines=-1\relax %note that the rest of the first line is also comment + \def\ThisComment{\global\advance\comlines1\relax}} + {\endgraf **Comment: \number\comlines\ line(s) removed**\endgraf} + +This is a line of text +\countedcomment +Oneline +\endcountedcomment +another line of text +\countedcomment +One line +Two line +Three line +\endcountedcomment +last line of text +\end diff --git a/Master/texmf-dist/doc/otherformats/lollipop/manual/example.tex b/Master/texmf-dist/doc/otherformats/lollipop/manual/example.tex new file mode 100644 index 00000000000..5b38d8eefb5 --- /dev/null +++ b/Master/texmf-dist/doc/otherformats/lollipop/manual/example.tex @@ -0,0 +1,4 @@ + +\Itemize\item One +{\par\PopIndentLevel Interrupted text!\par} +\item Two\> diff --git a/Master/texmf-dist/doc/otherformats/lollipop/manual/extern.tex b/Master/texmf-dist/doc/otherformats/lollipop/manual/extern.tex new file mode 100644 index 00000000000..e9a3c5937bd --- /dev/null +++ b/Master/texmf-dist/doc/otherformats/lollipop/manual/extern.tex @@ -0,0 +1,428 @@ +% extern.tex copyright 1992 Victor Eijkhout +% copyright 2014 Vafa Khalighi +% +% +% This program is free software: you can redistribute it and/or modify +% it under the terms of the GNU General Public License as published by +% the Free Software Foundation, either version 3 of the License, or +% (at your option) any later version. +% +% This program is distributed in the hope that it will be useful, +% but WITHOUT ANY WARRANTY; without even the implied warranty of +% MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the +% GNU General Public License for more details. +% +% You should have received a copy of the GNU General Public License +% along with this program. If not, see . +% +% +\Chapter[chap:referencing] +Referencing + +In manuals and scientific documents you often want to write something +like `see Chapter~4'. But what if you shuffle the chapters a bit? It +would be nice if the number would be updated automatically. With +\Lollipop, as with many other \TeX\ macro packages, this is easily +done. + +Here is an example to set the mood for the rest of this chapter. +The sort of thing that is referred to most is a heading. So suppose +you want to refer to a section number. + +\Example +\DefineHeading:TestSection + line:start Style:italic TestSectionCounter Spaces:2 title + line:stop Stop +\TestSection[one:section?] First section\par +After this section will come section~\ref[other:section!]. + +\TestSection[other:section!] Another section\par +This is the section that came after section~\ref[one:section?]. +\ExampleStop + +\Section What and how do you reference? + +You can reference not only headings but everything that has a +counter. Thus all generic constructs can be referenced, and in +addition you can reference item numbers in a list (there are examples +of this latter possibility in section~\ref[sec:bib]). The simplest way +of referencing something is to put the key in square brackets behind +it: + +\Ver>\Section[this:section] The title of This SectionSection \ref[this:section] on page \pgref[this:section]\label[the:key]\Section Precautions and remedies + +\label[sec:precautions]\label[sec:remedies] +In this section ...[ref:two] Dididi\par +This is after section \ref[ref:one]. +\ExampleStop + +This mechanism is also used in lists, where it's mostly useful for +bibliographies generated by Bib\TeX; see section~\ref[sec:BibTeX]. + +\Section[sec:ref-local] Local references + +Some documents are +collated out of parts that were documents in themselves. +The \Lollipop\ command \cs{InputFile} facilitates in a number +of ways working with such a segmented file (see +section~\ref[sec:InputFile]). One of the problems with input files is +that in such a case it may happen that the same reference key is used +in more than one part of the document. This phenomenon is +not at all unknown in multiple authored documents. Ordinarily this +would result in incorrect references. + +To prevent such collisions \Lollipop\ can use local +references: the command \refcs{LocalReferences} has default \n{no}, +and specifying +\Ver>LocalReferences:yes +\ExampleStop + +Here is a way to customize the label (if you need to refresh your +memory about description lists, see +section~\ref[sec:description:list]). + +\Example +\DefineList:BibList item:left [ itemCounter ] item:stop + label:start ( description ) label:stop Stop +In this example we shall have occasion to refer to +\ref[Abe80] and~\ref[Ceedee79].\par +\Indent:no Bibliography +\BibList \item[Aace55] Aace55 +C.D. Aace, Inscrutible title. +\item[Abe80] Abe80 +E.F. Abe, Worthless drivel. +\item[Ceedee79] Ceedee79 +G.H. Ceedee, Contractual obligation. +\> +\ExampleStop + +\SubSection[sec:BibTeX] Bibliographies with Bib\TeX + +\Lollipop has an interface to the popular Bib\TeX\ +bibliography database program, based on the `BtxMac' macros +by Karl Berry and Oren Patashnik. \Lollipop\ is set up for them, you +only have to \cs{input} the file \file{btxmac.tex}. (The version +of btxmac used to test this is \n{0.99h}.) You can find global +information about Bib\TeX\ in the \LaTeX\ book~{%\tracingmacros=2 +%\tracingcommands\tracingmacros +\bibref[La:book]}, +since Bib\TeX\ was +originally written for \LaTeX. + +Since there is some redefining going on between btxmac and \Lollipop\ +you have to load the btxmac file before the \cs{Start} command (see +section~\ref[sec:doc-start-stop]). + +Since the btxmac file already has a default way of formatting the +bibliography you can get away with just putting the lines + \Ver>\bibliography{ } +\bibliographystyle{ }\DefineList:BBL>, so you can see in the `lists' chapter of this +manual what options apply. + +For example: + \Ver>\DefineBBL line:start Style:italic literal:Literature line:stop + item:left [ begingroup Style:bold itemCounter + endgroup ] item:stop + Stop\bibref[Knuth80]>. This command has a very simple definition + \Ver>\def\bibref[#1]{[\ref[#1]]\nocite{#1}}\def\supref[#1]{$^{\rm \ref[#1]}$\nocite{#1}}\WriteExtern:no> (see +section~\ref[sec:write-extern]) defines \cs{noauxfile} to prevent +regeneration of the bib entries in the \file{.aux} file. +You don't have to do that anymore. + +\Section Obscure details + +For the sake of efficiency, not all macros in Lollipop automatically +accept labels for referencing, only the ones that use the \n{label} +option, or that have a counter (remember, the default form of the +reference is just the counter). If you want a macro that has no +counter and no label specification to accept a label, use the option +\refopt{haslabel}. One reason for doing this is that you have access to +the label itself through the control sequence \refcs{RefLabel}. + +\Chapter[chap:external-files] External Files + +Some document require information to be collected during a run. Such +information typically is a table of contents or index, and it is +gathered in an external file. (The reason for gathering such +information in a file at all is that often some external manipulation, +for instance sorting of an index, is needed.) Since there are many +possibilities for external files (mathematical monographs may have a +list of definitions, or a list of notations) \Lollipop\ does not +predefine such files, but supplies all of the tools for creating them. + +External files involve four actions: +\Enumerate\item The file should be declared. +\item It should be specified what information is to be written to the +file. +\item The formatting of the contents of the file has to be specified. +\item The file has to be loaded. +\> + +You can have at most 15 external files per document. + +\Section[sec:write-extern] Declaring and loading an external file + +The first act, declaring the existence of the external file is very +easy with the command \refcs{DefineExternalFile}: + an internal name and a three-character file name extension have +to be given as parameters. +\Ver>\DefineExternalFile:contents=toc\LoadExternalFile:contents\DefineHeading:Section + [...] + external:contents title external:stop\DefineExternalItem:Section file:contents + [...] Stop\DefineExternalItem:Chapter file:contents + item:left ChapterLabel item:stop + title begingroup Spaces:2 Style:italic Page endgroup + Stop\DefineExternalItem:SubSection file:contents + PushIndentLevel PushIndentLevel + item:left SectionLabel . SubSectionLabel item:stop + title begingroup Spaces:2 Style:italic Page endgroup + Stop. +% +% +\Chapter Headings + +Headings for sections, chapters, and such, are an essential part of +any \TeX\ macro package. In Lollipop they are maybe a bit less +special: all options for headings are general options, meaning that +they also apply to text blocks and lists. There are only two things +that distinguish headings: + +\Enumerate +\item there will be no page break after a heading; +\item there is no closing command for a heading. +\> + +\Section[sec:head:examples] Examples + +Headings are defined by \refcs{DefineHeading}. +The most obvious element in a heading is the title, marked by the +option \refopt{title}. The title is anything that follows the heading +command, upto the first empty line. + +\Ver>\SomeHeading Some title + +And some text following it.\DefineExternalFile:contents=toc\DefineHeading:TestSection + [...] + external:contents title external:stop + Stop. +% +% +\Chapter Lists + +Lists in Lollipop are defined by \refcs{DefineList}: + +\Ver>\DefineList:Foo [...] + item:start [...] item:stop + [...] Stop\Foo +\item [ ..text.. ] +\item [ ... ] +\FooStop}. + +\Section Label alignment + +In general there is a default position for labels; +either aligning with the +left or the right side of the margin over which the list is indented. +The two ways are indicated with the option \refopt{item}: +\Ver> item:left [...] item:stop item:right [...] item:stop +\item And back to the original list.\> +\ExampleStop + +\Section List indentation + +The amount over which the text of a list (excluding the item labels) +is indented is controled by a list of indentations. This is explained +in section~\ref[sec:indent:control]. The indentation amount is most of +the time also equal to the value of the paragraph indentation outside +that list. + +In the rare case where the indentation of a list has to be controlled +explicitly, there is an option \refopt{indentation} with one value. +\Ver>\DefineList:SomeList indentation=30pt [...] Stop\SetItemSign:6=m\SetItemCounterRepresentation:2=i +\ExampleStop + +As you can see, the problem of label overflow can easily occur with +description lists. Thus it is a good idea to end the item material +with some white space, as in the above example. + + Exceptional situation: +if you use an empty description text, you should write \ver>\item{}>. + +\Section Suspended lists + +Occasionally the is a need to resume an enumerate list, that is, +after a piece of text that is not part of the list an enumerate list +should start counting from the previous value on. In \Lollipop\ this +phenomenon can be realized by never ending the enumerate list, and +simply moving the text one indentation level back with +\refcs{PopIndentLevel}. + +\Example +\DefineList:enumerate item:left itemCounter item:stop Stop +\enumerate\item First some item\par +{\PopIndentLevel \Indent:no +This text seems to be outside the list. Don't you believe it.\par} +\item And another item\> +\ExampleStop + +Note that the `popped' text has to be in a group (otherwise the +subsequent items will also be popped back), and it has to be +separated from the preceding and following text by \cs{par}; the +trailing \cs{par} has to be in the group. + +\Section Item counter manipulation + +The item counter can be manipulated explicitly. This is necessary for +instance for starting a list at another value than one. What you need +to realize here is that the command \cs{item} starts by incrementing +the counter. Furthermore, the only way to access the item counter is +through the commands for counters; see section~\ref[sec:counters]. + +\Example +\DefineList:enumerate item:left itemCounter item:stop Stop +\enumerate \SetCounter:item=-1 +\item Escape: usually the backslash. +\item Begin Group.\> +\ExampleStop + +\Section List titles and list tails + +Lists can have titles. The title follows the command that invokes the +list, in the usual manner. Material to follow the list can also be +specified: anything following the option \refopt{text} is considered to +be trailing material. + +\Example +\DefineList:TestList hrule line:start Style:bold title line:stop + item:left Style:italic itemCounter item:stop + text vwhite:3pt hrule Stop +\TestList In the last fiscal year, have you:\par +\item Eaten peanuts? \item Walked the dog? +\item Bought a Frank Zappa record?\> +\ExampleStop + +In case you wonder what happens with textual material after +\opt{item:stop} and before any \opt{text}, well, that is taken to be +inserted immediately after each item label. + +\Section Between the items + +There are special list options controlling what happens in between +items. \Lollipop\ has an option \refopt{breakbetween}, analogous to +\opt{breakbefore} and \opt{breakafter}; see +section~\ref[sec:opt:penalties]. This item be default has a +value of~\n{$-50$}, implying that breaks in between items +should be preferred slightly over breaks in between the +lines of an item. + +Similarly, there is an option \refopt{whitebetween} +controlling the amount of white space in between items that is +analogous to \opt{whitebefore} and \opt{whiteafter}. Like these two +options, it can also be set by the \cs{Distance} command +(section~\ref[sec:com:distance]). + +\Section Indentation in lists + +An item can be considered to be consisting of at least one paragraph. +That paragraph is never indented. For the behaviour of any next +paragraph within the same item, the option \refopt{indentinside} can be +used. This option has values yes/no. In case paragraphs inside an +item indent, the indentation amount is level-controlled; see +section~\ref[sec:indent:control]. + +\Chapter[chap:text:block] Text Blocks + +The `text block' is a way of treating a moderate sized chunk of text +in a different way from the surrounding text. Text blocks are +created by \refcs{DefineTextBlock}. Here is a small example. + +\Example +\DefineTextBlock:Quote + PushIndentLevel PointSize:9 SetFont text Stop +\Indent:no In some context it has been written that +\Quote No man is an island.\QuoteStop +In another: +\Quote Run don't walk to the nearest island.\> +Sometimes one would wish women weren't so logical. +\ExampleStop + +Note that the text block has an explicit closing command, +consisting of the name of the block followed by \opt{Stop}, +and that implicit closing by \cs{>} is possible. + +\Section The \opt{text} option + +Text blocks have only one specific option: \refopt{text}. This option +is used to separate material heading the block from material trailing +the block. Example: + +\Example +\DefineTextBlock:DisplayEq + whitebefore:abovedisplayskip whiteafter:belowdisplayskip + line:start white:parindent $ displaystyle text $ line:stop Stop +The formula +\DisplayEq e^{\pi i}+1=0\> +contains nature's five most interesting constants. +\ExampleStop + +Here one dollar comes before the text, and one after, so the first is +inserted by \cs{DisplayEq} and the second by the corresponding +closing command. + +Material before and after the text should usually not be broken. +Hence \cs{nobreak} is automatically inserted. See the \cs{Example} +macro for this manual: pages should not be broken after rules, or +around the text `example~xyz'. + +\Section More examples + +A text block can encompass more than one paragraph, so the options +\opt{indentinside} and \opt{indentfirst} are particularly useful here. + +\Example +\AlwaysIndent:no +\DefineTextBlock:TestBlock PushIndentLevel + indentafter:yes indentfirst:no indentinside:yes + text unskip hfill $ bullet $ par Stop +One paragraph.\par The next paragraph +\TestBlock Inside the block one paragraph.\par +Inside the block the next paragraph.\> +Outside the following paragraph.\par And the last paragraph. +\ExampleStop + +\ImpNote +\iSection[imp:gen:open:close] The environment in generic constructs + +The text block is just about the purest use of the \Lollipop\ +environment mechanism. Here is how a text block is defined: +\Ver> +\def\@DefineTextBlock{ + \csarg\edef{\@name}{\@gen@open + \the\before@coms + } + \@DefineStopCommand{\the\after@coms \@gen@close} + } +\def\@gen@open{\outer@start@commands + \begingroup \inner@start@commands} +\def\@gen@close{\inner@end@commands + \endgroup \outer@end@commands} +\def\outer@start@commands{% + \iftext@construct + \ifleft@embedded@construct + \nxp\bsp@hack + \else \nxp\leavehmode \nxp\bvwit{\the\@whitebefore}\fi + % backspace previous white space while it's visible + \nxp\if@headed\nxp\else + \ifforced@break@before\@beforepenalty + \else\nxp\ifnum\lastpenalty=\z@ + \@beforepenalty\nxp\fi + \fi + \nxp\fi + \fi + \ifhas@counter \nxp\StepCounter:\expandafter\@name\@space + % This sets the \current@label by default + \ifhas@marks \edef\nxp\cs@e + {\nxp\nxp\nxp\refresh@mark@item + {\@name Counter}{\CSname{\@name Counter}}}% + \nxp\cs@e + \fi + \fi + \iflabel@defined + \global\current@label={\the\@labelcoms}\fi + \ifhas@title \install@title@code + \fi + \ifhas@marks\nxp\ifnin{\nxp\place@mark}\fi + %otherwise IniTeX'ing Lollipop will output a page + \nxp\xx@label\the\extern@toks\penalty\@M + % also subtle: if this white space would be higher, it would + % be invisible because of marks et cetera. + % insert nobreak after marks/writes to prevent page breaks. + \iftext@construct + \ifleft@embedded@construct + \else \nxp\@vwhite{\the\@whitebefore}\fi + \fi + } +\def\inner@start@commands{% + \nxp\Open@Group\CSname{\@class}\CSname{\@name}% + \install@stop + \ifleft@embedded@construct + \else \nxp\hold@parskip + \nxp\@defaulteverypar + \ifwhiteleft@defined \advance\leftskip \the\@whiteleft \relax \fi + \ifwhiteright@defined \advance\rightskip \the\@whiteright \relax \fi + \nxp\let\nxp\par=\nxp\@par %explain to me again why this is necessary... + \inside@indent \first@indent + \fi + \advance\nest@depth\@ne + } +\def\inner@end@commands{% + \nxp\Close@Group\CSname{\@class}\CSname{\@name}% + \ifright@embedded@construct \else \nxp\leavehmode \fi + \@afterpenalty + \ifright@embedded@construct \else \nxp\@vwhite{\the\@whiteafter}\fi + } +\def\outer@end@commands{% + \the\after@toks + \ifright@embedded@construct + \nxp\@headedno \nxp\esp@hack + \else + \after@indent \nxp\dono@parskip + \fi}}, which simply closes the current +construct. A~more drastic version, \cs{>]}, closes all currently +open constructs. +\Ver> +\def\outer@stop@command{\Emessage{Vacuous group closing}} +\let\default@stop@command\outer@stop@command +\def\>{\default@stop@command%[fool the editor + \ifNextChar]{% + \ifx\default@stop@command\outer@stop@command + \xp\take@one + \else \xp\>\fi}{}}} is installed in +\cs{inner@start@commands}: +\Ver> +\def\install@stop{\if@implicitclose + \def\nxp\default@stop@command + {\CSname{\stop@command}}% + \else \let\nxp\default@stop@command + \nxp\outer@stop@command + \fi} +\newif\if@implicitclose +\add@generic@default{\@implicitcloseyes} +\@GenericOption{noimplicitclose}{\@implicitcloseno}. +% +% +\tracingstats=1 +\makeatletter +\makeatother +\showboxdepth=-1 + +\input comment +% By shuffling the \comment line you can load different fonts. +% This is machine dependent, so by default you get the CM font, +% which should work everywhere. +% +\def\SerifFace{\TypeFace:ComputerModern } +\def\SansFace{\TypeFace:ComputerSans } +\comment +% Macintosh Times & Helvetica +\def\SerifFace{\TypeFace:macTimes } +\def\SansFace{\TypeFace:macHelvetica } +% Unix Postscript has different names +\def\SerifFace{\TypeFace:unixTimes } +\def\SansFace{\TypeFace:unixHelvetica } +\endcomment + +% Now load the style definition. This takes some time. +\input mandefs + +% Prevent regeneration of external files; change 'yes' into 'no' +% if you are changing page dimensions or so. +\WriteExtern:yes + +% BibTeX interface by Berry and Patashnik +\input btxmac + +% Start formating +\Start + +% Include the next line if you are formatting the second half +% of this manual: +%\comment + +\CounterRepresentation:Page=i \RightPage +\InputFile:titlepag + +\InputFile:prelim +\SetCounter:LastInPage=PageValue +\BackStepCounter:LastInPage + +\ToRecto\RightPage +\CounterRepresentation:Page=1 \SetCounter:Page=1 + +\InputFile:struct + +\InputFile:head + +\InputFile:list + +% For the first half include the following line: +%\Stop +% For second half include the following lines: +%\endcomment +%\RightPage \SetCounter:Page=11 + +\InputFile:out + +\InputFile:extern + +\InputFile:opt + +\InputFile:comm + +\InputFile:trace + +\InputFile:appendix + +\SetCounter:LastRegPage=PageValue +\BackStepCounter:LastRegPage +\Stop + +% 2014/04/11 Updated the manual +% 92/11/20 Total pages counter +% 93/01/08 \comment and such for two part processing diff --git a/Master/texmf-dist/doc/otherformats/lollipop/manual/mandefs.tex b/Master/texmf-dist/doc/otherformats/lollipop/manual/mandefs.tex new file mode 100644 index 00000000000..e952bea1ebb --- /dev/null +++ b/Master/texmf-dist/doc/otherformats/lollipop/manual/mandefs.tex @@ -0,0 +1,225 @@ +% mandefs.tex style definition for the Lollipop manual +% copyright 1992/3 Victor Eijkhout +% copyright 2014 Vafa Khalighi +% +% +% This program is free software: you can redistribute it and/or modify +% it under the terms of the GNU General Public License as published by +% the Free Software Foundation, either version 3 of the License, or +% (at your option) any later version. +% +% This program is distributed in the hope that it will be useful, +% but WITHOUT ANY WARRANTY; without even the implied warranty of +% MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the +% GNU General Public License for more details. +% +% You should have received a copy of the GNU General Public License +% along with this program. If not, see . +% +% +\def\con#1{{\tt#1}} +\def\n#1{{\tt#1}} +\def\file#1{{\tt#1}} + +\def\Lollipop{Lollipop} + +\Distance:rightmarginstretch={0cm plus 2.54cm} +\Distance:whitebefore={6pt plus 3pt minus 2pt} +\Distance:whiteafter=whitebefore +\FlushRight:no + +\DefineExternalFile:contents=toc + +\DefineHeading:Chapter + breakbefore:yes whiteafter:20pt + line:start PointSize:14 Style:bold literal:Chapter + Spaces:1 ChapterCounter line:stop + vwhite:15pt + line:start PointSize:16 Style:bold title line:stop + external:contents title external:stop + Stop + +\AdaptiveDistance:WidestLabel=15pt +\def\MeasureLabel{\ifdim\BlockWidth>\WidestLabel + \global\WidestLabel\BlockWidth\fi} +\StartCommand{\Distance:parindent=WidestLabel } +\DefineHeading:Section + whitebefore:{20pt plus 2pt} whiteafter:14pt + line:start PointSize:14 Style:italic + block:start block:start ChapterCounter . SectionCounter + Spaces:1 block:stop MeasureLabel + fillupto:WidestLabel + title line:stop + external:contents title external:stop + label:start ChapterCounter . SectionCounter label:stop + Stop +\GoverningCounter:Section=Chapter + +\DefineHeading:SubSection + whitebefore:{14pt plus 2pt} whiteafter:8pt + line:start PointSize:10 Style:italic + ChapterCounter . SectionCounter . SubSectionCounter + Spaces:1 title line:stop + label:start ChapterCounter . Spaces:.2 SectionCounter + . Spaces:.2 SubSectionCounter label:stop + Stop +\GoverningCounter:SubSection=Section + +\DefineExternalFile:impnotes=imp +\DefineHeading:iSection + whitebefore:{10pt plus 1pt} whiteafter:8pt + line:start PointSize:12 Style:bold I - + Style:italic iSectionCounter + Spaces:1 title line:stop + label:start I - iSectionCounter label:stop + external:impnotes title external:stop + Stop +%\GoverningCounter:iSection=Chapter +\DefineExternalItem:iSection file:impnotes PushIndentLevel + item:left I - Style:italic iSectionLabel item:stop + title begingroup Spaces:2 Style:italic Page endgroup + Stop + +\DefineExternalItem:Chapter file:contents + item:left ChapterLabel item:stop + title begingroup Spaces:2 Style:italic Page endgroup + Stop +\DefineExternalItem:Section file:contents PushIndentLevel + item:left ChapterLabel . SectionLabel item:stop + title begingroup Spaces:2 Style:italic Page endgroup + Stop + +\def\impnotetxt{Implementor's Note} +\DefineTextBlock:ImpNote PushIndentLevel + whitebefore:12pt whiteafter:11pt + line:start PointSize:12 Style:italic impnotetxt line:stop + SansFace PointSize:9 SetFont text + Stop +\excludecomment{ImpNote} + +\DefineTextBlock:WizNote + PushIndentLevel PointSize:9 SetFont text + Stop + +\DefineList:Description + item:left description Spaces:2 item:stop whitebetween:6pt + Stop + +\DefineList:cDescription + item:left tt char busje description Spaces:2 item:stop + whitebetween:6pt + Stop + +\DefineList:Enumerate + item:left itemCounter item:stop + Stop + +\DefineList:Itemize + item:left itemsign item:stop + Stop + +\DefineBBL + item:left [ - itemCounter - ] item:stop + Stop + +\SerifFace \SetFont + +\newwrite\exfile +\def\HereAndOut#1{\immediate\write\exfile{#1}} +\specialcomment{Example} + {\EExample + \immediate\openout\exfile=example.tex\relax + \let\ThisComment\HereAndOut} + {\immediate\closeout\exfile + \begingroup \tt \SetFont + \verbatimfile{example.tex}\endgroup + \SaveAlloc \input example.tex\relax \RestoreAlloc + \EExampleStop} +\DefineTextBlock:EExample whiteafter:{6pt plus 5pt} + noimplicitclose rule:h vwhite:3pt + line:start literal:Example Spaces:1.5 + ChapterCounter . EExampleCounter + line:stop + vwhite:3pt rule:h vwhite:3pt text vwhite:3pt rule:h + Stop +\GoverningCounter:EExample=Chapter + +\specialcomment{OutExample} + {\EExample + \immediate\openout\exfile=example.tex\relax + \let\ThisComment\HereAndOut} + {\immediate\closeout\exfile + \begingroup \tt \SetFont + \verbatimfile{example.tex}\endgroup + \par\penalty0\relax + \SaveAlloc \SuspendOutput \begingroup \CountSheetsno + \global\setbox\PageRow\hbox{}% + \let\CurrentShipout\ToPageRow + \xInputFile:example + \endgroup + \ResumeOutput \RestoreAlloc + \noindent\unhbox\PageRow\hbox{}\par + \EExampleStop} +\newbox\PageRow\newbox\RowPage +\def\ToPageRow{\setbox\RowPage\box\WholePage \xToPageRow} +\def\xToPageRow{\global\setbox\PageRow + \hbox{\unhbox\PageRow\box\RowPage\hfill}} + +\def\opt#1{{\tt#1}} +\DefineExternalFile:optindex=oix +\def\refopt#1{\OptToIdx #1\par} +\DefineHeading:OptToIdx embedded:yes + block:start tt title block:stop + external:optindex title external:stop + nomarks Stop +\DefineExternalItem:OptToIdx file:optindex + embedded:yes + begingroup tt title endgroup + nobreak Spaces:1.5 Page Spaces:2.5 Stop + +\DefineExternalFile:csindex=cix +\def\refcs#1{\CsToIdx #1\par} +\DefineHeading:CsToIdx embedded:yes + block:start tt char busje title block:stop + external:csindex title external:stop + nomarks Stop +\DefineExternalItem:CsToIdx file:csindex + embedded:yes + begingroup tt char busje title endgroup + nobreak Spaces:1.5 Page Spaces:2.5 Stop + +\topskip20pt +\OptionsMacro:PageDims=width:page=15cm height:page=23cm Stop +\DefinePageGrid:LeftPage macro:PageDims + band:start block:start PointSize:9 Style:italic + FirstPlaced:ChapterCounter Spaces:2 stickout:left + FirstPlaced:ChapterTitle band:stop + textband:start text textband:stop + band:invisible block:start PointSize:9 Style:bold + PageCounter Spaces:2 stickout:left band:stop + NextPageGrid:RightPage Stop +\DefinePageGrid:RightPage macro:PageDims + band:start fillup PointSize:9 Style:italic + LastPlaced:SectionTitle + block:start Spaces:2 LastPlaced:ChapterCounter . + LastPlaced:SectionCounter stickout:right + band:stop + textband:start text textband:stop + band:invisible fillup + block:start PointSize:9 Style:bold Spaces:2 + PageCounter stickout:right band:stop + NextPageGrid:LeftPage Stop +\DefinePageGrid:EmptyPage macro:PageDims + textband:start text textband:stop + NextPageGrid:LeftPage Stop + +\AdaptiveCounter:LastInPage \CounterRepresentation:LastInPage=i +\AdaptiveCounter:LastRegPage \CounterRepresentation:LastRegPage=1 +%\SetCounter:LastInPage=PageValue -- at the end of prelim.tex +%\SetCounter:LastRegPage=PageValue -- at the end of manual.tex + +\endinput + +% 92/11/05 stretch added +% 92/11/18 adaptive label width +% 92/11/19 adaptive last page \ No newline at end of file diff --git a/Master/texmf-dist/doc/otherformats/lollipop/manual/opt.tex b/Master/texmf-dist/doc/otherformats/lollipop/manual/opt.tex new file mode 100644 index 00000000000..041842ff8da --- /dev/null +++ b/Master/texmf-dist/doc/otherformats/lollipop/manual/opt.tex @@ -0,0 +1,408 @@ +% opt.tex copyright 1992 Victor Eijkhout +% copyright 2014 Vafa Khalighi +% +% +% This program is free software: you can redistribute it and/or modify +% it under the terms of the GNU General Public License as published by +% the Free Software Foundation, either version 3 of the License, or +% (at your option) any later version. +% +% This program is distributed in the hope that it will be useful, +% but WITHOUT ANY WARRANTY; without even the implied warranty of +% MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the +% GNU General Public License for more details. +% +% You should have received a copy of the GNU General Public License +% along with this program. If not, see . +% +% +\Chapter Options + +This chapter discusses the various options that are common to all +\Lollipop\ constructs. + +\Section Titles + +Any construct can have a title, although of course it is most useful +for headings. +A construct has a title if the option \refopt{title} appears. +Example: +\Ver> +\DefineHeading:Section [...] + Style:bold title + [...] Stop +\Section The title of this section + +Some text in this section. +\def\ComplicatedTitle{ .. \hrule ... + \vrule ... \vbox \bgroup ... + \FooTitle ... + }\DefineBar:Foo ... + ComplicatedTitle + ... Stop\DefineBar:Foo ... + HasTitle + ComplicatedTitle + ... Stop\DefineFoo:Bar [...] + BarCounter [...] +\Theorem Foos have arbitrary properties\> +\Corollary Foos are extremely valuable\> +\Corollary Foos are extremely worthless\> +\Theorem Foos don't exist\> +\ExampleStop + +You can only declare a counter to be synonym for something that has +already been created. In the above example you cannot define the +\cs{Theorem} after the \cs{Corollary}. + +\ImpNote +At the start of defining the construct, \cs{BarCounter} is defined to +be an option: +\Ver>\add@generic@default{\has@counterno + \def\counter@repr{1} + \csarg\def{\gen@option@name{\@name Counter}}{% + \@add@toks{\@name Counter}\global\has@counteryes}}\add@generic@stop@default{\ifhas@counter + \xp\expandafter\xp\install@counter + \xp\counter@repr\@space\fi} + \ifhas@counter + \nxp\StepCounter:\expandafter\@name\@space + % This sets the \current@label by default + \ifhas@marks \edef\nxp\cs@e + {\nxp\nxp\nxp\refresh@mark@item + {\@name Counter}{\CSname{\@name Counter}}}% + \nxp\cs@e + \fi + \fi block:start [...] block:stop block:hang [...] block:stop block:start [...] fillupto:20pt block:start [...] stickout:left block:start [...] stickout:right block:start [...] stickout:left=20pt\DefineHeading:TestSection + line:start Style:italic TestSectionCounter Spaces:2 title line:stop + label:start ( TestSectionCounter ) label:stop Stop + +\Section[sec:opt:indent] Indentation + +The option \refopt{indentafter} controls the behaviour of the first +paragraph after a generic construct., \refopt{indentinside}, +\refopt{indentfirst}. + +\Section Rules + +There is an option \refopt{hrule}. You should not write +\Ver>\def\rulemacro{\hrule height [...] } +\DefineHeading [...] rulemacro [...] Stop\def\rulespecs{ height [...] } +\DefineHeading [...] hrule rulespecs [...] Stop embedded:no embedded:left embedded:right embedded:yes\begin{itemize}>. The problem here is the braces. The option +\refcs{arg} produces a braced expression. + +For instance +\Ver>\DefineTextBlock:LaTeXlist begin arg:{itemize} text + end arg:{itemize} Stop} closes the current group, and \refcs{>]} +closes all currently open groups. Every once in a while this is too +drastic. Hence there is an option \refopt{noimplicitclose} that can be +used to prevent a construct from being closed implicitly. Using \cs{>]} +inside such a construct will close all enclosed constructs. + +See the definition of \cs{EExample} in this manual for an example. + +\Section[sec:opt:test] Testing + +There is an option \opt{test}. + +\endinput + +% 92/11/10 \BlockWidth discussed in 'block' section +% 92/11/15 counter:othercounter discussed +% 92/11/21 option 'arg' + diff --git a/Master/texmf-dist/doc/otherformats/lollipop/manual/out.tex b/Master/texmf-dist/doc/otherformats/lollipop/manual/out.tex new file mode 100644 index 00000000000..9ed6cc00022 --- /dev/null +++ b/Master/texmf-dist/doc/otherformats/lollipop/manual/out.tex @@ -0,0 +1,349 @@ +% out.tex copyright 1992/3 Victor Eijkhout +% copyright 2014 Vafa Khalighi +% +% +% This program is free software: you can redistribute it and/or modify +% it under the terms of the GNU General Public License as published by +% the Free Software Foundation, either version 3 of the License, or +% (at your option) any later version. +% +% This program is distributed in the hope that it will be useful, +% but WITHOUT ANY WARRANTY; without even the implied warranty of +% MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the +% GNU General Public License for more details. +% +% You should have received a copy of the GNU General Public License +% along with this program. If not, see . +% +% +\Chapter[chap:output] Output + +Every page is formatted according to a `page grid' consisting of +three elements: + +\Enumerate \item the page head, this is everything that's over the +running text; +\item the page foot, this is everything that is below the running +text; +\item the running text. \TeX\ acts as if text is on a long scroll, +and the running text part of a page is simply a portion cut off from +this scroll.\> +Either or both of the head and foot of the page can be empty, but +usually one of the two contains a page number. + +\OutExample +\OptionsMacro:ManPageSize=raggedbottom:10pt topskip:12pt + height:page=5cm width:page=6cm Stop +\DefinePageGrid:TestPage macro:ManPageSize + pagerule textband:start text textband:stop + pagerule band:start PageCounter band:stop Stop +\TestPage +This page does not contain much special.\EjectPage +This page is hardly better. +\OutExampleStop + +This example illustrates how you first define a page grid by +\refcs{DefinePageGrid}, and then activate it by calling its name. That +last action is in fact not necessary: each definition of a page grid +automatically installs that grid as the current one. + +\Section Page dimensions + +Most of the time it is easiest to specify the total height of a page, +that is, including head and bottom, but sometimes it is more +convenient to specify the height of the text, and let the head and +foot simply go over and under that. + +In the first case you can give the command \refcs{Height} with +two parameters: +\Ver>\Height:Page=23.5cm\Height:Text=19.55cm\Distance:hoffset= ... +\Distance:voffset= ... textband:start text textband:stop topskip:25pt\NewCounter:Page +\CounterRepresentation:Page=1\CounterRepresentation:Page=I[8,7]> is written on the log file or the +screen. Most of the time the two numbers will be the same, as in +\ver>[8,8]>, but they will differ if you have tinkered with the page +number. The first number is the `sheet counter': it counts how many +pages you have produced so far. The second number is the value of +\cs{PageCounter} for the page that was written out. Take a look at the +log file for this manual for an example. + +\Section[sec:page:tests] Page tests + +The page grid definition can set/query several properties of the +page. The following tests have been provided (see +section~\ref[sec:tests] for tests): +\Ver>\DefineTest:IsRightPage +\DefineTest:IsLeftPage +\DefineTest:FirstPage +\DefineTest:LastPage +\DefineTest:FlushBottom + +\OutExample +\DefinePageGrid:TestPage macro:ManPageSize + pagerule textband:start text textband:stop pagerule + band:start ifIsLeftPage else hwhite:fillup fi PageCounter + band:stop Stop \SetCounter:Page=12 +This is a left hand page. \EjectPage +This page is on the right side of a spread. +\OutExampleStop + +\Section[sec:head/foot] Running heads / footers + +Above it was explained how pages can be given a head and foot part. +Quite often you want changing information in such parts, for instance +the head of a left page often contains the number or title of section +that was current when that page started; the head of a right page +often contains the number or title of the section that was current +when that page ended. + +In \Lollipop\ all constructs that have a title or a counter can have +that information referenced in page grids. +\Description\item \refcs{FirstPlaced}:SectionTitle +Take the title of the first section that started on this page, or +the last one that started before this page if no section started on +this page.\item \refcs{LastPlaced}:SubSectionCounter +Take the title of the last subsection that started on this page, or +the last one that started before this page if no subsection started +on this pgae.\item \refcs{PreviousPlaced}:SectionCounter +Take the counter value of the last section that started before this +page.\> + +\OutExample +\DefinePageGrid:TestPage macro:ManPageSize + pagerule textband:start text textband:stop pagerule + band:start Style:italic FirstPlaced:HeadTitle + white:fillup PageCounter band:stop Stop +\DefineHeading:TestHeading Style:bold + line:start TestHeadingCounter Spaces:2 title line:stop Stop +\TestHeading A first section\par And some text.\EjectPage +This page contains text. \TestHeading A second Section\par +And more text. +\OutExampleStop + +The commands \cs{FirstPlaced} and \cs{PreviousPlaced} are typically +used on left pages; \cs{LastPlaced} is more common on right pages. +You can test on what sort of page you are; see +section~\ref[sec:page:tests]. + +\OutExample +\DefinePageGrid:TestPage macro:ManPageSize + pagerule textband:start text textband:stop pagerule + band:start Style:italic + ifIsLeftPage FirstPlaced:HeadTitle white:fillup fi + PageCounter + ifIsRightPage white:fillup LastPlaced:HeadTitle fi + band:stop Stop \SetCounter:Page=10 +\DefineHeading:TestHeading Style:bold + line:start TestHeadingCounter Spaces:2 title line:stop Stop +\TestHeading A first section\par And some text. +\TestHeading Second section\par More text.\EjectPage +\TestHeading Third section\par Is on the right page. +\TestHeading Fourth section\par Concludes this page. +\OutExampleStop + + +\Section Alternating page grids + +In \Lollipop\ it is very easy to switch page grids with the option +\refopt{NextPageGrid}: you simply specify + \Ver> NextPageGrid:otherpage + +Additionally, \refcs{NoPages} lets +all formatting and updating of values be performed, but +no pages are written to the dvi file; +\refcs{PagesOut} +reverts the effect of previous command. Note that \cs{NoPages} does not +incur any savings in time: full processing of the document is performed. + +When a page is finished it rests in box \refcs{WholePage}. Then a call is +made to \refcs{CurrentShipout}, which is by default +\ver>\shipout\box\WholePage>. However, you are free to define it +otherwise. If your \cs{CurrentShipout} does not actually ship out pages, +you may want to set \refcs{CountSheetsno} to prevent the effective page +counter from being updated. + +Redefining \cs{CurrentShipout} usually goes together with +\refcs{SuspendOutput} and \refcs{ResumeOutput}. These commands +temporarily save the page number and the current state of the page, +including the current definition of \cs{CurrentOutput}. (This is necessary +because a number of parameters concerned are changed by global +assignments.) See the definition of \cs{OutputExample} in the appendix of +this manual for an elaborate example. + +If you want to see te output routines in action, specify +\Ver>\Trace:out\Trace:mark. +% +% +\Chapter[chap:prelim] Preliminaries + +\Section What is Lollipop? + +Lollipop is `\TeX\ made easy'. Lollipop is a macro package +that functions as a toolbox for writing \TeX\ macros. It was my +intention to make macro writing so easy that implementing a fully new +layout in \TeX\ would become a matter of less than an hour for an +average document, and that it would be a task that could be +accomplished by someone with only a very basic training in \TeX\ +programming. + +Lollipop is an attempt to make structured text formatting available +for environments where previously only wysiwyg packages could be used +because adapting the layout is so much more easy with them than with +traditional \TeX\ macro packages. + +\Section But is it compatible? + +Lollipop, like \LaTeX, is not compatible with plain \TeX. I~don't +consider this a real problem. Most plain \TeX\ commands will work in +\Lollipop\ with the exception of anything output routine related. +(See also below.) + +\Lollipop\ is also not compatible with \LaTeX, although it has a lot +of the same functionality. There are two reasons why \Lollipop\ still +has a reason for existing, even though \LaTeX\ is used pretty much +all over the scientific world. + +For one, Lollipop is targeted in part +to different users than the typical plain \TeX\ or +\LaTeX\ user. For another, I~have a vain hope that I~can capture some +of the \LaTeX\ market share. Since developing styles in \Lollipop\ is +so much more easier than in \LaTeX, I~may stand a fighting chance. + +\SubSection \Lollipop\ and plain \TeX + +Having said the above, I'll conceded that \Lollipop\ is more +compatible with plain \TeX\ than with \LaTeX. You can use quite some +plain \TeX\ commands in \Lollipop. However, stay away from the +following:\Description\item \cs{everypar} +This one is heavily used by \Lollipop. You may use \cs{EveryParagraph} +instead, which functions pretty much like \cs{everypar}; see +section~\ref[sec:everypar].\item \cs{everymath} +This one is heavily used by \Lollipop. You may use \cs{EveryMath} +instead, which functions pretty much like \cs{everymath}; see +section~\ref[sec:everymath].\item \cs{everydisplay} +This one is heavily used by \Lollipop. You may use \cs{EveryDisplay} +instead, which functions pretty much like \cs{everydisplay}; see +section~\ref[sec:everydisplay].\item \cs{output} +Page output is done so very differently from plain \TeX\ that all +commands pertaining to page numbers and head/footlines have been +eradicated. (Well, \cs{pageno} still gives the page number.) See +chapter~\ref[chap:output]. + \> + +The current version of \Lollipop\ is based on the plain \TeX\ file +that comes with \TeX\ version~3.141592653. + +\SubSection \Lollipop\ and \TeX\ programming + +The tools in \Lollipop\ allow you to program in a simple manner quite +complicated macros. Still you may want to have some knowledge of +ordinary \TeX\ macro programming. If you are just starting in \TeX\ +you can pick up the basics from the book by Seroul and +Levy~\bibref[SeLe:book], +and after that there is the book by +the original author of \TeX~\bibref[Kn:book] and my own \TeX\ +reference guide~\bibref[E:book]. + + \Section How to Use \Lollipop + +The following files comprise the Lollipop format: +\Ver> + lollipop-define.tex lollipop-document.tex + lollipop-float.tex lollipop-fontdefs.tex + lollipop-fonts.tex lollipop-heading.tex + lollipop-lists.tex lollipop-output.tex + lollipop-plain.tex lollipop-text.tex + lollipop-tools.tex lollipop.tex + + +To process a file, say \file{test.tex}, with +Lollipop you then type: + +\Ver> +> lollipop test.tex +> dvilollipop test.tex +> lualollipop test.tex +> dvilualollipop test.tex +> xelollipop test.tex +\InputLollipop:bookstyle.tex + +There are also other known bugs on the sourceforge tickets of Lollipop: +\n{http://sourceforge.net/p/lollipop-project/tickets/?source=navbar}. + + +If you find any other bugs, or if you have any fixes/workarounds + for any existing bugs, then please open a ticket on the tickets. + +\Section About this manual + +This manual consists of a main file \file{lollipop-manual.tex}, and the +following input files: +\Ver> +titlepag.tex prelim.tex struct.tex head.tex list.tex +out.tex extern.tex opt.tex comm.tex trace.tex appendix.texHere is how much of TeX's memory you used: + 1193 strings out of 495844 + 16191 string characters out of 6190699 + 74602 words of memory out of 5000000 + 3494 multiletter control sequences out of 15000+600000 + 10941 words of font info for 39 fonts, out of 8000000 for 9000 + 19 hyphenation exceptions out of 8191 + 27i,4n,24p,187b,448s stack positions out of + 5000i,500n,10000p,200000b,80000s + +\SubSection A bit of history + +The \Lollipop\ format was begun in late 1989 to typeset Victor Eijkhout's Ph.D. +thesis, `{\Style:italic Vectorizable and Parallelizable +Preconditioners for the Conjugate Gradient Method}'. At that time +Victor~was using \TeX\ on an Atari 1040ST. +Loading the style definition for the thesis took about two minutes. +\Lollipop\ was heavily augmented in late 1991 to typeset his book +`{\Style:italic \TeX\ by Topic}', for which he~used Sun~3 and Sun~4 +computers. Writing this manual brought \Lollipop\ to its version 0.96; the first public release (version~0.9) was announced on the +internet in October 1992. + +Between 1992 and 2014, Lollipop was unmaintained and Vafa Khalighi took over the +development of Lollipop in April 2014. + +The name `\n{Lollipop}' refers to a quote by Alan +Perlis~\bibref[Pe:epigrams], quoted on page 365 of the \TeX +book~\bibref[Kn:book]. In a way it's rather pretentious. The philosophy +of the \n{Lollipop} format is described~\bibref[EL:Cork,E:Portland]. + +\endinput + +% 2014/04/13 Added some notes about \EveryMath, +% and \EveryDisplay. Also \EveryPar changed to +% \EveryParagraph +% 2014/04/12 Added note about xelollipop format +% 2014/04/11 Updated the manual +% 92/10/22 historical remark about name added +% 92/11/03 section 'Lollipop and plain TeX' added; +% remarks about IniTeX in Textures +% 92/11/26 uses bibrefs diff --git a/Master/texmf-dist/doc/otherformats/lollipop/manual/struct.tex b/Master/texmf-dist/doc/otherformats/lollipop/manual/struct.tex new file mode 100644 index 00000000000..b390cff88d5 --- /dev/null +++ b/Master/texmf-dist/doc/otherformats/lollipop/manual/struct.tex @@ -0,0 +1,264 @@ +% struct.tex copyright 1992 Victor Eijkhout +% copyright 2014 Vafa Khalighi +% +% +% This program is free software: you can redistribute it and/or modify +% it under the terms of the GNU General Public License as published by +% the Free Software Foundation, either version 3 of the License, or +% (at your option) any later version. +% +% This program is distributed in the hope that it will be useful, +% but WITHOUT ANY WARRANTY; without even the implied warranty of +% MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the +% GNU General Public License for more details. +% +% You should have received a copy of the GNU General Public License +% along with this program. If not, see . +% +% +\Chapter The structure of Lollipop + +Lollipop provides tools for realizing the style or layout of a +document. Some of these tools are macros ready to be used by the end +user; they concern for instance selection of fonts. +Others, the `generic constructs', are for the style designer so that +she can use them to program the macros for the user. + +\Section[sec:doc-start-stop] Lollipop Files + +Any Lollipop document has to have a \cs{Start} and \cs{Stop} command. +Before the \cs{Start} there can be style definition commands, but no +text. For a number of reasons it is advisable to put as much of the +style definition before the \cs{Start} command as possible. You can +do that easily by loading the style as an input file, or by first +dumping it as a format (see section~\ref[sec:style-dump]). + +\ImpNote +Before the \cs{Start} command, \cs{everypar} contains an error +message. The start command installs the default value for +\cs{everypar}. +\ImpNoteStop + +Both the start and the stop file load the \file{.aux} auxiliary file. +None of this should concern you, really. Expert users who want to +have certain actions performed at the start of the document may want +to use \refcs{StartCommand} to specify what they wish done. See +section~\ref[sec:adapt-distance] for an example. + +\Section Generic Constructs + +\label[generic:construct]\label[option:macro] +There are five `generic constructs': headings, lists, text blocks, page +grids, and external items. For each construct type there is a defining +command, for instance \cs{DefineHeading} +which is followed a list of `options', terminated by the word `Stop'. + +Options (possibly with values) have to be separated by a +space or a line end; the keyword \opt{Stop} has to be followed by a +space or a line end. +Options may have zero, one or two values; if there are values, then +the first one is separated from the option by a colon, the second is +separated from the first by an equals sign. + +\Ver>\DefineFoo:Bar optiona optionb optionc:value + optiond:valuea=valueb optione + optionf Stop\DefineHeading:Foo> you can type +\Ver>\Foo The title\DefineList:Foo> you can type +\Ver>\Foo +\item One item +\item And another +\FooStop +\def\stop@command@suffix{Stop} +\def\stop@command{\@command\stop@command@suffix}\DefineHeading:SubSection + [...] + SectionCounter . SubSectionCounter + [...] Stop\OptionsMacro:baz=optiona optionb:value optionc + Stop macro:baz\Distance:TheWidth\Distance:TheWidth=15pt\Distance:parskip=parundent\Distance:parskip=5pt \@GenericConstruct{Heading}\def\@GenericConstruct#1{\@GenericConstruct{Foo}>; +\Ver> \append@to@list{@gencons}{\\#1;} \csarg\newtoks{#1@defaults} + \csn #1@defaults\ecs{} \csarg\def{add@#1@default}##1% + {\append@to@list{#1@defaults}{##1}} \Install@Noops{#1} \csarg\def{Define#1}:##1 {\DefineFoo:Bar>; +\Ver> \def\@name{##1}\def\@class{#1} + \Tmessage[def]{Defining a #1: ##1}DefineFoo:Bar> leads to \cs{@name} begin \n{Bar}, +\cs{@class} being \n{Foo}; +\Ver> \the\generic@defaults + \csarg\the{#1@defaults} \Get@Items} \csarg\def{@#1Option}##1% + {\csarg\def{#1@##1}####1####2} }\def\Get@Items#1 {\if\EmptyList{#1}\let\get@next@item\Get@Items + \else\def\get@next@item{\@Get@Items#1 }\fi + \get@next@item}\NewDummy{Stop}>, \ref[imp:new:dummy]), in which case you +have reached the end of a generic definition, and can start performing +the final rites. Otherwise, dissect this option item +and go on with the rest +of the options. +\Ver> +\def\@Get@Items#1 {\let\get@next@item=\Get@Items + \csarg\ifx{#1}\Stop + \the\generic@stop@defaults + \let\get@next@item=\relax + \else \Item@or@Macro#1::. \fi \get@next@item}\@FooOption{Bar}{ [...] }\@GenericOption{Bar}{ [...] } optiona:par1 optionb:par1=par2 + \csarg\def{@#1Option}##1% + {\csarg\def{#1@##1}####1####2}\@FooOption{Bar}{ ... }\def\Foo@Bar#1#2{ ... }\def\@GenericOption#1{ + \append@to@list{@GenericOptions}{\\#1;} + \csarg\def{Option@#1}##1##2}\@GenericOption{Bar}{ ... }\def\Option@Bar#1#2{ ... }. +% +% +\EmptyPage +\begingroup\AlwaysIndent:no +\PointSize:25 \Style:bold Lollipop Unwrapped + +{\tt http://lollipop-project.sourceforge.net} + +\white:30pt + +\PointSize:20 \SetFont Victor Eijkhout {\rm(Original author)} + +\white:10pt + +Vafa Khalighi {\rm(Current developer)} + +\white:50pt + +\PointSize:15 \Style:roman +A manual for the Lollipop \TeX\ format,\par +last updated 19 April 2014\par +Pages: \LastInPageCounter+\LastRegPageCounter +% so far we could have done this with labels, however +\AddToCounter:LastRegPage=LastInPageValue +=\LastRegPageCounter. + +\EjectPage +\endgroup + +\Chapter Contents + +\Section Regular sections + +\LoadExternalFile:contents + +%\Section Implementer's notes + +%\LoadExternalFile:impnotes + +\Section All of the options + +(You know, this section and the next look much better if you sort the +\file{manual.oix} and \file{manual.cix} files before you format the +document the last time. Do put lines + \Ver>\Writeopindex:no +\Writecsindex:no. +% +% +\Chapter[chap:tracing] Tracing + +\Section Do you really want to see this? + +You can get glimpses of Lollipop's internal workings by enabling some +of the internal traces. The extreme positions +\Ver> \Trace:yes \Trace:no \NewTrace:def % definition of user constructs + \NewTrace:ref % cross references + \NewTrace:ext % external files + \NewTrace:doc % document structure + \NewTrace:font % font loading + \NewTrace:out % output routine + \NewTrace:indent % indentation control + \NewTrace:gen % general tools \Tmessage[type]{text} \Trace:no \Trace:xyz\trace:xyz> positive so that only +\ver>\Tmessage[xyz]{...}> calls will +produce output. Enabling a selective trace sets \cs{trace@all} to zero, in +case it was~$-1$. +\ImpNoteStop + +\endinput diff --git a/Master/texmf-dist/doc/otherformats/lollipop/tex-inde.xen b/Master/texmf-dist/doc/otherformats/lollipop/tex-inde.xen new file mode 100644 index 00000000000..60b25a42b57 --- /dev/null +++ b/Master/texmf-dist/doc/otherformats/lollipop/tex-inde.xen @@ -0,0 +1,259 @@ +TeX-index entries + +%% the Lollipop format + +The Lollipop format is designed to make implementation of +new style definitions easy, even for people who can barely +program TeX macros. It is not compatible with either plain +TeX or LaTeX, although a lot of plain TeX constructs are +available. There is a manual with many elaborate examples; +see below. + + + +Name: lollipop-define.tex +Description: cross referencing macros for + the lollipop package +Keywords: lollipop, macro package, style definitions +Author: Victor Eijkhout and Vafa Khalighi +Supported: yes +Latest version: v1.03, 19 April 2014 +Archives: https://github.com/vafa/lollipop +Note: part of the lollipop package, see lollipop.tex. + +Name: lollipop-document.tex +Description: document handling macros for the + lollipop package +Keywords: lollipop, macro package, style definitions +Author: Victor Eijkhout and Vafa Khalighi +Supported: yes +Latest version: v1.03, 19 April 2014 +Archives: https://github.com/vafa/lollipop +Note: part of the lollipop package, see lollipop.tex. + +Name: lollipop-float.tex +Description: floating insertion macros + for the lollipop package +Keywords: lollipop, macro package, style definitions +Author: Victor Eijkhout and Vafa Khalighi +Supported: yes +Latest version: v1.03, 19 April 2014 +Archives: https://github.com/vafa/lollipop +Note: part of the lollipop package, see lollipop.tex. + +Name: lollipop-fontdefs.tex +Description: fontdefinitions for the lollipop package +Keywords: lollipop, macro package, style definitions +Author: Victor Eijkhout and Vafa Khalighi +Supported: yes +Latest version: v1.03, 19 April 2014 +Archives: https://github.com/vafa/lollipop +Note: part of the lollipop package, see lollipop.tex. + +Name: lollipop-fonts.tex +Description: font handling macros + for the lollipop package +Keywords: lollipop, macro package, style definitions +Author: Victor Eijkhout and Vafa Khalighi +Supported: yes +Latest version: v1.03, 19 April 2014 +Archives: https://github.com/vafa/lollipop +Note: part of the lollipop package, see lollipop.tex. + +Name: lollipop-heading.tex +Description: heading macros for the lollipop package +Keywords: lollipop, macro package, style definitions +Author: Victor Eijkhout and Vafa Khalighi +Supported: yes +Latest version: v1.03, 19 April 2014 +Archives: https://github.com/vafa/lollipop +Note: part of the lollipop package, see lollipop.tex. + +Name: lollipop-lists.tex +Description: list definition macros + for the lollipop package +Keywords: lollipop, macro package, style definitions +Author: Victor Eijkhout and Vafa Khalighi +Supported: yes +Latest version: v1.03, 19 April 2014 +Archives: https://github.com/vafa/lollipop +Note: part of the lollipop package, see lollipop.tex. + +Name: lollipop.tex +Description: main file for the lollipop package +Keywords: lollipop, macro package, style definitions +Author: Victor Eijkhout and Vafa Khalighi +Supported: yes +Latest version: v1.03, 19 April 2014 +Archives: https://github.com/vafa/lollipop +Note: requires define.tex, document.tex float.tex, + fontdefs.tex, fonts.tex, heading.tex, lists,tex, + lolplain.tex, output.tex, text.tex, tools.tex. + +Name: lollipop-plain.tex +Description: version of plain.tex customized + for the lollipop package +Keywords: lollipop, macro package, style definitions +Author: Victor Eijkhout and Vafa Khalighi +Supported: yes +Latest version: v1.03, 19 April 2014 +Archives: https://github.com/vafa/lollipop +Note: part of the lollipop package, see lollipop.tex. + +Name: lollipop-output.tex +Description: output routine macros + for the lollipop package +Keywords: lollipop, macro package, style definitions +Author: Victor Eijkhout and Vafa Khalighi +Supported: yes +Latest version: v1.03, 19 April 2014 +Archives: https://github.com/vafa/lollipop +Note: part of the lollipop package, see lollipop.tex. + +Name: lollipop-text.tex +Description: text environment definitions + for the lollipop package +Keywords: lollipop, macro package, style definitions +Author: Victor Eijkhout and Vafa Khalighi +Supported: yes +Latest version: v1.03, 19 April 2014 +Archives: https://github.com/vafa/lollipop +Note: part of the lollipop package, see lollipop.tex. + +Name: lollipop-tools.tex +Description: utility macros for the lollipop package +Keywords: lollipop, macro package, style definitions +Author: Victor Eijkhout and Vafa Khalighi +Supported: yes +Latest version: v1.03, 19 April 2014 +Archives: https://github.com/vafa/lollipop +Note: part of the lollipop package, see lollipop.tex. + +%% lollipop manual + +Name: comment.tex +Description: comment environment for plain TeX, + LaTeX, and lollipop TeX. +Keywords: lollipop, macro package, style definitions +Author: Victor Eijkhout and Vafa Khalighi +Supported: yes +Latest version: v1.03, 19 April 2014 +Archives: https://github.com/vafa/lollipop +Note: part of the manual of the lollipop package, + see lollipop.tex. + +Name: extern.tex +Description: description of external file handling + in lollipop TeX. +Keywords: lollipop, macro package, style definitions +Author: Victor Eijkhout and Vafa Khalighi +Supported: yes +Latest version: v1.03, 19 April 2014 +Archives: https://github.com/vafa/lollipop +Note: part of the manual of the lollipop package, + see lollipop.tex. + +Name: head.tex +Description: description of headings in lollipop TeX. +Keywords: lollipop, macro package, style definitions +Author: Victor Eijkhout and Vafa Khalighi +Supported: yes +Latest version: v1.03, 19 April 2014 +Archives: https://github.com/vafa/lollipop +Note: part of the manual of the lollipop package, + see lollipop.tex. + +Name: list.tex +Description: description of lists in lollipop TeX. +Keywords: lollipop, macro package, style definitions +Author: Victor Eijkhout and Vafa Khalighi +Supported: yes +Latest version: v1.03, 19 April 2014 +Archives: https://github.com/vafa/lollipop +Note: part of the manual of the lollipop package, + see lollipop.tex. + +Name: mandefs.tex +Description: style definition for the lollipop TeX manual. +Keywords: lollipop, macro package, style definitions +Author: Victor Eijkhout and Vafa Khalighi +Supported: yes +Latest version: v1.03, 19 April 2014 +Archives: https://github.com/vafa/lollipop +Note: part of the manual of the lollipop package, + see lollipop.tex. + +Name: lollipop-manual.tex +Description: master file for the lollipop TeX manual +Keywords: lollipop, macro package, style definitions +Author: Victor Eijkhout and Vafa Khalighi +Supported: yes +Latest version: v1.03, 19 April 2014 +Archives: https://github.com/vafa/lollipop +Note: requires comment.tex, extern.tex, head.tex, list.tex + mandefs.tex, lollipop-manual.bbl, opt.tex, out.tex, prelim.tex, + struct.tex, titlepag.tex, trace.tex. + +Name: opt.tex +Description: description of construct options + in lollipop TeX +Keywords: lollipop, macro package, style definitions +Author: Victor Eijkhout and Vafa Khalighi +Supported: yes +Latest version: v1.03, 19 April 2014 +Archives: https://github.com/vafa/lollipop +Note: part of the manual of the lollipop package, + see lollipop.tex. + +Name: out.tex +Description: description of output handling + in lollipop TeX. +Keywords: lollipop, macro package, style definitions +Author: Victor Eijkhout and Vafa Khalighi +Supported: yes +Latest version: v1.03, 19 April 2014 +Archives: https://github.com/vafa/lollipop +Note: part of the manual of the lollipop package, + see lollipop.tex. + +Name: prelim.tex +Description: introductory chapter of lollipop manual. +Keywords: lollipop, macro package, style definitions +Author: Victor Eijkhout and Vafa Khalighi +Supported: yes +Latest version: v1.03, 19 April 2014 +Archives: https://github.com/vafa/lollipop +Note: part of the manual of the lollipop package, + see lollipop.tex. + +Name: struct.tex +Description: description of the overall structure of + lollipop TeX files +Keywords: lollipop, macro package, style definitions +Author: Victor Eijkhout and Vafa Khalighi +Supported: yes +Latest version: v1.03, 19 April 2014 +Archives: https://github.com/vafa/lollipop +Note: part of the manual of the lollipop package, + see lollipop.tex. + +Name: titlepag.tex +Description: titlepage of the lollipop manual +Keywords: lollipop, macro package, style definitions +Author: Victor Eijkhout and Vafa Khalighi +Supported: yes +Latest version: v1.03, 19 April 2014 +Archives: https://github.com/vafa/lollipop +Note: part of the manual of the lollipop package, + see lollipop.tex. + +Name: trace.tex +Description: description of trace modes in lollipop TeX +Keywords: lollipop, macro package, style definitions +Author: Victor Eijkhout and Vafa Khalighi +Supported: yes +Latest version: v1.03, 19 April 2014 +Archives: https://github.com/vafa/lollipop +Note: part of the manual of the lollipop package, + see lollipop.tex. + -- cgit v1.2.3