![是否有可能在对齐环境中集成多项式除法?](https://linux22.com/image/382317/%E6%98%AF%E5%90%A6%E6%9C%89%E5%8F%AF%E8%83%BD%E5%9C%A8%E5%AF%B9%E9%BD%90%E7%8E%AF%E5%A2%83%E4%B8%AD%E9%9B%86%E6%88%90%E5%A4%9A%E9%A1%B9%E5%BC%8F%E9%99%A4%E6%B3%95%EF%BC%9F.png)
梅威瑟:
\documentclass{scrartcl}
\usepackage{
amsmath,
polynom
}
\polyset{
vars = s,
style = C
}
\begin{document}
\begin{align}
Y &= \underbrace{\frac{1 + s}{-24 + 26s - 9s^2 + s^3}}_{G}U.
\intertext{Ein Pol von $G$ raten:}
p_1 &= 2.
\intertext{Polynomdivision:}
%\polylongdiv{s^3-9s^2+26s-24}{s-2}% generates many errors
\left(s^3-9s^2+26s-24\right):(s-2) &= s^2-7s+12\ldots
\end{align}
\[\polylongdiv{s^3-9s^2+26s-24}{s-2}\]
\end{document}
提前感谢您的帮助和努力!
答案1
你可以像这样\polylongdiv{...}{...}
支撑
{\polylongdiv{...}{...}}
但对齐也会偏离。一种解决方法是测量倒车量:
\documentclass{scrartcl}
\usepackage{amsmath,mathtools,polynom}
\polyset{
vars = s,
style = C
}
\begin{document}
\begin{align}
Y &= \underbrace{\frac{1 + s}{-24 + 26s - 9s^2 + s^3}}_{G}U.
\shortintertext{Ein Pol von $G$ raten:}
p_1 &= 2.
\intertext{Polynomdivision:}
&\settowidth{\dimen0}{%
$\displaystyle\bigl({}-{}s^3-9s^2+26s-24\bigr)\div\bigl(s-2\bigr)$%
}%
\hspace*{-\dimen0}\!\!{\polylongdiv{s^3-9s^2+26s-24}{s-2}}\\
(s^3-9s^2+26s-24):(s-2) &= s^2-7s+12
\end{align}
\end{document}
我使用了\shortintertext
第一个,因此间距不是那么大。
另一方面,我不明白为什么要尝试将截然不同的事物结合起来,因此我建议gather
:
\documentclass{scrartcl}
\usepackage{amsmath,mathtools,polynom}
\polyset{
vars = s,
style = C
}
\begin{document}
\begin{equation}
Y = \underbrace{\frac{1 + s}{-24 + 26s - 9s^2 + s^3}}_{G}U.
\end{equation}
Ein Pol von $G$ raten:
\begin{equation}
p_1 = 2.
\end{equation}
Polynomdivision:
\begin{gather}
\begin{gathered} % for centering the equation number
\!\!{\polylongdiv{s^3-9s^2+26s-24}{s-2}}
\end{gathered}\\
(s^3-9s^2+26s-24):(s-2) = s^2-7s+12
\end{gather}
\end{document}
显然,\polylongdiv
在左侧添加了两个窄空格。
\begin{gathered}[t]
如果您希望方程编号位于顶部而不是图表的中心,则使用。
答案2
它们嵌套得不好。但你可以这样做
\documentclass{scrartcl}
\usepackage{
amsmath,
polynom
}
\polyset{
vars = s,
style = C
}
\begin{document}
\begin{align}
Y &= \underbrace{\frac{1 + s}{-24 + 26s - 9s^2 + s^3}}_{G}U.
\intertext{Ein Pol von $G$ raten:}
p_1 &= 2.
\intertext{Polynomdivision:}
&\parbox{.6\textwidth}{\polylongdiv{s^3-9s^2+26s-24}{s-2}}\\
\left(s^3-9s^2+26s-24\right):(s-2) &= s^2-7s+12\ldots
\end{align}
\end{document}