[OS X TeX] texshop and preview

Michael Sharpe msharpe at ucsd.edu
Sun May 23 00:14:43 EDT 2010


On May 22, 2010, at 6:52 PM, Ross Moore wrote:

> Hi Victor,
> 
> On 22/05/2010, at 10:48 AM, Victor Ivrii wrote:
> 
>> The following example was posted in MacOSX TeX mailing list
>> 
>> \documentclass{article}
>> \usepackage{tikz}
>> \usepackage[papersize={51pt,51pt},margin=.5pt,centering]{geometry}
>> \begin{document}
>> \parindent 0pt
>> \begin{tikzpicture}
>> \draw[line width=.5pt] (0,0) circle (24.75pt);
>>  \draw (0,0) node{24.75pt};
>> \end{tikzpicture}
>> \end{document}
>> 
>> It results in pdf file which looks perfect in AR, evince, kpdf, Apple
>> "Get Info" but not in Apple Preview and other applications using the
>> same engine: it looks like pdf was slightly cropped from the top and a
>> tiny margin was added on the bottom.
> 
> When I run this and look at the result there is a problem
> at the right-hand edge too.
> 
> My first though was that it could be related to the different
> interpretations of how long is a point.
> Is it 72 points per inch, or ~72.27 points per inch ?
> 
> If you uncompress the PDF and look at its internal coding,
> you'll see:
> 
>>>> 0.0 0.0 m
>>>> 24.65785 0.0 m
>>>> 24.65785 13.68492 13.68492 24.65785 0.0 24.65785 c
> 
> 
> so the circle is drawn with radius: 24.65785
> which is very close to  25.75 x 72/72.27 .
> 
> 
>> Further, running pdfcrop
>> generates pdf which looks perfect in Apple Preview and Co as well
> 
> When I view it in Apple's Preview it actually looks fine; Skim also.
> Where it does not look fine is in TeXshop's Preview.
> So there is definitely a problem in some viewers based on Apple's
> PDFKit, but maybe Apple doesn't actually use it themselves?
> 
> BTW, my versions are quite old:
>  Preview v3.0.9
>  Skim 1.2.7 (45)
>  TeXshop 2.31  under  MacOS X 10.4.11 .
> 
>> 
>> Would be it possible to explain the reason of such unusual behavior?
> 
> 
> Maybe an error has been introduced with either OSX 10.5 or 10.6 ?
> 

Something quite interesting is going on here. I'm using 10.6.3 and when processing the file with pdflatex, the top of the circle is cut off. However, if I process instead with
latex xxx
dvips -oxxx.ps xxx.dvi
ps2eps -g -r=360 xxx.ps
epstopdf xxx.eps

then I get a file with no inappropriate cropping in Preview or in the TeXShop previewer. What I see now in Acrobat is identical to what I see in Preview. (This was not the case last year---PDFKit based viewers always clipped off part of the top back then. I sent in a bug report more than a year ago about this.) Could it be that pdfcrop had adjusted for Apple's former bad behavior in PDFKit, and Apple has now repaired one of their pdf rendering bugs?

Michael


More information about the MacOSX-TeX mailing list