# renewcommand not working after using jmlr2e

I am using the jmlr2e.sty package, used for papers submitted to a scientific journal. That sty file has the command \renewenvironment for redefining the \begin{abstract} command. Some lines below the usepackage{jmlr2e} I write \renewcommand\abstractname{newname} but it doesn't work. I have also tried \AtBeginDocument but the pdf keeps showing "Abstract" instead of "newname".

I am using Mac OS and Tex Live.

• 'Not working' is not a precise description... Is \abstractname defined at all? If it is not defined, then \renewcommand\abstractname would fail, of course. Please post a document that shows this issue and give a link to this jmlr2e.sty package – user31729 Oct 24 '17 at 17:23

jmlr2e doesn't use \abstractname. Instead, it hard-codes the name:

%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%
%                               A B S T R A C T
%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%

%% use \begin{abstract} .. \end{abstract} for abstracts.
\renewenvironment{abstract}
{\centerline{\large\bf Abstract}\vspace{0.7ex}%
\bgroup\leftskip 20pt\rightskip 20pt\small\noindent\ignorespaces}%
{\par\egroup\vskip 0.25ex}


You can patch it with etoolbox:

\documentclass{article}

% http://www.jmlr.org/format/jmlr2e.sty
\usepackage{jmlr2e,etoolbox}
\usepackage{lipsum}

% \patchcmd{<cmd>}{<search>}{<replace>}{<success>}{<failure>}
\patchcmd{\abstract}{Abstract}{newname}{}{}

\begin{document}

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

\end{document}