3

This question is exactly the same as this one, but for Mac OS. My error is:

Font OT1/pcr/m/n/9=pcrr7t at 9.0pt not loadable: Metric (TFM) file not found

So I tried the answer in the linked question. My missing file is pcrr7t.tfm. When I tried tlmgr search --file pcrr7t.tfm, it is found in:

courier:  
texmf-dist/fonts/tfm/adobe/courier/pcrr7t.tfm

Therefore, I tried to install courier with sudo tlmgr install courier. It turned out I already have courier.

tlmgr: package repository http://ctan.mirrorcatalogs.com/systems/texlive/tlnet
tlmgr install: package already present: courier

But then why I can't compile the tex file. Thanks in advance.


UPDATE

This error (and some others of the same kind) only occurs when I run pdflatex draft.tex. I can compile OK with TeXShop. But I only want to run from command line.

sean
  • 1,065
  • Just in case (I already met a similar problem with MiKTeX on Windows): run initexmf --mkmaps from the command line. It might a problem with the psfonts database (psfonts.map and the like). Also check if the font is mentioned in updmap.cfg. – Bernard Oct 06 '15 at 22:11
  • Can you try sudo mktexlsr? – egreg Oct 06 '15 at 22:18
  • @egreg: yes, the problem persists. – sean Oct 06 '15 at 22:24
  • 1
    Try sudo tlmgr install --reinstall courier – egreg Oct 06 '15 at 22:27
  • @egreg I just did, the problem persists :-( – sean Oct 06 '15 at 22:28
  • I guess you have two installations of TeX Live. What does which pdftex return? – egreg Oct 06 '15 at 22:30
  • @egreg I don't think so. Here is the path: /opt/local/bin/pdftex – sean Oct 06 '15 at 22:36
  • What does which tlmgr return? – cfr Oct 06 '15 at 22:43
  • @qsp That means the terminal is using TeX Live from MacPorts; are you sure TeXShop does the same? Note that tlmgr is not provided by the MacPorts distribution, so it will update the MacTeX distribution. – egreg Oct 06 '15 at 22:44
  • @cfr: perhaps egreg is right, I have /Library/TeX/texbin/tlmgr – sean Oct 06 '15 at 22:49
  • @egreg: yes, I installed from MacPorts. Could you tell me how I can check which pdftex TeXShop is using. Please tolerate my stupidity, I have just started using Mac 3 days ago (a machine from my project). – sean Oct 06 '15 at 22:52
  • @qsp Do a very simple thing: remove the MacPorts TeX Live. – egreg Oct 06 '15 at 22:54
  • @egreg: I removed it, and the command line now works like a charm. Thank you very much. Could you please turn your comment to an answer so I can close this question :) Or should I delete this question, because it is too trivial (not for me though). – sean Oct 06 '15 at 23:01

1 Answers1

2

This seems a problem due to having two distinct TeX Live distributions (which was confirmed in the comments).

You seem to have both a MacTeX provided TeX Live, which is the one used by TeXShop by default (the binaries are in /usr/local/texlive/2015/bin/x86_64-darwin, with a symbolic link at /Library/TeX/texbin, which is added to the PATH environment variable) and also the MacPorts one, that installs its binaries in /opt/local/bin.

Note that the latter distribution doesn't provide tlmgr, so this program is executed from the MacTeX binaries. However, MacPorts places /opt/local/bin high in the PATH variable, so when you run pdflatex from the terminal, the MacPorts binary is used (and the TeX tree corresponding to it). To the contrary, TeXShop is usually configured to run the binaries in /Library/TeX/texbin.

So, running tlmgr does no good to the MacPorts distribution, that has its own package manager.

I know, this looks complicated, but there's a very easy solution: get rid of the TeX Live provided by MacPorts.

egreg
  • 1,121,712
  • I have the same problem after installing a 2016 version of MacTex on Mac OS 10.9.5 for use with TexMaker 4.5 (see this question). I think that a second distribution can be present that causes the problem of the missing TFM file. So far, I have found the correct distribution in HD/Library/TeX, but I cannot find the other one (opt/local/bin - there is no folder opt, even after showing the hidden files and folders in finder). – Karlo Aug 03 '17 at 18:12