The abstract package

Changes the layout of the abstract environment (heading font, text font, indents) and provides onecolabstract for a full-width abstract in a two-column document.

Loading the package

\usepackage{abstract}

The standard classes set the abstract in a fixed way: small type, a centred bold heading and indented margins. With this package each of these parts is a command or a length that you redefine.

In a document with the class option twocolumn, the abstract normally sits in the first column. onecolabstract inside the optional argument of \twocolumn sets title and abstract across both columns.

Main commands

\renewcommand{\abstractnamefont}{\normalfont\bfseries}Font of the heading "Abstract".
\renewcommand{\abstracttextfont}{\normalfont\small\itshape}Font of the abstract text.
\setlength{\absleftindent}{1cm}Indent of the abstract on the left; \absrightindent sets the right side.
\renewcommand{\abstractname}{Summary}Text of the heading.
addtotocOption: adds the abstract to the table of contents.
runinOption: the heading starts the first line of the text instead of standing above it.
\begin{onecolabstract} ... \end{onecolabstract}Abstract across the full width in a two-column document.
\saythanksPrints the \thanks footnotes of the title when \maketitle stands inside \twocolumn[...].

Complete example

\documentclass[twocolumn]{article}
\usepackage{abstract}
\renewcommand{\abstractnamefont}{\normalfont\bfseries}
\renewcommand{\abstracttextfont}{\normalfont\small\itshape}
\title{Line numbers in long documents}
\author{A. Author}
\begin{document}
\twocolumn[
  \maketitle
  \begin{onecolabstract}
  We compare two ways of numbering lines and measure the compile time of each.
  \end{onecolabstract}
  \vspace{1cm}
]
\saythanks
\section{Introduction}
The text of the article starts here, in two columns.
\end{document}
Result
The compiled example

Open in the editor

Compiled with pdfLaTeX from TeX Live 2023.

Pitfalls

Related pages