| 1 |
% prelim.tex copyright 1992 Victor Eijkhout |
| 2 |
% copyright 2014--2016 Vafa Khalighi |
| 3 |
% |
| 4 |
% |
| 5 |
% This program is free software: you can redistribute it and/or modify |
| 6 |
% it under the terms of the GNU General Public License as published by |
| 7 |
% the Free Software Foundation, either version 3 of the License, or |
| 8 |
% (at your option) any later version. |
| 9 |
% |
| 10 |
% This program is distributed in the hope that it will be useful, |
| 11 |
% but WITHOUT ANY WARRANTY; without even the implied warranty of |
| 12 |
% MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the |
| 13 |
% GNU General Public License for more details. |
| 14 |
% |
| 15 |
% You should have received a copy of the GNU General Public License |
| 16 |
% along with this program. If not, see <http://www.gnu.org/licenses/>. |
| 17 |
% |
| 18 |
% |
| 19 |
\Chapter[chap:prelim] Preliminaries |
| 20 |
|
| 21 |
\Section What is Lollipop? |
| 22 |
|
| 23 |
Lollipop is `\TeX\ made easy'. Lollipop is a macro package |
| 24 |
that functions as a toolbox for writing \TeX\ macros. It was my |
| 25 |
intention to make macro writing so easy that implementing a fully new |
| 26 |
layout in \TeX\ would become a matter of less than an hour for an |
| 27 |
average document, and that it would be a task that could be |
| 28 |
accomplished by someone with only a very basic training in \TeX\ |
| 29 |
programming. |
| 30 |
|
| 31 |
Lollipop is an attempt to make structured text formatting available |
| 32 |
for environments where previously only wysiwyg packages could be used |
| 33 |
because adapting the layout is so much more easy with them than with |
| 34 |
traditional \TeX\ macro packages. |
| 35 |
|
| 36 |
\Section But is it compatible? |
| 37 |
|
| 38 |
Lollipop, like \LaTeX, is not compatible with plain \TeX. I~don't |
| 39 |
consider this a real problem. Most plain \TeX\ commands will work in |
| 40 |
\Lollipop\ with the exception of anything output routine related. |
| 41 |
(See also below.) |
| 42 |
|
| 43 |
\Lollipop\ is also not compatible with \LaTeX, although it has a lot |
| 44 |
of the same functionality. There are two reasons why \Lollipop\ still |
| 45 |
has a reason for existing, even though \LaTeX\ is used pretty much |
| 46 |
all over the scientific world. |
| 47 |
|
| 48 |
For one, Lollipop is targeted in part |
| 49 |
to different users than the typical plain \TeX\ or |
| 50 |
\LaTeX\ user. For another, I~have a vain hope that I~can capture some |
| 51 |
of the \LaTeX\ market share. Since developing styles in \Lollipop\ is |
| 52 |
so much more easier than in \LaTeX, I~may stand a fighting chance. |
| 53 |
|
| 54 |
\SubSection \Lollipop\ and plain \TeX |
| 55 |
|
| 56 |
Having said the above, I'll conceded that \Lollipop\ is more |
| 57 |
compatible with plain \TeX\ than with \LaTeX. You can use quite some |
| 58 |
plain \TeX\ commands in \Lollipop. However, stay away from the |
| 59 |
following:\Description\item \cs{everypar} |
| 60 |
This one is heavily used by \Lollipop. You may use \cs{EveryParagraph} |
| 61 |
instead, which functions pretty much like \cs{everypar}; see |
| 62 |
section~\ref[sec:everypar].\item \cs{everymath} |
| 63 |
This one is heavily used by \Lollipop. You may use \cs{EveryMath} |
| 64 |
instead, which functions pretty much like \cs{everymath}; see |
| 65 |
section~\ref[sec:everymath].\item \cs{everydisplay} |
| 66 |
This one is heavily used by \Lollipop. You may use \cs{EveryDisplay} |
| 67 |
instead, which functions pretty much like \cs{everydisplay}; see |
| 68 |
section~\ref[sec:everydisplay].\item \cs{output} |
| 69 |
Page output is done so very differently from plain \TeX\ that all |
| 70 |
commands pertaining to page numbers and head/footlines have been |
| 71 |
eradicated. (Well, \cs{pageno} still gives the page number.) See |
| 72 |
chapter~\ref[chap:output]. |
| 73 |
\> |
| 74 |
|
| 75 |
The current version of \Lollipop\ is based on the plain \TeX\ file |
| 76 |
that comes with \TeX\ version~3.141592653. |
| 77 |
|
| 78 |
\SubSection \Lollipop\ and \TeX\ programming |
| 79 |
|
| 80 |
The tools in \Lollipop\ allow you to program in a simple manner quite |
| 81 |
complicated macros. Still you may want to have some knowledge of |
| 82 |
ordinary \TeX\ macro programming. If you are just starting in \TeX\ |
| 83 |
you can pick up the basics from the book by Seroul and |
| 84 |
Levy~\bibref[SeLe:book], |
| 85 |
and after that there is the book by |
| 86 |
the original author of \TeX~\bibref[Kn:book] and my own \TeX\ |
| 87 |
reference guide~\bibref[E:book]. |
| 88 |
|
| 89 |
\Section How to Use \Lollipop |
| 90 |
|
| 91 |
The following files comprise the Lollipop format: |
| 92 |
\Ver> |
| 93 |
lollipop-define.tex lollipop-document.tex |
| 94 |
lollipop-float.tex lollipop-fontdefs.tex |
| 95 |
lollipop-fonts.tex lollipop-heading.tex |
| 96 |
lollipop-lists.tex lollipop-output.tex |
| 97 |
lollipop-plain.tex lollipop-text.tex |
| 98 |
lollipop-tools.tex lollipop.tex<Rev |
| 99 |
|
| 100 |
|
| 101 |
To process a file, say \file{test.tex}, with |
| 102 |
Lollipop you then type: |
| 103 |
|
| 104 |
\Ver> |
| 105 |
> lollipop test.tex <Rev |
| 106 |
|
| 107 |
to get the dvi output. |
| 108 |
|
| 109 |
|
| 110 |
\Section[sec:style-dump] Processing a Lollipop file |
| 111 |
|
| 112 |
Files that you make to be processed with Lollipop contain of course |
| 113 |
the input text, but they also have to contain the design macros that |
| 114 |
determine the layout. There are two possibilities for these design |
| 115 |
macros: |
| 116 |
|
| 117 |
\Itemize |
| 118 |
\item You can simply put them in the same file, either in the |
| 119 |
beginning or wherever they are first needed, or |
| 120 |
\item You can put the layout definition in a separate file and call this |
| 121 |
definition file in your main file. For instance, you can put the layout definition of a |
| 122 |
book in a file \file{bookstyle.tex}, and then call this definition file in your |
| 123 |
main Lollipop file by putting |
| 124 |
|
| 125 |
\Ver> |
| 126 |
\InputLollipop:bookstyle.tex <Rev |
| 127 |
|
| 128 |
somewhere in your main Lollipop file. |
| 129 |
|
| 130 |
|
| 131 |
|
| 132 |
If you have used \TeX\ before, you will notice that the page numbers |
| 133 |
get reported slightly differently from the usual way. See |
| 134 |
section~\ref[sec:page-counter] for the explanation. |
| 135 |
|
| 136 |
\Section The errors of \Lollipop / known bugs |
| 137 |
|
| 138 |
Since \Lollipop\ is an order of magnitude more powerful |
| 139 |
(and hence complicated) than formats such as \LaTeX, its error |
| 140 |
messages can also be an order of magnitude more cryptic (see |
| 141 |
section~\ref[sec:error-msg] for the possible origin of some of the |
| 142 |
more obscure error messages). |
| 143 |
|
| 144 |
Fortunately, \Lollipop\ is also quite a |
| 145 |
bit better than existing formats at catching potential errors. Typos |
| 146 |
in a style definition will usually lead to warning messages, and also |
| 147 |
during run time \Lollipop\ is able to track down ommisions. |
| 148 |
|
| 149 |
In addition, you can switch on various trace modes to get more |
| 150 |
detailed information about \Lollipop's thought processes. See |
| 151 |
chapter~\ref[chap:tracing]. |
| 152 |
|
| 153 |
These are the known bugs in \Lollipop\ at the moment. |
| 154 |
|
| 155 |
\Enumerate\item Local references have been insufficiently tested, |
| 156 |
and the code definitely is buggy. |
| 157 |
\item The `firstpage' test in the page grids does not work. |
| 158 |
\item The table of contents example is slightly wrong. |
| 159 |
\item Titles get written to the aux file with double spaces. |
| 160 |
This shouldn't cause any problem, but it has to be fixed. |
| 161 |
\item Rules in page grids get white space around them. |
| 162 |
\item External items shouldn't declare \cs{FooTitle} or |
| 163 |
\cs{FooCounter}. |
| 164 |
\item \cs{ToExternalFile} doesn't work. |
| 165 |
\> |
| 166 |
|
| 167 |
|
| 168 |
If you find any other issues, or if you have any fixes/workarounds |
| 169 |
for any existing issues, then please post them on GitHub. |
| 170 |
|
| 171 |
\Section About this manual |
| 172 |
|
| 173 |
This manual consists of a main file \file{lollipop-manual.tex}, and the |
| 174 |
following input files: |
| 175 |
\Ver> |
| 176 |
titlepag.tex prelim.tex struct.tex head.tex list.tex |
| 177 |
out.tex extern.tex opt.tex comm.tex trace.tex appendix.tex<Rev |
| 178 |
and the style definition file \file{mandefs.tex}. |
| 179 |
|
| 180 |
In addition, you need \file{comment.tex} which is used to format this |
| 181 |
manual, and \file{btxmac.tex} for the Bib\TeX\ interface, but these |
| 182 |
are not really a part of \Lollipop. |
| 183 |
|
| 184 |
If you format this manual (which you'll have to do three times |
| 185 |
to get the page numbering and the table of contents straight) you'll |
| 186 |
notice something strange. The file \file{example.tex} is read in |
| 187 |
many, many times. This is because this manual formats its examples |
| 188 |
along the way, first writing them out, and then reading them in to |
| 189 |
show both their code and their output. This way it is guaranteed that |
| 190 |
the examples in the manual will always work. |
| 191 |
|
| 192 |
As a result of formatting this manual you will wind up with, apart |
| 193 |
from the usual \file{pdf} and \file{log} file, with \file{lollipop-manual} files |
| 194 |
with extensions \file{aux}, \file{toc}, and \file{imp}; |
| 195 |
\file{oix} and \file{cix} for indexes of options and commands, |
| 196 |
and |
| 197 |
\file{tct}, file{tix} which are for the examples. For the |
| 198 |
bibliography there are the Bib\TeX\ input file \file{lollipop-manual.bib} and |
| 199 |
output file \file{lollipop-manual.bbl}. |
| 200 |
|
| 201 |
This manual needs quite some resources: here's what \TeX\ told me |
| 202 |
it needed. |
| 203 |
\Ver>Here is how much of TeX's memory you used: |
| 204 |
1194 strings out of 496579 |
| 205 |
16173 string characters out of 6202690 |
| 206 |
72655 words of memory out of 5000000 |
| 207 |
3270 multiletter control sequences out of 15000+600000 |
| 208 |
11241 words of font info for 40 fonts, out of 8000000 for 9000 |
| 209 |
19 hyphenation exceptions out of 8191 |
| 210 |
24i,4n,24p,187b,562s stack positions out of 5000i,500n,10000p,200000b,80000s<Rev |
| 211 |
|
| 212 |
|
| 213 |
Because of all the examples this manual takes quite some time to |
| 214 |
process. A~factor of four over the time for a regular document of |
| 215 |
similar length should be expected. Ordinary Lollipop documents will |
| 216 |
proceed far faster. |
| 217 |
|
| 218 |
\Section The most boring section in this manual |
| 219 |
|
| 220 |
There are a few things about \Lollipop\ that I~want to be clear about. |
| 221 |
|
| 222 |
\SubSection I am going to hurt you and I am not sorry |
| 223 |
|
| 224 |
In the secret handbook for the software industry it says that the |
| 225 |
final test phase of a product consists of putting it in stores and |
| 226 |
having innocent suckers pay good money for it. (You guessed it, this |
| 227 |
is the disclaimer section.) So let me just say that |
| 228 |
\Lollipop\ is probably good for nothing, at least, I~don't claim it |
| 229 |
is. And if you hurt yourself by using it, don't blame me. I~warned |
| 230 |
you. |
| 231 |
|
| 232 |
\SubSection Get a \Lollipop, give one away |
| 233 |
|
| 234 |
\Lollipop\ is free software: you can redistribute it and/or modify |
| 235 |
it under the terms of the GNU General Public License as published by |
| 236 |
the Free Software Foundation, either version 3 of the License, or |
| 237 |
(at your option) any later version. |
| 238 |
|
| 239 |
The easiest way to get the current copy of \Lollipop\ is to use |
| 240 |
a more recent \TeX{} distribution (\TeX Live or Mik\TeX). |
| 241 |
|
| 242 |
\SubSection The status of \Lollipop |
| 243 |
|
| 244 |
\Lollipop\ is still under development. Although I~will try not to |
| 245 |
make any drastic changes in the user interface (this says nothing |
| 246 |
about the internals!) I~really cannot guarantee anything. |
| 247 |
However, I~do listen to complaints and suggestions. |
| 248 |
|
| 249 |
If you have suggestions or complaints about the |
| 250 |
useability of \Lollipop\ or the implementation, feel free to contact |
| 251 |
me at \n{[email protected]} on the Internet. |
| 252 |
|
| 253 |
\SubSection[sec:wish:list] The wish list |
| 254 |
|
| 255 |
\Lollipop\ is not quite perfect. Here's a list of things that I~am |
| 256 |
going to be adding in the near future. If you want to add items to |
| 257 |
this list, just open a ticket on the tickets. |
| 258 |
|
| 259 |
\Enumerate\item Raggedbottom should really, really be added. Soon! |
| 260 |
|
| 261 |
\item Capitalization and initial capping of titles. If a |
| 262 |
title appears in mixed case, it should be possible to have it in all |
| 263 |
uppercase in running heads. Some code has been disabled now. |
| 264 |
|
| 265 |
\item A better multi-column mode. |
| 266 |
|
| 267 |
\item Interface to Bib\TeX\ seems to largely in place; what happens |
| 268 |
if you don't load btxmac? |
| 269 |
|
| 270 |
\item Inserts, in particular footnotes. At the moment floating |
| 271 |
figures are entirely lacking. (As a matter of fact, the plain \TeX\ |
| 272 |
macros are availble, but I'm not telling that.) |
| 273 |
|
| 274 |
\item A `nomarks' option to prevent wasting two token lists. |
| 275 |
Maybe other recourse saving optio for the expert designer? |
| 276 |
|
| 277 |
\item More sophisticated white space right before and after |
| 278 |
page breaks. (Use at least so and so much.) |
| 279 |
|
| 280 |
\item Dynamic topskip. |
| 281 |
|
| 282 |
\item Support for RTL languages (such as Persian). |
| 283 |
|
| 284 |
|
| 285 |
{\PopIndentLevel\Indent:no The following points are debatable: |
| 286 |
maybe I~should just steal a few components from \LaTeX. Maybe this |
| 287 |
sort of stuff does not belong in \Lollipop.\par} |
| 288 |
|
| 289 |
\item A tabular mode. Personally I~always felt \cs{halign} to be more |
| 290 |
than sufficient, but some people seem to think otherwise. |
| 291 |
|
| 292 |
\item Maths constructs. Some things in the \cs{eqalign} vein would be |
| 293 |
nice. |
| 294 |
|
| 295 |
\> |
| 296 |
|
| 297 |
\SubSection A bit of history |
| 298 |
|
| 299 |
The \Lollipop\ format was begun in late 1989 to typeset Victor Eijkhout's Ph.D. |
| 300 |
thesis, `{\Style:italic Vectorizable and Parallelizable |
| 301 |
Preconditioners for the Conjugate Gradient Method}'. At that time |
| 302 |
Victor~was using \TeX\ on an Atari 1040ST. |
| 303 |
Loading the style definition for the thesis took about two minutes. |
| 304 |
\Lollipop\ was heavily augmented in late 1991 to typeset his book |
| 305 |
`{\Style:italic \TeX\ by Topic}', for which he~used Sun~3 and Sun~4 |
| 306 |
computers. Writing this manual brought \Lollipop\ to its version 0.96; the first public release (version~0.9) was announced on the |
| 307 |
internet in October 1992. |
| 308 |
|
| 309 |
Between 1992 and 2014, Lollipop was unmaintained and Vafa Khalighi took over the |
| 310 |
development of Lollipop in April 2014. |
| 311 |
|
| 312 |
The name `\n{Lollipop}' refers to a quote by Alan |
| 313 |
Perlis~\bibref[Pe:epigrams], quoted on page 365 of the \TeX |
| 314 |
book~\bibref[Kn:book]. In a way it's rather pretentious. The philosophy |
| 315 |
of the \n{Lollipop} format is described~\bibref[EL:Cork,E:Portland]. |
| 316 |
|
| 317 |
\endinput |
| 318 |
|
| 319 |
% 2014/04/13 Added some notes about \EveryMath, |
| 320 |
% and \EveryDisplay. Also \EveryPar changed to |
| 321 |
% \EveryParagraph |
| 322 |
% 2014/04/12 Added note about xelollipop format |
| 323 |
% 2014/04/11 Updated the manual |
| 324 |
% 92/10/22 historical remark about name added |
| 325 |
% 92/11/03 section 'Lollipop and plain TeX' added; |
| 326 |
% remarks about IniTeX in Textures |
| 327 |
% 92/11/26 uses bibrefs |