# shareLaTex image not showing up

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

\documentclass[11pt,a4paper,oldfontcommands]{memoir}
\usepackage[utf8]{inputenc}
\usepackage[T1]{fontenc}
\usepackage{microtype}
\usepackage[dvips]{graphicx} %I've tried removing [dvips] here but this doesn't make a difference?
\usepackage{xcolor}
\usepackage{times}

\usepackage[
bookmarks=true,bookmarksopenlevel=2]{hyperref}

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

%%% CHAPTER'S STYLE
\chapterstyle{bianchi}
%%% STYLE OF SECTIONS, SUBSECTIONS, AND SUBSUBSECTIONS

%%% STYLE OF PAGES NUMBERING
\pagestyle{plain}
\makepagestyle{plain}
\makeevenfoot{plain}{\thepage}{}{}
\makeoddfoot{plain}{}{}{\thepage}

\maxsecnumdepth{subsection}
\maxtocdepth{subsection}

\begin{document}


Then, later on in my script I use:

\begin{figure}[h]
\includegraphics[width=8cm]{Xray}
\centering
\end{figure}


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 Dec 12, 2017 at 16:18
• Remove option [dvips] from \usepackage[dvips]{graphicx} Dec 12, 2017 at 16:36
• @Cragfelt why would anyone need to include the extension? Dec 12, 2017 at 17:24
• 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
• 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

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