作者illini (Go! Illini!)
看板PhD
标题Re: [问题] Latex 图形问题
时间Tue Apr 18 19:15:36 2006
※ 引述《jackyw99 (ㄚ政)》之铭言:
: ※ 引述《kenlo0425 (邪恶博士)》之铭言:
: : 感谢你提供这个方法,效果不错
: : 我也试过前面几篇的方法,但在我的环境我跑起来就是会有失真
大部分的程式都可以输出 pdf 档案吧, 然後直接使用 pdf 档案, 就比较不会失真.
Matlab 也可以直接输出 pdf 档案, 用 -dpdf 选项即可
例如在 .m 使用 print(gcf, '-dpdf', 档名) ;
在LaTex中只要使用 \usepackage[pdftex] 就可以罗.
我的环境是 MikTex 和 WinEdt.
我是用下面的某人提供的程式自动判断.
下面的指令会让 tex 编译的时候自动到你目前目录下的
/figure-eps/ 或 /figure-pdf/ 寻找档案
%请加在你的 tex 档案前面 usepackage 的下面, \title 之前
%-----------------------------------------------------
% Check for the existence of the variable \pdfoutput:
\newif\ifpdf
\ifx\pdfoutput\undefined
\pdffalse % we are not running PDFLaTeX
\else
\pdfoutput=1 % we are running PDFLaTeX
\pdftrue
\fi
%Then use the new variable \ifpdf
\ifpdf
\usepackage[pdftex]{graphicx}
\graphicspath{{figure-pdf/}}
\DeclareGraphicsExtensions{.pdf,.jpg,.png,.tif}
\usepackage[pdftex]{hyperref}
\usepackage[final]{pdfpages}
\else
\usepackage[dvips]{graphicx}
\graphicspath{{figure-eps/}}
\DeclareGraphicsExtensions{.eps,.ps}
\newcommand{\href}[2]{%
{#2}%
}
\newcommand{\url}[1]{%
\texttt{#1}%
}
\fi
% -----------------------------------------------------------------
※ 编辑: illini 来自: 140.113.88.61 (04/18 19:22)