0

I am trying to typeset synthetic division. I am using the following code:

\[
\left.\begin{array}[t]{c}1\\ \,\end{array}\right|\!\begin{array}[t]{cccc}1& 2& -5& 2\\ & 1& 3& -2\\ \hline 1& 3& -2& 0\end{array}
\]

The output I get is the following:

enter image description here

Why does the vertical line go way beyond the top of the array?

I need a vertical line of the size of the first two lines of the array on the right. I am trying to achieve it using KaTeX so I can only use the commands KaTeX supports. Adding extra packages is not possible.

1 Answer 1

2

Why not simply use this code?

\[
\begin{array}[t]{c|}1\\ \,\end{array}\enspace \begin{array}[t]{rrrr}1& 2& -5& 2\\ & 1& 3& -2\\ \hline 1& 3& -2& 0\end{array}
\]

enter image description here

5
  • Yes, indeed, I have not thought about it, but it works perfectly. Thank you! Nevertheless, I would still be curious why is my code giving longer delimiter. It seems, that the top alignment confuses \left \right. Dec 12, 2019 at 22:42
  • Probably it is because the (unique) row – or the array – has some invisible spacing at the top.
    – Bernard
    Dec 12, 2019 at 22:46
  • I tried adding text around this line, it did not make a difference.I also changed it to inline math, it did not make a difference either. I do not think there is some invisible space in the array, I think it would also make the vertical line in your edit go up.I was thinking about it a bit more and I rather think that the \left ... \right height is calculated symmetric to the alignment position, which in this case produces a strange looking result. Dec 13, 2019 at 6:53
  • I think you have the correct explanation.
    – Bernard
    Dec 13, 2019 at 8:20
  • @FerencBeleznay yes which is the issue the delarray package addresses, it shifts the delimiter alongside the array as you use [t] or [b] Dec 13, 2019 at 9:13

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.