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 am using Minion Pro for my document's main font and would like to use Consolas for my code listings.

I know that I can set the monospace font using fontspec and setmonofont, but it seems I cannot use fontspec in conjunction with the MinionPro and MnSymbol packages that I use to set my document's main font.

I do not want to use fontspec to set my main font, since headings in all-caps and small-caps do not render as nicely as with the MinionPro package.

My question: Is there a way I can use the MinionPro package to set my main font and tell fontspec to 'ignore' the main font and just set the monofont. Else, is there another way to do what I'm trying to achieve?

share|improve this question
add comment

3 Answers

up vote 9 down vote accepted

I suggest you load MinionPro with onlymath option. As far as I understand it, MnSymbol is mainly used for math.

Use \setmainfont of fontspec to set Minion Pro As the math font. The problem with all caps and small caps is because MinionPro optimized the spacing while fontspec won't do it for you automatically. But the solution is simple, use \addfontfeatures{WordSpace=...} feature of fontspec. Also Kerning=Uppercase will enable the cpsp opentype feature though I don't find its space is enough for all caps title.

Indeed I used MinionPro package for quite a long time. But the only reason stopped me for switching to fontspec before is the lack of support of microtype in xetex. Now I use fontspec and LuaTeX exclusively. This is a better solution than MininonPro since you can access features like case easily, which will select right punctuations when typeset in all caps. And much more.

For Minion Pro font, however, I found that it has a few problems with fontspec. At least on my Mac, there are issues for fontspec to select correct weight and optical sizes. See https://github.com/wspr/fontspec/issues/105.

In my case the medium weight cause fontspec or luatex confused. So I added the following to otfl-blacklist.cnf.

MinionPro-Medium.otf
MinionPro-MediumCapt.otf
MinionPro-MediumSubh.otf
MinionPro-MediumDisp.otf

And used the following to setup my fonts to get correct optical size.

\setmainfont[
SizeFeatures = {
  {Size =     -8.41, OpticalSize = 8},
  {Size = 8.41-13.1, OpticalSize = 11},
  {Size = 13.1-20.0, OpticalSize = 19},
  {Size = 20.0-,     OpticalSize = 72}},
Ligatures          = {Required, Common, Contextual, TeX},
Numbers            = {OldStyle, Proportional},
RawFeature         = {expansion  = default},
UprightFeatures    = {RawFeature = {protrusion = mnr}},
BoldFeatures       = {RawFeature = {protrusion = mnrb}},
ItalicFeatures     = {RawFeature = {protrusion = mni}},
BoldItalicFeatures = {RawFeature = {protrusion = mnib}}
]{Minion Pro}

where mnr, mnrb, etc are protrusion settings I wrote based on MinionPro package's

share|improve this answer
add comment

You can try the mathspec package:

\documentclass[a4paper]{article}
\usepackage{amsmath}
\usepackage{mathspec}
\setmathfont(Digits,Latin,Greek){Minion Pro}
\setmainfont{Minion Pro}
\setmonofont{Inconsolata}
\usepackage{MnSymbol}
\begin{document}

a$\alpha\sum b=c$\texttt{aaa}
\end{document}

I didn't do extensive tests, however.

share|improve this answer
add comment

I cannot see any Problem

\listfiles
\documentclass{scrartcl}
\usepackage{fontspec}
\setmainfont{Minion Pro}
\setsansfont{Myriad Pro}
\setmonofont{Consolas}
\usepackage{listings}
\begin{document}

Mininpro \textsf{Myriad Pro} \texttt{Consolas}

\begin{lstlisting}[basicstyle=\ttfamily\small]
\setmainfont{Minion Pro}
\setsansfont{Myriad Pro}
\setmonofont{Consolas}
\end{lstlisting}

\end{document}
share|improve this answer
add comment

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.