[Tex/LaTex] Copy the abstract environment for acknowledgments

abstractenvironments

I would like to create an acknowledgments environment that's simply the duplicate of the abstract environment, with two exceptions:

  1. It should print Acknowledgments as its heading, not Abstract.

  2. The acknowledgments environment should end with \clearpage.

The answer to Duplicating Environments shows me how to duplicate an environment, but what do I need to do to accomplish the two points above?

\documentclass{article}
\usepackage{filecontents,lipsum}
\begin{filecontents}{mystyle.sty}
\NeedsTeXFormat{LaTeX2e}
\ProvidesPackage{mystyle}
\let\acknowledgments\abstract
\let\endacknowledgments\endabstract
\endinput
\end{filecontents}
\usepackage{mystyle}

\begin{document}
\begin{abstract}
\lipsum[1]
\end{abstract}
\begin{acknowledgments}
\lipsum[1]
\end{acknowledgments}
\end{document}

Best Answer

It seems easier to define the acknowledgments environment as an "abstract wrapper" using the following:

enter image description here

\documentclass{article}
\usepackage{filecontents,lipsum}
\begin{filecontents*}{mystyle.sty}
\NeedsTeXFormat{LaTeX2e}
\ProvidesPackage{mystyle}
\newenvironment{acknowledgments}
  {\renewcommand{\abstractname}{Acknowledgments}% Abstract > Acknowledgements
   \begin{abstract}}
  {\end{abstract}
   \clearpage}
\endinput
\end{filecontents*}
\usepackage{mystyle}

\begin{document}
\begin{acknowledgments}
\lipsum[1]
\end{acknowledgments}
\begin{abstract}
\lipsum[1]
\end{abstract}
\end{document}

The name redefinition to Acknowledgments is temporary within the environment group.

Related Question