[OS X TeX] pdfcrop and white equations?

Peter Dyballa Peter_Dyballa at Web.DE
Sat Oct 4 00:33:02 CEST 2008


Am 03.10.2008 um 21:18 schrieb david craig:

> Please share your results with us

I'll do so! Heiko Oberdiek does not need to be confronted, PDFCROP  
1.13 obviously works correctly.


I used this XeTeX file (Germanised comments variant) I took from  
LaTeXiT's temporary working directory:

\documentclass[10pt]{article}
\usepackage{color}\color[rgb]{1.000,1.000,1.000}	% Farbunterstützung
\usepackage{amssymb}	% Mathe
\usepackage{amsmath} % Mathe
\usepackage{fontspec}
%\usepackage{xltxtra,xunicode}

\pagestyle{empty} \begin{document}$\fcolorbox{white}{cyan}{$x = r^2 +  
\sum_{0}^{100} y^2$}
$
\end{document}

For the completely white test I changed the cyan background of the  
formula to white.


For pdfTeX I used this file (Germanised comments variant) from LaTeXiT:

\documentclass[10pt]{article}
\usepackage{color}\color[rgb]{1.000,1.000,1.000}	% Farbunterstützung
\usepackage{amssymb}	% Mathe
\usepackage{amsmath} % Mathe
\usepackage[utf8]{inputenc} % Direkte Eingabe von Umlauten und  
anderen Diakritika
\pagestyle{empty} \begin{document}$\fcolorbox{white}{cyan}{$x = r^2 +  
\sum_{0}^{100} y^2$}
$
\end{document}

Again, for the completely white test I changed the cyan background of  
the formula to white.


On the command line I invoked xelatex or pdflatex. In the end I had  
four LaTeX and four PDF files:

XeTeX-Test-colour.tex XeTeX-Test-white.tex pdfTeX-Test-colour.tex  
pdfTeX-Test-white.tex
XeTeX-Test-colour.pdf XeTeX-Test-white.pdf pdfTeX-Test-colour.pdf  
pdfTeX-Test-white.pdf

Now I used pdfcrop as in: pdfcrop --verbose --debug --{pdf|xe}tex  
<test file>.pdf <test file>-cropped.pdf, so that I gained four more  
PDF files:

XeTeX-Test-colour-cropped.pdf XeTeX-Test-white-cropped.pdf pdfTeX- 
Test-colour-cropped.pdf pdfTeX-Test-white-cropped.pdf

The coloured PDF files were "loosely" cropped, i.e., the cyan  
background added some "depth" around the white text. The white PDF  
files were "tightly" cropped, i.e., no protective space around the  
formula (this can be seen by selecting the invisible text in a PDF  
viewer – which made me discover that Adobe Reader 9 computes its  
magnification on the actual resolution of my screen, what TeXShop,  
Preview, or Skim can't do, and the latter fails to display at a  
magnification that I set!).

Pdfcrop in verbose mode shows that Ghostscript 8.61 is used. And its  
Ghostscript that calculates the BoundingBox or HiResBoundingBox.  
Without error in my test cases ... So I created a new one:

\documentclass[10pt]{article}
\usepackage{color}\color[rgb]{1.000,1.000,1.000} % für Farbe
\usepackage{amssymb}	% Mathe
\usepackage{amsmath} % Mathe
\usepackage{fontspec}
%\usepackage{xltxtra,xunicode}

\pagestyle{empty} \begin{document}$x = r^2 + \sum_{0}^{100} y^2
$
\end{document}

and similarly for pdfTeX, both without any boxes. Again pdfcrop did  
not fail. The BoundingBox and HiResBoundingBox were a bit different  
in place and size – no box around!

--
Greetings

   Pete

You can learn many things from children.  How much patience you have,  
for instance.
				– Franklin P. Jones






More information about the macostex-archives mailing list