The abbrevs LaTeX package

abbreviation macros (Frankenstein’s briefs)

          Matt Swift <swift@alum.mit.edu>

Version: 1.2 Date: 1999/03/08

Documentation revision: 1999/03/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 4

4 Programmers’ interface 4

II Implementation 6

5 Version control 6

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

III Configuration 15

16 \relsize-1  15

17 Backwards compatibility 15 18 Suggestions 15

IV Testing 17

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 ,.':;?-~!)]{}.

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.

To do: Emulate the acronym and acromake packages.

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

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.

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

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 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

5 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.2}
 4 \def\filedate{1999/03/08}
 5 \def\docdate{1999/03/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]

6 Requirements

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

7 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.

25 \newcommand\nospacelist {%
26 ,.':;?-~!)]\bgroup\egroup

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 }

8 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 }

9 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 }

10 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.

78 \newcommand\TMNewAbbrevPlain [3] {% args: \csname category body
79 \NewRobustCommand #1 {%
80  \@bsphack
81  \TMHookAll
82  \@nameuse{TMHook#2}%
83  \@esphack
84  \ifmmode
85  \def\sc@t@a {%
86  \nfss@text{\@nameuse{TMFont#2}#3}%
87  }%
88  \else
89  \def\sc@t@a {%
90  \leavevmode
91  \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.

92  \tm@check@nocorr #3\nocorr\@nil
93  \TMFontAll
94  \@nameuse{TMFont#2}%
95  \tm@check@left
96  #3%
97  \tm@check@right
98  \endgroup
99  }%
100  \fi
101  \sc@t@a

102 }% 103 }

\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.
104 \NewName{tm@check@nocorr} {#1#2\nocorr#3\@nil} {%
105 \let\tm@check@left\maybe@ic
106 \def\tm@check@right {\aftergroup\maybe@ic@space}%
107 \def\reserved@a {\nocorr}%

108 \def\reserved@b {#1}%
109 \def\reserved@c {#3}%
110 \ifx\reserved@a\reserved@b
111  \ifx\reserved@c\@empty
112  \let\check@icl\@empty
113  \else
114  \let\check@icl\@empty
115  \def\check@icr {\aftergroup\maybe@space}%
116  \fi
117 \else
118  \ifx\reserved@c\@empty\else
119  \def\tm@check@right {\aftergroup\maybe@space}%
120  \fi
121 \fi

122 }

11 Control booleans

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

12 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.

125 \newcommand\TMNewAbbrevSwitcher [5] {% args: definer category csname
126 %                                    %       initial subseq.
127 \expandafter#1\csname #3\TMInitialSuffix\endcsname{#2}{#4}
128 \expandafter#1\csname #3\TMSubsequentSuffix\endcsname{#2}{#5}
129 \newboolean{@#3@mentioned}

130 \expandafter\g@addto@macro\csname TMReset#2\endcsname {%
131  \global\csname @#3@mentionedfalse\endcsname

132 }

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

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. See the \TMAcroDefiner definer in the configuration file for a use of this.

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

164  \sc@t@a
165  }%   close \gdef
166  }}}}}% close \EExpand...\In's
167 }%       close \@ifdefinable

168 }

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.

13 Defining commands

A ⟨definer⟩ is always called with a category as a first argument. There is only one definer in this package, though another is given in the distributed configuration file.

\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.

169 \newcommand\TMDefineAbbrevStandard [3] {% args: category \csname
170  %       initial [subsequent]
171 \@ifnextchar [ {%
172  \tm@defineabbrevstandard{#1}{#2}{#3}%
173  }{% ELSE
174  \TMNewAbbrevPlain{#2}{#1}{#3}%

175 }% 176 }

177 \NewName{tm@defineabbrevstandard} {#1#2#3[#4]} {% args: category \csname
178  %       initial subsequent
179 \eExpand\expandafter\Gobble\string#2\In {%
180  \TMNewAbbrevSwitcher\TMNewAbbrevPlain{#1}{##1}{#3}{#4}%

181 }% 182 }

\NewUserAbbrevDefiner
\tm@newuserabbrevdefiner
183 \newcommand\NewUserAbbrevDefiner [2] {% args: \csname category [definer]
184 \@ifnextchar [ {%
185  \tm@newuserabbrevdefiner{#1}{#2}%
186  }{% ELSE
187  \tm@newuserabbrevdefiner{#1}{#2}[\TMDefineAbbrevStandard]%

188 }% 189 }

190 \NewName{tm@newuserabbrevdefiner}{#1#2[#3]} {% args: \csname category definer
191 \newcommand #1 {%
192  #3{#2}%

193 }% 194 }

14 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.

195 \NewAbbrevCategory{Generic}
196 \NewAbbrevCategory{Name}
197 \NewAbbrevCategory{Book}
198 \NewAbbrevCategory{Work}
199 \NewUserAbbrevDefiner{\newabbrev}{Generic}
200 \NewUserAbbrevDefiner{\newname}{Name}
201 \NewUserAbbrevDefiner{\newbook}{Book}
202 \NewUserAbbrevDefiner{\newwork}{Work}

203

204 \def\TMFontBook {%
205 \itswitch

206 }

207 \def\TMFontWork {%
208 \itswitch

209 }

15 Date marks

\DateMark
\DateMarkSize
210 \newcommand\DateMark [1] {%
211 \hspace{.2em}{\DateMarkSize\scshape #1}%
212 \@ifnextchar. {%
213  \spacefactor\@m
214  }{% ELSE
215  .\maybe@ic@space

216 }% 217 }

218 \newlet\DateMarkSize\small

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

219 \newcommand{\PM} {%
220 \DateMark{p.m}%

221 }

222 \newcommand{\AM} {%
223 \DateMark{a.m}%

224 }

225 \newcommand{\BC} {%
226 \DateMark{b.c}%

227 }

228 \newcommand{\AD} {%
229 \DateMark{a.d}%

230 }

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.1}
 4 \def\filedate{1997/10/18}
 5 \def\docdate{1997/10/18}
 6 \ProvidesFile{abbrevs.cfg}

16 \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 }

17 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

18 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

Index

Numbers written in italic refer to the page where the corresponding entry is described, the ones underlined to the code line of the definition, the rest to the code lines where the entry is used.

Symbols

\< . . . . . . . 144, 154, 161 \@ . . . . . . . . . . . . . . 158 \@bsphack . . . . . . . . 80 \@empty 111, 112, 114, 118 \@esphack . . . . . . . . 83 \@for . . . . . . . . . . . . 63

\@ifdefinable . 133, 167
\@ifnextchar . . . . . .

…. 171, 184, 212

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

\@m . . . . . . . . . . . . . 213 \@nameuse 68, 82, 86, 94 \@nil . . . . . . . . . 92, 104

\@tempswafalse . . . . 146
\@tempswatrue . . 39, 150

\@tfor . . . . . . . . . . . 41

A

\AD . . . . . . . . . . . 4, \underline{219}

\addto@macro . . . . . . 14
\aftergroup 106, 115, 119

\AM . . . . . . . . . . . 4, \underline{219}

B

\BC . . . . . . . . . . . 4, \underline{219}

\begingroup . . . . . . . 91

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

C

\check@icl . . . 112, 114
\check@icr . . . . . . . 115

\csname …. 14, 56– 58, 60, 78, 127, 128, 130, 131, 133, 135, 137, 139, 141, 143, 169, 177, 183, 190

D

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

220, 223, 226, 229

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

\def . . 1–5, 8, 85, 89, 106–109, 115, 119, 154, 155, 161, 162, 204, 207

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

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

\DTypeout . . . . . . . . 40

E \edef . . . . . . . . . . . . . 6 \EExpand . . 135, 137,

139, 141, 143, 166 \eExpand . . . . . . 14, 179 \egroup . . . . . . . . . . 26 \else . . 88, 113, 117,

118, 149, 156, 157

                          \endcsname . . . . . . .

. 14, 56–58, 60, 127, 128, 130, 131, 133, 135, 137, 139, 141, 143

\endgroup . . . . . . . . 98 \endinput . . . . . . . . 19

                          \expandafter . . . 41–

44, 56–60, 127, 128, 130, 133, 179

F \fi . . . . . . . 49, 100,

116, 120, 121, 151, 152, 160, 163

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

                          \fileversion . . . . . \underline{1}, 3
                          \FootnoteTMHook . 13, 15
                          \FrankenWarning . . . 65
                          \futurelet . . . . . 29, 36

G

                          \g@addto@macro . 59, 130

\gdef . . . . . 144, 145, 165 \global … 131, 158, 159 \Gobble . . . . . . . . . . 179

H

                                                   \HaveECitationS . . . . \underline{1}

\hspace . . . . . . . . . . 211

I \if@ . . . . . . . . . . . . . 147

                                                   \if@tempswa . . . . 47, 153

\ifmmode . . . . . . . . . 84

                                                   \ifTMAlwaysLong . . .

. . . . . . 5, \underline{123}, 149

                                                   \ifTMInhibitSwitching

. . . . . . 5, \underline{123}, 157 \ifx . . . . . . 110, 111, 118 \In 14, 135, 137, 139,

141, 143, 166, 179

                                                   \InputIfFileExists . . 1

\itswitch …. 205, 208

J

                                                   \JusTLoaDInformatioN 12

L

                                                   \leavevmode . . . . . . . 90

\let . . . . . . 105, 112, 114

M

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

\maybe@ic . . . . . . . . 105

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

. . . . . \underline{28}, 106, 215

                                                   \maybe@ic@space@ . . \underline{28}
                                                   \maybe@space \underline{35}, 115, 119
                                                   \maybe@space@ . . . 33, \underline{35}

\meaning . . . . . . . . . 40

N

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

. 4, 11, \underline{51}, 195–198 \newbook . . . . . . . 3, \underline{195}

\newboolean 123, 124, 129
\newcommand . . . . . . .

. 25, 28, 31, 35, 38, 55, 62, 72, 75, 78, 125, 169, 183, 191, 210, 219, 222, 225, 228

\newlet …. 11–13, 218 \NewName . . 104, 177, 190 \newname . . . . . . . 3, \underline{195}

\NewRobustCommand . 79
\NewUserAbbrevDefiner

. . 4, \underline{183}, 199–202 \newwork . . . . . . . 3, \underline{195}

\nfss@text . . . . . . . 86

\nocorr … 92, 104, 107

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

P

\PM . . . . . . . . . . . 4, \underline{219} \PPOptArg . . . . . . . \underline{1}, 22

\PreFootnote . . . . . . 14
\ProvidesFile . . . . . . 6
\ProvidesPackage . . 22

R

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

\RequirePackage . . 7, 24

\ReserveCS 51–53, 56–58

\reserved@a 42, 107, 110
\reserved@b . . . 108, 110
\reserved@c 109, 111, 118

                          \ResetAbbrevs . . . . 4, \underline{51}
                          \RestoreDoXVarS . . . 17

S

                          \SaveDoXVarS . . . . . . 13

\sc@t@a . . 63–65, 68, 85, 89, 101, 154, 155, 161, 162, 164

\scshape . . . . . . . . . 211 \small . . . . . . . . . . . 218 \space . . . . . . . 7, 48, 65

                          \spacefactor . . . . . . 213

\string . . . . . . . . . . 179

T \t@st@ic . . . . . . . . . 46

                          \tm@check@left . 95, 105
                          \tm@check@nocorr 92, \underline{104}
                          \tm@check@right . . .

. . . . . 97, 106, 119

                          \tm@defineabbrevstandard

. . . . . . . . . . . \underline{169}

                          \tm@newuserabbrevdefiner

. . . . . . . . . . . \underline{183}

                          \TMAlwaysLongfalse .

. . . . . . . . . 5, \underline{123}

                          \TMAlwaysLongtrue 5, \underline{123}
                          \TMDefineAbbrevPlain  \underline{11}
                          \TMDefineAbbrevStandard

. . . . . 12, \underline{169}, 187

                          \TMFontAll . . . 4, \underline{51}, 93
                          \TMFontBook . . . . . . . \underline{195}

                                                   \TMFontGeneric . . . . \underline{195}
                                                   \TMFontName . . . . . . . \underline{195}
                                                   \TMFontWork . . . . . . . \underline{195}
                                                   \TMHookAll . . . 4, \underline{51}, 81
                                                   \TMHookBook . . . . . . . \underline{195}
                                                   \TMHookGeneric . . . . \underline{195}
                                                   \TMHookName . . . . . . . \underline{195}
                                                   \TMHookWork . . . . . . . \underline{195}
                                                   \TMInhibitSwitchingfalse

. . . . . . . . . 5, \underline{123}

                                                   \TMInhibitSwitchingtrue

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

                                                   \TMInitialSuffix . .

4, \underline{72}, 127, 143, 161

                                                   \TMNewAbbrevPlain .

. . . . . \underline{78}, 174, 180

                                                   \TMNewAbbrevSwitcher

. . . . . . . . \underline{125}, 180

                                                   \TMNewCategory . . . . \underline{11}
                                                   \TMResetAll . . . . . . 4, \underline{51}
                                                   \TMResetBook . . . . . . \underline{195}
                                                   \TMResetGeneric . . . \underline{195}
                                                   \TMResetName . . . . . . \underline{195}
                                                   \TMResetWork . . . . . . \underline{195}
                                                   \TMSubsequentSuffix

4, \underline{72}, 128, 139, 154

U

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