Skip to content

Instantly share code, notes, and snippets.

@pydanny
Created March 17, 2017 17:19
Show Gist options
  • Save pydanny/d6a33e2d51384da36b43f8b44d8fc316 to your computer and use it in GitHub Desktop.
Save pydanny/d6a33e2d51384da36b43f8b44d8fc316 to your computer and use it in GitHub Desktop.
% Our tocloft configuration
\usepackage{tocloft}
\newlength{\mylen} %% extra space
\setlength{\mylen}{.2cm}
\addtolength{\cftsecnumwidth}{\mylen} % add the extra space after section numbers
\addtolength{\cftsubsecnumwidth}{\mylen} % add the extra space after subsection numbers
% How we load fontspec
\usepackage{fontspec}
% A sample TOC header
\chapter*{Authors' Notes}
\addcontentsline{toc}{chapter}{Authors' Notes}
% The error we get
xelatex -shell-escape screen.tex
This is XeTeX, Version 3.14159265-2.6-0.99996 (TeX Live 2016) (preloaded format=xelatex)
\write18 enabled.
entering extended mode
(./screen.tex
LaTeX2e <2016/03/31>
Babel <3.9r> and hyphenation patterns for 22 language(s) loaded.
(./main.tex (/usr/local/texlive/2016basic/texmf-dist/tex/latex/base/book.cls
Document Class: book 2014/09/29 v1.4h Standard LaTeX document class
(/usr/local/texlive/2016basic/texmf-dist/tex/latex/base/bk10.clo))
(/usr/local/texlive/2016basic/texmf-dist/tex/latex/listings/listings.sty
(/usr/local/texlive/2016basic/texmf-dist/tex/latex/graphics/keyval.sty)
(/usr/local/texlive/2016basic/texmf-dist/tex/latex/listings/lstmisc.sty)
(/usr/local/texlive/2016basic/texmf-dist/tex/latex/listings/listings.cfg))
(/usr/local/texlive/2016basic/texmf-dist/tex/latex/fontspec/fontspec.sty
(/usr/local/texlive/2016basic/texmf-dist/tex/latex/l3kernel/expl3.sty
(/usr/local/texlive/2016basic/texmf-dist/tex/latex/l3kernel/expl3-code.tex)
(/usr/local/texlive/2016basic/texmf-dist/tex/latex/l3kernel/l3xdvipdfmx.def))
(/usr/local/texlive/2016basic/texmf-dist/tex/latex/l3packages/xparse/xparse.sty
)
(/usr/local/texlive/2016basic/texmf-dist/tex/latex/fontspec/fontspec-xetex.sty
*************************************************
* fontspec warning: "tu-clash"
*
* I have found the tuenc.def encoding definition file but the TU encoding is
* not defined by the LaTeX2e kernel; attempting to correct but you really
* should update to the latest version of LaTeX2e.
*************************************************
(/usr/local/texlive/2016basic/texmf-dist/tex/latex/base/fontenc.sty
(/usr/local/texlive/2016basic/texmf-dist/tex/latex/base/tuenc.def
! Missing \endcsname inserted.
<to be read again>
\def
l.252 ... \UnicodeEncodingName {}{"007E}
?
@clayball
Copy link

@pydanny, best of luck with everything!

@mpacer
Copy link

mpacer commented Mar 17, 2017

Also, I should mention that I cannot reproduce the initial error. My guess is it's related to your current font declaration.

Strangely when I look at the PT Sans Narrow font on my comp, it comes in a .ttc font collection rather than an individual file. Had you generated them manually?

@pydanny
Copy link
Author

pydanny commented Mar 17, 2017

@mpacer, the font declaration causing the problem is:

\setsansfont [Path = fonts/,
    UprightFont = PTSansNarrow-Regular.ttf,
    BoldFont = OpenSans-Bold.ttf,
    ItalicFont = AvenirNextCondensed-Italic.ttf
 ]
{PTSansNarrow.ttf}

The font is stored in a fonts directory. It's also in my Mac's fontbook utility. Not sure if there's a conflict.

However, what've discovered though is that when I comment out this command, the book compiles without a problem. In the rendered book's section on typographical conventions, everything looks fine. HOORAY!

So I think the problem is resolved. However, since the book is 527 pages, it might be a while before we discover any problems.

@mpacer
Copy link

mpacer commented Mar 17, 2017

Does get you a functional font declaration? My guess is that if you don't pass an explicit Extension parameter it defaults to Extension = .ttf which seems backwards for xelatex given it's otf support, but 🤷‍♀️.

\setsansfont [Path = fonts/,
Extension = .ttf,
UprightFont = PTSansNarrow-Regular,
BoldFont = OpenSans-Bold,
ItalicFont = AvenirNextCondensed-Italic
]
{PTSansNarrow}

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment