Logo Questions Linux Laravel Mysql Ubuntu Git Menu
 

Fonts in pdf documents screwed up when generated with latex (specifically, pdflatex) on mac osx

My colleague suggests that texniscope is somehow to blame and that I should try purging it from my system. I really hope not to have to resort to that!

Possible clues:

  • This wasn't an issue till I upgraded to Leopard.

  • When I say the fonts are screwed up, I mean the main text looks like maybe it's the default mac system font, and all math is completely unreadable. Basically all special symbols are completely garbled.

  • I installed latex from here: http://www.tug.org/mactex/. I had already had texniscope installed.

  • When I run /usr/texbin/pdflatex foo.tex, it seems to work:

     This is pdfTeXk, Version 3.1415926-1.40.9 (Web2C 7.5.7)
     %&-line parsing enabled.
     entering extended mode
    ...

but the resulting pdf file has screwed up fonts.

  • The same thing happens both with pdflatex on the command line, or using TeXShop.
like image 912
dreeves Avatar asked Dec 31 '22 07:12

dreeves


1 Answers

Apple knows about the problem and isn't planning to fix it (I had a faculty member spend a lot of time testing and submit a bug to Apple). Their claim is that PDFTeX is embedding the fonts incorrectly, and they have fixed the Apple PDF library to be more strict about what it will and won't accept, which means that you will continue to see problems with PDF documents created with PDFTeX in Preview, TeXShop, or other tools that display PDF using Apple's PDF engine. Unfortunately, they weren't at all clear about exactly what it is that PDFTeX is doing wrong, which makes fixing it or even reporting the bug to the PDFTeX developers problematic. Note that Adobe's Acrobat or Reader applications can often display these documents without any problems; presumably Adobe's error-checking is more liberal than Apple's.

You can actually recover from this problem without rebooting, although you may see it recur with the same document in the same session. You need to run

atsutil server -shutdown

which will kill the Apple Type Services server daemon (ATSServer) and spawn a new instance, coincidentally rebuilding its cache files.

like image 68
Claire Avatar answered Jan 09 '23 10:01

Claire