## LaTeX forum ⇒ General ⇒ Ragged Right Justification cancels Indentation Topic is solved

LaTeX specific issues not fitting into one of the other forums of this category.
SaneAssasin
Posts: 14
Joined: Thu Feb 07, 2013 1:02 am

### Ragged Right Justification cancels Indentation

Hello everyone,

I am writing a document using the "mla13" package and when I compile, it is all justified and not ragged right, as the style demands. I entered \raggedrightin the preamble, which solved the problem, but now the first line of the paragraph is not indented and entering \indent does not change it.

A minimal working example:
\documentclass{article}\usepackage{mla13} \title{Title}\firstname{First name}\lastname{Last Name}\professor{Professor}\class{Class}\raggedright \begin{document}\makeheaderThis minimal working example will hopefully show the issue I am having where I seem to be unable to have both ragged right and first paragraph indentation.\end{document}

Any suggestions? Thank you!

localghost
Site Moderator
Posts: 9204
Joined: Fri Feb 02, 2007 12:06 pm
The problem is not related to the package at all. Let's take a look at the definition of \raggedright in the LaTeX kernel (file »latex.ltx«).
\def\raggedright{%   \let\\\@centercr\@rightskip\@flushglue \rightskip\@rightskip   \leftskip\z@skip   \parindent\z@}

Note the last line where \parindent is set to 0pt. You can preserve its value by saving it into another length register before using \raggedright.
\documentclass[11pt]{article}\usepackage[T1]{fontenc}\usepackage{lipsum} \newlength{\saveparindent}\setlength{\saveparindent}{\parindent}\raggedright\setlength{\parindent}{\saveparindent} \begin{document}   \lipsum[1]\end{document}

You could also set \parindent by hand. But since it varies with the chosen font size, this is the most convenient way.

Remarks:

Thorsten
LaTeX Community Moderator

¹ System: openSUSE 42.2 (Linux 4.4.52), TeX Live 2016 (vanilla), TeXworks 0.6.1

DarrenG
Posts: 1
Joined: Wed Apr 15, 2015 1:57 pm
Just wanted to say I found this very useful and used it verbatim. Many thanks.