3

When I use ntheorem with the thref option, every time I use the amsmath split command the numbering skips ahead by one.

Here is an example:

\documentclass{article}

\usepackage{amsmath}
\usepackage[amsmath,thref]{ntheorem}

\begin{document}

\begin{equation}
    a = b
\end{equation}

\begin{equation}
    b = c
\end{equation}

\begin{equation}
    \begin{split}
        a & = b\\
        &= c
    \end{split}
\end{equation}

\end{document}

The final equation should be numbered (3), but is instead numbered (4). Removing thref resolves the issue.

Can anyone tell me how to fix this? Any help is greatly appreciated.

  • 1
    I usually advise against using ntheorem. – egreg Feb 10 '16 at 19:23
1

I usually advise against using ntheorem, but you may prefer it to amsthm. You can solve the problem of thref by not using the option and going to the much more powerful cleveref package.

\documentclass{article}

\usepackage{amsmath}
\usepackage[amsmath]{ntheorem}
\usepackage{cleveref}

\newtheorem{theorem}{Theorem}

\begin{document}

\begin{theorem}\label{test}
\begin{equation}
    a = b
\end{equation}
\end{theorem}

\Cref{test} says something interesting.

\begin{equation}
    b = c
\end{equation}

\begin{equation}
    \begin{split}
        a & = b\\
        &= c
    \end{split}
\end{equation}

\end{document}

enter image description here

0

Work-around: replace split with the aligned environment:

\documentclass{article}

\usepackage{amsmath}
\usepackage[amsmath,thref]{ntheorem}

\begin{document}

\begin{equation}
    a = b
\end{equation}

\begin{equation}
    b = c
\end{equation}

\begin{equation}
    \begin{aligned}
        a & = b\\
        &= c
    \end{aligned}
\end{equation}

\end{document} 

enter image description here

  • is that "work-around"? (as it is, it sounds a bit dizzy.) – barbara beeton Feb 10 '16 at 19:32
  • Thank you! It is interesting to me that this works, since split and aligned are both from amsmath and do similar things. – Andrew Patrick Turner Feb 10 '16 at 19:37
  • @Barbara Beeton: Maybe I meant ‘lol-around’ ;o) – Bernard Feb 10 '16 at 20:13
0

You may try this:

\documentclass{article}

\usepackage{amsmath}
\usepackage[amsmath,thref]{ntheorem}
\makeatletter
\newcommand\forcefirstchoice{\firstchoice@false}
\makeatother

\begin{document}

\begin{equation}
    a = b
\end{equation}

\begin{equation}
    b = c
\end{equation}

\begin{equation}\forcefirstchoice
    \begin{split}
        a & = b\\
        &= c
    \end{split}
\end{equation}


\begin{equation}\forcefirstchoice
    \begin{split}
        a & = b\\
        &= c
    \end{split}
\end{equation}

\end{document}

Output:

Blockquote

Your Answer

By clicking “Post Your Answer”, you agree to our terms of service, privacy policy and cookie policy

Not the answer you're looking for? Browse other questions tagged or ask your own question.