latex中表格、图片的排版

一、图、表位置

1. 第一行标记图像、表格位置:

   (1) [h]here; [t]top; [b]bottom;[p]浮动

   (2) 强行固定位置,不浮动:加包\usepackage{float},用[H]

2. 标记与引用

   标记:\label{Tab1};引用:Table~\ref{Tab1}

二、表格的排版

1. center:表格居中

2. 表格列数{cccc}: 四列内容居中;l: 居左;r: 居右。

    {|c|c|c|}: 竖线表示列与列之间有竖线

    \hline:表示行与行之间的横线

3. 表格内容输入

   xx & xx&  xx& ~\\

  列与列之间用&间隔,换行用\\,无输入用~或者不写

\begin{table}[htbp]
    \caption{diet.}
    \begin{center}
    \begin{tabular}{cccc}
    \hline
    & moring& afternoon & evening \\
    \hline
    I & 10&20&15\\
    U & 10&30&15
    \hline
    \end{tabular}
    \label{tab1}
    \end{center}\vs{-4mm}
\end{table}

4. 合并单元格

合并行:\multirow{2}*{内容} 合并两行,下一行对应列用~代替

\begin{table}[h!]
    \caption{diet.}
    \begin{center}
    \begin{tabular}{c|c|c|c}
    \hline
    & \multirow{2}*{moring of today}& afternoon & evening \\
    &~& a&b\\
    \hline
    I & 10&20&15\\
    U & 10&30&15\\
    \hline
    \end{tabular}
    \label{tab18}
    \end{center}\vs{-4mm}
\end{table}

 

 合并列:

\hline
    & moring & \multicolumn{2}{c}{afternoon vs evening} \\
\hline

表头三叉:加包\usepackage{diagbox} 

\diagbox{people}{amount}{time}& moring & afternoon&evening \\

三、图像的插入与排列

 1. 单张图

\begin{figure}[h!]
    \begin{center}
    \includegraphics[width=9.0cm]{Figure8}
    \caption{Image of orange.}
    \label{fig8}
    \end{center}\vs{-4mm}
\end{figure}

插入pdf格式的图,或者一般需要figure8.eps

2.两张图并排

加包 \usepackage{caption}   \usepackage{subfigure}

\begin{figure}[H]
    \subfigure[]{
       \centering
        \includegraphics[width=0.48\textwidth]{Figure5(a).pdf}
    }
    \subfigure[]{
        \centering
        \includegraphics[width=0.48\textwidth]{Figure5(b).pdf}
    }\caption{Images of a  and b\label{fig5}}
\end{figure}

评论
添加红包

请填写红包祝福语或标题

红包个数最小为10个

红包金额最低5元

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

抵扣说明:

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

余额充值