Text FormattingTwo Abstracts on one Page

Information and discussion about LaTeX's general text formatting features (e.g. bold, italic, enumerations, ...)
Post Reply
krasnal1988
Posts: 8
Joined: Tue May 10, 2011 10:31 pm

Two Abstracts on one Page

Post by krasnal1988 »

Hi.

I want to put two abstracts on one page. How to do it? When I end first abstract, second one starts on new page.

Code: Select all

\begin{abstract}
Streszczenie
%{{\bf Słowa kluczowe} ???}
\end{abstract}

\selectlanguage{english}
\begin{abstract}
Here will be abstract in English.
\end{abstract}
Someone know how to do it? Thanks in advance.

Recommended reading 2024:

LaTeXguide.org • LaTeX-Cookbook.net • TikZ.org

NEW: TikZ book now 40% off at Amazon.com for a short time.

Frits
Posts: 169
Joined: Wed Feb 02, 2011 6:02 pm

Re: Two Abstracts on one Page

Post by Frits »

We'll need a Minimal Working Example for this one, since the way abstracts are printed are documentclass dependent.
howtoTeX.com - Your LaTeX resource site (Tips, Tricks, Templates and more!)
Follow howtoTeX on twitter
krasnal1988
Posts: 8
Joined: Tue May 10, 2011 10:31 pm

Two Abstracts on one Page

Post by krasnal1988 »

Sorry.

Code: Select all

\documentclass[12pt,a4paper,titlepage]{article}

\usepackage[utf8]{inputenc}
\usepackage{amsfonts,amssymb,amsthm,amsmath}
\usepackage[english,polish]{babel}
\usepackage[OT4]{fontenc}
\usepackage[plmath]{polski}
\usepackage[section]{algorithm}
\usepackage[labelsep=period,justification=justified,singlelinecheck=false]{caption}
\usepackage{algpseudocode}
\usepackage{indentfirst}

\begin{document}

\begin{abstract}
Streszczenie
%{{\bf Słowa kluczowe} ???}
\end{abstract}

\selectlanguage{english}
\begin{abstract}
Here will be abstract in English.
\end{abstract}

rest of article...
\end{document}
User avatar
localghost
Site Moderator
Posts: 9202
Joined: Fri Feb 02, 2007 12:06 pm

Two Abstracts on one Page

Post by localghost »

If the abstract package doesn't offer a solution, you can try this. It is based on a redefinition of the abstract enviroment

Code: Select all

\documentclass[12pt,a4paper,titlepage]{article}
\usepackage[OT4]{fontenc}
\usepackage[utf8]{inputenc}
\usepackage[english,polish]{babel}
\usepackage[plmath]{polski}
\usepackage{blindtext}

\makeatletter
\if@titlepage
  \renewenvironment{abstract}{%
      \null\vfil
      \@beginparpenalty\@lowpenalty
      \begin{center}%
        \bfseries \abstractname
        \@endparpenalty\@M
      \end{center}}%
     {\par\vfil\null}
\else
  \renewenvironment{abstract}{%
      \if@twocolumn
        \section*{\abstractname}%
      \else
        \small
        \begin{center}%
          {\bfseries \abstractname\vspace{-.5em}\vspace{\z@}}%
        \end{center}%
        \quotation
      \fi}
      {\if@twocolumn\else\endquotation\fi}
\fi
\makeatother

\title{Two Abstracts on one Page}
\author{krasnal1988}

\begin{document}
  \maketitle

  \begin{abstract}
    Streszczenie
  \end{abstract}

  \selectlanguage{english}
  \begin{abstract}
    Here will be abstract in English.
  \end{abstract}

  \newpage
  \blinddocument
\end{document}
The blindtext package is only for creating dummy text, thus not part of the solution.


Thorsten
krasnal1988
Posts: 8
Joined: Tue May 10, 2011 10:31 pm

Two Abstracts on one Page

Post by krasnal1988 »

Thank you:) one more question - Normally page with abstract is without number. I want to have abstracts, next would be table of contents (this page should have number 1) . When I use your modification, page with abstracts is numbered. When I use \thispagestyle{empty} for abstracts page there's no number, but page with tables of contents have number 2. How to change it?

EDIT:

I just find the answer:) Before command \tableofcontents i put

Code: Select all

\setcounter{page}{1}
\pagenumbering{arabic}
User avatar
localghost
Site Moderator
Posts: 9202
Joined: Fri Feb 02, 2007 12:06 pm

Two Abstracts on one Page

Post by localghost »

Replace the redefinition from my earlier reply with these lines.

Code: Select all

\makeatletter
\if@titlepage
  \renewenvironment{abstract}{%
      \thispagestyle{empty}
      \null\vfil
      \@beginparpenalty\@lowpenalty
      \begin{center}%
        \bfseries \abstractname
        \@endparpenalty\@M
      \end{center}}%
     {\par\vfil\null}
\else
  \renewenvironment{abstract}{%
      \if@twocolumn
        \section*{\abstractname}%
      \else
        \small
        \begin{center}%
          {\bfseries \abstractname\vspace{-.5em}\vspace{\z@}}%
        \end{center}%
        \quotation
      \fi}
      {\if@twocolumn\else\endquotation\fi}
\fi
\makeatother
krasnal1988
Posts: 8
Joined: Tue May 10, 2011 10:31 pm

Re: Two Abstracts on one Page

Post by krasnal1988 »

Your solution doesn't work like I want.

In yours, page with abstracts has number, but number is hide and next page has number 2. I want have number 1 on next page :)
User avatar
localghost
Site Moderator
Posts: 9202
Joined: Fri Feb 02, 2007 12:06 pm

Two Abstracts on one Page

Post by localghost »

I just forgot a line. Next try.

Code: Select all

\makeatletter
\if@titlepage
  \renewenvironment{abstract}{%
      \thispagestyle{empty}
      \setcounter{page}{0}
      \null\vfil
      \@beginparpenalty\@lowpenalty
      \begin{center}%
        \bfseries \abstractname
        \@endparpenalty\@M
      \end{center}}%
     {\par\vfil\null}
\else
  \renewenvironment{abstract}{%
      \if@twocolumn
        \section*{\abstractname}%
      \else
        \small
        \begin{center}%
          {\bfseries \abstractname\vspace{-.5em}\vspace{\z@}}%
        \end{center}%
        \quotation
      \fi}
      {\if@twocolumn\else\endquotation\fi}
\fi
\makeatother
Post Reply