#Inserting space after a display math

1 messages · Page 1 of 1 (latest)

crisp lark
#

I want to effectively make it look like this

\documentclass{article}
\usepackage{amsmath,calc}
\begin{document}
\begin{gather*}
  1 + 1 = 2 \\
  2 + 2 = 5
\end{gather*}
\vspace{1ex-\baselineskip}

\noindent Lorem ipsum dolor sit amet, consectetur adipiscing elit, sed do eiusmod

tempor incididunt ut labore et dolore magna aliqua. Ut enim ad minim
\end{document}

Here are the things I've tried so far and their issues

  1. The above example: Makes a new paragraph, requiring adjusting by -\baselineskip and using \noindent.
  2. Not having the empty line: Space is inserted between the two lines of regular text, rather than between the math and the first line.
  3. Using \vspace before the \end{gather*}: Does nothing (I think \vspace is ignored in math blocks).
  4. Using \\[\dimeval{1ex-\baselineskip}] before the \end{gather*}: Requires adjusting by -\baselineskip, and therefore needs \dimeval because calc doesn't support \\[].
  5. Setting \belowdisplayskip: I only want this change to apply to this one display math block, so I would need to reset it afterwards or put it inside a group, which is annoying.
  6. Setting \belowdisplayskip inside the gather*: Does nothing.
    I'd appreciate any other ideas on how to do this. Solutions 3 or 6 would be perfect if they worked, or solution 1 if there was a way to tell it to insert the space before the current line (removing the need for -\baselineskip and \noindent). I'm thinking I might just define a macro that expands to \\[\dimeval{#1-\baselineskip}].
#

side note: is there any way to prevent the bots from responding to a specific message with a TeX code block?

drowsy prairie
#

Is your objective to modify the vskip after all gather* environments only?

crisp lark
#

I only want this change to apply to this one display math block
no, otherwise I would just redefine the gather* environment to set \belowdisplayskip or something like that

tulip lichen
#

Why is it annoying to adjust the value of belowdisplayskip in a group?

crisp lark
#

it requires two additional commands that i'd rather not need.

#

also i need to set the length above the environment, when i only care about its effect below the environment

drowsy prairie
#

This sounds really like an XY problem

drowsy prairie
crisp lark
crisp lark
drowsy prairie
#

Could you give an example where qedhere doesn't work properly?

crisp lark
#
\documentclass{article}
\usepackage{mathtools,amsthm}
\mathtoolsset{showonlyrefs,showmanualtags}
\begin{document}
\begin{proof}
  \begin{gather}
    1 + 1 \qedhere
  \end{gather}
\end{proof}
\end{document}
drowsy prairie
#

Obviously \qedhere cannot work with numbered equations

#

You have to use gather* if you want qedhere

crisp lark
#

and even if the number was there it could be placed right under it

#

which is why I want to be able to insert (negative) space after the display math

drowsy prairie
#

A hack you can use is \tag*{$\qedsymbol$} on the last line of your display math environment, and then suppress the actual qedsymbol that proof places

crisp lark
crisp lark
#

i wish there was a rewrite of all the usual packages that makes them integrate well together lol

drowsy prairie
#

I am pretty sure ConTeXt can do this

#

It's much more cohesive and internally consistent than LaTeX

crisp lark
#

huh i'll have to look into it

drowsy prairie
#

You'll have to find some way to suppress the qed

#

Seems like \renewcommand*\qed{} should do the trick

crisp lark
#

ooh thanks

#

still curious on a good way to insert negative space after math mode, but this will be useful

balmy burrow
#

centred inline maths then? catThink

drowsy prairie
#

You can try something like this

#

,,```tex
<mathtools,amssymb>

\begin{gather*}
xyzzy.
\end{gather*}
\strut \vadjust{
\kern-\dp\strutbox
\vtop to \dp\strutbox{\vss
\hbox to\hsize{\hfil $\square$}
\kern\baselineskip \kern\belowdisplayskip \kern\dp\strutbox
}
}%
\ipsum

quick sleetBOT