Graphics, Figures & TablesMatrix within a Table

Information and discussion about graphics, figures & tables in LaTeX documents.
Post Reply
KarolisK
Posts: 13
Joined: Sat Jun 18, 2011 3:36 pm

Matrix within a Table

Post by KarolisK »

Hello,

I have been trying to create a table with some mathematical operators in it and it includes rotor which has to be written in matrix form. I just went straight forward and used {vmatrix} environment. However, I am not satisfied with the result, because the straight line brackets tend to stretch over the empty spaces between lines. Thank You in advance!

P.S I have also noticed that \vec{A} is not produced too, so there might be a problem too.

MWE:

Code: Select all

\documentclass[a4paper,10pt]{article}
\usepackage{amsmath, blindtext, multicol, xspace}
\usepackage{hyperref}
\usepackage{booktabs}
\usepackage{array}
\begin{document}
\begin{tabular}{ccc}
\toprule[1.5pt]
Cartesian & Cylindrical & Spherical \\
\midrule
1 & 2 & 3 \\
1 & 2 & 3 \\
1 & 2 & 3 \\
\[\vec{A} = 
\begin{vmatrix}
a_{11} & a_{12} \\
a_{21} & a_{22}
\end{vmatrix}
\] & 2 & 3\\
\bottomrule[1.5pt]
\end{tabular}
\end{document}
Last edited by KarolisK on Fri Dec 23, 2011 3:20 pm, edited 1 time in total.

Recommended reading 2024:

LaTeXguide.org • LaTeX-Cookbook.net • TikZ.org

NEW: TikZ book now 40% off at Amazon.com for a short time.

And: Currently, Packt sells ebooks for $4.99 each if you buy 5 of their over 1000 ebooks. If you choose only a single one, $9.99. How about combining 3 LaTeX books with Python, gnuplot, mathplotlib, Matlab, ChatGPT or other AI books? Epub and PDF. Bundle (3 books, add more for higher discount): https://packt.link/MDH5p

Stefan Kottwitz
Site Admin
Posts: 10324
Joined: Mon Mar 10, 2008 9:44 pm

Re: Matrix within a Table

Post by Stefan Kottwitz »

Hi KarolisK,

simply use $...$ (inline math) instead of \[ ... \]. The latter is for displayed equations.

Stefan
LaTeX.org admin
KarolisK
Posts: 13
Joined: Sat Jun 18, 2011 3:36 pm

Re: Matrix within a Table

Post by KarolisK »

Thanks! It does repair the errors, however the brackets still extend over the spaces between lines.
User avatar
Stefan Kottwitz
Site Admin
Posts: 10324
Joined: Mon Mar 10, 2008 9:44 pm

Matrix within a Table

Post by Stefan Kottwitz »

The row with the matrix ist just higher, but the brackets don't overlap. You can see if you put a \midrule before the matrix.
matrix.png
matrix.png (4.98 KiB) Viewed 9441 times
Stefan
LaTeX.org admin
KarolisK
Posts: 13
Joined: Sat Jun 18, 2011 3:36 pm

Re: Matrix within a Table

Post by KarolisK »

Thanks a million :) I forgot to include "\setlength{\extrarowheight}{6pt}" in the example. It was causing the unwanted effecs.
Post Reply