[Tex/LaTex] Changing two abstract names in same document

abstract

I have a LaTeX document with two abstracts (in two different languages)

I would like to change the 'abstract' to another title.

I cannot use \renewcommand{\abstractname}{Example} because I need to define two different abstract names.

Can this be done somehow?

\usepackage{abstract}
\begin{abstract}
\renewcommand{\abstractname}{Example}
cdsvsdavsa
\end{abstract}
\pagebreak
\begin{abstract}
\renewcommand{\abstractname}{Example2}
cdsvsdavsa
\end{abstract}

Best Answer

The following example uses package babel to add support for different languages. The example uses english as main language and adds a abstract in ngerman. Environment abstract uses \abstractname, which is automatically redefined for different languages. Also switching the language sets the correct hyphenation patterns for the language.

\documentclass{article}
\usepackage[ngerman, english]{babel}

\begin{document}
  \begin{abstract}
    Abstract in English.
  \end{abstract}

  \begin{otherlanguage}{ngerman}
    \begin{abstract}
      Zusammenfassung in deutscher Sprache.
    \end{abstract}
  \end{otherlanguage}
\end{document}

Result