The hyphenat package^{∗}

Peter Wilson Catholic University of America^{†}

             Now at peter.r.wilson@boeing.com

1999/02/13

Abstract

The hyphenat package can be used to either disable hyphenation throughout a document or to enable automatic hyphenation within words that include analphabetic characters. It also provides for hyphenatable monospaced fonts.

Contents

1 Introduction 1

2 The hyphenat package 2

3 The package code 3 3.1 Hyphenation of TT text . . . . . . . . . . . . . . . . . . . . . . . . 6 3.2 Package features and caveats . . . . . . . . . . . . . . . . . . . . . 12

1 Introduction

Questions about hyphenation seem to pop up fairly regularly on comp.text.tex newsgroup. Broadly speaking the questions take one of two forms:

• How can I disable hyphenation in my document?

• How can I enable hyphenation after the character … ?

The hyphenat package attempts to provide solutions for both of these questions. This package is an extension of the uschyp package which was developed as part of a class and package bundle for typesetting ISO standards [Wil96]. This manual is typeset according to the conventions of the L^{A}TEX docstrip utility which enables the automatic extraction of the L^{A}TEX macro source files [GMS94].

∗This file has version number v2.3, last revised 1999/02/13.

†This work was originally performed as a Guest Researcher at the National Institute of Standards and Technology.

Section 2 describes a package to enable ‘words’ containing analphabetic characters to be automatically hyphenated, or to disable hyphenation throught a document or just disable it for short pieces of text. It also enables hyphenation, if required, of text typeset using monospaced (TT) fonts. For convenience I use TT to mean a monospaced font; TT does not indicate TrueType fonts. Commented source code for the package is in Section 3.

2 The hyphenat package

The hyphenat package has an option called none. Use of this option prevents any hyphenation throughout the document. If TEX is prevented from hyphenating it may complain about bad line breaks and you may find bits of text sticking out into the margin. If you use this option you should also consider using \sloppy

and/or \raggedright.

The other option, htt, enables hyphenation of text typeset using Computer Modern Typewriter fonts (or their equivalent, such as Adobe Courier). If this option is used, then text typeset via either \texttt or \ttfamily will be in the default TT font and may be automatically hyphenated. Note that this will not affect any TT text typeset by either \verb or in a verbatim environment because they locally inhibit hyphenation. If you use this option you are likely to get a lot of Font Warning messages about being unable to load a font. It is reasonably safe to suggest that you can ignore these.

\textnhtt The command \textnhtt{⟨text⟩} will typeset ⟨text⟩ in the default TT font \nhttfamily with no automatic hyphenation. It has the same effect as \texttt when the htt

option is not used. The \nhttfamily declaration is a companion to the \textnhtt command and is analagous to the \ttfamily declaration in that it prevents any hyphenation of TT fonts.

\nohyphens The command \nohyphens{⟨text⟩} will typeset ⟨text⟩ without any automatic

hyphenation. This is intended to be used for short pieces of text.

An analphabetic character is a character than does not appear in the alphabet. Analphabetic characters include the numerals and punctuation characters. If a ‘word’ contains any analphabetic characters, TEX’s automatic hyphenation capability is disabled for any syllables following the (first) of the analpabetic characters in the word. Words containing analphabetic characters often occur as the names of variables in computer programs, and of course, as URLs on the Web. The hyphenat package provides several commands enabling automatic hyphenation of words containing analphabetics.

\_In L^{A}TEX a ‘word’ containing an underscore (e.g., `letters_with_underscores') can be hyphenated at the underscore by using a discretionary hyphen. That is, write the word like letters\_\-with\_\-underscores. This has two potential disadvantages: (a) more typing is involved, and (b) if the word is broken at one underscore, hyphenation of any succeeding syllables is disabled. The hyphenat package redefines the \_command so that hyphenation can automatically occur after an underscore and further hyphenation within the word is not disabled. Thus, this example word can just be written as letters\_with\_underscores.

Note that following the revised \_command with a discretionary hyphen makes its behaviour revert to the L^{A}TEX default.

\bshyp The \bshyp command can be used to print a backslash and have following

hyphenation. \fshyp The \fshyp command can be used to print a forward slash and have following

hyphenation.

\dothyp The \dothyp command can be used to print a period (full stop) and have

following hyphenation.

\colonhyp The \colonhyp command can be used to print a colon and have following

hyphenation.

   For example, to typeset first\second/third.fourth:fifth_sixth, allowing

hyphenation at the analphabetic characters the source would be:

 first\bshyp{}second\fshyp{}third\dothyp{}fourth\colonhyp{}fifth\_sixth

\hyp TEX does not want to hyphenate a word that appears in the source already hyphenated, such as electromagnetic-endioscopy. The \hyp command is like the other \...hyp commands, only it typesets a hyphen and allows full automatic hyphenation of the other words forming the compound word. It is used like

electromagnetic\hyp{}endioscopy.

3 The package code

Announce the name and version of the package, which requires L^{A}TEX 2ε.

1 ⟨∗usc⟩

 2 \NeedsTeXFormat{LaTeX2e}
 3 \ProvidesPackage{hyphenat}[1999/02/13 v2.3 hyphenation utilities]

An option is provided whereby all hyphenation throught a document is disabled. Hyphenation throughout a document can be disabled in at least the following ways:

1. Set \exhyphenpenalty and \hyphenpenalty to 10000 (the TEXbook exercise 14.6);

2. Use an ‘unknown’ language (i.e., one that has no hyphenation patterns, but for a complete document this would cause problems if a package like babel was used);

  3. Set \lefthyphenmin and \righthyphenmin to large values (see lthyphen.dtx)

to prevent hypenation in the first \lefthyphenmin characters and in the last

     \righthyphenmin characters.

I have chosen the TEXbook solution for global hyphenation suppression as it is generic.

 4 \DeclareOption{none}%
 5  {\hyphenpenalty=10000\exhyphenpenalty=10000\relax}

An option is provided whereby TT text may be hyphenated. See §3.1 for how it is implemented via the \touchttfonts and \touchextrattfonts commands. At the end we have to ensure that the normal text font is selected.

 6 \DeclareOption{htt}{%
 7 \PackageWarningNoLine{hyphenat}{%
 8  *******************************\MessageBreak
 9  * You have used the htt option.\MessageBreak
10  * You are likely to get many Font Warning messages.\MessageBreak
11  * These can usually be ignored.\MessageBreak
12  *******************************}
13 \AtBeginDocument{\touchttfonts\touchextrattfonts\normalfont}}
14 \ProcessOptions

\langwohyphens We will use a non-existant language as a local means of disabling hyphenation.

15 \newlanguage\langwohyphens

This package redefines the \_command to include a discretionary hyphen.^{1} The new definition provides for full hyphenation throughout a construct such as long\_identifier. The default L^{A}TEX behaviour is that this kind of construct has to be written as as long\_\-identifier if hyphenation is to be enabled at the position of the underscore; this also switched off hypenation after the first use of \_or _\- within the construct.

Users of this package must not use a discretionary hyphen in conjunction with an underscore.

The behaviour of _as a subscript command in math mode is unaffected as is the use of a naked _in text (an error).

The original attempt was to enable a naked _to be used in ordinary text. The code for this follows. The problem that arose with this was that, for example, \input{long_filename} would fail. With the original code, a naked _could not be used in \label, \cite or \ref commands as \protect is not properly enabled in these commands.

    % uscaslet.sty
    % (Email from Donald Arseneau 10 October 1997)
    \newcommand{\BreakableUnderscore}{\leavevmode
    \nobreak\hskip\z@skip
    \textunderscore
    \-\nobreak\hskip\z@skip}
    \def\UnderOrSub0{\ifmmode\sb\else\BreakableUnderscore\fi}
    \AtBeginDocument{\catcode`\_\active}
    \begingroup\catcode`\_\active
    \@firstofone{\endgroup\def_{\protect\UnderOrSub0}}
    \DeclareRobustCommand{\_}{%
      \ifmmode\nfss@text{\textunderscore}\else\BreakableUnderscore\fi}

1Thanks to Donald Arseneau for pointing the author in the right direction.

    \endinput

Donald Arseneau has since developed his underscore package, available on CTAN, that eliminates the above problems.

Now for the hyphenat version. This is reduced from Donald Arseneau’s code (Email from him on Friday 10 October 1997) with my comments.

This version includes macros for breakable backslashes, forward slashes and periods as well as underscores.

\prw@zbreak \prw@zbreak is just defined to save some potential typos further on.

16 \newcommand{\prw@zbreak}{\nobreak\hskip\z@skip}

\BreakableUnderscore This macro adds a discretionary hyphen after an underscore. As Ray Goult discovered, using the shorthand \- for \discretionary{-}{}{} causes problems in a tabbing environment which modifies the definition of \-, so we have to use the long form.

17 \newcommand{\BreakableUnderscore}{\leavevmode%
18 \prw@zbreak\textunderscore\discretionary{-}{}{}\prw@zbreak}

The next bit of Donald Arseneau’s code preserves any following spaces (yes, that is a zero at the end of the command name). Unfortunately this is not required any more.

    \def\UnderOrSub0{\ifmmode\sb\else\BreakableUnderscore\fi}

Originally the underscore was made active only at the beginning of the document to avoid possibly upsetting other packages that had been loaded:

    \AtBeginDocument{\catcode`\_\active}

but this broke input of files with names that included underscores. Next a new underscore command was defined.

    \begingroup\catcode`\_\active
    \@firstofone{\endgroup\def_{\protect\UnderOrSub0}}

but again this broke file names.

And finally redefine the \_command.

19 \DeclareRobustCommand{\_}{%
20 \ifmmode\nfss@text{\textunderscore}\else\BreakableUnderscore\fi}
\BreakableBackslash \BreakableSlash \BreakablePeriod \BreakableColon We do similar breakable definitions for \, / and . characters.
21 \newcommand{\BreakableBackslash}{\leavevmode%
22 \prw@zbreak\textbackslash\discretionary{-}{}{}\prw@zbreak}
23 \newcommand{\BreakableSlash}{\leavevmode%
24 \prw@zbreak/\discretionary{-}{}{}\prw@zbreak}

25 \newcommand{\BreakablePeriod}{\leavevmode%
26 \prw@zbreak.\discretionary{-}{}{}\prw@zbreak}
27 \newcommand{\BreakableColon}{\leavevmode%
28 \prw@zbreak:\discretionary{-}{}{}\prw@zbreak}

\bshyp \fshyp \dothyp \colonhyp Now for the user commands. I was hoping to have these of the form \\, \/ and \., but these are all part of the basic set of commands. \? appears to be the only unused single analphabetic command, and I chose this for a breakable period (at least the symbol does include a dot). Normal alphabetic commands are used for the others. For the second release, I changed my mind and replaced the original \? command with \dothyp instead:

• \dothyp is more consistent with the other breakable commands;

• \? might be used in other classes or packages;

• I, or someone else, might want to later use \? for a breakable question mark.

To print first\second/third.fourth:fifth, allowing hyphenation within each ‘word’ and also at the \, /, . and : characters, the source should be:

first\bshyp{}second\fshyp{}third\dothyp{}fourth\colonhyp{}fifth
29 \DeclareRobustCommand{\bshyp}{%
30 \ifmmode\backslash\else\BreakableBackslash\fi}
31 \DeclareRobustCommand{\fshyp}{%
32 \ifmmode/\else\BreakableSlash\fi}
33 \DeclareRobustCommand{\dothyp}{%
34 \ifmmode.\else\BreakablePeriod\fi}
35 \DeclareRobustCommand{\colonhyp}{%
36 \ifmmode:\else\BreakableColon\fi}
\BreakableHyphen
\hyp
37 \newcommand{\BreakableHyphen}{\leavevmode%
38 \prw@zbreak-\discretionary{-}{}{}\prw@zbreak}
39 \DeclareRobustCommand{\hyp}{%
40 \ifmmode-\else\BreakableHyphen\fi}

3.1 Hyphenation of TT text

The default specification for the Computer Modern Typewriter font disables hyphenation by setting the \hyphenchar for the font to be -1 (in other fonts the \hyphenchar is normally 45). To enable hyphenation for text typeset with the cmtt font(s) we need to set the \hyphenchar to the position of the hyphen in the font. This can be done by:

1. Replacing the default ...tt.fd file;

2. Define a new virtual font with the \hyphenchar set;

3. Define a new font family based on cmtt with the \hyphenchar set.

The first choice is not good because it is effectively a global change to a L^{A}TEX installation. The second involves some amount of work (both on the package writer’s and users’ parts) and depends on the DVI driver being able to handle virtual fonts. The third option was initially chosen as being the simplest and most portable. It principally involved defining .fd files for a font family that I called cmhtt, as being a hyphenatable version of cmtt.

\textnhtt \nhttfamily \textnhtt is equivalent to \texttt but it ensures that its argument will never be hyphenated. Similarly the \nhttfamily declaration is the corresponding equivalent to the \ttfamily declaration. On the assumption that this will only be used for short pieces of text we will implement this by using a non-existant language; this does mean, however, that any language-specific typesetting (for example via the babel package) will be locally disabled.

41 \DeclareTextFontCommand{\textnhtt}{\nhttfamily}
42 \DeclareRobustCommand{\nhttfamily}
43 {\not@math@alphabet\nhttfamily\mathtt
44 \fontfamily\ttdefault\selectfont\language\langwohyphens}

\nohyphens While we are at it, we might as well define a general command to disable hyphenation of its argument text.

45 \newcommand{\nohyphens}[1]{{\language\langwohyphens #1}}

\touchttfonts There is a fourth way of specifying hyphenatable TT fonts that does not depend on generating any extra .fd files but does depend on the fact that TEX only touches (loads) a font once. The method is to select all likely TT fonts at the beginning of the document, and then to select the normal font. When each TT font is selected its \hyphenchar is set to the default hyphen character for the font rather than to the -1 as specified in the .fd files. The command \touchttfonts selects all likely TT fonts once. (This has been tested with no font packages (i.e., vanilla L^{A}TEX cmtt fonts), with the PSNFSS font packages, and with the pandora package using the Pandora pntt TT font).

46 \newcommand{\touchttfonts}{%

The Medium series in Normal, Italic, Slanted and Small Caps.

47 \fontfamily{\ttdefault}\fontseries{m}\fontshape{n}\selectfont%
48  \hyphenchar\font=\defaulthyphenchar
49 \fontfamily{\ttdefault}\fontseries{m}\fontshape{it}\selectfont%
50  \hyphenchar\font=\defaulthyphenchar
51 \fontfamily{\ttdefault}\fontseries{m}\fontshape{sl}\selectfont%
52  \hyphenchar\font=\defaulthyphenchar
53 \fontfamily{\ttdefault}\fontseries{m}\fontshape{sc}\selectfont%
54  \hyphenchar\font=\defaulthyphenchar

The Bold series in Normal, Italic, Slanted and Small Caps.

55 \fontfamily{\ttdefault}\fontseries{b}\fontshape{n}\selectfont%
56  \hyphenchar\font=\defaulthyphenchar
57 \fontfamily{\ttdefault}\fontseries{b}\fontshape{it}\selectfont%
58  \hyphenchar\font=\defaulthyphenchar

59 \fontfamily{\ttdefault}\fontseries{b}\fontshape{sl}\selectfont%
60  \hyphenchar\font=\defaulthyphenchar
61 \fontfamily{\ttdefault}\fontseries{b}\fontshape{sc}\selectfont%
62  \hyphenchar\font=\defaulthyphenchar

The Bold Extended series in Normal, Italic, Slanted and Small Caps.

63 \fontfamily{\ttdefault}\fontseries{bx}\fontshape{n}\selectfont%
64  \hyphenchar\font=\defaulthyphenchar
65 \fontfamily{\ttdefault}\fontseries{bx}\fontshape{it}\selectfont%
66  \hyphenchar\font=\defaulthyphenchar
67 \fontfamily{\ttdefault}\fontseries{bx}\fontshape{sl}\selectfont%
68  \hyphenchar\font=\defaulthyphenchar
69 \fontfamily{\ttdefault}\fontseries{bx}\fontshape{sc}\selectfont%
70  \hyphenchar\font=\defaulthyphenchar

The Semi-bold series in Normal, Italic, Slanted and Small Caps.

71 \fontfamily{\ttdefault}\fontseries{sb}\fontshape{n}\selectfont%
72  \hyphenchar\font=\defaulthyphenchar
73 \fontfamily{\ttdefault}\fontseries{sb}\fontshape{it}\selectfont%
74  \hyphenchar\font=\defaulthyphenchar
75 \fontfamily{\ttdefault}\fontseries{sb}\fontshape{sl}\selectfont%
76  \hyphenchar\font=\defaulthyphenchar
77 \fontfamily{\ttdefault}\fontseries{sb}\fontshape{sc}\selectfont%
78  \hyphenchar\font=\defaulthyphenchar

The Condensed series in Normal, Italic, Slanted and Small Caps.

79 \fontfamily{\ttdefault}\fontseries{c}\fontshape{n}\selectfont%
80  \hyphenchar\font=\defaulthyphenchar
81 \fontfamily{\ttdefault}\fontseries{c}\fontshape{it}\selectfont%
82  \hyphenchar\font=\defaulthyphenchar
83 \fontfamily{\ttdefault}\fontseries{c}\fontshape{sl}\selectfont%
84  \hyphenchar\font=\defaulthyphenchar
85 \fontfamily{\ttdefault}\fontseries{c}\fontshape{sc}\selectfont%
86  \hyphenchar\font=\defaulthyphenchar

The Light series in Normal, Italic, Slanted and Small Caps.

87 \fontfamily{\ttdefault}\fontseries{l}\fontshape{n}\selectfont%
88  \hyphenchar\font=\defaulthyphenchar
89 \fontfamily{\ttdefault}\fontseries{l}\fontshape{it}\selectfont%
90  \hyphenchar\font=\defaulthyphenchar
91 \fontfamily{\ttdefault}\fontseries{l}\fontshape{sl}\selectfont%
92  \hyphenchar\font=\defaulthyphenchar
93 \fontfamily{\ttdefault}\fontseries{l}\fontshape{sc}\selectfont%
94  \hyphenchar\font=\defaulthyphenchar

Miscellaneous cmtt not covered above (from cmfonts.fdd).

95 \fontfamily{\ttdefault}\fontseries{m}\fontshape{ui}\selectfont%
96  \hyphenchar\font=\defaulthyphenchar
97 \fontfamily{\ttdefault}\fontseries{bx}\fontshape{ui}\selectfont%
98  \hyphenchar\font=\defaulthyphenchar
99 \fontfamily{\ttdefault}\fontseries{m}\fontshape{In}\selectfont%
100  \hyphenchar\font=\defaulthyphenchar

End of the definition of \touchttfonts.

101 }

\touchextrattfonts This macro is provided as a hook in case \touchttfonts does not cover the required range. It should be redefined in the preamble after loading the hyphenat package. The definition of \touchttfonts can be used as a template for the new definition.

102 \newcommand{\touchextrattfonts}{}

This completes the package.

103 ⟨/usc⟩

Just in case anyone is interested, the following is my original specification of a hyphenatable TT font family.

Now to specify the various .fd files for the cmhtt font. These are essentially copies of the files generateable from cmfonts.fdd (1998/03/27), which is part of the L^{A}TEX base distribution.

104 ⟨∗ot1⟩

The OT1 coding for normal typesetting.

105 \ProvidesFile{ot1cmhtt.fd}[1998/12/31 Hyphenatable cmtt fonts]
106 \DeclareFontFamily{OT1}{cmhtt}{\hyphenchar\font45}
107 \DeclareFontShape{OT1}{cmhtt}{m}{n}

108 {%

109 <5><6><7><8>cmtt8<9>cmtt9%
110 <10><10.95>cmtt10%
111 <12><14.4><17.28><20.74><24.88>cmtt12%
112 }{}
113 \DeclareFontShape{OT1}{cmhtt}{m}{it}

114 {%

115 <5><6><7><8><9>%
116 <10><10.95><12><14.4><17.28><20.74><24.88>cmitt10%
117 }{}
118 \DeclareFontShape{OT1}{cmhtt}{m}{sl}

119 {%

120 <5><6><7><8><9>%
121 <10><10.95><12><14.4><17.28><20.74><24.88>cmsltt10%
122 }{}
123 \DeclareFontShape{OT1}{cmhtt}{m}{sc}

124 {%

125 <5><6><7><8><9>%
126 <10><10.95><12><14.4><17.28><20.74><24.88>cmtcsc10%
127 }{}
128 \DeclareFontShape{OT1}{cmhtt}{m}{ui}
129 {<->ssub*cmhtt/m/it}{}
130 \DeclareFontShape{OT1}{cmhtt}{bx}{n}
131 {<->ssub*cmhtt/m/n}{}
132 \DeclareFontShape{OT1}{cmhtt}{bx}{it}
133 {<->ssub*cmhtt/m/it}{}

134 \DeclareFontShape{OT1}{cmhtt}{bx}{ui}
135 {<->ssub*cmhtt/m/it}{}

That’s all for this file.

136 ⟨/ot1⟩

137 ⟨∗ot1slides⟩

The OT1 coding for slides class.

138 \ProvidesFile{ot1lcmhtt.fd}[1998/12/31 Hyphenatable cmtt fonts for slides]
139 \DeclareFontFamily{OT1}{lcmhtt}{\hyphenchar\font45}
140 \DeclareFontShape{OT1}{lcmhtt}{m}{n}

141 {%

142 <13.82><16.59><19.907><23.89><28.66><34.4><41.28>%
143 cmtt8%
144 }{}
145 \DeclareFontShape{OT1}{lcmhtt}{m}{In}

146 {%

147 <13.82><16.59><19.907><23.89><28.66><34.4><41.28>%
148 icmtt8%
149 }{}
150 \DeclareFontShape{OT1}{lcmhtt}{m}{it}

151 {%

152 <13.82><16.59><19.907><23.89><28.66><34.4><41.28>%
153 cmitt10%
154 }{}
155 \DeclareFontShape{OT1}{lcmhtt}{m}{ui}
156 {<->ssub*lcmhtt/m/it}{}
157 \DeclareFontShape{OT1}{lcmhtt}{bx}{ui}
158 {<->ssub*lcmhtt/m/it}{}

That’s all for this file.

159 ⟨/ot1slides⟩

160 ⟨∗u⟩

The U coding for normal typesetting.

161 \ProvidesFile{ucmhtt.fd}[1998/12/31 Hyphenatable cmtt fonts]
162 \DeclareFontFamily{U}{cmhtt}{\hyphenchar\font45}
163 \DeclareFontShape{U}{cmhtt}{m}{n}

164 {%

165 <5><6><7><8>cmtt8<9>cmtt9%
166 <10><10.95>cmtt10%
167 <12><14.4><17.28><20.74><24.88>cmtt12%
168 }{}
169 \DeclareFontShape{U}{cmhtt}{m}{it}

170 {%

171 <5><6><7><8><9>%
172 <10><10.95><12><14.4><17.28><20.74><24.88>cmitt10%
173 }{}
174 \DeclareFontShape{U}{cmhtt}{m}{sl}

175 {%

176 <5><6><7><8><9>%
177 <10><10.95><12><14.4><17.28><20.74><24.88>cmsltt10%
178 }{}
179 \DeclareFontShape{U}{cmhtt}{m}{sc}

180 {%

181 <5><6><7><8><9>%
182 <10><10.95><12><14.4><17.28><20.74><24.88>cmtcsc10%
183 }{}
184 \DeclareFontShape{U}{cmhtt}{m}{ui}
185 {<->ssub*cmhtt/m/it}{}
186 \DeclareFontShape{U}{cmhtt}{bx}{n}
187 {<->ssub*cmhtt/m/n}{}
188 \DeclareFontShape{U}{cmhtt}{bx}{it}
189 {<->ssub*cmhtt/m/it}{}
190 \DeclareFontShape{U}{cmhtt}{bx}{ui}
191 {<->ssub*cmhtt/m/it}{}

That’s all for this file.

192 ⟨/u⟩

193 ⟨∗t1⟩

The T1 coding for normal typesetting.

194 \ProvidesFile{t1cmhtt.fd}[1998/12/31 Hyphenatable cmtt fonts]
195 \providecommand{\EC@httfamily}[5]{%
196 \DeclareFontShape{#1}{#2}{#3}{#4}%
197 {<5><6><7><8>#50800%
198 <9><10><10.95><12><14.4><17.28><20.74><24.88><29.86>%
199 <35.83>genb*#5}{}}
200 \DeclareFontFamily{T1}{cmhtt}{\hyphenchar\font45}
201 \EC@httfamily{T1}{cmhtt}{m}{n}{ectt}
202 \EC@httfamily{T1}{cmhtt}{m}{sl}{ecst}
203 \EC@httfamily{T1}{cmhtt}{m}{it}{ecit}
204 \EC@httfamily{T1}{cmhtt}{m}{sc}{ectc}
205 \DeclareFontShape{T1}{cmhtt}{bx}{n}%
206 {<->ssub*cmhtt/m/n}{}
207 \DeclareFontShape{T1}{cmhtt}{bx}{it}%
208 {<->ssub*cmhtt/m/it}{}

That’s all for this file.

209 ⟨/t1⟩

210 ⟨∗t1slides⟩

The T1 coding for slides class typesetting.

211 \ProvidesFile{t1lcmhtt.fd}[1998/12/31 Hyphenatable cmtt fonts for slides]
212 \DeclareFontFamily{T1}{lcmhtt}{\hyphenchar\font45}
213 \DeclareFontShape{T1}{lcmhtt}{m}{n}

214 {%

215 <13.82><16.59><19.907><23.89><28.66><34.4><41.28>%
216 ecltt8%
217 }{}

218 \DeclareFontShape{T1}{lcmhtt}{m}{In}

219 {%

220 <13.82><16.59><19.907><23.89><28.66><34.4><41.28>%
221 iecltt8%
222 }{}
223 \DeclareFontShape{T1}{lcmhtt}{m}{it}

224 {%

225 <13.82><16.59><19.907><23.89><28.66><34.4><41.28>%
226 ecit1000%
227 }{}

That’s all for this file.

228 ⟨/t1slides⟩

229 ⟨∗ts1⟩

The TS1 coding for normal typesetting.

230 \ProvidesFile{ts1cmhtt.fd}[1998/12/31 Hyphenatable cmtt fonts]
231 \providecommand{\EC@httfamily}[5]{%
232 \DeclareFontShape{#1}{#2}{#3}{#4}%
233 {<5><6><7><8>#50800%
234 <9><10><10.95><12><14.4><17.28><20.74><24.88><29.86>%
235 <35.83>genb*#5}{}}
236 \DeclareFontFamily{TS1}{cmhtt}{\hyphenchar\font45}
237 \EC@httfamily{TS1}{cmhtt}{m}{n}{tctt}
238 \EC@httfamily{TS1}{cmhtt}{m}{sl}{tcst}
239 \EC@httfamily{TS1}{cmhtt}{m}{it}{tcit}

That’s all for this file.

240 ⟨/ts1⟩

3.2 Package features and caveats

Features :

• The none option disables all hyphenation. If you use this option you should also consider using \sloppy (to reduce TEX’s moans about bad line breaks) or \raggedright (to reduce moans about overfull boxes).

• \_prints an underscore (per the traditional command).

• _makes a subscript in math mode, and an error in text mode.

• Words surrounding \_are hyphenated normally and there is a discretionary hyphenation point immediately after the underscore.

• An underscore character is used if the font encoding has one, otherwise it uses a drawn underscore.

Caveats :

• Using \_\- together disables hyphenation in any succeeding word.

• Using \nohyphens disables any language-specific commands within its argument. The same applies to \textnhtt and \nhttfamily.

• If the htt option is used, then any resetting of the default TT font must be done in the preamble before the \begin{document}.

References

[GMS94] Michel Goossens, Frank Mittelbach, and Alexander Samarin. The LaTeX Companion. Addison-Wesley Publishing Company, 1994.

[Wil96] Peter R. Wilson. LaTeX for standards: The LaTeX package files user manual. NIST Report NISTIR, June 1996.

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

\_. . . . . . . . . . . . . . . 2

A

\AtBeginDocument . . 13

B

\backslash . . . . . . . 30
\BreakableBackslash

. . . . . . . . . \underline{21}, 30

\BreakableColon . \underline{21}, 36
\BreakableHyphen . . \underline{37}
\BreakablePeriod   \underline{21}, 34
\BreakableSlash . \underline{21}, 32
\BreakableUnderscore

. . . . . . . . . \underline{17}, 20 \bshyp . . . . . . . . . . 2, \underline{29}

C

\colonhyp . . . . . . . 3, \underline{29}

D

\DeclareFontFamily .

…. 106, 139, 162, 200, 212, 236

\DeclareFontShape .

. 107, 113, 118, 123, 128, 130, 132, 134, 140, 145, 150, 155, 157, 163, 169, 174, 179, 184, 186, 188, 190, 196, 205, 207, 213, 218, 223, 232

\DeclareRobustCommand

. . . . . . 19, 29, 31, 33, 35, 39, 42

\DeclareTextFontCommand

. . . . . . . . . . . . 41

\defaulthyphenchar .

. . . . . . 48, 50, 52, 54, 56, 58, 60, 62, 64, 66, 68, 70, 72, 74, 76, 78, 80, 82, 84, 86, 88, 90, 92, 94, 96, 98, 100

\discretionary . 18,

22, 24, 26, 28, 38 \dothyp . . . . . . . . . 2, \underline{29}

E

\EC@httfamily . . . . .

…. 195, 201– 204, 231, 237–239

\exhyphenpenalty . . . 5

F

\font . . . . . . . 48, 50, 52, 54, 56, 58, 60, 62, 64, 66, 68, 70, 72, 74, 76, 78, 80, 82, 84, 86, 88, 90, 92, 94, 96, 98, 100, 106, 139, 162, 200, 212, 236

\fontfamily 44, 47, 49,

51, 53, 55, 57, 59, 61, 63, 65, 67, 69, 71, 73, 75, 77, 79, 81, 83, 85, 87, 89, 91, 93, 95, 97, 99

\fontseries . . 47, 49,

51, 53, 55, 57, 59, 61, 63, 65, 67, 69, 71, 73, 75, 77, 79, 81, 83, 85, 87, 89, 91, 93, 95, 97, 99

\fontshape . . 47, 49,

51, 53, 55, 57, 59, 61, 63, 65, 67, 69, 71, 73, 75, 77, 79, 81, 83, 85, 87, 89, 91, 93, 95, 97, 99

\fshyp . . . . . . . . . . 2, \underline{29}

H

\hyp . . . . . . . . . . . . 3, \underline{37}

\hyphenchar . . 48, 50,

52, 54, 56, 58, 60, 62, 64, 66, 68, 70, 72, 74, 76, 78, 80, 82, 84, 86, 88, 90, 92, 94, 96, 98, 100, 106, 139, 162, 200, 212, 236

\hyphenpenalty . . . . . 5

I

\ifmmode . . . . . . 20, 30, 32, 34, 36, 40

L

\language . . . . . . 44, 45

\langwohyphens \underline{15}, 44, 45

M

\mathtt . . . . . . . . . . 43

\MessageBreak . . . . 8–11

N

\newlanguage . . . . . . 15
\nfss@text . . . . . . . 20
\nhttfamily . . . . . . 2, \underline{41}
\nohyphens . . . . . . 2, \underline{45}
\normalfont . . . . . . . 13
\not@math@alphabet . 43

P

\PackageWarningNoLine

. . . . . . . . . . . . . 7

\providecommand 195, 231
\ProvidesFile . . . . .

…. 105, 138, 161, 194, 211, 230

\ProvidesPackage . . . 3
\prw@zbreak . . \underline{16}, 18,

22, 24, 26, 28, 38

T

                          \textbackslash . . . . 22

\textnhtt . . . . . . . 2, \underline{41}

                          \textunderscore . 18, 20
                          \touchextrattfonts .

. . . . . . . . 13, \underline{102}

                          \touchttfonts . . . 13, \underline{46}
                          \ttdefault 44, 47, 49,

51, 53, 55, 57, 59, 61, 63, 65, 67, 69, 71, 73, 75, 77, 79, 81, 83, 85, 87, 89, 91, 93, 95, 97, 99

Z \z@skip . . . . . . . . . . 16