[Tex/LaTex] Graphicx Displays File Path, not Image

graphics

I am using the bmcart.cls file, as it is required for submission to a particular journal (associated with BioMed Central). Using this format, none of the images to which I refer in my code render in the .pdf output; however, the compiler (ShareLaTeX) throws no errors. The code works in the article and nwc document class.

Below is a minimum working example. The graphicx package is loaded in the document preamble. Help?

\begin{figure}[!ht]  
    \centering  
    \includegraphics[width=.48\textwidth]{./figs/WestCoastPowerGrid.pdf}  
    \includegraphics[width=.48\textwidth]{./figs/WestCoastPowerGrid2.pdf}  
    \caption{The  West Coast Power Grid introductory slide and degree distribution slide (by Ben McCaleb)}  
    \label{fig:WestCoastPowerGrid}  
\end{figure}  

Thank you,
Jon

Best Answer

The bmcart class comes with a template file that includes the comment:

All additional figures and files should be attached separately and not embedded in the \TeX\ document itself.

and also:

If you wish to display your graphics for your own use using includegraphic or includegraphics, then comment out the following two lines of code. NB: These line must be included when submitting to BMC. All figure files must be submitted as separate graphics through the BMC submission process, not included in the submitted article.

followed by:

\def\includegraphic{}
\def\includegraphics{}

So, if you want the images to appear in a draft version of your document, you need to comment out those two lines above. I'm guessing (since there's no MWE) you haven't done this, which means that \includegraphics won't take any arguments, which accounts for the filename appearing, since it's not an argument.

For your final submission-ready paper, you'll have to remove the graphicx package, and possibly just mark where the images should appear with \includegraphic or \includegraphics without any arguments or completely remove \includegraphics. (This is just guesswork based on a cursory glance at the template, so I recommend you read the author guidelines to check this.)

The template has an example of a couple of figures:

  \begin{figure}[h!]
  \caption{\csentence{Sample figure title.}
      A short description of the figure content
      should go here.}
      \end{figure}

\begin{figure}[h!]
  \caption{\csentence{Sample figure title.}
      Figure legend text.}
      \end{figure}

These simply have the caption (including their custom \csentence, which you don't seem to have used) so I think it's best to just replicate that.

Related Question