跳至主要内容

Latex学习手记之二:插入图片(1)

插入eps图片
使用\includegraphics[选项]{文件} 命令可以插入eps图片。下面是一个最简单的例子:

\documentclass{article}
\usepackage{graphicx} %使用graphicx包
\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}

评论

此博客中的热门博文

I want to learn Emacs

I'm using crimson editor, a good text editor from Korea. It has worked very well for me till now, but it has not been updated since 2004 and recently I found some features that crimson editor does not have,such as code folding, really useful. So I want to switch to a powerful, up-to-date, extendable and cross-platform editor. Between vi and Emacs, I chose the later one. Emacs is not easy to learn, so I just want to learn some basic features firstly. 1. Switch between buffers, buffer and minibuffer, and modes. One does not need to change into a special mode to input the content in Emacs (This is one reason why I did not choose vi), but Emacs does have a minibuffer to take some complected commands from the user. And in Emacs one can have many buffers and each buffer has a mode (not the same "mode" in vi). So have to learn what they are and how to switch between them. 2. Basic editing, such as creat new, open, save, and close file, copy and paste, search and replace ... 3. F...

闲话

通常我在google上搜索的是,“如何在windows 7下配置ssh”,“vi命令”, 诸如此类的问题。百无聊赖的时候,搜一下“如何才能活得快乐”,这个居然也有答案。 这两天睡的太晚。今天实在挺不住了,回到家先睡了一觉,结果晚上睡不着。喝了点儿酒,还是睡不着。其实也不是为了睡觉才喝酒,就是想喝酒。 现在写着的这支笔,用起来不太舒服。Sailor的pocket pen, 比我另外两支pocket pen还要短1cm。不戴笔帽太短了,戴上笔帽重心太靠后,笔总向上翘,不舒服。想到Ebay上把它卖了,不过在此之前要拍照留念。我现在是不戴笔帽写的。 对,我是在纸上写的,不是在电脑上敲的。有图有真相! 太晚了,还是得去睡觉了。明天早上起来又是一个好人。张爱玲说的。 要是落款的话,现在可以用“醉墨“两个字。 我觉得这笔也没有那么讨厌了。 晚安,再见!