1

I have the abstract for my paper on a separate page, hence there is no need to have the extra indentation on either side of the abstract environment to indicate that it is an abstract.

There is an answer to how to do that in How to adjust the width of abstract?, in which it seems to me that the entire definition of the abstract environment is repeated with an adjustment of the setlength macro within that definition.

I am, however, already using etoolbox to remove indentation in the abstract environment (following lockstep's suggestion to Remove paragraph indent from abstract in article class), and in that case, the entire definition of the abstract is not repeated - it simply adds something extra to the existing definition.

I am, therefore, wondering if I could do the same to remove the indentation. Can I use etoolbox to remove the indentation in a similar way as is done below to remove the indentation?

\documentclass{article}
\usepackage{lipsum,etoolbox}
\ifundef{\abstract}{}{\patchcmd{\abstract}%
    {\quotation}{\quotation\noindent\ignorespaces}{}{}}
\begin{document}
    \begin{abstract}
        \lipsum[1]
    \end{abstract}
\lipsum[2]
\end{document}
1
\documentclass{article}
\usepackage{lipsum}
\usepackage{abstract}

%\setlength{\absparindent}{0em}%
%\AtBeginDocument{\setlength{\absparindent}{0em}}
\setlength{\absleftindent}{0em}
\setlength{\absrightindent}{0em}

\begin{document}
\setlength{\absparindent}{0em}
    \begin{abstract}
        \lipsum[1]
    \end{abstract}
\lipsum[2-3]
\end{document}

enter image description here

  • This works, but I prefer to avoid putting global non-document specific settings inside the actual document (they go in a custom .sty file I make instead). That way I don't have to remember to repeat it every time I write a document in that style. – Sverre Apr 24 '14 at 10:59
  • @Ok, that is true -- using \AtBeginDocument is the correct way. – user31729 Apr 24 '14 at 11:03
0

Following up on Christian's comment, it's probably easiest to do this with the abstract package and the \absleftindent/\absrightindent macros. Note, however, that this package contains the following line:

AtBeginDocument{\setlength{\absparindent}{\parindent}}

The effect of that line means that changing the paragraph indent of the abstract environment with \absparindent has no effect, since it's automatically reverted to the global setting of \parindent anyway. The only way I've found to avoid this is to first set \parindent to whatever you want \absparindent to be, and then change \parindent to what you actually want \parindent to be. Maybe there's a better way.

\documentclass{article}
\usepackage{lipsum,abstract}
\setlength{\absleftindent}{0em}
\setlength{\absrightindent}{0em}
\parindent = 0em % use this instead of \absparindent
\AtBeginDocument{\parindent = 1.5em} % then set \parindent
\begin{document}
    \begin{abstract}
        \lipsum[1]
    \end{abstract}
\lipsum[2-3]
\end{document}

enter image description here

  • Why do you not set the \absparindent right after \begin{document}? See my 'other' answer below – user31729 Apr 24 '14 at 10:58
  • @ChristianHupfer See my comment to your answer :) – Sverre Apr 24 '14 at 11:02

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.