1

Reading:

ntheorem with the [amsthm] option ignores styling of a theorem environment

I adopted the suggested proof environment for ntheorem without the amsmath option. I also made sure to add the thmmarks options to ntheorem, to enable end-of-theorem/end-of-proof marks. However - if I write this document:

\documentclass{article}

\makeatletter

\usepackage[thmmarks]{ntheorem} \usepackage{amssymb} % for \blacksquare \usepackage{mathtools}

\newcommand{\proofname}{Proof} \newcounter{proof}\newcounter{currproofctr}\newcounter{endproofctr}% \newenvironment{proof}[1][\proofname]{ \th@nonumberplain \def\theorem@headerfont{\itshape}% \normalfont @thm{proof}{proof}{{#1}.}}% {@endtheorem} % and this ends the definition of the proof environment

\newcommand\proofSymbol{\ensuremath{\blacksquare}} \qedsymbol{\ensuremath{\blacksquare}}

\makeatother

\begin{document}

\begin{proof} The quick brown fox jumped over the lazy dog 1. \end{proof}

\begin{proof} The quick brown fox jumped over the lazy dog 2. \begin{align} 42
\end{align
} \end{proof}

and some text afterwards.

\end{document}

I get a black square on the first proof, but not the second. Why is that?

einpoklum
  • 12,311
  • @Marijn : Sorry for yanking your chain, my earlier question was kind of stupid, this is the more serious problem (I just deleted too much when trying to create a minimal example). – einpoklum Jan 17 '21 at 11:53
  • Also for this one the \openbox part is not used I think? You redefine \proofSymbol at the end of the preamble, which discards the earlier \gdef. That is not the core issue of course (the output is the same after deleting the \openbox definition). – Marijn Jan 17 '21 at 12:09
  • Just out of idle curosity: Do you have a specific reason for employing the ntheorem package rather than the amsthm package? The reason I ask is that the latter package defines a very handy proof environment and even provides the macro \qedhere to place the QED symbol in some other location than at the very end. – Mico Jan 17 '21 at 12:11
  • @Mico: This reason. Although things may have changed over time. – einpoklum Jan 17 '21 at 12:22
  • Note that the issue does not seem related to your custom \newenvironment{proof}, with a regular \theoremsymbol{\ensuremath{\blacksquare}}\newtheorem{myproof}{Proof} you see the same behavior (first proof with square, second without square). The ntheorem manual mentions (although not very clearly) that for theorems ending with math you need amsthm for end marks (page 15), so it you want to use this without amsthm then you probably need to lift some code from that package as well. – Marijn Jan 17 '21 at 12:30
  • @Marijn: Dropped the \openbox. Do you have any idea what code specifically I would need to lift, or shall I just dig into that to look? – einpoklum Jan 17 '21 at 12:31
  • 1
    @einpoklum From a quick look in the source amsthm uses over 150 lines of code for just the QED symbol, so I gues the other way around (i.e., make ntheorem with the amsthm option respect formatting modifications) would be easier to do. – Marijn Jan 17 '21 at 14:31
  • @einpoklum that sounds like a different problem, maybe some solution can be found there as well - however modifying the theorem style does seem to be compatible with amsthm. – Marijn Jan 17 '21 at 18:28

1 Answers1

1

It seems the regular interface works as expected (after compiling two times), including modified formatting:

\documentclass{article}

\usepackage{amsmath} \usepackage[amsmath,thmmarks]{ntheorem} \usepackage{amssymb} % for \blacksquare \usepackage{mathtools}

\theoremstyle{plain} \theorembodyfont{\normalfont} \theoremheaderfont{\normalfont\itshape} \theoremseparator{.} \theoremsymbol{\ensuremath{\blacksquare}} \newtheorem{proof}{Proof} \begin{document}

\begin{proof} The quick brown fox jumped over the lazy dog 1. \end{proof}

\begin{proof} The quick brown fox jumped over the lazy dog 2. \begin{align} 42
\end{align
} \end{proof}

and some text afterwards.

\end{document}

enter image description here

Marijn
  • 37,699