4

how can I globally enable hyphenation for the first word in a paragraph? A manual workaround is to add \hspace{0pt} in front of the corresponding word, so that it is not counted as first word, but it would be very good to have a global solution for this. Any ideas?

Kindest regards, Mil

10
  • Do you have so long words or so narrow columns that this is necessary in every paragraph?
    – egreg
    Commented Nov 2, 2015 at 10:04
  • 1
    It is hard to imagine that you ever want to hyphenate the first word of a paragraph in the main text? In table columns yes (but that can be specified) doing it in the main text is harder. Or use luatex where this is the default behaviour. Commented Nov 2, 2015 at 10:29
  • 2
    Perhaps he's writing an article on Hubert Blaine Wolfeschlegelsteinhausenbergerdorff, Sr.
    – Psychonaut
    Commented Nov 2, 2015 at 10:38
  • 1
    @Psychonaut Gesundheit!! Commented Nov 2, 2015 at 10:49
  • 3
    @Andreas It is almost certainly an accidental artefact of the implementation, but frozen now as TeX-the-program is frozen apart from major bugs. LuaTeX, which is not so tied by historical compatibility has changed this so the first word is hyphenated. Commented Nov 4, 2015 at 13:34

2 Answers 2

4

I assume you're currently compiling your document with pdfLaTeX. If that's the case, I suggest you switch to LuaLaTeX. LuaLaTeX is able to hyphenate the first word of every paragraph without the user having to specify anything special.

3

If you insert a zero width space at the start of a paragaph then the first word is considered for hyphenation. You could attempt \everypar{\hspace*{0pt}} but something is likely to break, but in restricted contexts where you have direct access to the start of the text then things are easier.

For example array package allows > to inject tokens in to the start and it may be useful to use >{\hspace*{0pt}\ignorespaces}p{...} so the cell starts with such a space. Similarly if you define \newcommand\mpar[1]{\marginpar{\hspace*{0pt}\ignorespaces#1}} Then the margin paragraph would allow hyphenation of the first word.

1
  • Many thanks for that solution for the cells, David! That's exactly what I needed, too, for handling German's lovely neverending compound words in tables. Do you know of a way to set this token globally? Like, can I add it to the columntype definition somehow so that it's always automatically applied to every table?
    – serval
    Commented May 8 at 6:14

You must log in to answer this question.

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