TransWikia.com

ntheorem: Manually placing end-of-proof symbol in an equation

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}

Output of this code

Any corrections to what I’ve done? And, most importantly, how do I place the end-of-proof symbol correcly in Theorem 3?

One Answer

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}

enter image description here

Answered by Bernard on June 19, 2021

Add your own answers!

Ask a Question

Get help from others!

© 2024 TransWikia.com. All rights reserved. Sites we Love: PCI Database, UKBizDB, Menu Kuliner, Sharing RPP