Latex中图形的引用和插入


http://blog.163.com/xiaoting_hu/blog/static/504647722013528143405/


步骤:

1. 用图形软件输出 EPS 格式的文件,或PDF格式的图形
2. 在源文件的导言中加入下面代码,这样下面几种类型的图都可以插入

   ifCLASSINFOpdf
   usepackage[pdftex]{graphicx}
   graphicspath{{../pdf/}{../jpeg/}}     % declare the path(s) where your graphic files are
    DeclareGraphicsExtensions{.pdf,.jpeg,.png}
    else
    usepackage[dvips]{graphicx}
    graphicspath{{../eps/}}
    DeclareGraphicsExtensions{.eps}
fi

3 插入浮动图形(浮动图形由latex自动指定位置,一般放在一页的最前面或最后面)

egin{figure}
centering   //设置对齐格式
includegraphics [width=0.75,height=2.5]{arch.pdf}  //指定图形大小和图形名称,一般将该图形放在latex文件同一路径下就不需要指明路径
caption{Proposed Secure Systolic Montgomery modular MultiplierArchitecture} 设置图形标题

 label{fig:arch} 设置图形引用名称
end{figure}

或者使用includegraphics[width=0.25 extwidth]{arch.pdf} //此处width=0.25和命令 extwidth配合可实现原图按比例缩放的功能,此处代表原图的宽度为页面的大小的25%,高度按比例自动缩放。

4.想要把图形插在自己指定位置并且需要交叉引用的话,要使用以下的格式:

makeatletter

def@captype{figure}

makeatother

includegraphics [width=0.75,height=2.5]{arch.pdf}  //此处用法同3

caption{...}

label{...}

5.文中引用

In  Figure ef{fig:arch}   //其中的fig:arch为定义该图时的label名

6.{figure} and {figure*}的区别

figure相对本栏,figure* 相对于通栏。 


原文地址:https://www.cnblogs.com/ztguang/p/12645805.html