2

I want to include a jpg image in a journal paper, and I get the error below when I do 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

I can get LaTeX=>PDF but I need the PS file as well. When I remove the jpg image it is compiled without errors and warnings. I know that I can convert my jpg images to eps and get it to work, however, I am obliged by the journal to use jpg images for the biography section. I use TexnicCenter with MikTex. The document class that I am using is IEEEtran and I have the following in it (of course, shortened and modified!), the jpg image comes at the end of the document in the biography section.

\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}
4
  • and how exactly is LaTeX suppose to handle JPG images when LaTeX+dvips does not support jpg. Not that AFAIR tif is not supported either
    – daleif
    Aug 4, 2016 at 10:25
  • @daleif that's true, but isn't the exception rule taking care of that (line 10)?
    – Kevin Bell
    Aug 4, 2016 at 10:27
  • 2
    Line 10 tells LaTeX that if the compiler is pdflatex, then the pdftex driver should be loaded. Otherwise the dvips driver is loaded and only EPS files are acceptable. The code tries to enable TIFF, but this has been unsupported for several years.
    – egreg
    Aug 4, 2016 at 10:35
  • 2
    The whole \ifCLASSINFOpdf \usepackage[pdftex]{graphicx} \DeclareGraphicsExtensions{.pdf,.jpeg,.jpg,.png} \else \usepackage[dvips]{graphicx} \DeclareGraphicsExtensions{.ps, .eps, .tiff} \fi block can (and should) be replaced by simply \usepackage{graphicx} there is no need to test the config file will detect if you are using latex or pdflatex and select the right option Aug 4, 2016 at 10:44

1 Answer 1

2

The compilation “latexdvipsps2pdf” only accepts EPS files.

The code advertised in many examples for the IEEEtran class and that you're using is bad and outdated, but this is another matter.

What you can do is converting your JPEG file into EPS (several programs are available) and keep both versions together. So you will have both whome.jpg and whome.eps and you can compile the file using both methods.

\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}

Notes.

I only left amsmath just to show that the cmex10 option should not be used with it. It's provided only for allowing very old TeX distributions to use the package; you're not using emTeX, are you?

The preference for dvips extensions should be looking first for EPS and then for PS; TIFF inclusion support has long been dropped, so there's no point in adding .tiff.

1
  • Thank you for explaining the issue. I really appreciate it.
    – Kevin Bell
    Aug 4, 2016 at 10:51

You must log in to answer this question.

Not the answer you're looking for? Browse other questions tagged .