0

I know abstract usually is not defined for book classes, but you can define it by yourself as a workaround. However, it seems to always force itself on a new page, i.e. it forces a single page for an abstract. This is bad, if I e.g. want to add multiple abstracts for different languages (e.g. one for the language the paper is written in and one in English).

Here is the simplified code:

% !TeX program = lualatex
% !BIB TS-program = biber
% !TeX encoding = UTF-8
% !TeX spellcheck = de_DE
\documentclass[12pt,a4paper,notitlepage,numbers=noenddot,oneside]{scrbook}

% deutsch
\usepackage[english, ngerman]{babel}
\usepackage[english, ngerman]{isodate}
\usepackage{lmodern} % font
\usepackage[autostyle, german=quotes]{csquotes} % deutsche Anführungszeichen mit \enquote

% abstract in book, https://tex.stackexchange.com/a/539606/98645
\newenvironment{abstract}{}{}
\usepackage{abstract}

\begin{document}
    \begingroup
    \setstretch{1.0}
    \hypersetup{hidelinks}
    \tableofcontents
    \endgroup
    
    \pagebreak

%   \vfill
    
    \begin{abstract}
        Dies ist ein schöner Beispieltext für einen Abstract für ein Paper darüber, wie Abstracts ohne allzu viel Abstraktion abstrahiert werden können.
    \end{abstract}
    
    \selectlanguage{english}
    \begin{abstract}
        This is a nice example text for an abstract for a paper about how abstracts can be abstracted without too much abstraction.
    \end{abstract}
    \selectlanguage{ngerman}

    % […]
\end{document]

This way, it forces a new page for each abstract. I have experimented with redefining the abstract beginning and end, but by using the code there and adding some \vfill's I could get it one one page, but then it was not vertically centered anymore. I have also tested onecolabstract instead of the abstract env, but it did not make a difference. The abstract package also does not seem to provide any helpful options here, according to it's doc.

And yes I have seen this question, but it is about a document with a report style, where apparently the abstract is never put on a single page, respectively the abstract package does not force a page break. As such, the answers there just circle around how to put the title on the same page etc.

And BTW, no, switching to another LaTeX style is not solution – I want the book style for other reasons, obviously.

Basically my aim can be summarized like this: I want to put two abstracts one one page and have them nicely centered just like when you only have one abstract one one page.

1
  • Vertical centering requires balancing the \vfills before and after, and possibly throwing in a \null at the bottom of the page. Jul 16 '20 at 13:28
1

You can use an abridged version of abstract from scrartcl:

% !TeX program = lualatex
% !BIB TS-program = biber
% !TeX encoding = UTF-8
% !TeX spellcheck = de_DE
\documentclass[12pt,a4paper,notitlepage,numbers=noenddot,oneside]{scrbook}

% deutsch
\usepackage[english, ngerman]{babel}
\usepackage[english, ngerman]{isodate}
\usepackage{lmodern} % font
\usepackage[autostyle, german=quotes]{csquotes} % deutsche Anführungszeichen mit \enquote

\makeatletter
\newif\if@abstractlanguage
\newenvironment{abstract}[1][]
 {%
  \par\addvspace{3\baselineskip} % adjust to suit
  \if\relax\detokenize{#1}\relax
    \else\@abstractlanguagetrue
    \begin{otherlanguage}{#1}%
  \fi
  \begin{center}
  \normalfont\sectfont
  \nobreak\abstractname\@endparpenalty\@M\end{center}
  \begin{quotation}
 }
 {%
  \end{quotation}%
  \if@abstractlanguage\end{otherlanguage}\fi
 }
\makeatother


\begin{document}

\begin{abstract}
Dies ist ein schöner Beispieltext für einen Abstract für ein Paper darüber, 
wie Abstracts ohne allzu viel Abstraktion abstrahiert werden können.
\end{abstract}
    
\begin{abstract}[english]
This is a nice example text for an abstract for a paper about how abstracts 
can be abstracted without too much abstraction.
\end{abstract}

\end{document}

enter image description here

If you want to center them in the page, you can define a wrapper environment:

% !TeX program = lualatex
% !BIB TS-program = biber
% !TeX encoding = UTF-8
% !TeX spellcheck = de_DE
\documentclass[12pt,a4paper,notitlepage,numbers=noenddot,oneside]{scrbook}

% deutsch
\usepackage[english, ngerman]{babel}
\usepackage[english, ngerman]{isodate}
\usepackage{lmodern} % font
\usepackage[autostyle, german=quotes]{csquotes} % deutsche Anführungszeichen mit \enquote

\makeatletter
\newif\if@abstractlanguage
\newenvironment{abstracts}{\cleardoublepage\vspace*{\fill}}{\vspace*{\fill}}
\newenvironment{abstract}[1][]
 {%
  \par\addvspace{3\baselineskip} % adjust to suit
  \if\relax\detokenize{#1}\relax
    \else\@abstractlanguagetrue
    \begin{otherlanguage}{#1}%
  \fi
  \begin{center}
  \normalfont\sectfont
  \nobreak\abstractname\@endparpenalty\@M\end{center}
  \begin{quotation}
 }
 {%
  \end{quotation}%
  \if@abstractlanguage\end{otherlanguage}\fi
 }
\makeatother


\begin{document}

\begin{abstracts}

\begin{abstract}
Dies ist ein schöner Beispieltext für einen Abstract für ein Paper darüber, 
wie Abstracts ohne allzu viel Abstraktion abstrahiert werden können.
\end{abstract}
    
\begin{abstract}[english]
This is a nice example text for an abstract for a paper about how abstracts 
can be abstracted without too much abstraction.
\end{abstract}

\end{abstracts}

\end{document}

enter image description here

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.