I would like to create an acknowledgments environment that's simply the duplicate of the abstract environment, with two exceptions:
It should print
Acknowledgmentsas its heading, notAbstract.The
acknowledgmentsenvironment 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}

Overwriting file './mystyle.sty'.? and how it could be solved? – juanuni Jun 25 '18 at 17:54filecontentspackage it allows one to overwritemystyle.stywith every compilation if you use\begin{filecontents*}{mystyle.sty} ... \end{filecontents*}. Without thefilecontentspackage, the file won't be overwritten if it's already in the working folder. – Werner Jun 25 '18 at 18:10