## LaTeX forum ⇒ Graphics, Figures & Tables ⇒ includegraphics doesn't show graphics but file name Topic is solved

Information and discussion about graphics, figures & tables in LaTeX documents.
csam8754
Posts: 9
Joined: Thu Jun 19, 2014 4:35 pm

### includegraphics doesn't show graphics but file name

Hi there!

I'm having trouble to include graphics into the Biomed Central Latex Template (http://www.biomedcentral.com/authors/tex).

The following code produces the output as shown in the attachement underneath.

\begin{figure}\centering\includegraphics{/img/fig5.png}\caption{Caption}\label{fig:my_label}\end{figure} \begin{figure}\centering\includegraphics{lion-logo}\caption{Caption}\label{fig:test}\end{figure}
Attachments
screen.png (4.31 KiB) Viewed 16767 times
Last edited by cgnieder on Sat Jun 28, 2014 10:32 pm, edited 1 time in total.
Reason: changed code markup from inline to block

Tags:

Johannes_B
Site Moderator
Posts: 4174
Joined: Thu Nov 01, 2012 4:08 pm
It is important to always boil down your code to a minimum working example. Please follow the link to learn how to prepare one.

So, just a shot into the blue: Did you set option demo or draft either as a global option or an option to package graphicx?
The smart way: Calm down and take a deep breath, read posts and provided links attentively, try to understand and ask if necessary.

csam8754
Posts: 9
Joined: Thu Jun 19, 2014 4:35 pm
Well, it's not easy for me to reduce the code to a minimum working example since I'm using this massive Biomed Central Template.

However the head of my *.tex file goes like this:

%% BioMed_Central_Tex_Template_v1.06%%                                      %%  bmc_article.tex            ver: 1.06 %%                                       % %%IMPORTANT: do not delete the first line of this template%%It must be present to enable the BMC Submission system to%%recognise this template!! %%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%                                     %%%%  LaTeX template for BioMed Central  %%%%     journal article submissions     %%%%                                     %%%%          <8 June 2012>              %%%%                                     %%%%                                     %%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%  %%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%                                                                 %%%% For instructions on how to fill out this Tex template           %%%% document please refer to Readme.html and the instructions for   %%%% authors page on the biomed central website                      %%%% http://www.biomedcentral.com/info/authors/                      %%%%                                                                 %%%% Please do not use \input{...} to include other tex files.       %%%% Submit your LaTeX manuscript as one .tex document.              %%%%                                                                 %%%% All additional figures and files should be attached             %%%% separately and not embedded in the \TeX\ document itself.       %%%%                                                                 %%%% BioMed Central currently use the MikTex distribution of         %%%% TeX for Windows) of TeX and LaTeX.  This is available from      %%%% http://www.miktex.org                                           %%%%                                                                 %%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%% %%% additional documentclass options:%  [doublespacing]%  [linenumbers]   - put the line numbers on margins %%% loading packages, author definitions %\documentclass[twocolumn]{bmcart}% uncomment this for twocolumn layout and comment line below\documentclass{bmcart} %%% Load packages%\usepackage{amsthm,amsmath}%\RequirePackage{natbib}%\RequirePackage{hyperref}\usepackage[utf8]{inputenc} %unicode support%\usepackage[applemac]{inputenc} %applemac support if unicode package fails%\usepackage[latin1]{inputenc} %UNIX support if unicode package fails  %%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%                                             %%%%  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.                         %%%%                                             %%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%  \def\includegraphic{}\def\includegraphics{}

But there are many more files included such as *.sty, *.cls ...

Last edited by cgnieder on Sat Jun 28, 2014 10:33 pm, edited 1 time in total.
Reason: changed code markup from inline to block

csam8754
Posts: 9
Joined: Thu Jun 19, 2014 4:35 pm
I'm using ShareLatex.com and neither can I find the word "demo" nor "draft" within my *.tex file ...

csam8754
Posts: 9
Joined: Thu Jun 19, 2014 4:35 pm
Adding "\usepackage{graphicx}" doesn't help either
Last edited by cgnieder on Sat Jun 28, 2014 10:34 pm, edited 1 time in total.

Johannes_B
Site Moderator
Posts: 4174
Joined: Thu Nov 01, 2012 4:08 pm
As seen in the comment block, use percent sign to comment out those two lines.
%\def\includegraphic{}%\def\includegraphics{}

Now you need to load graphicx in order to have this command defined.

But read the comment block carefully. You need to remove those comments and submit the figures separately.
The smart way: Calm down and take a deep breath, read posts and provided links attentively, try to understand and ask if necessary.

csam8754
Posts: 9
Joined: Thu Jun 19, 2014 4:35 pm
Again thanks for your quick response! Unfortunately it's still not working. I am now using /usepackage{graphicx} and commented out the two lines but the outcome is not what I want (see attachement). I did some research on the internet and maybe it as something to do with a demo option of graphicx or something but I don't really get it.

Thanks for the advice with the figures by the way. However it's just a project for university so i think it'll be ok to include some images.

%% BioMed_Central_Tex_Template_v1.06%%                                      %%  bmc_article.tex            ver: 1.06 %%                                       % %%IMPORTANT: do not delete the first line of this template%%It must be present to enable the BMC Submission system to%%recognise this template!! %%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%                                     %%%%  LaTeX template for BioMed Central  %%%%     journal article submissions     %%%%                                     %%%%          <8 June 2012>              %%%%                                     %%%%                                     %%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%  %%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%                                                                 %%%% For instructions on how to fill out this Tex template           %%%% document please refer to Readme.html and the instructions for   %%%% authors page on the biomed central website                      %%%% http://www.biomedcentral.com/info/authors/                      %%%%                                                                 %%%% Please do not use \input{...} to include other tex files.       %%%% Submit your LaTeX manuscript as one .tex document.              %%%%                                                                 %%%% All additional figures and files should be attached             %%%% separately and not embedded in the \TeX\ document itself.       %%%%                                                                 %%%% BioMed Central currently use the MikTex distribution of         %%%% TeX for Windows) of TeX and LaTeX.  This is available from      %%%% http://www.miktex.org                                           %%%%                                                                 %%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%% %%% additional documentclass options:%  [doublespacing]%  [linenumbers]   - put the line numbers on margins %%% loading packages, author definitions %\documentclass[twocolumn]{bmcart}% uncomment this for twocolumn layout and comment line below\documentclass{bmcart} %%% Load packages%\usepackage{amsthm,amsmath}%\RequirePackage{natbib}%\RequirePackage{hyperref}\usepackage[utf8]{inputenc} %unicode support%\usepackage[applemac]{inputenc} %applemac support if unicode package fails%\usepackage[latin1]{inputenc} %UNIX support if unicode package fails\usepackage{graphicx}  %%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%                                             %%%%  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.                         %%%%                                             %%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%  %\def\includegraphic{}%\def\includegraphics{}
Attachments
test.png (2.76 KiB) Viewed 16760 times

csam8754
Posts: 9
Joined: Thu Jun 19, 2014 4:35 pm
I'm sorry, within the latest post I messed up the file name! ... It's now working. Thank you very much for your help with this question and in the other thread as well!