The titles LaTeX package

title macros (Frankenstein’s references)

              Matt Swift <swift@alum.mit.edu>

Version: 1.1a Date: 1999/03/08

Documentation revision: 1999/03/08

Abstract The titles package defines macros that typeset the titles of books, journals, etc. and handle following spacing and punctuation intelligently, based on context. These are useful for bibliographic databases, for example. Also defined is other markup like \word, \defn, \phrase, etc.

Contents

I Discussion 2

1 Options 2 2 Words and phrases 2 3 Titles 3 4 Programmer’s interface 6

4.1 Limitations of Wrapquotes and friends . . . . . . . . . . . . . . . . 6 4.1.1 Nesting . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 6 4.1.2 Italic corrections . . . . . . . . . . . . . . . . . . . . . . . . 7 4.1.3 A slight bug . . . . . . . . . . . . . . . . . . . . . . . . . . . 7

II Implementation 8

5 Version control 8 6 Requirements 8 7 Options 9 8 Words and phrases 9 9 Wrapquotes 9

9.1 Titles that are Questions or Exclamations . . . . . . . . . . . . . . 9 9.2 Highlevel macros . . . . . . . . . . . . . . . . . . . . . . . . . . . . 11 9.3 Opening quotes . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 13 9.4 Closing macros that don’t suck . . . . . . . . . . . . . . . . . . . . 14 9.5 Closing macros that suck . . . . . . . . . . . . . . . . . . . . . . . 14 9.6 Looking ahead . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 16

10 Titles 20

III Configuration 22

11 User Customization 22

IV Testing 23

11.1 Question and exclamation marks . . . . . . . . . . . . . . . . . . . 23 11.2 Plain . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 23 11.3 Nested beginnings . . . . . . . . . . . . . . . . . . . . . . . . . . . 23 11.4 Nested endings . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 24

Part I

Discussion

1 Options

There are two package options, british and american, the default is american. They select the conventional way to use quotation marks: British style is use single quotes, and do not suck following period or comma inside; American style is to use double quotes and to suck following period or comma inside.

2 Words and phrases

\word Typeset a word or phrase referred to as a noun with \word {⟨word⟩}. The argument is not expected to contain punctuation.

     \word{Elephant} is such a silly word.

LOOKS LIKE:

Elephant is such a silly word.

\phrase Typeset a phrase used as a noun rather than direct quotation with \phrase {⟨phrase⟩}. The argument might well have punctuation, including final punctuation.

Warning: I don’t think \phrase nests.

     The sentence \phrase{And stop calling me Shirley!} occurs
     twenty-seven times.

LOOKS LIKE:

The sentence ‘And stop calling me Shirley!’ occurs twenty-seven times.

\foreign Typeset a foreign word or phrase with \foreign {⟨foreign text⟩}.

     I couldn't think of the \foreign{mot juste} at the time.

LOOKS LIKE:

I couldn’t think of the mot juste at the time.

\foreignword Typeset a foreign word or phrase referred to as a noun with \foreignword {⟨foreign word⟩}.

     Only later did I realize that the right word was
     \foreignword{bouffon}.

LOOKS LIKE:

Only later did I realize that the right word was ‘bouffon’.

Warning: Notice that writing \foreign{\word{text}} or vice versa is not necessarily going to do the right thing. Suppose \foreign and \word were both set to \textitswitch (which are in fact the default settings below). Then \foreign{\word{text}} is going to cancel out and look just like the surrounding text. This is not the most intuitive fact, but it’s not worth it to try to make \foreign and \word smart enough to see each other inside themselves.

\term \term {⟨technical term⟩} typesets a techincal term in a different font. You might want to use this where a techincal term is first used, or defined. One could enhance this macro and \defn to help build an automatic glossary

      This sort of thing is called a \term{blibnil}.

LOOKS LIKE:

This sort of thing is called a blibnil.

\defn \defn {⟨definition⟩} typesets a definition, perhaps of a technical term. One could enhance this macro and \defn to help build an automatic glossary

     We may describe a \term{blibnil} as \defn{a slibnil with
     three arms}.

LOOKS LIKE:

We may describe a blibnil as a slibnil with three arms.

3 Titles

\booktitle \booktitle {⟨book title⟩} typesets a book title.

     Some people find \booktitle{Moby-Dick} dull, but I thought
     it was exciting.

LOOKS LIKE:

Some people find Moby-Dick dull, but I thought it was exciting.

\journaltitle \journaltitle {⟨journal title⟩} typesets a journal title.

     I liked it so much I started a scholarly journal called
     \journaltitle{The Melville Times} with the inheritance from
     my grandmother.

LOOKS LIKE:

I liked it so much I started a scholarly journal called The Melville Times with the inheritance from my grandmother.

\musictitle \musictitle {⟨music title⟩} typesets a music title.

My journal didn't do very well; I moped around my office
and listened to Schubert's \musictitle{Winterreise}.

LOOKS LIKE:

My journal didn’t do very well; I moped around my office and listened to Schubert’s Winterreise.

\articletitle \articletitle {⟨article title⟩} typesets a article title.

Then one day I received an article, \articletitle{Pip and
the Milk of Human Kindness}, by express mail from Wales.

LOOKS LIKE:

Then one day I received an article, “Pip and the Milk of Human Kindness,” by express mail from Wales.

\poemtitle \poemtitle {⟨poem title⟩} typesets a poem title.

I then wrote my famous poem \poemtitle{Jump for Joy like
the Butterflies of Troy} in five minutes.

LOOKS LIKE:

I then wrote my famous poem “Jump for Joy like the Butterflies of Troy” in five minutes.

Sometimes longer poems are distinguished from shorter ones in the type FIX REF. This package doesn’t define a macro \longpoemtitle, but the following would be a natural addition to the package configuration file:

\newlet\longpoemtitle\textitswitch

\playtitle \playtitle {⟨play title⟩} typesets a play title.

To celebrate the popularity of the article, I took the
author to the theater to see the acclaimed play
\playtitle{Grave in Waterloo}, starring Vincent Price.

LOOKS LIKE:

To celebrate the popularity of the article, I took the author to the theater to see the acclaimed play “Grave in Waterloo,” starring Vincent Price.

Sometimes longer plays are distinguished from shorter ones in the type FIX: REF. This package doesn’t define a macro \longplaytitle, but the following would be a natural addition to the package configuration file:

\newlet\longplaytitle\textitswitch

\crafttitle \crafttitle {⟨craft title⟩} types a title of a craft or ship.

  With tears in my heart, I put the author on the \crafttitle{HMS Shangrila}
  bound for Wales.

LOOKS LIKE:

With tears in my heart, I put the author on the HMS Shangrila bound for Wales.

Warning: Right now there is a small discrepancy between the behavior of \textitswitch and \Wrapquotes regarding what happens when followed by a command sequence such as \footnote. I hope to make these things completely parallel one day, but for now, realize that after using a titling macro that uses \Wrapquotes, you must use {} before any following command sequence that you want to immediately follow the title with no intervening space. The only case I can think of is \footnote. If you forget the {}, you will have an extra space after the title and before the footnotemark. The following example illustrates this behavior and contrasts it with \textitswitch:

\newabbrev\foo{Foo}
\booktitle{Foo}\foo
\booktitle{Foo} \foo
\booktitle{Foo}\footnote{footie}
\booktitle{Foo}{}\footnote{footie}
\poemtitle{Foo}\foo
\poemtitle{Foo} \foo
\poemtitle{Foo}\footnote{footie}
\poemtitle{Foo}{}\footnote{footie}
\poemtitle{Foo}.\footnote{footie}

LOOKS LIKE:

FooFoo Foo Foo Foo^{a} Foo^{b} “Foo” Foo “Foo” Foo “Foo” ^{c} “Foo”^{d} “Foo.”^{e}

afootie bfootie cfootie dfootie efootie

4 Programmer’s interface

\Wrapquotes \Wrapquotes {⟨text⟩} wraps ⟨text⟩ in quotes. Single quotes are used if the

\WrapquotesNS
\WrapquotesIS
\WrapquotesNN
\WrapquotesIN

singlequotes option is given to the package, and double quotes if no option or the doublequotes option is given to the package.

FIX

Spacing and punctuation following the closing quotes are handled intelligently. That is, if what follows is a comma or period, it is pulled inside the quotes (following American practice). A space is inserted after the closing quotes unless what follows is in the set ;?:!-)]'{, in which case no space is inserted.

\Wrapquotes nests properly, switching from single to double or vice versa for each level of nesting. When quotation marks inserted by the \Wrapquotes command are doubled up, proper space is inserted between them.

\IfQuestionOrExclamation      \IfQuestionOrExclamation {⟨text⟩}{⟨true⟩}{⟨false⟩} executes ⟨true⟩ clause

iff ⟨text⟩ ends with a question mark or an exclamation point; executes ⟨false⟩ clause otherwise.

4.1 Limitations of Wrapquotes and friends

4.1.1 Nesting

Warning: For proper nesting of \Wrapquotes (and friends, here and hereafter), user commands must be \let to \Wrapquotes instead of using a \def-like defining command. Also, the user command which is \let to \Wrapquotes must appear in the source. That is, it must not appear as the result of an expansion. Among other things, this means that nesting won’t work properly if you put \Wrapquotes into an abbrev (see the abbrevs package in the Frankenstein bundle).

For applications where nesting will not occur, there should be nothing to worry about.

4.1.2 Italic corrections

Warning: The question of when to insert an italic correction is not nearly as simple as it might seem. I cannot figure good rules which cover all cases, and I do not trust the behavior of the kernel’s macros as a guide. So I can not tell you whether this package handles italic corrections properly. If you discover behavior which you think is wrong, please let me know with an example and an argument.

4.1.3 A slight bug

Warning: Right now there is a small bug in cases where closing quotes fall at the end of italic text, such as

          \normalfont
          \booktitle{My love of \poemtitle{Daffodils}}, by H.~Moneysworth.

LOOKS LIKE:

My love of “Daffodils,” by H. Moneysworth.

These cases loose because the closing quotation marks and any sucked-in punctuation are going to be in roman, not italic, or italic, not roman. Only the more obsessive will notice this flaw. I’m sure I will come up with a way to handle this for a future version of this package.

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{title macros (Frankenstein's references)}
 2 \def\DoXPackageS {}
 3 \def\fileversion{v1.1a}
 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{titles}[\PPOptArg]

6 Requirements

23 \RequirePackage{moredefs,slemph}

7 Options

\ti@domelater
24 \ReserveCS\ti@domelater
25 \DeclareOption{british} {%
26 \def\ti@domelater {%
27  \let\Wrapquotes\WrapquotesNN
28  \@doublequotes@false

29 } 30 }

31 \DeclareOption{american} {%
32 \def\ti@domelater {%
33  \let\Wrapquotes\WrapquotesNS
34  \@doublequotes@true

35 } 36 }

37 \ExecuteOptions{american}
38 \ProcessOptions

8 Words and phrases

\word
\foreign
\foreignword
\phrase
\term
\defn

39 \newlet\word\textitswitch
40 \newlet\foreign\textitswitch
41 \newcommand\foreignword [1] {%
42 \phrase{\word{#1}}%

43 }

The \@ cancels the effect on spacing of any final punctuation in the argument.

44 \newcommand\phrase [1] {%
45 `#1'\@%

46 }

47 \newlet\term\textitswitch
48 \newlet\defn\textslswitch

9 Wrapquotes

Here we go! This is not a picnic, so leave your jelly jar home.

9.1 Titles that are Questions or Exclamations

\IfQuestionOrExclamation
\ti@checkfor@q
\ti@checkfor@e
\ti@prev
\ti@prev@prev
\@ti@sw@true
\@ti@sw@false
\if@ti@sw@

49 \newcommand\IfQuestionOrExclamation [1] {%
50 \@tempswafalse
51 \ti@checkfor@q #1?\@nil
52 \ti@checkfor@e #1!\@nil
53 \if@tempswa

54  \expandafter\@firstoftwo
55 \else
56  \expandafter\@secondoftwo
57 \fi

58 }

Strategy is to divide our argument (with an extra question mark tacked onto the end) into what’s before the first question mark and what’s after it. Then we examine what’s after it and interpret the results thus:

empty no question mark in title

question mark title ends with question mark

text ending with one question mark a question mark occurs in the title, but not at the end

text ending with two question marks title has more than one question mark and ends with a question mark

We set switch a to true if the title ends with a question mark.

59 \newboolean{@ti@sw@}
60 \ReserveCS\ti@prev
61 \ReserveCS\ti@prev@prev
62 \NewName{ti@checkfor@q} {#1?#2\@nil} {%
63 \def\sc@t@a{#2}%
64 \def\sc@t@b{?}%
65 \ifx\sc@t@a\ShortEmpty
66 \else
67  \ifx\sc@t@a\sc@t@b
68  \@tempswatrue
69  \else

We use a loop to whittle down #2 until \ti@prev contains the last character and \ti@prev@prev contains the second-to-last. We know that \ti@prev is going to be a question mark. Iff \ti@prev@prev is a question mark, we are in the final case above.

70  \let\ti@prev\sc@t@a
71  \let\ti@prev@prev\sc@t@a
72  \@ti@sw@true
73  \@whilesw \if@ti@sw@ \fi {%
74 \ifx\sc@t@a\ShortEmpty
75 \@ti@sw@false
76 \else
77  \let\ti@prev@prev\ti@prev
78  \let\ti@prev\sc@t@a
79 \edef\sc@t@a{\E@cdr\sc@t@a\@nil}%
80 \fi
81  }%
82  \edef\ti@prev@prev{\E@car\ti@prev@prev\@nil}%
83  \ifx\ti@prev@prev\sc@t@b

 84  \@tempswatrue
 85  \fi
 86  \fi
 87 \fi

88 }

Exact same logic applies to exclamation points.

 89 \NewName{ti@checkfor@e} {#1!#2\@nil} {%
 90 \def\sc@t@a{#2}%
 91 \def\sc@t@b{!}%
 92 \ifx\sc@t@a\ShortEmpty
 93 \else
 94  \ifx\sc@t@a\sc@t@b
 95  \@tempswatrue
 96  \else
 97  \let\ti@prev\sc@t@a
 98  \let\ti@prev@prev\sc@t@a
 99  \@ti@sw@true
100  \@whilesw \if@ti@sw@ \fi {%
101 \ifx\sc@t@a\ShortEmpty
102 \@ti@sw@false
103 \else
104  \let\ti@prev@prev\ti@prev
105  \let\ti@prev\sc@t@a
106 \edef\sc@t@a{\E@cdr\sc@t@a\@nil}%
107 \fi

108 }%

109  \edef\ti@prev@prev{\E@car\ti@prev@prev\@nil}%
110  \ifx\ti@prev@prev\sc@t@b
111  \@tempswatrue
112  \fi
113  \fi
114 \fi

115 }

9.2 Highlevel macros

\ti@wrapquotes@suck \ti@wrapquotes@nosuck These two are the top-level internal macros, and they are pretty sane. One sucks in a following period or comma, the other does not. \ti@wrapquotes@suck does not suck, however, when the title ends in a question or exclamation point.

The group here is necessary to scope the \@doublequotes@ boolean.

116 \newcommand*\ti@wrapquotes@suck [1] {%
117 %  \DTypeout{top of wrapquotes@suck}%
118 \IfQuestionOrExclamation {#1} {%
119  \ti@wrapquotes@nosuck{#1}%
120  }{% ELSE
121 %    \DTypeout{top of wrapquotes@suck ELSE}%
122  \begingroup
123  \if@doublequotes@

124 %        \DTypeout{double true in suck}%
125 \@doublequotes@false
126 \def\sc@t@a {\ti@open@double #1\ti@close@double@suck}%
127  \else
128 %        \DTypeout{double false in suck}%
129 \@doublequotes@true
130 \def\sc@t@a {\ti@open@single #1\ti@close@single@suck}%
131  \fi
132  \sc@t@a
133  \endgroup

134 }% 135 }

136 \newcommand*\ti@wrapquotes@nosuck [1] {%
137 \begingroup
138  \if@doublequotes@
139 %      \DTypeout{double true in nosuck}%
140  \@doublequotes@false
141  \def\sc@t@a {\ti@open@double #1\ti@close@double@nosuck}%
142  \else
143 %      \DTypeout{double false in nosuck}%
144  \@doublequotes@true
145  \def\sc@t@a {\ti@open@single #1\ti@close@single@nosuck}%
146  \fi
147  \sc@t@a
148 \endgroup

149 }

\WrapquotesNS \WrapquotesIS \WrapquotesNN \WrapquotesIN \Wrapquotes \if@doublequotes@ \@doublequotes@true \@doublequotes@false Now we can define some secondary programmers’ macros. In the two-letter suffix,

first letter N means “normal” as opposed to I for “inverse.” An inverse wrapquotes wraps with single quotes when a normal wrapquotes would wrap with double quotes, and vice versa. Second letter S means suck a following period or comma into the closing quote, and N means “nosuck,” that is, don’t suck.

The command \Wrapquotes should be \let to one of the four \Wrapquotes?? macros. WARNING FIX: user commands must be \let to one of these four macros (it’s OK to \let them to something like \Wrapquotes which itself has been \let to one of these. In other words, you cannot use a \def command of any kind! Put this warning up above with the one I already wrote. And here too.

We simply reserve \Wrapquotes here, and assign it in the user options section above.

150 \newboolean{@doublequotes@}
151 \newcommand*\WrapquotesNS {%
152 %  \DTypeout{starting wrapquotes NS}%
153 \ti@wrapquotes@suck

154 }

155 \newcommand*\WrapquotesIS {%
156 %  \DTypeout{starting wrapquotes IS}%
157 \ToggleBoolean{@doublequotes@}%
158 \ti@wrapquotes@suck

159 }

160 \newcommand*\WrapquotesNN {%
161 %  \DTypeout{starting wrapquotes NN}%
162 \ti@wrapquotes@nosuck

163 }

164 \newcommand*\WrapquotesIN {%
165 %  \DTypeout{starting wrapquotes IN}%
166 \ToggleBoolean{@doublequotes@}%
167 \ti@wrapquotes@nosuck

168 }

169 \ReserveCS\Wrapquotes
170 \ti@domelater

9.3 Opening quotes

\ti@open@double \ti@open@single \ti@openquote We start by putting an opening mark in scratch f with a global definition.

I can’t remember why it’s global. In the macros that close quotes, we want to keep that information around past a group end because we’re using \aftergroup, but that doesn’t seem to apply for opening them. Best not to change what’s not broke, however.

171 \newcommand\ti@open@double {%
172 \gdef\sc@t@f {``}%                           '' for Emacs
173 \ti@openquote

174 }

175 \newcommand\ti@open@single {%
176 \gdef\sc@t@f {`}%
177 \ti@openquote

178 }

Then we look ahead with scratch a. We are looking ahead at the first character of the contents of the \Wrapquotes.

179 \newcommand\ti@openquote {%
180 \futurelet\sc@t@a\ti@@openquote

181 }

Insert the opening mark. Then, if we are about to open another quote, insert the space appropriate to separate contiguous quotation marks.

182 \newcommand\ti@@openquote {%
183 \sc@t@f
184 \ifx\sc@t@a\WrapquotesNS
185 %    \DTypeout{Quotation marks are doubled up (next is NS); inserting padding.}%
186  \,%
187 \else \ifx\sc@t@a\WrapquotesNN
188 %    \DTypeout{Quotation marks are doubled up (next is NN); inserting padding.}%
189  \,%
190 \else \ifx\sc@t@a\WrapquotesIN
191 %    \DTypeout{Quotation marks are doubled up (next is IN); inserting padding.}%
192  \,%
193 \else \ifx\sc@t@a\WrapquotesIS
194 %    \DTypeout{Quotation marks are doubled up (next is IS); inserting padding.}%
195  \,%

196 \else
197 %    \DTypeout{Just plain opening.  F=[\meaning\sc@t@f]}%
198 \fi \fi \fi \fi

199 }

9.4 Closing macros that don’t suck

This case that doesn’t suck is easier, so we warm up with it.

\ti@close@single@nosuck
\ti@close@double@nosuck
\ti@close@single@@nosuck
\ti@close@double@@nosuck

200 \newcommand*\ti@close@single@nosuck {%
201 \aftergroup\ti@close@single@@nosuck

202 }

203 \newcommand*\ti@close@double@nosuck {%
204 \aftergroup\ti@close@double@@nosuck

205 }

206 \newcommand*\ti@close@single@@nosuck {%
207 \gdef\sc@t@f {'}%
208 \ti@close@quote@nosuck

209 }

210 \newcommand*\ti@close@double@@nosuck {%
211 \gdef\sc@t@f {''}%
212 \ti@close@quote@nosuck

213 }

\ti@close@quote@nosuck \if@look@nosuck@ \@look@nosuck@true \@look@nosuck@false To do: Document this flag. It’s a hack, we must set it before each call to \ti@

q@ifnextcharin I think. What it stands for is something like the presence of the

 tokens \ti@close@single@nosuck and \ti@close@double@nosuck in the list

of chars to look for, but since they aren’t really chars they can’t go in the list, so instead we set the flag. Somewhat cleaner would be putting a flag char in the list, but I can’t think of what char I could safely use.

214 \newboolean{@look@nosuck@}
215 \@look@nosuck@false
216 \newcommand\ti@close@quote@nosuck {%
217 %  \DTypeout{Starting ti@close@quote@nosuck}%
218 \@look@nosuck@true
219 \ti@q@ifnextcharin {.,;?:!-)]'\bgroup} {%
220 %      \DTypeout{Found a nosuck no-spacer.  C=[\meaning\sc@t@c] F=[\meaning\sc@t@f]}%
221  \sc@t@f
222  }{% ELSE
223 %      \DTypeout{Found a nosuck spacer. C=[\meaning\sc@t@c] F=[\meaning\sc@t@f]}%
224  \sc@t@f\space

225 }% 226 }

9.5 Closing macros that suck

\ti@close@double@suck \ti@close@single@suck We need to look ahead beyond the \endgroup that ends \Wrapquotes??. The

lookahead mechanism that gets invoked in scratch a below could handle looking past the \endgroup, but I think it is more efficient to skip it by using \aftergroup.

227 \newcommand\ti@close@double@suck {%
228 \aftergroup\ti@close@double@@suck

229 }

230 \newcommand\ti@close@single@suck {%
231 \aftergroup\ti@close@single@@suck

232 }

\ti@close@double@@suck \ti@close@single@@suck This part isn’t so bad yet. To close the quotes, we again start with the closing mark in scratch f, with a global definition.

233 \newcommand\ti@close@double@@suck {%
234 \gdef\sc@t@f {''}%
235 \ti@close@quote@suck

236 }

237 \newcommand\ti@close@single@@suck {%
238 \gdef\sc@t@f {'}%
239 \ti@close@quote@suck

240 }

\ti@close@quote@suck Then we use \ti@q@ifnextcharin to look as far ahead as necessary for a significant character. The latest significant character found is available in scratch c. The work of handling all the cases of what we might find while looking ahead

is divided up between \ti@close@quote@suck and \ti@q@ifnextcharin. \ti@
close@quote@suck handles the last step in the process, and \ti@q@ifnextcharin

handles all the steps up to the last.

Here is what \ti@close@quote@suck does, in English. If we find a comma or period, we put it inside the closing quote, and gobble the one we found. That is, we print out scratch c, then scratch f, then gobble a character. If we find something in the set ;?:!-)]}, do not leave a space after the closing mark. That is, just print out scratch f. If we find something else, we leave a space after the closing mark. That is, print scratch f and a space.

241 \newcommand\ti@close@quote@suck {%
242 %  \DTypeout{Starting ti@close@quote@suck}%
243 \@look@nosuck@false
244 \ti@q@ifnextcharin {.,} {%
245 %      \DTypeout{Found a comma or period. C=[\meaning\sc@t@c] F=[\meaning\sc@t@f]}%
246  \sc@t@c\sc@t@f\DGobbleM % This gobbles the original punctuation.
247  }{% ELSE
248 %    \DTypeout {Before second ti@qifnextcharin.  C=[\meaning\sc@t@c] F=[\meaning\sc@t@f]}%
249  \@look@nosuck@true
250  \ti@q@ifnextcharin {;?:!-)]'\bgroup} {%
251 %        \DTypeout{Found a suck no-spacer.  C=[\meaning\sc@t@c] F=[\meaning\sc@t@f]}%
252  \sc@t@f
253  }{% ELSE
254 %      \DTypeout{Found a suck spacer. C=[\meaning\sc@t@c] F=[\meaning\sc@t@f]}%
255  \sc@t@f\space

256 }% 257 }% 258 }

9.6 Looking ahead

Now things are getting fun.

\ti@q@ifnextcharin \ti@q@check \ti@q@ifnch \ti@q@@ifnch These macros are modeled after the definition of \@ifnextchar which skips spaces.

While looking ahead for the next significant character, these macros skip spaces,

\egroup, \endgroup, \check@icr, \ti@close@double and \ti@close@single

while doing the right thing after each.

The first argument should expand to a list of chars. If the next significant char is in the list, then the true clause is executed, otherwise the false clause is executed. The next significant char is left in scratch c so it can be accessed by the clauses.

The three arguments to \ti@q@ifnextcharin are saved in global variables because while looking ahead we must continue past the ends of groups.

259 \newcommand\ti@q@ifnextcharin [3] {% args: charlist true false
260 \xdef\sc@t@e {#1}%
261 \gdef\sc@t@a {#2}%
262 \gdef\sc@t@b {#3}%
263 \ti@q@check

264 }

Having saved the arguments, we look ahead with scratch c. This step is not in the macro above so that we can jump back to \ti@q@check whenever we want to look ahead another character.

265 \newcommand\ti@q@check {%
266 \futurelet\sc@t@c\ti@q@ifnch

267 }

Scratch c contains the current char. Scratch d is the action to take at the end of this macro. We attempt to order these possibilities to make \Wrapquotes most efficient, though it is a guess which items will be encountered most frequently.

First we have to handle the case of finding an \ifvmode. We can’t bundle this test in with the tests for other tokens, so it gets its own macro, \ti@q@handle@ ifvmode, which see for details. The remaining cases are handled in \ti@q@@ifnch.

The actions taken for each of the possibilities are the following:

\ifvmode Assume that the \Wrapquotes was the argument of a \TextFontCommand

from certain L^{A}TEX kernels. Gobble three more tokens expected to follow the \ifvmode, execute them, and continue on to look ahead another character. See documentation of \ti@q@handle@ifvmode for more details.

\check@icr This means the \Wrapquotes was the argument of a \TextFontCommand.

Gobble the \check@icr and look ahead another character after we exit the group that the \TextFontCommand has given us.

\endgroup and } Pass right by an \endgroup or } and look ahead another char.

\@sptoken (a space) Handle a space by calling \ti@q@handle@space, which gobbles the space and looks ahead another char.

 \ti@close@double@suck, \ti@close@single@suck
 \ti@close@double@nosuck, and \ti@close@single@nosuck We are in a nested
      \Wrapquotes. Call \ti@q@handle@single/double@suck/nosuck as appro-

priate, which gobbles the closequotes token, adds properly-padded closing quotes to scratch f, and then goes on to look ahead another character.

The lookahead process stops when it finds something not on this list. Then it compares what it found to the list of characters given to \ti@q@ifnextcharin and executes the true or false clause as appropriate.

268 \newcommand\ti@q@ifnch {%
269 %  \DTypeout{The lookahead in ti@q@ifnch: [\meaning\sc@t@c]}%
270 \ifx\sc@t@c\ifvmode
271  \let\sc@t@d\ti@q@handle@ifvmode
272 \else
273  \let\sc@t@d\ti@q@@ifnch
274 \fi
275 \sc@t@d

276 }

277 \newcommand\ti@q@@ifnch {%
278 \expandafter\sc@toks@a\expandafter{\sc@t@c}%
279 %  \DTypeout{entering ti@q@@ifnch C expanded once is =[\the\sc@toks@a]}%
280 \ifx\sc@t@c\check@icr
281 %    \DTypeout{Handling check@icr}%
282  \defcommand\sc@t@d [1] {%
283 %      \DTypeout{check@icr handler: gobbling [\meaning ##1]}%
284  ##1\aftergroup\ti@q@check

285 }%

286 \else \ifx\sc@t@c\endgroup
287 %    \DTypeout{Handling endgroup}%
288  \def\sc@t@d {\aftergroup\ti@q@check}%
289 \else \ifx\sc@t@c\@sptoken
290 %    \DTypeout{Handling space}%
291  \let\sc@t@d\ti@q@handle@space
292 \else \ifx\sc@t@c\egroup
293 %    \DTypeout{Handling egroup}%
294  \def\sc@t@d {\aftergroup\ti@q@check}%
295 \else \ifx\sc@t@c\ti@close@double@suck
296 %    \DTypeout{Handling ti@close@double@suck}%
297  \let\sc@t@d\ti@q@handle@double@suck
298 \else \ifx\sc@t@c\ti@close@single@suck
299 %    \DTypeout{Handling ti@close@single@suck}%
300  \let\sc@t@d\ti@q@handle@single@suck
301 \else \ifx\sc@t@c\ti@close@double@nosuck
302 %    \DTypeout{Handling ti@close@double@nosuck}%
303  \let\sc@t@d\ti@q@handle@double@nosuck
304 \else \ifx\sc@t@c\ti@close@single@nosuck
305 %    \DTypeout{Handling ti@close@single@nosuck}%
306  \let\sc@t@d\ti@q@handle@single@nosuck
307 \else

We’ve handled all the lookahead cases, so now we are left with the simple comparison of the next char with the charlist.

308  \@tempswafalse
309  \expandafter   \@tfor
310 \expandafter \sc@t@g
311 \expandafter :%
312 \expandafter =%
313  \sc@t@e
314  \do {%
315 \expandafter\ifx\sc@t@g\sc@t@c
316 %                  \DTypeout{We have a match of [\meaning\sc@t@c]
317 %                           with [\expandafter\meaning\sc@t@g]}%
318  \@tempswatrue
319  \@break@tfor
320  \else
321 %                  \DTypeout{We have NO match between [\meaning\sc@t@c]
322 %                           with [\meaning\sc@t@g]}%
323  \fi

324 }%

325  \if@tempswa
326 %                \DTypeout{Choosing true clause [\meaning\sc@t@a]}%
327  \let\sc@t@d\sc@t@a % the ``true'' clause
328  \else
329 %                \DTypeout{Choosing false clause [\meaning\sc@t@b]}%
330  \let\sc@t@d\sc@t@b % the ``false'' clause
331  \fi
332 \fi \fi \fi \fi \fi \fi \fi \fi
333 %  \DTypeout{About to fall out of ti@q@@ifnch and do this [\meaning\sc@t@d]}%
334 \sc@t@d

335 }

\ti@q@handle@ifvmode This is in its own macro for clarity and to avoid problems with skipping over

clauses.

\ti@q@ifnch has to take two different kinds of L^{A}TEX kernel into account. The 1996/12/01 and 1997/06/01 kernels used a different definition of

 \DeclareTextFontCommand:
336 %\def \DeclareTextFontCommand #1#2{%
337 %  \DeclareRobustCommand#1[1] {%
338 %    \ifmmode
339 %      \nfss@text{#2##1}%
340 %    \else
341 %      \leavevmode
342 %      {\text@command{##1}%
343 %       #2\check@icl ##1\ifvmode\else\check@icr\fi
344 %       \expandafter}%
345 %    \fi
346 %  }%

347 %}

All other kernels leave out the check for vertical mode (kernels from 1997/12/01 include it when necessary inside \check@icr). The macro \ti@q@ifnch, which will be called immediately before this point of difference, handles both cases by looking for both \ifvmode and \check@icr. For the history, see L^{A}TEX bug report 2646.

The check for \ifvmode must not be part of a nested conditional. TEX can’t match \ifs with \fis properly when you nest tests for \if-type tokens. See p. 211 of the TEXbook.

When we encounter an \ifvmode, we must assume we are inside a TextFont-Command declared by one of the two kernel versions mentioned above. If not, we are in an unknown situation and we will bomb. Since the error message in this case won’t be helpful, we warn the user in the log file. We use scratch d to gobble both the \ifvmode and what we expect will follow the \ifvmode, namely \else\check@icr\fi. After swallowing those, we reissue those same commands and then proceed with our lookahead. We want to issue those commands, which conditionally introduce an italic correction, before looking further ahead.

348 \newcommand\ti@q@handle@ifvmode {%
349 %  \DTypeout{Handling ifvmode}%
350 \FrankenInfo{titles}
351  {Handling an \string\ifvmode\space following a title.\MessageBreak
352  If you now get an error that \string\sc@t@d\space does not\MessageBreak
353  match its definition, this \string\ifvmode\space is\MessageBreak
354  unexpected}%
355 \DefName{sc@t@d} {\ifvmode\else\check@icr\fi} {%
356  \ifvmode
357  \else
358  \check@icr
359  \fi
360  \aftergroup\ti@q@check

361 }%

362 \sc@t@d

363 }

\ti@q@handle@space Handle the case of a following space: gobble the space and call \ti@q@check.

This little bit of trickery sneaks a space in as the \def template, thereby causing a space following \ti@q@handle@space to get gobbled. We use the control character \: and restore its value.

364 \ReserveCS\ti@q@handle@space
365 \let\sc@t@a\:
366 \def\:{\ti@q@handle@space} \expandafter\def\: {\ti@q@check}
367 \let\:\sc@t@a

\ti@q@handle@single@suck \ti@q@handle@double@suck Handle the single and double sucking cases: gobble the closequotes token with a \def template, add some stuff to scratch f and call \ti@q@check. These are put in their own macros only to avoid clutter above.

368 \newcommand*\ti@q@handle@double@suck [1] {%
369 %  \DTypeout{handle double suck: gobbling [\meaning#1]}%
370 %  \DTypeout{scratch f before: [\meaning\sc@t@f]}%
371 \g@addto@macro\sc@t@f {\,''}%

372 %  \DTypeout{scratch f after: [\meaning\sc@t@f]}%
373 \ti@q@check

374 }

375 \newcommand*\ti@q@handle@single@suck [1] {%
376 %  \DTypeout{handle single suck: gobbling [\meaning#1]}%
377 %  \DTypeout{scratch f before: [\meaning\sc@t@f]}%
378 \g@addto@macro\sc@t@f {\,'}%
379 %  \DTypeout{scratch f after: [\meaning\sc@t@f]}%
380 \ti@q@check

381 }

\ti@q@handle@single@nosuck \ti@q@handle@double@nosuck Handle the single and double nosucking cases. Add inter-quote space to scratch f and exit \ti@q@@ifnch with true or false depending on whether we were looking for it. We had to do it this way instead of the normal \if test above at the end

 of \ti@q@@ifnch because \ti@close@double@nosuck is more than one character

long.

382 \newcommand*\ti@q@handle@double@nosuck [1] {%
383 % \DTypeout{handle double nosuck: gobbling [\meaning#1]}%
384 \if@look@nosuck@
385 %      \DTypeout{And we're looking for \string\ti@close@double@nosuck.}%
386  \g@addto@macro\sc@t@f {\,''}%
387 %      \DTypeout{After adding padding, F=[\meaning\sc@t@f]}%
388  \let\sc@t@d\sc@t@a % the ``true'' clause of ti@q@ifnextcharin
389 \else
390 %    \DTypeout{But we're not looking for \string\ti@close@double@nosuck.}%
391 %    \DTypeout{F is unchanged, F=[\meaning\sc@t@f]}%
392  \let\sc@t@d\sc@t@b % the ``false'' clause of ti@q@ifnextcharin
393 \fi
394 \ti@q@check

395 }

396 \newcommand*\ti@q@handle@single@nosuck [1] {%
397 % \DTypeout{handle single nosuck: gobbling [\meaning#1]}%
398 \if@look@nosuck@
399 %      \DTypeout{And we're looking for \string\ti@close@single@nosuck.}%
400  \g@addto@macro\sc@t@f {\,'}%
401 %      \DTypeout{After adding padding, F=[\meaning\sc@t@f]}%
402  \let\sc@t@d\sc@t@a % the ``true'' clause of ti@q@ifnextcharin
403 \else
404 %    \DTypeout{But we're not looking for \string\ti@close@single@nosuck.}%
405 %    \DTypeout{F is unchanged, F=[\meaning\sc@t@f]}%
406  \let\sc@t@d\sc@t@b % the ``false'' clause of ti@q@ifnextcharin
407 \fi
408 \ti@q@check

409 }

10 Titles

\booktitle
\journaltitle
\musictitle
\articletitle
\storytitle
\poemtitle
\playtitle
\crafttitle

21

410 \newlet\booktitle\textitswitch
411 \newlet\journaltitle\textitswitch
412 \newlet\musictitle\textitswitch
413 \newlet\articletitle\Wrapquotes
414 \newlet\storytitle\Wrapquotes
415 \newlet\poemtitle\Wrapquotes
416 \newlet\playtitle\Wrapquotes
417 \newlet\crafttitle\textitswitch

Part III

Configuration

User alterations and additions and package testing are in a configuration file.

1 \InputIfFileExists{titles.cfg}{}{}

The contents of the distributed configuration file are below.

2 \def\fileinfo{titles package configuration}
3 \def\fileversion{v1.3}
4 \def\filedate{1999/03/01}
5 \def\docdate{1999/03/01}
6 \ProvidesFile{titles.cfg}

11 User Customization

Put your own alterations and additions here. For example.

7 % \let\word\textslswitch

Part IV

Testing

11.1 Question and exclamation marks

Test string: [ Title ] Result: Declarative Test string: [ Title? ] Result: Question or Exclamation Test string: [ Title! ] Result: Question or Exclamation Test string: [ Title?? ] Result: Question or Exclamation Test string: [ Title!! ] Result: Question or Exclamation Test string: [ Title? Title ] Result: Declarative Test string: [ Title! Title ] Result: Declarative Test string: [ Title!? ] Result: Question or Exclamation Test string: [ Title?! ] Result: Question or Exclamation Test string: [ Title? Title? ] Result: Question or Exclamation Test string: [ Title? Title! ] Result: Question or Exclamation Test string: [ Title! Title? ] Result: Question or Exclamation Test string: [ Title?? Title ] Result: Declarative Test string: [ Title!! Title ] Result: Declarative

11.2 Plain

Book Title. Test. Book Title, test. Book Title; test. Book Title test. “Play Title.” Test. “Play Title,” test. “Play Title”; test. “Play Title” test.

11.3 Nested beginnings

Book Title begins first book title and outside. Book Title, begins first book title, and outside. Book Title. begins first book title. and outside. Book Title; begins first book title; and outside. “Play Title” begins first book title and outside. “Play Title,” begins first book title, and outside. “Play Title.” begins first book title. and outside. “Play Title”; begins first book title; and outside. “Book Title begins first play title” and outside. “Book Title, begins first play title,” and outside. “Book Title. begins first play title.” and outside. “Book Title; begins first play title”; and outside.

“ ‘Play Title’ begins first play title” and outside. “ ‘Play Title,’ begins first play title,” and outside. “ ‘Play Title.’ begins first play title.” and outside. “ ‘Play Title’; begins first play title”; and outside.

11.4 Nested endings

There are too many cases I think to test them all. I’m testing to three levels of nesting. This is a Book Title including Book Title including Book Title and ending first one and outside. This is a Book Title including Book Title including Book Title, and ending first one, and outside. This is a Book Title including Book Title including Book Title. and ending first one. and outside. This is a Book Title including Book Title including Book Title; and ending first one; and outside. This is a Book Title including Book Title including “Play Title” and ending first one and outside. This is a Book Title including Book Title including “Play Title,” and ending first one, and outside. This is a Book Title including Book Title including “Play Title.” and ending first one. and outside. This is a Book Title including Book Title including “Play Title”; and ending first one; and outside. This is a Book Title including “Play Title including Book Title” and ending first one and outside. This is a Book Title including “Play Title including Book Title,” and ending first one, and outside. This is a Book Title including “Play Title including Book Title.” and ending first one. and outside. This is a Book Title including “Play Title including Book Title”; and ending first one; and outside. This is a Book Title including “Play Title including ‘Play Title’ ” and ending first one and outside. This is a Book Title including “Play Title including ‘Play Title,’ ” and ending first one, and outside. This is a Book Title including “Play Title including ‘Play Title.’ ” and ending first one. and outside. This is a Book Title including “Play Title including ‘Play Title’ ”; and ending first one; and outside. This is a “Play Title including ‘Play Title including “Play Title” ’ and ending first one” and outside. This is a “Play Title including ‘Play Title including “Play Title,” ’ and ending first one,” and outside.

This is a “Play Title including ‘Play Title including “Play Title.” ’ and ending first one.” and outside. This is a “Play Title including ‘Play Title including “Play Title” ’; and ending first one”; and outside. This is a “Play Title including ‘Play Title including Book Title’ and ending first one” and outside. This is a “Play Title including ‘Play Title including Book Title,’ and ending first one,” and outside. This is a “Play Title including ‘Play Title including Book Title.’ and ending first one.” and outside. This is a “Play Title including ‘Play Title including Book Title’; and ending first one”; and outside. This is a “Play Title including Book Title including ‘Play Title’ and ending first one” and outside. This is a “Play Title including Book Title including ‘Play Title,’ and ending first one,” and outside. This is a “Play Title including Book Title including ‘Play Title.’ and ending first one.” and outside. This is a “Play Title including Book Title including ‘Play Title’; and ending first one”; and outside. This is a “Play Title including Book Title including Book Title and ending first one” and outside. This is a “Play Title including Book Title including Book Title, and ending first one,” and outside. This is a “Play Title including Book Title including Book Title. and ending first one.” and outside. This is a “Play Title including Book Title including Book Title; and ending first one”; and outside.

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

\, 186, 189, 192, 195,

371, 378, 386, 400 \: . . . . . . . . . . 365–367 \@ . . . . . . . . . . . . . . 45

\@break@tfor . . . . . . 319
\@doublequotes@false

. 28, 125, 140, \underline{150}

\@doublequotes@true

. 34, 129, 144, \underline{150}

\@firstoftwo . . . . . . 54
\@ifundefined . . . . . 10
\@look@nosuck@false

. . . . . . . . \underline{214}, 243

\@look@nosuck@true .

. . . . . . . . \underline{214}, 249 \@nil …. 51, 52, 62,

79, 82, 89, 106, 109

\@secondoftwo . . . . . 56

\@sptoken . . . . . . . . 289

\@tempswafalse . 50, 308
\@tempswatrue . . . . .

68, 84, 95, 111, 318 \@tfor . . . . . . . . . . . 309

\@ti@sw@false . . . . . \underline{49}
\@ti@sw@true . . . . . . \underline{49}

\@whilesw . . . . . 73, 100

A

\aftergroup . . . 201,

204, 228, 231, 284, 288, 294, 360

\articletitle . . . 4, \underline{410}

B

\begingroup . . . 122, 137

\bgroup . . . . . . 219, 250

\booktitle . . . . . 3, \underline{410}

C

\check@icl . . . . . . . 343
\check@icr . . . . . . .

. 280, 343, 355, 358

\crafttitle . . . . . 4, \underline{410}

\csname . . . . . . . . . . 14

D

                          \DeclareOption . . 25, 31
                          \DeclareRobustCommand

. . . . . . . . . . . 337

                          \DeclareTextFontCommand

. . . . . . . . . . . 336 \def . 1–5, 26, 32, 63,

64, 90, 91, 126, 130, 141, 145, 288, 294, 336, 366

                          \defcommand . . . . . . . 282

\defn . . . . . . . . . . . 3, \underline{39} \DefName . . . . . . . . . 355 \DGobbleM . . . . . . . . 246 \do . . . . . . . . . . . . . 314 \docdate . . . . . . . . \underline{1}, 5

                          \DoXPackageS . . . . . . . 2
                          \DoXUsepackagE . . . . . \underline{1}
                          \DTypeout . . . . 117,

121, 124, 128, 139, 143, 152, 156, 161, 165, 185, 188, 191, 194, 197, 217, 220, 223, 242, 245, 248, 251, 254, 269, 279, 281, 283, 287, 290, 293, 296, 299, 302, 305, 316, 321, 326, 329, 333, 349, 369, 370, 372, 376, 377, 379, 383, 385, 387, 390, 391, 397, 399, 401, 404, 405

E \E@car . . . . . . . . 82, 109 \E@cdr . . . . . . . . 79, 106 \edef . 6, 79, 82, 106, 109 \eExpand . . . . . . . . . 14 \egroup . . . . . . . . . . 292 \else . 55, 66, 69, 76,

93, 96, 103, 127, 142, 187, 190, 193, 196, 272, 286, 289, 292, 295, 298, 301, 304, 307, 320, 328, 340, 343, 355, 357, 389, 403

                                                   \endcsname . . . . . . . 14

\endgroup . 133, 148, 286 \endinput . . . . . . . . 19

                                                   \ExecuteOptions . . . 37
                                                   \expandafter . 54, 56,

278, 309–312, 315, 317, 344, 366

F \fi . . . . . . . . 57, 73,

80, 85–87, 100, 107, 112–114, 131, 146, 198, 274, 323, 331, 332, 343, 345, 355, 359, 393, 407

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

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

\foreign . . . . . . . . 2, \underline{39}

                                                   \foreignword . . . . . 2, \underline{39}
                                                   \FrankenInfo . . . . . . 350
                                                   \futurelet . . . 180, 266

G

                                                   \g@addto@macro . . . .

. 371, 378, 386, 400 \gdef . . . . . . . . 172,

176, 207, 211, 234, 238, 261, 262

H

                                                   \HaveECitationS . . . . \underline{1}

\if@doublequotes@ .

…. 123, 138, \underline{150}

\if@look@nosuck@ . .

…. \underline{214}, 384, 398

\if@tempswa . . . . 53, 325
\if@ti@sw@ . . . . . . . \underline{49}

\ifmmode . . . . . . . . . 338

\IfQuestionOrExclamation

. . . . . . . 6, \underline{49}, 118 \ifvmode . . 270, 343,

351, 353, 355, 356 \ifx . . . . . . . . 65, 67,

74, 83, 92, 94, 101, 110, 184, 187, 190, 193, 270, 280, 286, 289, 292, 295, 298, 301, 304, 315

\In . . . . . . . . . . . . . 14

\InputIfFileExists . . 1

J

\journaltitle . . . 3, \underline{410}
\JusTLoaDInformatioN 12

L

\leavevmode . . . . . . . 341

\let . . . . . . . . 7, 27, 33, 70, 71, 77, 78, 97, 98, 104, 105, 271, 273, 291, 297, 300, 303, 306, 327, 330, 365, 367, 388, 392, 402, 406

M

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

\meaning 197, 220, 223, 245, 248, 251, 254, 269, 283, 316, 317, 321, 322, 326, 329, 333, 369, 370, 372, 376, 377, 379, 383, 387, 391, 397, 401, 405

\MessageBreak . 351–353

\musictitle . . . . . 3, \underline{410}

N

\NeedsTeXFormat . . . 21
\newboolean 59, 150, 214
\newcommand . . . . . . .

41, 44, 49, 116, 136, 151, 155, 160, 164, 171, 175, 179, 182, 200, 203, 206, 210, 216, 227, 230, 233, 237, 241, 259, 265, 268, 277, 348, 368, 375, 382, 396

\newlet . . . . . . . 39,

40, 47, 48, 410–417 \NewName . . . . . . . 62, 89

\nfss@text . . . . . . . 339

P

\phrase . . . . . . . . . 2, \underline{39}

\playtitle . . . . . 4, \underline{410}
\poemtitle . . . . . 4, \underline{410}

\PPOptArg . . . . . . . \underline{1}, 22

\ProcessOptions . . . 38
\ProvidesFile . . . . . . 6
\ProvidesPackage . . 22

R

\RequirePackage . . . 23
\ReserveCS . . . . . . .

24, 60, 61, 169, 364

\RestoreDoXVarS . . . 17

S

\SaveDoXVarS . . . . . . 13

\sc@t@a . . 63, 65, 67, 70, 71, 74, 78, 79, 90, 92, 94, 97, 98, 101, 105, 106, 126, 130, 132, 141, 145, 147, 180, 184, 187, 190, 193, 261, 326, 327, 365, 367, 388, 402

\sc@t@b . . 64, 67, 83, 91, 94, 110, 262, 329, 330, 392, 406 \sc@t@c 220, 223, 245,

246, 248, 251, 254, 266, 269, 270, 278, 280, 286, 289, 292, 295, 298, 301, 304, 315, 316, 321

\sc@t@d … 271, 273, 275, 282, 288, 291, 294, 297, 300, 303, 306, 327, 330, 333, 334, 352, 362, 388, 392, 402, 406

\sc@t@e . . . . . . 260, 313 \sc@t@f . . . . . . 172,

176, 183, 197, 207, 211, 220, 221, 223, 224, 234, 238, 245, 246, 248, 251, 252, 254, 255, 370–372, 377– 379, 386, 387, 391, 400, 401, 405

\sc@t@g 310, 315, 317, 322

\sc@toks@a . . . 278, 279
\ShortEmpty . . . . . . .

… 65, 74, 92, 101 \space . . . . . . . . . 7,

224, 255, 351–353

\storytitle . . . . . . . \underline{410}

\string … 351–353, 385, 390, 399, 404

T

\term . . . . . . . . . . . 3, \underline{39}

\text@command . . . . . 342
\textitswitch . . 39,

40, 47, 410–412, 417

\textslswitch . . . . 7, 48

\the . . . . . . . . . . . . . 279

\ti@@openquote 180, 182
\ti@checkfor@e . . . . \underline{49}
\ti@checkfor@q . . . . \underline{49}
\ti@close@double@@nosuck

. . . . . . . . . . . \underline{200}

\ti@close@double@@suck

. . . . . . . . 228, \underline{233}

\ti@close@double@nosuck

. . . . . . . . 141, \underline{200}, 301, 385, 390

\ti@close@double@suck

…. 126, \underline{227}, 295

\ti@close@quote@nosuck

…. 208, 212, \underline{214}

\ti@close@quote@suck

…. 235, 239, \underline{241}

\ti@close@single@@nosuck

. . . . . . . . . . . \underline{200}

\ti@close@single@@suck

. . . . . . . . 231, \underline{233}

\ti@close@single@nosuck

. . . . . . . . 145, \underline{200}, 304, 399, 404

\ti@close@single@suck

…. 130, \underline{227}, 298

\ti@domelater . . \underline{24}, 170
\ti@open@double . . .

…. 126, 141, \underline{171}

\ti@open@single . . .

…. 130, 145, \underline{171}

\ti@openquote . . . . . \underline{171}

\ti@prev . . . . . . . . . \underline{49}

\ti@prev@prev . . . . . \underline{49}
\ti@q@@ifnch . . . . . . \underline{259}
\ti@q@check . . . . . . .

. \underline{259}, 360, 366, 373, 380, 394, 408

\ti@q@handle@double@nosuck

. . . . . . . . 303, \underline{382}

\ti@q@handle@double@suck

. . . . . . . . 297, \underline{368}

\ti@q@handle@ifvmode

. . . . . . . . 271, \underline{336}

\ti@q@handle@single@nosuck

. . . . . . . . 306, \underline{382}

\ti@q@handle@single@suck

. . . . . . . . 300, \underline{368}

\ti@q@handle@space .

. . . . . . . . 291, \underline{364}

\ti@q@ifnch . . . . . . . \underline{259}
\ti@q@ifnextcharin .

. 219, 244, 250, \underline{259}

                          \ti@wrapquotes@nosuck

…. \underline{116}, 162, 167

                          \ti@wrapquotes@suck

…. \underline{116}, 153, 158

                          \ToggleBoolean 157, 166

U

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

W \word . . . . . . . . . 2, 7, \underline{39}

                          \Wrapquotes . . . . . 6,

27, 33, \underline{150}, 413–416

                          \WrapquotesIN 6, \underline{150}, 190
                          \WrapquotesIS 6, \underline{150}, 193
                          \WrapquotesNN . . . . .

… 6, 27, \underline{150}, 187

                          \WrapquotesNS . . . . .

… 6, 33, \underline{150}, 184

X \xdef . . . . . . . . . . . . 260