我是 Latex 新手,我有个问题。类似这样的表格是否可以自动编号?
现在我自己在表格中对项目进行编号,如下所示:
\begin{table}\centering
\begin{tabular}{lll}
\toprule
1. prepare process \\ \hline
(a) cut the infinite pipe into three regions, \\
(b) calculate the boundary velocity of the finite pipe using series expression, \\
(c) decompose the fluid field into singular and harmonic parts, \\
(d) solve the harmonic field and make the tables of strength $\bm{G}^i$, \\
\midrule
2. calculation process \\ \hline
(a) interpolate $\bm{g}_2^i(\bm{x}_f)$ using $\bm{G}^i$, \\
(b) resolve the Stokeslets $\bm{S}_{pipe}$. \\
\bottomrule
\end{tabular}
\caption{1 and 2 in relation to Foo and Bar.}
\end{table}
表格中的项目可以在 Latex 中自动索引吗?谢谢。
答案1
使用enumerate
列表:
\documentclass{article}
\usepackage{bm}
\begin{document}
\begin{table}
\centering
\rule[-1ex]{\linewidth}{1pt}
\begin{enumerate}
\item prepare process\\[1.5ex]
\hrule height0.3pt \relax
\begin{enumerate}
\item cut the infinite pipe into three regions,
\item calculate the boundary velocity of the finite pipe using series expression,
\item decompose the fluid field into singular and harmonic parts,
\item solve the harmonic field and make the tables of strength $\bm{G}^i$,
\end{enumerate}
\hrule height 0.5pt \relax
\item calculation process \\[1.5ex]
\hrule height0.3pt \relax
\begin{enumerate}
\item interpolate $\bm{g}_2^i(\bm{x}_f)$ using $\bm{G}^i$,
\item resolve the Stokeslets $\bm{S}_{pipe}$.
\end{enumerate}
\end{enumerate}
\rule[2ex]{\linewidth}{1pt}
\caption{1 and 2 in relation to Foo and Bar.}
\end{table}
\end{document}
编辑: 或者更简单、更漂亮(符合我的口味):
\documentclass{article}
\usepackage{bm}
%\usepackage{enumitem}
\begin{document}
\begin{table}
\centering
\rule[-1ex]{\linewidth}{1pt}
\begin{enumerate}
\item prepare process
\begin{enumerate}
\item cut the infinite pipe into three regions,
\item calculate the boundary velocity of the finite pipe using series expression,
\item decompose the fluid field into singular and harmonic parts,
\item solve the harmonic field and make the tables of strength $\bm{G}^i$,
\end{enumerate}
\item calculation process
\begin{enumerate}
\item interpolate $\bm{g}_2^i(\bm{x}_f)$ using $\bm{G}^i$,
\item resolve the Stokeslets $\bm{S}_{pipe}$.
\end{enumerate}
\end{enumerate}
\rule[2ex]{\linewidth}{1pt}
\caption{1 and 2 in relation to Foo and Bar.}
\end{table}
\end{document}