# “Illegal pream-token (]) used.” for array

I have an identical error message as the one in this question. However upon applying the solution in the answer, the errors still occur.

As always, any help is greatly appreciated, and thanks in advance.

MWE:

\documentclass[12pt]{article}
\usepackage{siunitx}
\begin{document}
\subsection{b)}
$2x^3+5x^2-7x+3$\\
$\sisetup{table-format=1.1} \vspace{2mm} \begin{array}{S|SSSr[table-format=-1]} 1 & 2 & 5 & \multicolumn{1}{S|}{-7} & \multicolumn{1}{S}{3}\\ & & 2 & \multicolumn{1}{S|}{7}\\ \cline{2-4} 2 & 2 & \multicolumn{1}{S|}{7} & \multicolumn{1}{S}{0} \\ & & \multicolumn{1}{S|}{4} \\ \cline{2-3} 3 & \multicolumn{1}{S|}{2} &\multicolumn{1}{r}{11} \\ & \multicolumn{1}{S|}{ }\\ \cline{2-2} \multicolumn{3}{S}{2} \end{array}$\\
\vspace{2mm}
$\therefore 2x^3+5x^2-7x+3 = 2x(x-1)(x-2) + 11x(x-1)+3$
\end{document}

• If you want to add vertical space after \\, use \\[2mm]; the \vspace{2mm} after $ adds the space below the formula, not above it. – egreg Feb 4 '17 at 13:17 ## 2 Answers In addition to not passing an option to the r column type (which doesn't take any options), you may want to reorganize and streamline the code of the array environment, say, along the following lines. \documentclass[12pt]{article} \usepackage{siunitx} % for 'S' column type \usepackage{amssymb} % for '\therefore' macro \begin{document} \subsection{b)}$2x^3+5x^2-7x+3$\\ \sisetup{table-format=-1.0} \medskip\noindent$\begin{array}{@{}r|SSS|S}
1 & 2 & 5 & -7 & 3\\
&   & 2 &  7 \\
\cline{2-4}
2 & 2 & \multicolumn{1}{S|}{7} & \multicolumn{1}{S}{0} \\
&   & \multicolumn{1}{S|}{4} \\
\cline{2-3}
3 & \multicolumn{1}{S|}{2} &\multicolumn{1}{r}{11} \\
& \multicolumn{1}{S|}{}\\
\cline{2-2}
\multicolumn{1}{r}{} & 2
\end{array}$\medskip\noindent$\therefore 2x^3+5x^2-7x+3 = 2x(x-1)(x-2) + 11x(x-1)+3\$
\end{document}


r columns does not take options, S columns do. So move that [....] to after an S column