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
  • 1
    I usually advise against using ntheorem.
    – egreg
    Commented Feb 10, 2016 at 19:23

3 Answers 3

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

3
  • is that "work-around"? (as it is, it sounds a bit dizzy.) Commented Feb 10, 2016 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. Commented Feb 10, 2016 at 19:37
  • @Barbara Beeton: Maybe I meant ‘lol-around’ ;o)
    – Bernard
    Commented Feb 10, 2016 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

You must log in to answer this question.

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