Text FormattingQED 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, ...)
rais
Posts: 419
Joined: Sun Nov 16, 2014 8:51 pm

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

Post by rais »

user49915 wrote: Sometimes you wish to denote the end of the example. I do it in a compact way by placing a QED-like symbol at the end.
what I meant was, wouldn't it be confusing for your readers putting a QED symbol somewhat out of context?
user49915 wrote: But, this is a much more cumbersome, LaTeX way, and it leaves less horizontal space for the picture (which is o.k. for my examples so far, but not o.k. in general).
Why? What's wrong in reserving space for the symbol?
So what's going to happen if you really fill the full width available? Do you want the symbol collide with your contents?
user49915 wrote: I'd prefer that the vertical spaces introduced by \endcenter (resp. \endtrivlist) be simply undone.
Come to think of it, you could try \removelastskip. Then, all you should need to worry about is \baselineskip, e.g.,

Code: Select all

\newcommand*{\qedEndingNonProofAfterTikzCenter}{\removelastskip\nopagebreak\par\nopagebreak\vspace{-\baselineskip}\nopagebreak\textQEDendingNonProof}%%% -1.57\baselineskip is a wild guess; it is subject to change depending on the font used
(and possibly \parskip).

KR
Rainer

Recommended reading 2024:

LaTeXguide.org • LaTeX-Cookbook.net • TikZ.org

NEW: TikZ book now 40% off at Amazon.com for a short time.

rais
Posts: 419
Joined: Sun Nov 16, 2014 8:51 pm

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

Post by rais »

user49915 wrote:
That's an old one from 2009. The new one from this year is available using the link in the code in the OP, which boils down to getting
https://resource-cms.springernature.com ... 6/data/v10
as of now.
Thanks. If that's legit, you should ask someone at Springer to update their `Information for Authors' page, then.

KR
Rainer
user49915
Posts: 81
Joined: Wed Apr 17, 2019 12:51 pm

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

Post by user49915 »

> Do you know a mean to conditionally adapt the vertical spacing for the qed ?

This question is off-topic in this thread, I'm afraid, and I don't know the answer. Ask a separate question, please, so that more people would see it.
user49915
Posts: 81
Joined: Wed Apr 17, 2019 12:51 pm

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

Post by user49915 »

rais wrote:wouldn't it be confusing for your readers putting a QED symbol somewhat out of context?
It would. Therefore, I use ∎ for the end of the proofs and □ for the end of all other upright-text environments, and that's how some of my teachers used it.
rais wrote:Do you want the symbol collide with your contents?
Sometimes you need the full width for a drawing, but you still have lots of free space in the lower right corner.
rais wrote:Come to think of it, you could try \removelastskip. Then, all you should need to worry about is \baselineskip, e.g.,

Code: Select all

\newcommand*{\qedEndingNonProofAfterTikzCenter}{\removelastskip\nopagebreak\par\nopagebreak\vspace{-\baselineskip}\nopagebreak\textQEDendingNonProof}%%% -1.57\baselineskip is a wild guess; it is subject to change depending on the font used
Undoing the last skip turns out to be insufficient in general. One has to re-do the skip after the box symbol. I forgot to do it either while unskipping a wildly guessed amount. Any idea how?
rais wrote:(and possibly \parskip).
I think I don't understand you here. Are you proposing to say \vspace{-\parskip} somewhere?
rais wrote:Thanks. If that's legit, you should ask someone at Springer to update their `Information for Authors' page, then.
I am not to communicate with Springer directly, and I cannot raise this issue to the next level - the person who does communicate understands neither latex nor the importance of latex-related questions and typically ignores such requests. Sigh. I hope that Frank Holzwarth, or whoever is responsible, reads here from time to time.
Last edited by user49915 on Mon Jun 17, 2019 10:00 pm, edited 6 times in total.
rais
Posts: 419
Joined: Sun Nov 16, 2014 8:51 pm

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

Post by rais »

user49915 wrote: Undoing the last skip turns out to be insufficient in general. One has to re-do the skip after the box symbol. I forgot to do it either while unskipping a wildly guessed amount. Any idea how?
sure ;)

Code: Select all

\newlength\mylastskip
\newcommand*{\qedEndingNonProofAfterTikzCenter}{%
  \setlength\mylastskip{\lastskip}% remember last skip
  \removelastskip\nopagebreak\par\nopagebreak\vspace{-\baselineskip}\nopagebreak\textQEDendingNonProof
  \vskip\mylastskip% skip remembered amount
}%
user49915 wrote:
rais wrote:(and possibly \parskip).
I think I don't understand you here. Are you proposing to say \vspace{-\parskip} somewhere?
I meant I didn't check what happens if \parskip isn't zero. Nor did I check, if Springer allows for \parskip to be anything else.
In other words: if you want to change \parskip, it may need to be taken into account (then again, it may be ignored by the center environment because of its own vertical skips before and after). If it's needed, you can add it to the negative skip

Code: Select all

\vspace{\dimexpr-\baselineskip-\parskip\relax}
instead of \vspace{-\baselineskip}.

KR
Rainer
user49915
Posts: 81
Joined: Wed Apr 17, 2019 12:51 pm

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

Post by user49915 »

rais wrote:

Code: Select all

\newlength\mylastskip
\newcommand*{\qedEndingNonProofAfterTikzCenter}{%
  \setlength\mylastskip{\lastskip}% remember last skip
  \removelastskip\nopagebreak\par\nopagebreak\vspace{-\baselineskip}\nopagebreak\textQEDendingNonProof
  \vskip\mylastskip% skip remembered amount
}%

Code: Select all

\vspace{\dimexpr-\baselineskip-\parskip\relax}
Thx!!!
I expected that the last \vskip\mylastskip should be complemented with \vspace{\dimexpr\baselineskip+\parskip\relax}, so that \vspace{\dimexpr-\baselineskip-\parskip\relax} is undone, right? However, when I do tests,

Code: Select all

\newlength\lastSkipBeforeQED
\newcommand*{\qedEndingNonProofAfterCenter}{%
\setlength\lastSkipBeforeQED{\lastskip}%
\removelastskip\nopagebreak\par\nopagebreak\vspace{\dimexpr-\baselineskip-\parskip\relax}\nopagebreak\textQEDendingNonProof%
\vskip\lastSkipBeforeQED}
is sufficient, whereas I would have expected that the last line should be something like \vskip\lastSkipBeforeQED\vskip\baselineskip\vskip\parskip instead.
I'm confused: we subtract some vertical space explicitly before, never give it back explicitly, but still the result is as if we would have given it back. Any idea, why?
PS. I took freedom to give the macros somewhat more meaningful names.
rais
Posts: 419
Joined: Sun Nov 16, 2014 8:51 pm

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

Post by rais »

user49915 wrote: I'm confused: we subtract some vertical space explicitly before, never give it back explicitly, but still the result is as if we would have given it back. Any idea, why?
yes, you do that implicitly in \textQEDendingNonProof: its last command is \endgraf, which is basically the same as \par, start a new paragraph. So a new line is begun (skipping by \baslineskip + \parskip), and the new line is indented by \parindent. Of course, by default \parindent is set and \parskip isn't (so you'd only see the shift by \baselineskip), but that's why \vskip\lastSkipBeforeQED is all that's needed here.

KR
Rainer
user49915
Posts: 81
Joined: Wed Apr 17, 2019 12:51 pm

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

Post by user49915 »

Alright, I got it that \endgraf ends the paragraph.
rais wrote:
user49915 wrote:Of course, by default \parindent is set and \parskip isn't (so you'd only see the shift by \baselineskip), but that's why \vskip\lastSkipBeforeQED is all that's needed here.
It is wrong that \parskip isn't set. svmono says

Code: Select all

\setlength{\parskip}{\z@ \@plus \p@}
(for the main text; for the index something different is done).
It's not the same as zero or unset. Of course, one point of vertical glue is often not executed, and, when it is executed, it might be invisible except under large magnification. But still, it's different form plain zero. Or have you meant something else? I'm confused.
rais
Posts: 419
Joined: Sun Nov 16, 2014 8:51 pm

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

Post by rais »

Sorry about that.
You're quite right, `set/unset' aren't the words I should've used...
Perhaps I should've said `\parskip is usually set to zero (disregarding any shrinkable/expandable glue)'

KR
Rainer
hemanthr417
Posts: 1
Joined: Sun Sep 13, 2020 8:10 am

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

Post by hemanthr417 »

It's off-point in this string. In any case, it is conceivable utilizing \AtEndEnvironment of the tool stash. Yet, you don't need that, since, starting at now, the programmed expansion gives problematic outcomes when the exact opposite thing before nature closes isn't unadulterated content. You need to have qed directly on the last pattern if there is space there, however not unequivocally after the last gauge.
Post Reply