[Tex/LaTex] Using the fonts from the pxfonts package with fontspec

fontsfontspec

I've been using the pxfonts package to typeset my document since I liked the look of the text fonts. I now have cause to use the fontspec package but now my favoured pxfonts don't load. I'm getting the LaTeX warning that it is substituting "EU2/lmr/m/n" for "EU2/pxr/m/n".

I suspect the issue is that I'm too new to fontspec and don't know what I'm doing. (Also using LuaLaTeX for the first time, but I think that's not so much the cause of the problem.)

What's the right way to load these "pxr" fonts using fontspec?… Clearly the pxfonts package is not it. (I will have a very small amount of maths also, so I'll need the relevant maths fonts loaded too.)

Sorry if this is well trodden ground – I looked at other questions that arose when I searched for "pxfonts fontspec" but I couldn't make enough sense of what was being said to answer my question.

Best Answer

pxfonts is not “officially” deprecated, but it is so “typographically”, because there are several flaws in its design. Such flaws have brilliantly been fixed by Michael Sharpe who provided the package newpxtext and newpxmath instead.

However, newpxtext isn't compatible with fontspec, because it's based on “classical” 256 slot fonts.

You can obtain a very similar result using newpxmath for math fonts and a Palatino based text font:

\documentclass{article}

\usepackage{newpxmath} % math font is Palatino compatible
\usepackage[nomath]{fontspec}

\setmainfont{TeX Gyre Pagella} % or another Palatino OpenType clone
Related Question