2

The following is a minimal example of a problem I'm having with hyphenation.

\documentclass{article}
\begin{document}

\hyphenpenalty=0
\hyphenation{shame-less-ness}

\begin{minipage}{18mm}

  shamelessness

  shameless\-ness

  Four score and seven years ago, shamelessness our forefathers
  brought forth upon this continent a new nation.

\end{minipage}

\end{document}

It seems that for a single-word paragraph inside a narrow column, I can't convince LaTeX to hyphenate the word. The result when I typeset this document looks like this:

shamelessness
shameless-
ness
Four score
and seven
years ago,
shameless-
ness our
forefathers
brought
forth upon
this conti-
nent a new
nation.

The width of 18 mm is chosen to be narrower than the word "shamelessness." If I explicitly suggest a hyphenation, the word gets hyphenated. But implicit hyphenation doesn't happen, even though I did everything I could think of to encourage it, setting \hyphenpenalty to zero and explicitly providing a hyphenation for the word. However, when I insert the word at a random spot in a multi-line passage of text, it gets hyphenated.

Why is latex refusing to do the implicit hyphenation here, and what can I do to fix the problem?

[EDIT] Thanks, David Carlisle, for your comment. That answers my question.

1
  • 7
    tex doesn't hyphenate the first word (unless you use luatex) you can prefix with \hspace*{0pt} to allow hyphenation Jul 20, 2023 at 14:37

1 Answer 1

5

TeX doesn't hyphenate the first word (unless you use luatex) you can prefix with \hspace*{0pt} to allow hyphenation

9
  • Do you happen to know if this behavior is for typographical or technical reasons?
    – gusbrs
    Aug 7, 2023 at 13:51
  • 3
    If it was anyone else I'd say it was an out-by-one coding error, starting the scan at the wrong place. But great men get to define documented coding errors as features, so it's a feature. @gusbrs Aug 7, 2023 at 13:53
  • @ DavidCarlisle :)
    – gusbrs
    Aug 7, 2023 at 13:57
  • 2
    @gusbrs -- I can confirm that it's intentional. I asked DEK and he said so. (I ran into the problem in the early 1980s, creating a membership list with quite narrow columns, and encountering a very long city name in the geographic section.) He pointed out a reason, but I've forgotten what it was Aug 7, 2023 at 14:36
  • 1
    @barbarabeeton intentional or not, it's still wrong:-) Aug 7, 2023 at 14:38

You must log in to answer this question.

Not the answer you're looking for? Browse other questions tagged .