# Unable to insert figure with a given document class

I was told to make a document with a given template. That uses a class called jps-cp. Using this class I am unable to insert any figures. When article class is used I can insert figures using \includegraphics. Can anybody tell what could be the problem?

%\documentclass[12pt]{article}
\documentclass{jps-cp}

\usepackage{graphicx}

\begin{document}
%\maketitle

\section{Introduction}

To explain the matter-antimatter asymmetry observed in the universe, must be satisfied \cite{c1}.

\begin{figure}[tbh]
\includegraphics{mrec.eps}
\caption{You can embed figures }
\end{figure}

\section{Conclusion}
In summary, the  first study of baryon number violation is done.

\end{document}

• Welcome to TeX.SX! As jps-cp is not a standard class you could add a link to it, if possible. Also add the error message. Maybe jps-cp does not load something that is loaded by article or there is some conflict? Nov 19 '19 at 17:30
• The template can be found from here journals.jps.jp/page/jpscp/authors. I am using TexMaker in Ubuntu. There is no error message, it's compiling successfully. Also, the caption is coming but no plots. Figure fromat I have tried in eps, png also pdf. One can debug with any figure. Nov 19 '19 at 17:47
• Also another thing, figures are insertable with the same template by TeXshop in MacOS. Nov 19 '19 at 17:56

It has to do with the implicit workflow.

The jps-cp class, in contravention to the suggested best practice listed in the documentation for the graphicx package, hard codes a driver. You find in it

\RequirePackage[dvipdfmx]{graphicx}


which specifies using the dvipdfmx driver. Which means that if you compile your document, which uses the jps-cp class, using pdflatex, you will not see the included image. But if you compile it using the two-step process

latex file.tex
dvipdfmx  file.dvi


the image will now appear. I bet if you look under the "working" installation of TeXShop you will find that it does the two step process, while TeXMaker just calls pdflatex.

• Thank You so much! It works. Nov 20 '19 at 4:16