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.



fontspeccan 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. – Marc van Dongen Dec 11 '12 at 8:20\usepackage [charter] {mathdesign}beforefontspecin your preamble? I don't have myriad pro but it should work in otherotffonts. – hpesoj626 Dec 11 '12 at 8:24\titleformatcommand (from thetitlesecpackage) 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. – GTK Dec 11 '12 at 8:29\setmainfontas usual – Herbert Dec 11 '12 at 8:39