## Insanity with LaTeX and screenshots

I am revising MyProxyAdvisor’s first grant proposal, and wanted to make the screenshots that appear in the document look better. I just spent between 2 and 3 hours on this, which is awful enough, but it was also one of these maddening processes where I’m not sure I really figured out exactly what was wrong but I can’t spend any more time on it. But I thought I would at least post here for my own satisfaction and possibly for the advancement of all digitized mankind. (At least the part messing around with arcane document processing software.)

The basic problem was that pdflatex was enlarging the image files I included in my LyX document. The image that appeared in the pdf created by LyX was much larger than the original image file I included. Not only was the image grainy and the text clownishly large, but the image spilled over the right edge of the page. I figured the problem was with LyX, pdflatex, or my screenshots. I tried various ways of taking the screenshot and various formats to save it in, and the same problem happened no matter what I did. I even downloaded a trial version of Better Screenshots, which is a pretty nice piece of software (possibly worth the \$20 they’ll want from me in a month), and the same problem occurred. Compiling the file directly within WinEdt produced the same problem so it didn’t seem to be specifically a LyX problem at the compiling stage (although this seemed unlikely anyway). Finally I decided to mess around with the options within LyX at the stage of including the file. I just sort of randomly decided to specify the width as “4.5in” (should really specify “4.5” in the first form and select “in” from the second) and selected “Maintain aspect ratio” and voila, it worked perfectly. When you look at the LaTeX code it says

\begin{figure}

\caption{Screen shot of our application (development version)\label{mpaScreen}}

\vspace{.2in}

\begin{centering}\includegraphics[width=4.5in,keepaspectratio]{filenameNoExtension}\par\end{centering}
\end{figure}

So this was probably a very obvious LaTeX solution, but I just could not understand why this problem would be happening — why pdflatex would be changing the size of the image during the compile process. Oh well, now I guess I know what to do, but it’s annoying that I don’t really understand why LaTeX chose to behave this way with these particular image files (and not others I tried). Maybe it had something to do with their dimensions?