![如何在 beamer 中为线性方程组编写代码?](https://linux22.com/image/415033/%E5%A6%82%E4%BD%95%E5%9C%A8%20beamer%20%E4%B8%AD%E4%B8%BA%E7%BA%BF%E6%80%A7%E6%96%B9%E7%A8%8B%E7%BB%84%E7%BC%96%E5%86%99%E4%BB%A3%E7%A0%81%EF%BC%9F.png)
答案1
有多种工具可用于此目的,例如systeme
,数组和eqparbox
。这是一种使用幻像的非常强力的方法。
\documentclass{beamer}
\usepackage[fleqn]{mathtools}
\begin{document}
\begin{frame}[t]
\frametitle{A system of equation}
\[
\left\{\begin{aligned}
x_1&=-c_{1,r+1}x_{r+1}-c_{1,r+2}x_{r+2}-\cdots-c_{1n}x_n\;, \\
x_2&=-c_{2,r+1}x_{r+1}-c_{2,r+2}x_{r+2}-\cdots-c_{2n}x_n\;, \\
\vdotswithin{x_{1}}& \vdotswithin{-c_{1,r+1}x_{r+1}-c_{1,r+2}x_{r+2}-\cdots-c_{1n}x_n}\\
x_r&=-c_{r,r+1}x_{r+1}-c_{r,r+2}x_{r+2}-\cdots-c_{rn}x_n\;, \\
x_{r+1}&=\hphantom{-c_{r,r+1}}x_{r+1}+\hphantom{c_{2,r+2}}\mathllap{0}x_{r+2}+\cdots+\hphantom{c_{rn}}\mathllap{0}x_n\;, \\
x_{r+2}&=\hphantom{-c_{r,r+1}}\mathllap{0}x_{r+1}+\hphantom{c_{2,r+2}}x_{r+2}+\cdots+\hphantom{c_{rn}}\mathllap{0}x_n\;, \\
\vdotswithin{x_{1}}& \vdotswithin{-c_{1,r+1}x_{r+1}-c_{1,r+2}x_{r+2}-\cdots-c_{1n}x_n}\\
x_n&=\hphantom{-c_{r,r+1}}\mathllap{0}x_{r+1}+\hphantom{c_{2,r+2}}\mathllap{0}x_{r+2}+\cdots+\hphantom{c_{rn}}x_n\;.
\end{aligned}\right.\]
\end{frame}
\end{document}