# Error when using the amsthm package

I've got following error message when compiling for a journal article:

/usr/share/texlive/texmf-dist/tex/latex/amscls/amsthm.sty:431: LaTeX Error: Command \proof already defined. Or name \end... illegal, see p.192 of the manual.

while compiling this in overleaf:

\documentclass[lnbip]{svmultln}
\usepackage{lineno,hyperref, graphicx, caption, color, amsthm, float, makeidx}
\usepackage[utf8]{inputenc}

\modulolinenumbers[5]

\setlength{\parindent}{0em}

\setlength{\parskip}{0.8em}

\setlength{\belowcaptionskip}{-12pt}

\newtheoremstyle{dotless}{}{}{\itshape}{}{\bfseries}{}{ }{}

\theoremstyle{dotless}

\newtheorem {lem}{Lemma}

\begin{document}


and Journal send me this error (I don't know what editor they use)

! Runaway argument?
! Paragraph ended before \@tempa was complete.
\par
l.435 \newenvironment{proof}[1][\proofname]{\par


But everything is ok on Sharelatex.

p.s (updated): I dont get error more after delete amsthm, add amsmath and remove \newtheoremstyle{dotless}{}{}{\itshape}{}{\bfseries}{}{ }{} and \theoremstyle{dotless} and after reformat all formula but I get error for caption with footnote and 2^14 x 2^14 (it is ok in sharelatex):

\begin{figure}[h]
\centering
\includegraphics[width=\linewidth]{fig6.PNG}
\captionsetup{justification=centering}
\caption{...    A\footnotemark \\ with dimensions 2^{24} \times 2^{24}.}
\label{figure6}
\end{figure}

\footnotetext{\url{}}

• It seems that the class file already defines the proof environment. Try removing "amsthm" from your top \usepackage list – Lupino Oct 16 '17 at 11:49
• @Lupino After remove "amsthm" got error in line "\newtheoremstyle{dotless}{}{}{\itshape}{}{\bfseries}{}{ }{}" after remove it and below line I got error again – hoom Oct 16 '17 at 11:55
• I see. Well, the dirty method is to keep amsthm and add \makeatletter\let\proof\@undefined\let\endproof\@undefined\makeatother between the \documentclass and the first \usepackage line. – Lupino Oct 16 '17 at 12:01
• @Lupino after add it I got "Undefined control sequence. l.126 ...\vert{}\right\vert{}}_p}={max}_{\substack." in overleaf – hoom Oct 16 '17 at 12:05
• The Springer classes have their own way to define new theorems and you shouldn't use different tools for the purpose: it's their style, not yours, when you publish with them. – egreg Oct 16 '17 at 13:17

The amsthm package is not compatible with Springer document classes. It's not difficult to make them load it, but this increases the risk that the document is eventually rejected because of not being compliant with the house style.

In general, when using classes or packages provided by publishers or conference organizers, one should stick to their style.

In your case, you seem to want that there's no period after statements' labels, so

Lemma 1 Some statement.

instead of what the class does, which is

Lemma 1. Some statement.

This is easily done and the copy editors will most probably reject the change, but they will just need to remove one line from your code.

\documentclass[lnbip]{svmultln}
\usepackage[utf8]{inputenc}
\usepackage{
lineno,
graphicx,
%caption,% <---- not compatible with Springer classes
color,
%amsthm, % <---- not compatible with Springer classes
float,   % <---- don't use the [H] option
makeidx,
hyperref,% <---- should be last
}

\modulolinenumbers[5]

%%% No period after theorem labels
\makeatletter
\renewcommand*{\@thmcounterend}{}
\makeatother

\spnewtheorem{lem}{Lemma}{\bfseries}{\itshape}

\begin{document}

\begin{lem}
Statement
\end{lem}

\end{document}


I commented some of the packages: caption, as well as amsthm, is not compatible with the class; float is usually not necessary, because one should never use the [H] option to floats. I also removed the settings to \parindent and \parskip for the same reasons as before, that is, sticking to the house style.