![如何自动对表格中的此项进行编号?](https://linux22.com/image/384249/%E5%A6%82%E4%BD%95%E8%87%AA%E5%8A%A8%E5%AF%B9%E8%A1%A8%E6%A0%BC%E4%B8%AD%E7%9A%84%E6%AD%A4%E9%A1%B9%E8%BF%9B%E8%A1%8C%E7%BC%96%E5%8F%B7%EF%BC%9F.png)
我是 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}