I would like to use both the KP Fonts package for the serif font in the main body of the text and Myriad Pro for the sans serif font to be used in section headers etc.

\documentclass[11pt]{scrreprt}
\usepackage{fancyhdr}
\usepackage{fontspec}

\usepackage{kpfonts}
\usepackage[lite]{mtpro2}

\begin{document}

\chapter{Introduction}
\noindent For any integer $n$ and prime number $p$, we want to solve $x^2 - ny^2 = p$. In this equation it is evident that...
\end{document}


I've tried swapping around the lines \usepackage{kpfonts} and \setsansfont{Myriad Pro} but I cannot seem to get the desired sans-serif and serif fonts to work at the same time. Any help much appreciated, as always.

• Real quick: What are you trying to achieve by loading the mtpro2 package, which supplies a Times Roman math font, after the kpfonts package, which supplies Palatino text and math fonts? Do you really want to have Palatino for ordinary running text, Times Roman for math, and Myriad Pro for sectioning headers? – Mico Sep 8 '18 at 17:23
• Please also advise whether you use XeLaTeX or LuaLaTeX. – Mico Sep 8 '18 at 17:28
• Yes, I do. Also, I am using LuaLaTeX – wrb98 Sep 8 '18 at 20:58
• Consider using either mathspec to use your modern text font for letters in math mode, or unicode-math with a matching math font such as Asana Math (based on pxfonts) or TeX Gyre Patella Math. – Davislor Sep 8 '18 at 23:45

If I understand your setup correctly, you use LuaLaTeX and wish to use mtpro2 for math fonts, Palatino as the main serif text font, and Myriad Pro as the sans-serif text font.

Actually, you mentioned wanting to use the kpfonts package, which provides both text and math fonts that are based on Palatino. However, unless you really need to employ the "distressed look" of the letters E, F, and T (something that's provided by the kpfonts package), you might as well load "just" a Palatino text-only font using a \setmainfont directive, since you won't be using the math fonts of the kpfonts package.

If this interpretation is on target, the following code should work for you.

\documentclass[11pt]{scrreprt}
\usepackage{fancyhdr}
\usepackage[lite]{mtpro2} % load 'mtpro2' before 'fontspec'
\usepackage[no-math]{fontspec}
\setmainfont{Palatino}
\begin{document}

\chapter{Introduction}
For any integer $n$ and prime number $p$, we want to
solve $x^2 - ny^2 = p$. In this equation it is evident
that \dots
\end{document}


Addendum: As @Davislor points out in a comment, the exact names of the fonts may depend on your system. Under MacOS, Palatino is a system font and hence is available by that name to fontspec. If you are running Windows 2000 or later, or have installed Office 2003, chances are that you have Palatino Linotype. (And if you run another OS but have a Windows partition mounted, you might be able to find / -name "pala*.ttf" -print and put symlinks in a local font directory such as /usr/local/share/fonts/ or a personal one.) Finally, if you have upgraded your TeX distribution in the last decade, you should have TeX Gyre Pagella, another Palatino clone. If it’s older than that, you might have URW Palladio. (There is also a particularly large number of Palatino knock-offs, including Microsoft’s Book Antiqua.)

• If the OP is not on a Mac, Palatino is probably not installed under that name. TeX Gyre Pagella certainly will be in your TeX installation, but you will have Palatino Linotype if there is a copy of Windows or MS Office on your system. You probably want to liad it with [Ligatures = {Common, Discretionary, TeX}]. – Davislor Sep 8 '18 at 23:43
• Hi, Mico can I ask a question please? – Sebastiano Sep 9 '18 at 8:25
• @Davislor - Nice edit! :-) – Mico Sep 9 '18 at 22:30
• @Mico Thanks! Also for getting me to re-read it, since it had a typo. – Davislor Sep 9 '18 at 22:32