I'm using one of the preset project formats provided by Sharelatex (thesis template with memoir). The .tex file looks like:

\usepackage[dvips]{graphicx} %I've tried removing [dvips] here but this doesn't make a difference?

linkcolor=black,urlcolor=black,citecolor=black,% PRINT

\geometry{total={210mm,297mm},left=25mm,right=25mm, bindingoffset=0mm, top=25mm,bottom=25mm}





Then, later on in my script I use:


But this doesn't produce a picture, just a box where the picture should be with "Xray.png" in it. I have the .png file in the same folder as the .tex file so I am a little lost as to what could be the problem. Anyone who knows what could be the cause of the problem?

  • Welcome to TeX.SE!. You need to include the image extension: .jpg, .png. E.g.: Xray.jpg
    – Cragfelt
    Dec 12, 2017 at 16:18
  • 1
    Remove option [dvips] from \usepackage[dvips]{graphicx}
    – Cragfelt
    Dec 12, 2017 at 16:36
  • 2
    @Cragfelt why would anyone need to include the extension? Dec 12, 2017 at 17:24
  • 1
    you have specified [dvips] but dvips can not include png files. If you use pdflatex rather than latex/dvips then it will work. Dec 12, 2017 at 17:25
  • 1
    it will sort of work by accident but it is much better to put \centering at the start of the figure, not the end. Dec 12, 2017 at 17:27

1 Answer 1


Remove option [dvips] from \usepackage[dvips]{graphicx} in preamble. As @DavidCarlisle stated, place \centering command before the figure command line.

  • Hi Cragfelt, I've removed dvips and tried using .png , .jpeg and .pdf as format, but all of those won't show me an image still (also I placed the \centering command to before the figure command line like you said). Also I am using pdfLatex as a compiler. Any idea what else could be the cause of the problem? Thanks for the help!
    – Kroepoek
    Dec 14, 2017 at 8:35
  • @Kroepoek Well, in that case, it would be better if you show us your work by including a minimal working example (MWE) to your original question so we can compile it and find the actual issue you are having.
    – Cragfelt
    Dec 14, 2017 at 9:46
  • @Kroepoek any news about this?
    – Cragfelt
    Dec 20, 2017 at 8:27

Your Answer

By clicking “Post Your Answer”, you agree to our terms of service, privacy policy and cookie policy

Not the answer you're looking for? Browse other questions tagged or ask your own question.