我想在期刊论文中包含一个 jpg 图像,当我执行 LaTeX=>PS=>PDF 时出现以下错误:
ps2pdf> Error: /undefined in ÿØÿà
ps2pdf> Operand stack:
ps2pdf> Execution stack:
ps2pdf> %interp_ exit .runexec2 --nostringval ...
.
.
.
ps2pdf> MiKTeX GPL Ghostscript 9.19: Unrecoverable error, exit code 1
我可以获得 LaTeX=>PDF,但我还需要 PS 文件。当我删除 jpg 图像时,编译时没有错误和警告。我知道我可以将 jpg 图像转换为 eps 并使其工作,但是,期刊要求我在传记部分使用 jpg 图像。我将 TexnicCenter 与 MikTex 结合使用。我使用的文档类是 IEEEtran,其中有以下内容(当然,缩短和修改了!),jpg 图像位于传记部分的文档末尾。
\usepackage{microtype}
\usepackage{amssymb}
\usepackage{yfonts}
\usepackage{cite}
\usepackage{url}
\usepackage{multirow}
\usepackage{xcolor}
\usepackage{algpseudocode}
\ifCLASSINFOpdf
\usepackage[pdftex]{graphicx}
\DeclareGraphicsExtensions{.pdf,.jpeg,.jpg,.png} \else
\usepackage[dvips]{graphicx}
\DeclareGraphicsExtensions{.ps, .eps, .tiff} \fi
\usepackage[cmex10]{amsmath}
\usepackage{amsfonts}
\usepackage{array}
\usepackage[caption=false]{subfig}
\hyphenation{op-tical net-works semi-conduc-tor}
\frenchspacing
\makeatletter
\newcommand{\thickhline}{%
\noalign {\ifnum 0=`}\fi \hrule height 0.75pt
\futurelet \reserved@a \@xhline
}
\newcolumntype{"}{@{\hskip\tabcolsep\vrule width 0.75pt\hskip\tabcolsep}}
\makeatother
\begin{document}
\graphicspath{{./figures/}}
\title{Some eye catching title}
\author{Whoever}
\markboth{}
{Shell \MakeLowercase{\textit{et al.}}: Bare Demo of IEEEtran.cls for Journals}
\maketitle
\begin{abstract}
some nice stuff
\end{abstract}
\begin{IEEEkeywords}
buzz words
\end{IEEEkeywords}
\IEEEpeerreviewmaketitle
\section{Introduction}\label{intro}
\IEEEPARstart{H}{ere} we go.
\section{Conclusion}
We presented some nice stuff, didn't we?!
\appendices
\section{appendix I}
Our fancy equations are as below
.
.
.
\section*{Acknowledgement}
The authors would like to thank all who answered this question!
\bibliographystyle{IEEETran}
\bibliography{nice_paper}
\begin{IEEEbiography}[{\includegraphics[width=1in,height=1.25in,clip,keepaspectratio,natwidth=1040,natheight=1384]{whome.jpg}}]{Whoever} is a nice guy that often asks question in this website!
\end{IEEEbiography}
\end{document}
答案1
汇编“ latex
→ dvips
→ ps2pdf
”仅接受EPS文件。
IEEEtran
您正在使用的该课程的许多示例中宣传的代码很糟糕且过时,但这是另一回事。
您可以做的是将 JPEG 文件转换为 EPS(有几种程序可用)并保留两个版本。这样,您将同时拥有这两个版本,whome.jpg
并且whome.eps
可以使用这两种方法编译文件。
\documentclass{IEEEtran}
\usepackage{graphicx} % don't specify a driver
\ifCLASSINFOpdf
\DeclareGraphicsExtensions{.pdf,.jpeg,.jpg,.png}
\else
\DeclareGraphicsExtensions{.eps,.ps}
\fi
\usepackage{amsmath} % don't use the cmex10 option
\begin{document}
\title{Some eye catching title}
\author{Whoever}
\begin{abstract}
some nice stuff
\end{abstract}
\begin{IEEEkeywords}
buzz words
\end{IEEEkeywords}
\IEEEpeerreviewmaketitle
\section{Introduction}\label{intro}
\IEEEPARstart{H}{ere} we go.
\section{Conclusion}
We presented some nice stuff, didn't we?!
\begin{IEEEbiography}[%
{\includegraphics[
width=1in,
height=1.25in,
clip,
keepaspectratio]{whome}}% <--- NO EXTENSION
]{Whoever} is a nice guy that often asks question in this website!
\end{IEEEbiography}
\end{document}
笔记。
我留下只是amsmath
为了表明该cmex10
选项不应该与它一起使用。它只是为了允许很古老TeX 发行版使用该包;您没有使用 emTeX,是吗?
扩展的偏好dvips
应该首先寻找 EPS,然后是 PS;TIFF 包含支持早已被放弃,因此添加是没有意义的.tiff
。