I like the mathdesign
package, but would like to use Myriad Pro section headings in LuaLaTeX
. Is this possible, or do I have to convert an OTF font to T1? (My ignorance of font issues in *TeX is boundless.) The \setsansfont
command and mathdesign
packages seem not to work together, though there is no mention of fontspec within mathdesign. Here's a MWE that shows what doesn't work when running through LuaLaTeX.
\documentclass{article}
\usepackage [english] {babel}
\usepackage {blindtext}
\usepackage {titlesec}
\usepackage {etoolbox}
\usepackage {ifluatex}
\titleformat{\section}{\Large\sffamily\bfseries}{\thesection}{1em}{}
\ifbool{luatex} {
\usepackage {fontspec}
\setsansfont [Ligatures=TeX,Scale=MatchLowercase] {Myriad Pro}
\usepackage [charter] {mathdesign}
}{\usepackage [T1] {fontenc}
\usepackage [charter] {mathdesign}
\renewcommand*{\sfdefault}{phv} % Adobe Helvetica
}
\begin{document}
\section {A section}
\blindmathpaper
\end{document}
The beginning of that document looks as follows (note the lack of sans serif section heading)
If I load the mathdesign
package before fontspec
I get the correct section heading font, but the rmdefault
font switches to CM.
Interestingly, the math font remains Charter in all cases.
fontspec
can do. You need to redefine the heading commands and letting the redefined commands set the headings in sans serif withfontspec
. To redefine the headers you can use a package but it may depend on which headers you want to redefine.\usepackage [charter] {mathdesign}
beforefontspec
in your preamble? I don't have myriad pro but it should work in otherotf
fonts.\titleformat
command (from thetitlesec
package) to set them in sans serif. At least that's what the intent is, and it works right up until (and unless) I use fontspec and mathdesign together.\setmainfont
as usual