Information and discussion about graphics, figures & tables in LaTeX documents.
ChelseaBoot
Posts: 7 Joined: Fri Jun 17, 2011 9:54 am
Post
by ChelseaBoot » Sun Jun 19, 2011 1:25 pm
I have been trying to rescale the height of cells in a table:
Code: Select all
\begin{table}[htbp]
\begin{center}
\begin{tabular}{>{$\displaystyle}p{.2\textwidth}<{$} >{$\displaystyle}p{.3\textwidth}<{$}}
%================================%
\toprule
\textbf{Derivative} & \textbf{Expression} \\
\toprule
\dfrac{\partial \mathbi{X}\transp\mathbf{A}\mathbi{X}}{\partial\mathbi{X}} &= \underbrace{\left(\mathbf{A}+\mathbf{A}\transp\right)\mathbi{X}}_{\textit{Column Vector}} &\\
\dfrac{\partial \mathbi{X}\transp\mathbf{A}\mathbi{X}}{\partial\mathbi{X}\transp} &= \underbrace{\mathbi{X}\transp\left(\mathbf{A}+\mathbf{A}\transp\right)}_{\textit{Row Vector}}&\\
%================================%
\midrule
\dfrac{\partial \mathbi{A}\transp\mathbi{X}}{\partial \mathbi{X}} &= \mathbi{A} \\
\dfrac{\partial \mathbi{X}\transp\mathbi{A}}{\partial\mathbi{X}} &= \mathbi{A}\\
\dfrac{\partial \mathbi{A}\transp\mathbi{X}}{\partial \mathbi{X}\transp} &= \mathbi{A}\transp \\
\dfrac{\partial \mathbi{X}\transp\mathbi{A}}{\partial\mathbi{X}\transp} &= \mathbi{A}\transp \\
%================================%
%\midrule
%\dfrac{\partial}{\partial} &= \\
%\dfrac{\partial}{\partial} &=
%================================%
\bottomrule
\end{tabular}
\end{center}
\end{table}
with an
but only the top half of the table seems to get adjusted and the bottom half cells tend to run into each other.
Any clues how to solve this?
Thanks
Last edited by
ChelseaBoot on Sun Jun 19, 2011 3:18 pm, edited 1 time in total.
NEW: TikZ book now 40% off at Amazon.com for a short time.
ChelseaBoot
Posts: 7 Joined: Fri Jun 17, 2011 9:54 am
Post
by ChelseaBoot » Sun Jun 19, 2011 2:37 pm
Sorry!
Code: Select all
\documentclass[a4paper]{article}
\usepackage{amsmath,amssymb}
\usepackage{tabularx}
\usepackage{bm}
\usepackage{booktabs}
\renewcommand{\arraystretch}{1.1}
\def\mathbi#1{\textbf{\em #1}}
\newcommand{\transp}{^{\mathsf{T}}}
\begin{document}
\begin{table}[htbp]
\begin{center}
\begin{tabular}{>{$\displaystyle}p{.2\textwidth}<{$} >{$\displaystyle}p{.3\textwidth}<{$}}
%================================%
\toprule
\textbf{Derivative} & \textbf{Expression} \\
\toprule
\dfrac{\partial \mathbi{X}\transp\mathbf{A}\mathbi{X}}{\partial\mathbi{X}} &= \underbrace{\left(\mathbf{A}+\mathbf{A}\transp\right)\mathbi{X}}_{\textit{Column Vector}} &\\
\dfrac{\partial \mathbi{X}\transp\mathbf{A}\mathbi{X}}{\partial\mathbi{X}\transp} &= \underbrace{\mathbi{X}\transp\left(\mathbf{A}+\mathbf{A}\transp\right)}_{\textit{Row Vector}}&\\
%================================%
\midrule
\dfrac{\partial \mathbi{A}\transp\mathbi{X}}{\partial \mathbi{X}} &= \mathbi{A} \\
\dfrac{\partial \mathbi{X}\transp\mathbi{A}}{\partial\mathbi{X}} &= \mathbi{A}\\
\dfrac{\partial \mathbi{A}\transp\mathbi{X}}{\partial \mathbi{X}\transp} &= \mathbi{A}\transp \\
\dfrac{\partial \mathbi{X}\transp\mathbi{A}}{\partial\mathbi{X}\transp} &= \mathbi{A}\transp \\
%================================%
%\midrule
%\dfrac{\partial}{\partial} &= \\
%\dfrac{\partial}{\partial} &=
%================================%
\bottomrule
\end{tabular}
\end{center}
\end{table}
\end{document}
Stefan Kottwitz
Site Admin
Posts: 10348 Joined: Mon Mar 10, 2008 9:44 pm
Post
by Stefan Kottwitz » Sun Jun 19, 2011 2:54 pm
Good that you posted a minimal example! So I could test it too. You will see that also the rows below will be adjusted if you raise the value of \arraystretch, set it for example to 2.5. Of course this is too much.
Btw. there are errors in the code: at the end of rows remove the & before \\.
You can extend the space between rows manually, write at the end of a row for example
Stefan
LaTeX.org admin
ChelseaBoot
Posts: 7 Joined: Fri Jun 17, 2011 9:54 am
Post
by ChelseaBoot » Sun Jun 19, 2011 3:16 pm
Ah, those "&"s are left over from a different table formatting. Thanks for pointing them out.
And the "[3ex]" works quite well. Thank you.
localghost
Site Moderator
Posts: 9202 Joined: Fri Feb 02, 2007 12:06 pm
Post
by localghost » Sun Jun 19, 2011 3:56 pm
The
booktabs package provides the
\addlinespace command to insert additional space between lines. And by the way, to depict a transposed matrix you can simply use
^ \top .
ChelseaBoot
Posts: 7 Joined: Fri Jun 17, 2011 9:54 am
Post
by ChelseaBoot » Mon Jun 20, 2011 2:17 am
Thanks for the reply localghost! "\addlinespace" is very useful.