1

Can someone help with option clash for package fontspec? I'm compiling by using XeLaTeX in TeXmaker 5.0.3. I get this error and I don't see preview in program, however PDF is producing.

\documentclass[12pt]{article}
\usepackage{fontspec}
\usepackage{mathspec}
\usepackage[T1]{fontenc}
\usepackage[polish]{babel}
\usepackage[utf8]{inputenc}
\usepackage{lmodern}
\usepackage{cancel}
\selectlanguage{polish}
\usepackage{multicol}
\usepackage{geometry}
\geometry{lmargin=30mm, rmargin=20mm, tmargin=30mm, bmargin=30mm, foot=10mm, head=10mm}
\setmainfont{Segoe Print}

\setmathsfont(Digits){Segoe Print}
\setmathsfont(Latin){Segoe Print}
\setmathrm{Segoe Print}
\begin{document}
\setlength\columnsep{1cm}
\begin{multicols}{2}
$y=x^{100}\ln x$
\columnbreak\\
$\leftarrow$ gdy nie ma idealnego działania między funkcjami to między tymi funkcjami występuje działanie mnożenia/iloczyn
\end{multicols}
\end{document}
  • Remove fontspec if you’re including mathspec. Remove fontenc and lmodern if you’re using either. Since mathspec is XeTeX-only, you’re automatically using utf-8 and also want to remove inputenc. Etc. – Davislor Jan 4 at 8:32
  • The proximate cause is probably that mathspec reloads fontspec with different options. – Davislor Jan 4 at 8:35
2

Remove all the unneeded packages. Your preamble should better look like this:

\documentclass[12pt]{article}
\usepackage[polish]{babel}
\usepackage{mathspec}
\usepackage{cancel}
\usepackage{multicol}
\usepackage{geometry}
\geometry{lmargin=30mm, rmargin=20mm, tmargin=30mm, bmargin=30mm, foot=10mm, head=10mm}
\setmainfont{Segoe Print}

\setmathsfont(Digits){Segoe Print}
\setmathsfont(Latin){Segoe Print}
\setmathrm{Segoe Print}
  • Thanks for quick respond, its works perfectly. What about this missing fonts, do I need to provide any link – bartzmc Jan 4 at 8:42

Your Answer

By clicking “Post Your Answer”, you agree to our terms of service, privacy policy and cookie policy

Not the answer you're looking for? Browse other questions tagged or ask your own question.