我一直在尝试获取“epstopdf”包,但遇到了很多问题。我终于可以毫无错误地运行文件了。但图像没有显示,相反,有很多文本挤在一起。
\documentclass[12pt,twoside]{mitthesis}
\usepackage[pdftex]{graphicx}
\usepackage{epstopdf}
\usepackage{color}
\usepackage{transparent}
\usepackage[]{algorithm2e}
\usepackage{algorithms}
\usepackage{subfig}
\usepackage{hhline}
\usepackage{amsmath}
\usepackage[pdftex]{graphicx}
\usepackage{epstopdf}
\usepackage{color}
\usepackage{transparent}
\begin{document}
\begin{figure}[htb]
\centering
\graphicpath{{Inkscape/}}
\def\svgwidth{1\pagewidth}
\begingroup%
\makeatletter%
\providecommand\color[2][]{%
\errmessage{(Inkscape) Color is used for the text in Inkscape, but the package 'color.sty' is not loaded}%
\renewcommand\color[2][]{}%
}%
\providecommand\transparent[1]{%
\errmessage{(Inkscape) Transparency is used (non-zero) for the text in Inkscape, but the package 'transparent.sty' is not loaded}%
\renewcommand\transparent[1]{}%
}%
\providecommand\rotatebox[2]{#2}%
\ifx\svgwidth\undefined%
\setlength{\unitlength}{571.23355406bp}%
\ifx\svgscale\undefined%
\relax%
\else%
\setlength{\unitlength}{\unitlength * \real{\svgscale}}%
\fi%
\else%
\setlength{\unitlength}{\svgwidth}%
\fi%
\global\let\svgwidth\undefined%
\global\let\svgscale\undefined%
\makeatother%
\begin{picture}(1,0.52560219)%
\put(0,0){\includegraphics[width=\unitlength]{AC_system.eps}}%
\put(0.61248205,0.4970148){\color[rgb]{0,0,0}\makebox(0,0)[b]{\smash{$Overhead Line/Positive Feeder$}}}%
\put(0.61199996,0.00436966){\color[rgb]{0,0,0}\makebox(0,0)[b]{\smash{$Negative Feeder$}}}%
\put(0.61289235,0.22564519){\color[rgb]{0,0,0}\makebox(0,0)[b]{\smash{$Rail$}}}%
\put(0.23435301,0.50964167){\color[rgb]{0,0,0}\makebox(0,0)[b]{\smash{$Power$\\$Transformer$}}}%
\put(0.52285146,0.15575975){\color[rgb]{0,0,0}\makebox(0,0)[b]{\smash{$AT_1$}}}%
\put(0.78334036,0.15562127){\color[rgb]{0,0,0}\makebox(0,0)[b]{\smash{$AT_2$}}}%
\put(0.91218434,0.15562127){\color[rgb]{0,0,0}\makebox(0,0)[b]{\smash{$AT_3$}}}%
\end{picture}%
\endgroup%
\caption{AC bivoltage traction system}
\label{fig:bivoltage}
\end{figure}
\end{document}
方案二,使用输入命令代替代码。(eps文件中:https://www.dropbox.com/sh/sqqq21adv2nptsw/AADQ6LMgttTrtMPbVkHA60Dba?dl=0)
\documentclass[12pt,twoside]{mitthesis}
\usepackage[pdftex]{graphicx}
\usepackage{epstopdf}
\usepackage{color}
\usepackage{transparent}
\usepackage[]{algorithm2e}
\usepackage{algorithms}
\usepackage{subfig}
\usepackage{hhline}
\usepackage{amsmath}
\usepackage[pdftex]{graphicx}
\usepackage{epstopdf}
\usepackage{color}
\usepackage{transparent}
\begin{document}
\begin{figure}[htb]
\centering
\graphicpath{{Inkscape/}}
\def\svgwidth{1\pagewidth}
\input{Inkscape/AC_system.eps_tex}
\caption{AC bivoltage traction system}
\label{fig:bivoltage}
\end{figure}
\end{document}
我附上了结果的截图。希望你能帮上忙 :)
答案1
看起来下面的选项效果不错,但是有几点需要考虑。
使用 Quartz11 时存在一个已知错误,有时当 Latex 调用 Quartz 执行 pdf 转换时,它会调用旧版本的 X11。由于它不再存在,因此它永远不会创建 pdf 转换。解决此问题的方法是重新安装 Quartz11。
epstopdf 与最新版本的 Tex 配合使用效果最佳。就我而言,只需安装最新版本的 MACTEX 包似乎就解决了这个问题。
\documentclass[12pt,twoside]{mitthesis}
\usepackage[pdftex]{graphicx}
\usepackage{epstopdf}
\usepackage{color}
\usepackage{transparent}
\begin{document}
\begin{figure}[htb]
\centering
\graphicpath{{Inkscape/}}
\def\svgwidth{1\pagewidth}
\input{Inkscape/AC_system.eps_tex}
\caption{AC bivoltage traction system}
\label{fig:bivoltage}
\end{figure}
\end{document}