我现在正在制作一张桌子,我牢房里的物品被压碎了,这真的很烦人
\begin{center}
\begin{tabular}{|c| c | c|}
Critical Points $P_0$ & $f(P_0)$ & Conclusion \\
\hline
(0,0,1) & 0 & Local Extrema\\ \hline
(0,0,-1) & -2 & Absolute minimum \\ \hline
$\left ( 0,0,\frac{1}{2} \right ) $ & $\frac{1}{4}$ & Local Extrema \\ \hline
$(0,0, \frac{\sqrt{12}}{5})$ & $\frac{8}{5}$ & Absolute maximum \\ \hline
$(0,0, -\frac{\sqrt{12}}{5})$ & $\frac{8}{5}$ & Absolute maximum \\
\end{tabular}
\end{center}
我的分数越来越少了,而且没有“p{height}”这样的词可以修复。
答案1
我建议你不要增加行的垂直空间,而是进行一些更改:
- 不要使用
\frac{a}{b}
,而要简单a/b
;这会增加可读性。 - 使用
booktabs
和array
包。 消除垂直规则。
\documentclass{article} \usepackage{amsmath} \usepackage{array} \usepackage{booktabs} \begin{document} \begin{center} \begin{tabular}{*{2}{>{$}c<{$}} c} \toprule \multicolumn{1}{c}{Critical Points $P_0$} & f(P_0) & Conclusion \\ \cmidrule(r){1-1}\cmidrule(lr){2-2}\cmidrule(l){3-3} (0,0,1) & 0 & Local Extrema\\ (0,0,-1) & -2 & Absolute minimum \\ (0,0,1/2 ) & 1/4 & Local Extrema \\ (0,0,\sqrt{12}/5) & 8/5 & Absolute maximum \\ (0,0, -\sqrt{12}/5) & 8/5 & Absolute maximum \\ \bottomrule \end{tabular} \end{center} \end{document}
如果由于某种原因无法使用array
和,我的第一和第三个建议仍然适用,您可以更改;类似这样的操作:booktabs
\arraystretch
\documentclass{article}
\usepackage{amsmath}
\begin{document}
\begin{center}
\renewcommand\arraystretch{1.2}
\begin{tabular}{c c c}
\hline
Critical Points $P_0$ & $f(P_0)$ & Conclusion \\
\hline
$(0,0,1)$ & $0$ & Local Extrema\\
$(0,0,-1)$ & $-2$ & Absolute minimum \\
$(0,0,1/2 )$ & $1/4$ & Local Extrema \\
$(0,0,\sqrt{12}/5)$ & $8/5$ & Absolute maximum \\
$(0,0, -\sqrt{12}/5)$ & $8/5$ & Absolute maximum \\
\hline
\end{tabular}
\end{center}
\end{document}
答案2
包裹cellspace
提供一种获取正确高度的简单方法:
\documentclass{article}
\usepackage{amsmath}
\usepackage{array}
\usepackage{booktabs}
\usepackage{cellspace}
\addtolength\cellspacetoplimit{3pt}
\addtolength\cellspacebottomlimit{3pt}
\begin{document}
\begin{center}
\begin{tabular}{>{$}c<{$}>{$}Sc<{$}c}
\toprule
\multicolumn{1}{c}{Critical Points $P_0$} & f(P_0) & Conclusion \\
\cmidrule(r){1-1}\cmidrule(lr){2-2}\cmidrule(l){3-3}
(0,0,1) & 0 & Local Extrema\\
(0,0,-1) & -2 & Absolute minimum \\
(0,0,1/2 ) & \dfrac14 & Local Extrema \\
(0,0,\sqrt{12}/5) & \dfrac85 & Absolute maximum \\
(0,0, -\sqrt{12}/5) & \dfrac85 & Absolute maximum \\
\bottomrule
\end{tabular}
\end{center}
\end{document}