How can I place a one-column-abstract in a two-column document?

How can I place a one-column-abstract and after that two-column-section in a LaTeX template?

-

migrated from stackoverflow.comSep 11 '11 at 12:40

This question came from our site for professional and enthusiast programmers.

This was (long long time ago) the first question who made me visit UK-TeX FAQ. And I found the answer there. – Ignasi Sep 12 '11 at 9:00

This should make the trick. Important Note: This is a copy-paste from: I've just tested it

\documentclass[twocolumn]{article}
...
\begin{document}
... % \author, etc
\twocolumn[
\begin{@twocolumnfalse}
\maketitle
\begin{abstract}
...
\end{abstract}
\end{@twocolumnfalse}
]

-
Note that \maketitle must be included if you want to avoid a page break before the abstract environment. – Ger Aug 31 '12 at 11:51
Users are advised to see some of the other solutions at the linked page, which is an answer on the TeX FAQ. In particular, to get \thanks to work in the author list (instead of just gobbling the footnotes), use of the abstract package (and the \saythanks command it provides) is advisable. See also tex.stackexchange.com/q/80210/17427 – cyberSingularity Nov 4 '12 at 11:41

If you use the multicol package then you can easily mix different column format

\documentclass{article}
\usepackage{multicol}
\usepackage{lipsum}% for dummy text

\begin{document}
\begin{abstract}
\lipsum[1]
\end{abstract}
\begin{multicols}{2}
\lipsum[2]
\end{multicols}
\end{document}

-

The \twocolumn-command takes an optional argument, which will be printed in one-column-mode.

-
Well, that's exactly what the accepted answer by GuillemB is about, isn't it? – lockstep Sep 11 '11 at 17:23
@lockstep: No, he added an environment (probably he forgot \makeatother) using @twocolumnfalse, but the simple optional argument does the trick. – Keks Dose Sep 11 '11 at 19:54
I stand corrected -- +1. – lockstep Sep 11 '11 at 19:55
His added environment seems to be necessary if you want both the title and the abstract in there. – Mk12 Apr 4 '13 at 0:29

If you use the titling package, which I do anyway, you can use the final hook it provides for \maketitle to hold the abstract.

For example, the following code defines a new command, \myabstract[]{}. The optional argument can be used to specify a different proportion of the \textwidth be used for the abstract. The default is width=.8. To specify something else, just use \myabstract[width=<value between 0 and 1>]{}. The mandatory argument just holds the abstract content.

\documentclass[twocolumn]{article}
\usepackage{expl3,xparse,xcoffins,titling,kantlipsum}
\ExplSyntaxOn
\coffin_new:N \l_my_abstract_coffin
\dim_zero_new:N \l_my_width_dim
\keys_define:nn { my / abstract }
{
width .code:n = {
\dim_set:Nn \l_my_width_dim {#1\textwidth}
}
}
\NewDocumentCommand \myabstract { O {width=.8} m }{%
\keys_set:nn { my / abstract } { #1 }
\SetVerticalCoffin \l_my_abstract_coffin {\l_my_width_dim} {#2}
\renewcommand\maketitlehookd{%
\mbox{}\medskip\par
\centering
\TypesetCoffin \l_my_abstract_coffin
}
}
\ExplSyntaxOff
\begin{document}
\author{A. N. Author\thanks{To somebody.}}
\title{A Gripping Tale}
\myabstract{\kant[1]}
\maketitle
\kant[2-3]
\title{Another Gripping Yarn}
\author{A. Nother Author}
\myabstract[width=.7]{\kant[4]}
\maketitle
\kant[5]
\end{document}


Although I've used xcoffins and expl3 stuff (which I'm not sure I should be mixing at all), you can do this without the alien syntax, still using xcoffins:

\documentclass[twocolumn]{article}
\usepackage{xcoffins,titling,kantlipsum}
\NewCoffin \myabstractcoffin
\newcommand \myabstract[2][.8]{%
\SetVerticalCoffin \myabstractcoffin {#1\textwidth} {#2}%
\renewcommand\maketitlehookd{%
\mbox{}\medskip\par
\centering
\TypesetCoffin \myabstractcoffin}}
\begin{document}
\author{A. N. Author\thanks{To somebody.}}
\title{A Gripping Tale}
\myabstract{\kant[1]}
\maketitle
\kant[2-3]
\title{Another Gripping Yarn}
\author{A. Nother Author}
\myabstract[.7]{\kant[4]}
\maketitle
\kant[5]
\end{document}


Note that the optional argument now just takes the number e.g. .7 rather than width=.7.

Or, most easily of all, just using a minipage environment:

\documentclass[twocolumn]{article}
\usepackage{titling,kantlipsum}
\newcommand \myabstract[2][.8]{%
\renewcommand\maketitlehookd{%
\mbox{}\medskip\par
\centering
\begin{minipage}{#1\textwidth}
#2
\end{minipage}}}
\begin{document}
\author{A. N. Author\thanks{To somebody.}}
\title{A Gripping Tale}
\myabstract{\kant[1]}
\maketitle
\kant[2-3]
\title{Another Gripping Yarn}
\author{A. Nother Author}
\myabstract[.7]{\kant[4]}
\maketitle
\kant[5]
\end{document}

-