LaTeXの日本語にヒラギノを適用する
#!/bin/sh
{
echo "LaTeX -> Hiragino"
# clear any previous sudo permission
sudo -k
# run inside sudo
sudo sh <<SCRIPT
tlmgr update --self --all
mkdir -p /usr/local/texlive/texmf-local/fonts/opentype/hiragino/
ln -fs "/Library/Fonts/ヒラギノ明朝 Pro W3.otf" "/usr/local/texlive/texmf-local/fonts/opentype/hiragino/HiraMinPro-W3.otf"
ln -fs "/Library/Fonts/ヒラギノ明朝 Pro W6.otf" "/usr/local/texlive/texmf-local/fonts/opentype/hiragino/HiraMinPro-W6.otf"
ln -fs "/Library/Fonts/ヒラギノ丸ゴ Pro W4.otf" "/usr/local/texlive/texmf-local/fonts/opentype/hiragino/HiraMaruPro-W4.otf"
ln -fs "/Library/Fonts/ヒラギノ角ゴ Pro W3.otf" "/usr/local/texlive/texmf-local/fonts/opentype/hiragino/HiraKakuPro-W3.otf"
ln -fs "/Library/Fonts/ヒラギノ角ゴ Pro W6.otf" "/usr/local/texlive/texmf-local/fonts/opentype/hiragino/HiraKakuPro-W6.otf"
ln -fs "/Library/Fonts/ヒラギノ角ゴ Std W8.otf" "/usr/local/texlive/texmf-local/fonts/opentype/hiragino/HiraKakuStd-W8.otf"
ln -fs "/System/Library/Fonts/ヒラギノ明朝 ProN W3.otf" "/usr/local/texlive/texmf-local/fonts/opentype/hiragino/HiraMinProN-W3.otf"
ln -fs "/System/Library/Fonts/ヒラギノ明朝 ProN W6.otf" "/usr/local/texlive/texmf-local/fonts/opentype/hiragino/HiraMinProN-W6.otf"
ln -fs "/Library/Fonts/ヒラギノ丸ゴ ProN W4.otf" "/usr/local/texlive/texmf-local/fonts/opentype/hiragino/HiraMaruProN-W4.otf"
ln -fs "/System/Library/Fonts/ヒラギノ角ゴ ProN W3.otf" "/usr/local/texlive/texmf-local/fonts/opentype/hiragino/HiraKakuProN-W3.otf"
ln -fs "/System/Library/Fonts/ヒラギノ角ゴ ProN W6.otf" "/usr/local/texlive/texmf-local/fonts/opentype/hiragino/HiraKakuProN-W6.otf"
ln -fs "/Library/Fonts/ヒラギノ角ゴ StdN W8.otf" "/usr/local/texlive/texmf-local/fonts/opentype/hiragino/HiraKakuStdN-W8.otf"
mktexlsr
updmap-sys --setoption kanjiEmbed hiragino
SCRIPT
}