我想要做的是在同一条线上求解我的系统。我已经求解了 x,但我还想将求解 y 的部分放在我刚刚求解的系统的右侧。有没有办法让它们并排?
\documentclass[10pt]{article}
\usepackage{amsmath, amsthm, amssymb}
\usepackage{array}
\usepackage{booktabs}
\usepackage[makeroom]{cancel}
\begin{document}
Solve the system.
\begin{align*}
6x-5y &= 11 && && & \\
7x+5y &= 2
\end{align*}
\begin{equation}
\renewcommand{\arraystretch}{1.2}
\begin{array}{@{}r@{}>{{}}l@{}}
6x\; {\cancel{-\;5y}} &= 11 \\
7x\; {\cancel{+\;5y}} &= 2 \\
\midrule
13x &= 13 \\
x &= 1
\end{array}
\end{equation}
\begin{flalign*}
\text{Substitute $x=1$ into one of equations to find $y$:} \ \ 6(1)-5y &=11 \\
6-5y &=11 \\
-5y &=5 \\
y &= -1
\end{flalign*}
\end{document}
答案1
像这样吗?
\documentclass[10pt]{article}
\usepackage{amsmath, amsthm, amssymb}
\usepackage{array}
\usepackage{booktabs}
\usepackage[makeroom]{cancel}
\begin{document}
\noindent
\begin{minipage}{0.45\textwidth}
Solve the following system:
\begin{align*}
6x-5y &= 11 \\
7x+5y &= 2
\end{align*}
\end{minipage}
\bigskip\noindent
\begin{minipage}[t]{0.45\textwidth}
Begin by adding the two equations to find $x$:
\begin{equation*}
\renewcommand{\arraystretch}{1.2}
\setlength\arraycolsep{0pt}
\begin{array}{r@{}>{{}}l}
6x\; {\cancel{{}-5y}} &= 11 \\
7x\; {\cancel{{}+5y}} &= 2 \\
\midrule
13x &= 13 \\
x &= 1
\end{array}
\end{equation*}
\end{minipage}
\hspace{\fill} % maximize space between the minipages
\begin{minipage}[t]{0.45\textwidth}
Then, substitute $x=1$ into one of the equations to find $y$:
\begin{align*}
6(1)-5y &=11 \\
6-5y &=11 \\
-5y &=5 \\
y &= -1
\end{align*}
\end{minipage}
\end{document}
答案2
这样怎么样:两个aligned
环境和一个\eqparbox
介于两者之间的环境,嵌套在中flalign
。Eqparbox 允许拥有一个\parbox
宽度为段落最长行宽的宽度:
\documentclass[10pt]{article}
\usepackage{amsmath, amsthm, amssymb}
\usepackage{array, eqparbox}
\usepackage{booktabs}
\usepackage[makeroom]{cancel}
\begin{document}
Solve the system.
\begin{align*}
6x-5y &= 11 && && & \\
7x+5y &= 2
\end{align*}
\begin{flalign}
& \begin{aligned}
6x {\cancel{{}- 5y}} &= 11 \\
7x {\cancel{{}+ 5y}} &= 2 \\
\midrule
13x &= 13 \\
x &= 1
\end{aligned}
& & \eqparbox[b]{Expl}{Substitute $x=1$ into \\ one of equations to find $y$:\\}
& &\begin{aligned}
7(1) + 5y & = 2\\
7 + 5y & =2 \\
5y &= -5 \\
y &= -1
\end{aligned}\qquad \end{flalign}
\end{document}