1

How do I avoid the hyphenation ladder effect in XeLaTeX?

Consider the following as an example...

I want to hyphe-

nate this senten-

ce, but the pre-

sence of quadru-

ple lines suc-

cessively hyphe-

nated or even more than that, is just too much for my poor eyes.

11
  • If you're typesetting in narrow columns, hyphens are unavoidable.
    – egreg
    Dec 3, 2014 at 13:16
  • If you don't want to hyphenate you have to allow latex do do something instead, eg \raggedright Dec 3, 2014 at 13:18
  • @McGafter Maybe you can switch to LuaLaTeX and try \usepackage{microtype}. You might be lucky with this.
    – LaRiFaRi
    Dec 3, 2014 at 13:36
  • 1
    you could try increasing the value of \doublehyphendemerits. in knuth's gkpmac.tex, it's set to 100000; latex sets it to only 10000. but the suggestion to use microtype is a good one; it should work with pdflatex as well. Dec 3, 2014 at 13:43
  • 1
    Have you modified the value of \righthyphenmin? The reason I ask is that you report the hyphenation point senten-ce occurring. This is not only wrong, it can only happen if you or one of the packages you load have modified the parameter \righthyphenmin.
    – Mico
    Dec 3, 2014 at 16:03

2 Answers 2

3

Just load microtype and see, if it helps:

% xelatex

\documentclass{article}
\usepackage{polyglossia}
\setdefaultlanguage{english}
\setlength{\textwidth}{6.3em}
\setlength{\parindent}{0em}
%\usepackage{microtype}

\begin{document}
I want to hyphenate this sentence, but the presence of quadruple lines successively hyphenated
\end{document}

Without:

enter image description here

With:

enter image description here

4

enter image description here

The only way I could get that many hyphens in that text is to force tex to prefer them, this shows various alternative settings

\documentclass{article}
\usepackage{ragged2e}
\begin{document}

\def\t{I want to hyphenate this sentence, but the presence of quadruple lines successively hyphenated}

\noindent\mbox{\vrule\ 
\begin{minipage}[t]{3.1cm}
 \hyphenpenalty=-500
\t
\end{minipage}\ \vrule\
\begin{minipage}[t]{3.1cm}
 %\hyphenpenalty=-500
\t
\end{minipage}\ \vrule\
\begin{minipage}[t]{3.1cm}
\raggedright
\t
\end{minipage}\ \vrule\
\begin{minipage}[t]{3.1cm}
\RaggedRight
\t
\end{minipage}\ \vrule}

\end{document}

Your Answer

By clicking “Post Your Answer”, you agree to our terms of service, privacy policy and cookie policy

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