TeX - LaTeX Asked on June 19, 2021
I would like to use ntheorem
to produce theorems and proofs. I’ve got an end-of-proof symbol that works ok but, in the case of a trivial result, I’d like to place the symbol in the theorem itself. I’ve got something that works ok, except when the theorem ends with an equation.
I’m not 100% sure that I’m using the package correctly. The following is my attempt at a MWE:
documentclass{article}
usepackage{amssymb}
usepackage[thmmarks]{ntheorem}
newtheorem{thm}{Theorem}
theoremstyle{nonumberplain}
theorembodyfont{normalfont}
theoremsymbol{ensuremathsquare}
newtheorem{proof}{Proof:}
begin{document}
begin{thm}
Some theorems need a proof.
end{thm}
begin{proof}
And the end of proof symbol works even with an equation such as
[
P = NP.
]
end{proof}
begin{thm}
Some are trivial and don't need a proof. hfillproofSymbol
end{thm}
begin{thm}
But how do you place the symbol when the trivial result ends with an equation
[
x^{2}-1 = (x-1)(x+1)? hfillproofSymbol
]
end{thm}
end{document}
Any corrections to what I’ve done? And, most importantly, how do I place the end-of-proof symbol correcly in Theorem 3?
You can define a trivthm
environment, which shares the counter of thm
, and declare theoremsymbol
just before this environment:
documentclass{article}
usepackage{amssymb}
usepackage[thmmarks]{ntheorem}
newtheorem{thm}{Theorem}
theoremsymbol{ensuremathsquare}
newtheorem{trivthm}[thm]{Theorem}
theoremstyle{nonumberplain}
theorembodyfont{normalfont}
newtheorem{proof}{Proof:}
begin{document}
begin{thm}
Some theorems need a proof.
end{thm}
begin{proof}
And the end of proof symbol works even with an equation such as
[
P = NP.
]
end{proof}
begin{trivthm}
Some are trivial and don't need a proof.
end{trivthm}
begin{trivthm}
But how do you place the symbol when the trivial result ends with an equation
[
x^{2}-1 = (x-1)(x+1)?
]
end{trivthm}
end{document}
Answered by Bernard on June 19, 2021
Get help from others!
Recent Questions
Recent Answers
© 2024 TransWikia.com. All rights reserved. Sites we Love: PCI Database, UKBizDB, Menu Kuliner, Sharing RPP