答案1
这里我做了一些堆叠。我必须引入\xlu
才能在选项卡字段上实现下划线。
编辑:我创建了\twobrak[text]
一个可堆叠的两行括号元素,可以将其合并到表格堆栈中。
\documentclass{article}
\usepackage{tabstackengine}
\def\xlu#1{\setbox0=\hbox{$#1{}$}%
\stackunder[.4\baselineskip]{#1{}}{\protect\rule{\wd0}{.5pt}}%
}
\newcommand\twobrak[1][]{\raisebox{.5\dimexpr\Lstackgap}{\mbox{#1}\ttwobrak}}
\savestack\ttwobrak{$\left\{\Centerstack{\\}\right.$}
\stackMath
\setstackgap{L}{1.2\baselineskip}
\def\stacktype{L}
\setstacktabulargap{0pt}
\begin{document}
\[\TABbinary
\tabularLongunderstack{rrl}{
8x& + 6y = & 4\\
\twobrak\xlu{-15x}& \xlu{{}- 8y =}& \xlu{-3}\\
-7x& = & 1\qquad\qquad\vert:(-7)\\
& x = & {-}1/7
}%
\]
\end{document}
如果想要在最后一列进行[混合]右对齐,请尝试以下操作:
\documentclass{article}
\usepackage{tabstackengine}
\def\xlu#1{\setbox0=\hbox{$#1{}$}%
\stackunder[.4\baselineskip]{#1{}}{\protect\rule{\wd0}{.5pt}}%
}
\newcommand\twobrak[1][]{\raisebox{.5\dimexpr\Lstackgap}{\mbox{#1}\ttwobrak}}
\savestack\ttwobrak{$\left\{\Centerstack{\\}\right.$}
\stackMath
\setstackgap{L}{1.2\baselineskip}
\def\stacktype{L}
\setstacktabulargap{0pt}
\begin{document}
\[\TABbinary
\tabularLongunderstack{rrrl}{
8x& + 6y = & 4&\\
\twobrak\xlu{-15x}& \xlu{{}- 8y =}& \xlu{-3}&\\
-7x& = & 1&\qquad\qquad\vert:(-7)\\
& x = \rlap{$-1/7$}& &
}%
\]
\end{document}
根据我的回答获得显示消元法解决联立方程的图表的最优雅方法是什么?
跟进:
引入\twobrak[]
允许在单个堆栈中使用具有多个括号元素的更大堆栈。
\documentclass{article}
\usepackage{tabstackengine}
\def\xlu#1{\setbox0=\hbox{$#1{}$}%
\stackunder[.4\baselineskip]{#1{}}{\protect\rule{\wd0}{.5pt}}%
}
\stackMath
\setstackgap{L}{1.2\baselineskip}
\def\stacktype{L}
\setstacktabulargap{0pt}
\newcommand\twobrak[1][]{\raisebox{.5\dimexpr\Lstackgap}{\mbox{#1}\ttwobrak}}
\savestack\ttwobrak{$\left\{\Centerstack{\\}\right.$}
\begin{document}
\[\TABbinary
\tabularLongunderstack{rrll}{
x & - 2y = & 13 & \\
\twobrak[some text] 3x & + y = & 4 \qquad\qquad & \vert ~\cdot 2 \\
& & & \\
x & - 2y = & 13 & \\
\twobrak[more text]\xlu{6x} & \xlu{{}+ 2y =} & \xlu{8} & \\
7x & = & 21 \qquad\qquad & \vert:7 \\
& x = & 3 &
}
\]
\end{document}
答案2
以下是基于该blkarray
包的解决方案:
\documentclass{book}
\usepackage{amsmath}
\usepackage{blkarray, bigstrut, booktabs}
\usepackage[x11names]{xcolor}
\begin{document}
\begin{equation}
\begin{blockarray}{r@{}r@{{}={}}l@{\qquad}l}
\begin{block}{\Left{\scriptsize\fcolorbox{IndianRed3}{white}{\parbox{1.6cm}{\raggedright Here, we can add some explanations}}}{\{\,}r@{} >{{}}r@{{}={}}l@{\qquad}l}
8x & +6y & \hphantom{-}4\\
-15x & -6y & -3\\
\end{block}
\cmidrule[0.6pt](l{0.66em}r{2.8em}){1-3}
-7x & {}& \hphantom{-}1 &\lvert\colon (-7)\\
& x &-1/7
\end{blockarray}
\end{equation}
\end{document}
答案3
下面使用默认array
构造来布局您需要的元素:
\documentclass{article}
\begin{document}
\[
\renewcommand{\arraystretch}{1.2}
\begin{array}{r@{}r@{}l@{}l}
\raisebox{-.5\dimexpr\arraystretch\normalbaselineskip}[0pt][0pt]{$
\left\{\begin{array}{@{}c@{}} \mathstrut \\ \mathstrut \end{array}\right.
$}
& 8x + 6y & {}= 4 \\
& -15x - 6y & {}= -3 \\
\cline{2-3}
& -7x \phantom{{} + 6y} & {}= 1 & \qquad (\div -7) \\
& x & {}= -\frac{1}{7}
\end{array}
\]
\end{document}
代码中的布局选择特定于这种情况,并且如果某些数字发生变化,则可能需要更多的工作。
改变是为了(在某种程度上)匹配-and-friends\arraystretch
的垂直间距。align
答案4
我编辑了史蒂文提交的代码:
\[\TABbinary
\left\{\Centerstack{\\}\right.\raisebox{3.5\dimexpr\Lstackgap}{
\tabularLongunderstack{rrll}{
x & - 2y = & 13 & \\
3x & + y = & 4 \qquad\qquad & \vert ~\cdot 2 \\
& & & \\
x & - 2y = & 13 & \\
\xlu{6x} & \xlu{{}+ 2y =} & \xlu{8} & \\
7x & = & 21 \qquad\qquad & \vert:7 \\
& x = & 3 &
}}
\]
还有一个问题。如何得到前两个方程式左侧的花括号?