1

Is there a way to organize the vertical alignment in table around a particular symbol. For example in the below code

\begin{table}
\begin{center}
  \begin{tabular}{ *{1}{c}}
    a = b + c \\
    a + b = c + d \\
  \end{tabular}
  \caption{16 constants used for BLAKE-256}
\end{center}
\end{table}

A sample table would look like

  a = b + c
a + b = c + d

However, I would like the output to center align around equals sign. Something like below.

    a = b + c
a + b = c + d

Is something like this possible in latex?

0

1 Answer 1

2

Is there are reason you aren't using align*?

\documentclass{article}
\usepackage{amsmath}
\begin{document}

\begin{table}
  \centering
  \begin{minipage}{\linewidth}
  \begin{align*}
    a & = b + c \\
    a + b & = c + d
  \end{align*}
  \end{minipage}
  \caption{16 constants used for BLAKE-256}
\end{table}
\end{document}

enter image description here

10
  • Please, the correct answer is with align*; the present one has several glitches. For example it doesn't use math mode and the spacing is terrible.
    – egreg
    Jul 17, 2013 at 23:18
  • @egreg I asked the OP if there is a reason why he isn't using align.
    – dustin
    Jul 17, 2013 at 23:19
  • Thanks a ton, that worked. Well, I was not aware of the align package. I kept Google searching for vertical table alignment, rather than alignment.
    – Soham
    Jul 17, 2013 at 23:34
  • 1
    -1, switching from tabular to align* isn't exactly a small change. E.g. with multiple rows (of which one should be aligned in this way), alternating row colors, it's not a feasible alternative.
    – stefan
    Nov 8, 2013 at 15:51
  • 1
    @dustin Ever heard of multiple columns, row colors, or any other fancy table stuff? Stackexchange is a platform not to solve the posters problem only. There is a reason for that it is not deleted after an answer is found and the poster is happy. Others should be able to use the answer as well, even in a slightly different context. That's impossible with these crappy "do something completely different instead" answers.
    – stefan
    Nov 9, 2013 at 8:59

You must log in to answer this question.

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