## LaTeX forum ⇒ Text Formatting ⇒ QED on the last line of the center environment containing a TikZ drawing

Information and discussion about LaTeX's general text formatting features (e.g. bold, italic, enumerations, ...)
user49915
Posts: 66
Joined: Wed Apr 17, 2019 12:51 pm

### QED on the last line of the center environment containing a TikZ drawing

Running pdflatex on the input

produces the output
output
screenshot.png (43.54 KiB) Viewed 1044 times

In this example, the qed symbol (square) should be placed on the base line of the TikZ drawing (which can be arbitrarily complicated) and flushed to the right.
My current solution involves finishing the center environment, introducing a wildly guessed negative vertical space, putting the box, and continuing from there on. This is fragile: wild guesses break when the general parameters such as the font or the baselineskip change. Instead, we should undo the vertical skip(s) introduced by \endcenter in a font-independent way (which boils down to undoing the vertical skip(s) introduced by \endtrivlist), put the QED symbol, and redo the vertical skip(s). However, the definition of \endtrivlist is a bit too complicated for me to understand. I imagine that trivlist is a very standard thing, so, someone has probably already done the job. Any help?

An aside is worth being made. Marginnote-based solutions to place the qed symbol are of second choice, since the package is abandoned and does lead to problems with a large book. Marginpar/marginline sometimes requires manual vertical adjustments, i.e., a no-go for automation. Using amsthm or ntheorem is also a no-go: amsthm clashes with svmono in various ways, and ntheorem has bugs (e.g., doesn't jive with UTF-8 engines and has other problems, see https://tex.stackexchange.com/questions/tagged/ntheorem) and is both antique and abandoned. The inclusion of ntheorem with some options into svmono.cls is, in fact, so far from a clever design that I had to turn off ntheorem manually. (If you have problems with getting svmono.cls for the purpose of trying this very example out, go with the book class instead and define example via \newtheorem).
Last edited by user49915 on Fri Jun 07, 2019 11:30 pm, edited 1 time in total.

thomasb
Posts: 132
Joined: Thu Aug 03, 2017 10:54 am
You are going to say that you don't like it :
\begin{proof} (...) \end{proof}
?

user49915
Posts: 66
Joined: Wed Apr 17, 2019 12:51 pm
thomasb wrote:You are going to say that you don't like it

No. I'm going to say that what you typed is unrelated to my question.

thomasb
Posts: 132
Joined: Thu Aug 03, 2017 10:54 am
user49915 wrote:No. I'm going to say that what you typed is unrelated to my question.

Well, I'm not sure I understood the question then ! You need the QED not to go another line ?

user49915
Posts: 66
Joined: Wed Apr 17, 2019 12:51 pm
thomasb wrote:You need the QED not to go another line ?

Yes. But replacing "example" with "proof" leads to "Proof" instead of "Example" in the output.

thomasb
Posts: 132
Joined: Thu Aug 03, 2017 10:54 am
user49915 wrote:Yes. But replacing "example" with "proof" leads to "Proof" instead of "Example" in the output.

It seems you can define your own environments : http://distrib-coffee.ipsl.jussieu.fr/p ... heorem.pdf

user49915
Posts: 66
Joined: Wed Apr 17, 2019 12:51 pm
thomasb wrote:It seems you can define your own environments : http://distrib-coffee.ipsl.jussieu.fr/p ... heorem.pdf

ntheorem has bugs and is unmaintained. I think I wrote a note about it in the question.

thomasb
Posts: 132
Joined: Thu Aug 03, 2017 10:54 am
user49915 wrote:ntheorem has bugs and is unmaintained. I think I wrote a note about it in the question.

Indeed...

rais
Posts: 256
Joined: Sun Nov 16, 2014 8:51 pm
I didn't understand the benefit of putting a proof' symbol into an example environment; all that even for a Springer class, which I find highly unusual to be tinkered with.
Anyway, my idea would be to put everything but the qed symbol into a {minipage}, align it to the bottom, and put the qed symbol next to it, e.g.,

is that less troublesome for you?

KR
Rainer

thomasb
Posts: 132
Joined: Thu Aug 03, 2017 10:54 am
Wow ! What about \hfill\QEDendingNonProofSymbol` at the end ?