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.

I want to use the TeX Gyre fonts (especially the Pagella and Pagella Math) with LaTeX+dvips+ps2pdf. In the future I want to use this for PSTricks but first I've to solve my font problems.

I use this code for 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}

It produces a PDF file with the text in TeX Gyre Pagella but the mathematics in Computer Modern (see screenshot)

Screenshot produced by sourcefile

When changing the code to the following

\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}

and processing it with LuaLaTeX in DVI-mode works well. But running dvips afterwards produces the following errors

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;

I understand that dvips can't handle OpenType fonts, but how can I use the TeX Gyre Pagella and especially TeX Gyre Pagella Math together with PSTricks? Either LaTeX or LuaLaTeX solutions would be a great help.

share|improve this question
    
Isn't XeLaTeX an option? It can run PSTricks directly. –  egreg Apr 1 '13 at 16:20
    
XeLaTeX would be my "worst case solution". But if there's a solution with LaTeX or LuaLaTeX, I'd enjoy much more. –  Stephan Lukasczyk Apr 1 '13 at 16:22
1  
auto-pst-pdf? –  egreg Apr 1 '13 at 16:30

1 Answer 1

up vote 3 down vote accepted

I've now solved the problem with adding auto-pst-pdf to the code

\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}

And compiling it with lualatex -shell-escape file.tex produces the following out put containing just TeX Gyre Pagella and TeX Gyre Pagella Math.

Screenshot of correct result

Great thanks to @egreg for providing this hint.

Improved due to @Ulrike Fischer's comment

There is obiously no way to solve the problem as I wanted, so I edited my code once again

\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}

Processing it with xelatex file.tex produces the wanted PDF-file, containing the TeX Gyre Pagella and Pagella Math

Screenshot of processed code with xelatex

Thanks to @egreg and @Ulrike Fischer for their hints. More improvement is welcome, I think there's a lot to learn for me.

share|improve this answer
3  
Well you are actually not making use of auto-pst-pdf in this example: It doesn't contain any pstricks pictures which try to use your fonts. As soon as you add them you will run in the same problem: auto-pst-pdf uses dvips+ps2pdf to convert the pictures, and dvips can't handle open type fonts. The only way to handle pstricks pictures which use open type fonts is to use xelatex. –  Ulrike Fischer Apr 1 '13 at 17:21
    
Thank you @UlrikeFischer. So my answer is not a real answer to my question, when using PSTricks. I'll try to get it work with XeLaTeX and improve to answer afterwards. –  Stephan Lukasczyk Apr 1 '13 at 17:52
    
Btw, is TikZ working with LuaLaTeX? –  Stephan Lukasczyk Apr 2 '13 at 15:08
1  
Yes, TikZ works fine with lualatex. –  Ulrike Fischer Apr 2 '13 at 15:49

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.