10

I am using the ragged2e package in the article class and want the first paragraph within the justify environment to be indented. As such, I used the indentfirst package. However, this does not change the indentation of the first paragraph. Here is a MWE:

\documentclass{article}
\usepackage{ragged2e} % Used to get good looking fully-justified (even on both sides) text
\usepackage{indentfirst} %Used to indent the first paragraph in a section

\usepackage{lipsum} %used to generate filler text

\begin{document}

\begin{justify}
\lipsum[1-2]
\end{justify}

\end{document}
13

It is not that indentfirst doesn't work (my packages always work:-) it's just not relevant here as it only interacts with section headings. justify is a list internally so you need the itemindent to be the same as the parindent:

\documentclass{article}
\usepackage{ragged2e} % Used to get good looking fully-justified (even on both sides) text
%\usepackage{indentfirst} %Used to indent the first paragraph in a section

\usepackage{lipsum} %used to generate filler text

\renewenvironment{justify}{%
   \trivlist
   \justifying
   \itemindent\JustifyingParindent
   \item\relax
   }{%
   \endtrivlist
   }

\begin{document}

\begin{justify}
\lipsum[1-2]
\end{justify}

\end{document}
  • My apologies for the inappropriate title :) I've always thought of \trivlist as creating separate paragraphs, but it seems that metaphor breaks down here. Thanks for the help, David. – adamglesser Jun 26 '13 at 20:27
  • 2
    @adamglesser argualbly its a deficiency in the package that justify ought to give you a paragraph indent as in the answer here unless the first para pf a section ie use something like \if@nobreak\if@afterindent\itemindent\JustifyingParindent\fi\else\itemindent\JustifyingParindent\fi – David Carlisle Jun 26 '13 at 20:36

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.