2

I have a table and I would like to have an arrow on the right, but I get this error "Extra \right. $\right\Uparrow". How do I fix it? I use tikz package and graphicx. Here's the code:

\begin{center}
$\right\Uparrow$    
        \begin{tabular}{ r|c } 
            42588 & 0 \\ 
            21294 & 0 \\
            10647 & 1 \\
            5323 & 1 \\
            2661 & 1 \\
            1330 & 0 \\
            665 & 1 \\
            332 & 0 \\
            166 & 0 \\
            83 & 1 \\
            41 & 1 \\
            20 & 0 \\
            10 & 0 \\
            5 & 1 \\
            2 & 0 \\
            1 & 1 \\
            0 & - \\
        \end{tabular}
$\right\Uparrow$        
\end{center}

Edit: this is what I would like to get as an outputenter image description here

Edit 2: I fixed it

\begin{center}
    $\left.
        \begin{tabular}{ r|c } 
            42588 & 0 \\ 
            21294 & 0 \\
            10647 & 1 \\
            5323 & 1 \\
            2661 & 1 \\
            1330 & 0 \\
            665 & 1 \\
            332 & 0 \\
            166 & 0 \\
            83 & 1 \\
            41 & 1 \\
            20 & 0 \\
            10 & 0 \\
            5 & 1 \\
            2 & 0 \\
            1 & 1 \\
            0 & - \\
        \end{tabular}
    \right\uparrow$     
\end{center}
5
  • This is unrelated to the table. Your arrow syntax is not correct. Commented Jan 10 at 17:08
  • How do I fix it?
    – pepper
    Commented Jan 10 at 17:17
  • Is $\Rightarrow$ what you need? Commented Jan 10 at 17:17
  • What output are you trying to get? Normally, it's \left ... \right, but you're not allowed to leave math mode, and the left/right only works on somethings.
    – Teepeemm
    Commented Jan 10 at 17:18
  • I don't know, this is literally the first time I'm using latex. All I know is that I have this table on the center and I want an arrow going up from the last number to the first one
    – pepper
    Commented Jan 10 at 17:20

1 Answer 1

4

The idea of left/right is that you'll have \left(left thing)(middle stuff)\right(right thing). So your first problem is that you have two rights and no left. Your next problem is that you leave math mode to have the tabular, and then reenter math mode, so that the \left/\right are in different groups.

You can get everything into one group by having it all in math mode and using array instead of tabular. And since you don't want anything on the left, you can use \left. (note the period) to suppress that.

\documentclass{article}
\begin{document}
\[
\left.
        \begin{array}{ r|c } 
            42588 & 0 \\ 
            21294 & 0 \\
            10647 & 1 \\
            5323 & 1 \\
            2661 & 1 \\
            1330 & 0 \\
            665 & 1 \\
            332 & 0 \\
            166 & 0 \\
            83 & 1 \\
            41 & 1 \\
            20 & 0 \\
            10 & 0 \\
            5 & 1 \\
            2 & 0 \\
            1 & 1 \\
            0 & - \\
        \end{array}
\right\Uparrow
\]
\end{document}

Resulting in:

table of numbers with double up arrow

If you want the single lined arrow of your picture, then you can use \uparrow instead.

1
  • 1
    Thank you very much, now I understand
    – pepper
    Commented Jan 10 at 17:47

You must log in to answer this question.

Not the answer you're looking for? Browse other questions tagged .