LaTeX forum ⇒ 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: 239
Joined: Sun Nov 16, 2014 8:51 pm

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

Postby rais » Mon Jun 17, 2019 11:38 am

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] [Expand/Collapse] [Download] ({untitled.tex})
  1. \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

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

Postby rais » Mon Jun 17, 2019 11:49 am

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/springer-cms/rest/v1/content/20566/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: 52
Joined: Wed Apr 17, 2019 12:51 pm

Postby user49915 » Mon Jun 17, 2019 2:22 pm

> 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: 52
Joined: Wed Apr 17, 2019 12:51 pm

Postby user49915 » Mon Jun 17, 2019 2:29 pm

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] [Expand/Collapse] [Download] ({untitled.tex})
  1. \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: 239
Joined: Sun Nov 16, 2014 8:51 pm

Postby rais » Tue Jun 18, 2019 2:23 pm

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] [Expand/Collapse] [Download] ({untitled.tex})
  1. \newlength\mylastskip
  2. \newcommand*{\qedEndingNonProofAfterTikzCenter}{%
  3. \setlength\mylastskip{\lastskip}% remember last skip
  4. \removelastskip\nopagebreak\par\nopagebreak\vspace{-\baselineskip}\nopagebreak\textQEDendingNonProof
  5. \vskip\mylastskip% skip remembered amount
  6. }%

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] [Expand/Collapse] [Download] ({untitled.tex})
  1. \vspace{\dimexpr-\baselineskip-\parskip\relax}

instead of \vspace{-\baselineskip}.

KR
Rainer

user49915
Posts: 52
Joined: Wed Apr 17, 2019 12:51 pm

Postby user49915 » Wed Jun 19, 2019 12:19 pm

rais wrote:
Code: [Select all] [Expand/Collapse] [Download] ({untitled.tex})
  1. \newlength\mylastskip
  2. \newcommand*{\qedEndingNonProofAfterTikzCenter}{%
  3. \setlength\mylastskip{\lastskip}% remember last skip
  4. \removelastskip\nopagebreak\par\nopagebreak\vspace{-\baselineskip}\nopagebreak\textQEDendingNonProof
  5. \vskip\mylastskip% skip remembered amount
  6. }%

Code: [Select all] [Expand/Collapse] [Download] ({untitled.tex})
  1. \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] [Expand/Collapse] [Download] ({untitled.tex})
  1. \newlength\lastSkipBeforeQED
  2. \newcommand*{\qedEndingNonProofAfterCenter}{%
  3. \setlength\lastSkipBeforeQED{\lastskip}%
  4. \removelastskip\nopagebreak\par\nopagebreak\vspace{\dimexpr-\baselineskip-\parskip\relax}\nopagebreak\textQEDendingNonProof%
  5. \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: 239
Joined: Sun Nov 16, 2014 8:51 pm

Postby rais » Thu Jun 20, 2019 3:20 pm

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: 52
Joined: Wed Apr 17, 2019 12:51 pm

Postby user49915 » Fri Jun 21, 2019 7:13 pm

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] [Expand/Collapse] [Download] ({untitled.tex})
  1. \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: 239
Joined: Sun Nov 16, 2014 8:51 pm

Postby rais » Fri Jun 21, 2019 10:14 pm

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


Return to “Text Formatting”

Who is online

Users browsing this forum: No registered users and 6 guests