LaTeX技巧96:LaTeX 图片控制命令,位置控制

2012-04-05 17:25:44 zd0303 阅读数 28512更多

分类专栏: Latex
 

LaTeX 控制图片的位置,就是加感叹号来忽略“美学”标准。
\begin{figure}[!htb]
\usepackage{float}
\begin{figure}[H]
插到你代码相应的位置。

1,插入并列的子图
\usepackage{subfigure}

\begin{figure}[H] 
\centering 
\subfigure[SubfigureCaption]{ 
\label{Fig.sub.1} 
\includegraphics[width=0.4\textwidth]{figurename.eps}} 
\subfigure[SubfigureCaption]{ 
\label{Fig.sub.2} 
\includegraphics[width=0.4\textwidth]{figurename.eps}} 
\caption{MainfigureCaption} 
\label{Fig.lable} 
\end{figure}\begin{figure}[H] \centering \subfigure[SubfigureCaption]{ \label{Fig.sub.1} \includegraphics[width=0.4\textwidth]{figurename.eps}} \subfigure[SubfigureCaption]{ \label{Fig.sub.2} \includegraphics[width=0.4\textwidth]{figurename.eps}} \caption{MainfigureCaption} \label{Fig.lable} \end{figure}

2,控制图片位置
如果不喜欢让Latex自动安排图片位置,可以使用float包,然后用
\begin{figure}[H]
\usepackage{float}

  • 插入jpg图片
    在命令行环境下,使用命令:
    ebb figure.jpg
    生成bounding box文件figure.bb。
    使用如下命令:
    \includegraphics[width=0.8\textwidth]{figure.jpg}
    可以使用Pdf Texify直接编译成pdf文件。
  • 插入bmp图片
    还没有找到直接插入bmp图片的方法。现在的方法是,使用gimp将bmp转换成jpg,然后按上述方法插入。转换时不要使用windows自带的painter,图片质量损失太多。用gimp或fastone image viewer,将jpg质量选为最高,转换之后得到的图片质量较好。
  • 同时插入jpg和eps图片
    插入的命令不变。编译时使用Latex, dvi2pdf,两种格式的图片都可以显示。
  • 插入eps图片
    使用\includegraphics[选项]{文件} 命令可以插入eps图片。
    下面是一个最简单的例子:
    \documentclass{article}
    \usepackage{graphicx} %使用graphicx包
    \begin{document} 
    \includegraphics{file.eps} %插入图片,按图片原尺寸插入 
    \end{document}\begin{document} \includegraphics{file.eps} %插入图片,按图片原尺寸插入 \end{document}

注意:
(1)eps文件和tex文件放在同一个文件夹,只用文件名就可以调用,不用写路径。
(2)编译时不能使用pdflatex,会出错。即使不出错,也看不到图。应使用latex编译生成dvi,然后dvi2ps, ps2pdf就可以看到图了。
使用[选项]可以指定图片大小:
\includegraphics[width=3in]{file.eps}
设定图片宽度为3 inches,图片高度会自动缩放。
\includegraphics[width=\testwidth]{file.eps}
设定图片宽度为文本宽度。
\includegraphics[width=0.8\textwidth]{file.eps}
设定图片宽度为文本宽度的0.8倍
\includegraphics[width=\testwidth-2.0in]{file.eps}
设定图片宽度比文本宽度少2 inches。
使用[选项]指定图片旋转角度:
\includegraphics[angle=270]{file.eps}
将图片旋转270度。
两个选项同时使用,中间用逗号隔开:
\includegraphics[width=\testwidth, angle=270]{file.eps}

最新文章

  1. ionic的常用命令总结以及正式发布的准备
  2. JVM内存模型
  3. HTML5 十大新特性(五)——SVG绘图
  4. MessageDigest消息摘要
  5. Swift3.0语言教程使用Unicode范式标准化获取字符串
  6. UniversalApp启动页面设置
  7. Java实现文件的加密与解密
  8. Library Cache: Lock, Pin and Load Lock
  9. 关于DIV+CSS和XHTML+CSS的理解
  10. 2014--9=17 软工二班 MyEclipse blue==2
  11. XCode中的特殊快捷键图标
  12. F - Power Network - poj 1459(简单最大流)
  13. Docker(三):Docker仓库配置
  14. vs2010单步调试崩溃
  15. python bytes和bytearray、编码和解码
  16. Java+Jmeter接口测试
  17. [转]11种常见sqlmap使用方法详解
  18. 分享下使用 svn,测试服务器代码自动更新、线上服务器代码手动更新的配置经验
  19. MyBatis_Study_001(入门)
  20. metal2的四个新features

热门文章

  1. 【零基础】神经网络优化之L1、L2
  2. Linux 使用 you-get 指令下载网页视频
  3. Cookie的使用(js-cookie插件)
  4. window server 2008 iis7+php安装配置
  5. 002-创建型-02-抽象工厂模式(Abstract Factory)
  6. java数据类型,取值范围,引用类型解析
  7. 一百四十三:CMS系统之评论布局和功能一
  8. LeetCode_21. Merge Two Sorted Lists
  9. 根据DELTA自动生成SQL语句
  10. pycurl模块