latex表格
教程:https://www.javatpoint.com/latex-table
- 基本语法
\documentclass{article}
\begin{document}
\begin{center}
\begin{tabular}{|l|c|r|}
\hline
a&b&c\\ \hline
d&e&f\\ \hline
g&h&i\\ \hline
\end{tabular}
\end{center}
\end{document}
Output:
- 美化表格
\documentclass{article}
\usepackage{booktabs} % For prettier tables
\begin{document}
\begin{table}[h!]
\begin{center}
\caption{Table using booktabs.}
\label{tab:table1}
\begin{tabular}{l|c|r}
\toprule % Toprule applied here
\textbf{Heading 1} & \textbf{Heading 2} & \textbf{Heading 3}\\
$\alpha$ & $\beta$ & $\gamma$ \\
\midrule % Midrule applied here
1 & 1.101 & a\\
2 & 103.145 & b\\
3 & 289.1 & c\\
4 & 17.132114 & d\\
\bottomrule % Bottomrule applied here
\end{tabular}
\end{center}
\end{table}
\end{document}
Output:
3.跨栏插入表格
(一个整体two column的latex,把一个table搞成占横着整页)
加个*
号,
\begin{table*}
\end{table*}
此时,表格就可以通栏排列。同样的方法适用于跨栏插入图片。
- 自动换行
使用p参数,如下:
\begin{table}[ht]
\caption{test}
\label{Tab:bookRWCal}
\centering
\begin{tabular}{lp{3cm}p{3cm}p{3cm}}
\toprule
\textbf{著作类别} &\textbf{A级出版社} &\textbf{B级出版社}&\textbf{C级出版社}\\
\midrule
学术专著 &第一作者3分/万字,其他作者 2分/万字 &第一作者3分/万字,其他作者 2分/万字 &第一作者3分/万字,其他作者 2分/万字\\
\bottomrule
\end{tabular}
\end{table}
效果:
- 合并行
3、4、5参考:https://blog.csdn.net/abrohambaby/article/details/80554730