Latex技巧:LaTex插图命令includegraphics参数详解

Latex插图的命令是\includegraphics[选项]{文件}

  这里的选项在表 7.1, 7.2, 7.3 中列出。 因为 \includegraphics 不会结束 当前段落,所以它能够在文本中放置图形如   \includegraphics[width=12pt]{recycle.eps} 和  \includegraphics[width=12pt]{illusion.eps}

下面的命令将以 file.eps  的自然大小插入到 LATEX 文档中:

\documentclass{article}

    \usepackage{graphicx}

    \begin{document}

    \includegraphics{file.eps}

\end{document}

image

image

image

如果加入的图形文件没有指明扩展名,那么 \includegraphics 会根据  \DeclareGraphicsExtensions 的扩展名列表自动为它加上扩展名(见第  9.1 节)。由于缺省的扩展名列表不包括空的扩展名,  \includegraphics{file} 不会读入 file。除非空的扩展名 已被加到扩展名列表中。 命令

\includegraphics[width=3in]{file.eps}

file.eps 插入文档并且它的宽度被缩放到 3 英寸,高度也会 按相应的比例缩放。如果用 \textwidth\em 等的函数来 指定宽度,而不是用像 3 英寸这样的固定尺寸,将会使你的 LATEX 文 档更具通用性。例如:

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

将所插入图形缩放到和文本行的宽度一样宽。而下面的命令

\includegraphics[width=0.80\textwidth]{graphics.eps}

使得插入图形的宽度为文本行宽的 80%。当与 calc 宏包配合使用 时,下面的命令可令图形的宽度比文本行宽少 2 英寸:

\includegraphics[width=\textwidth-2.0in]{graphics.eps}

to (需要 graphicx 12/95 或以后的 版本。) 下面是一些使用 \includegraphics 命令来插入图形的 例子。这里为方便起见,定义 \HR 如下:

\newcommand{\HR}{\rule{1em}{0.4pt}}

  在下面的几个例子中,可以比较以下使用 scale,width,height,angle  以及 keepaspectratio 选项及其不同的顺序所得到的不同效果。

\fbox{%<br>%<br>            \includegraphics[scale=.5]{w.eps}}

左\HR\fbox{%
\includegraphics[scale=.5]{w.eps}%
\HR 右

\fbox{%<br>%<br>            \includegraphics[width=10mm]{w.eps}}
左\HR\fbox{%
\includegraphics%
[width=10mm]{w.eps}%
\HR 右

\fbox{%<br>%<br>            \includegraphics[height=20mm,width=30mm]%<br>%<br>            {w.eps}}

左\HR\fbox{%
\includegraphics [height=20mm,width=30mm]%
{w.eps}}\HR 右

\fbox{%<br>%<br>            \includegraphics[height=20mm,width=30mm,%<br>%<br>            keepaspectratio]{w.eps}}

左\HR\fbox{%
\includegraphics [height=20mm,width=30mm,%
keepaspectratio]{w.eps}}%
\HR 右

\fbox{%<br>%<br>            \includegraphics[angle=-45]{w.eps}}

左\HR\fbox{%
\includegraphics [angle=-45]{w.eps}}%
\HR 右

\fbox{%<br>%<br>            \includegraphics[angle=-45,width=30mm]%<br>%<br>            {w.eps}}

左\HR\fbox{%
\includegraphics [angle=-45,width=30mm]%
{w.eps}}\HR 右

\fbox{%<br>%<br>            \includegraphics[width=30mm,angle=-45]%<br>%<br>            {w.eps}}

左\HR\fbox{%
\includegraphics [width=30mm,angle=-45]%
{w.eps}}\HR 右

\fbox{%<br>%<br>            \includegraphics[angle=-60,totalheight=15mm]{w.eps}}<tex2html_comment_mark>446

左\HR\fbox{%
\includegraphics [angle=-60,totalheight=15mm]%
{w.eps}}%
\HR 右

\fbox{%<br>%<br>            \includegraphics[angle=-60,totalheight=20mm,width=30mm]{w.eps}}<tex2html_comment_mark>452

左\HR\fbox{%
\includegraphics [angle=-60,totalheight=20mm,%
width=30mm]{w.eps}}%
\HR 右

\fbox{%<br>%<br>            \includegraphics[angle=-60,totalheight=20mm,width=30mm,keepaspectratio]{w.eps}}<tex2html_comment_mark>458

左\HR\fbox{%
\includegraphics [angle=-60,totalheight=20mm,%
width=30mm,keepaspectratio]%
{w.eps}}%
\HR 右



参考文献:http://chenli-0925.blog.163.com/blog/static/3408462920109802115554/

转载于:https://www.cnblogs.com/yifdu25/p/8326025.html

  • 0
    点赞
  • 1
    收藏
    觉得还不错? 一键收藏
  • 0
    评论

“相关推荐”对你有帮助么?

  • 非常没帮助
  • 没帮助
  • 一般
  • 有帮助
  • 非常有帮助
提交
评论
添加红包

请填写红包祝福语或标题

红包个数最小为10个

红包金额最低5元

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

抵扣说明:

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

余额充值