4

I have seen that this subject was discussed a couple of times, but often the reason was like "oh, I used align* with \label". In my case it is a bit different, here is a minimal example

\documentclass{article}
\usepackage{amsmath}
\usepackage[thmmarks, amsthm]{ntheorem}

\begin{document}
\begin{equation}\label{eq:a}
a=b
\end{equation}

\begin{align}
a &=b  \label{eq:something_different}
\end{align}
\ref{eq:a} and \ref{eq:something_different}
\end{document} 

When I compile this, I get the error message "Package amsmath Error: Multiple \label's: label 'eq:a' will be lost. \end{align}". In fact label "eq:a" is not defined and is referenced as "??" in the text. It works when I change "align" to "equation" (and remove the ampersand) and it also works when I remove the " \label{eq:something_different). Can anybody explain why this is the case and what I should do to avoid this error message?

Thank you very much.

Best regards,

Markus

5
  • 1
    Welcome to TeX.SE.
    – Mico
    Jul 23, 2023 at 18:24
  • 1
    And load it with the amsmath option.
    – Alan Munn
    Jul 23, 2023 at 18:26
  • 4
    you must use the amsmath option too: \usepackage[amsmath,thmmarks, amsthm]{ntheorem}, see the documentation of ntheorem. Jul 23, 2023 at 18:26
  • 1
    Not relevant, but align shouldn't be used with single-line equations. Jul 23, 2023 at 18:41
  • Thank you for your help. I know that align shouldn't be used with single-line equations, I just wanted to strip down the example as far as possible Jul 23, 2023 at 20:11

1 Answer 1

4

From page 4 of the user guide of the ntheorem package:

enter image description here

Hence, replace

\usepackage{amsmath}
\usepackage[thmmarks, amsthm]{ntheorem}

with

\usepackage{amsmath}
\usepackage[thmmarks, amsmath, amsthm]{ntheorem}

If, for some inscrutable reason, you do not wish to set the amsmath option while loading ntheorem, you must load ntheorem before, not after, amsmath. Not the recommended route, though.

1
  • Thank you Mico, that does the trick. And sorry for not looking into the documentation thoroughly enough Jul 23, 2023 at 20:09

You must log in to answer this question.

Not the answer you're looking for? Browse other questions tagged .