赞
踩
在用latex做图片的时候发现问题没有很多,但是做表格的问题就非常多了,因此记录一下
首先导包需要
- \usepackage{array}
- \usepackage{booktabs}
- \usepackage{caption} % 可有可无
然后制作简单表格参考该处:
Latex基本表格绘制_爱摸鱼的派大星星-CSDN博客_latex表格
LaTeX 表格_yhl_leo-CSDN博客_latex如何表格
直接贴上较为复杂的表格,做了我好久-v-
- \begin{table}[!]
- \caption{here is title.}
- \label{table1}
-
- \resizebox{0.5\textwidth}{!}{ %不放0.5\textwidth在我的pdf上会越界
- \begin{tabular}{cp{0.8cm} cp{0.3cm} c p{0.2cm}
- c p{0.2cm} c p{0.4cm} cp{0.1cm} cp{0.5cm} cp{0.2cm} cp{0.3cm}}
- % c居中 要想设置列宽要p{} 我一开始直接{}就报错了
- \toprule
- \textbf{a} & \textbf{b} & \textbf{C} & \textbf{D} &
- \textbf{E} & \textbf{S} & \textbf{F} & \textbf{G} & \textbf{H} \\
- \toprule
- & 0 & 1024 & 256 & $1 \times 1$ & 1 & 0 & Y & Y \\
- & 0 & 1024 & 256 & $1 \times 1$ & 1 & 0 & Y & Y \\
- & 3 & 256 & 512 & $3 \times 3$ & 2 & 1 & Y & Y \\
- & 6 & 512 & 128 & $1 \times 1$ & 1 & 0 & Y & Y \\
- & 9 & 128 & 256 & $3 \times 3$ & 2 & 1 & Y & Y \\
- Column
- & 12 & 256 & 128 & $1 \times 1$ & 1 & 0 & Y & Y \\
- (aaaa)
- & 15 & 128 & 256 & $3 \times 3$ & 2 & 1 & Y & Y \\
- & 18 & 256 & 128 & $1 \times 1$ & 1 & 0 & Y & Y \\
- & 21 & 128 & 256 & $3 \times 3$ & 2 & 1 & Y & Y \\
- & 24 & 256 & 128 & $1 \times 1$ & 1 & 0 & Y & Y \\
- & 27 & 128 & 256 & $3 \times 3$ & 2 & 1 & Y & Y \\
- & 30 & 256 & 128 & $1 \times 1$ & 1 & 0 & Y & Y \\
- & 33 & 128 & 256 & $3 \times 3$ & 2 & 1 & Y & Y \\
- \hline\hline % 双靠近的线
- & 0 & 1024 & 256 & 2 & 1 & 0 & Y & Y \\
- & 0 & 1040 & 512 & $1 \times 1$ & 1 & 0 & Y & Y \\
- & 3 & 512 & 256 & $1 \times 1$ & 1 & 0 & Y & Y \\
- Column
- & 6 & 256 & 128 & $1 \times 1$ & 1 & 0 & Y & Y \\
- (bbbbb)
- & 9 & 128 & 64 & $1 \times 1$ & 1 & 0 & N & Y \\
- & 11 & 64 & 1 & $1 \times 1$ & 1 & 0 & N & Y \\
- \end{tabular}} % 注意resizebox的括号和在label和caption下面 否则报错
- \end{table}

推荐一个识别图片直接出latex文本
遇到的错误:
latex 让一图只占一半页面
! You can't use `\hrule' here except with leaders.
resizebox的位置应该在label和\caption下面 (好像是因为这个)
Package graphics Error: Division by 0.
resizebox的位置应该在label和\caption下面 (好像是因为这个)
或者把aux文件删除
! Missing $ inserted. <inserted text> $ l.798 \begin{array
有公式没有加$ 如 \text {} \times
放图片出现的问题 LaTeX Error: Cannot determine size of graphic in (no B oundingBox).
以及这个错误Latex error: .bb file not found
。。。。
Copyright © 2003-2013 www.wpsshop.cn 版权所有,并保留所有权利。