latex 图片的使用

图片插入:

首先得调用宏:

\usepackage{graphics}

一般在文章中插入图片的语句为:

\begin{figure*}[htbp]

\centering

\includegraphics[width=0.75\textwidth]{figureName.eps}

\caption{FigureTitle}

\label{figure}

\end{figure*}

在双栏下插入图片占据双栏时,加上两个*:

\begin{figure*}[htbp]

\centering

\includegraphics[width=0.75\textwidth]{figureName.eps}

\caption{FigureTitle}

\label{figure}

\end{figure*}

插入并列的子图时:\usepackage{subfigure}

\begin{figure}[htbp]

\centering

\subfigure[SubfigureTitle]{

\label{Fig.sub.1}

\includegraphics[width=0.75\textwidth]{figurename.eps}}

\subfigure[SubfigureTitle]{

\label{Fig.sub.2}

\includegraphics[width=0.75\textwidth]{figurename.eps}}

\caption{MainfigureTitleCaption}

\label{figure}

\end{figure}

对于语句中figure后的[htbp]说明:

这是个可选参数项,允许用户来指示图形有可能被放置的位置。这一可选参数项可以是下列字母的任意组合。

h     here 当前位置;将图形放置在 正文文本中给出该图形环境的地方。如果本页所剩的页面不够, 这一参数将不起作用。

t      top 顶部;将图形放置在页面的顶部。

b     bottom 底部;将图形放置在页面的底部。

p     page 浮动页;将图形放置在一只允许有浮动对象的页面上。

注:在使用这些参数时:

(1)如果在图形环境中没有给出上述任一参数,则缺省为 [tbp]。

(2)给出参数的顺序不会影响到最后的结果。因为在考虑这些参数时 LATEX  总是尝试以 h-t-b-p 的顺序来确定图形的位置。所以  [hb] 和 [bh] 都使 LaTex 以h-b 的顺序来排版。

(3)给出的参数越多,LATEX 的排版结果就会越好。[htbp], [tbp], [htp], [tp] 这些组合得到的效果不错。


指定图片大小:

\includegraphics[width=90mm,height=60mm]{figure.eps}

设定图片长宽,图片高度会自动缩放。

\includegraphics[width=\textwidth]{figure.eps}

设定图片宽度为文本宽度。

\includegraphics[width=0.75\textwidth]{figure.eps}

设定图片宽度为文本宽度的0.75倍

\includegraphics[scale=1]{figure.eps}

设定图片与原文件比例为1。

\includegraphics[angle=90]{figure.eps}

将图片旋转90度。


图片使用编译时得注意:

-- 在对.eps格式的图片进行编译时,得注意编译顺序,不能直接使用PDFLaTex,这样会出现编译错误说:Unknown graphics extension: .eps.而是得LaTex编译生成dvi->dvi2pdf或者LaTex编译生成dvi->dvi2ps->ps2pdf。

-- 在对.pdf或者.jpg格式的图片进行编译时,可以直接使用PDFLaTex。

label的使用:

标签使用语句:

\label{LabelName}

在需要引用该label时,\ref{LabelName}

\label的使用注意事项:

\label{key}

A \label command appearing in ordinary text assigns to the key the number of the current sectional unit; one appearing inside a numbered environment assigns that number to the key.

A key can consist of any sequence of letters, digits, or punctuation characters. Upper- and lowercase letters are different.

The number assigned to the key can be accessed by use of the \ref command. For example,

 \begin{equation} 

   .... 

 \label{eq:no1} 

 \end{equation}

 ...

 One can see from Eq.~(\ref{eq:no1}) that ...

In a table or figure environment, the \label command should follow the \caption command (or be part of its argument) since it is the \caption command which generates the number.

评论 1
添加红包

请填写红包祝福语或标题

红包个数最小为10个

红包金额最低5元

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

抵扣说明:

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

余额充值