1

I use ntheorem and define two theorem-like environments ("Theorem" and "Lemma") that share the same counter which is reset for every section. Moreover I have a proof-environment that has no counter at all.

At the same time I include thm-restate because I need to repeat a particular theorem.

Even if I do not use thm-restate but simply load the package, the lemma environment does not print its counter. If thm-restate is not loaded the output is as expected. Alternatively, if I omit switching the theorem style to nonumberplain for the proof-environment the counter is printed, too. However, in this case the proof gets numbered, too, which is not desired.

The MWE below yields

  • List item
  • Theorem 1.1
  • Lemma
  • Theorem 1.3
  • Proof

expected output is

  • Theorem 1.1
  • Lemma 1.2
  • Theorem 1.3
  • Proof

This means, the shared counter is correctly incremented but not printed.

\documentclass[american]{article}

\usepackage[T1]{fontenc}
\usepackage{lmodern}
\usepackage[utf8]{inputenc}
\usepackage[thmmarks,thref]{ntheorem}
% Option 1: Either do no use 'thm-restate' and 'lemma' will be numbered
\usepackage{thm-restate}



\theoremstyle{plain}
\theoremheaderfont{\normalfont\bfseries}
\theoremseparator{}
\theorembodyfont{\normalfont\itshape}
\theoremsymbol{}
\newtheorem{theorem}{Theorem}[section]
\newtheorem{lemma}[theorem]{Lemma}
% Option 2: or do not use 'nonumberplain' and 'lemma' will be numbered
\theoremstyle{nonumberplain}
\theoremheaderfont{\normalfont\scshape}
\theoremseparator{}
\theorembodyfont{\normalfont\upshape}
\theoremsymbol{\rule{1ex}{1ex}}
\newtheorem{proof}{Proof}



\begin{document}

\section{Header}

Lorem ipsum dolor sit amet, consectetuer adipiscing elit.
Ut purus elit, vestibulum ut, placerat ac, adipiscing vitae, felis.
Curabitur dictum gravida mauris.

\begin{theorem}[Suprising Result]
Nam arcu libero, nonummy eget, consectetuer id, vulputate a, magna.
Donec vehicula augue eu neque.
Pellentesque habitant morbi tristique senectus et netus et malesuada fames ac turpis egestas.
\end{theorem}

\begin{lemma}[Trivial Conclusion]
Mauris ut leo.
Cras viverra metus rhoncus sem.
Nulla et lectus vestibulum urna fringilla ultrices.
\end{lemma}

\begin{theorem}[Awesome Result]
Phasellus eu tellus sit amet tortor gravida placerat.
Integer sapien est, iaculis in, pretium quis, viverra ac, nunc.
Praesent eget sem vel leo ultrices bibendum.
\end{theorem}

\begin{proof}
Aenean faucibus.
Morbi dolor nulla, malesuada eu, pulvinar at, mollis ac, nulla.
Curabitur auctor semper nulla.
\end{proof}

\end{document}

2 Answers 2

0

I finally found a workaround. The definitions in the preamble needs to be re-ordered: first define theorem-like environments which are unnumbered and then the remaining one. However, this workaround only works if there is only one counter which is shared by all numbered theorem-like environments.

\theoremstyle{nonumberplain}
\theoremheaderfont{\normalfont\scshape}
\theoremseparator{}
\theorembodyfont{\normalfont\upshape}
\theoremsymbol{\rule{1ex}{1ex}}
\newtheorem{proof}{Proof}

\theoremstyle{plain}
\theoremheaderfont{\normalfont\bfseries}
\theoremseparator{}
\theorembodyfont{\normalfont\itshape}
\theoremsymbol{}
\newtheorem{theorem}{Theorem}[section]
\newtheorem{lemma}[theorem]{Lemma}
0

I recommend using amsthm rather than ntheorem. The thmmarks option applies several hacks in order to accomplish automatic marks (which don't always work, by the way). Using it just to define proof with the mark, is a waste, in my opinion.

\documentclass{article}

\usepackage[T1]{fontenc}
\usepackage{lmodern}

\usepackage{amsmath}
\usepackage{amsthm}
\usepackage{thm-restate}

\theoremstyle{plain}
\newtheorem{theorem}{Theorem}[section]
\newtheorem{lemma}[theorem]{Lemma}


\begin{document}

\section{Header}

Lorem ipsum dolor sit amet, consectetuer adipiscing elit.
Ut purus elit, vestibulum ut, placerat ac, adipiscing vitae, felis.
Curabitur dictum gravida mauris.

\begin{theorem}[Suprising Result]
Nam arcu libero, nonummy eget, consectetuer id, vulputate a, magna.
Donec vehicula augue eu neque.
Pellentesque habitant morbi tristique senectus et netus et malesuada fames ac turpis egestas.
\end{theorem}

\begin{lemma}[Trivial Conclusion]
Mauris ut leo.
Cras viverra metus rhoncus sem.
Nulla et lectus vestibulum urna fringilla ultrices.
\end{lemma}

\begin{restatable}[Awesome Result]{theorem}{awesome}
Phasellus eu tellus sit amet tortor gravida placerat.
Integer sapien est, iaculis in, pretium quis, viverra ac, nunc.
Praesent eget sem vel leo ultrices bibendum.
\end{restatable}

\begin{proof}
Aenean faucibus.
Morbi dolor nulla, malesuada eu, pulvinar at, mollis ac, nulla.
Curabitur auctor semper nulla.
\end{proof}

\awesome*

\end{document}

enter image description here

You must log in to answer this question.

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