I am using etoolbox
and ntheorem
packages to have a custom numbering of theorems and equations. Everything works but these side errors occur:
\qedhere
command is unknown (EDIT: following some suggestions I worked something out, so the\qedhere
issue is somehow solved)- theorems title (the optional argument) is typeset in bold
As a MWE, the following code
\documentclass{book}
\usepackage{amsmath}
\usepackage{etoolbox}
\usepackage[amsmath,amsthm,framed,thmmarks]{ntheorem}
%
\renewcommand{\theequation}{\thechapter.\arabic{equation}}
\setcounter{equation}{0}
\newcounter{tempcounter}
\newtheorem{thm}{Theorem}[chapter]
%
\BeforeBeginEnvironment{thm}{\setcounter{tempcounter}{\arabic{equation}}}
\AtBeginEnvironment{thm}
{\setcounter{thm}{\thetempcounter}\subequations}
\AtEndEnvironment{thm}{\endsubequations}
%
\begin{document}
\chapter{This is a chapter}
\begin{equation}\label{Eq:A}
2+2=4
\end{equation}
\begin{thm}[First Theorem]\label{Thm:First}
\begin{equation}\label{Eq:B}
1+1=2
\end{equation}
\begin{proof}
If equation \ref{Eq:A} was trivial, equation \ref{Eq:B} in Theorem \ref{Thm:First} is even more \qedhere \\
trivial.
\end{proof}
\end{thm}
\end{document}
results in this output:
The \qedhere
command is unknown and therefore ignored. I think that the problem is a conflict between the amsthm
option in ntheorem
package and the amsthm
package. However, if I add \usepackage{amsthm}
in the preamble I get errors like
! LaTeX Error: Command \theoremstyle already defined.
and many more.
I would like either to solve the two problems listed above, or to have an alternative code in order to have:
- theorems and equations following the same numbering, resetting at each chapter
- equations in theorem environments subnumbered as shown in the above MWE's output.
Any other suggestion is highly appreciated.
Best Answer
The
ntheorem
package covers the\qedhere
in different ways. Here's an example on which you can elaborate. The "normal font attribution" is easily obtained by (re)defining the theorem style.