[Tex/LaTex] Modify revtex abstract

abstractrevtex

I'm trying to modify the abstract style of a revtex 4.1 document and am running into problems. I'm just using the revtex-4.1 style file for a personal project (i.e. not worried about submitting to a journal or similar). So far if I try to use \renewenvironment{abstract} as in the first answer to this question:

How to adjust the width of abstract?

the abstract is formatted how I want, except it appears below the title when I compile. A minimal example using \renewenvironment:

\documentclass[10pt,a4paper,aps,pra,twocolumn,superscriptaddress]{revtex4-1}
\usepackage{lipsum}

\renewenvironment{abstract}
{\onecolumngrid
    \list{}{%
        \setlength{\leftmargin}{.5in}% 
        \setlength{\rightmargin}{\leftmargin}%
        }%
        \item\relax}
        {\endlist}

\begin{document}
\title{Some title}
\author{Some vagrant}
\affiliation{Some box}

\begin{abstract}
\lipsum[1]
\end{abstract}
\maketitle

\lipsum[2]
\end{document}

Thanks!

Best Answer

You can hook into the parameters used by revtex4-1:

\documentclass[10pt,a4paper,aps,pra,twocolumn,superscriptaddress]{revtex4-1}

\usepackage{lipsum}

\makeatletter
\renewcommand\frontmatter@abstractwidth{\dimexpr\textwidth-1in\relax}
\makeatother

\begin{document}
\title{Some title}
\author{Some vagrant}
\affiliation{Some box}

\begin{abstract}
\lipsum[1]
\end{abstract}
\maketitle

\lipsum[2]
\end{document}

The macro \frontmatter@abstractwidth is set by the journal options, so you can override it; the abstract is typeset in a box as wide as stated by \frontmatter@abstractwidth and horizontally centered on the page.

enter image description here