Latex 表格问题

在用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公式编辑器-编辑器

遇到的错误:

  • ! Package array Error: Illegal pream-token (\hsize): `c' used.  因为没有加上p{3cm}
    •  
  • latex 让一图只占一半页面

  •  ! You can't use `\hrule' here except with leaders.

    • resizebox的位置应该在label和\caption下面 (好像是因为这个)

  • Package graphics Error: Division by 0.

    • resizebox的位置应该在label和\caption下面 (好像是因为这个)

  • ! File ended while scanning use of \@newl@bel
    • 控制台用q退出 不要强制关闭
    • 或者把aux文件删除

  • ! Missing $ inserted. <inserted text> $ l.798 \begin{array

    • 有公式没有加$ 如 \text {}  \times

  • 放图片出现的问题 LaTeX Error: Cannot determine size of graphic in  (no B oundingBox).

  • 。。。。

 

 

 

 

  • 6
    点赞
  • 9
    收藏
    觉得还不错? 一键收藏
  • 2
    评论
评论 2
添加红包

请填写红包祝福语或标题

红包个数最小为10个

红包金额最低5元

当前余额3.43前往充值 >
需支付:10.00
成就一亿技术人!
领取后你会自动成为博主和红包主的粉丝 规则
hope_wisdom
发出的红包
实付
使用余额支付
点击重新获取
扫码支付
钱包余额 0

抵扣说明:

1.余额是钱包充值的虚拟货币,按照1:1的比例进行支付金额的抵扣。
2.余额无法直接购买下载,可以购买VIP、付费专栏及课程。

余额充值