# sharelatex image not shows up

I'm using sharelatex with the Polimi Thesis project. When I'm trying to include images, they not show up. The problem seems related to the package: \usepackage[dvipdfmx]{graphicx} But when I remove it for use only graphicx, the images start to showing up but the entire structure of the text is not conformed to the page size (text exceed the border page). Thanks in advice for any further reply.

Packages in the main .tex file:

\documentclass[11pt,a4paper,twoside,openright]{report}
\usepackage[utf8x]{inputenc}
\usepackage[dvipdfmx]{graphicx}
\usepackage{bmpsize}
\usepackage{tabularx}
\usepackage{subfigure}
\usepackage{afterpage}
\usepackage{amsmath,amssymb}
\usepackage{rotating}
\usepackage{fancyhdr}
\usepackage[scriptsize]{caption}
\hyphenation{a-gen-tiz-za-zio-ne}
\graphicspath{ {pictures/} }
\setlength{\paperwidth}{16cm}
\setlength{\paperheight}{24cm}
\setlength{\oddsidemargin} {2. cm}
\setlength{\evensidemargin} {2. cm}

\usepackage[italian]{babel}
\usepackage{makeidx}

\end{document}


When I try to load an image:

\begin{figure}[!ht]
\centering
\fbox{\includegraphics[scale=.4]{<filename>.png}}
\caption{Terza generazione ICS: in rete}
\label{fig:figura3}
\end{figure}


I used fbox for view the box related to the image and it appeared but it is empty (no image inside)

• (1) Welcome, (2) what exactly are you using to compile this? If you are compiling with pdflatex that option is wrong – daleif Aug 3 '17 at 14:19
• main file is not of big help. please make small but complete, self contained document beginning with \documenntclass{...} and ending with \end{document}. include in it only necessary packages and not use \include{<any file>} since we haven't your files. only on this way we can (eventually) identified your problem and suggest solution(s). welcome to tex.se! – Zarko Aug 3 '17 at 14:19
• Thanks for the reply, I tried to use each compiler offered by the sharelatex engine but with the same results (no images) or in some cases with the structured mixed – Younes Aug 3 '17 at 14:28
• Don't know if it'll make a difference but try removing [dvipdfmx], so you have just \usepackage{graphicx}. – Torbjørn T. Aug 3 '17 at 14:40
• Thanks for the suggestion but I've already tried, the imges shows up but the entire structure of the text exceed the border of the pages – Younes Aug 3 '17 at 15:08

The problem was solved by removing the [dvipdfmx] package option and all the manual papersize and margins, using instead the geometry package.