align
有人能解释一下使用 an而不是 a时额外的间距是从哪里来的equation
吗?有人知道如何删除它吗?
\documentclass{article}
\usepackage{amsmath}
\usepackage{mdframed}
\mdfdefinestyle{myframe}{frametitlebackgroundcolor=green}
\begin{document}
\begin{mdframed}[style=myframe, frametitle={B}]
\begin{equation} c^2=a^2+b^2 \end{equation}
\end{mdframed}
\begin{mdframed}[style=myframe, frametitle={A}]
\begin{align} c^2 & =a^2+b^2 \\ & \geq a^2 \end{align}
\end{mdframed}
\end{document}
答案1
您tcolorbox
可以使用ams equation
或ams algin
特殊盒子,这个间隙就会消失。
\documentclass{article}
\usepackage{amsmath}
\usepackage[most]{tcolorbox}
\newtcolorbox{myframe}[1][]{colbacktitle=green,coltitle=black, #1}
\begin{document}
\begin{myframe}[title=B, ams equation]
c^2=a^2+b^2
\end{myframe}
\begin{myframe}[title=A, ams align]
c^2 & =a^2+b^2 \\ & \geq a^2
\end{myframe}
This is a very long long sentence
\[c^2=a^2+b^2\]
This is a very long long sentence
\begin{align} c^2 & =a^2+b^2 \\ & \geq a^2 \end{align}
\end{document}