1

I already tried using width = \textwidth and width = \linewidth, also i tried scaling the image but it appears all over the text.

\documentclass[a4paper,12pt]{article}
\usepackage[spanish]{babel}
% Package to make citations superscrit with brackets
\usepackage[super,square]{natbib}
% Package to change margin size
\usepackage{anysize}
\marginsize{2cm}{2cm}{1cm}{2cm}
% Package to make headers
\usepackage{fancyhdr}
\renewcommand{\headrulewidth}{0pt}
% Package for highligths
\usepackage{soul}
% Colors for the references links
\usepackage[dvipsnames]{xcolor}
% Package to link references
\usepackage{hyperref}
\usepackage{float}
\usepackage{graphicx}
\hypersetup{
    colorlinks=true,
    linkcolor=black,
    citecolor=CadetBlue,
    filecolor=CadetBlue,      
    urlcolor=CadetBlue,
}
% Package for lorem ipsum
\usepackage{lipsum}
% Package for multicolumn
\usepackage{multicol}
\setlength\columnsep{18pt}
% Sets bastract
\renewenvironment{abstract}
 {\par\noindent\textbf{\abstractname}\ \ignorespaces \\}
 {\par\noindent\medskip}

\begin{document}

\begin{figure}[H]
    \centering
    \includegraphics[width = \textwidth]{images/SEM_01.png}
    \caption{}
    \label{fig:SEM01}
\end{figure}

\end{document}

enter image description here

4
  • 1
    Hi, welcome! Difficult to say what's wrong without any code... 🔮 Please help us help you by adding a simple, minimal, and complete example.
    – Rmano
    May 4, 2023 at 8:45
  • I edited the question with code and one of the images im using, it was a tiff file, i converted it into png May 4, 2023 at 8:55
  • 1
    Please complete your code (with documentclass, \usepackage etc.) so that it compiles. The code you posted should work ok, so clearly the problem must be in some other place.
    – Rmano
    May 4, 2023 at 8:59
  • There you go, thank you so much. May 4, 2023 at 9:00

1 Answer 1

1

For whatever reason, the "PNG" image you generated is stored with a density of 1 PPI: that means that LaTeX thinks it's 1024 inches wide, which is 26 meters give or take, which is more than the ~5 meters that LaTeX can manage.

I just opened the image in GIMP, changed the resolution to 300 ppi, and it works (edited image below).

Probably you missed a "resolution" or "density" flag when transforming the image from TIFF to PNG.

enter image description here

1
  • Good catch! For some reason, the OP is not alone with the density=1 problem (presumably that is the default, when nothing else is provided, for some graphics programs). I have seen related problems mentioned on sites that deal with graphics in printed books. It is also possible to force the density using ImageMagick or GraphicsMagick.
    – user287367
    May 4, 2023 at 16:34

You must log in to answer this question.

Not the answer you're looking for? Browse other questions tagged .