5

I am trying to use gfsneohellenic with tufte-book. While compiling I am getting the following error.

/usr/local/texlive/2018/texmfdist/tex/latex/gfsneohellenic/gfsneohellenic.sty:
85: LaTeX Error: Command \textlozenge already defined.
           Or name \end... illegal, see p.192 of the manual.

MWE is appended below.

\documentclass{tufte-book}
%\documentclass{book} % compiles correctly with this setting
\usepackage[T1]{fontenc}
\usepackage[default]{gfsneohellenic}

\begin{document}

\chapter{Science of why}

\end{document}

PS: with \documentclass{book} the font compiles correctly without any error.

2

The tufte classes load hyperref prematurely, which is a cause for several kinds of problems, including yours.

\documentclass[nohyper]{tufte-book}
\usepackage[T1]{fontenc}
\usepackage[default]{gfsneohellenic}
\usepackage[unicode,hyperfootnotes=false]{hyperref}

\hypersetup{
  pdfborder = {0 0 0},
  bookmarksdepth = section,
  citecolor = DarkGreen,
  linkcolor = DarkBlue,
  urlcolor = DarkGreen,
}
\AtBeginDocument{%
  \hypersetup{
    pdfauthor={\plainauthor}
    pdftitle={\plaintitle},
  }%
}


\begin{document}

\chapter{Science of why}

\end{document}
2

Your error message states, that command \textlozenge is defined in both packages tufte-book and gfsneohellenic. You are facing a package clash.

Since gfsneohellenic, as far as I understand, is about loading a font, you can bypass this definition clash by loading this font with fontspec and compile with xelatex if GFS neo hellenic is installed on your system font file, lualatex otherwise. Since you try to load a package, GFS neohellenic should be in your tex distribution font file and I suggest compiling with lualatex.

\documentclass{tufte-book}
%\documentclass{book} % compiles correctly with this setting
\usepackage{fontspec}
%the fontspec way to load fonts
\setmainfont{GFS neohellenic}

\begin{document}

\chapter{Science of why}

\end{document}

Maybe you don't know how to compile with lualatex: set your editor compiler to LuaLaTeX, or use latexmk -luatex option or type in console lualatex document.tex where document.tex is your file name.

enter image description here

PS: you can use XeLaTeX with tex font distribution either, but it needs a special declaration, check fontspec documentation.

PS2: your .tex file should be encoded as utf-8.

2
  • Thanks for the solution, I was using XeLaTeX for compilation. Will try Lua for this compilation.
    – Damitr
    Nov 14 '18 at 6:40
  • 1
    If you use XeLaTeX, you don't need T1 encoding, you've got OTF fonts and utf8 out of the box. So delete the \usepackage[T1]{fontenc}. I think reading fontspec doc will show you how to use also XeLaTeX.
    – sztruks
    Nov 14 '18 at 7:27
1
\documentclass{tufte-book}
\usepackage[T1]{fontenc}
\let\textlozenge\relax
\usepackage[default]{gfsneohellenic}

\begin{document}

    \chapter{Science of why}

\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.