我正在尝试排版多项式长除法问题,但得到了双重运算符。
\documentclass{standalone}
\usepackage{polynom}
%% macro to remove 1 coefficients
\makeatletter
\let\pldx@saved@PrintRational\pld@PrintRational
\renewcommand*{\pld@PrintRational}[2]{%
\def\pldx@do{\pldx@PrintRational{#1}{#2}}%
\futurelet\pldx@token\pldx@do
}
\newcommand*{\pldx@PrintRational}[2]{%
\let\pldx@do\@firstofone
\ifx\pldx@token\pld@S
\def\pldx@a{#1}%
\def\pldx@b{#2}%
\ifx\pldx@a\pldx@b
\let\pldx@do\@gobble
\fi
\fi
\pldx@do{%
\pldx@saved@PrintRational{#1}{#2}%
}%
}
\makeatother
\begin{document}
$$\polylongdiv{3x^2 + ax + a + 9}{x + 2}$$
\end{document}
给我这个:
我希望最后一行不要有 +-2。