我该如何放置居中在 displaymath 环境中分隔两个文本区域的垂直线?我想要的效果如下所述。谢谢!
\[
3x + 2 = 6 | x + 5 = 7
-2 = -2 | -5 = -5
3x = 4 | x = 2
x = 4/3 |
\]
答案1
以下是 MWE:
\documentclass[letterpaper]{article}
\usepackage{amsmath}
\begin{document}
\begin{tabular}{l|l}
$\begin{aligned}
3x + 2 &= 6\\
-2 &= -2 \\
3x &= 4 \\
x &= 4/3 \\
\end{aligned}$ &
$\begin{aligned}
3x + 2 &= 6\\
-2 &= -2 \\
3x &= 4 \\
x &= 4/3 \\
\end{aligned}$
\end{tabular}
\end{document}
在上面的例子中,我实现了一个表格环境。您也可以使用数组或多列版本来创建相同的结果。
答案2
没有表格:
\documentclass{article}
\usepackage{amsmath}
\begin{document}
\begin{gather*}
\begin{aligned}
3x + 2 &= 6\\
-2 &= -2 \\
3x &= 4 \\
x &= 4/3 \\
\end{aligned} \quad \vrule \quad
\begin{aligned}
3x + 2 &= 6\\
-2 &= -2 \\
3x &= 4 \\
x &= 4/3 \\
\end{aligned}
\end{gather*}
\end{document}
这也有效
\[
\begin{aligned}
3x + 2 &= 6\\
-2 &= -2 \\
3x &= 4 \\
x &= 4/3 \\
\end{aligned} \quad \vrule \quad
\begin{aligned}
3x + 2 &= 6\\
-2 &= -2 \\
3x &= 4 \\
x &= 4/3 \\
\end{aligned}
\]