This file is built for L^{A}TEX 2ε, so we make sure an error is generated when it is used with another format

 1 ⟨+package⟩\NeedsTeXFormat{LaTeX2e}

Now announce the package name and its version:

2 ⟨∗dtx⟩

 3 \ProvidesFile{changebar.dtx}

4 ⟨/dtx⟩

 5 ⟨+package⟩\ProvidesPackage{changebar}
 6  [1996/03/26 v3.2c Indicate changes with marginal bars]

1 A driver for this document

The next bit of code contains the documentation driver file for TEX, i.e., the file that will produce the documentation you are currently reading. It will be extracted from this file by the docstrip program.

7 ⟨∗driver⟩

 8 \documentclass{ltxdoc}

We do want an index, using linenumbers

 9 \EnableCrossrefs
10 \CodelineIndex

This document uses some extra doc style macros.

11 \makeatletter
12 \def\DescribeVar#1{\leavevmode\@bsphack
13  \marginpar{\raggedleft\PrintDescribeEnv{#1}}%
14  \SpecialVarUsageIndex{#1}\@esphack\ignorespaces}
15 \def\SpecialVarMainIndex#1{\@bsphack
16  \index{#1\actualchar\texttt{#1}\encapchar main}%
17  \@esphack}
18 \def\SpecialVarUsageIndex#1{\@bsphack
19  \index{#1\actualchar\texttt{#1}\encapchar usage}%
20  \@esphack}
21 \let\@SpecialMainIndex\SpecialMainIndex
22 \def\Var{\let\SpecialMainIndex\SpecialVarMainIndex\macro}
23 \def\endVar{\endmacro\let\SpecialMainIndex\@SpecialMainIndex}
24 \makeatother

Some commonly used abbreviations

25 \newcommand\Lopt[1]{\textsf {#1}}
26 \newcommand\Lenv[1]{\textsf {#1}}
27 \newcommand\file[1]{\texttt {#1}}
28 \newcommand\Lcount[1]{\textsl {\small#1}}
29 \newcommand\pstyle[1]{\textsl {#1}}

We also want the full details.

30 \begin{document}
31 \DocInput{changebar.dtx}
32 \end{document}

33 ⟨/driver⟩

The Changebar document style option ^{∗}

Johannes Braams Kooienswater 62 2215 AK Zoetermeer The Netherlands

                   JLBraams@cistron.nl

Printed February 17, 1997

Contents

1 A driver for this document 1

2 Introduction 2

3 The user interface 3 3.1 The package options … 3 3.2 Macros defined by the

package . . . . . . . . . . 3 3.3 Changebar parameters . . 4

4 Deficiencies and bugs 4

5 The basic algorithm 5

6 The implementation 6 6.1 Declarations And Initial-

izations . . . . . . . . . . 6 6.2 Option Processing …. 8 6.3 User Level Commands

And Parameters . . . . . 9 6.4 Macros for beginning and

ending bars . . . . . . . . 13 6.5 Macros for Making It

Work Across Page Breaks 15 6.6 Macros For Managing

The Lists of Bar points . 17 6.7 Macros For Checking That The .aux File Is Stable . . . . . . . . . . . 18

6.8 Macros For Making It Work With Nested Floats/Footnotes . . . . . 19

Abstract

This document style-option implements a way to indicate modifications in a L^{A}TEX-document by putting bars in the margin. It realizes this by making use of the \special commands supported by ‘dvi drivers’. Currently four different drivers are supported. More can easily be added.

2 Introduction

IMPORTANT NOTE: Just as with cross references and labels, you usually need to process the document twice (and sometimes three times) to ensure that the changebars come out correctly. However, a warning will be given if another pass is required.

FEATURES:

∗This file has version number v3.2c, last revised 1996/03/26.

• Changebars may be nested within each other. Each level of nesting can be given a different thickness bar.

• Changebars may be nested in other environments including floats and footnotes.

• Changebars are applied to all the material within the “barred” environment, including floating bodies regardless of where the floats float to. An exeception to this are margin floats.

• Changebars may cross page boundaries.

3 The user interface

This package has options to specify some details of its operation, and also defines several macros.

3.1 The package options

One set of package options/footnoteFor older documents the command \driver is available in the preamble of the document. It takes the options as defined for L^{A}TEX 2ε as argument. specify the driver that will be used to print the document can be indicated. The driver may be one of:

• DVItoLN03

• DVItoPS

• DVIps

• emTEX

The drivers are represented in the normal typewriter method of typing these names, or by the same entirely in lower case.

The position of the bars may either be on the inner edge of the page (the left column on a recto or single-sided page, the right column of a verso page) by use of the innerbars package option (the default), or on the outer edge of the page by use of the the outerbars package option.

The package also implements tracing for its own debugging. The package options traceon and traceoff control tracing.

3.2 Macros defined by the package

\cbstart All material between the macros \cbstart and \cbend is barred. The nesting of

\cbend multiple changebars is allowed. The macro \cbstart has an optional parameter that specifies the width of the bar. The syntax is \cbstart[⟨dimension⟩]. If no width is specified, the current value of the parameter \changebarwidth is used. Note that \cbstart and \cbend can be used anywhere but must be correctly nested with floats and footnotes. That is, one cannot have one end of the bar inside a floating insertion and the other outside, but that would be a meaningless thing to do anyhow.

changebar Apart from the macros \cbstart and \cbend a proper L^{A}TEX environment is defined. The advantage of using the environment whenever possible is that L^{A}TEX will do all the work of checking the correct nesting of different environments.

\cbdelete The macro \cbdelete puts a square bar in the margin to indicate that some text was removed from the document. The macro has an optional argument to specify the width of the bar. When no argument is specified the current value of the parameter \deletebarwidth will be used.

\nochangebars The macro \nochangebars disables the changebar commands.

3.3 Changebar parameters

\changebarwidth The width of the changebars is controlled with the L^{A}TEX length parameter \changebarwidth. Its value can be changed with the \setlength command. Changing the value of \changebarwidth affects all subsequent changebars subject to the scoping rules of \setlength.

\deletebarwidth The width of the deletebars is controlled with the L^{A}TEX length parameter \deletebarwidth. Its value can be changed with the \setlength command. Changing the value of \changebarwidth affects all subsequent deletebars subject to the scoping rules of \setlength.

\changebarsep The separation between the text and the changebars is determined by the value

of the L^{A}TEX length parameter \changebarsep.

changebargrey When one of the supported dvi to PostScript translators is used the ‘blackness’ of the bars can be controlled. The L^{A}TEX counter changebargrey is used for this purpose. Its value can be changed with a command like:

    \setcounter{changebargrey}{85}

The value of the counter is a percentage, where the value 0 yields black bars, the value 100 yields white bars.

outerbars The changebars will be printed in the ‘inside’ margin of your document. This means they appear on the left side of the page. When twoside is in effect the bars will be printed on the right side of even pages. This behaviour can be changed by including the command \outerbarstrue in your document.

4 Deficiencies and bugs

• The macros blindly use specials points \cb@minpoint through \cb@maxpoint. If this conflicts with another set of macros, the results will be unpredictable. (What is really needed is a \newspecialpoint, analogous to \newcount etc. — it’s not provided because the use of the points is rather rare.)

• There is a limit of (\cb@maxpoint−\cb@minpoint+1)/2 bars per page (two special points per bar). Using more than this number yeilds unpredictable results (but that could be called a feature for a page with so many bars). This limitation could be increased if desired.

• Internal macro names are all of the form \cb@xxxx. No checking for conflicts with other macros is done.

• This implementation does not work with two (or more) column printing.

• The algorithms may fail if a floating insertion is split over multiple pages. In L^{A}TEX floats are not split but footnotes may be. The simplest fix to this is to prevent footnotes from being split but this may make TEX very unhappy.

• The \cbend normally gets “attached” to the token after it rather than the one before it. This may lead to a longer bar than intended. For example, consider the sequence ‘word1 \cbend word2’. If there is a line break between ‘word1’ and ‘word2’ the bar will incorrectly be extended an extra line. This particular case can be fixed with the incantation ‘word1\cbend{} word2’.

5 The basic algorithm

The changebars are implemented using the \specials of various dvi interpreting programs like DVItoLN03 or DVIps. In essence, the start of changebar defines a \special point in the margin at the current vertical position on the page. The end of a changebar defines another point and then joins the two using the “connect”

\special.

This works fine as long as the two points being connected lie on the same page. However, if they don’t, the bar must be artificially terminated at the page break and restarted at the top of the next page. The only way to do this (that I can think of) is to modify the output routine so that it checks if any bar is in progress when it ships out a page and, if so, adds the necessary artificial end and begin.

The obvious way to indicate to the output routine that a bar is in progress is to set a flag when the bar is begun and to unset this flag when the bar is ended. This works most of the time but, because of the asynchronous behavior of the output routine, errors occur if the bar begins or ends near a page break. To illustrate, consider the following scenario.

    blah blah blah          % page n
    blah blah blah
    \cbstart                % this does its thing and set the flag
    more blah
               <-------------- pagebreak occurs here
    more blah
    \cbend                  % does its thing and unsets flag
    blah blah

Since TEX processes ahead of the page break before invoking the output routine, it is possible that the \cbend is processed, and the flag unset, before the output routine is called. If this happens, special action is required to generate an artificial end and begin to be added to page n and n + 1 respectively, as it is not possible to use a flag to signal the output routine that a bar crosses a page break.

The method used by these macros is to create a list of the beginning and end points of each bar in the document together with the page number corresponding to each point. Then, as a page is completed, a modified output routine checks the list to determine if any bars begun on or before the current page are terminated on subsequent pages, and handles those bars appropriately. To build the list, information about each changebar is written to the .aux file as bars are processed. This information is re-read when the document is next processed. Thus, to ensure that changebars are correct, the document must be processed twice. Luckily, this is generally required for L^{A}TEX anyway.

This approach is sufficiently general to allow nested bars, bars in floating insertions, and bars around floating insertions. Bars inside floats and footnotes are handled in the same way as bars in regular text. Bars that encompass floats or footnotes are handled by creating an additional bar that floats with the floating material. Modifications to the appropriate L^{A}TEX macros check for this condition and add the extra bar.

6 The implementation

We begin by identifying ourselves by writing a message in the transcript of the session.

6.1 Declarations And Initializations

\cb@maxpoint The original version of changebar.sty only supported the DVItoLN03 specials. The LN03 printer has a maximum number of points that can be defined on a page. Also for some PostScript printers the number of points that can be defined can be limited by the amount of memory used. Therefore, the consecutive numbering of points has to be reset when the maximum is reached. This maximum can be adapted to the printers needs.

34 ⟨∗package⟩

35 \def\cb@maxpoint{80}

\cb@minpoint When resetting the point number we need to know what to reset it to, this is minimum number is stored in \cb@minpoint. This number has to be ODD because the algorithm that decides whether a bar has to be continued on the next page depends on this.

36 \def\cb@minpoint{1}

\cb@nil Sometimes a void value for a point has to be returned by one of the macros. For this purpose \cb@nil is used.

37 \def\cb@nil{0}

\cb@nextpoint \cb@currentpoint The number of the next special point is stored in the count register \cb@nextpoint and initially equal to \cb@minpoint. The number of the current point is stored

in \cb@currentpoint.
38 \newcount\cb@nextpoint
39 \cb@nextpoint=\cb@minpoint
40 \newcount\cb@currentpoint

\cb@page \cb@pagecount The macros need to keep track of the number of pages output so far. To this end the counter \cb@pagecount is used. When a pagenumber is read from the history list, it is stored in the counter \cb@page. The counter cb@pagecount is initially 0; it gets incremented during the call to \@makebox (see section 6.5).

41 \newcount\cb@page
42 \newcount\cb@pagecount
43 \cb@pagecount=0

outerbars A switch is provided to control where the changebars will be printed.

44 \newif\ifouterbars

@cb@trace A switch to enable tracing of the actions of this package

45 \newif\if@cb@trace

\cb@positions This macro calculates the (horizontal) positions of the changebars. The calcula-

tions take twoside into account. Also the setting of the switch outerbars is checked.

Because the margins can differ for even and odd pages and because changebars are sometimes on different sides of the paper we need two dimensions to store the result.

Since the changebars are drawn with the PostScript command lineto and not as TEX-like rules the reference points lie on the center of the changebar, therefore the calculation has to add or subtract half of the width of the bar to keep \changebarsep whitespace between the bar and the body text.

46 \newdimen\cb@odd
47 \newdimen\cb@even

First the position for odd pages is calculated. In this case the use of the twoside option does not effect the positioning of the changebars.

48 \def\cb@positions{%
49 \global\cb@odd =\hoffset
50 \global\advance\cb@odd by \oddsidemargin
51 \ifouterbars
52  \global\advance\cb@odd by \textwidth
53  \global\advance\cb@odd by \changebarsep
54  \global\advance\cb@odd by 0.5\changebarwidth
55 \else
56  \global\advance\cb@odd by -\changebarsep
57  \global\advance\cb@odd by -0.5\changebarwidth
58 \fi

On even pages the use of the twoside option results in a different placement of the bars.

59 \global\cb@even =\hoffset
60 \global\advance\cb@even by \evensidemargin
61 \if@twoside
62  \ifouterbars
63  \global\advance\cb@even by -\changebarsep
64  \global\advance\cb@even by -0.5\changebarwidth
65  \else
66  \global\advance\cb@even by \textwidth
67  \global\advance\cb@even by \changebarsep
68  \global\advance\cb@even by 0.5\changebarwidth
69  \fi
70 \else
71  \ifouterbars
72  \global\advance\cb@even by \textwidth
73  \global\advance\cb@even by \changebarsep
74  \global\advance\cb@even by 0.5\changebarwidth
75  \else
76  \global\advance\cb@even by -\changebarsep
77  \global\advance\cb@even by -0.5\changebarwidth

78  \fi
79 \fi}

\cb@removedim In PostScript code length specifications are without dimensions. Therefore we need a way to remove the letters ‘pt’ from the result of the operation \the\⟨dimen⟩. This can be done by defining a command that has a delimited argument like:

    \def\cb@removedim#1pt{#1}

We encounter one problem though, the category code of the letters ‘pt’ is 12 when produced as the output from \the\⟨dimen⟩. Thus the characters that delimit the argument of \cb@removedim also have to have category code 12. To keep the changes local the macro \cb@removedim is defined in a group.

80 {\catcode`\p=12\catcode`\t=12 \gdef\cb@removedim#1pt{#1}}

6.2 Option Processing

The user should select the specials that should be used by specifying the driver name as an option to the \usepackage call. Possible choices are:

• DVItoLN03

• DVItoPS

• DVIps

• emTEX

The ambition is that the driver names should be case-insensitive, but the following code doesn’t achieve this: it only permits the forms given above and their lower-case equivalents.

81 \DeclareOption{DVItoLN03}{\global\chardef\cb@driver@setup=0\relax}
82 \DeclareOption{dvitoln03}{\global\chardef\cb@driver@setup=0\relax}
83 \DeclareOption{DVItoPS}{\global\chardef\cb@driver@setup=1\relax}
84 \DeclareOption{dvitops}{\global\chardef\cb@driver@setup=1\relax}
85 \DeclareOption{DVIps}{\global\chardef\cb@driver@setup=2\relax}
86 \DeclareOption{dvips}{\global\chardef\cb@driver@setup=2\relax}
87 \DeclareOption{emTeX}{\global\chardef\cb@driver@setup=3\relax}
88 \DeclareOption{emtex}{\global\chardef\cb@driver@setup=3\relax}

The new features of L^{A}TEX 2ε make it possible to implement the outerbars option.

89 \DeclareOption{outerbars}{\outerbarstrue}
90 \DeclareOption{innerbars}{\outerbarsfalse}

It is also possible to specify that the change bars should always be printed on either the left or the right side of the text. For this we have the options leftbars and rightbars. Specifying either of these options will overrule a possible twoside option at the document level.

91 \DeclareOption{leftbars}{%
92 \def\cb@positions{%
93  \global\cb@odd\hoffset
94  \global\advance\cb@odd by \oddsidemargin
95  \global\advance\cb@odd by -\changebarsep

 96  \global\advance\cb@odd by -0.5\changebarwidth
 97  \global\cb@even\hoffset
 98  \global\advance\cb@even by \evensidemargin
 99  \global\advance\cb@even by -\changebarsep
100  \global\advance\cb@even by -0.5\changebarwidth

101 }}

102 \DeclareOption{rightbars}{%
103 \def\cb@positions{%
104  \global\cb@odd =\hoffset
105  \global\advance\cb@odd by \oddsidemargin
106  \global\advance\cb@odd by \textwidth
107  \global\advance\cb@odd by \changebarsep
108  \global\advance\cb@odd by 0.5\changebarwidth
109  \global\cb@even\hoffset
110  \global\advance\cb@even by \evensidemargin
111  \global\advance\cb@even by \textwidth
112  \global\advance\cb@even by \changebarsep
113  \global\advance\cb@even by 0.5\changebarwidth

114 }}

115 \DeclareOption{traceon}{\@cb@tracetrue}
116 \DeclareOption{traceoff}{\@cb@tracefalse}

Signal an error if an unknown option was specified.

117 \DeclareOption*{\OptionNotUsed\PackageError
118  {Unrecognised option `\CurrentOption'}%
119  {known options are dvitoln03, dvitops, dvips
120  and emtex,\MessageBreak
121  outerbars, innerbars, leftbars and rightbars.}}

The default is to have the change bars on the left side of the text on odd pages.

122 \ExecuteOptions{innerbars,traceoff,dvips}
123 \ProcessOptions\relax

6.3 User Level Commands And Parameters

\driver The user can select the specials that should be used by calling the command \driver{⟨drivername⟩}. Possible choices are:

• DVItoLN03

• DVItoPS

• DVIps

• emTEX

This command can only be used in the preamble of the document.

The argument should be case-insensitive, so it is turned into a string containing all uppercase characters. To keep some definitions local, everything is done within a group.

124 \if@compatibility
125 \def\driver#1{%
126  \bgroup\edef\next{\def\noexpand\tempa{#1}}%
127  \uppercase\expandafter{\next}%

128  \def\LN{DVITOLN03}%
129  \def\DVItoPS{DVITOPS}%
130  \def\DVIPS{DVIPS}%
131  \def\emTeX{EMTEX}%

The choice has to be communicated to the macro \cb@setup@specials that will be called from within \document. For this puprose the control sequence \cb@driver@setup is used. It receives a numeric value using \chardef.

132  \global\chardef\cb@driver@setup=0\relax
133  \ifx\tempa\LN      \global\chardef\cb@driver@setup=0\fi
134  \ifx\tempa\DVItoPS \global\chardef\cb@driver@setup=1\fi
135  \ifx\tempa\DVIPS   \global\chardef\cb@driver@setup=2\fi
136  \ifx\tempa\emTeX   \global\chardef\cb@driver@setup=3\fi
137  \egroup}

We add \driver to \@preamblecmds, which is a list of commands to be used only in the preamble of a document.

138 {\def\do{\noexpand\do\noexpand}
139  \xdef\@preamblecmds{\@preamblecmds \do\driver}

140 }

141 \fi

\cb@setup@specials The macro \cb@setup@specials defines macros containing the driver specific \special macros. It will be called from within the \begin{document} command.

\cb@trace@defpoint When tracing is on write information about the point being defined to the log file.

142 \def\cb@trace@defpoint#1#2{%
143 \wlog{Changebar trace: defining point \the#1 at position \the#2}
144 \wlog{Changebar trace: cb@pagecount: \the\cb@pagecount;
145  page \thepage}}

\cb@trace@connect When tracing is on write information about the points being connected to the log file.

146 \def\cb@trace@connect#1#2#3{%
147 \wlog{Changebar trace: connecting points \the#1 and \the#2;
148  barwidth: \the#3}
149 \wlog{Changebar trace: cb@pagecount: \the\cb@pagecount;
150  page \thepage}}

\cb@defpoint The macro \cb@defpoint is used to define one of the two points of a bar. It has two arguments, the number of the point and the distance from the left side of the paper; so its syntax is: \cb@defpoint{⟨number⟩}{⟨length⟩}.

\cb@resetpoints The macro \cb@resetpoints can be used to instruct the printer driver that it should send a corresponding instruction to the printer. This is really only used for the LN03 printer.

\cb@connect The macro \cb@connect is used to instruct the printer driver to connect two points with a bar. The syntax is \cb@connect{⟨number⟩}{⟨number⟩}{⟨length⟩} The two ⟨number⟩s indicate the two points to be connected; the ⟨length⟩ is the width of the bar.

151 \def\cb@setup@specials{%

The control sequence \cb@driver@setup expands to a number which indicates the driver that will be used. The original changebar.sty was written with only the the \special syntax of the program DVItoLN03 (actually one of its predecessors, ln03dvi). Therefore this syntax is defined first.

152 \ifcase\cb@driver@setup
153 \def\cb@defpoint##1##2{%
154  \special{ln03:defpoint \the##1(\the##2,)}%
155  \if@cb@trace\cb@trace@defpoint##1##2\fi}
156 \def\cb@connect##1##2##3{%
157  \special{ln03:connect \the##1\space\space \the##2\space \the##3}%
158  \if@cb@trace\cb@trace@connect##1##2##3\fi}
159 \def\cb@resetpoints{%
160  \special{ln03:resetpoints \cb@minpoint \space\cb@maxpoint}}

The first extension to the changebar option was for the \special syntax of the program DVItoPS by James Clark.

161 \or
162 \def\cb@defpoint##1##2{%
163  \special{dvitops: inline
164  \expandafter\cb@removedim\the##2\space 6.5536 mul\space
165  /CBarX\the##1\space exch def currentpoint exch pop
166  /CBarY\the##1\space exch def}%
167  \if@cb@trace\cb@trace@defpoint##1##2\fi}
168 \def\cb@connect##1##2##3{%
169  \special{dvitops: inline
170  gsave \thechangebargrey\space 100 div setgray
171  \expandafter\cb@removedim\the##3\space 6.5536 mul\space
172  CBarX\the##1\space\space CBarY\the##1\space\space moveto
173  CBarX\the##2\space\space CBarY\the##2\space\space lineto
174  stroke grestore}%
175  \if@cb@trace\cb@trace@connect##1##2##3\fi}
176 \let\cb@resetpoints\relax

Also the program DVIps by Thomas Rockicki is supported. The PostScript code is nearly the same as for DVItoPS, but the coordinate space has a different dimension. Also this code has been made resolution independent, whereas the code for DVItoPS might still be resolution dependent.

So far all the positions have been calculated in pt units. DVIps uses pixels internally, so we have to convert pts into pixels which of course is done by dividing by 72.27 (pts per inch) and multiplying by Resolution giving the resolution of the PostScript device in use as a PostScript variable.

177 \or
178 \def\cb@defpoint##1##2{%
179  \special{ps:
180  \expandafter\cb@removedim\the##2\space
181  Resolution\space mul\space 72.27\space div\space
182  /CBarX\the##1\space exch def currentpoint exch pop
183  /CBarY\the##1\space exch def}%
184  \if@cb@trace\cb@trace@defpoint##1##2\fi}
185  \def\cb@connect##1##2##3{%
186  \special{ps:
187  gsave \thechangebargrey\space 100 div setgray
188  \expandafter\cb@removedim\the##3\space
189  Resolution\space mul\space 72.27\space div\space

190  setlinewidth
191  CBarX\the##1\space\space CBarY\the##1\space\space moveto
192  CBarX\the##2\space\space CBarY\the##2\space\space lineto
193  stroke grestore}%
194  \if@cb@trace\cb@trace@connect##1##2##3\fi}
195  \let\cb@resetpoints\relax

The latest addition is for the drivers written by Eberhard Mattes. The \special syntax used here will be supported with version 1.5 of his driver programs. This version will probably be released late in 1991, therefore we add a warning for now.

196 \or
197 \PackageWarning{Changebar}%
198  {changebars only supported for v1.5+ of dvidrv}%
199 \def\cb@defpoint##1##2{%
200  \special{em:point \the##1,\the##2}%
201  \if@cb@trace\cb@trace@defpoint##1##2\fi}
202 \def\cb@connect##1##2##3{%
203  \special{em:line \the##1,\the##2,\the##3}%
204  \if@cb@trace\cb@trace@connect##1##2##3\fi}
205 \let\cb@resetpoints\relax

When code for other drivers should be added it can be inserted here. When someone makes a mistake and somehow selects an unknown driver a warning is issued and the macros are defined to be noops.

206 \else
207 \PackageWarning{Changebar}{changebars not supported in unknown setup}
208 \def\cb@defpoint##1##2{%
209  \if@cb@trace\cb@trace@defpoint##1##2\fi

210 }

211 \def\cb@connect##1##2##3{%
212  \if@cb@trace\cb@trace@connect##1##2##3\fi

213 }

214 \let\cb@resetpoints\relax
215 \fi

The last thing to do is to forget about \cb@setup@specials.

216 \global\let\cb@setup@specials\relax}

\cbstart The macro \cbstart starts a new changebar. It has an (optional) argument that will be used to determine the width of the bar. The default width is

 \changebarwidth.
217 \newcommand\cbstart{\@ifnextchar [{\cb@start}%
218  {\cb@start[\changebarwidth]}}

\cbend The macro \cbend (surprisingly) ends a changebar. The macros \cbstart and \cbend can be used when the use of a proper L^{A}TEX environment is not possible.

219 \newcommand\cbend{\cb@end}

\cbdelete The macro \cbdelete inserts a ‘deletebar’ in the margin. It too has an optional argument to determine the width of the bar. The default width (and length) of it

 are stored in \deletebarwidth.
220 \newcommand\cbdelete{\@ifnextchar [{\cb@delete}
221  {\cb@delete[\deletebarwidth]}}

\cb@delete Deletebars are implemented as a special ‘change bar’. The bar is started and immediately ended. It is as long as it is wide.

222 \def\cb@delete[#1]{\vbox to \z@{\vss\cb@start[#1]\vskip #1\cb@end}}
\changebar \endchangebar The macros \changebar and \endchangebar have the same function as \cbstart

and \cbend but they can be used as a L^{A}TEX environment to enforce correct nesting. They can not be used in the tabular and tabbing environments.

223 \newenvironment{changebar}%
224  {\@ifnextchar [{\cb@start}%
225  {\cb@start[\changebarwidth]}}%
226  {\cb@end}

\nochangebars To disable changebars altogether without having to remove them from the document the macro \nochangebars is provided. It makes noops from a couple of internal macros.

227 \newcommand\nochangebars{%
228 \def\cb@start[##1]{}%
229 \def\cb@delete[##1]{}%
230 \let\cb@end\relax}

\changebarwidth The default width of the changebars is stored in the dimen register \changebarwidth.

231 \newlength{\changebarwidth}
232 \setlength{\changebarwidth}{2pt}

\deletebarwidth The default width of the deletebars is stored in the dimen register \deletebarwidth.

233 \newlength{\deletebarwidth}
234 \setlength{\deletebarwidth}{4pt}

\changebarsep The default separation between all bars and the text is stored in the dimen register

\changebarsep.
235 \newlength{\changebarsep}
236 \setlength{\changebarsep}{30pt}

changebargrey When the document is printed using one of the PostScript drivers the bars do not need to be black; with PostScript is possible to have grey bars. The pecentage of greyness of the bar is stored in the count register \changebargrey. It can have values between 0 (meaning white) and 100 (meaning black).

237 \newcounter{changebargrey}
238 \setcounter{changebargrey}{65}

6.4 Macros for beginning and ending bars

\cb@start This macro starts a change bar. It assigns a new value to the current point and advances the counter for the next point to be assigned. It pushes this info onto \cb@currentlist and then sets the point by calling \cb@setBeginPoint with the point number. Finally, it writes the aux file.

239 \def\cb@start[#1]{%
240 \cb@currentpoint=\cb@nextpoint

\cb@push expects the width of the bar to be stored in \@tempdima.

241 \@tempdima#1\relax
242 \cb@push\cb@currentlist
243 \ifvmode
244  \cb@setBeginPoint\cb@currentpoint
245 \else
246 \vbox to \z@{%

When we are in horizontal mode we jump up a line to set the starting point of the changebar.

247  \vskip -\ht\strutbox
248  \cb@setBeginPoint\cb@currentpoint
249  \vskip \ht\strutbox}\fi
250 \cb@writeAux\cb@advancePoint}
\cb@advancePoint The macro \cb@advancePoint advances the count register \cb@nextpoint. When

the maximum number is reached, the numbering is reset.

251 \def\cb@advancePoint{%
252 \global\advance\cb@nextpoint by 2\relax
253 \ifnum\cb@nextpoint>\cb@maxpoint
254  \global\cb@nextpoint=\cb@minpoint\relax
255 \fi}

\cb@end This macro ends a changebar. It pops the current point and nesting level off \cb@currentlist and sets the end point by calling \cb@setEndPoint with the parameter corresponding to the beginning point number. It writes the .aux file and joins the points.

256 \def\cb@end{%
257 \cb@pop\cb@currentlist
258 \ifnum\cb@currentpoint=\cb@nil
259  \PackageWarning{Changebar}%
260  {Badly nested changebars; Expect erroneous results}%
261 \else
262  \cb@setEndPoint\cb@currentpoint
263  \global\advance\cb@currentpoint by1\cb@writeAux
264 \fi}

\cb@setBeginPoint The macro \cb@setBeginPoint assigns a position to point number #1. It determines wether the point is on an even or an odd page and uses the right dimension to position the point. Keep in mind that the value of \cb@pagecount is one less than the value of \c@page unless the latter has been reset by the user.

265 \def\cb@setBeginPoint#1{%
266 \ifodd\cb@pagecount
267  \cb@defpoint{#1}{\cb@even}%
268 \else
269  \cb@defpoint{#1}{\cb@odd}%
270 \fi}

\cb@setEndPoint The macro \cb@setEndPoint assigns a position to point #1 + 1. It then instructs the driver to connect points #1 and #1 + 1 with a bar. The macro assumes that the width of bar is stored in \@tempdima.

271 \def\cb@setEndPoint#1{%

272 \@tempcnta=#1\advance\@tempcnta by1\relax
273 \ifodd\cb@pagecount
274  \cb@defpoint{\@tempcnta}{\cb@even}%
275 \else
276  \cb@defpoint{\@tempcnta}{\cb@odd}%
277 \fi
278 \cb@connect{#1}{\@tempcnta}{\@tempdima}}%

\cb@writeAux The macro \cb@writeAux writes information about a changebar point to the auxiliary file. The number of the point, the pagenumber and the width of the bar are written out as arguments to \cb@barpoint. This latter macro will be expanded when the auxiliary file is read in. The macro assumes that the width of bar is

stored in \@tempdima.

The code is only executed when auxiliary files are enabled, as there’s no sense in trying to write to an unopened file.

279 \def\cb@writeAux{%
280 \if@filesw
281  \begingroup
282  \edef\point{\the\cb@currentpoint}%
283  \edef\level{\the\@tempdima}%
284  \let\the=0%
285  \edef\cb@temp{\write\@auxout
286  {\string\cb@barpoint{\point}{\the\cb@pagecount}{\level}}}%
287  \cb@temp
288  \endgroup
289 \fi}

6.5 Macros for Making It Work Across Page Breaks

\@makecol \@vtryfc Modifies the L^{A}TEX macros to end the changebars spanning the current page (if any) and restart them on the next page. Does the following: It resets special points for this page. Adds begin bars to top of box255. The bars carried over from the previous page, and hence to be restarted on this page, have been saved in \cb@beginSaves, and are then executed. Then it builds the list \cb@spanlist, then calls \cb@processActive to process the elements on the list, then it executes the original \@makecol (saved as \cb@makecol).

290 \let\cb@makecol\@makecol
291 \def\@makecol{%
292 \setbox\@cclv \vbox{%
293  \cb@resetpoints
294  \cb@beginSaves
295  \unvbox\@cclv
296  \boxmaxdepth\maxdepth}%
297 \gdef\cb@beginSaves{}
298 \global\advance\cb@pagecount by 1\relax
299 \cb@buildActive\cb@processActive
300 \cb@makecol}

When L^{A}TEXmakes a page with only floats it doesn’t use \@makecol; instead it calls \@vtryfc, so we have to modify this macro as well.

301 \let\cb@vtryfc\@vtryfc
302 \def\@vtryfc{%

303 \setbox\@outputbox \vbox{%
304  \cb@resetpoints
305  \cb@beginSaves
306  \unvbox\@cclv
307  \boxmaxdepth\maxdepth}%
308 \gdef\cb@beginSaves{}
309 \global\advance\cb@pagecount by 1\relax
310 \cb@buildActive\cb@processActive
311 \cb@vtryfc}

\cb@processActive Processes each element on span list. Each element represents a bar that crosses the page break. There could be more than one if bars are nested. Works as folows:

        pop top element of span list
        if point null (i.e., list empty) then done
        else
            do an end bar on box255
            save start for new bar at top of next page in \cb@startSaves
            push active point back onto history list (need to reprocess
                on next page).

312 \def\cb@processActive{%
313 \cb@pop\cb@spanlist
314 \ifnum\cb@currentpoint=\cb@nil
315 \else
316  \setbox\@cclv\vbox{%
317  \unvbox\@cclv
318  \boxmaxdepth\maxdepth
319  \advance\cb@pagecount by -1\relax
320  \cb@setEndPoint\cb@currentpoint}%
321  \cb@saveBeginPoint\cb@currentpoint
322  \cb@push\cb@history
323  \cb@processActive
324 \fi}

\cb@saveBeginPoint Saves a \special to begin a point in expanded macro \cb@beginSaves. This is then used to start all spanning bars at the top of the next page. It is almost the

 same as \cb@setBeginPoint.
325 \def\cb@saveBeginPoint#1{%
326 \ifodd\cb@pagecount
327  \xdef\cb@beginSaves{\cb@defpoint{#1}{\cb@even}\cb@beginSaves}%
328 \else
329  \xdef\cb@beginSaves{\cb@defpoint{#1}{\cb@odd}\cb@beginSaves}%
330 \fi}
331 \def\cb@beginSaves{}                % initially empty

\cb@buildActive Initializes the spanlist to null.

332 \def\cb@buildActive{\cb@initlist\cb@spanlist\cb@pushNextActive}

\cb@pushNextActive Pops top of history list. If point is on future page, push back onto history list. If point on current or previous page and odd, add point to span list; if even, pop span list since this bar has terminated on current page.

333 \def\cb@pushNextActive{%
334 \cb@pop\cb@history
335 \ifnum\cb@currentpoint=\cb@nil
336 \else
337  \ifnum\cb@page>\cb@pagecount
338  \cb@push\cb@history
339  \else
340  \ifodd\cb@currentpoint
341  \cb@push\cb@spanlist
342  \else
343  \cb@pop\cb@spanlist
344  \fi
345  \cb@pushNextActive
346  \fi
347 \fi}

6.6 Macros For Managing The Lists of Bar points

The macros make use of three lists corresponding to \special defpoints. Each

list takes the form <element> ...  <element>

Each element is of the form xxxnyyypzzzl where xxx is the number of the special point, yyy is the page on which this point is set, and zzz is the dimension used when connecting this point.

The list \cb@history is built from the log information and initially lists all the points. As pages are processed, points are popped off the list and discarded.

The list \cb@spanlist is a temporary list used by the output routine and contains the list of all bars crossing the current page (there may be more than one with nested bars). It is built by popping elements off the history list.

The list \cb@currentlist contains all the current bars. A \cb@start pushes an element onto this list. A \cb@end pops the top element off the list and uses the info to terminate the bar.

For performance and memory reasons, the history list, which can be very long, is special cased and a file is used to store this list rather than an internal macro. The “external” interface to this list is identical to what is described above. However, when the history list is popped, a line from the file is first read and appended to the macro \cb@history.

\cb@initlist A macro to (globally) initialize a list.

348 \def\cb@initlist#1{\xdef#1{}}

\cb@history \cb@write \cb@read We need to initialise a list to store the entries read from the external history file.

349 \cb@initlist\cb@history

We also need to allocate a read and a write stream for the history file.

350 \newwrite\cb@write
351 \newread\cb@read

And we open the histroy file for writing.

352 \immediate\openout\cb@write=\jobname.cb\relax

\cb@spanlist Allocate a list for the bars that span the current page.

353 \cb@initlist\cb@spanlist

\cb@currentlist And we allocate an extra list that is needed to implement nesting without having to rely on TEX’s grouping mechanism.

354 \cb@initlist\cb@currentlist

\cb@pop This pops the top element off the named list and puts the point value into \cb@currentpoint, the page value into \cb@page and the bar width into \@tempdima. If the list is empty, returns a void value (\cb@nil) in \cb@currentpoint

and sets \cb@page=0.
355 \def\cb@pop#1{%
356 \ifx #1\cb@history
357  \ifeof\cb@read
358  \else
359  {\endlinechar=-1\read\cb@read to\@temp
360  \xdef\cb@history{\cb@history\@temp}%

361 }%

362  \fi
363 \fi
364 \ifx#1\@empty
365  \cb@currentpoint=\cb@nil\cb@page=0\relax
366 \else
367  \expandafter\cb@carcdr#1e#1%
368 \fi}

\cb@carcdr Used to ‘decode’ a list entry.

369 \def\cb@carcdr#1n#2p#3l#4e#5{%
370 \cb@currentpoint=#1\cb@page=#2\relax\@tempdima=#3\xdef#5{#4}}
\cb@push Pushes \cb@currentpoint, \cb@page and \@tempdima onto the top of the named

list.

371 \def\cb@push#1{%
372 \xdef#1{\the\cb@currentpoint n\the\cb@page p\the\@tempdima l#1}}

\cb@barpoint For populating the history file. Writes one line to .cb file which is equivalent to one ⟨element⟩ described above.

373 \def\cb@barpoint#1#2#3{\immediate\write\cb@write{#1n#2p#3l}}

6.7 Macros For Checking That The .aux File Is Stable

\AtBeginDocument While reading the .aux-file L^{A}TEX has created the history list in a separate file. We need to close that file and open it for reading. Also the ‘initialistion’ of the \special commands has to take place. While we are modifying the macro we also include the computation of the possible positions of the changebars

For these actions we need to add to the L^{A}TEX begin-document hook.

374 \AtBeginDocument{%
375 \cb@setup@specials
376 \cb@positions
377 \immediate\closeout\cb@write
378 \immediate\openin\cb@read=\jobname.cb}

\AtEndDocument Does a \clearpage to flush rest of document. (Note that I believe there is contention in this area: are there in fact situations in which the end-document hooks need to be called before the final \clearpage? — the documentation of LaTeX itself implies that there are.) Then closes .cb file and reopens it for checking. Inits history list (to be read from file). Lets \cb@barpoint=\cb@checkhistory for checking.

379 \AtEndDocument{%
380 \clearpage
381 \cb@initlist\cb@history
382 \immediate\closein\cb@read
383 \immediate\openin\cb@read=\jobname.cb%
384 \let\cb@barpoint=\cb@checkHistory}

\cb@checkHistory Pops the top of the history list (\jobname.cb) and checks to see if the point and page numbers are the same as the arguments #1 and #2 respectively. Prints a warning message if different.

385 \def\cb@checkHistory#1#2#3{%
386 \cb@pop\cb@history
387 \ifnum #1=\cb@currentpoint\relax
388  \ifnum #2=\cb@page\relax

Both page and point numbers are equal; do nothing,

389  \else

but generate a warning when page numbers don’t mach, or

390  \cb@error
391  \fi
392 \else

when point numbers don’t mach.

393  \cb@error
394 \fi}

\cb@error When a mismatch between the changebar information in the auxiliary file and the history list is detected a warning is issued; further checking is disabled.

395 \def\cb@error{%
396 \PackageWarning{Changebar}%
397  {Changebar info has changed.\MessageBreak
398  Rerun to get the bars right}
399 \gdef\cb@checkHistory##1##2##3{}%
400 \let\cb@barpoint=\cb@checkHistory}

6.8 Macros For Making It Work With Nested Floats/Footnotes

\end@float This is a replacement for the L^{A}TEX-macro of the same name. All it does is check to see if changebars are active and, if so, it puts changebars around the box containing the float. Then it calls the original L^{A}TEX \end@float.

401 \let\cb@endfloat=\end@float
402 \def\end@float{%
403 \cb@pop\cb@currentlist
404 \ifnum\cb@currentpoint=\cb@nil
405 \else
406  \cb@push\cb@currentlist
407  \global\@tempdima=\@tempdima
408  \egroup

409  \global\setbox\@currbox=%
410  \vbox\bgroup\cb@start[\@tempdima]\unvbox\@currbox\cb@end
411 \fi
412 \cb@endfloat}

This only works if this new version of \end@float is really used. With L^{A}TEX2.09 the documentstyles used to contain:

     \let\endfigure\end@float

In that case this binding has to be repeated after the redefinition of \end@float. However, the L^{A}TEX 2ε class files use \newenvironment to define the figure and table environments. In that case there is no need to rebind \endfigure.

\@footnotetext Replacement for the L^{A}TEX macro of the same name. Simply checks to see if changebars are active and if so wraps the macro argument (i.e., the footnote) in changebars.

413 \let\cb@footnote=\@footnotetext
414 \long\def\@footnotetext#1{%
415 \cb@pop\cb@currentlist
416 \ifnum\cb@currentpoint=\cb@nil
417  \cb@footnote{#1}%
418 \else
419  \cb@push\cb@currentlist
420  \edef\cb@temp{\the\@tempdima}%
421  \cb@footnote{\cb@start[\cb@temp]#1\cb@end}%
422 \fi}

\@mpfootnotetext Replacement for the L^{A}TEX macro of the same name. Same thing as \@footnotetext.

423 \let\cb@mpfootnote=\@mpfootnotetext
424 \long\def\@mpfootnotetext#1{%
425 \cb@pop\cb@currentlist
426 \ifnum\cb@currentpoint=\cb@nil
427  \cb@mpfootnote{#1}%
428 \else
429  \cb@push\cb@currentlist
430  \edef\cb@temp{\the\@tempdima}%
431  \cb@mpfootnote{\cb@start[\cb@temp]#1\cb@end}%
432 \fi}

433 ⟨/package⟩

Index

Numbers in italics indicate the page where the macro is described, the underlined numbers indicate the number of the line of code where the macro is defined, all other numbers indicate where a macro is used.

Symbols

 \@SpecialMainIndex .

. . . . . . . . . 21, 23 \@auxout . . . . . . . . . 285 \@bsphack … 12, 15, 18 @cb@trace . . . . . . . . . \underline{7}

                           \@cb@tracefalse . . . 116
                           \@cb@tracetrue . . . . 115

\@cclv . . . . . . . 292,

295, 306, 316, 317 \@currbox …. 409, 410 \@empty . . . . . . . . . . 364 \@esphack … 14, 17, 20

\@footnotetext . . . . \underline{413}
\@ifnextchar . . . . . .

…. 217, 220, 224 \@makecol . . . . . . . . \underline{290}

\@mpfootnotetext . . \underline{423}
\@outputbox . . . . . . . 303
\@preamblecmds . . . . 139

\@temp . . . . . . . 359, 360

\@tempcnta . . . . . . .

. 272, 274, 276, 278

\@tempdima 241, 278,

283, 370, 372, 407, 410, 420, 430

\@vtryfc . . . . . . . . . \underline{290}

A

\actualchar . . . . . 16, 19

\advance … 50, 52– 54, 56, 57, 60, 63, 64, 66–68, 72–74, 76, 77, 94–96, 98–100, 105–108, 110– 113, 252, 263, 272, 298, 309, 319

\AtBeginDocument . . \underline{374}
\AtEndDocument . . . . \underline{379}

B

\begin . . . . . . . . . . . 30

\begingroup . . . . . . . 281

\bgroup . . . . . . 126, 410

\boxmaxdepth . . . . . .

…. 296, 307, 318

C

\catcode . . . . . . . . . 80

\cb@advancePoint . .

. . . . . . . . 250, \underline{251}

\cb@barpoint . . . . . .

. 286, \underline{373}, 384, 400

\cb@beginSaves . . . .

. 294, 297, 305, 308, 327, 329, 331

\cb@buildActive . . .

…. 299, 310, \underline{332}

\cb@carcdr . . . 367, \underline{369}
\cb@checkHistory . .

. 384, \underline{385}, 399, 400

\cb@connect . . . \underline{151}, 278
\cb@currentlist . . .

…. 242, 257, \underline{354}, 403, 406, 415, 419, 425, 429

                          \cb@currentpoint  \underline{38},

240, 244, 248, 258, 262, 263, 282, 314, 320, 321, 335, 340, 365, 370, 372, 387, 404, 416, 426

                          \cb@defpoint . . . . . .

. \underline{151}, 267, 269, 274, 276, 327, 329

                          \cb@delete . . . . . . .

. 220, 221, \underline{222}, 229

                          \cb@driver@setup . .

81–88, 132–136, 152 \cb@end . . . . . . 219,

222, 226, 230, \underline{256}, 410, 421, 431

                          \cb@endfloat . . 401, 412

\cb@error . 390, 393, \underline{395} \cb@even …. 47, 59,

60, 63, 64, 66– 68, 72–74, 76, 77, 97–100, 109– 113, 267, 274, 327

                          \cb@footnote . . . . . .

…. 413, 417, 421

                          \cb@history . . . 322,

334, 338, \underline{349}, 356, 360, 381, 386

                          \cb@initlist 332, \underline{348},

349, 353, 354, 381

                          \cb@makecol . . . 290, 300
                          \cb@maxpoint \underline{34}, 160, 253
                          \cb@minpoint . . . . . .

. . \underline{36}, 39, 160, 254

                          \cb@mpfootnote . . . .

…. 423, 427, 431

                          \cb@nextpoint . . . . .

. . \underline{38}, 240, 252–254 \cb@nil . . . . . . . \underline{37},

258, 314, 335, 365, 404, 416, 426

\cb@odd . . . . . 46, 49, 50, 52–54, 56, 57, 93–96, 104– 108, 269, 276, 329

\cb@page … \underline{41}, 337,

365, 370, 372, 388

                          \cb@pagecount . . \underline{41},

144, 149, 266, 273, 286, 298, 309, 319, 326, 337

\cb@pop … 257, 313, 334, 343, \underline{355},

386, 403, 415, 425

                                                   \cb@positions . . . . .

. . \underline{46}, 92, 103, 376

                                                   \cb@processActive .

…. 299, 310, \underline{312} \cb@push . . . . . 242,

322, 338, 341, \underline{371}, 406, 419, 429

                                                   \cb@pushNextActive .

. . . . . . . . 332, \underline{333} \cb@read . . \underline{349}, 357,

359, 378, 382, 383

                                                   \cb@removedim . . \underline{80},

164, 171, 180, 188

                                                   \cb@resetpoints . . .

…. \underline{151}, 293, 304

                                                   \cb@saveBeginPoint .

. . . . . . . . 321, \underline{325}

                                                   \cb@setBeginPoint .

…. 244, 248, \underline{265}

                                                   \cb@setEndPoint . . .

…. 262, \underline{271}, 320

                                                   \cb@setup@specials .

. . . . . . . . \underline{142}, 375

                                                   \cb@spanlist . . 313,

332, 341, 343, \underline{353}

                                                   \cb@start . . . . . . . .

. 217, 218, 222, 224, 225, 228, \underline{239}, 410, 421, 431

\cb@temp . . 285, 287,

420, 421, 430, 431

                                                   \cb@trace@connect .

…. \underline{146}, 158, 175, 194, 204, 212

                                                   \cb@trace@defpoint .

…. \underline{142}, 155, 167, 184, 201, 209

                                                   \cb@vtryfc . . . 301, 311

\cb@write . \underline{349}, 373, 377

                                                   \cb@writeAux . . . . . .

…. 250, 263, \underline{279} \cbdelete . . . . . . 4, \underline{220} \cbend . . . . . . . . . 3, \underline{219} \cbstart . . . . . . . 3, \underline{217}

                                                   \changebar . . . . . . . \underline{223}
                                                   changebar (environ-

ment) . . . . . . . . 3

                                                   changebargrey . . . . 4, \underline{13}
                                                   \changebarsep . . . . .

…. 4, 53, 56, 63, 67, 73, 76, 95, 99, 107, 112, \underline{235}

\changebarwidth 4, 54,

57, 64, 68, 74, 77, 96, 100, 108, 113, 218, 225, \underline{231}

\chardef 81–88, 132–136

\clearpage . . . . . . . 380

\closein . . . . . . . . . 382 \closeout . . . . . . . . 377

\CodelineIndex . . . . 10
\CurrentOption . . . . 118

D

\DeclareOption . 81–

91, 102, 115–117 \def . . . . . 12, 15, 18,

22, 23, 35–37, 48, 92, 103, 125, 126, 128–131, 138, 142, 146, 151, 153, 156, 159, 162, 168, 178, 185, 199, 202, 208, 211, 222, 228, 229, 239, 251, 256, 265, 271, 279, 291, 302, 312, 325, 331–333, 348, 355, 369, 371, 373, 385, 395, 402, 414, 424

\deletebarwidth . . .

. . . . . . 4, 221, \underline{233}

\DescribeVar . . . . . . 12

\do . . . . . . . . . 138, 139 \DocInput . . . . . . . . 31

\documentclass . . . . . 8

\driver . . . . . . . . . . \underline{124} \DVIPS . . . . . . . 130, 135 \DVItoPS . . . . . 129, 134

E

\edef . . . . . 126, 282,

283, 285, 420, 430 \egroup . . . . . . 137, 408 \else . . . . . . . . . 55,

65, 70, 75, 206, 245, 261, 268, 275, 315, 328, 336, 339, 342, 358, 366, 389, 392, 405, 418, 428

\emTeX . . . . . . . 131, 136

\EnableCrossrefs . . . 9

\encapchar . . . . . 16, 19

\end . . . . . . . . . . . . . 32

\end@float . . . . . . . \underline{401}
\endchangebar . . . . . \underline{223}

\endgroup . . . . . . . . 288

\endlinechar . . . . . . 359

\endmacro . . . . . . . . 23 \endVar . . . . . . . . . . 23 environments:

changebar . . . . . . . 3
\evensidemargin . . .

. . . . . . 60, 98, 110

\ExecuteOptions . . . 122
\expandafter 127, 164,

171, 180, 188, 367

F

\fi . . . . . . . . 58, 69, 78, 79, 133–136, 141, 155, 158, 167, 175, 184, 194, 201, 204, 209, 212, 215, 249, 255, 264, 270, 277, 289, 324, 330, 344, 346, 347, 362, 363, 368, 391, 394, 411, 422, 432

\file . . . . . . . . . . . . 27

G

\gdef . . 80, 297, 308, 399 \global . 49, 50, 52–

54, 56, 57, 59, 60, 63, 64, 66– 68, 72–74, 76, 77, 81–88, 93– 100, 104–113, 132–136, 216, 252, 254, 263, 298, 309, 407, 409

H

\hoffset . . . . . . 49,

59, 93, 97, 104, 109 \ht . . . . . . . . . 247, 249

I

\if@cb@trace . . . 45,

155, 158, 167, 175, 184, 194, 201, 204, 209, 212

\if@compatibility . 124
\if@filesw . . . . . . . 280

\if@twoside . . . . . . . 61

\ifcase . . . . . . . . . . 152 \ifeof . . . . . . . . . . . 357 \ifnum 253, 258, 314,

335, 337, 387, 388, 404, 416, 426

\ifodd 266, 273, 326, 340

\ifouterbars . . . . . .

…. 44, 51, 62, 71 \ifvmode . . . . . . . . . 243 \ifx . . 133–136, 356, 364

\ignorespaces . . . . . 14
\immediate 352, 373,

377, 378, 382, 383 \index . . . . . . . . . 16, 19

J

\jobname . . 352, 378, 383

L

\Lcount . . . . . . . . . . 28

\leavevmode . . . . . . . 12

\Lenv . . . . . . . . . . . . 26 \let …. 21–23, 176,

195, 205, 214, 216, 230, 284, 290, 301, 384, 400, 401, 413, 423

\level . . . . . . . 283, 286 \LN . . . . . . . . . 128, 133 \long . . . . . . . . 414, 424 \Lopt . . . . . . . . . . . . 25

M

\macro . . . . . . . . . . . 22

\makeatletter . . . . . 11
\makeatother . . . . . . 24
\marginpar . . . . . . . 13

\maxdepth . 296, 307, 318

\MessageBreak . 120, 397

N

\NeedsTeXFormat . . . . 1
\newcommand . . 25–29,

217, 219, 220, 227 \newcount … 38, 40–42

\newcounter . . . . . . . 237

\newdimen . . . . . . 46, 47

\newenvironment . . . 223

\newif . . . . . . . . . 44, 45 \newlength 231, 233, 235 \newread . . . . . . . . . 351 \newwrite . . . . . . . . 350 \next . . . . . . . . 126, 127

\nochangebars . . . 4, \underline{227}

\noexpand …. 126, 138

O

\oddsidemargin . . . .

. . . . . . 50, 94, 105 \openin . . . . . . 378, 383 \openout . . . . . . . . . 352

\OptionNotUsed . . . . 117

\or . . . . . . 161, 177, 196 outerbars . . . . . . . 4, \underline{7}

\outerbarsfalse . . . 90
\outerbarstrue . . . . 89

P

\p . . . . . . . . . . . . . . 80

\PackageError . . . . . 117
\PackageWarning . . .

. 197, 207, 259, 396 \point . . . . . . . 282, 286

\PrintDescribeEnv . 13
\ProcessOptions . . . 123
\ProvidesFile . . . . . . 3
\ProvidesPackage . . . 5

\pstyle . . . . . . . . . . 29

R

\raggedleft . . . . . . . 13

\read . . . . . . . . . . . . 359 \relax . . 81–88, 123,

132, 176, 195, 205, 214, 216, 230, 241, 252, 254, 272, 298, 309, 319, 352, 365, 370, 387, 388

S \setbox 292, 303, 316, 409

                          \setcounter . . . . . . . 238

\setlength 232, 234, 236 \small . . . . . . . . . . . 28 \space …. 157, 160,

164–166, 170– 173, 180–183, 187–189, 191, 192

\special . . 154, 157, 160, 163, 169, 179, 186, 200, 203

                          \SpecialMainIndex .

. . . . . . . . . 21–23

                          \SpecialVarMainIndex

. . . . . . . . . 15, 22

                          \SpecialVarUsageIndex

. . . . . . . . . 14, 18 \string . . . . . . . . . . 286 \strutbox …. 247, 249

T \t . . . . . . . . . . . . . . 80 \tempa …. 126, 133–136 \textsf . . . . . . . . 25, 26 \textsl . . . . . . . . 28, 29 \texttt . . . . . 16, 19, 27

                          \textwidth . . . . . . .

52, 66, 72, 106, 111 \the . . . . . . 143, 144,

147–149, 154, 157, 164–166, 171–173, 180, 182, 183, 188, 191, 192, 200, 203, 282–284, 286, 372, 420, 430

                                                   \thechangebargrey .

. . . . . . . . 170, 187 \thepage . . . . . 145, 150

U \unvbox 295, 306, 317, 410

                                                   \uppercase . . . . . . . 127

V \Var . . . . . . . . . . . . . 22 \vbox . . . . . 222, 246,

292, 303, 316, 410 \vskip …. 222, 247, 249 \vss . . . . . . . . . . . . . 222

W \wlog . 143, 144, 147, 149 \write . . . . . . . 285, 373

X \xdef . 139, 327, 329,

348, 360, 370, 372

Z \z@ . . . . . . . . . 222, 246