无需使用表格的表格公式表样式

无需使用表格的表格公式表样式

我想存档一些与剑桥物理学公式风格类似的内容,如本问题末尾的屏幕截图所示。左侧是方程名称,中间是带有数字的方程,并对一些符号进行了解释。脚注使用字母而不是数字,并且位于章节底部而不是页面底部。

我认为表格环境不是实现此目的的正确方法,因为我必须使用很多\multirow。另外,我不能\begin{equation}在表格内使用,因此方程式数字不起作用。

剑桥物理学公式书截图

答案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}   

在此处输入图片描述

相关内容