Graphics, Figures & TablesImages not appearing

Information and discussion about graphics, figures & tables in LaTeX documents.
Post Reply
Dag9
Posts: 2
Joined: Sat Apr 18, 2020 7:09 pm

Images not appearing

Post by Dag9 »

Hi everyone, I'm very new to LaTeX since I just started writing my dissertation with it, and while I was able to overcome most problems by looking in forums such as this one, I can't find any straightforward solution to this particular issue, so here I am
I started from a template that my university provided, but the images for some reason do not appear in the final pdf. They seem to be there, because if for example I change their size the blank space in which they should be also changes in size, but there's just a void. Here's the frontispiece code as an example:

Code: Select all

\documentclass[11pt,a4paper,twoside,openright]{book}

\usepackage[dvips]{graphicx}
\usepackage{tabularx}
\usepackage{subfigure}
\usepackage{afterpage}
\usepackage{amsmath,amssymb}            
\usepackage{rotating}  
\usepackage{fancyhdr}  
\usepackage[scriptsize]{caption} 
\hyphenation{a-gen-tiz-za-zio-ne}

\setlength{\paperwidth}{16cm}
\setlength{\paperheight}{24cm}
\setlength{\oddsidemargin} {2. cm}
\setlength{\evensidemargin} {2. cm}
\addtolength{\oddsidemargin} {-0.4 cm}
\addtolength{\evensidemargin} {-0.4 cm}
\linespread{1.1}

\usepackage[english]{babel}
\usepackage[latin1]{inputenc}
\renewcommand{\captionfont}{\normalfont \sffamily \itshape \small}

\pagestyle{empty}

\begin{document}
	
\thispagestyle{empty}
\vspace*{-1.5cm} \bfseries{
	\begin{center}
		\Huge
		Politecnico di Milano\\
		\bigskip
		\normalsize
		School of Industrial and Information Engineering\\
		Master of Science in Materials Engineering and Nanotechnology\\
		
		\begin{figure}[htbp]
			\begin{center}
				\includegraphics[width=3.5cm,natwidth=300,natheight=297]{logopm.png}
			\end{center}
		\end{figure}
	\vspace*{0.3cm} \LARGE
	\textbf{TITLE}\\
	\end{center}

\vspace*{1.0cm} \large
\begin{flushleft}

Supervisor: Prof. NAME SURNAME \\
Co-supervisor: Dott. NAME SURNAME 

\end{flushleft}
\vspace*{1.0cm}
\begin{flushright}
Thesis by\\ NAME SURNAME \\ mat. NUMBER
\end{flushright}
\vspace*{0.5cm}

\begin{center}
Academic Year 2019/2020
\end{center} \clearpage

\end{document}
A few more things that may or may not be related to the issue, according to my Google searches:
I'm using MikTeX with TeXstudio and PdfLaTeX as default compiler (and, if I switch to XeLaTeX I can actually see the images, but the page layout gets completely distroyed and a few errors arise, so I'd like to stick to PdfLaTeX if possible). The images are all .png and in the same folder as the .tex, and I can even see the preview in the GUI.

A hundred thanks to anyone who'd help me out, I'm getting kind of desperate

Recommended reading 2024:

LaTeXguide.org • LaTeX-Cookbook.net • TikZ.org

NEW: TikZ book now 40% off at Amazon.com for a short time.

Ijon Tichy
Posts: 640
Joined: Mon Dec 24, 2018 10:12 am

Images not appearing

Post by Ijon Tichy »

The template is full of avoid this code. You should at least remove option dvips. And the figure environment doesn't make any sense on a title page. But there a lot of other things, you should never do. So I would recommend not to use such a broken template but begin from scratch with an introduction to LaTeX.
Sorry, but I can no longer participate here as the administrator is trampling on my wishes on one of his other platforms. :cry:
Bartman
Posts: 369
Joined: Fri Jan 03, 2020 2:39 pm

Images not appearing

Post by Bartman »

A note on how to create a title page.
Dag9
Posts: 2
Joined: Sat Apr 18, 2020 7:09 pm

Images not appearing

Post by Dag9 »

Yeah, somehow I imagined that was the case, I just didn't want to believe it haha
I guess I'll start over, thank you both!
Post Reply