学习视频:【LaTeX视频教程(基于CTEX中文套装+WinEdt)第四节】 https://www.bilibili.com/video/BV1ua4y1p7eR/?share_source=copy_web&vd_source=5588c97e9e603617b74ee9c3caa63304
enumerate:生成“编号列表”,设置前导符,计数器开始值设置;
longtable:长表格控制;
itemize:生成“-列表”;
tabular:生成表格,竖线,横线,对齐;
table:生成表格,竖线,横线,对齐,单元格合并,长表格控制;
% 列表与表格
% 列表和表格环境,将EXCEL数据快速导入LaTeX
% enumerate宏包, setcounter
% tabular, table, c中间对齐|l左|r右, \multicolumn, \cline, \hline
\documentclass{book}
% 设置宏包
\usepackage{enumerate}
\usepackage{longtable} % 长表格
\begin{document}
\begin{itemize}
\item This is item 1
\begin{itemize}
\item This is subitem 1
\item This is subitem 2
\item This is subitem 3
\end{itemize}
\item This is item 2
\begin{enumerate}
\item This is subitem 1
\item This is subitem 2
\item This is subitem 3
\end{enumerate}
\item This is item 3
\end{itemize}
*****************************************
% 设置前导符A.
% \bfseries A.
% \bfseries A
% \sffamily a. 无衬线字体
% 改变编号起点
\begin{enumerate}[A.]
% 设定计数器,第一层一个i,从第4个开始
\setcounter{enumi}{4}
\item This is item 1
\begin{enumerate}
\item This is subitem 1
\item This is subitem 2
\end{enumerate}
\item This is item 2
\item This is item 3
\end{enumerate}
*****************************************
%另起一页
\eject
% 加竖线|
\begin{tabular}{|c|l|r|}
\hline
% after \\: \hline or \cline{col1-col2} \cline{col3-col4} ...
230 & 3 & 25 \\ % 区分两行表格
\hline
11 & 223 & 3 \\
\hline
1 & 52 & 423 \\
% 加横线
\hline
\end{tabular}
% 从EXCEL粘贴?先粘贴到记事本,然后查询TAB替换成 & ,注意前后加空格,然后每行后面加\\
% 无法用表一表二标识,怎么办?用table环境
\eject
*****************************************
% 自动生成序号
% \multirow,需要引入宏包
% 参考书:LaTeX companion
\begin{table}
\centering %对环境中所有对象居中
\begin{tabular}{|c|l|r|}
\hline
% after \\: \hline or \cline{col1-col2} \cline{col3-col4} ...
% 合并单元格数量,对齐方式,具体内容
\multicolumn{2}{c}{2 3} & 2G \\ % 区分两行表格
\hline
1 & 223 & 3 \\
\hline
1 & 52 & 423 \\
\cline{1-2} % 在第1-2项下面加横线(是表格的横线!)
% 加横线
\end{tabular}
\caption{This is my first table} % 表格标题
\end{table}
% 表格太长,一页显示不完,使用{longtable}宏包
\end{document}