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.
\hspace*{0pt}
assures that, syntactically speaking,implemention
is no longer the first "word" in the paragraph. Interestingly, LuaLaTeX has no such trouble.\hspace{0pt}
is better than\
as the latter would affect the output.