0

I have an test.eps that consists of

%%BoundingBox: 0 0 343 491
%%EOF

and a tex document

\documentclass{minimal}
\usepackage{graphicx}
\newbox\figbox
\begin{document}
\setbox\figbox\hbox{\includegraphics{test.eps}}%
\the\ht\figbox

\fboxsep0pt
\fbox{\unhbox\figbox}
\end{document}

when i run LaTeX, the first line of shell output is

This is pdfTeX, Version 3.14159265-2.6-1.40.18 (TeX Live 2017) (preloaded format=latex)

and yields the DVI output (xdvi shrink factor 1, only upper left corner):

bb error

For those of you who don't remember xdvi: The red line is the Bounding Box of the eps. The black line is the fbox I created in LaTeX.

Note the visual deviation between Bounding Box and fbox and the difference between the height of 492 (bp? and including 0) in the eps file and the 492.84125 (pt?) that TeX calculates*. Why is that and how do i get rid of it (without editing the eps, if possible)?


* Adding \strip@pt\dimexpr\ht\figbox*7200/7227\relax bp results in 491bp, so that value is explained (thanks to users Ulrike Fischer and daleif).

  • (1) never use the minimal class, it has no real use. (2) the bounding box is in postscript points aka bp (big points) and LaTeX calculates in pt. So probably the difference is bp vs pt? Try loading the pgfmath package and run: \pgfmathparse{491bp} \typeout{\pgfmathresult} the output is in pt – daleif Dec 19 '18 at 10:38
  • the bounding box is in postscript points, so 491bp = 492.84pt. The visual difference looks like a problem of the viewer. – Ulrike Fischer Dec 19 '18 at 10:42
  • @daleif so no minimal class for no minimal example? (scnr) \strip@pt\dimexpr\ht\figbox*7200/7227\relax bp results in 491 bp. – Lupino Dec 19 '18 at 10:49
  • Apparently minimal is too minimal, better stick to article or standalone. According to CTAN it is only for testing. – daleif Dec 19 '18 at 10:51
  • @UlrikeFischer is this a well-known problem in xdvi? – Lupino Dec 19 '18 at 10:55

Your Answer

By clicking “Post Your Answer”, you agree to our terms of service, privacy policy and cookie policy

Browse other questions tagged or ask your own question.