This code






produces three paragraphs with a ragged right edge and no paragraph indentation. Why? And how can I get a ragged right edge with paragraph indentation?

Also -- please feel free to add tags to this post; I didn't quite know what would be best.

  • I've added the tags 'indentation' and 'ragged2e'. – Mico Jun 21 '14 at 21:30

The definition of \raggedright in the LaTeX kernel is

% latex.ltx, line 3974:
  \let\\\@centercr\@rightskip\@flushglue \rightskip\@rightskip

Thus you can say in your document preamble

  \let\\\@centercr\@rightskip\@flushglue \rightskip\@rightskip

removing the last instruction. Now \iraggedright will do what you want.

A different approach is to use ragged2e





enter image description here

Note that \RaggedRight is less strict than \raggedright in that it allows hyphenation, so making “less ragged” output.


It is common practice to typeset flush-left (aka ragged-right) paragraphs without indentation of the first lines of paragraphs. To compensate for this, one usually also inserts a bit of extra whitespace between paragraphs. You could get this effect (i.e., the extra spacing between paragraphs) by loading the parskip package.

To restore indentation of the first line of a paragraph, you could issue the command

\setlength\parindent{2em} % or whatever length you desire

after issuing the command \raggedright.

If you really need to typeset entire paragraphs in ragged-right mode, you should consider loading the ragged2e package and issuing the command \RaggedRight (notice the capitalization of the two Rs), either in the preamble or at the start of the material you want to get typeset ragged-right (flush-left). Doing so will (re)enable hyphenation, making the right-hand edges of paragraphs look much less ragged looking (pun intended) than if you used \raggedright. As @MartinSchröder -- the author of the ragged2e package -- has pointed out in a comment, the package provides the parameter \RaggedRightParindent. You could set this parameter equal to the basic \parindent parameter to re-enable indentation of the first line of every paragraph. Importantly, you should set the value of this length parameter before issuing the command \RaggedRight.

\setlength\RaggedRightParindent{\parindent} % default value of this parameter is `0pt`
\RaggedRight % if invoked in preamble, entire document is set Ragged-Right
  • 1
    Ehm. ragged2e offers \RaggedRightParindent. – Martin Schröder Jun 22 '14 at 12:02
  • @MartinSchröder - Thanks for this; I've revised the final paragraph of my answer to mention this parameter and how it might/should be modified to re-enable indentation of the first line of paragraphs. – Mico Jun 22 '14 at 13:16

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.