
私は、TeX Gyre フォント (特に Pagella と Pagella Math) を LaTeX+dvips+ps2pdf で使用したいと考えています。将来的にはこれを PSTricks で使用したいのですが、まずはフォントの問題を解決する必要があります。
私はLaTeX+dvips+ps2pdfにこのコードを使用します
\documentclass{article}
\usepackage[utf8]{inputenc}
\usepackage[T1]{fontenc}
\usepackage{tgpagella}
\begin{document}
Test in Pagella
\[\sum_{k=1}^n k=\frac{n(n+1)}{2}\]
\end{document}
TeX Gyre Pagellaのテキストを含むPDFファイルを生成します。しかしComputer Modern の数学 (スクリーンショットを参照)
コードを次のように変更すると
\documentclass{article}
\usepackage{fontenc,unicode-math}
\setmainfont[Ligatures=TeX]{TeX Gyre Pagella}
\setmathfont[Ligatures=TeX]{TeX Gyre Pagella Math}
\begin{document}
Test in Pagella
\[\sum_{k=1}^n k=\frac{n(n+1)}{2}\]
\end{document}
そしてDVIモードでLuaLaTeXで処理するとうまくいきます。しかしdvips
その後実行すると次のエラーが発生します。
This is dvips(k) 5.992 Copyright 2012 Radical Eye Software (www.radicaleye.com)
' LuaTeX output 2013.04.01:1811' -> template-pstricks.ps
kpathsea: Invalid fontname `name:TeXGyrePagella:mode=node;script=latn;language=DFLT;+tlig;+trep;', contains ':'
dvips: Font name:TeXGyrePagella:mode=node;script=latn;language=DFLT;+tlig;+trep; not found; using cmr10
</usr/local/texlive/2012/texmf-dist/fonts/pk/ljfour/public/cm/dpi600/cmr10.pk>kpathsea: Invalid fontname `name:TeXGyrePagellaMath:mode=base;script=math;language=DFLT;+tlig;+trep;+ssty=1;', contains ':'
dvips: Font name:TeXGyrePagellaMath:mode=base;script=math;language=DFLT;+tlig;+trep;+ssty=1; not found; using cmr10
</usr/local/texlive/2012/texmf-dist/fonts/pk/ljfour/public/cm/dpi600/cmr10.pk>
dvips: ! invalid char 119899 from font name:TeXGyrePagellaMath:mode=base;script=math;language=DFLT;+tlig;+trep;+ssty=1;
dvips は OpenType フォントを処理できないことは理解していますが、TeX Gyre Pagella、特に TeX Gyre Pagella Math を PSTricks と一緒に使用するにはどうすればよいでしょうか? LaTeX または LuaLaTeX ソリューションがあれば大変助かります。
答え1
auto-pst-pdf
コードに追加することで問題を解決しました
\documentclass{article}
\usepackage{auto-pst-pdf}
\usepackage{fontenc,unicode-math}
\setmainfont[Ligatures=TeX]{TeX Gyre Pagella}
\setmathfont[Ligatures=TeX]{TeX Gyre Pagella Math}
\begin{document}
Test in Pagella
\[\sum_{k=1}^n k=\frac{n(n+1)}{2}\]
\end{document}
これをコンパイルすると、lualatex -shell-escape file.tex
TeX Gyre Pagella と TeX Gyre Pagella Math だけを含む次の出力が生成されます。
このヒントを提供してくれた @egreg に大いに感謝します。
@Ulrike Fischer のコメントにより改善されました
明らかに、私が望んだように問題を解決する方法はないので、もう一度コードを編集しました
\documentclass{article}
\usepackage{pstricks}
\usepackage{xltxtra}
\usepackage{xunicode}
\usepackage{fontenc}
\usepackage{unicode-math}
\setromanfont[Ligatures=TeX]{texgyrepagella-regular.otf}
\setmathfont[Ligatures=TeX]{texgyrepagella-math.otf}
\begin{document}
Test in Pagella
\[\sum_{k=1}^n k=\frac{n(n+1)}{2}\]
\begin{pspicture}(3,3)
\psline{->}(1,1)(3,2)
\psline{->}(1,1)(3,1)
\rput(2,2){$x$}
\end{pspicture}
\end{document}
これを処理することでxelatex file.tex
、TeX Gyre PagellaとPagella Mathを含む必要なPDFファイルが生成されます。
ヒントを提供してくれた @egreg と @Ulrike Fischer に感謝します。さらなる改善を歓迎します。学ぶべきことがたくさんあると思います。