Possible Duplicate:
Why isn't \textwidth the width of the text?
After some gruelling work, I reduced my problem to this MWE:
\documentclass{article}
\usepackage{rotating}
\begin{document}
\includegraphics[width=\textwidth]{Rolemaster.pdf}
\end{document}
The PDF included by this snippet is actually a potrace of a bitmap, and according to TeX of ~470pt width:
<Rolemaster.pdf, id=1, 469.755pt x 91.34125pt>
That's why am using the width=\textwidth parameter to includegraphics, to scale the included PDF down to fit. However, I am getting this warning:
Overfull \hbox (15.0pt too wide) in paragraph at lines 6--7
Why does this happen, and what would be the correct parameter to width to result in max-width fit without a warning?
I did some trial & error, with (for me) surprising results. Going from the above warning ("15.0pt too wide") I tried:
\includegraphics[width=\textwidth - 15pt]{Rolemaster.pdf}
Getting:
Overfull \hbox (65.00009pt too wide) in paragraph at lines 6--7
So obviously there's something non-trivial going on behind the scenes, screwing with my numbers. Using fixed numbers, I figured that
\includegraphics[width=330pt]{Rolemaster.pdf}
does what I want, but quite obviously this isn't acceptable since I am not in a mind of peppering my document with "magic numbers" like that. There has to be some constant (or sum of constants) that would result in the proper max width. But I have no idea which one that would be...?
\noindentbefore\includegraphics– egreg Sep 19 '12 at 15:09calcpackage for that kind of calculation. Without it, it just typesets-15ptin front of your graphic. – Qrrbrbirlbel Sep 19 '12 at 15:23- 15ptis typeset. You can't do arithmetic in that way;width=\dimexpr\textwidth-15pt\relaxwould be correct syntactically, but resulting in wrong output, as the picture would be indented. – egreg Sep 19 '12 at 15:26\linewidththan\textwidth. – Paul Gaborit Sep 19 '12 at 15:48