Take the 2-minute tour ×
TeX - LaTeX Stack Exchange is a question and answer site for users of TeX, LaTeX, ConTeXt, and related typesetting systems. It's 100% free, no registration required.

In this answer I did something one shouldn't really do: I modified the font metric file cmsy10.tfm and saved it in my working TeX directory without changing the name. This had the desired effect: Compilation of my LaTeX file containing \hat{\mathcal C} produced a different positioning of the hat due to the modification in the font metrics.

However, this was done with

\documentclass[12pt]{article}

It also works with 11pt, but if I try it with 10pt, I get the original font metrics although the output of pdflatex shows that the font cmsy10.pfb is used (same as with 11pt and 12pt)!

Why does this happen? And how could one fix the problem? (For some preliminary testing the method with unchanged filenames is rather tempting since in principle it's very simple.)

share|improve this question
    
I think the cmr10.tfm might be included in the format file, so it isn't really looked for as a file. Try fmtutil --all, but you have to make sure your changed cmr10.tfm is found then. Note that you're breaking your TeX distribution this way, be sure to unbreak it again later. –  Stephan Lehmke Jun 14 '12 at 17:27
    
@Stephan: Thanks for telling me about fmtutils! I can't really do fmtutil --all since I'm a user with restricted rights on a machine that is centrally administrated. –  Hendrik Vogt Jun 14 '12 at 17:30
1  
fmtutil is the version for users (putting things in your home directory). Your admin will be using fmtutil-sys. –  Stephan Lehmke Jun 14 '12 at 17:42
    
@Stephan: Ah, OK. I'm still a little afraid that I'll break something in my local texmfs. And: how many (large) files will that produce, and how long will that take? –  Hendrik Vogt Jun 14 '12 at 17:45
1  
I don't know. But changing system default fonts is not a good idea anyway. Why not save under a different name and then use that font? –  Stephan Lehmke Jun 14 '12 at 17:48

1 Answer 1

up vote 6 down vote accepted

cmsy10.tfm is indeed preloaded. The metric file is however read in again when the main font size is not 10pt because the font is used scaled 1095 and scaled 1200 respectively for 11pt and 12pt.

If you rename the modified cmsy10.tfm say to modcmsy10.tfm and do the same changes to cmsy5, cmsy6, cmsy7, cmsy8, cmsy9, cmbsy5, cmbsy6, cmbsy7, cmbsy8, cmbsy9 and cmbsy10, writing

\DeclareFontShape{OMS}{cmsy}{m}{n}{%
      <5><6><7><8><9><10>gen*modcmsy%
      <10.95><12><14.4><17.28><20.74><24.88>modcmsy10%
      }{}
\DeclareFontShape{OMS}{cmsy}{b}{n}{%
      <5><6><7><8><9>gen*modcmbsy%
      <10><10.95><12><14.4><17.28><20.74><24.88>modcmbsy10%
      }{}

in the preamble should bring you on track more easily.

You have also to teach pdftex that the fonts are really the old ones. So you should add to the preamble

\pdfmapline{+modcmsy10 CMSY10 <cmsy10.pfb}
\pdfmapline{+modcmsy5 CMSY5 <cmsy5.pfb}
\pdfmapline{+modcmsy6 CMSY6 <cmsy6.pfb}
\pdfmapline{+modcmsy7 CMSY7 <cmsy7.pfb}
\pdfmapline{+modcmsy8 CMSY8 <cmsy8.pfb}
\pdfmapline{+modcmsy9 CMSY9 <cmsy9.pfb}
\pdfmapline{+modcmbsy10 CMBSY10 <cmbsy10.pfb}
\pdfmapline{+modcmbsy5 CMBSY5 <cmbsy5.pfb}
\pdfmapline{+modcmbsy6 CMBSY6 <cmbsy6.pfb}
\pdfmapline{+modcmbsy7 CMBSY7 <cmbsy7.pfb}
\pdfmapline{+modcmbsy8 CMBSY8 <cmbsy8.pfb}
\pdfmapline{+modcmbsy9 CMBSY9 <cmbsy9.pfb}

You may also save a file modcmsy.map with the following contents

modcmsy10 CMSY10 <cmsy10.pfb
modcmsy5 CMSY5 <cmsy5.pfb
modcmsy6 CMSY6 <cmsy6.pfb
modcmsy7 CMSY7 <cmsy7.pfb
modcmsy8 CMSY8 <cmsy8.pfb
modcmsy9 CMSY9 <cmsy9.pfb
modcmbsy10 CMBSY10 <cmbsy10.pfb
modcmbsy5 CMBSY5 <cmbsy5.pfb
modcmbsy6 CMBSY6 <cmbsy6.pfb
modcmbsy7 CMBSY7 <cmbsy7.pfb
modcmbsy8 CMBSY8 <cmbsy8.pfb
modcmbsy9 CMBSY9 <cmbsy9.pfb

and call \pdfmapfile{+modcmsy.map}, which would have the same effect. The file can be in any place where pdftex looks for map files. For instance, with TeX Live on a GNU/Linux system it can be

~/texmf/fonts/map/modcmsy/modcmsy.map

Similarly, you can store the modified modcmsy10.tfm file as

~/texmf/fonts/tfm/modcmsy/modcmsy10.tfm

(and the others in the same directory). The \DeclareFontShape instruction can go, together with the \pdfmapfile line in a custom .sty package, say

~/texmf/tex/latex/modcmsy/modcmsy.sty
share|improve this answer
    
Thanks for your answer and for telling me what's happening! I tried your solution (so far only with all the cmsy fonts, not cmbsy), but when I compiled with pdflatex, I got kpathsea: Running mktexpk --mfmode / --bdpi 600 --mag 1+0/600 --dpi 600 modcmsy10, followed by mktexpk: don't know how to create bitmap font for modcmsy10. So would I need to create even more files? –  Hendrik Vogt Jun 15 '12 at 9:30
    
@HendrikVogt Right! You have also to teach pdftex that these fonts are actually the same as before. I'll add it. –  egreg Jun 15 '12 at 9:41
    
Great! This is everything but short, but I'm very happy that it can be done just by adding something to the preamble. I feared that I'd have to create some map file and use updmap, which I badly wanted to avoid for some temporary testing. I didn't know of \pdfmapline! –  Hendrik Vogt Jun 15 '12 at 9:53
    
Wow, only now I read your edit regarding \pdfmapfile - that's even better than \pdfmapline. Thanks again! –  Hendrik Vogt Mar 27 '13 at 12:46

Your Answer

 
discard

By posting your answer, you agree to the privacy policy and terms of service.

Not the answer you're looking for? Browse other questions tagged or ask your own question.