The lips package

Chicago Manual text ellipses (Frankenstein’s lips)

                 Matt Swift <swift@bu.edu>

Version: v1.2 Documentation revision: 1996/09/04

Abstract

The \lips command generates text ellipses that are closer to what The Chicago Manual suggests than what \dots produces.

Part I

Discussion

\lips The macro \lips should be used for all text ellipses, that is, those that are not

part of a mathematical expression.

The Chicago Manual does not acknowledge different spacings after different marks of punctuation, distinguish interword from intersentence space, or give rules about where to break a line near an ellipsis. Given a context where such spaces do vary and rules for linebreaks can be given, I arrived at the following rules for handling them around ellipses.

1. Pre-, post-, and intra-ellipsis space is normal intra-word space, which should be 3-to-em.

2. When non-period punctuation p follows \lips, p is followed by the space that normally follows it.

3. A period following \lips is treated as if the period preceded \lips. Conceptually, an ellipsis never precedes a period, so conceptually there is only one case, and it is convenient to be able to type either \lips. or .\lips.

4. Lines are a tiny bit breakable before ellipses, and a tiny bit breakable after ellipses that are not followed by punctuation.

Here are examples of correct usage and a comparison with \dots. You can substitute ‘?’, ‘.’, ‘:’, ‘,’ or ‘:’ for the exclamation point. There can be additional spaces after \lips, just like after any command name.

source  result

Hello\lips.␣And  Hello. . . . And
Hello␣\lips.␣And Hello. . . . And
Hello.\lips␣And  Hello. . . . And
Hello.␣\lips␣And Hello. . . . And
one,\lips,␣three one, . . . , three
one,␣\lips,␣three one, . . . , three
Hello\lips␣and  Hello . . . and
Hello␣\lips␣and  Hello . . . and
Hello!\lips␣And  Hello! . . . And
Hello!␣\lips␣And Hello! . . . And

source  result

Hello\dots.␣And  Hello. . . . And
Hello\lips.␣And  Hello. . . . And
Hello␣\dots.␣And Hello . . . . And
Hello␣\lips.␣And Hello. . . . And
Hello.\dots␣And  Hello.. . . And
Hello.\lips␣And  Hello. . . . And
Hello.␣\dots␣And Hello. . . . And
Hello.␣\lips␣And Hello. . . . And
one,\dots,␣three one,. . . , three
one,\lips,␣three one, . . . , three
one,␣\dots,␣three one, . . . , three
one,␣\lips,␣three one, . . . , three

Hello\dots␣and     Hello. . . and

Hello\lips␣and  Hello . . . and

Hello␣\dots␣and    Hello . . . and

Hello␣\lips␣and  Hello . . . and
Hello!\dots␣And  Hello!. . . And
Hello!\lips␣And  Hello! . . . And
Hello!␣\dots␣And Hello! . . . And
Hello!␣\lips␣And Hello! . . . And

Warning: Notice that \lips does the right thing after \par, but after \indent or \noindent there is an extra preceding space. Suggestions on how to handle this problem are welcome.

. . . and (\par \lips and)
and (\par and)
. . . (\par\indent \lips and)
and (\par\indent and)
. . . and (\par\noindent \lips and)
and (\par\noindent and)

And. …

(\par And.\lips \par)

And.

(\par And. \par)

The examples above are inside a quotation environment. They need testing outside of this also, so we repeat them here:

. . . and (\par \lips and)
and (\par and)

 . . . (\par\indent \lips and)
and (\par\indent and)
. . . and (\par\noindent \lips and)
and (\par\noindent and)

And. …

(And.\lips \par)

And.

(And. \par)

Also I test here some random things: \lips before \\, before shortvrb’s verbatim chars, before a tie, before punctuation transparent to spacefactors (e.g. ‘)’).

 Hello.\lips␣\\                Hello. . . .

 One␣two␣three.\lips~tiedword One two three. . . . tiedword
 (One␣two␣three.\lips)␣Next. (One two three. . . . ) Next.
 (One␣two␣three.\lips)\␣Next. (One two three. . . . ) Next.
One two three. . . . shortverb verb stuff. (One two three.\lips |shortverb verb stuff|.)

Part II

Implementation

1 Version control

\fileinfo \fileversion \filedate \docdate \PPOptArg These definitions must be the first ones in the file.
1 \def\fileinfo{Chicago Manual text ellipses (Frankenstein's lips)}
2 \def\DoXNeeDME{}
3 \def\fileversion{v1.2}
4 \def\filedate{1996/09/04}
5 \def\docdate{1996/09/04}
6 \edef\PPOptArg {%
7 \filedate\space \fileversion\space \fileinfo
8 }

Stop right here if we’re just loading the file’s information, and don’t want to load this code for typesetting its documentation (only makes sense for certain packages). The JuStLaAdInFoRmAtIoN flag will be set by the documentation driver; the DoXNeeDME flag will be set in the dtx file, and will appear above if it’s set.

9 \makeatletter
10 \@ifundefined{JuStLoAdInFoRmAtIoN} {%
11 }{% ELSE
12 \@ifundefined{DoXNeeDME} {%
13  }{% ELSE
14  \UndefineCS\JuStLoAdInFoRmAtIoN
15  \usepackage{lips}%

16 }

17 \makeatother
18 \endinput

19 }

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

20 \NeedsTeXFormat{LaTeX2e}
21 \ProvidesPackage{lips}[\PPOptArg]

2 The macro

\lips
22 \newcommand\lips {}
23 \let\lips\relax
24 \DeclareRobustCommand\lips {%
25 \ifmmode
26  \def\sc@t@a {%
27  \PackageError{lips}{Don't use \protect\lips \space in math mode.}%
28  }%
29 \else
30  \ifvmode
31  \def\sc@t@a {%
32  \leavevmode
33  .\nobreak\ .\nobreak\ .\nobreak\ %
34  }%
35  \else
36  \let\sc@t@a\sc@lips@hmode
37  \fi
38 \fi
39 \sc@t@a

40 }

\sc@lips@hmode \GobbleIgnoreSpaces The horizontal mode case.
41 \newcommand\sc@lips@hmode {%
42 \unskip
43 \@ifnextchar . {%
44  .\penalty9999\ .\nobreak\ .\nobreak\ .\penalty9999\ %
45  \GobbleIgnoreSpaces
46  }{% ELSE
47  \penalty9999\ .\nobreak\ .\nobreak\ .%
48  \futurelet\sc@t@a\sc@lips@check@punct
49 }%

50 }

51 \newcommand\GobbleIgnoreSpaces [1] {%
52 \ignorespaces

53 }

\sc@lips@check@punct Add a nonbreakable space if \sc@t@a is punctuation; add slightly breakable space otherwise.

54 \newcommand\sc@lips@check@punct {%
55 \ifcat.\sc@t@a%
56  \nobreak\ %
57 \else
58  \penalty9999\ %
59 \fi

60 }

You might want to compare the L^{A}TEX version (as of 95/12/01). \fontdimen3 is the interword stretchability, not interword space.

\DeclareTextCommandDefault{\textellipsis}{%
  .\kern\fontdimen3\font
  .\kern\fontdimen3\font
  .\kern\fontdimen3\font
}
\def\mathellipsis{\mathinner{\ldotp\ldotp\ldotp}}
\DeclareRobustCommand{\dots}{%
  \ifmmode\mathellipsis\else\textellipsis\fi
}
\let\ldots\dots