The abbrevs LaTeX package

abbreviation macros (Frankenstein’s briefs)

          Matt Swift <swift@alum.mit.edu>

Version: 1.4 Date: 2001/09/08

Documentation revision: 2001/09/08

Abstract

“Abbreviation macros” expand to defined text and insert following space intelligently, based on context. They can also expand to one thing the first time they are used and another thing on subsequent invocations. Thus they can be abbreviations in two senses, in the source and in the document. Useful applications include the abstraction of textual elements such as names without fussing over spacing and the automatic expansion of abbreviations and acronyms at their first use. The initial and subsequent expansions of an abbreviation macro are available at any time via explicit commands. Abbreviation macros are grouped into categories; there are hooks applicable to each category. Categories can be reset so that subsequent abbreviation macros in that category behave as if used for the first time again.

A generic facility is also provided for suffixes like 1900 b.c. and 6:00 p.m., which correctly handles following periods.

Contents

I Discussion 2

1 General 2

2 Usage 2

3 Date Marks 3

4 Emulation of acromake 4 4.1 Possible discrepancies . . . . . . . . . . . . . . . . . . . . . . . . . 4

5 Programmers’ interface 4

II Implementation 6

6 Version control 6

7 Requirements 6 8 Basics 7 9 Categories 8 10 Suffixes 8 11 Plain abbreviations 8 12 Control booleans 10 13 Switching abbreviations 10 14 Defining commands 12 15 Basic categories 12 16 Date marks 13 17 Emulation of Acromake 13

III Configuration 20

18 \DateMarkSize  20

19 Backwards compatibility 20 20 Suggestions 20

IV Testing 21

Part I

Discussion

1 General

\nospacelist An abbreviation macro \foo that expands to ⟨text⟩ is robust; \foo can be used in place of ⟨text⟩ almost anywhere. A space is inserted following an abbreviation macro when the first non-white character following it is not in the set

\nospacelist, whose default value is ,.':;?-/~!)]{}\␣\/\@xobeysp.

When an abbreviation macro has different initial and subsequent expansions, either may be explicitly requested by adding a suffix to the abbreviation macro. The commands \⟨command⟩short and \⟨command⟩long are also defined whenever an abbreviation macro \⟨command⟩ is defined. Using the \⟨command⟩long command does not affect what the next abbreviation macros expands to.

All abbreviation macros are assigned categories, identified by a string. Four categories are defined by the package, and it is easy to add more. Categories facilitate handling different groups of abbreviation macros in different ways.

Warning: Regarding CJK macros and probably other 8-bit input. If you use the abbrevs package with the CJK macros for typesetting Chinese, Japanese, and Korean text, you must define your abbreviations within the CJK environment. I believe that the CJK macros work by interpreting 8-bit input in the source file. But this input is only interpreted properly within the CJK environment. If you define the abbrevs outside, such as in the preamble, you will just get a bunch of numbers when your abbreviation expands.

I would use capital letters for the name of this macro, since it doesn’t seem like a user command to me, but I’m modelling after the kernel’s \nocorrlist.

2 Usage

Examples of how to define abbreviation macros:

   \newbook\worst{Worstward Ho}
   \newbook\fall{All That Fall}
   \newbook\nacht{Nacht und Tr\"aume}
   \newbook\csp{Collected Shorter Plays \emph{(}CSP\emph{)}}[CSP]
   \newname\joyce{James Joyce}[Joyce]
   \newname\nixon{Richard Milhous Nixon}[Nixon]
   \newname\ww{Wordsworth}
   \newname\beckett{Samuel Beckett}[Beckett]
   \newwork\godot{Waiting for Godot}[Godot]
   \newbook\prelude{The Prelude}
   \newabbrev\ART{American Repetrory Theater (ART)}[ART]

To do: Give example of using short or long.

Examples of how to use the macros, and how they are typeset:^{1}

   The manuscripts of \ww's \prelude differ. \lips Before he began \prelude,
   \ww wrote \lips

1\lips is defined in the lips package, part of the Frankenstein bundle.

LOOKS LIKE:

The manuscripts of Wordsworth’s The Prelude differ. … Before he began The Prelude, Wordsworth wrote …

  \nixon was the 37st American President. \lips Many Americans like my uncle
  Norm voted for \nixon enthusiastically in both 1968 and 1972.

LOOKS LIKE:

Richard Milhous Nixon was the 37st American President. … Many Americans like my uncle Norm voted for Nixon enthusiastically in both 1968 and 1972.

  \beckett gained international noteriety with the play \godot in the early
  1950s.  \beckett wrote \godot, he said, as a diversion from the novels he
  was then writing.  I have seen this play at the \ART in Cambridge,
  Massachusetts.  The \ART is often disappointing, but I liked their
  production of \godot.

LOOKS LIKE:

Samuel Beckett gained international noteriety with the play Waiting for Godot in the early 1950s. Beckett wrote Godot, he said, as a diversion from the novels he was then writing. I have seen this play at the American Repetrory Theater (ART) in Cambridge, Massachusetts. The ART is often disappointing, but I liked their production of Godot.

\newabbrev \newabbrev {⟨\command⟩}{⟨initial⟩}[⟨subsequent⟩] defines an abbreviation

macro ⟨\command⟩ of category Generic.

\newname \newname {⟨\command⟩}{⟨initial⟩}[⟨subsequent⟩] defines an abbreviation

macro ⟨\command⟩ of category Name.

\newbook \newbook {⟨\command⟩}{⟨initial⟩}[⟨subsequent⟩] defines an abbreviation

macro ⟨\command⟩ of category Book.

\newwork \newwork{⟨\command⟩}{⟨bibliography key⟩}{⟨initial⟩}[⟨subsequent⟩] defines an abbreviation macro ⟨\command⟩ of category Work. Works can be distinguished from books by being listed in a separate bibliography, e.g., of primary works referred to by short titles in the main text. The defining command therefore requires a BibTEX key as an argument. The first use of the work serves as a citation to that bibliography, and all uses of the work generate an index entry.

To do: Works are not yet fully implemented. Presently they are the same as Books.

3 Date Marks

\PM These variants of abbreviation macros correctly handle following periods.

\AM
\BC
\AD

    She left for work before 6\AM, but
    did not arrive until 12\PM.  The
    interval 5\BC--5\AD is one year
    shorter than the interval
    95\AD--105\AD.

LOOKS LIKE:

She left for work before 6 a.m., but did not arrive until 12 p.m. The interval 5 b.c.–5 a.d. is one year shorter than the interval 95 a.d.–105 a.d.

4 Emulation of acromake

We emulate the acromake package by Paul A. Thompson (version of 1995/7/16 at

CTAN:/macros/latex/contrib/other/misc/acromake.sty). Abbrevs will issue

an informative warning when it guesses it is about to fail because acromake is already loaded (we cannot know for certain if it is). I will add an option so that abbrevs and acromake can both be loaded if anyone persuades me it will be useful.

One reason to emulate acromake with abbrevs is that it can be done easily and by doing so we can avoid keeping two packages around when one will do. Another is that abbrevs is a more general and powerful package which adds value to acromake functionality. Abbrevs should be a drop-in replacement for acromake, but you can also take advantage of features of abbrevs: acromake-style abbreviations obey \TMInhibitSwitching, and they are defined as their own category of abbreviations, Acromake, so that acromake-style abbreviations can be manipulated with the general mechanisms available to any category.

The following three acromake user commands are implemented in abbrevs.

\acromake \acromake {⟨csname⟩}{⟨initial text⟩}{⟨final text⟩} FIX dox \ACRcnta The macro \ACRcnta contains the number of times (default 1) the initial text

(full text) is given. Use \renewcommand to redefine it.

\ACRcntb The macro \ACRcntb contains the number of iterations (default 2) before the final text is given. The intermediate text (final text plus page reference) is therefore

given ACRcntb − ACRcnta times.

\AcromakePageref Define the macro \AcromakePageref to contain the text that expresses the page reference. Abbrevs will replace the string ##1 in the definition of this macro with the page number where the abbreviation was first used (more precisely, with \pageref{⟨label⟩}). The default value is (see Page ##1) for compatibility with acromake. The styles I am familiar with would call for a lowercase “page.”

Warning: \AcromakePageref not implemented yet

4.1 Possible discrepancies

The counter util and the macros \pv and \addtomacro are used internally by acromake and are not defined in abbrevs. (If you managed to find some use for \addtomacro, you will probably see easily how to redefine it in this context—and if not, write me.)

The emulation may behave slightly differently due to the difference beteween the way the xspace package handles following punctuation and space and the way abbrevs does. I think abbrevs is very likely to be as good or better than xspace at making these decisions. Let me know if you think otherwise.

5 Programmers’ interface

\ResetAbbrevs When abbreviation macros are reset, their next invocation will expand to the initial text. Subsequent occurrences will expand to the subsequent text again. For exmaple, using \ResetAbbrevs{Name} at the beginning of chapters will cause the full name to be used only for the first occurrence in each chapter. \ResetAbbrevs {⟨category list⟩} resets all abbreviation macros of the listed categories. The list is comma-separated, and the category All is a shorthand for all defined categories. Example:

     \SaveCS\chapter
     \renewcommand\chapter {%
       \ResetAbbrevs{All}%
       \MDSavedchapter
     }

\NewAbbrevCategory To create new categories of abbreviation, use \NewAbbrevCategory{⟨category name⟩}.

\TMFontAll
\TMHookAll
\TMResetAll
\TMFont<category>
\TMHook<category>
\TMReset<category>

Macros \TMFont ⟨category⟩, \TMHook ⟨category⟩, and \TMReset⟨category⟩ are all reserved. The hook and font slots start empty. The virtual category All is predefined and refers to all defined categories. \TMHookAll and \TMFontAll are called before the respective category-specific commands.

\NewUserAbbrevDefiner{⟨defining command⟩}{⟨category⟩}[⟨definer⟩] defines

\NewUserAbbrevDefiner

a user command ⟨defining command⟩. With the default ⟨definer⟩, \TMDefineAbbrevStandard, the ⟨defining command⟩ will take the arguments {⟨abbrev command⟩}{⟨initial text⟩} [⟨subsequent text⟩] and defines ⟨abbrev command⟩ to be a plain or switching abbreviation macro as appropriate. If given, the optional argument ⟨definer⟩ should be a macro name, which will be first be passed a {⟨category⟩}, then will read user arguments (e.g., in the case of \TMDefineAbbrevStandard, {⟨cs⟩}{⟨initial⟩}[⟨subsequent⟩]). The ⟨definer⟩ is expected of course to do something like define {⟨cs⟩}.

\TMInitialSuffix The factory default suffixes “short” and “long” may be changed by changing

\TMSubsequentSuffix the definitions of \TMSubsequentSuffix and \TMInitialSuffix. The change

should be made after the package is loaded but before any abbreviation macros have been defined.

\DateMark Abbreviation macros like \PM are defined as \DateMarks, like this, without the final period:

     \newcommand\PM {%
       \DateMark{p.m}%
     }
\ifTMInhibitSwitching  When \ifTMInhibitSwitching is true, first occurrences of an abbreviation
\TMInhibitSwitchingfalse
\TMInhibitSwitchingtrue
\ifTMAlwaysLong
\TMAlwaysLongtrue
\TMAlwaysLongfalse

macro will expand to the initial expansion as usual, but they will not trigger the change to subsequent expansions. Example: inhibit switching inside footnotes, and abbreviations will not be spelled out for the first and only time in a footnote. That is, if their first appearance is in a footnote, their first appearance in the main text will also expand to the long version. See the configuration file for how to do this.

When \TMAlwaysLong is true, every abbreviation macro expands to its initial expansion.

Part II

Implementation

6 Version control

\fileinfo \DoXUsepackagE \HaveECitationS \fileversion \filedate \docdate \PPOptArg These definitions must be the first ones in the file.
 1 \def\fileinfo{abbreviation macros (Frankenstein's briefs)}
 2 \def\DoXPackageS {abbrevs}
 3 \def\fileversion{v1.4}
 4 \def\filedate{2001/09/08}
 5 \def\docdate{2001/09/08}
 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{abbrevs}[\PPOptArg]

7 Requirements

23 \NeedsTeXFormat{LaTeX2e}[1995/12/01]
24 \RequirePackage{moredefs,slemph}

Warning: These docs could be much improved. There are far too many things called “definers.” Cleaning up the basic code concepts wouldn’t hurt either.

8 Basics

Let’s begin with the tricky part of inserting space based on context. The strategy is: first, if the following character is not in \nocorr and the current font is not slanted, insert an italic correction with \sw@slant; second, if the following character is not in \nospacelist, insert a space.

Again, in pseudocode:

 LET T = the next token
 IF (slanted font is current AND T NOT IN \nocorrlist)
   \sw@slant
 FI
 IF T NOT IN \nospacelist
   \space
 FI

\nospacelist Put these in the order of their frequency. Anything in \nocorrlist should also be in here, most likely. I’m putting in \@xobeysp because it’s in the xspace package, but I can’t tell you when it would come up.

25 \requirecommand\nospacelist {%
26 ,.':;?-/\slash~!)]\bgroup\egroup\@sptoken\ \space\/\@xobeysp

27 }

\maybe@ic@space \maybe@ic@space@ \maybe@ic@space checks the next character and inserts an italic correction and space as appropriate.

28 \newcommand\maybe@ic@space {%
29 \futurelet\@let@token\maybe@ic@space@

30 }

We first call the kernel’s \maybe@ic@, then our own \maybe@space@.

31 \newcommand\maybe@ic@space@ {%
32 \maybe@ic@
33 \maybe@space@

34 }

\maybe@space \maybe@space@  \maybe@space and \maybe@space@ are very similar to the kernel’s analogs
\maybe@ic and \maybe@ic@, but they check \nospacelist instead of \nocorr.
\t@st@ic sets \@tempswa false if \@let@token is in \nospacelist.
35 \newcommand\maybe@space {%
36 \futurelet\@let@token\maybe@space@

37 }

38 \newcommand\maybe@space@ {%
39 \@tempswatrue
40 %  \DTypeout{In maybe@space@ my lettoken is [\meaning\@let@token]}%
41 \expandafter   \@tfor
42  \expandafter \reserved@a
43  \expandafter :%
44  \expandafter =%
45  \nospacelist
46  \do \t@st@ic
47 \if@tempswa
48  \space
49 \fi

50 }

9 Categories

\ResetAbbrevs \NewAbbrevCategory \TMResetAll \TMHookAll \TMFontAll Each time an abbreviation of category C is defined, some tokens are added to the contents of \TMReset⟨C ⟩.

51 \ReserveCS\TMResetAll
52 \ReserveCS\TMHookAll
53 \ReserveCS\TMFontAll

54

55 \newcommand\NewAbbrevCategory [1] {% args:  category
56 \expandafter\ReserveCS\csname TMReset#1\endcsname
57 \expandafter\ReserveCS\csname TMFont#1\endcsname
58 \expandafter\ReserveCS\csname TMHook#1\endcsname
59 \expandafter\g@addto@macro
60  \expandafter\TMResetAll\csname TMReset#1\endcsname

61 }

62 \newcommand\ResetAbbrevs [1] {% args: category-list
63 \@for\sc@t@a:=#1\do {%
64  \@ifundefined{TMReset\sc@t@a} {%
65  \FrankenWarning{abbrevs}{The abbreviation category \sc@t@a\space
66  is not defined!}%
67  }{% ELSE
68  \@nameuse{TMReset\sc@t@a}%
69  }%
70 }%

71 }

10 Suffixes

\TMInitialSuffix \TMSubsequentSuffix When an abbreviation macro is created, two additional commands with these suffixes are also created. For example, \foo, \foolong, and \fooshort. When abbrevs are used in such a way that “long” and “short” don’t make sense, it would make sense to change these to something more descriptive.

72 \newcommand\TMInitialSuffix {%
73 long%

74 }

75 \newcommand{\TMSubsequentSuffix} {%
76 short%

77 }

11 Plain abbreviations

The checking that \sw@slant does for skips and penalties on the list is going to be superfluous for the applications I imagine. But we trade that for a more flexible macro.

We don’t check for \nocorr or an empty body; maybe we should when it’s first defined; but I ran into really hairy expansion troubles trying to do that and

use \DeclareRobustCommand. FIX.

\TMNewAbbrevPlain Things are easy when the abbreviation doesn’t switch between initial and subsequent expansions.

To do: pass root and suffix instead of \csname so that we don’t have to parse it out again later from tmcurrentmacro

78 \ReserveCS\TMCurrentMacro
79 \newcommand\TMNewAbbrevPlain [3] {% args: \csname category body
80 \NewRobustCommand #1 {%
81 %    \xdef\TMCurrentMacro {\expandafter\Gobble\string#1}%
82  \@bsphack
83  \TMHookAll
84  \@nameuse{TMHook#2}%
85  \@esphack
86  \ifmmode
87  \def\sc@t@a {%
88  \nfss@text{\@nameuse{TMFont#2}#3}%
89  }%
90  \else
91  \def\sc@t@a {%
92  \leavevmode
93  \begingroup

We can skip the check for emptiness and containing just a space, since those won’t occur with abbreviation macros except by accident, I think. We proceed straight to a check for \nocorrs.

94  \tm@check@nocorr #3\nocorr\@nil
95  \TMFontAll
96  \@nameuse{TMFont#2}%
97  \tm@check@left
98  #3%
99  \tm@check@right
100  \endgroup

101 }%

102  \fi
103  \sc@t@a

104 }% 105 }

\tm@check@nocorr This corresponds to the kernel’s \check@nocorr@. We simply substitute \maybe@

ic@space and \maybe@space in where necessary. We also use \tm@check@left
and \tm@check@right instead of \check@icl and \check@icr.
106 \NewName{tm@check@nocorr} {#1#2\nocorr#3\@nil} {%
107 \let\tm@check@left\maybe@ic
108 \def\tm@check@right {\aftergroup\maybe@ic@space}%
109 \def\reserved@a {\nocorr}%
110 \def\reserved@b {#1}%
111 \def\reserved@c {#3}%
112 \ifx\reserved@a\reserved@b
113  \ifx\reserved@c\@empty
114  \let\check@icl\@empty
115  \else
116  \let\check@icl\@empty
117  \def\check@icr {\aftergroup\maybe@space}%
118  \fi
119 \else
120  \ifx\reserved@c\@empty\else

121  \def\tm@check@right {\aftergroup\maybe@space}%
122  \fi
123 \fi

124 }

12 Control booleans

\ifTMInhibitSwitching \TMInhibitSwitchingtrue \TMInhibitSwitchingfalse \ifTMAlwaysLong \TMAlwaysLongtrue \TMAlwaysLongfalse Control booleans.
125 \newboolean{TMInhibitSwitching} % initially false
126 \newboolean{TMAlwaysLong}       % initially false

13 Switching abbreviations

\TMNewAbbrevSwitcher Here is the main abbreviation macro definer. It works by defining two macros, one for the initial text and one for the subsequent text, and setting up a third user command to choose between the two as appropriate. (The first two are made available to the user by explicit call as well.) The function used to define the two macros is passed as the first argument to this function. Supplied definers are

\TMNewAbbrevPlain (I will write \TMNewAbbrevWork and \TMNewAbbrevDotclose

soon FIX). The second argument is the category—each definer takes at least three arguments: a command name, a category, and the content. The third argument is the user macro name to be created, and the fourth and fifth arguments are the initial and subsequent expansion texts.

The first part sets three token variables to the three command sequences that this macro is going to define—the user, initial, and subsequent commands. The user command checks its associated boolean variable to see whether it has been called before. If so, it calls the “subsequent” macro; if not, the “initial” macro.

127 \newcommand\TMNewAbbrevSwitcher [5] {% args: definer category csname
128 %                                    %       initial subseq.
129 \expandafter#1\csname #3\TMInitialSuffix\endcsname{#2}{#4}
130 \expandafter#1\csname #3\TMSubsequentSuffix\endcsname{#2}{#5}
131 \newboolean{@#3@mentioned}
132 \expandafter\g@addto@macro\csname TMReset#2\endcsname {%
133  \global\csname @#3@mentionedfalse\endcsname

134 }

We’ve created the initial and subsequent macros, and the boolean. Now we define the user macro. This definition is tricky. In pseudocode, it looks like this:

 if #3 definable then
   #3 := { if (#3-mentioned AND NOT TMAlwaysLong) then
             #3-short
           else
             if NOT TMInhibitSwitching then #3-mentioned := (global) true
             #3-long
           fi }
 fi

Hmm, I’m not sure this is any more readable than a sea of \expandafter

 \noexpands.

Notice that in a switching abbrev, the -mentioned boolean is set to true before calling the macro itself, so that the hook can check and possibly alter the value. The acromake emulation takes advantage of this.

135 \expandafter\@ifdefinable\csname #3\endcsname {%
136 %                is ##1 below:
137  \EExpand\csname #3\endcsname\In {%
138 %                   ####1:
139  \EExpand\csname if@#3@mentioned\endcsname\In {%
140 %                   ########1:
141  \EExpand\csname #3\TMSubsequentSuffix\endcsname\In {%
142 %                   ################1:
143  \EExpand\csname @#3@mentionedtrue\endcsname\In {%
144 %                   ################################1:
145  \EExpand\csname #3\TMInitialSuffix\endcsname\In {%
146 %     \gdef\<csname>{%
147  \gdef ##1{%  must be NO SPACE before `{' !
148  \@tempswafalse
149 %       \if@<csname>mentioned
150  ####1%
151  \ifTMAlwaysLong\else
152  \@tempswatrue
153  \fi
154  \fi
155  \if@tempswa
156 %         \def\sc@t@a {\<csname>\TMSubsequentSuffix}%
157  \def\sc@t@a {########1}%
158  \else
159  \ifTMInhibitSwitching\else
160 %           \global\@<csname>@mentionedtrue
161  \global ################1%
162  \fi
163 %         \def\sc@t@a {\<csname>\TMInitialSuffix}%
164  \def\sc@t@a {################################1}%
165  \fi
166 %        \expandafter  \gdef
167 %          \expandafter\TMCurrentMacro
168 %          \expandafter{\sc@t@a}%
169  \sc@t@a
170  }%   close \gdef
171  }}}}}% close \EExpand...\In's
172 }%       close \@ifdefinable

173 }

Warning: The \csnames (e.g., either \foolong or \fooshort) must be the very last thing to occur in the definitions, or the \futurelet that checks following spacing in, e.g., \TMNewAbbrevPlain will break. This is why we use the construction with \sc@t@a. No space must sneak into the macros, either!

The hard work is done. Now we define some macros to help create new categories.

14 Defining commands

A ⟨definer⟩ is always called with a category as a first argument. The only definers in this version of this package are this one and the one that emulates the acromake package. More later!

\TMDefineAbbrevStandard \tm@defineabbrevstandard  \TMDefineAbbrevStandard is the standard ⟨definer⟩ that makes the choice be-

tween defining an switching or a plain abbreviation, depending on whether the user supplies a subsequent text.

174 \newcommand\TMDefineAbbrevStandard [3] {% args: category \csname
175  %       initial [subsequent]
176 \@ifnextchar [ {%
177  \tm@defineabbrevstandard{#1}{#2}{#3}%
178  }{% ELSE
179  \TMNewAbbrevPlain{#2}{#1}{#3}%

180 }% 181 }

182 \NewName{tm@defineabbrevstandard} {#1#2#3[#4]} {% args: category \csname
183  %       initial subsequent
184 \eExpand\expandafter\Gobble\string#2\In {%
185  \TMNewAbbrevSwitcher\TMNewAbbrevPlain{#1}{##1}{#3}{#4}%

186 }% 187 }

\NewUserAbbrevDefiner
\tm@newuserabbrevdefiner
188 \newcommand\NewUserAbbrevDefiner [2] {% args: \csname category [definer]
189 \@ifnextchar [ {%
190  \tm@newuserabbrevdefiner{#1}{#2}%
191  }{% ELSE
192  \tm@newuserabbrevdefiner{#1}{#2}[\TMDefineAbbrevStandard]%

193 }% 194 }

195 \NewName{tm@newuserabbrevdefiner}{#1#2[#3]} {% args: \csname category definer
196 \newcommand #1 {%
197  #3{#2}%

198 }% 199 }

15 Basic categories

\TMResetGeneric \TMResetName \TMResetBook \TMResetWork \TMHookGeneric \TMHookName \TMHookBook \TMHookWork \TMFontGeneric \TMFontName \TMFontBook \TMFontWork \newabbrev \newname \newbook \newwork Right now, the Book and Work categories are separate but equal. A future revision

will distinguish them by keeping track of more information about Works, with the idea of using them to generate a separate bibliography and index in a long document that refers to a certain list of books by short titles. E.g., my thesis is on Samuel Beckett, and I want to refer to his works by short titles, and automatically generate a Beckett bibliography of only the ones I use, listed by title.

200 \NewAbbrevCategory{Generic}
201 \NewAbbrevCategory{Name}
202 \NewAbbrevCategory{Book}
203 \NewAbbrevCategory{Work}
204 \NewUserAbbrevDefiner{\newabbrev}{Generic}
205 \NewUserAbbrevDefiner{\newname}{Name}

206 \NewUserAbbrevDefiner{\newbook}{Book}
207 \NewUserAbbrevDefiner{\newwork}{Work}

208

209 \def\TMFontBook {%
210 \itswitch

211 }

212 \def\TMFontWork {%
213 \itswitch

214 }

16 Date marks

\DateMark
\DateMarkSize
215 \newcommand\DateMark [1] {%
216 \hspace{.2em}{\DateMarkSize\scshape #1}%
217 \@ifnextchar. {%
218  \spacefactor\@m
219  }{% ELSE
220  .\maybe@ic@space

221 }% 222 }

223 \newlet\DateMarkSize\small

\PM \AM \BC \AD Some common time abbreviations.

224 \newcommand{\PM} {%
225 \DateMark{p.m}%

226 }

227 \newcommand{\AM} {%
228 \DateMark{a.m}%

229 }

230 \newcommand{\BC} {%
231 \DateMark{b.c}%

232 }

233 \newcommand{\AD} {%
234 \DateMark{a.d}%

235 }

17 Emulation of Acromake

Warning: This code is a mess! Consider all but the user functions “internal.” I will reimplement it all another time. Meanwhile it works, and the user interface is acromake’s anyway, so it won’t change.

\TMResetAcromake \TMFontAcromake \TMHookAcromake \TMHookAcromakeHook \TMAcromakeSecondarySuffix \acromake \tm@acromake@pageref Define the category Acromake and declare its user defining command to be

\acromake. Create a suffix secondaryanalogous to \TMInitialSuffix and

\TMSubsequentSuffix.

Instead of building more generality into abbrevs, I emulate acromake with a few hacks, since I don’t see a general need for more than two expansions. Counting iterations, on the other hand, is something I would like to do for all abbrevs. Doing so is tantamount to replacing the present -mentioned booleans with “counter” macros.

The emulation is done in the following way. Let’s call the three expansions of an acromake macro the ⟨am-initial⟩, ⟨am-secondary⟩, and ⟨am-subsequent⟩ expansions, in order. These must be mapped onto the abbrevs concepts of inital and subsequent expansions. The \acromake command as I define it here defines a switching abbrev whose initial text contains ⟨am-initial⟩ and subsequent text contains ⟨am-subsequent⟩. It also defines a plain abbrev

with a suffix \TMAcroSecondarySuffix (analogous to \TMInitialSuffix and

\TMSubsequentSuffix) that expands to ⟨am-secondary⟩. In a switching abbrev, the associated -mentioned boolean is set to true before calling the macro itself (and therefore its hook). The hook can therefore reset the boolean to false, and I do this in \TMHookAcromake until it is time to go from the ⟨am-initial⟩ to the ⟨am-secondary⟩ expansions. \TMInhibitSwitching affects the Acromake category like all others, and \TMResetAcromake behaves as expected.

236 \@ifpackageloaded{acromake}{%
237  \FrankenWarning{abbrevs}{LaTeX is about to fail because \protect\acromake
238 is already defined.\MessageBreak Probably you have loaded acromake.sty, and if
239 so,\MessageBreak you should simply not load it, since abbrevs.sty
240 emulates\MessageBreak acromake.sty.}
241 }{%ELSE

242 }

243 \NewAbbrevCategory{Acromake}
244 \NewUserAbbrevDefiner{\acromake}{Acromake}[\TMAcromakeDefiner]

245

246 \newcommand\TMAcromakeSecondarySuffix {secondary}

247

248 \ReserveCS\tm@acromake@pageref

We’re going to use the main hook, so provide another free one.

249 \ReserveCS\TMHookAcromakeHook

I’m not sure why acromake does this check for odd values of \ACRcnta. I use logic below that I think does reasonable things with odd values.

I think acromake tried to inhibit using ⟨am-secondary⟩ when it appeared on the same page as the (first!) ⟨am-initial⟩ instance, but I also think there was a spurious 0 in the source that broke this feature. I’ve emulated the working feature.

250 % consider these acromake functions internal for now!
251 % differs from regular version in passing args to definer
252 \newcommand\TMNewAbbrevSwitcherAcromake [5] {% args: definer category csname
253 %                                    %       initial subseq.
254 #1{#3}{\TMInitialSuffix}{#2}{#4}
255 #1{#3}{\TMSubsequentSuffix}{#2}{#5}
256 \newboolean{@#3@mentioned}
257 \expandafter\g@addto@macro\csname TMReset#2\endcsname {%
258  \global\csname @#3@mentionedfalse\endcsname

259 }

260 \expandafter\@ifdefinable\csname #3\endcsname {%
261 %                is ##1 below:
262  \EExpand\csname #3\endcsname\In {%
263 %                   ####1:
264  \EExpand\csname if@#3@mentioned\endcsname\In {%
265 %                   ########1:
266  \EExpand\csname #3\TMSubsequentSuffix\endcsname\In {%
267 %                   ################1:

268  \EExpand\csname @#3@mentionedtrue\endcsname\In {%
269 %                   ################################1:
270  \EExpand\csname #3\TMInitialSuffix\endcsname\In {%
271 %     \gdef\<csname>{%
272  \gdef ##1{%  must be NO SPACE before `{' !
273  \@tempswafalse
274 %       \if@<csname>mentioned
275  ####1%
276  \ifTMAlwaysLong\else
277  \@tempswatrue
278  \fi
279  \fi
280  \if@tempswa
281 %         \def\sc@t@a {\<csname>\TMSubsequentSuffix}%
282  \def\sc@t@a {########1}%
283  \else
284  \ifTMInhibitSwitching\else
285 %           \global\@<csname>@mentionedtrue
286  \global ################1%
287  \fi
288 %         \def\sc@t@a {\<csname>\TMInitialSuffix}%
289  \def\sc@t@a {################################1}%
290  \fi
291 %        \expandafter  \gdef
292 %          \expandafter\TMCurrentMacro
293 %          \expandafter{\sc@t@a}%
294  \sc@t@a
295  }%   close \gdef
296  }}}}}% close \EExpand...\In's
297 }%       close \@ifdefinable

298 }

299 \newcommand\TMAcromakeDefiner [4] {% args: category csname acronym fulltext
300 \ifnum \ACRcnta < 1\relax
301  \def\ACRcnta {1}%
302 \fi%

Acromake uses a suffix of z here, which IMHO is a bad idea, so I use something a user will not put in a source file: a prefix of tm@acromake@. See below for why we start at −1.

303 \Global\NewName{tm@acromake@#2}{} {-1}% macro for counting occurrences

Define an abbrev that switches from ⟨am-initial⟩ to ⟨am-subsequent⟩. Hack the resetting macro to reset the count as well as the -mentioned boolean. Reset to 0 not −1 so that we only label once! Is this an argument for having the “mentioned” boolean switch at the transition from ⟨am-secondary⟩ to ⟨am-subsequent⟩? (so that resetting goes back to ⟨am-secondary⟩ instead of ⟨am-initial⟩.) I think so; or, better, define a new label each time we reset.

304 \TMNewAbbrevSwitcherAcromake\TMNewAbbrevAcromake{#1}{#2}{#4 (#3)}{#3}%
305 \expandafter\g@addto@macro\csname TMReset#1\endcsname {%
306  \global\DefName{tm@acromake@#2}{} {-1}%

307 }%

Define an additional abbrev that expands to ⟨am-secondary⟩. In the code below, Fred replaces the #1 with something else with #1 in it; Ethel replaces the new #1 with the contents of \sc@toks@a. (The # is quoted with more #’s below.) Hmm, this expansion business could probably be simplified by thinking it through from the beginning.

308 %   \def\tm@acromake@pageref {%
309 %     \sc@toks@a={\noexpand\pageref{TMacromake:#2}}%
310 %     \EExpand\AcromakePageref\In {%  ``Fred''
311 %       \EExpand\sc@toks@a\In {% ``Ethel''
312 %         ####1%
313 %       }%
314 %     }%
315 %   }%
316 %  \eExpand\tm@acromake@pageref\In {%
317  \TMNewAbbrevAcromake{#2}{\TMAcromakeSecondarySuffix}
318  {Acromake}
319  {#3\ (see Page \pageref{TMacromake:#2})}%
320 %        {#3\ ##1}%
321 %  }%

322 }

Now define \TMHookAcromake. Arg, first have to define an alternative of \TMNewAbbrevPlain because of the odd problem described above. Same as \TMNewAbbrevPlain except takes first argument in two parts and defines , which will be used in the hook.

323 \ReserveCS\TMCurrentMacroRootname
324 % plain's args: csname category body
325 \newcommand\TMNewAbbrevAcromake [4] {% args: csname-root csname-suffix category body
326 \expandafter\NewRobustCommand\csname #1#2\endcsname {%
327  \gdef\TMCurrentMacroRootname {#1}%
328  \@bsphack
329  \TMHookAll
330  \@nameuse{TMHook#3}%
331  \@esphack
332  \ifmmode
333  \def\sc@t@a {%
334  \nfss@text{\@nameuse{TMFont#3}#4}%

335 }%

336  \else
337  \def\sc@t@a {%
338  \leavevmode
339  \begingroup

We can skip the check for emptiness and containing just a space, since those won’t occur with abbreviation macros except by accident, I think. We proceed straight to a check for \nocorrs.

340  \tm@check@nocorr #4\nocorr\@nil
341  \TMFontAll
342  \@nameuse{TMFont#3}%
343  \tm@check@left
344  #4%
345  \tm@check@right
346  \endgroup

347 }%

348  \fi
349  \sc@t@a

350 }%

352 %\def\tm@chop#1 {#1}%
353 %\def\tm@choplong#1long{#1}

354

355 \ReserveCS\tm@t % temp
356 \def\TMHookAcromake {%

We handle inhibition of switching as follows. If the count is −1, this is the first iteration, so make the \label, increment the count to 0, and proceed. If switching is not inhibited, increment the counter. Then proceed with choosing the right expansion based on the counter. A first iteration in the normal case will therefore increment the counter twice from −1 to 1. A first iteration in the case that switching is inhibited will advance the counter once to 0, where it will stay until switching is permitted.

I need to extract the root name from the three suffixed names – why can’t I do that?!

  \documentclass{minimal}
  \begin{document}
  \def\gobble#1{}
  \def\one{j}
  \edef\two{\expandafter\gobble\string\j}
  %\edef\two{\two} % doesn't help
  \edef\three{\two}
  \typeout{one: [\meaning\one]}
  \typeout{two: [\meaning\two]}
  [\one] [\two]
  \typeout{\ifx\one\two ifx same\else ifx different -- WHY?!\fi}
  \typeout{\if\one\two if same\else if different\fi}

357 %  \edef\tm@t{\expandafter\strip@prefix\meaning\TMCurrentMacro}%
358 %  \edef\tm@t{\E@cdr\tm@t\@nil}%
359 %  \edef\tm@t{\expandafter\tm@choplong\TMCurrentMacro}%
360 \edef\tm@t{\TMCurrentMacroRootname}%
361 \ifnum\csname tm@acromake@\tm@t\endcsname = -1\relax
362  \eExpand\tm@t\In{%
363 %      \typeout{initial: labeling ##1}%
364  \label{TMacromake:##1}%

365 }%

366  \tm@incmacro{\tm@t}%
367 \fi
368 \ifTMInhibitSwitching\else
369  \tm@incmacro{\tm@t}%
370 \fi
371 %  \typeout{BEGIN: count is \csname tm@acromake@\tm@t\endcsname}%

When the count is < ACRcnta, reset the -mentioned boolean so that the expansion will be the initial text i.e., ⟨am-initial⟩, again the next time.

372 % doesn't work:
373 %  \ifnum\csname tm@acromake@\tm@t\endcsname < \ACRcnta%
374 % doesn't work:
375 %  \ifnum\csname tm@acromake@\tm@t\endcsname < \ACRcnta %
376 % works:  I have no clue why...
377 \ifnum\csname tm@acromake@\tm@t\endcsname < \ACRcnta\relax

378 %    \typeout{use before cnta}%
379  \expandafter\global\csname @\tm@t@mentionedfalse\endcsname
380 \else

When the count is = ACRcnta, use the initial text (i.e., ⟨am-initial⟩) one last time and switch to using ⟨am secondary⟩ next time. We allow the -mentioned boolean to become true by refraining from resetting it. We save the existing subsequent macro (which expands to ⟨am-subsequent⟩) and substitute the abbrev that expands to ⟨am-secondary⟩. The bounds check on \ACRcnta at the beginning guarantees that we execute this clause once.

381  \ifnum\csname tm@acromake@\tm@t\endcsname = \ACRcnta\relax
382  \ifTMInhibitSwitching\else
383 % \typeout{use at cnta A}%
384 \SaveName{\tm@t\TMSubsequentSuffix}%
385 % \typeout{use at cnta B}%
386 \global\EElet\csname \tm@t\TMSubsequentSuffix\endcsname
387  \csname \tm@t\TMAcromakeSecondarySuffix\endcsname
388 % \typeout{use at cnta C}%
389  \fi
390  \fi

When the count is > ACRcnta and <= ACRcntb, the expansion is ⟨am-secondary⟩, we only check whether we are currently on the page of the original use of the ⟨am-initial⟩ text and in this case use ⟨am-subsequent⟩.

391 %     \@tempswafalse
392 %     \ifnum\csname tm@acromake@\tm@t\endcsname < \ACRcntb\relax
393 %       \ifnum\csname tm@acromake@\tm@t\endcsname > \ACRcnta\relax
394 %  \@tempswatrue
395 %       \fi
396 %     \else
397 %       \ifnum\csname tm@acromake@\tm@t\endcsname = \ACRcntb\relax
398 %         \@tempswatrue
399 %       \fi
400 %     \fi
401 %     % ie    cnta < count <= cntb
402 %     \if@tempswa
403 % %      \typeout{use between cnta and cntb}%
404 %         \eExpand\tm@t\In{%
405 %             \typeout{page [\thepage]  ref [\r@TMacromake:##1]}%
406 %           \expandafter\ifnum\expandafter\thepage\expandafter=\csname r@TMacromake:##1\endcsname\relax
407 % %            \typeout{this instance should be subsequent instead of secondary}%
408 %             % insert a * to signal where:
409 % %            *%
410 %             % FIX how to do it??  I leave it broken for now, as it is broken in acromake
411 %      % itself,
412 %           \fi
413 %         }%
414 %     \fi

When the count is = ACRcntb, we want to restore the definition of the subsequent macro. This test is not in an \else clause to handle the case where ACRcnta =

 ACRcntb.
415 %    \ifnum\csname tm@acromake@\tm@t\endcsname < \ACRcntb\relax
416 %      \ifnum\csname tm@acromake@\tm@t\endcsname > \ACRcnta\relax
417 % \typeout{use between cnta and cntb}%

418 %      \fi
419 %    \fi
420  \ifnum\csname tm@acromake@\tm@t\endcsname = \ACRcntb\relax
421 %      \typeout{use at cntb}%
422  \RestoreName{\tm@t\TMSubsequentSuffix}%
423  \fi
424 \fi
425 \TMHookAcromakeHook

426 }

\tm@incmacro \c@tm@util This is Paul’s trick for using a macro like a counter. I reduce the command to its essential function in this context. It looks like Paul wanted a more general command. I think if you define such a command (or set of commands that emulate counters with macros) they do not belong here but in moredefs or their own package. I also

427 \newcounter{tm@util}
428 \newcommand{\tm@incmacro} [1] {% arg: acroabbrev
429 \eExpand\csname tm@acromake@#1\endcsname\In {%
430  \setcounter{tm@util}{##1}%

431 }%

432 \stepcounter{tm@util}%
433 \expandafter\xdef\csname tm@acromake@#1\endcsname {\thetm@util}%

434 }

\ACRcnta
435 \newcommand\ACRcnta {1}
436 \newcommand\ACRcntb {2}

\AcromakePageref The string #1 will make it into the macro, which will in another context be replaced

 with a \pageref.
437 \newcommand\AcromakePageref {(see Page ##1)}
438 % suggestion:
439 % \renewcommand\AcromakePageref {(see page ##1)}

Part III

Configuration

We’ve built up the groundwork and leave the definitions of useful things to the configuration file.

 1 \InputIfFileExists{abbrevs.cfg}{}{}

The contents of the distributed configuration file are below.

 2 \def\fileinfo{Abbrevs package configuration}
 3 \def\fileversion{v1.2}
 4 \def\filedate{2001/08/31}
 5 \def\docdate{1997/10/18}
 6 \ProvidesFile{abbrevs.cfg}

18 \DateMarkSize

\DateMarkSize I like to use this definition instead of the one in the main file, but I didn’t want to require abbrevs to depend on relsize.

 7 \RequirePackage{relsize}
 8 \def\DateMarkSize {%
 9 \relsize{-1}%

10 }

19 Backwards compatibility

\TMNewCategory \TMDefineAbbrevPlain This can be uncommented to deal with anything you might have written that referred to these variables before I changed their names.

11 % \newlet\TMNewCategory\NewAbbrevCategory
12 % \newlet\TMDefineAbbrevPlain\TMDefineAbbrevStandard

20 Suggestions

Here are ideas commented out that you might want to try.

You can learn a helpful general strategy about how to work with hooks in L^{A}TEX from this example. If you put the inhibitor directly into \PreFootnote, you could never take it out without either losing whatever else had been put into \PreFootnote, or using some thorny procedure that stepped through the macro and removed just the inhibitor (you don’t want to try that). If you add a “subhook” to \PreFootnote, you can turn the subhook on or off without even knowing

what else in in \PreFootnote. You can’t redefine \TMInhibitSwitchingtrue. A

\newcommand would work as well as the \newlet here, a tad less efficient.

13 % \newlet\FootnoteTMHook\TMInhibitSwitchingtrue
14 % \addto@macro\PreFootnote {%
15 %   \FootnoteTMHook
16 % }
To undo the effect later, say \let\FootnoteTMHook\relax or \global\let . . .

as appropriate.

Part IV

Testing

I’m presently writing a dissertation on Samuel Beckett. Although there is comparatively little biographical material available, it is well known that he spent several years under the wing of James Joyce, another of the great writers in English this century. Joyce and Beckett, it is curious, like other great writers, both had trouble with their vision, and both were exiles in some sense. One of my favorite pieces by Beckett is Worstward Ho, a short work written in the 1980’s not long before his death: “Fail again. Fail better.” Worstward Ho is lyric and exalting to me. A work I feel is underrated is the radio play All That Fall (all but his three long plays are collected in Collected Shorter Plays (CSP)). It’s extremely funny, and very touchingly compassionate. Because it is a radio play, it loses less from performance to reading. I would recommend All That Fall to anyone. His later plays (and fiction) are famously enigmatic, but with a little practice, it is not hard to see the same lyric beauty and compassion. Take the brief television play Nacht und Träume (in CSP of course), which has no dialogue, only a few murmured bars of the Schubert song, also brief, and also called Nacht und Träume—it’s one of the most hauntingly beautiful few minutes of music I’ve ever heard, and I particularly recommend Cheryl Studer’s recording on Deutsche Grammophone. Every other recording I’ve heard plays too fast.

Joyce is short for James Joyce, not Joyce Smith.

Now some more rigious and boring testing. Each pair should be identical. initial hello initial hello subsequent hello subsequent hello subsequent tie subsequent tie subsequent regular text subsequent regular text subsequent: colon subsequent: colon subsequent; semicolon subsequent; semicolon subsequent. Period. subsequent. Period. subsequent! Exclamation point. subsequent! Exclamation point. subsequent? Question mark. subsequent? Question mark. subsequent-hyphen. subsequent-hyphen. subsequent texttt subsequent texttt subsequent (leftparen) subsequent (leftparen)

(subsequent) rightparen (subsequent) rightparen subsequent, comma subsequent, comma. subsequent tmacro subsequent tmacro subsequent’s face subsequent’s face subsequent “quote” subsequent “quote” subsequent [leftbracket] subsequent [leftbracket] [subsequent] rightbracket [subsequent] rightbracket subsequentopen group subsequentopengroup subsequent close group subsequent close group subsequent {realbrace} subsequent {realbrace} subsequent 666 number subsequent 666 number subsequent x = y^{2} math subsequent x = y^{2} math subsequent $realdollar subsequent $realdollar subsequent #numbersign subsequent #numbersign subsequent/slash subsequent/slash subsequent italic correction subsequent italic correction subsequent explicit space subsequent explicit space subsequent \space subsequent \space subsequent \@xobeysp subsequent \@xobeysp The Central Intelligence Agency (CIA) is overthrowing Nigeria. The CIA (see Page 22) is watching in your window right now. The CIA (see Page 22) will stop that missile. The CIA! The CIA! The CIA. The CIA guys. Resetting Acromake abbrevs. The Central Intelligence Agency (CIA)! The CIA (see Page 22)! The CIA (see Page 22). The CIA guys.

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

\/ . . . . . . . . . . . . . . 26 \< . . . . . . . 146, 156,

163, 271, 281, 288 \@ . . . . . . . . . . 160, 285 \@bsphack . . . . . 82, 328 \@empty 113, 114, 116, 120 \@esphack . . . . . 85, 331 \@for . . . . . . . . . . . . 63

\@ifdefinable . . . . .

. 135, 172, 260, 297

\@ifnextchar . . . . . .

…. 176, 189, 217

\@ifpackageloaded . 236
\@ifundefined . . . 10, 64
\@let@token . . 29, 36, 40

\@m . . . . . . . . . . . . . 218

\@nameuse . . . 68, 84,

88, 96, 330, 334, 342 \@nil . . 94, 106, 340, 358 \@sptoken . . . . . . . . 26

\@tempswafalse . . . .

…. 148, 273, 391

\@tempswatrue . . 39,

152, 277, 394, 398 \@tfor . . . . . . . . . . . 41 \@xobeysp . . . . . . . . 26

\␣ . . . . . . . 26, 319, 320

A

\ACRcnta 4, 300, 301, 373, 375, 377, 381, 393, 416, \underline{435}

\ACRcntb …. 4, 392,

397, 415, 420, 436 \acromake . . . . . . 4, \underline{236}

\AcromakePageref . .

. . . . . . 4, 310, \underline{437} \AD . . . . . . . . . . . 3, \underline{224}

\addto@macro . . . . . . 14
\aftergroup 108, 117, 121

\AM . . . . . . . . . . . 3, \underline{224}

B

\BC . . . . . . . . . . . 3, \underline{224}

\begingroup . . . . 93, 339

\bgroup . . . . . . . . . . 26

C

\c@tm@util . . . . . . . \underline{427}
\check@icl . . . 114, 116
\check@icr . . . . . . . 117

\csname . . 14, 56–58, 60, 79, 129, 130, 132, 133, 135, 137, 139, 141, 143, 145, 174, 182, 188, 195, 257, 258, 260, 262, 264, 266, 268, 270, 305, 326, 361, 371, 373, 375, 377, 379, 381, 386, 387, 392, 393, 397, 406, 415, 416, 420, 429, 433

D

\DateMark . . . 5, \underline{215},

225, 228, 231, 234

\DateMarkSize . . . \underline{7}, \underline{215}

\def . . . . . . . . 1–5, 8, 87, 91, 108–111, 117, 121, 156, 157, 163, 164, 209, 212, 281, 282, 288, 289, 301, 308, 333, 337, 352, 353, 356

\DefName . . . . . . . . . 306 \do . . . . . . . . . . . 46, 63 \docdate . . . . . . . . \underline{1}, 5

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

\DTypeout . . . . . . . . 40

E

\E@cdr . . . . . . . . . . . 358 \edef . . . . . . 6, 357–360 \EElet . . . . . . . . . . . 386 \EExpand . . . . . 137,

139, 141, 143, 145, 171, 262, 264, 266, 268, 270, 296, 310, 311

\eExpand … 14, 184,

316, 362, 404, 429 \egroup . . . . . . . . . . 26 \else . . . . . . 90, 115,

119, 120, 151, 158, 159, 276, 283, 284, 336, 368, 380, 382, 396

\endcsname . . . . 14,

56–58, 60, 129, 130, 132, 133, 135, 137, 139, 141, 143, 145, 257, 258, 260, 262, 264, 266, 268, 270, 305, 326, 361, 371, 373, 375, 377, 379, 381, 386, 387, 392, 393, 397, 406, 415, 416, 420, 429, 433

\endgroup …. 100, 346 \endinput . . . . . . . . 19

\expandafter . . . . . .

… 41–44, 56– 60, 81, 129, 130, 132, 135, 166– 168, 184, 257, 260, 291–293, 305, 326, 357, 359, 379, 406, 433

F

\fi … 49, 102, 118, 122, 123, 153, 154, 162, 165, 278, 279, 287, 290, 302, 348, 367, 370, 389, 390, 395, 399, 400, 412, 414, 418, 419, 423, 424

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

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

\FootnoteTMHook . 13, 15
\FrankenWarning 65, 237
\futurelet . . . . . 29, 36

G

\g@addto@macro . . . .

. 59, 132, 257, 305 \gdef . . . . . 146, 147,

166, 170, 271, 272, 291, 295, 327

\Global . . . . . . . . . . 303 \global … 133, 160,

161, 258, 285, 286, 306, 379, 386

\Gobble . . . . . . . 81, 184

H

\HaveECitationS . . . . \underline{1}

\hspace . . . . . . . . . . 216

I

\if@ . . . . . . . . . 149, 274

\if@tempswa . . . . . . .

. 47, 155, 280, 402 \ifmmode . . . . . . 86, 332 \ifnum 300, 361, 373,

375, 377, 381, 392, 393, 397, 406, 415, 416, 420

\ifTMAlwaysLong . . .

. . 5, \underline{125}, 151, 276

\ifTMInhibitSwitching

. . . . . . 5, \underline{125}, 159, 284, 368, 382

\ifx . . . . . . 112, 113, 120 \In 14, 137, 139, 141,

143, 145, 171, 184, 262, 264, 266, 268, 270, 296, 310, 311, 316, 362, 404, 429

\InputIfFileExists . . 1

\itswitch …. 210, 213

J

\JusTLoaDInformatioN 12

L

\label . . . . . . . . . . . 364

\leavevmode . . . . 92, 338

\let . . . . . . 107, 114, 116

M

\makeatletter . . . . . . 9
\makeatother . . . . . . 18

\maybe@ic . . . . . . . . 107

\maybe@ic@ . . . . . . . 32
\maybe@ic@space . . .

. . . . . \underline{28}, 108, 220

\maybe@ic@space@ . . \underline{28}
\maybe@space \underline{35}, 117, 121
\maybe@space@ . . . 33, \underline{35}

\meaning . . . . . . 40, 357

\MessageBreak . 238–240

N

\NeedsTeXFormat . 21, 23
\newabbrev . . . . . 3, \underline{200}
\NewAbbrevCategory 5,

11, \underline{51}, 200–203, 243 \newbook . . . . . . . 3, \underline{200}

\newboolean . . . . . . .

. 125, 126, 131, 256

\newcommand . . . . 28,

31, 35, 38, 55, 62, 72, 75, 79, 127, 174, 188, 196, 215, 224, 227, 230, 233, 246, 252, 299, 325, 428, 435–437

\newcounter . . . . . . . 427

\newlet …. 11–13, 223 \NewName . . . . . . . . .

. 106, 182, 195, 303 \newname . . . . . . . 3, \underline{200}

\NewRobustCommand .

. . . . . . . . 80, 326

\NewUserAbbrevDefiner

. . . . . . . . . . 5, \underline{188}, 204–207, 244

\newwork . . . . . . . 3, \underline{200}

\nfss@text . . . . 88, 334

\nocorr 94, 106, 109, 340 \noexpand . . . . . . . . 309

\nospacelist . . 2, \underline{25}, 45

P

\pageref . . . . . 309, 319 \PM . . . . . . . . . . . 3, \underline{224} \PPOptArg . . . . . . . \underline{1}, 22

\PreFootnote . . . . . . 14

\protect . . . . . . . . . 237

\ProvidesFile . . . . . . 6
\ProvidesPackage . . 22

R

\r@TMacromake . . . . . 405

\relax . . . . . . . 300, 361, 377, 381, 392, 393, 397, 406, 415, 416, 420

\relsize . . . . . . . . . . 9

                          \renewcommand . . . . . 439
                          \requirecommand . . . 25
                          \RequirePackage . . 7, 24
                          \ReserveCS . . . . 51–

53, 56–58, 78, 248, 249, 323, 355

                          \reserved@a 42, 109, 112
                          \reserved@b . . . 110, 112
                          \reserved@c 111, 113, 120
                          \ResetAbbrevs . . . . 4, \underline{51}
                          \RestoreDoXVarS . . . 17
                          \RestoreName . . . . . . 422

S

                          \SaveDoXVarS . . . . . . 13

\SaveName . . . . . . . . 384 \sc@t@a . . . . . . . 63–

65, 68, 87, 91, 103, 156, 157, 163, 164, 168, 169, 281, 282, 288, 289, 293, 294, 333, 337, 349

                          \sc@toks@a . . . 309, 311

\scshape . . . . . . . . . 216

                          \setcounter . . . . . . . 430

\slash . . . . . . . . . . . 26 \small . . . . . . . . . . . 223 \space …. 7, 26, 48, 65

                          \spacefactor . . . . . . 218
                          \stepcounter . . . . . . 432

\string . . . . . . . 81, 184

                          \strip@prefix . . . . . 357

T \t@st@ic . . . . . . . . . 46 \thepage . . . . . 405, 406

                          \thetm@util . . . . . . . 433
                          \tm@acromake@pageref

. . . . . . . . . . . \underline{236}

                          \tm@check@left . . . .

. . . . . 97, 107, 343

                          \tm@check@nocorr . .

. . . . . 94, \underline{106}, 340

                          \tm@check@right . . .

. 99, 108, 121, 345 \tm@chop . . . . . . . . . 352

                          \tm@choplong . . 353, 359
                          \tm@defineabbrevstandard

. . . . . . . . . . . \underline{174}

\tm@incmacro . . . . . .

…. 366, 369, \underline{427}

\tm@newuserabbrevdefiner

. . . . . . . . . . . \underline{188}

\tm@t . . . . . 355, 357– 362, 366, 369, 371, 373, 375, 377, 381, 384, 386, 387, 392, 393, 397, 404, 415, 416, 420, 422

\tm@t@mentionedfalse

. . . . . . . . . . . 379

\TMAcromakeDefiner .

. . . . . . . . 244, 299

\TMAcromakeSecondarySuffix

. . . . . . . . . . . \underline{236}

\TMAlwaysLongfalse .

. . . . . . . . . 5, \underline{125}

\TMAlwaysLongtrue 5, \underline{125}
\TMCurrentMacro . . .

. . . . . . 78, 81, 167, 292, 357, 359

\TMCurrentMacroRootname

…. 323, 327, 360

\TMDefineAbbrevPlain  \underline{11}

\TMDefineAbbrevStandard

. . . . . 12, \underline{174}, 192

\TMFontAcromake . . . \underline{236}

\TMFontAll 5, \underline{51}, 95, 341

\TMFontBook . . . . . . . \underline{200}
\TMFontGeneric . . . . \underline{200}
\TMFontName . . . . . . . \underline{200}
\TMFontWork . . . . . . . \underline{200}
\TMHookAcromake . . . \underline{236}
\TMHookAcromakeHook  \underline{236}

\TMHookAll 5, \underline{51}, 83, 329

\TMHookBook . . . . . . . \underline{200}
\TMHookGeneric . . . . \underline{200}
\TMHookName . . . . . . . \underline{200}
\TMHookWork . . . . . . . \underline{200}
\TMInhibitSwitchingfalse

. . . . . . . . . 5, \underline{125}

\TMInhibitSwitchingtrue

. . . . . . . 5, 13, \underline{125}

\TMInitialSuffix . .

5, \underline{72}, 129, 145, 163, 254, 270, 288

\TMNewAbbrevAcromake

…. 304, 317, 325

\TMNewAbbrevPlain .

. . . . . \underline{78}, 179, 185

                          \TMNewAbbrevSwitcher

. . . . . . . . \underline{127}, 185

                          \TMNewAbbrevSwitcherAcromake

. . . . . . . . 252, 304

                          \TMNewCategory . . . . \underline{11}
                          \TMResetAcromake . . \underline{236}
                          \TMResetAll . . . . . . 5, \underline{51}
                          \TMResetBook . . . . . . \underline{200}
                          \TMResetGeneric . . . \underline{200}
                          \TMResetName . . . . . . \underline{200}
                          \TMResetWork . . . . . . \underline{200}
                          \TMSubsequentSuffix

5, \underline{72}, 130, 141, 156, 255, 266, 281, 384, 386, 422

\typeout . . . . . 363, 371, 378, 383, 385, 388, 403, 405, 407, 417, 421

U

                          \UndefineCS . . . . . . . 12
                          \usepackage . . . . . . . 15

X \xdef . . . . . . . . . 81, 433