2

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}
2
  • 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
    Commented Jan 4, 2019 at 8:32
  • The proximate cause is probably that mathspec reloads fontspec with different options.
    – Davislor
    Commented Jan 4, 2019 at 8:35

1 Answer 1

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}
1
  • Thanks for quick respond, its works perfectly. What about this missing fonts, do I need to provide any link
    – bartzmc
    Commented Jan 4, 2019 at 8:42

You must log in to answer this question.

Not the answer you're looking for? Browse other questions tagged .