The bits LaTeX package

basic bits (Frankenstein’s guts)

           Matt Swift <swift@alum.mit.edu>

Version: 1.2 Date: 2001/08/31

Documentation revision: 2001/08/31

Abstract

Bits provides a programmer’s interface for a new idea called a bit, which is like an environment but has a title, author, and other attributes usually only associated with the document environment.

This package is useful but may have problems and is unsupported.

Contents

I Discussion 2

1 Basic concepts and terminology 2 1.1 Users’ interface . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 2 1.2 Programmers’ interface . . . . . . . . . . . . . . . . . . . . . . . . . 2

2 Usage 4

3 Extension and customization 4 3.1 Customizing an instance of a bit . . . . . . . . . . . . . . . . . . . 4 3.2 Adding bitstyles, copystyles, and tasks . . . . . . . . . . . . . . . . 4

4 Notes 4

II Implementation 5

5 Version control 5

6 Preliminaries 5 6.1 Requirements . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 5 6.2 Option processing . . . . . . . . . . . . . . . . . . . . . . . . . . . 5

7 Making new copy and bit styles 6 7.1 General stuff . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 6 7.2 Schemes . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 8

7.2.1 The Z scheme . . . . . . . . . . . . . . . . . . . . . . . . . . 8 7.2.2 The P scheme . . . . . . . . . . . . . . . . . . . . . . . . . . 10 7.2.3 The R scheme . . . . . . . . . . . . . . . . . . . . . . . . . . 10 7.2.4 The T scheme . . . . . . . . . . . . . . . . . . . . . . . . . . 11

8 The standard copystyle and generic bitstyle 11 9 Bit Styles 11

9.1 Story . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 11 9.2 Poem . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 11 9.3 Prose . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 11

10 Copy Styles 11 11 Bit counters and interbit skips 12 12 Userinfos 13 13 Dates 14 14 Ends 14 15 Version control 15

III Configuration 17

Part I

Discussion

This documentation is spotty, but should be accurate. Please feel free to write me if you can’t figure something out.

1 Basic concepts and terminology

1.1 Users’ interface

A bit is the smallest part of a document treated as an independent unit. Each bit has an explicit type called a bitstyle. (Examples: generic, story, poem, recipe, letter.) A bit’s bitstyle determines the markup that is legal within the bit. (Additional declarations can be made on a per-bit basis, also; see below.) A bit’s formatting is determined by both its bitstyle and the copystyle (see below) of the document. New bitstyles can be added.

A copystyle is one of an explicit list of ways to present a collection of bits together in a single document. It might well be called a “documentstyle” and be implemented as a L^{A}TEX documentclass, but if they are kept separate, copystyles and documentclasses can coexist with each other, and this leads to a greater flexibility when dealing with existing documents. The relationship between copystyles and documentclasses is discussed further below. New copystyles can be added.

1.2 Programmers’ interface

The formatting of a bit is considered to involve a fixed number of tasks. Examples of tasks performed near the beginning of formatting a bit are inserting some space after the preceding bit, and formatting the title of the current bit. Each task must be assigned a procedure that accomplishes that task. (Notice that the null procedure might be a suitable procedure for some tasks in some situations.) We call a mapping of some tasks to suitable procedures a profile. We call a profile that maps the complete set of tasks a scheme. You need a scheme to format a bit, and the scheme to use for a given bit is determined by its bitstyle and copystyle.

Now we are in a position to try to visualize the variable space established by the bits package. It’s not simple, and if you think of a better way, please let me know.

As just explained, to format a bit, you need a scheme, which is a series of procedures suitable for a series of certain tasks. To be concrete, let’s assume there are 4 tasks. Identify each task with a general color. In our example, let’s use red, blue, green, and yellow. Think of a scheme as a stack of colored blocks, each representing a procedure. The top block, corresponding to the first task, is red, the second block is blue, the third green, and the bottom block, corresponding to the final task, is yellow.

Suppose I create a new scheme, the same as the original except for a slight change in the first task. This would be represented by changing the color of the red, or top, block to a different shade of red. The precise color of a block represents the specific procedure. A general color is associated with a task because it is expected that no procedure suitable for one task is going to be suitable for another task. The redness of a block represents its suitability for the the first task.

(If we wanted to be exact, we would observe that some procedures, such as the null procedure, might be suitable for more than one task. OK, let such procedures be a shade of grey, with the null task, let us say, being white. Then the colored block at each task’s position will have either the associated color of the task or a shade of grey.)

I have drawn in your mind the picture of two stacks of 4 colored blocks, differing only in the shade of the top (red) block. Let’s give them the names Jack and Jill. Let Jack and Jill represent two bitstyles. You can imagine as many bitstyles as you like—Jack, Jill, Hank, Wendy, and Beauregard; all are stacks of four colored blocks arranged next to each other in a line, a red block on top, a blue block, a green block, and a yellow block. Some of the stacks might even have identical blocks. This would mean that two bitstyles have the same scheme. You refer to bitstyles by their name, so in the future, you could change one bitstyle and make it different from the other. In fact, when you create a new bitstyle, it is initially simply a copy of an existing bitstyle. Then you can modify the new one if you want to.

bitclass? bittype? bitstyle best describes a scheme. bitscheme?

You’ve almost got the whole picture now. We need to consider copystyles. Suppose Jack, Jill, Hank, Wendy, and little Beauregard are all siblings. They have the same last name, Grimm. Grimm is the name of a copystyle. Across town, or in a parallel universe, there is another set of siblings Jack, Jill, etc. with a different last name, Beedle. They, too, are represented by a line of stacks of colored blocks. Line up the Beedle siblings behind the Grimm siblings, and you now have a pile of colored blocks 4 high (4 tasks), 5 wide (the 5 bitstyles Jack, Jill, etc.), and 2 deep (the 2 copystyles Grimm and Beedle).

That’s it. Given a bitstyle (e.g., Hank) and a copystyle (e.g., Beedle), you have a particular scheme for formatting a bit.

As you may notice, there is so far no justification for the metaphor of family. Nothing I’ve said yet about tasks and procedures corresponds to the metaphor’s suggestion that Hank Beedle is probably more similar to Wendy Beedle than he is to Hank Grimm; or that when putting together the Beedles in a family photograph, there is a certain pleasing aesthetic unity that would be lacking if any of those odd-looking Grimms were to stray into the picture. In fact, technically, each scheme can be completely different from every other scheme, Hank Beedle being as different from Wendy Beedle as he is from Hank Grimm.

These metaphors are justified when you consider the way in which new copystyles and bistyles are added, and the expected purposes for bitstyles and copystyles.

OR: family of Poems, family of recipes. First name is the copystyle. Then a document would consist of Hank Poem, Hank Recipe, etc. = Standard Poem, Standard Recipe; Fancy Poem, Fancy Recipe.

Or, each family has one Poem, one Recipe, etc. So a document puts together members of a family, Poem, Recipe, etc.

2 Usage

Bits look like L^{A}TEX environments that take two arguments. (Surprise surprise that’s exactly what they are.) Here’s an example of a bit with hypothetical bitstyle “poem”:

 \begin{poem}{Butterflies}{\subtitle{An Address to My Stomach}}
   O jittery one, quavering tub, \\
   Rumble not your complaints so violently! \\
   Remember your jollitude just last Sunday, \\
   The pound of bovine ambrosia \\
   I filled you to the gills with \\
   To silence you, on this, my wedding day.
 \end{poem}

3 Extension and customization

3.1 Customizing an instance of a bit

Fat little Hank Beedle might come with a note tied around his neck on a piece of yarn, with special instructions on his care and feeding from his mother. “Peanuts will give him hives,” it might say. And “A quart of sour cream is always welcome.”

3.2 Adding bitstyles, copystyles, and tasks

When you add a new bitstyle B′, you create a new scheme for each of the existing copystyles. You name an existing bitstyle B and zero or more profiles. For each existing copystyle C, the profiles will be composed with the \frac{B}{C} scheme to obtain the new scheme \frac{B′}{C}. (Notice that if any of the profiles you name are schemes, the choice of B is irrelevant, and that if you name no profiles, B′ = B.)

The procedure is identical when you add a new copystyle. Just swap references to copystyles and bibstyles in the last paragraph.

You can add to list of tasks. When you do this, you must assign a default procedure for it (part of the Z scheme, the universal default). All existing bitstyles and copystyles will inherit the same procedure for this task. This makes sense because they’ve presumably all done the task the same way before, if they’ve done it at all. You can promulgate changes with \Promulgate etc.

4 Notes

FIX; bit type determines its markup; bitstyle is a mapping of tasks to procedures.

Part II

Implementation

5 Version control

\fileinfo \DoXUsepackagE \HaveECitationS \fileversion \filedate \docdate \PPOptArg These definitions must be the first ones in the file.
 1 \def\fileinfo{basic bits (Frankenstein's guts)}
 2 \def\DoXPackageS {}
 3 \def\fileversion{v1.2}
 4 \def\filedate{2001/08/31}
 5 \def\docdate{2001/08/31}
 6 \edef\PPOptArg {%
 7 \filedate\space \fileversion\space \fileinfo
 8 }

If we’re loading this file from a \ProcessDTXFile command (see the compsci package), then \JusTLoaDInformatioN will be defined; othewise we assume it is not (that’s why the FunkY NamE).

If we’re loading from \ProcessDTXFile, we want to load the packages listed in \DoXPackageS (needed to typeset the documentation for this file) and then bail out. Otherwise, we’re using this file in a normal way as a package, so do nothing. \DoXPackageS, if there are any, are declared in the dtx file, and, if you’re reading the typeset documentation of this package, would appear just above. (It’s OK to call \usepackage with an empty argument or \relax, by the way.)

 9 \makeatletter% A special comment to help create bst files.  Don't change!
10 \@ifundefined{JusTLoaDInformatioN} {%
11 }{% ELSE (we know the compsci package is already loaded, too)
12 \UndefineCS\JusTLoaDInformatioN
13 \SaveDoXVarS
14 \eExpand\csname DoXPackageS\endcsname\In {%use \csname in case it's undefined
15  \usepackage{#1}%
16 }%
17 \RestoreDoXVarS
18 \makeatother
19 \endinput
20 }% A special comment to help create bst files.  Don't change!

Now we check for L^{A}TEX2e and declare the LaTeX package.

21 \NeedsTeXFormat{LaTeX2e}
22 \ProvidesPackage{bits}[\PPOptArg]

6 Preliminaries

6.1 Requirements

23 \RequirePackage{blkcntrl,letterhead,moredefs,relsize}

6.2 Option processing

24 \DeclareOption{poetica} {%
25 \RequirePackage{poetica}

26 \newcommand\FullTitlePoetica {%
27  \begin{Poetica}
28  \fontshape{t}\selectfont
29  \BitTitle\\%
30  \ifx\BitSubtitle\ShortEmpty \else
31  \BitSubtitle\\%
32  \fi
33  \end{Poetica}

34 }

35 \AtBeginDocument {%
36  \let\FullTitle\FullTitlePoetica

37 } 38 }

FIX: hmm, I think I always want user options so that I can have two different packages require a package, and they don’t have to match up on their options. What about options that can only be used in preamble, that would be the right thing for many cases I think. Aak, \ends can’t be defined without special handling? Hmm, seems like it can.

39 \DeclareBooleanUserOptions{ends}{noends}
40 \DeclareBooleanUserOptions{signed}{anonymous}

41

42 \DeclareBooleanOptions{titlepage}{notitlepage}

43

44 \ExecuteOptions{ends,notitlepage,signed}
45 \ProcessOptions

7 Making new copy and bit styles

7.1 General stuff

\bt@a \bt@b \bt@c \bt@d \bt@e
46 \ReserveCS\bt@a
47 \ReserveCS\bt@b
48 \ReserveCS\bt@c
49 \ReserveCS\bt@d
50 \ReserveCS\bt@e

\bt@tasks \bt@bitstyle@list \bt@copystyle@list Comma-separated lists of valid bitstyles, copystyles, and tasks. We start them off non-null to bootstrap the system of adding new ones, which adds them preceded by a comma.

51 \newcommand\bt@tasks {%
52 environment,end@bit,begin@bit,interbits,firstbit%
53 ,settitle,setfirsttitle%

54 }

55 \newcommand\bt@bitstyle@list {%
56 generic%

57 }

58 \newcommand\bt@copystyle@list {%
59 standard%

60 }

\if@bt@trymoreschemes@ \@bt@trymoreschemes@true \@bt@trymoreschemes@false \bt@list@car \bt@list@cdr  \bt@list@car and \bt@list@cdr expand to the car and cdr of a comma-separated

list, respectively.

61 \provideboolean{@bt@trymoreschemes@}

62

63 \NewName{bt@list@car}{#1,#2\@nil} {%
64 #1%

65 }

66 \NewName{bt@list@cdr}{#1,#2\@nil} {%
67 #2%

68 }

\NewCopystyle \NewBitstyle \bt@assign@task To define a new style, you specify a base style and a list of profiles. Each of these can be empty. If no base style is specified, the root style is used (i.e., standard copystyle or generic bitstyle). See discussion above.

69 \newcommand\NewCopystyle [2][Z] {% args: [profile-list] new-copystyle
70 \addto@macro\bt@copystyle@list{,#2}%
71 \@for\bt@a:=\bt@bitstyle@list \do {%
72  \@for\bt@b:=\bt@tasks \do {%
73  \eExpand\bt@b\In {%
74  \expandafter\bt@assign@task
75  \expandafter{\bt@a}{#2}{##1}{#1}%
76  }%
77  }%
78 }%

79 }

80 \newcommand\NewBitstyle [2][Z] {% args: [scheme-list] new-bitstyle
81 \addto@macro\bt@bitstyle@list{,#2}%
82 \@for\bt@a:=\bt@copystyle@list \do {%
83  \@for\bt@b:=\bt@tasks \do {%
84  \eExpand\bt@a\In {%
85  \eExpand\bt@b\In {%
86 %        \eExpandNest\bt@b\In {%  FIX?
87  \bt@assign@task{#2}{##1}{####1}{#1}%
88  }%
89  }%
90  }%
91 }%

92 }

93 \newcommand\bt@assign@task [4] {% args: bitstyle copystyle
94  %       task scheme-list
95 \@bt@trymoreschemes@true
96 \edef\bt@d{#4}% scheme-list that diminishes; edef not necessary
97 \@whilesw\if@bt@trymoreschemes@\fi {%

There’s at least one element to start; and the last scheme (Z) is always defined.

98  \edef\bt@c{%
99  \bt@list@car\bt@d,\@nil

100 }

101  \@ifundefined{bt@make@#3@\bt@c} {%
102  \edef\bt@d{\bt@list@cdr\bt@d,\@nil}%
103  }{% ELSE
104  \@nameuse{bt@make@#3@\bt@c}{#1}{#2}%
105  \@bt@trymoreschemes@false

106 }% 107 }% 108 }

\PromulgateTaskAcrossCopystyles
\PromulgateTaskAcrossBitstyles
109 \newcommand\PromulgateTaskAcrossCopystyles [3] {% args: task scheme bitstyle
110 \@for\bt@a:=\bt@copystyle@list \do {%
111  \@nameuse{bt@make@#1@#2}{#3}{\bt@a}%

112 }% 113 }

114 \newcommand\PromulgateTaskAcrossBitstyles [3] {% args: task scheme copystyle
115 \@for\bt@a:=\bt@bitstyle@list \do {%
116  \@nameuse{bt@make@#1@#2}{\bt@a}{#3}%

117 }% 118 }

\bt@begin@bit@common \BitStyle \PreBitAll  \bt@begin@bit@common should be called early in the sequence of beginning a bit.
119 \providesavebox\sc@box@a
120 \newcommand\bt@begin@bit@common [2] {%
121 \title{#1}%

We want to clear all optional attributes here, such as subtitle. FIX: should be a list of attributes and perhaps even abstract clearing functions on them, etc.

122 \subtitle{}%

Execute stuff: FIXME: nice hooks can be set here to execute things later We introduce the

so that extra spaces in the argument are not going to mean anything. It would be complicated but possible by means perhaps of \nullfont to avoid starting a paragraph here. Arg, the kernel is so opaque on how it handles ignoring spaces and what it’s doing with everypar.

123 \par #2%
124 \refstepcounter{bit}%
125 \ifnum\value{bit} = \@ne
126  \@nameuse{bt@firstbit@\CopyStyle}%
127 \else
128  \@nameuse{bt@interbits@\CopyStyle}%
129 \fi

130 }

131 \ReserveCS\BitStyle
132 \ReserveCS\PreBitAll

7.2 Schemes

7.2.1 The Z scheme

\FullTitle The Z scheme is always the last resort deafult, and it corresponds to the standard

copystyle and the generic bitstyle.

FIXME: whenever we have a dummy we have to use DefName or else we error FIXME: Aak, when Promulgating we need defnames for everyting!

133 \newcommand\bt@make@environment@Z [2] {% args: bitstyle dummy
134 \DefName{end#1}{}{}%
135 \DefName{#1}{##1##2} {%
136  \DefName{end#1}{} {%
137  \@nameuse{bt@end@bit@#1@\CopyStyle}{##1}%

138 }%

139  \@nameuse{bt@begin@bit@#1@\CopyStyle}{##1}{##2}%

140 }%

142 \newcommand\bt@make@interbits@Z [2] {% args: dummy copystyle
143 \DefName{bt@interbits@#2}{} {%
144  \relax
145  \par\pagebreak[2]\bigskip\bigskip
146  \@nameuse{bt@settitle@\BitStyle @#2}%

147 }% 148 }

149 \newcommand\bt@make@firstbit@Z [2] {% args: dummy copystyle
150 \DefName{bt@firstbit@#2}{} {%
151  \relax
152  \par\pagebreak[2]%
153  \thispagestyle{empty}%
154  \@nameuse{bt@setfirsttitle@\BitStyle @#2}%

155 }% 156 }

157 \newcommand\bt@make@begin@bit@Z [2] {% args: bitstyle copystyle
158 \DefName{PreBit#1}{}{}%
159 \DefName{bt@begin@bit@#1@#2}{##1##2} {%
160  \def\BitStyle{#1}%
161  \bt@begin@bit@common{##1}{##2}%
162  \PreBitAll
163  \@nameuse{PreBit#1}%

164 }% 165 }

166 \newcommand\bt@make@end@bit@Z [2] {% args: bitstyle copystyle
167 \DefName{bt@end@bit@#1@#2}{##1} {%
168  \TheEnd

169 }% 170 }

171 \newcommand\bt@make@settitle@Z [2] {% args: bitstyle copystyle
172 \DefName{bt@settitle@#1@#2}{} {%
173  \relax
174  \begin{center}\FullTitle\end{center}

175 }% 176 }

177 \newcommand\bt@make@setfirsttitle@Z [2] {% args: bitstyle copystyle
178 \DefName{bt@setfirsttitle@#1@#2}{} {%
179  \relax
180  \begin{center}\FullTitle\end{center}
181  \DTypeout{FIXME setfirsttitle in Z scheme}%

182 }% 183 }

When there is no subtitle, it sometimes seems better for the title to be set one size larger than the copy; but when you have a subtitle, you need the title two sizes larger so that the subtitle can be an intermediate size. With CM fonts, because their boldface is extended, a bold subtitle at the same size as the copy looks good, and larger is too larger. So this is a tricky issue. A basic kludge that would work for me, given the font families I have an use, would be to check for CM fonts here, or on the other hand specifically for an extended boldface, or for Dante/Bulmer, or set a flag in my dante.sty or bulmer.sty.

184 \newcommand\FullTitle {%
185 \relsize{2}\bfseries

186 %  \relsize{1}\bfseries
187 \BitTitle\\%
188 \ifx\BitSubtitle\ShortEmpty
189 \else
190  \csname sbseries\endcsname  % this way it's harmless if undefined
191  \relsize{-1}\BitSubtitle\\%
192 \fi

193 }

7.2.2 The P scheme

\bt@make@setfirsttitle@P \bt@make@settitle@P \bt@make@end@bit@P \bt@make@begin@bit@P The P scheme was created for the poem bitstyle.
194 \newcommand\bt@make@begin@bit@P [2] {% args: bitstyle copystyle
195 \DefName{bt@begin@bit@#1@#2}{##1##2} {%
196  \def\BitStyle{#1}%
197  \bt@begin@bit@common{##1}{##2}%
198  \PreBitAll
199  \verse        % FIX: why does the PreBitAll hook come before \verse and the
200 % BitHook come after?  Why doesn't the PreBitAll come in
201 % @common@ -- well, so that a bit can put stuff before the hooks.
202  \@nameuse{PreBit#1}%

203 }% 204 }

205 \newcommand\bt@make@end@bit@P [2]  {% args: bitstyle copystyle
206 \DefName{bt@end@bit@#1@#2}{##1} {%
207  \relax
208  \endverse
209  \TheEnd

210 }% 211 }

212 \newcommand\bt@make@settitle@P [2]  {% args: bitstyle copystyle
213 \DefName{bt@settitle@#1@#2}{} {%
214  \relax
215  \begin{verse}\FullTitle\end{verse}

216 }% 217 }

218 \newcommand\bt@make@setfirsttitle@P [2]  {% args: bitstyle copystyle
219 \DefName{bt@setfirsttitle@#1@#2}{} {%
220  \relax
221  \begin{verse}\FullTitle\end{verse}
222  \DTypeout{this is setfirsttitle in P scheme}%

223 }% 224 }

7.2.3 The R scheme

For the prose bitstyle.

225 \newcommand\bt@make@settitle@R [2] {%
226 \DefName{bt@settitle@#1@#2}{} {%
227  \relax
228  \ifx\BitTitle\ShortEmpty\else
229  \noindent
230  \begingroup

231  \relsize{1}%
232  \bfseries
233  \BitTitle
234  \endgroup
235  \par\smallskip
236  \fi

237 }% 238 }

7.2.4 The T scheme

FIX: for what?

8 The standard copystyle and generic bitstyle

239 \@for\bt@e:=\bt@tasks \do {%
240 \PromulgateTaskAcrossBitstyles{\bt@e}{Z}{standard}

241 }

9 Bit Styles

9.1 Story

This is the same as generic.

242 \NewBitstyle{generic}
243 \NewBitstyle{story}

9.2 Poem

244 \NewBitstyle{poem}
245 \PromulgateTaskAcrossCopystyles{begin@bit}{P}{poem}
246 \PromulgateTaskAcrossCopystyles{end@bit}{P}{poem}
247 \PromulgateTaskAcrossCopystyles{settitle}{P}{poem}
248 \PromulgateTaskAcrossCopystyles{setfirsttitle}{P}{poem}

9.3 Prose

249 \NewBitstyle{prose}
250 \PromulgateTaskAcrossCopystyles{settitle}{R}{prose}

10 Copy Styles

251 \NewCopystyle{titlepage}

252

253 \newcommand\bt@make@setfirsttitle@T [2] {% args: bitstyle copystyle
254 \DefName{bt@setfirsttitle@#1@#2}{} {%
255  \thispagestyle{empty}%
256  \vspace*{\fill}%
257  \begin{center}
258  {\relsize{5}\BitTitle \\}%
259  \ifx\BitSubtitle\ShortEmpty\else
260  {\relsize{3}\BitSubtitle \\}%
261  \fi
262  \end{center}

263  \vfill
264 %      \CoverNotes
265 %      \vfill
266  \par
267  \begingroup
268  \sffamily
269  \hfill
270  \begin{tabular}{r@{\hspace{\@ne em}}r}
271  Copy of:&\todayabbrev   \\%
272  Version of:&\Lastchange \\%
273  Date:&\Date             \\%
274  \end{tabular}
275  \par\bigskip\bigskip
276  \begin{raggedleft}
277  \def\and{\\}%
278  \larger\scshape\Author

A final \par is needed to close the paragraph in raggedleft mode.

279  \par
280  \end{raggedleft}
281  \endgroup
282  \newpage
283  \setcounter{page}{\@ne}%

284 }% 285 }

286 \PromulgateTaskAcrossBitstyles{setfirsttitle}{T}{titlepage}

11 Bit counters and interbit skips

\c@bit
\c@bitbit
\c@bitbitbit

287 \providecounter{bit}
288 \providecounter{bitbit}[bit]
289 \providecounter{bitbitbit}[bitbit]
\bt@bitskip \InterBitBreak \InterBitBitBreak \InterBitBitBitBreak  \medbreak is penalty -100; \smallbreak is 50. FIXME: what’s going on here?
290 \newcommand\bt@bitskip[1] {%
291 \par
292 \ifdim \lastskip < \bigskipamount
293  \removelastskip
294  \penalty -500%
295  #1%
296 \fi

297 }

298 \newcommand\InterBitBreak {%
299 \bt@bitskip
300 \bigskip

301 }

302 \newcommand\InterBitBitBreak {%
303 \bt@bitskip
304 \medskip

305 }

306 \newcommand\InterBitBitBitBreak {%
307 \bt@bitskip
308 \smallskip

309 }

\bitbit \bitbitbit \bt@bitbit \bt@bitbitbit FIXME: These should be made attributes of the Generic Bit Style.

310 \newcommand\bitbit {%
311 \@ifstar {%
312  \bt@bitbit{}%
313  }{% ELSE
314  \refstepcounter{bitbit}%
315  \bt@bitbit{\thebitbit\ }%

316 }% 317 }

318 \newcommand{\bt@bitbit} [2] {%
319 \ifnum\value{bitbit}=\@ne \else
320  \InterBitBitBreak
321 \fi
322 \noindent #1{\relsize{-1}\bfseries #2}%
323 \par\nobreak
324 \smallskip

325 }

326 \newcommand\bitbitbit {%
327 \@ifstar {%
328  \bt@bitbitbit{}%
329  }{% ELSE
330  \refstepcounter{bitbitbit}%
331  \bt@bitbitbit{\thebitbitbit\ }%

332 }% 333 }

334 \newcommand\bt@bitbitbit [2] {%
335 \ifnum\value{bitbitbit}=\@ne \else
336  \InterBitBitBitBreak
337 \fi
338 \noindent #1{\relsize{-1}\bfseries #2}%
339 \par\nobreak
340 \smallskip

341 }

12 Userinfos

\Author \author \Lastchange \lastchange \Date \date \title \BitTitle \BitSubtitle \Subtitle \subtitle When we redefine \author, \date, and \title, we add a new action to the original

meaning. This means that standard commands like \maketitle will still perform as expected, if someone prefers to use that instead of the Frankenstein commands.

342 \SaveCS\date

343

344 \newcommand*\Date {%
345 \todayabbrev

346 }

347 \defcommand\date [1] {%
348 \MDSaveddate{#1}%
349 \def\Date{#1}%

350 }

351 \SaveCS\title
352 \ReserveCS\BitTitle

353

354 \defcommand\title [1] {%

355 \MDSavedtitle{#1}%
356 \def\BitTitle{#1}%

357 }

Why did I originally want \Subtitle to be a user command instead of \subtitle?

358 \NewUserInfo*[\subtitle]\BitSubtitle
359 %\NewUserInfo*[\Subtitle]\BitSubtitle
360 %\newlet\subtitle\Subtitle
361 \NewUserInfo*\Lastchange
362 \lastchange{\todayabbrev}
\Copystyle \copystyle
363 \NewUserInfo*\CopyStyle
364 \copystyle{standard}

13 Dates

\today
\todayabbrev
365 \def\today {%
366 \number\day\space\ifcase\month\or
367  January\or February\or
368  March\or April\or May\or June\or July\or August\or September\or
369  October\or November\or December\fi\space\number\year

370 }

371 \newcommand\todayabbrev {%
372 \number\day\space\ifcase\month\or
373  Jan\or Feb\or
374  Mar\or Apr\or May\or Jun\or Jul\or Aug\or Sep\or
375  Oct\or Nov\or Dec\fi\space\number\year

376 }

\copywrite This adds a copyright message to the beginning of \Notes. Its single argument should be a year.

377 \newcommand\copywrite [1] {%
378 \edef\Notes {%
379  \copyright#1 All rights reserved. \Notes

380 }% 381 }

14 Ends

\EndSign It’s very hard to attach this thing without allowing a page break before it. FIX.

382 \newcommand\EndSign {%
383 \par\nobreak
384 \vspace{2\bigskipamount}%  multiplication turns glue into dimen.
385 \hfill

We do this so that \Author can have \\s in it.

386 \begingroup
387  \scshape
388  \let\and\@tabularcr
389  \begin{tabular}{c}

390  \Author \\%
391  \relsize{-1}\itshape\Date
392  \end{tabular}%
393 \endgroup

394 }

\theend User command which (almost) always makes an \EndSign:

395 \newcommand\theend {%
396 \if@signed@
397  \EndSign
398 \fi

399 }

\TheEnd The end of a bit calls \TheEnd. The default definition is either nothing or \EndSign, depending on some condition.

400 \newcommand\TheEnd {%
401 \def\sc@t@c {%
402  prizes%

403 }%

404 \let\sc@t@a\EndSign
405 \ifx\CopyStyle\sc@t@c
406  \InitCS*\sc@t@a
407 \else
408  \if@signed@
409  \if@ends@
410 % FIX: when you get the footer going...
411 %        \ifnum\value{page} < 2%
412 %          \InitCS*\sc@t@a
413 %        \fi
414  \else
415  \InitCS*\sc@t@a
416  \fi
417  \else
418  \InitCS*\sc@t@a
419  \fi
420 \fi
421 \sc@t@a

422 }

15 Version control

We use macros instead of boxes, because at this point some of the macros in the boxes may change their meaning.

Algorithm: We will maintain two \hbox es to \textwidth each time \MakeCover is called. Set the footboxes to \v@idbox here. Whenever \MakeCover is called, it should stack another \vbox with the right information in it into both boxes. The information is expanded, and thus the macro contents can change between calls to \MakeCover, but the box being built inserts two different \vboxes with their value at the moment.

\bt@vcbox
\VersionControlString
\VersionControlAuthorString

423 \newcommand\BTVersionWord {Version}

424 \newcommand\BTCopyWord {Copy}
425 \newcommand\bt@vcbox {%
426 \footnotesize
427 \ifx\Lastchange\ShortEmpty\else
428  {\bfseries \BTVersionWord:} {\slshape \Lastchange}%
429 \fi
430 \hspace{\@ne em}%
431 {\bfseries \BTCopyWord:} {\slshape \todayabbrev}%

432 }

433 \newcommand\VersionControlString {%
434 \hfill \bt@vcbox \hfill

435 }

I should assign some names to the various meanings of and, like protect.

436 \newcommand\VersionControlAuthorString {%
437 \bt@vcbox \hfill {\scshape\def\and{\unskip, \ignorespaces}\Author}%

438 }

\whitespace
439 \requirecommand\whitespace {%
440 \bigbreak

441 }

Part III

Configuration

We leave the rest to a configuration file.

1 \InputIfFileExists{bits.cfg}{}{}

The contents of the distributed configuration file are below.

2 \def\fileinfo{Bits package configuration}
3 \def\fileversion{v1}
4 \def\filedate{1996/01/24}
5 \def\docdate{1996/01/24}
6 \ProvidesFile{bits.cfg}
7 \InputIfFileExists{monster.cfg}{}{}

Index

Numbers written in italic refer to the page where the corresponding entry is described; numbers underlined refer to the code line of the definition; numbers in roman refer to the code lines where the entry is used.

Symbols

\@bt@trymoreschemes@false

. . . . . . . . \underline{61}, 105

\@bt@trymoreschemes@true

. . . . . . . . . \underline{61}, 95 \@for . . . . . . . 71, 72,

82, 83, 110, 115, 239 \@ifstar . . . . . 311, 327

\@ifundefined . . 10, 101
\@nameuse . . . . 104,

111, 116, 126, 128, 137, 139, 146, 154, 163, 202

\@ne . . . . . . 125, 270,

283, 319, 335, 430 \@nil …. 63, 66, 99, 102

\@tabularcr . . . . . . . 388

\@whilesw . . . . . . . . 97 \\ . . . . . 29, 31, 187,

191, 258, 260, 271–273, 277, 390

\␣ . . . . . . . . . . 315, 331

A

\addto@macro . . . . 70, 81

\and . . . . . . 277, 388, 437

\AtBeginDocument . . 35

\Author 278, \underline{342}, 390, 437 \author . . . . . . . . . . \underline{342}

B

\begin . . . . . 27, 174, 180, 215, 221, 257, 270, 276, 389

\begingroup 230, 267, 386
\bfseries . . . . . . . .

. 185, 186, 232, 322, 338, 428, 431

\bigbreak . . . . . . . . 440 \bigskip . . 145, 275, 300

\bigskipamount 292, 384

\bitbit . . . . . . . . . . \underline{310}

\bitbitbit . . . . . . . \underline{310}
\BitStyle . . . . \underline{119},

146, 154, 160, 196

\BitSubtitle . . . . . .

… 30, 31, 188, 191, 259, 260, \underline{342}

\BitTitle . . 29, 187,

228, 233, 258, \underline{342} \bt@a \underline{46}, 71, 75, 82, 84,

110, 111, 115, 116

\bt@assign@task . . . \underline{69}

\bt@b \underline{46}, 72, 73, 83, 85, 86

\bt@begin@bit@common

…. \underline{119}, 161, 197

\bt@bitbit . . . . . . . \underline{310}
\bt@bitbitbit . . . . . \underline{310}
\bt@bitskip . . . . . . . \underline{290}
\bt@bitstyle@list .

… \underline{51}, 71, 81, 115 \bt@c … \underline{46}, 98, 101, 104

\bt@copystyle@list .

… \underline{51}, 70, 82, 110 \bt@d …. \underline{46}, 96, 99, 102 \bt@e . . . . . \underline{46}, 239, 240

\bt@list@car . . . . \underline{61}, 99
\bt@list@cdr . . . \underline{61}, 102
\bt@make@begin@bit@P

. . . . . . . . . . . \underline{194}

\bt@make@begin@bit@Z

. . . . . . . . . . . 157

\bt@make@end@bit@P . \underline{194}
\bt@make@end@bit@Z . 166
\bt@make@environment@Z

. . . . . . . . . . . 133

\bt@make@firstbit@Z 149
\bt@make@interbits@Z

. . . . . . . . . . . 142

\bt@make@setfirsttitle@P

. . . . . . . . . . . \underline{194}

\bt@make@setfirsttitle@T

. . . . . . . . . . . 253

\bt@make@setfirsttitle@Z

. . . . . . . . . . . 177

\bt@make@settitle@P  \underline{194}
\bt@make@settitle@R 225
\bt@make@settitle@Z 171

\bt@tasks \underline{51}, 72, 83, 239 \bt@vcbox . . . . . . . . \underline{423}

\BTCopyWord . . . 424, 431
\BTVersionWord 423, 428

C \c@bit . . . . . . . . . . . \underline{287} \c@bitbit . . . . . . . . \underline{287}

                          \c@bitbitbit . . . . . . \underline{287}
                          \copyright . . . . . . . 379
                          \CopyStyle 126, 128,

137, 139, 363, 405

                          \Copystyle . . . . . . . \underline{363}
                          \copystyle . . . . . . . \underline{363}
                          \copywrite . . . . . . . \underline{377}
                          \CoverNotes . . . . . . . 264

\csname . . . . . . . 14, 190

D \Date . . . . . 273, \underline{342}, 391 \date . . . . . . . . . . . . \underline{342} \day . . . . . . . . . 366, 372

                          \DeclareBooleanOptions

. . . . . . . . . . . . 42

                          \DeclareBooleanUserOptions

. . . . . . . . . 39, 40

                          \DeclareOption . . . . 24

\def . . . . . . 1–5, 160, 196, 277, 349, 356, 365, 401, 437

                          \defcommand . . . 347, 354

\DefName . . 134–136, 143, 150, 158, 159, 167, 172, 178, 195, 206, 213, 219, 226, 254

\do . . . . . . . . 71, 72,

82, 83, 110, 115, 239 \docdate . . . . . . . . \underline{1}, 5

                          \DoXPackageS . . . . . . . 2
                          \DoXUsepackagE . . . . . \underline{1}

\DTypeout …. 181, 222

E \edef . 6, 96, 98, 102, 378 \eExpand . 14, 73, 84, 85

                          \eExpandNest . . . . . . 86

\else 30, 127, 189, 228, 259, 319, 335, 407, 414, 417, 427

\end . . . . . . . 33, 174, 180, 215, 221, 262, 274, 280, 392

\endcsname . . . . 14, 190

\endgroup . 234, 281, 393 \endinput . . . . . . . . 19 \EndSign . . \underline{382}, 397, 404 \endverse . . . . . . . . 208

\ExecuteOptions . . . 44
\expandafter . . . . 74, 75

F

\fi . 32, 97, 129, 192, 236, 261, 296, 321, 337, 369, 375, 398, 413, 416, 419, 420, 429

\filedate . . . . . . . \underline{1}, 4 \fileinfo . . . . . . . \underline{1}, 2

\fileversion . . . . . \underline{1}, 3

\fill . . . . . . . . . . . . 256

\fontshape . . . . . . . 28
\footnotesize . . . . . 426
\FullTitle . . . . . . .

. 36, \underline{133}, 215, 221

\FullTitlePoetica 26, 36

H

\HaveECitationS . . . . \underline{1}

\hfill 269, 385, 434, 437 \hspace . . . . . . 270, 430

I

\if@bt@trymoreschemes@

. . . . . . . . . \underline{61}, 97 \if@ends@ . . . . . . . . 409

\if@signed@ . . . 396, 408

\ifcase . . . . . . 366, 372 \ifdim . . . . . . . . . . . 292 \ifnum 125, 319, 335, 411 \ifx . . . . . . . 30, 188,

228, 259, 405, 427

\ignorespaces . . . . . 437

\In . . . . . . 14, 73, 84–86 \InitCS 406, 412, 415, 418

\InputIfFileExists 1, 7
\InterBitBitBitBreak

. . . . . . . . \underline{290}, 336

\InterBitBitBreak .

. . . . . . . . \underline{290}, 320

\InterBitBreak . . . . \underline{290}

\itshape . . . . . . . . . 391

J

\JusTLoaDInformatioN 12

L

\larger . . . . . . . . . . 278

\Lastchange . . . . . . .

. 272, \underline{342}, 427, 428

\lastchange . . . . . . . \underline{342}

\lastskip . . . . . . . . 292 \let . . . . . . 36, 388, 404

M

\makeatletter . . . . . . 9
\makeatother . . . . . . 18
\MDSaveddate . . . . . . 348
\MDSavedtitle . . . . . 355

\medskip . . . . . . . . . 304 \month . . . . . . . 366, 372

N

\NeedsTeXFormat . . . 21
\NewBitstyle . . . . . .

. . \underline{69}, 242–244, 249

\newcommand . . . . . . .

. 26, 51, 55, 58, 69, 80, 93, 109, 114, 120, 133, 142, 149, 157, 166, 171, 177, 184, 194, 205, 212, 218, 225, 253, 290, 298, 302, 306, 310, 318, 326, 334, 344, 371, 377, 382, 395, 400, 423–425, 433, 436

\NewCopystyle . . \underline{69}, 251

\newlet . . . . . . . . . . 360 \NewName . . . . . . . 63, 66 \newpage . . . . . . . . . 282

\NewUserInfo . . . . . .

. 358, 359, 361, 363 \nobreak . . 323, 339, 383 \noindent . 229, 322, 338 \Notes . . . . . . . 378, 379 \number 366, 369, 372, 375

O

\or . . 366–369, 372–375

P

\pagebreak . . . 145, 152

\par 123, 145, 152, 235, 266, 275, 279, 291, 323, 339, 383

\penalty . . . . . . . . . 294 \PPOptArg . . . . . . . \underline{1}, 22 \PreBitAll \underline{119}, 162, 198

\ProcessOptions . . . 45

\PromulgateTaskAcrossBitstyles

…. \underline{109}, 240, 286

\PromulgateTaskAcrossCopystyles

. \underline{109}, 245–248, 250

\provideboolean . . . 61
\providecounter 287–289
\providesavebox . . . 119
\ProvidesFile . . . . . . 6
\ProvidesPackage . . 22

R

\refstepcounter . . .

…. 124, 314, 330 \relax . . . . . . . 144,

151, 173, 179, 207, 214, 220, 227

\relsize . . 185, 186, 191, 231, 258, 260, 322, 338, 391

\removelastskip . . . 293
\requirecommand . . . 439
\RequirePackage . 23, 25
\ReserveCS . . . . . . .

46–50, 131, 132, 352

\RestoreDoXVarS . . . 17

S

\SaveCS . . . . . . 342, 351

\SaveDoXVarS . . . . . . 13

\sc@box@a . . . . . . . . 119 \sc@t@a … 404, 406,

412, 415, 418, 421 \sc@t@c . . . . . . 401, 405 \scshape . . 278, 387, 437

\selectfont . . . . . . . 28
\setcounter . . . . . . . 283

\sffamily . . . . . . . . 268

\ShortEmpty . . . . 30,

188, 228, 259, 427 \slshape . . . . . 428, 431

\smallskip . . . . . . .

. 235, 308, 324, 340 \space . . . . . . . . . 7,

366, 369, 372, 375 \Subtitle . . . . . . . . \underline{342} \subtitle …. 122, \underline{342}

T

\thebitbit . . . . . . . 315
\thebitbitbit . . . . . 331

\TheEnd … 168, 209, \underline{400} \theend . . . . . . . . . . \underline{395}

\thispagestyle 153, 255

\title . . . . . . . 121, \underline{342} \today . . . . . . . . . . . \underline{365}

\todayabbrev . . 271,

345, 362, \underline{365}, 431

U

\UndefineCS . . . . . . . 12

\unskip . . . . . . . . . . 437

\usepackage . . . . . . . 15

V

\value 125, 319, 335, 411 \verse . . . . . . . . . . . 199

\VersionControlAuthorString

. . . . . . . . . . . \underline{423}

\VersionControlString

. . . . . . . . . . . \underline{423}

\vfill . . . . . . . 263, 265 \vspace . . . . . . 256, 384

W

                          \whitespace . . . . . . . \underline{439}

Y \year . . . . . . . . 369, 375