
[背景: スペースと忍耐力が尽きたので、システムドライブを消去してCatalinaをゼロから再インストールしました。現在、まだ使用しているすべてのアプリケーションを1つずつ再インストールしています。] MacTexをhttp://www.tug.org/mactex/mactex-download.html概ね動作しますが、追加の非フリーフォントである Sabon をインストールする必要があります。このフォントのライセンスと関連ファイルを持っています。数年前のメモによると、(Sabon 関連のファイルを含むディレクトリ構造を含む、私が準備した sabon2.tgz ファイルを考えると) に個人用の texmf ディレクトリを作成する必要があります~/Library/texmf/
。そこには、
tar zxvf sabon2.tgz
texhash
updmap --enable Map=psb.map
このレシピは、Linux で機能したものをアレンジしたもので、2017 年頃には Mac でもうまく機能していました。その間に何か変更したとしても、書き留めるのを忘れていました。しかし、今日自分で手順を試してみたところ、うまくいきませんでした。Texhash によると、多数のディレクトリが書き込み不可とのことでした。
$ texhash
texhash: /usr/local/texlive/2020/texmf-config: directory not writable. Skipping...
texhash: /usr/local/texlive/2020/texmf-dist: directory not writable. Skipping...
texhash: /usr/local/texlive/2020/texmf-var: directory not writable. Skipping...
texhash: /usr/local/texlive/texmf-local: directory not writable. Skipping...
texhash: Done.
私はtexhashをsudoで実行することでこれを回避しましたが、それが正しいやり方だったかどうかはわかりません。FAQ QM05https://tug.org/mactex/faq/faq.html#qm05~/Library/texmf にファイルを追加するときに texhash を実行する必要はないと書かれているので、この手順は 2020 年には不要になったと推測します。では、次に進みます。次の失敗:
$ updmap --enable Map=psb.map
updmap [ERROR]: Either -sys or -user mode is required.
updmap [ERROR]: In nearly all cases you should use updmap -sys.
updmap [ERROR]: For special cases see https://tug.org/texlive/scripts-sys-user.html
エラーメッセージに従って -sys を追加します...
$ updmap -sys --enable Map=psb.map
updmap will read the following updmap.cfg files (in precedence order):
/usr/local/texlive/2020/texmf-dist/web2c/updmap.cfg
updmap may write changes to the following updmap.cfg file:
/usr/local/texlive/2020/texmf-config/web2c/updmap.cfg
updmap: can't write to /usr/local/texlive/2020/texmf-config/web2c/updmap.cfg: Permission denied at /Library/TeX/texbin/updmap line 1589.
...しかし、再び権限エラーが発生します。ここでも、sudo を追加して再試行します。
$ sudo updmap -sys --enable Map=psb.map
updmap [WARNING]: resetting $HOME value (was /Users/XXX) to root's actual home (/var/root).
updmap will read the following updmap.cfg files (in precedence order):
/usr/local/texlive/2020/texmf-dist/web2c/updmap.cfg
updmap may write changes to the following updmap.cfg file:
/usr/local/texlive/2020/texmf-config/web2c/updmap.cfg
Creating new config file /usr/local/texlive/2020/texmf-config/web2c/updmap.cfg
dvips output dir: "/usr/local/texlive/2020/texmf-var/fonts/map/dvips/updmap"
pdftex output dir: "/usr/local/texlive/2020/texmf-var/fonts/map/pdftex/updmap"
dvipdfmx output dir: "/usr/local/texlive/2020/texmf-var/fonts/map/dvipdfmx/updmap"
updmap [ERROR]: The following map file(s) couldn't be found:
updmap [ERROR]: psb.map (in /usr/local/texlive/2020/texmf-config/web2c/updmap.cfg)
updmap [ERROR]: Did you run mktexlsr?
You can disable non-existent map entries using the option
--syncwithtrees.
updmap が psb.map を見つけられなかった理由は、psb.map がユーザーの ~/Library/texmf にあるためだと思いますが、updmap を root として実行すると、その場所を検索しません。一方、私として実行すると、ファイルを更新できません。
この質問のおかげで、ローカルフォントのインストールの問題スペースなしで updmap-sys と記述でき、sudo なしでも機能することがわかりました。
$ updmap-sys --enable Map=psb.map
updmap will read the following updmap.cfg files (in precedence order):
/usr/local/texlive/2020/texmf-config/web2c/updmap.cfg
/usr/local/texlive/2020/texmf-dist/web2c/updmap.cfg
updmap may write changes to the following updmap.cfg file:
/usr/local/texlive/2020/texmf-config/web2c/updmap.cfg
/usr/local/texlive/2020/texmf-config/web2c/updmap.cfg unchanged. Map files not recreated.
updmap: Updating ls-R files.
そして、そのファイルには「Map psb.map」という 1 行が含まれるようになりました。
$ cat /usr/local/texlive/2020/texmf-config/web2c/updmap.cfg
Map psb.map
しかし、Sabonを使用した正常なTexファイルをコンパイルすると、
$ pdflatex test.tex
...
kpathsea: Running mktexpk --mfmode / --bdpi 600 --mag 1+264/600 --dpi 864 psbb8r
mktexpk: don't know how to create bitmap font for psbb8r.
mktexpk: perhaps psbb8r is missing from the map file.
kpathsea: Appending font creation commands to missfont.log.
(see the transcript file for additional information)
!pdfTeX error: pdflatex (file psbb8r): Font psbb8r at 864 not found
==> Fatal error occurred, no output PDF file produced!
そもそも、なぜビットマップ フォントを作成したいのでしょうか。とにかく、ベクター フォントが欲しいだけです。もう 20 世紀ではありません。
何が欠けていて、代わりに何をすべきでしょうか?
答え1
コメントで議論した結果、最善の解決策は、TEXMFLOCAL
(ここ、/usr/local/texlive/texmf-local
) ではなく、TEXMFHOME
(ここ、~/Library/texmf
) ディレクトリ内のファイルを解凍することでした。
MacTeX FAQ では、ローカル ファイルを後者に置くことを推奨していますが、8 ビット フォント マップは例外です。updmap
ユーザー モードで実行することは絶対に避けてください。これは、システム フォント マップを補足するのではなく上書きする罠であり、システム ツリーを更新するとどんどん古くなります。ただし、updmap-sys
は検索しませんTEXMFHOME
。