15

I am not sure, if this is a bug of the package showhyphens or some LaTeX-behaviour I don't understand. Please have a look on the following example:

% arara: lualatex
\documentclass[ngerman]{article}
\usepackage{babel}
\usepackage{showhyphens}

\begin{document}
\noindent Hallo\\Hallo 
\end{document}

Could there be any reason to suppress hyphenation here? When using the babel shorthand "- the red hyphenation line is shown.

enter image description here

3
  • 1
    I can't think of a place where hyphenating the word after \\ can be useful. Using \\ in normal text can be justified only in very rare occasions. If \\ is in the scope of \raggedright, \raggedleft or \centering, the hyphenation point is found.
    – egreg
    Nov 20, 2013 at 12:05
  • Absolutely. Only case would be: Writing short lists of words for brief examples on this page here. In tex.stackexchange.com/q/145488 I wanted to show ligatures and hyphenation points for some different commands and modified the breaking behavior due to my `\`s. In daily business, I just never use those back slashes.
    – LaRiFaRi
    Nov 20, 2013 at 13:02
  • A new paragraph (or \\ in \raggedright, which is essentially the same, because in that context \\ issues \par) is better.
    – egreg
    Nov 20, 2013 at 13:04

1 Answer 1

14

Yes (must admit I hadn't noticed that before). The same is true of the first word of the paragraph (a well known failing) despite the marker shown in your image.

Note, as egreg comments below, the first word in paragraph problem is fixed in lualatex (which is anyway a prerequisite for the showhyphens package you are using) but hyphenation is still disabled by \\ in lualatex.

enter image description here

% arara: lualatex
\documentclass[ngerman]{article}
\usepackage{babel}
%\usepackage{showhyphens}

\setlength\textwidth{3pt}
\begin{document}
\showhyphens{Hallo}
\noindent Hallo\\Hallo 


\noindent \hspace*{0pt}Hallo\\\hspace*{0pt}Hallo 
\end{document}
1
  • 8
    It's a bit paradoxical that LuaTeX is indeed able to hyphenate the first word in a paragraph, but fails for the one after \\. ;-)
    – egreg
    Nov 19, 2013 at 10:27

You must log in to answer this question.

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