When I put an equation in a tabular, it gets vertically compressed. How do I prevent that?
[Tex/LaTex] Embedding large equation in tabular
equationsmath-modetables
Related Solutions
\documentclass{article}
\usepackage{amsmath,varwidth,array,ragged2e}
\newcolumntype{L}{>{\varwidth[c]{\linewidth}}l<{\endvarwidth}}
\newcolumntype{M}{>{$}l<{$}}
\def\ds{\mathrm{d}s}% don't know what your \ds should be ....
\begin{document}
\def\arraystretch{1.7}
\begin{tabular}{rMrL}
(A) & \ds u=\sqrt{x^2+y^2} &(B) & $\ds u=\sqrt{x^4+y^4}$\tabularnewline
(C) & \ds u=\sqrt[3]{xy} &(D) & $\ds u=\sqrt[3]{x^2+y^2}$\tabularnewline
(E) & \ds u=\sqrt[3]{x^4+y^4} & (F) &
\[ u=\begin{cases}e^{\frac{-1}{x^2+y^2}}; &x^2+y^2\neq 0\\ 0; &x^2+y^2=0\end{cases} \] \tabularnewline
(G) & \ds u=\sqrt[3]{x}\sin y & (H) & $\ds u=\sqrt[3]{y}\tan x$
\end{tabular}
\end{document}
You can use m
-type columns and flalign
for left aligning the numbered equation. Some vertical space corrections are needed, but they're hidden in a macro, so you don't need to specify them each time.
\documentclass{report}
\usepackage[T1]{fontenc}
\usepackage[utf8]{inputenc}
\usepackage[ngerman]{babel}
\usepackage[intlimits]{amsmath}
\usepackage{booktabs,array}
\usepackage{caption}
\newcommand{\tableequation}[1]{%
\vspace*{-\baselineskip}
{\begin{flalign}#1&&&\end{flalign}}%
\vspace*{-\baselineskip}
}
\begin{document}
With a reference to one of the equations, \eqref{eq-sV}
\begin{table}[htb]
\centering
\caption{testststt} \label{tab_BG1_zustand}
\begin{tabular}{
@{}
>{\linespread{1.2}\selectfont}m{6cm}
@{}
m{6cm}
@{}
}
\toprule
Zustandsgröße & Beziehung \\
\midrule
spezifisches Volumen\newline
$v = (\partial g / \partial p)_T$ &
\tableequation{
v(\pi,\tau)\frac{p}{R T} = \pi \gamma_{\pi} \label{eq-sV}
} \\
spezifische innere Energie\newline
$u=g-T(\partial g / \partial T)_p - p(\partial g / \partial p)_T$ &
\tableequation{
\frac{u(\pi,\tau )}{R T} = \tau \gamma_{\tau}
} \\
\bottomrule
\end{tabular}
\end{table}
\end{document}
Best Answer
Put
\displaystyle
inside your\( \)
or$ $
.Added: The issue here actually has nothing to do with tables (unless I'm missing something). It's just about inline as opposed to displayed math.