3

Why are the following entries in the table not vertically aligned? I see that the first column is too low and the second column is too high.

enter image description here

Here is my code:

\documentclass{article}
\usepackage{tabularx,amsmath,color}

\begin{document}

\begin {centering}
    \huge{\textbf{Homogene Transformationen}} \\[20pt]
\end{centering}


\noindent
\begin{tabularx}{\textwidth}{XX}

\hline

    \color{red}{\textbf{Translation}} 

    &

    T = $\begin{pmatrix}
                1 & 0 & d_x \\
                0 & 1 & d_y \\
                0 & 0 & 1
    \end{pmatrix} $\\

    \hline
\end{tabularx}

\end{document}
  • It's very unfortunate that MathJax forces one to write \color{red}{text}, which is utterly wrong in LaTeX and still has no \textcolor command. – egreg Jan 11 '16 at 21:45
  • @egreg I agree it should be the default (I tried to convince them) but mathjax has had a configuration to use better color for ages docs.mathjax.org/en/latest/tex.html?highlight=latex#color you could put in a feature request for math,sx to use that – David Carlisle Jan 11 '16 at 22:43
5

\color does not take the text to be coloured in an argument, you should use

 \textcolor{red}{\textbf{Translation}} 

not

 \color{red}{\textbf{Translation}} 

As noted in the color package documentation \color at the start of a table cell can affect the positioning, use of \textcolor starts the paragraph before the colour change so avoids that problem.

enter image description here

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.