1

I'm trying to place a tabular containing some values for x and y inside an align statement.

\begin{align*}
    0 &= 0 \\
    \begin{tabular} {|c|c|c|}
        %table content
    \end{tabular} \\
    1 &= 1
\end{align*}

enter image description here

Since this isn't really pretty I'd appreciate to center the table.

Or is there a way so one could share the alignment over 2 aligns?

Thanks in Advance for any suggestions :)

Edit: I tried grouping the tabular together with a \centering command, which did not work.

0

2 Answers 2

0

The package amsmath offers an \intertext{...} command to set complete lines inbetween equations. \centering such "intertext" material could lead to the following:

\documentclass{article}
\usepackage{amsmath}

\begin{document}
\begin{align*}
    0 &= 0 
    \intertext{\centering%
                \begin{tabular} {|c|c|r|}
                \hline
                  x  &  0  &  1 \\
                \hline
                  y  &  0  & -1 \\
                \hline
                \end{tabular}
              }
    1 &= 1
\end{align*}
\end{document}

with the output :

enter image description here

0
0

Not a scaleable solution if you got many tabbles, but you can manually align the equations by padding it with \hspace

\begin{align*}
    0 &= 2 + 5 - 7\\
    &\hspace{-20pt}\begin{tabular}{|c|c|c|}
        \hline
        a & b & c \\
        \hline
        c & d & e \\
        \hline
        f & g & h \\
        \hline
    \end{tabular}\\
    5 + 7 - 11 &= 1
\end{align*}

enter image description here

1
  • Hi, welcome. You can make do with a bit less manual intervention, by using align* as in the OP's original code, and adding &\hspace{-15pt} (or some other suitable length) right before \begin{tabular}. Jan 14, 2019 at 19:23

You must log in to answer this question.

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