I know how to turn off hyphenation via \nohyphens{.....} (from hyphenat). But what I'd really like would be to hyphenate smartly. What I mean by this should hopefully be made clear by the following example.

On the left is a piece of text from a column in a table, rendered with the \nohyphens{...} command. This leaves a lot of open white space. On the right is the same text typeset by vanilla XeLaTeX. As you can see, it still leaves a big white space in the middle of the text, and it also introduces the rather strange hyphenation, "or-phaning", instead of, for example, the more natural "cor-rections".
No hyphenation at all Default behavior

Here is a smarter version that is made by me introducing "cor-rections" into the source code:

some by hand tweaking

To my eye at least, this seems much better than either of the versions above.

So the basic question is: Could I get LaTeX to do this for me automatically, for example by specifying the longest acceptable inter-word whitespace?

PS. Another more complex solution would be to specify a "target width" for the columns in my table, e.g. .25\textwidth and then have the system optimize to produce a table that brings me as close to my specified whitespace score and table width as possible, while minimizing the number of hyphenated words... but I don't know if LaTeX can do this sort of dynamic optimization in several variables! Here's one last image where I have gotten rid of the hyphenation entirely, by moving to .27\textwidth for columns. This seems to be the most readable version yet.

enter image description here

  • 1
    Kindly add a minimal working example (MWE) that illustrates your problem. It will be much easier for us to reproduce your situation and find out what the issue is when we see compilable code, starting with \documentclass{...} and ending with \end{document}. Apr 5, 2013 at 16:51
  • 1
    AFAIKT, the example is the picture -- this behavior should be familiar to anyone who uses LaTeX. But if it helps anyone, here's a Gist gist.github.com/holtzermann17/5320882 with a table that includes LOTS of inter-word white space. Apr 5, 2013 at 17:00
  • 2
    narrow columns always pose a nasty problem for attractive justification. since the default hyphenation patterns produce cor-rec-tions, not to mention han-dled or-phan-ing mech-a-nism non-re-spon-sive au-thors, i'm wondering whether you're using them at all before trying \nohyphens. Apr 5, 2013 at 17:02
  • @barbarabeeton - I don't think I'm doing anything to change the default hyphenation. Here's the same table typeset using my actual preamble. This is a NON-minimal example, since I'm doing a lot of things in the preamble... but again, I don't think there's anything there to change the hyphenation patterns. gist.github.com/holtzermann17/5320983 (Should there be? I.e. I think this is what I'm asking in the question above - is there anything to do to get LaTeX to hyphenate more aggressively?) Apr 5, 2013 at 17:15
  • For narrow columns raggedright (see ragged2e) will usually be better; if you insist on justified text, use microtype and LuaTeX/pdfTeX. Apr 6, 2013 at 15:50

2 Answers 2


When trying to typeset text in very narrow measures, it's sometimes best (least worst?!) to use the \sloppy directive, as is done in the following example.

It can also be helpful in such situations to set \righthyphenmin2. (For English-language texts, the default value of this parameter is 3.)

enter image description here

  % \textwidth = 8.5"-2*3.38" = 1.74"
\setmainfont[Ligatures=TeX]{Linux Libertine O}
Quality control is handled with corrections and the ``orphaning'' mechanism in case 
of nonresponsive authors. Some articles are world-writeable, as in the wiki model.
  • I tried with the full example from the Gist, and it's not clear that \sloppy has that much of an impact. However, your point about \righthyphenmin is a good one. I think what really matters here is \lefthyphenmin, in particular, \lefthyphenmin=3 will solve the problem of the awkward "or-phaning". (Cf. tex.stackexchange.com/questions/40324/pdflatex-and-hyphenation) However, honestly this seems a bit more like a clever hack than a "smart" solution. As in your example and my postscript, you can get arbitrarily good typesetting by changing the region width. Apr 5, 2013 at 18:18
  • 3
    @JoeCorneli - If you're allowed to switch from XeLaTeX to LuaLaTeX (you're advisor might object, who knows!), you could make use of the microtype package to even out the "grayness value" of the textblock. I'd call that a pretty smart solution. :-) Incidentally, I couldn't run the example you posted to github as it makes use of a few fonts I don't have on my system.
    – Mico
    Apr 5, 2013 at 18:31
  • latest version of microtype seems to work with XeLaTeX too, indeed, it's the walk-through example in tlmgr help. Following the walkthrough didn't work for me, but sudo /usr/local/texlive/2012/bin/x86_64-linux/tlmgr update --all did. I've compiled the document with \usepackage[protrusion=true]{microtype} and some of the other tweaks and things are indeed looking a bit better... Apr 5, 2013 at 19:45
  • @JoeCorneli - the more I contemplate the matter, the less convinced I am that setting \lefthyphenmin3 is a good solution. As you must know too, there are tons of English words that start with prefixes such as in, re, or un. For such words, it should be unobjectionable to hyphenate them after the prefix (in-quire, re-set, re-view, re-wind, un-clear, etc). Suppressing all hyphenation after two letters is bound to create more problems that it solves. If it's mostly about dealing with orphaning, you can always provide the instruction \hyphenation{orphan-ing} in the preamble, right?
    – Mico
    Apr 6, 2013 at 5:40

I'm not sure why you are using \nohyphens I'd have thought you want more rather than less. Using the linked table as you don't supply code for the example in the question I get this which isn't too bad, although could obviously be tweaked a bit more.

enter image description here





\begin{tabular}{|*{3}{>{\hyphenpenalty0 }p{.25\textwidth}|}}
% \multicolumn{1}{p{.25\textwidth}}{\textbf{Relevance}}

Ultimately relevance depends on peer review, and irrelevant content
may be deleted. Mechanisms to ensure that relevant content
\emph{will} be added could be improved. &
People contribute articles about what
they're interested in; apart from this, rules like WP:WEIGHT come into

Anyone can upload projects (for ``full projects'', one time approval
is needed), but getting changes into the core requires considerably
more vetting. \\
Quality control is handled with corrections and the ``orphaning'' mechanism
in case of nonresponsive authors. Some articles are world-writeable,
as in the wiki model. & Automated tools for spam and vandalism detection
combined with a system of editorial oversight, in which Jimmy Wales
has last say. & In addition to bug reports and feature requests handled
through the issue tracker, modules can make use of an automated patch
testing system.\\
Peer review is distributed. Links are handled automatically. Caching
is deployed where relevant; in particular, interlinking features are
kept up to date. & The database and other infrastructure is massively
scaled. There are many bots that help with small tasks. & In theory,
anyone can join. Earl Miles, NYCCamp 2012 keynote: ``\emph{There are
no insiders, except Dries; there are no outsiders, only resumes.}''
% \multicolumn{1}{p{.25\textwidth}}{\textbf{Consistency}}
Although automatic links and corrections can help with consistency,
mainly PM relies on standards for proof and expository quality.
&NPOV is the key rule, which works together with templates and other
process tools to maintain community standards about style and
content. & The project issue queues are the place to go when one
module's changes breaks another's. The core of the project has
considerable oversight in these
% \multicolumn{1}{p{.25\textwidth}}{\textbf{Motivation}}
People are solving some of their learning, exposition, and social
needs on the site by writing and reviewing articles and posting in the
forums.& As of 2006, over 50\% of the site had been written by less
than 1\% of the users; these days, paid editing is somewhat
notorious.& Miles continued: ``\emph{To build a resume, find someone
who needs help, and help them. Find something that needs doing, do
it.}'' \\ \hline
\caption{As typeset ``out of the box''}


If you allow a bit of flexibility on the right margin, and add microtype you get:



   >{\hyphenpenalty0 \rightskip0pt plus .3em \emergencystretch2em}%

enter image description here

  • 3
    @JoeCorneli - If your adviser can be placated if you write \mbox{orphan}\-ing, which suppresses the first of two possible hyphenation points in or-phan-ing, I'd go for it. More generally, to suppress all hyphenation instances after just two characters in a word, set \lefthyphenmin3.
    – Mico
    Apr 5, 2013 at 18:16
  • 2
    @JoeCorneli since TeX only hyphenates to minimise the badness property of the paragraph, preventing hyphens will in almost all cases increase white space. Apr 5, 2013 at 22:19
  • 5
    @JoeCorneli Are you sure you should be taking advice on hyphenation and line breaking from a Word user? Apr 5, 2013 at 22:47
  • 1
    @JoeCorneli - There's a good reason why most Word users don't use hyphenation: It doesn't work all that well! It's certainly vastly inferior to TeX's hyphenation algorithm. Of course, no hyphenation algorithm will ever be perfect. In TeX, you always have the option to create hyphenation exceptions via the \hyphenation command (to be inserted in the preamble). Use - characters to indicate where hyphenation should be allowed in the words listed in the argument of the \hyphenation command.
    – Mico
    Apr 6, 2013 at 5:50
  • 1
    @JoeCorneli Questions should always have complete document examples (if you expect people to test their answers). It is of course possible for latex to try multiple widths, but it really only makes sense for single isolated paragraphs like figure captions: in a table where all the widths need to add up to the text width, and different paragraphs in different entries want different values I can not really think of a good algorithm. (Implementing it in latex probably isn't the problem if there is an algorithm to be implemented) Apr 7, 2013 at 12:47

You must log in to answer this question.

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