0

I have the following issue with a hyphen going into the margin:

output

As you can see, the Spatio-Temporal word has crossed the margin. How can I fix it in LaTeX? I am using the TeX template at www.biostat.umn.edu/~brad/8400/HQuick_cv.tex.

user34790
  • 303

1 Answers1

3

With babel, some languages:

Spatio"=Temporal

With babel, some other languages:

Spatio"-Temporal

with babel 3.9+:

Spatio\babelhyphen{hard}Temporal

with hyphenat:

Spatio\hyp{}Temporal

otherwise:

Spatio-\hspace{0pt}Temporal

Overview of hyphens and hyphenation points

These always show a (hard) hyphen:

  • - restrict to these hyphenation points (U+002D / U+2010)
    • \babelhyphen*{hard}
  • "= allows other hyphenation points
    • \babelhyphen{hard}
    • \nobreak\-\nobreak\hskip\z@skip
    • \hyp{} from the hyphenat package: \leavevmode\nobreak\hskip\z@skip-\discretionary{}{}{}\nobreak\hskip\z@skip
  • "~ not a valid hyphenation point, usually at the beginning or end of a word (NBHY U+2011)
    • \babelhyphen*{nobreak}, possibly \babelhyphen{nobreak} (-suffix) or \babelhyphen{hard} (prefix-)
    • \leavevmode\hbox{-}

These only show a (soft) hyphen at the end of a line:

  • \- restrict to these hyphenation points (~ SHY U+00AD), but \IUPAC
    • \babelhyphen*{soft}
  • "- allows other hyphenation points (~ SHY U+00AD)
    • \babelhyphen{soft}
    • \penalty\@M-\hskip\z@skip
    • -\hspace{0pt}
  • "| suppresses ligation (ZWNJ U+200C)
    • \babelhyphen{}
    • \penalty\@M\discretionary{-}{}{\kern.03em}\allowhyphens
    • \/

This never shows a hyphen:

  • "" usually in combination with another hyphen (ZWSP U+200B)
    • \babelhyphen{empty}
    • \hskip\z@skip

(Note: \@M = 10000, z@skip = 0pt plus 0pt minus 0pt; some macros have been expanded)

Using shorthands in English

The ones beginning with " are available in german variants of the babel package by default, other ldf files may deviate, e.g. "- may be a hard hyphen elsewhere. They can be enabled for English like this:

\usepackage[ngerman,english]{babel}
\useshorthands{"}
\addto\extrasenglish{\languageshorthands{ngerman}}

Since babel version 3.9 you can also do:

\usepackage[english]{babel}
\useshorthands*{"}
\defineshorthand{"-}{\babelhyphen{hard}}
David Carlisle
  • 757,742
Crissov
  • 1,866
  • I'm confused by the use of \nobreak\-\nobreak\hskip\z@skip, could you explain why we need a glue after the penalty \nobreak? – Tuff Contender Jan 25 '17 at 08:43
  • @TuffContender I don’t remember where that code came from, it’s probably Babel’s \babelhyphen{hard} (as it was 2 years ago). – Crissov Jan 25 '17 at 15:00
  • Thank you for response, and I just found the answer in TeXbook that TeX only starts hyphenation with word immediately following a glue. – Tuff Contender Feb 03 '17 at 03:02