Take the 2-minute tour ×
TeX - LaTeX Stack Exchange is a question and answer site for users of TeX, LaTeX, ConTeXt, and related typesetting systems. It's 100% free, no registration required.

In this example, why is the hyphenation rule not used?

\documentclass{article}
\usepackage{tabu}
\hyphenation{abc-def-hij-klm-nop-qrs-tuv-wxyz}
\begin{document}

\begin{center}
\begin{tabu} {|X|X|}
abcdefghijklmnopqrstuvwxyz abcdefghijklmnopqrstuvwxyz & 
abcdefghijklmnopqrstuvwxyz abcdefghijklmnopqrstuvwxyz 
\\
5 & 6 \\
\end{tabu}
\end{center}

\end{document}

Output:

screenshot

share|improve this question

closed as too localized by Lev Bishop, percusse, Werner, Tom Bombadil, diabonas Aug 24 '12 at 18:04

This question is unlikely to help any future visitors; it is only relevant to a small geographic area, a specific moment in time, or an extraordinarily narrow situation that is not generally applicable to the worldwide audience of the internet. For help making this question more broadly applicable, visit the help center.If this question can be reworded to fit the rules in the help center, please edit the question.

4  
Your \hyphenation{...} is missing the letter g –  Lev Bishop Aug 19 '12 at 4:59

1 Answer 1

up vote 12 down vote accepted
  1. As Lev Bishop already said, the words are different, g is missing in the alphabet word in \hyphenation.

  2. If the text width is decreased, the first word is not hyphenated because TeX does not hyphenate the first word in a paragraph. Adding \hspace{0pt} helps here:

    \documentclass{article}
    \usepackage{tabu}
    \hyphenation{abc-def-ghij-klm-nop-qrs-tuv-wxyz}% g is added
    
    \setlength{\textwidth}{.5\textwidth}
    
    \begin{document}
    
    \begin{center}
    \begin{tabu} {|X|X|}
    \hspace{0pt}abcdefghijklmnopqrstuvwxyz abcdefghijklmnopqrstuvwxyz &
    abcdefghijklmnopqrstuvwxyz abcdefghijklmnopqrstuvwxyz
    \\
    5 & 6 \\
    \end{tabu}
    \end{center}
    
    \end{document}
    

    Comparison hyphenation of first word

share|improve this answer

Not the answer you're looking for? Browse other questions tagged or ask your own question.