2

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}
  • 1
    use \renewcommand{\abstractname}{Example} after the first abstract. – David Carlisle Jun 9 '15 at 11:41
  • I tried but it did not change the name – vdsvds Jun 9 '15 at 11:41
  • It always helps if you supply an example code, the details depend on the class file's definition of \abstract. (I removed the latex3 tag as I assume your class is not using latex3 code) – David Carlisle Jun 9 '15 at 11:43
  • please see my edit – vdsvds Jun 9 '15 at 11:45
  • Please make example complete documents that people can run, see my answer, also you need to put the redefinition after the first abstract but before (not inside) the second. – David Carlisle Jun 9 '15 at 11:49
2

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

1
\documentclass{article}
\usepackage{abstract}
\begin{document}

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

\end{document}

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.