My objective is to put a tcolorbox
around one or more AMS multline
environment(s). However, there is extra space above the first equation. Presumably I'm running into an issue like this.
I have not found a solution that addresses this situation directly (most seem to address align
in tcolorbox
es such as this). One solution addresses it indirectly here and if I use -6pt
I can get somewhat even vertical alignment. I couldn't find a good way to set this via variable (e.g., \baselineskip
).
I have also experimented with empheq
but could not get it to behave in the desired way.
My questions:
- Is there a better way to handle a
tcolorbox
around an AMSmultline
directly? - If not, is there a better way to do what I've done either by either setting up a custom
tcolorbox
to always include the "displayskips" and/or not having to hard code theabovedisplayskip
value?
A MWE is shown below; my real equation is quite complicated and requires a multline
(I'd much rather not try to use an alternative environment because of the amount of equation number management I would need to do in my write up).
Edit to clarify:
I want to emphasize the equations I put inside the box relative to the progression leading up to them and those that follow. So, I want the tcolorbox
to respect the typical intra- and inter-paragraph line spacing and not act as an equation but then within the tcolorbox
to have even vertical alignment.
MWE:
\documentclass{article}
\usepackage{amsmath}
\usepackage[most]{tcolorbox}
\begin{document}
An example \texttt{multline} formula is:
\begin{tcolorbox}
\begin{multline}
f(x) = 1 + 2 + 3 + 4\\
+ 5 + 6 + 7 + 8 + 9\\
+ 10.
\end{multline}
\end{tcolorbox}
\end{document}
MWE with workaround:
...
\begin{tcolorbox}
\abovedisplayskip=-6pt
\belowdisplayskip=0pt
\begin{multline}
...
\begin{tcolorbox}\vspace{-\baselineskip}\begin{multline}...\end{tcolorbox}
. Notice that I accidentally typed\begin{tcolorbox}\vspace{—\baselineskip}\begin{multline}...
which gives amusing unexpected result.tcolorbox
at all and directlyAn example \texttt{multline} formula is: \begin{multline}...
. The space above equation is very much the same (I did not measure) as when there is an extra\begin{tcolorbox}\vspace{-\baselineskip}...
)