What special is in the word "implementation" that it is not possible automatic hyphenate in narrower environments as are minipage
, TikZ nodes etc, even if in preamble is added hyphenation pattern for it?
Interestingly, hyphenation works, if in the begins of those environments is added \hspace{0pt}
! Examples:
\documentclass{article}
\begin{document}
\textbullet doesn't work:
\smallskip
\fbox{\begin{minipage}{4em}
implementation
\end{minipage}
}
\medskip
\textbullet\ with use of \verb+\hspace*{0pt}+ works:
\fbox{\begin{minipage}{4em}\hspace*{0pt} % <---
implementation
\end{minipage}
}
\end{document}
And example at use TikZ nodes:
\documentclass{article}
\usepackage{tikz}
\begin{document}
\textbullet\ doesn't work:
\smallskip
\tikz\node[draw, text width=4em, align=center] {implementation};
\textbullet\ with use of \verb+\hspace*{0pt}+ works:
\tikz\node[draw, text width=4em, align=center,
execute at begin node=\hspace*{0pt}] % <---
{implementation};
\end{document}
I wonder, what is in the word implementation. For example, with similar long word hyphenation this problem not occur.
Best Answer
There is nothing special about
implementation
. TeX simply does not hyphenate the first word of a paragraph. If you need this hyphenated you have to have glue before it such as\hspace{0pt}
. This (mis)-feature is shared with tex variants such as ptex and xetex, however luatex does include the first word in its hyphenation pass, and so would hyphenate your example without the extra space.