4

Here is a minimal example of a file that lualatex from texlive-2013 compiles fine:

\documentclass[11pt]{article}
\usepackage{fontspec}
\begin{document}
X\textsubscript{Y}
\end{document}

If I try to compile it with lualatex from texlive-2014 as packaged by Debian 8 "Jessie", I get the following error:

This is LuaTeX, Version beta-0.79.1 (TeX Live 2015/dev/Debian) (rev 4971) 
 restricted \write18 enabled.
(./test.tex
LaTeX2e <2014/05/01>
Babel <3.9l> and hyphenation patterns for 13 languages loaded.
(/usr/share/texlive/texmf-dist/tex/latex/base/article.cls
Document Class: article 2014/09/29 v1.4h Standard LaTeX document class
(/usr/share/texlive/texmf-dist/tex/latex/base/size11.clo))
(/usr/share/texlive/texmf-dist/tex/latex/fontspec/fontspec.sty
(/usr/share/texlive/texmf-dist/tex/latex/l3kernel/expl3.sty
(/usr/share/texlive/texmf-dist/tex/latex/l3kernel/expl3-code.tex
(/usr/share/texlive/texmf-dist/tex/latex/etex-pkg/etex.sty))
(/usr/share/texlive/texmf-dist/tex/latex/l3kernel/l3unicode-data.def)
(/usr/share/texlive/texmf-dist/tex/latex/l3kernel/l3pdfmode.def))
(/usr/share/texlive/texmf-dist/tex/latex/l3packages/xparse/xparse.sty)
(/usr/share/texlive/texmf-dist/tex/luatex/luaotfload/luaotfload.sty
(/usr/share/texlive/texmf-dist/tex/luatex/luatexbase/luatexbase.sty
(/usr/share/texlive/texmf-dist/tex/generic/oberdiek/ifluatex.sty)
(/usr/share/texlive/texmf-dist/tex/generic/oberdiek/luatex.sty
(/usr/share/texlive/texmf-dist/tex/generic/oberdiek/infwarerr.sty)
(/usr/share/texlive/texmf-dist/tex/generic/oberdiek/luatex-loader.sty
(/usr/share/texlive/texmf-dist/scripts/oberdiek/oberdiek.luatex.lua)))
(/usr/share/texlive/texmf-dist/tex/luatex/luatexbase/luatexbase-compat.sty)
(/usr/share/texlive/texmf-dist/tex/luatex/luatexbase/luatexbase-modutils.sty
(/usr/share/texlive/texmf-dist/tex/luatex/luatexbase/luatexbase-loader.sty
(/usr/share/texlive/texmf-dist/tex/luatex/luatexbase/luatexbase.loader.lua))
(/usr/share/texlive/texmf-dist/tex/luatex/luatexbase/modutils.lua))
(/usr/share/texlive/texmf-dist/tex/luatex/luatexbase/luatexbase-regs.sty)
(/usr/share/texlive/texmf-dist/tex/luatex/luatexbase/luatexbase-attr.sty
(/usr/share/texlive/texmf-dist/tex/luatex/luatexbase/attr.lua))
(/usr/share/texlive/texmf-dist/tex/luatex/luatexbase/luatexbase-cctb.sty
(/usr/share/texlive/texmf-dist/tex/luatex/luatexbase/cctb.lua))
(/usr/share/texlive/texmf-dist/tex/luatex/luatexbase/luatexbase-mcb.sty
(/usr/share/texlive/texmf-dist/tex/luatex/luatexbase/mcb.lua)))
(/usr/share/texlive/texmf-dist/tex/luatex/luaotfload/luaotfload-main.lua)
(/usr/share/texlive/texmf-dist/tex/luatex/luaotfload/luaotfload-log.lua)
(/usr/share/texlive/texmf-dist/tex/luatex/luaotfload/luaotfload-fontloader.lua)(
using write cache: /home/david/.texmf-var/luatex-cache/generic)(using read cache
: /var/lib/texmf/luatex-cache/generic /home/david/.texmf-var/luatex-cache/generi
c)
luaotfload | main : fontloader loaded in 0.030 seconds
(/usr/share/texlive/texmf-dist/tex/luatex/luaotfload/luaotfload-override.lua)
(/usr/share/texlive/texmf-dist/tex/luatex/luaotfload/luaotfload-parsers.lua)
(/usr/share/texlive/texmf-dist/tex/luatex/luaotfload/luaotfload-configuration.lu
a)
(/usr/share/texlive/texmf-dist/tex/luatex/luaotfload/luaotfload-status.lua)
(/usr/share/texlive/texmf-dist/tex/luatex/luaotfload/luaotfload-loaders.lua)
(/usr/share/texlive/texmf-dist/tex/luatex/luaotfload/luaotfload-database.lua)
(/usr/share/texlive/texmf-dist/tex/luatex/luaotfload/luaotfload-colors.lua)
(/usr/share/texlive/texmf-dist/tex/luatex/luaotfload/luaotfload-features.lua)
(/usr/share/texlive/texmf-dist/tex/luatex/luaotfload/luaotfload-letterspace.lua)
(/usr/share/texlive/texmf-dist/tex/luatex/luaotfload/luaotfload-auxiliary.lua))
(/usr/share/texlive/texmf-dist/tex/latex/fontspec/fontspec.lua)
(/usr/share/texlive/texmf-dist/tex/latex/fontspec/fontspec-patches.sty)
(/usr/share/texlive/texmf-dist/tex/latex/fontspec/fontspec-luatex.sty
(/usr/share/texlive/texmf-dist/tex/latex/base/fontenc.sty
(/usr/share/texlive/texmf-dist/tex/latex/euenc/eu2enc.def)
(/usr/share/texlive/texmf-dist/tex/latex/euenc/eu2lmr.fd)(compiling luc: /var/li
b/texmf/luatex-cache/generic/fonts/otf/lmroman10-regular.luc)(load luc: /home/da
vid/.texmf-var/luatex-cache/generic/fonts/otf/lmroman10-regular.luc))
(/usr/share/texlive/texmf-dist/tex/xelatex/xunicode/xunicode.sty
(/usr/share/texmf/tex/latex/tipa/t3enc.def(compiling luc: /var/lib/texmf/luatex-
cache/generic/fonts/otf/lmromanslant10-regular.luc)(load luc: /home/david/.texmf
-var/luatex-cache/generic/fonts/otf/lmromanslant10-regular.luc)(compiling luc: /
var/lib/texmf/luatex-cache/generic/fonts/otf/lmroman10-italic.luc)(load luc: /ho
me/david/.texmf-var/luatex-cache/generic/fonts/otf/lmroman10-italic.luc)(compili
ng luc: /var/lib/texmf/luatex-cache/generic/fonts/otf/lmroman10-bold.luc)(load l
uc: /home/david/.texmf-var/luatex-cache/generic/fonts/otf/lmroman10-bold.luc)
(/usr/share/texlive/texmf-dist/tex/latex/euenc/eu2lmss.fd)(compiling luc: /var/l
ib/texmf/luatex-cache/generic/fonts/otf/lmsans10-regular.luc)(load luc: /home/da
vid/.texmf-var/luatex-cache/generic/fonts/otf/lmsans10-regular.luc))
(/usr/share/texlive/texmf-dist/tex/latex/graphics/graphicx.sty
(/usr/share/texlive/texmf-dist/tex/latex/graphics/keyval.sty)
(/usr/share/texlive/texmf-dist/tex/latex/graphics/graphics.sty
(/usr/share/texlive/texmf-dist/tex/latex/graphics/trig.sty)
(/usr/share/texlive/texmf-dist/tex/latex/latexconfig/graphics.cfg)
(/usr/share/texlive/texmf-dist/tex/latex/pdftex-def/pdftex.def
(/usr/share/texlive/texmf-dist/tex/generic/oberdiek/ltxcmds.sty)
(/usr/share/texlive/texmf-dist/tex/generic/oberdiek/pdftexcmds.sty
(/usr/share/texlive/texmf-dist/tex/generic/oberdiek/ifpdf.sty)
(/usr/share/texlive/texmf-dist/scripts/oberdiek/pdftexcmds.lua))))))
(/usr/share/texlive/texmf-dist/tex/latex/fontspec/fontspec.cfg)))
No file test.aux.
(/usr/share/texmf/tex/latex/tipa/t3cmr.fd)
(/usr/share/texlive/texmf-dist/tex/context/base/supp-pdf.mkii
[Loading MPS to PDF converter (version 2006.09.02).]
) (/usr/share/texlive/texmf-dist/tex/latex/oberdiek/epstopdf-base.sty
(/usr/share/texlive/texmf-dist/tex/latex/oberdiek/grfext.sty
(/usr/share/texlive/texmf-dist/tex/generic/oberdiek/kvdefinekeys.sty))
(/usr/share/texlive/texmf-dist/tex/latex/oberdiek/kvoptions.sty
(/usr/share/texlive/texmf-dist/tex/generic/oberdiek/kvsetkeys.sty
(/usr/share/texlive/texmf-dist/tex/generic/oberdiek/etexcmds.sty)))
(/usr/share/texlive/texmf-dist/tex/latex/latexconfig/epstopdf-sys.cfg))

! LaTeX Error: Command \textsubscript unavailable in encoding EU2.

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

l.4 X\textsubscript
                 {Y}
? x
 296 words of node memory still in use:
   3 hlist, 1 rule, 1 kern, 1 glyph, 3 attribute, 41 glue_spec, 3 attribute_list
, 1 temp, 1 write, 1 local_par, 1 dir nodes
   avail lists: 2:9,3:1,4:2,7:1,9:1
No pages of output.
Transcript written on test.log.

I did find this related tex.stackexchange thread, but I its solution is not applicable here since I only load fontspec.

Here are my questions:

  • Is this a bug, or did I do something wrong?

  • If it is a bug, is it worth bug-reporting somewhere? If so, where? (Debian, texlive, luatex, latex, or some subset of the above?)

  • Is there some not-too-ugly way to work around this bug? Assume, for various reasons, that I really need to work with this particular version of lualatex/texlive (and, unforunately, given Debian's hard-line policy of not fixing bugs unless they are security holes, this will remain as such until the next version of Debian is released, approximately one trillion years from now). Is there something I can write to make \textsubscript "available under EU2 encoding" which wouldn't break if it already works?

Thanks for any help!

Clarification: The question has been satisfactorily answered by David Carlisle below. I don't see, however, how it can be considered a duplicate of this other question: in my minimal example, \textsubscript works with luatex from texlive-2013, so my question was not "how to produce a subscript?" but "how/why did the behavior change between 2013 and 2014? (and is this a bug?)". Furthermore, I emphasize that the error message I got, which is reproduced in the title, was not "Undefined control sequence" (if it were, the question would, indeed, be a duplicate). As a matter of fact, I'd be curious to have an explanation of this error message: how can someone have coded a specific error message saying that \textsubscript is "unavailable" (what does that even mean?) when the fix is almost as short as the error message itself — this seems to make no sense.

  • 1
    I've raised this question before. – Sverre May 15 '15 at 11:35
  • Your minimal document only contains the command \textsubscript, and this gives you the error Command \textsubscript unavailable in encoding .... You wondered why this is, and what you could do about it. That's exactly the same question as I have asked before, so it's a duplicate. Since my question itself was closed as a dupe, I voted to close yours as a dupe of the original question. Your question can't be marked as a dupe of my question, since it doesn't have an answer (it got resolved in the com – Sverre May 18 '15 at 15:44
9

In the 2015/01/01 latex release, it's not needed, but for 2014, the easiest way to get \textsubscript defined is

\RequirePackage{fixltx2e}
\documentclass[11pt]{article}
\usepackage{fontspec}
\begin{document}
X\textsubscript{Y}
\end{document}

Older releases of fontspec included fixltx2e automatically, that was removed at some point, and in latex 2015 release, fixltx2e is not needed at all.

If you don't want all of fixltx2e just steal the one definition:

\makeatletter
\DeclareRobustCommand*\textsubscript[1]{%
  \@textsubscript{\selectfont#1}}
\def\@textsubscript#1{%
  {\m@th\ensuremath{_{\mbox{\fontsize\sf@size\z@#1}}}}}
\makeatother
  • This does indeed fix my minimal example. Sadly, fixltx2e seems to break other things, because now the combination of biblatex and \footnote produces the message "Package biblatex Warning: Patching footnotes failed.", and calls to \footnote break.☹ Do you think this can be fixed as well (should I open another thread?) or will I keep on running on more problems as I fix them? – Gro-Tsen May 13 '15 at 20:57
  • @Gro-Tsen see update – David Carlisle May 13 '15 at 21:00
  • Wonderful!, it worked. Thank you very much. – Gro-Tsen May 13 '15 at 22:18

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.