2

Is there a way to make LaTeX hyphenate much more to make spacing in justified text more even? I am trying to achieve the justification used in Renaissance-era typography (Bram de Does and other typographers following tradition also do this), which seems to often use a large amount of hyphenation to achieve better spacing.

In addition to all this, InDesign (which uses the TeX line-breaking algorithm) has a slider that goes from ‘better spacing’ to ‘fewer hyphenations’. Is there a way to get something like this in LaTeX?

I tried decreasing the \hyphenpenalty to 0, but this did not have the desired effect. I am wondering if it is possible to increase the penalty for bad spacing in addition to this …

Update

A new question that asks the same base question, but gets at the core better. I realised that I didn’t express myself very well in this question, so I have created a new one. It also takes into account what I learned from the answer, namely that hyphenation cannot save bad justification.

  • 1
    Making hyphenation more desirable can actually increase the number of lines. – egreg Oct 7 '18 at 13:15
6

You can make \hypenpenalty negative, if you wish to go this way.

Sample output

\documentclass{article}

\usepackage[main=latin]{babel}
\usepackage{lipsum}
\usepackage[width=15cm]{geometry}
\usepackage{multicol}

\setlength{\columnsep}{1cm}

\begin{document}


\begin{multicols*}{2}
  \lipsum[1]

  \columnbreak

  {\hyphenpenalty=-200 \lipsum[1] }
\end{multicols*}
\end{document}

(I have loaded babel with the latin option as the lipsum text is in Latin.) Note that as egreg points out, encouraging more hyphenation does not necessarily improve the spacing.

There are a number of other approaches to get better spacing in narrow columns. One is using the microtype package, that makes subtle minor adjustments to spacing to get better line breaks. See What are penalties and which ones are defined? for a discussion of various parameters that can be tweaked. Here is the effect of the microtype package:

Sample output

\documentclass{article}

\usepackage[main=latin]{babel}
\usepackage{lipsum}
\usepackage[width=15cm]{geometry}
\usepackage{multicol}
\usepackage{microtype}

\setlength{\columnsep}{1cm}

\begin{document}


\begin{multicols*}{2}
  \microtypesetup{activate=false}
  \lipsum[1]

  \columnbreak

  {\microtypesetup{activate=true} \lipsum[1] }
\end{multicols*}
\end{document}
  • Lipsum text is not really a good specimen, because it's in pseudo Latin. You may try with kantlipsum or other packages that provide English text. – egreg Oct 7 '18 at 13:27
  • @egreg Of course. I have now updated so latin hyphenation patterns are used. – Andrew Swann Oct 7 '18 at 15:27
  • 1
    And now it shows better the issue: with more frequent hyphenation the spaces increase. – egreg Oct 7 '18 at 15:29

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.