These option clashes happen when a package is requested to be loaded on two different positions, like by you and inside another package, but with different options. The package is loaded by the first \usepackage
(or its twin \RequirePackage
); it isn't loaded again when it is requested again. It simply can't be loaded a second time. Therefore the new options can be activated and previous options might conflict with the second usage. So LaTeX creates an error to report this issue to you.
The way to fix this is to declare the options beforehand using \PassOptionsToPackage{<options>}{<package>}
. Then they are used wherever the package is loaded.
\documentclass{article}
\usepackage{ifpdf}
\ifpdf
\PassOptionsToPackage{pdftex,usenames,dvipsnames}{color}
\usepackage[T1]{fontenc}
\usepackage{libertine} % most likely loads 'color' itself
%\usepackage{lmodern} % doesn't load 'color'
\usepackage{color}
\usepackage[pdftex]{graphicx}
\else
%\bye
\fi
\begin{document}
Hello, world!
\end{document}
I can't test it by myself, because I don't have the libertine
package installed.
PS:
I don't think you need to set pdftex
manually. Normally packages do a good job recognizing the driver by themselves. Also you might want to use the extended xcolor
package instead of color
.
Using unicode-math
:
\usepackage{amsmath} % always load before mathspec or unicode-math
\usepackage[math-style=ISO]{unicode-math} % try sans-style=upright
\defaultfontfeatures{Scale=MatchLowercase,Mapping=tex-text}
\setmainfont[Numbers={OldStyle,Proportional},SmallCapsFeatures={LetterSpace=6},%
BoldFont={Myriad Pro Bold},BoldFeatures={LetterSpace=3}]{Minion Pro}
\setsansfont[Numbers={OldStyle,Proportional},LetterSpace=3]{Myriad Pro}
\setmonofont{Crystal}
\setmathfont{xits-math.otf}
\setmathfont[range=\mathup/{num,latin,Latin,greek,Greek}]{Minion Pro}
\setmathfont[range=\mathsf/{num,latin,Latin,greek,Greek}]{Myriad Pro}
\setmathfont[range=\mathbfsf/{num,latin,Latin,greek,Greek}]{Myriad Pro Bold}
\setmathfont[range=\mathit/{num,latin,Latin,greek,Greek}]%
{Minion Pro Italic}
\setmathfont[range=\mathsfit/{num,latin,Latin,greek,Greek}]%
{Myriad Pro Italic}
\setmathfont[range=\mathbfsfit/{num,latin,Latin,greek,Greek}]%
{Myriad Pro Bold Italic}
\setmathfont[range=\mathtt->\mathup]{Crystal}
\let\mathbf\mathbfsf
\let\mathbfit\mathbfsfit
\AtBeginDocument{\let\phi\varphi}
(N.B. unicode-math
loads fontspec
, xltxtra
, and xunicode
)
mathbb
, mathscr
, &c. all have sensible defaults with this. If you want, say, serifed mathbb
, you could add \setmathfont[range=\mathbb/{Latin}->\mathup,Scale=MatchUppercase]{Hoefler Text Engraved}
. The /{Latin}
part applies it only to uppercase latin letters.
- Use
BoldFont
and BoldFeatures
with fontspec
. For unicode-math
, I just used \let
commands, although I know there's probably a more elegant way to do this.
- Removing
MnSymbol
frees up a lot of math alphabets, and unicode-math
increases the limit.
- Apparently Ubuntu Mono is bugged; I couldn't use it, so I tested with Crystal. And it works.
EDIT: To use Minion for even more symbols, you could replace the \mathup
line with:
\setmathfont[range={\mathup/{num,latin,Latin,greek,Greek},\question,\exclam,\mathdollar,%
\percent,\ampersand,\lparen,\rparen,\plus,\comma,\period,\mathslash,\mathcolon,%
\semicolon,\less,\equal,\greater,\backslash,\rbrack,\lbrack,\atsign,\vert,\lbrace,%
\rbrace,\times,\div}]{Minion Pro}
Best Answer
How to use the condensed fonts of MyriadPro with pdftex
I had much help by Ulrike Fischer and a useful hint by David Carlisle to find this solution:
OK, and it looks like this:
(Old answer deleted)