Scale does not work with includegraphics

graphicsincludegraphics

I've seen this question asked, but I have not seen an answer that works for me.

I am trying to include screenshots from my program with includegraphics. I have many screenshots — all of different pixel widths. I would like to be able to include them at the same 'scale' such that text in each remains the same size.

Long ago, I was able to do this with the [scale=0.75] option for includegraphics. This no longer works as it seems includegraphics now ignores the dpi information stored in the PNG file.

The PNG starts at 72dpi (I have changed it in an image editor to 300dpi, no change) and including it with scale=1.0, 0.5, and 0.1 all give identical results — the image does not scale.

Any help is appreciated.

\documentclass[]{aiaa-tc}
\begin{document}
\begin{figure}
\includegraphics[scale=1.0]{example-image.png}
\end{figure}
\begin{figure}
\includegraphics[scale=0.5]{example-image.png}
\end{figure}
\begin{figure}
\includegraphics[scale=0.1]{example-image.png}
\end{figure}
\end{document}

I am running TeXShop on a Mac using pdftex.

sample image

Changing the first few lines…

\documentclass[]{article}
\usepackage{graphicx}

remedies the problem. Of course, I am submitting an AIAA paper, so it would be best to find a solution that works with this class file.

Best Answer

The class you are using does

\setkeys{Gin}{width=\linewidth,totalheight=\textheight,keepaspectratio}

so all images are unconditionally scaled as large as possible to fit in the text block.

This is clearly an intentional choice of the publisher so if you are using a journal that mandates this class, that is just the way it is.

So scale is more or less disabled, but you can re-specify width to scale the image:

enter image description here

\documentclass[]{aiaa-tc}
\begin{document}
\begin{figure}
\includegraphics[width=.5\textwidth]{example-image}
\end{figure}
\begin{figure}
\includegraphics[width=.2\textwidth]{example-image}
\end{figure}
\begin{figure}
\includegraphics[width=0.1\textwidth]{example-image}
\end{figure}
\end{document}
Related Question