2

I want to create a book in greek language in tufte style using mtpro2 package and xetex.

\documentclass[twoside]{tufte-book}
\usepackage{mtpro2}
\usepackage{amsmath}
\usepackage[no-math,cm-default]{fontspec}
\usepackage{xunicode}
\usepackage{xltxtra}
\usepackage{xgreek}
\defaultfontfeatures{Mapping=tex-text,Scale=MatchLowercase}
\setmainfont[Mapping=tex-text,Numbers=Lining,Scale=1.0]{Times New Roman}
\usepackage{mtpro2}
\begin{document}
Μαθηματικά
\end{document}

I get the following errors :

Command `\hbar' already defined. ...thSymbol{\hbar} {\mathord}{symbols}{"84}
Option clash for package fontspec. \usepackage
  • It's a problem with tufte-book which tries to do something really awful with the fonts and other things. Are you sure you want to load xgreek? – egreg Sep 12 '15 at 17:25
  • What are the really awful things tufte-book does with the fonts and other things? – JPi Sep 12 '15 at 17:36
  • I have another computer with all the nessesary packages installed and this example works fine. Thats why I do load the xgreek package. But i didnt try to unload it yet. Is it beacuse of any new version of tufte-book? – mac Sep 12 '15 at 18:06
  • Will it work if I reinstall tufte class? – mac Sep 12 '15 at 21:47
3

The \hbar macro is defined by the xunicode package. Here's a modified preamble that should work okay:

\PassOptionsToPackage{no-math,cm-default}{fontspec}
\documentclass[twoside,nofonts]{tufte-book}
\usepackage{amsmath}
\usepackage{xgreek}
\defaultfontfeatures{Mapping=tex-text,Scale=MatchLowercase}
\setmainfont[Mapping=tex-text,Numbers=Lining,Scale=1.0]{Times New Roman}
\let\hbar\relax
\usepackage{mtpro2}
\begin{document}
Μαθηματικά
\end{document}

I changed the following items in your preamble:

  • Moved the options from \usepackage[no-math,cm-default]{fontspec} to the \PassOptionsToPackage line at the top. Since Tufte-LaTeX will load the fontspec package automatically, this will pass your options and you won't have an error for conflicting options.
  • Added the nofonts option to the \documentclass line to suppress Tufte-LaTeX from setting its own fonts.
  • Removed the first \usepackage{mtpro2} line. You don't need this twice.
  • Removed the \usepackage{xunicode} and \usepackage{xltxtra} lines as Tufte-LateX loads these automatically for you.
  • Added the \let\hbar\relax line just prior to loading the mtpro2 package. This will “undefine” the \hbar macro so that the mtpro2 package can define it itself.
  • Seems to work great! I think that the previous version of tufte-latex was working differently. – mac Sep 13 '15 at 8:50
  • 1
    @mac, I'm glad it works for you! The Tufte-LaTeX code itself hasn't changed much at all over the past few years, but some of the packages it uses might have. – godbyk Sep 13 '15 at 19:30

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.