3

With the upgrade to TeXLive 2017, I'm finding that a lot of my documents are failing to compile with lualatex because I had been using the packages xunicode and xltxtra to access uncommon accents using TeX macros. One such accent I use is the U+032A ◌̪ COMBINING BRIDGE BELOW (used to mark dental consonants in the IPA), which used to be accessible with \textsubbridge. The relevant portion of my preamble is:

\usepackage{fontspec}
\defaultfontfeatures{Mapping=tex-text}
\usepackage{xunicode} % Fails with LuaTeX
\usepackage{microtype}

\setmainfont{Linux Libertine O}[
    Ligatures=TeX,
    Numbers=Uppercase,
]

\setsansfont{Fira Sans}[
    % Ligatures=TeX,
    Numbers=Uppercase,
    Scale=MatchLowercase,
    BoldFont={* SemiBold},
]

\setmonofont{Fira Mono}[
    Ligatures=TeX,
    Scale=MatchLowercase,
]

Commenting out those packages means that the accents I was using are no longer defined, and none of the solutions given in this question from 2011 work at all. The only way I've been able to get these files to compile is to use a modified copy of xunicode which won't exit on an engine that isn't XeTeX.

Is there a more correct way to get this working with LuaTex? While it's true I can find all the Unicode combining characters in the character map application provided by GNOME, inserting them directly into files in my editor is a bit glitchy, so the macros are the more convenient way for those not available with the Compose Key mappings.

  • 1
    Load fontspec. xltxtra is not to be used with LuaLaTeX. – Johannes_B Nov 1 '17 at 6:41
  • I'm already using fontspec; it's usually the first in my preambles after various KOMA-script options. – Robbie Nov 1 '17 at 6:42
  • Please provide some examples of "uncommon accents" that you can no longer typeset. Please also tell us (a) how you load fontspec and (b) which font(s) you use. – Mico Nov 1 '17 at 6:45
  • 1
    Would you mind posting an example that we can compile? – Johannes_B Nov 1 '17 at 7:49
  • 1
    The new TU encoding predefines a number of commands but not so much as xunicode did. You will have to add the missing ones yourself. Look in tuenc.def for examples. – Ulrike Fischer Nov 1 '17 at 7:55
4

You probably don't need all of xunicode so you can probably just copy the definitions that you need. Alternatively you can load the package in luatex, you just need to work around the bug that stops it loading in luatex. (fontspec uses an equivalent workaround if you use the older eu1/eu2 encoding setup that required xunicode.

\documentclass{article}
\usepackage{fontspec}
\defaultfontfeatures{Mapping=tex-text}
\providecommand\XeTeXpicfile{xunicode bug}
\usepackage{xunicode} % Fails with LuaTeX
\usepackage{microtype}


\begin{document}

\end{document}
  • This has been reported (some months back) to the xunicode maintainer, hopefully an update will appear to make this workaround not necessary. – David Carlisle Nov 1 '17 at 9:15
  • This workaround fixed the problem without my needing to manually patch xunicode, so I'm marking it as the answer. – Robbie Nov 3 '17 at 10:37
4

You can add such command individually like this:

\documentclass{article}
\usepackage{fontspec}
\usepackage{microtype}

\setmainfont{Linux Libertine O}[
    Ligatures=TeX,
    Numbers=Uppercase,
]

\DeclareUnicodeAccent{\textsubbridge}\UnicodeEncodingName{"032A}


\begin{document}
a \textsubbridge a
\end{document}

enter image description here

  • The support for combining characters in tuenc.def is somewhat limited. – egreg Nov 1 '17 at 10:25
  • @egreg Well the question is always if such support is so basic that it should be done in the kernel. This here is the first question that I saw about this accent so it doesn't look to be used so much. – Ulrike Fischer Nov 1 '17 at 10:35
  • I was going to mark this as the answer, as it solved the problem for these specific characters, but a more general solution is definitely needed, and an upstream fix for xunicode (or similar) is probably the way to go. – Robbie Nov 3 '17 at 10:36
  • @Robbie the problem is that xunicode redefines tons of commands. It is a quite intrusive package and now that the support of unicode has moved into the kernel I normally avoid it and setup needed commands with the kernel macros. – Ulrike Fischer Nov 3 '17 at 10:40

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.