I used code found here to create my own long division of a generalized polynomial.
As you can see, there is some vertical alignment problem when subscripts and superscripts are combined. My code is listed below. Could anyone lend a hand?
\documentclass{article}
\usepackage{amssymb}
\usepackage{array}
\newcommand{\x}[1]{\multicolumn{1}{|r}{#1}}
\begin{document}
\[
\renewcommand\arraystretch{1.2}% specify the vertical stretch
\begin{array}{*{5}{>{\hfill}m{8.5mm}}}%specify the column width
&
&
1&
1&
0\\\cline{2-5}
$x \,- \, u$&
\x${f_{n-1}x^{n-1}}$&
$f_{n-2}$&
${f_{n-3}x^{n-3}}$&
1\\
&
a&
-1&
&
\\\cline{2-4}
&
&
1&
-1&
\\
&
&
1&
-1&
\\\cline{3-5}
&
&
&
&
1\\
\end{array}
\]
\end{document}


mbut why do that rather than leave the columns natural width? – David Carlisle Oct 08 '15 at 12:43\documentclassetc to this but got! Undefined control sequence. l.15 \xYou could edit the example to make it a full error-free document. – David Carlisle Oct 08 '15 at 12:46