14

I'm inserting a PNG file and it's rendered enlarged, somehow. Here is my MWE:

\documentclass{book}
\usepackage{graphicx}
\begin{document}
\mainmatter
hello, world.
the following screenshot should be rendered in 1:1 scale, isn't it?

\begin{figure}[H]
\centering
\includegraphics{screenshot.png}
\end{figure}

\end{document}

Here is a screenshot I desire to insert: http://conus.info/tmp/screenshot.png I use XeLaTeX.

And here is a result: http://conus.info/tmp/result.pdf

All I want is to insert a PNG picture (screenshot), so it will be rendered in the same width/height in PDF viewed at 100%.

The size of screenshot.png is 726 pixels by 489 pixels. I want it to be exacly the same size when viewed in Acrobat Reader at 100%.

What should I do?

What are the best practices of inserting screenshots into TeX and exporting them to PDF?

10
  • 1 px is not equal to 1 mm on the PDF page... what do you mean exactly the same size ?
    – percusse
    Sep 12, 2016 at 11:35
  • What to do to make it equal? How to insert screenshots to TeX and export to PDF? Sep 12, 2016 at 11:35
  • you can use \includegraphics[width=\textwidth]{screenshot} to fit in the text
    – percusse
    Sep 12, 2016 at 11:37
  • I tried, than it's smaller. Sep 12, 2016 at 11:40
  • I mean that's how you adjust the width. What is the image final size in dimensions of length pt,cm, mm etc. ?
    – percusse
    Sep 12, 2016 at 11:42

2 Answers 2

20

This question cannot have general answer for ALL monitors.

The size of the PNG image on the screen depends on the screen resolution (e.g. 110.27 PPI (pixels per inch) for my MacBook), and on Retina (220 PPI) it will be twice smaller.

And the size of image inside PDF, shown at real 100%, will be monitor-independent.

Thus solution for my monitor:

\includegraphics[scale=0.65]{screenshot.png}

will be different from yours:

\includegraphics[scale=0.75]{screenshot.png}
0
1
\documentclass{book}

\usepackage{graphicx}

\begin{document}
    \mainmatter

    \begin{figure}[H]
        \centering
        \includegraphics[height = 0.3, width = 0.6]{crocodile.png}
    \end{figure}

\end{document}
1
  • 3
    Compiling your document example trow the error: Unknown float option. In preamble you need to load the float package.
    – Zarko
    Jul 18, 2020 at 21:15

You must log in to answer this question.

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