[Tex/LaTex] Compiling a Latex template to a PDF file

texniccenter

I'm trying to compile a LaTeX template to a PDF, but it's not working. The template is available in this link (on the right side in Article Templates).

I'm using TeXnic Center. Can anyone please try to compile this and let me know if it's working.

Best Answer

No answer for almost two weeks, so here my guess: You’ve chosen the wrong output profile for compiling.

The template file NanoMMTA_template.tex, available in the ZIP file to be found from your link, clearly states in the preamble:

%% put the discipline from the list below"
%% chemistry, biology, physics, mathematics, medicine
\documentclass[mathematics,DVI]{ejs_author}
% if you use PostScript figures in your article
% use the graphics package for simple commands
\usepackage{graphics}
% or use the graphicx package for more complicated commands
\usepackage{graphicx}
% or use the epsfig package if you prefer to use the old commands
\usepackage{epsfig}

Note the DVI as documentclass option. So you need an output profile in TeXnicCenter, what creates a DVI file in first step. Supposed you have the default profile configuration these are the following:

  • LaTeX ⇨ DVI
  • LaTeX ⇨ DVI ⇨ PDF
  • LaTeX ⇨ PS (what actually is LaTeX ⇨ DVI ⇨ PS)
  • LaTeX ⇨ PS ⇨ PDF (again: actually LaTeX ⇨ DVI ⇨ PS ⇨ PDF)

After choosing the graphics package (I would opt for graphicx) the compilation went fine here.

In fact the cause of the problem is the inclusion of an EPS file:

\includegraphics[width=12cm,height=6cm]{nano-mmta-fig.eps}% Here is how to import EPS art

This file type is not supported in pdftex mode (“LaTeX ⇨ PDF”), cf. Graphics file extensions and their order of inclusion when not specified.

Remark:

Looking into the class file ejs_author.cls you can see, that beside the option DVI there is also a PDF one, and this is even the default option. Usually for on-the-fly conversion from EPs to a pdftex supported format the package and script epstopdf is recommended. In TeX Live this happens automatic while compilation, in MiKTeX you need to add \usepackage{epstopdf} after usepackage{graphicx}.

But in this case here the EPS file is a bit special (a bitmap file just embedded in a bounding box), and in the result the included image is defunct both in MiKTeX and TeX Live. In MiKTeX there is no cure in such a case (but use one of the DVI modes), in TeX Live I had success in using the Perl script epstopdf.pl with some Ghostscript options:

perl C:\texlive\texmf-dist\scripts\epstopdf\epstopdf.pl --gs --gscmd=C:\Programs\Ghostscript\bin\gswin32c.exe --outfile=e2p-nanofig.pdf nano-mmta-fig.eps

(Paths must be adjusted. Help with adding the option --help.)

I’ve got a warning ==> Warning: BoundingBox not found, what perhaps is the actual reason for all the mess, but the resulting PDF file shows the image, so I could use it replacing the original \includegraphics command:

\includegraphics[width=12cm,height=6cm]{e2p-nanofig.pdf}

The image is a bit cutted on the right and distorted. Only the distortion can be cured by setting a bounding box in \includegraphics:

\includegraphics[width=12cm,height=6cm,bb=20mm 10mm 218mm 165mm]{e2p-nanofig.pdf}