5

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}
  • 1
    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
5

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.

enter image description here

\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}
4

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

Your Answer

By clicking “Post Your Answer”, you agree to our terms of service, privacy policy and cookie policy

Not the answer you're looking for? Browse other questions tagged or ask your own question.