latex3 / fontspec

Font selection in LaTeX for XeTeX and LuaTeX
http://latex3.github.io/fontspec/
LaTeX Project Public License v1.3c
277 stars 34 forks source link

Bad interaction with shellesc #389

Closed Evpok closed 5 years ago

Evpok commented 5 years ago

Description

When shellesc is loaded before fontspec, lualatex errors in tuenc.def, xelatex seems to be fine.

Minimal example demonstrating the issue

\documentclass{article}
\usepackage{shellesc}
\usepackage{fontspec}

\begin{document}
hello
\end{document}

Further details

Relevant part of the log:

This is LuaTeX, Version 1.10.0 (TeX Live 2019)  (format=lualatex 2019.11.8)
<snip>
Package: shellesc 2019/10/17
<snip>
Package: fontspec 2019/10/19 v2.7d Font selection for XeLaTeX and LuaLaTeX
<snip>
File: tuenc.def 2018/08/11 v2.0j Standard LaTeX file
LaTeX Font Info:    Redeclaring font encoding TU on input line 82.

/usr/local/texlive/2019/texmf-dist/tex/latex/base/tuenc.def:119: Missing number, treated as zero.
<to be read again> 
"
l.119 ...ollar}          \UnicodeEncodingName{"0024}

A number should have been here; I inserted `0'.
(If you can't figure out why I needed to see a number,
look up `weird error' in the index to The TeXbook.)

/usr/local/texlive/2019/texmf-dist/tex/latex/base/tuenc.def:119: Missing $ inserted.
<inserted text> 
$
l.119 ...ollar}          \UnicodeEncodingName{"0024}

I've inserted a begin-math/end-math symbol since I think
you left one out. Proceed, with fingers crossed.

/usr/local/texlive/2019/texmf-dist/tex/latex/base/tuenc.def:119: LaTeX Error: Missing \begin{document}.

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

l.119 ...ollar}          \UnicodeEncodingName{"0024}

You're in trouble here.  Try typing  <return>  to proceed.
If that doesn't work, type  X <return>  to quit.
davidcarlisle commented 5 years ago

@Evpok sorry I can reproduce, looks like a change in shellesc rather than fontspec, give me a minute..

davidcarlisle commented 5 years ago

Sorry, just cut and paste incompetence on my part:(

On the very last line of shellesc.sty you will find

\catcode`\"\shellesc@underscorecat

which was supposed to be restoring the catcode of _ but "restores" the catocde of " instead, making " act like a math underscore.

Please edit that line so it looks like

\catcode`\_\shellesc@underscorecat

Please could you also edit the top to say something like

\ProvidesPackage{shellesc}
       [2019/10/17 v1.0b unified shell escape interface for LaTeX (+ underscore catcode fix)]

If you could confirm that works I'll push out a update to tools as soon as possible.

Evpok commented 5 years ago

Yes, it works, thanks!

davidcarlisle commented 5 years ago

Thanks for confirming, this is fixed at https://github.com/latex3/latex2e/commit/5a229cd6dc3d7b1484e46d05e05708b15a217dd7 and I'll make a tools release to ctan later today,