# How do I make en/em dashes work in Myriad when using it with MinionPro

I'm using MinionPro for the body of a document and Myriad for figure/table captions. Because I can't load packages MinionPro and Myriad at the same time, I load the Myriad fonts for the sans-serif fonts using a \renewcommand{\sfdefault}{\Myriad-LF} call in the preamble. Then I set the figure/table captions to use the sans-serif font using package caption.

This works great, except that the en dashes (--) and em dashes (---) are not properly interpreted as long dashes; they're displayed as two or three hyphens. A minimal working example is below. Any ideas?

\documentclass[12pt]{article}

% Set fonts (Minion Pro, Myriad):
\usepackage[lf]{MinionPro} % 'lf' option to use full-height (lining) figures

% We can't use package Myriad here as it conflicts with MinionPro, so
% Set body sans serif (\textsf) text to Myriad with lining figures:

% Set math sans serif (\mathsf) alphabet to Myriad with lining figures:

\usepackage[margin=10pt,font={small,sf},labelfont={sf,bf},labelsep=endash]{caption}

\begin{document}
Some text.
\begin{figure}
\centering
\ldots
\caption{The mass of the coal storage piles ranged from 8--20 megatonnes.}
\label{fig:coal}
\end{figure}
\end{document}


This outputs the following, with the incorrect dash highlighted.

• You can use MinionPro and MyriadPro together! Use the onlytext option of MyriadPro, which is default in a recent version. – sebschub Aug 7 '13 at 16:45
• @sebschub care to provide an answer to take this oldie off the unanswered list? – Paul Gessler Apr 19 '15 at 1:24

The packages MinionPro and MyriadPro from FontPro can be used together. By default, the math font is not changed by MyriadPro. With the sansmath option, the sans serif of \mathsf is adjusted and an additional math version is defined to allow two math fonts with matching math symbols in one document (see the documentation for that).

Thus, the code

\documentclass[12pt]{article}

% Set fonts (Minion Pro, Myriad Pro):
\usepackage[lf]{MinionPro} % 'lf' option to use full-height (lining) figures

\usepackage{caption}
\DeclareCaptionFont{sfmath}{\mathversion{sans}}
\captionsetup{margin=10pt,font={small,sf, sfmath},labelfont={sf,bf},labelsep=endash}

\begin{document}

Some text with $a \times \mathsf{b} = c / d$.

\begin{figure}[h]
\centering
\ldots
\caption{The mass of the coal storage piles ranged from 8--20
megatonnes and $a \times b = c / d$.}
\label{fig:coal}
\end{figure}
\end{document}


produces the following output: