答案1
长堆栈(来自 [ tab
]stackengine
包)使用固定的基线跳跃。因此,无论任何给定行上的内容高度如何,两个相邻的\[...]Centerstack
s 都可以实现您想要的交错外观。要使用的参数是长堆栈基线跳跃,可使用 进行设置\setstackgap{L}{<length>}
。
\documentclass{article}
\usepackage{tabstackengine,amssymb}
\TABstackMath
\TABstackMathstyle{\displaystyle}
\begin{document}
\[
\setstackgap{L}{30pt}
\alignCenterstack{
& \frac{x}{2} + \frac{x}{2}\\
=& s\Bigl(\frac{x}{2}\Bigr)\\
=& x\\
=& 4
}
\qquad\qquad
\tabbedCenterstack[l]{
(\because a + a = 2a)\\
\Bigl(\because \frac{a}{a} = 1\Bigr)\\
(\because\textrm{given } x = 4)
}
\]
\end{document}
答案2
你可以用 来实现witharrows
。默认情况下,我们有箭头:
\documentclass{article}
\usepackage{witharrows}
\usepackage{amssymb} % for \because
\begin{document}
\begin{DispWithArrows*}[interline = 3mm] %TikzCode= {\path (#1) to node {#3} (#2) ;}]
& \frac{x}{2} + \frac{x}{2}
\Arrow{$(\because a + a = 2a)$}\\
& = s\Bigl(\frac{x}{2}\Bigr)
\Arrow{$\Bigl(\because \frac{a}{a} = 1\Bigr)$}\\
& = x
\Arrow{$(\because \textrm{ given } x = 4)$}\\
& = 4
\end{DispWithArrows*}
\end{document}
但你可以抑制箭头:
\documentclass{article}
\usepackage{witharrows}
\usepackage{amssymb} % for \because
\begin{document}
\begin{DispWithArrows*}[interline = 3mm,
TikzCode= {\path (#1) to node {#3} (#2) ;}]
& \frac{x}{2} + \frac{x}{2}
\Arrow{$(\because a + a = 2a)$}\\
& = s\Bigl(\frac{x}{2}\Bigr)
\Arrow{$\Bigl(\because \frac{a}{a} = 1\Bigr)$}\\
& = x
\Arrow{$(\because \textrm{ given } x = 4)$}\\
& = 4
\end{DispWithArrows*}
\end{document}