我正在处理一个表格,其中有些行有三列,有些行只有两列。
这就是我所拥有的:
\documentclass[12pt]{article}
\usepackage{amsmath}
\usepackage[latin1]{inputenc}
\begin{document}
\begin{center}
\begin{tabular}{ | m{5em} | m{1.5cm}| m{1.5cm} | }
\hline
& $ \frac{\partial^2_f}{\partial^2_x} > 0 $ & $ \frac{\partial^2_f}{\partial^2_x} < 0 $ \\
\hline
$\bigl|H| > 0$ & mínim & màxim \\
\hline
$\bigl|H| < 0$ & punt de sella \\
\hline
$\bigl|H| = 0 $ & No ho podem dir \\
\hline
\end{tabular}
\end{center}
\end{document}
我想 :
$\bigl|H| < 0$ & punt de sella \\
和
$\bigl|H| = 0 $ & No ho podem dir \\
成为位于前两列正中央的一列。
答案1
两个例子:
- 与
tabular
,和 - 与
tabularray
和derivative
包
\documentclass[12pt]{article}
\usepackage{array}
\usepackage{tabularray}
\usepackage{mathtools}
\DeclarePairedDelimiter\abs{\lvert}{\rvert}
\usepackage{derivative}
\begin{document}
\begin{center}
\begin{tabular}{ | m{5em} | m{2cm}| m{2cm} | }
\hline
& $ \frac{\partial^2_f}{\partial^2_x} > 0 $
& $ \frac{\partial^2_f}{\partial^2_x} < 0 $ \\
\hline
$\abs{H} > 0$ & mínim & màxim \\
\hline
$\abs{H} < 0$ & \multicolumn{2}{l|}{punt de sella} \\
\hline
$\abs{H} = 0$ & \multicolumn{2}{l|}{No ho podem dir} \\
\hline
\end{tabular}
\end{center}
with \verb+tblr+ of \verb+tabularrray+ and \verb+derivative+ package:
\begin{center}
\begin{tblr}{hlines, vlines,
colspec = {Q[mode=math, wd=5em]
*{2}{Q[c, wd=2cm]}},
row{1} = {mode=dmath}
}
& \pdv[order=2]{f}{x} > 0
& \pdv[order=2]{f}{x} < 0 \\
\abs{H} > 0 & mínim & màxim \\
\abs{H} < 0 & \SetCell[c=2]{l} punt de sella \\
\abs{H} = 0 & \SetCell[c=2]{l} No ho podem dir \\
\end{tblr}
\end{center}
\end{document}