Welcome to the UK List of
TeX Frequently Asked Questions
on the Web

Searching

The index of Frequently Asked Questions about TeX is searchable.

Please enter your keyword here:   then press here: ,    or:
Google

Setting text ragged right

The trick with typesetting ragged right is to be sure you’ve told the TeX engine “make this paragraph ragged, but never too ragged”. The LaTeX \raggedright command (and the corresponding flushleft environment) has a tendency to miss the “never” part, and will often create ridiculously short lines, for some minor benefit later in the paragraph. The Plain TeX version of the command doesn’t suffer this failing, but is rather conservative: it is loath to create too large a gap at the end of the line, but in some circumstances — such as where hyphenation is suppressed — painfully large gaps may sometimes be required.

Martin Schröder’s ragged2e package offers the best of both worlds: it provides raggedness which is built on the Plain TeX model, but which is easily configurable. It defines easily-remembered command (e.g., \RaggedRight) and environment (e.g., FlushLeft) names that are simply capitalised transformations of the LaTeX kernel originals. The documentation discusses the issues and explains the significance of the various parameters of ragged2e’s operation.

ragged2e.sty
Distributed as part of macros/latex/contrib/ms (or browse the directory); catalogue entry


Go to previous question, or next question

Go to FAQ home.

URL for this question: http://www.tex.ac.uk/cgi-bin/texfaq2html?label=ragright

Comments, suggestions, or error reports? - see “how to improve the FAQ”.

This is FAQ version 3.28, released on 2014-06-10.