6

How is it possible to avoid LaTeX putting an abstract on a new page when using article class and titlepage enabled?

\documentclass[11pt,a4paper,titlepage]{article}
\begin{document}
Some text...
\begin{abstract} Some text unfortunately put on a new page \end{abstract}
\end{document}

Thanks for any help!

2 Answers2

4

As long you are not using twocolumn option, this will work.

I patched out the occurence of \newpage in the titlepage environment, which is used due to the titlepage option.

Since the original code contains @ characters, \makeatletter and \makeatother have to be used to give @ a different meaning temporarily.

\documentclass[11pt,a4paper,titlepage]{article}
\usepackage{xpatch}
\usepackage{blindtext}
\makeatletter
\xpatchcmd{\titlepage}{\@restonecolfalse\newpage}{\@restonecolfalse}{}{}
\xpatchcmd{\endtitlepage}{\if@restonecol\twocolumn \else \newpage \fi}{\if@restonecol\twocolumn \else  \fi}{\typeout{success}}{\typeout{fail}}
\makeatother
\begin{document}
Some text...

\begin{abstract} \blindtext \end{abstract}

Regular text:

\blindtext
\end{document}

enter image description here

  • I don't know at all what I'm doing there but it works perfectly so thank you very much ^_^ – Oliver Borchert Feb 18 '15 at 19:05
  • @OliverBorchert: An alternative would be to copy the abstract/titlepage code from article.cls and redefine it. So this is basically one 'smarter' approach. –  Feb 18 '15 at 19:07
0

You can also just avoid using the abstract class altogether:

\begin{document}

\subsection*{Abstract}
Abstract text here

\section{First regular section}
Lorem ipsum

\end{document}
Doubt
  • 371
  • 1
  • 3
  • 8