Loading data/chap02.tex +16 −0 Changes for data/chap02.tex: 16 added lines, 0 removed lines. Original line number Diff line number Diff line Loading @@ -80,6 +80,22 @@ \end{table} 如果需要调整表格列宽度, 可以改用命令 \verb|L|, \verb|R|, 或者 \verb|C|, 如 \verb|C{2cm}| 代表居中列宽2cm。 表格如果想要与页面等宽,可以使用 \pkg{tabularx} 宏包,如表格\ref{tab:textwith-example}所示。 模版定义了一些扩展命令,实现一些排版需求。\verb|X| 两端对齐, \verb|Y| 左对齐, \verb|Z| 右对齐,或者 \verb|W| 居中对齐。 \begin{table} \centering \caption{同页宽的表格实例} \label{tab:textwith-example} \begin{tabularx}{\textwidth}{YXZW} \toprule Cell with text aligned to the left & 1 & 2 & 3\\ \midrule 4 & Cell with justified text & 5 & 6\\ \midrule 7 & 8 & Cell with centered text & 9\\ \midrule 10 & 11 & 12 & Cell with text aligned to the right \\ \bottomrule \end{tabularx} \end{table} 如果您要排版的表格长度超过一页,那么推荐使用 \pkg{longtable} 或者 \pkg{supertabular} 宏包,模板对 \pkg{longtable} 进行了相应的设置,所以用起来可能简单一些。 Loading sustech-setup.tex +10 −1 Changes for sustech-setup.tex: 10 added lines, 1 removed line. Original line number Diff line number Diff line Loading @@ -164,7 +164,16 @@ % 伪代码环境 \usepackage[ruled,linesnumbered]{algorithm2e} % tabular 扩展命令 \newcolumntype{R}[1]{>{\raggedleft\arraybackslash}p{#1}} % 定义R为表格左右居左,用于自定义表格列宽度 \newcolumntype{L}[1]{>{\raggedright\arraybackslash}p{#1}} % 定义L为表格左右居右,用于自定义表格列宽度 \newcolumntype{C}[1]{>{\centering\arraybackslash}p{#1}} % 定义C为表格左右居中,用于自定义表格列宽度 % tabularx 扩展命令,会对单元格内容进行单元格内自动换行 % X 默认就是两端对齐 % Y 左对齐 \newcolumntype{Y}{>{\raggedright\arraybackslash}X} % W 右对齐 \newcolumntype{W}{>{\raggedleft\arraybackslash}X} % Z 居中对齐 \newcolumntype{Z}{>{\centering\arraybackslash}X} No newline at end of file Loading
data/chap02.tex +16 −0 Changes for data/chap02.tex: 16 added lines, 0 removed lines. Original line number Diff line number Diff line Loading @@ -80,6 +80,22 @@ \end{table} 如果需要调整表格列宽度, 可以改用命令 \verb|L|, \verb|R|, 或者 \verb|C|, 如 \verb|C{2cm}| 代表居中列宽2cm。 表格如果想要与页面等宽,可以使用 \pkg{tabularx} 宏包,如表格\ref{tab:textwith-example}所示。 模版定义了一些扩展命令,实现一些排版需求。\verb|X| 两端对齐, \verb|Y| 左对齐, \verb|Z| 右对齐,或者 \verb|W| 居中对齐。 \begin{table} \centering \caption{同页宽的表格实例} \label{tab:textwith-example} \begin{tabularx}{\textwidth}{YXZW} \toprule Cell with text aligned to the left & 1 & 2 & 3\\ \midrule 4 & Cell with justified text & 5 & 6\\ \midrule 7 & 8 & Cell with centered text & 9\\ \midrule 10 & 11 & 12 & Cell with text aligned to the right \\ \bottomrule \end{tabularx} \end{table} 如果您要排版的表格长度超过一页,那么推荐使用 \pkg{longtable} 或者 \pkg{supertabular} 宏包,模板对 \pkg{longtable} 进行了相应的设置,所以用起来可能简单一些。 Loading
sustech-setup.tex +10 −1 Changes for sustech-setup.tex: 10 added lines, 1 removed line. Original line number Diff line number Diff line Loading @@ -164,7 +164,16 @@ % 伪代码环境 \usepackage[ruled,linesnumbered]{algorithm2e} % tabular 扩展命令 \newcolumntype{R}[1]{>{\raggedleft\arraybackslash}p{#1}} % 定义R为表格左右居左,用于自定义表格列宽度 \newcolumntype{L}[1]{>{\raggedright\arraybackslash}p{#1}} % 定义L为表格左右居右,用于自定义表格列宽度 \newcolumntype{C}[1]{>{\centering\arraybackslash}p{#1}} % 定义C为表格左右居中,用于自定义表格列宽度 % tabularx 扩展命令,会对单元格内容进行单元格内自动换行 % X 默认就是两端对齐 % Y 左对齐 \newcolumntype{Y}{>{\raggedright\arraybackslash}X} % W 右对齐 \newcolumntype{W}{>{\raggedleft\arraybackslash}X} % Z 居中对齐 \newcolumntype{Z}{>{\centering\arraybackslash}X} No newline at end of file