1

I'm trying to write a document with tufte-book. Most of the document is supposed to be in English but I wish to write some text in Hebrew. I am able successfully compile documents with more common document classes with polyglossia and Tectonic which internally uses XeTeX. But with tufte-book and this MWE:

%! TEX program = xelatex
\documentclass[nols,nobib,bidi]{tufte-book}
% Language
\usepackage{polyglossia}
\setdefaultlanguage{english}
\setotherlanguage{hebrew}
\begin{document}

Hello World.

\end{document}

I get this weird error:

****************************************************
(biditools.sty) (zref-abspage.sty (zref-base.sty)) (latex-xetex-bidi.def

! LaTeX Error: Command \XeTeX already defined.
               Or name \end... illegal, see p.192 of the manual.

See the LaTeX manual or LaTeX Companion for explanation.
Type  H <return>  for immediate help.
 ...

l.138 ...di@reflect@box{E}}\kern-.1667em \TeX}}$}}

I'm using tufte-book from it's Git repository. Is this a polyglossia bug or a tufte bug? I'd also like to know what use can I find for the bidi option in tufte-book \documentclass.

Lastly, this question suggests to use biditufte-book class provided by the bidi package but I can't use it since I'd like to use biblatex and biditufte-book doesn't support the nobib option which I need.

1
  • 2
    The tufte suite should be updated not to load xltxtra. This package loads metalogo and this is the problem, because bidi doesn't check whether \XeTeX and \XeLaTeX are already defined (which is also wrong). Just add \let\XeTeX\relax and \let\XeLaTeX\relax before \usepackage{polyglossia}.
    – egreg
    Mar 16, 2021 at 18:38

1 Answer 1

4

It's a combined problem.

The tufte-book.cls loads tufte-common.def that, when XeLaTeX as processing engine is detected, does \RequirePackage{xltxtra}, which used to be recommended several years ago, but now it's definitely recommended not to load it.

What happens? That xltxtra loads metalogo, which defines the commands \XeTeX and `\XeLaTeX.

Later, bidi does an unconditional definition of both commands, without any check on whether they're already defined, which is obviously wrong. It should first remove possible definitions of the commands, and then add its own adaptation for bidirectional typesetting.

Fix:

%! TEX program = xelatex
\documentclass[nols,nobib,bidi]{tufte-book}

% fix the bad interaction
\let\XeTeX\undefined
\let\XeLaTeX\undefined

% Language
\usepackage{polyglossia}
\setdefaultlanguage{english}
\setotherlanguage{hebrew}

\begin{document}

Hello World.

\end{document}

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.