LaTeX forum ⇒ Graphics, Figures & Tablesincludegraphics 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

Postby csam8754 » Thu Jun 26, 2014 8:22 pm

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.

  1. \begin{figure}
  2. \centering
  3. \includegraphics{/img/fig5.png}
  4. \caption{Caption}
  5. \label{fig:my_label}
  6. \end{figure}
  7.  
  8. \begin{figure}
  9. \centering
  10. \includegraphics{lion-logo}
  11. \caption{Caption}
  12. \label{fig:test}
  13. \end{figure}
Attachments
screen.png
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:

User avatar
Johannes_B
Site Moderator
Posts: 4174
Joined: Thu Nov 01, 2012 4:08 pm

Postby Johannes_B » Thu Jun 26, 2014 8:31 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

Postby csam8754 » Thu Jun 26, 2014 8:37 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:

  1. %% BioMed_Central_Tex_Template_v1.06
  2. %% %
  3. % bmc_article.tex ver: 1.06 %
  4. % %
  5.  
  6. %%IMPORTANT: do not delete the first line of this template
  7. %%It must be present to enable the BMC Submission system to
  8. %%recognise this template!!
  9.  
  10. %%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%
  11. %% %%
  12. %% LaTeX template for BioMed Central %%
  13. %% journal article submissions %%
  14. %% %%
  15. %% <8 June 2012> %%
  16. %% %%
  17. %% %%
  18. %%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%
  19.  
  20.  
  21. %%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%
  22. %% %%
  23. %% For instructions on how to fill out this Tex template %%
  24. %% document please refer to Readme.html and the instructions for %%
  25. %% authors page on the biomed central website %%
  26. %% http://www.biomedcentral.com/info/authors/ %%
  27. %% %%
  28. %% Please do not use \input{...} to include other tex files. %%
  29. %% Submit your LaTeX manuscript as one .tex document. %%
  30. %% %%
  31. %% All additional figures and files should be attached %%
  32. %% separately and not embedded in the \TeX\ document itself. %%
  33. %% %%
  34. %% BioMed Central currently use the MikTex distribution of %%
  35. %% TeX for Windows) of TeX and LaTeX. This is available from %%
  36. %% http://www.miktex.org %%
  37. %% %%
  38. %%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%
  39.  
  40. %%% additional documentclass options:
  41. % [doublespacing]
  42. % [linenumbers] - put the line numbers on margins
  43.  
  44. %%% loading packages, author definitions
  45.  
  46. %\documentclass[twocolumn]{bmcart}% uncomment this for twocolumn layout and comment line below
  47. \documentclass{bmcart}
  48.  
  49. %%% Load packages
  50. %\usepackage{amsthm,amsmath}
  51. %\RequirePackage{natbib}
  52. %\RequirePackage{hyperref}
  53. \usepackage[utf8]{inputenc} %unicode support
  54. %\usepackage[applemac]{inputenc} %applemac support if unicode package fails
  55. %\usepackage[latin1]{inputenc} %UNIX support if unicode package fails
  56.  
  57.  
  58. %%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%
  59. %% %%
  60. %% If you wish to display your graphics for %%
  61. %% your own use using includegraphic or %%
  62. %% includegraphics, then comment out the %%
  63. %% following two lines of code. %%
  64. %% NB: These line *must* be included when %%
  65. %% submitting to BMC. %%
  66. %% All figure files must be submitted as %%
  67. %% separate graphics through the BMC %%
  68. %% submission process, not included in the %%
  69. %% submitted article. %%
  70. %% %%
  71. %%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%
  72.  
  73.  
  74. \def\includegraphic{}
  75. \def\includegraphics{}


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

You link is not working. Thanks for your response so far! :)
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

Postby csam8754 » Thu Jun 26, 2014 8:38 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

Postby csam8754 » Thu Jun 26, 2014 8:40 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.
Reason: added inline code markup

User avatar
Johannes_B
Site Moderator
Posts: 4174
Joined: Thu Nov 01, 2012 4:08 pm

Postby Johannes_B » Thu Jun 26, 2014 8:51 pm

As seen in the comment block, use percent sign to comment out those two lines.
  1. %\def\includegraphic{}
  2. %\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

Postby csam8754 » Thu Jun 26, 2014 9:05 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.

  1. %% BioMed_Central_Tex_Template_v1.06
  2. %% %
  3. % bmc_article.tex ver: 1.06 %
  4. % %
  5.  
  6. %%IMPORTANT: do not delete the first line of this template
  7. %%It must be present to enable the BMC Submission system to
  8. %%recognise this template!!
  9.  
  10. %%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%
  11. %% %%
  12. %% LaTeX template for BioMed Central %%
  13. %% journal article submissions %%
  14. %% %%
  15. %% <8 June 2012> %%
  16. %% %%
  17. %% %%
  18. %%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%
  19.  
  20.  
  21. %%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%
  22. %% %%
  23. %% For instructions on how to fill out this Tex template %%
  24. %% document please refer to Readme.html and the instructions for %%
  25. %% authors page on the biomed central website %%
  26. %% http://www.biomedcentral.com/info/authors/ %%
  27. %% %%
  28. %% Please do not use \input{...} to include other tex files. %%
  29. %% Submit your LaTeX manuscript as one .tex document. %%
  30. %% %%
  31. %% All additional figures and files should be attached %%
  32. %% separately and not embedded in the \TeX\ document itself. %%
  33. %% %%
  34. %% BioMed Central currently use the MikTex distribution of %%
  35. %% TeX for Windows) of TeX and LaTeX. This is available from %%
  36. %% http://www.miktex.org %%
  37. %% %%
  38. %%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%
  39.  
  40. %%% additional documentclass options:
  41. % [doublespacing]
  42. % [linenumbers] - put the line numbers on margins
  43.  
  44. %%% loading packages, author definitions
  45.  
  46. %\documentclass[twocolumn]{bmcart}% uncomment this for twocolumn layout and comment line below
  47. \documentclass{bmcart}
  48.  
  49. %%% Load packages
  50. %\usepackage{amsthm,amsmath}
  51. %\RequirePackage{natbib}
  52. %\RequirePackage{hyperref}
  53. \usepackage[utf8]{inputenc} %unicode support
  54. %\usepackage[applemac]{inputenc} %applemac support if unicode package fails
  55. %\usepackage[latin1]{inputenc} %UNIX support if unicode package fails
  56. \usepackage{graphicx}
  57.  
  58.  
  59. %%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%
  60. %% %%
  61. %% If you wish to display your graphics for %%
  62. %% your own use using includegraphic or %%
  63. %% includegraphics, then comment out the %%
  64. %% following two lines of code. %%
  65. %% NB: These line *must* be included when %%
  66. %% submitting to BMC. %%
  67. %% All figure files must be submitted as %%
  68. %% separate graphics through the BMC %%
  69. %% submission process, not included in the %%
  70. %% submitted article. %%
  71. %% %%
  72. %%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%
  73.  
  74.  
  75. %\def\includegraphic{}
  76. %\def\includegraphics{}
Attachments
test.png
test.png (2.76 KiB) Viewed 16760 times

csam8754
Posts: 9
Joined: Thu Jun 19, 2014 4:35 pm

Postby csam8754 » Thu Jun 26, 2014 9:09 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!


Return to “Graphics, Figures & Tables”

Who is online

Users browsing this forum: No registered users and 5 guests