答案1
以下内容可以帮助您入门:
\documentclass{report}
\usepackage{tabularx}
\usepackage{threeparttable}
\renewcommand\tabularxcolumn[1]{m{#1}}
\begin{document}
\chapter{chapter}
\section{section}
\begin{threeparttable}
\begin{tabularx}{\linewidth}{|>{\raggedright\arraybackslash}m{3cm}|X|@{}>{\footnotesize}l@{}|}
\multicolumn{3}{@{}l}{\large\bfseries some text above the table\tnote{a}}\\
\hline
Newtonian force & {\begin{equation}F = \end{equation}} & \begin{tabular}{ll} a & some text\\ b & some text \\c & come text\end{tabular}\\
\cline{1-2}
Newtonian force & {\begin{equation}F = \end{equation}} & \begin{tabular}{ll} d & some text\end{tabular}\\
\cline{1-2}
longer name that gets split into multiple lines & {\begin{equation}F = \end{equation}} & \begin{tabular}{ll} e & some text\\ f & some text \end{tabular}\\
\hline
\end{tabularx}
\begin{tablenotes}[flushleft]\scriptsize
\item[a] some explanatory text below the table
\end{tablenotes}
\end{threeparttable}
\end{document}
下面是我创建了一个带有两个参数的新环境的版本。第一个是表格标题,第二个是表格注释,表格主体包含实际公式、公式名称和变量描述:
\documentclass{report}
\usepackage{tabularx}
\usepackage{threeparttable}
\renewcommand\tabularxcolumn[1]{m{#1}}
\NewDocumentEnvironment{myformulagroup}{m m}
{\threeparttable%
\tabularx{\linewidth}{|>{\raggedright\arraybackslash}m{3cm}|X|@{}>{\footnotesize}l@{}|}%
\multicolumn{3}{@{}l}{\large\bfseries #1 \tnote{a}}\\%
\hline%
}%
{\endtabularx%
\begin{tablenotes}[flushleft]\scriptsize%
\item[a] #2%
\end{tablenotes}%
\endthreeparttable%
}
\begin{document}
\chapter{chapter}
\section{section}
\begin{myformulagroup}{title}{table note}
Newtonian force & {\begin{equation}F = \end{equation}} & \begin{tabular}{ll} a & some text\\ b & some text \\c & come text\end{tabular}\\
\cline{1-2}
Newtonian force & {\begin{equation}F = \end{equation}} & \begin{tabular}{ll} d & some text\end{tabular}\\
\cline{1-2}
longer name that gets split into multiple lines & {\begin{equation}F = \end{equation}} & \begin{tabular}{ll} e & some text\\ f & some text \end{tabular}\\
\hline
\end{myformulagroup}
\end{document}
答案2
使用该makecell
包。
\documentclass{report}
\usepackage{makecell}
\usepackage{threeparttable}
% math-mode column
\newcolumntype{E}{>{$}c<{$}}
%\newcolumntype{E}{>{$\displaystyle}c<{$}} %<-- Use this if you want equations in display style
% equation no column (source: https://tex.stackexchange.com/a/521583/219947)
\newcolumntype{N}{>{\refstepcounter{equation}(\theequation)}r}
\begin{document}
\chapter{Ch 1}
\section{Sec 1}
\begin{threeparttable}
Table Caption\tnote{a}
\begin{tabular}{|lEN|El|}
\hline
Newton & F=ma & &
\makecell[l]{F\\m\\a}& \makecell[l]{force\\mass\\acceleration} \\
\cline{1-3}
Momentum & p=mv & &
\makecell[l]{p\\v}& \makecell[l]{momentum\\velocity} \\
\hline
\end{tabular}
\begin{tablenotes}
\item[a] Table note
\end{tablenotes}
\end{threeparttable}
\end{document}