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.

Robbie
  • 2,893
  • 1
    Load fontspec. xltxtra is not to be used with LuaLaTeX. – Johannes_B Nov 01 '17 at 06:41
  • I'm already using fontspec; it's usually the first in my preambles after various KOMA-script options. – Robbie Nov 01 '17 at 06: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 01 '17 at 06:45
  • Incidentally, the xunicode and xltxtra packages are supposed to be used only with XeLaTeX. I've never before heard of these packages being usable if the document is compiled with LuaLaTeX. You appear to be using a modified (hacked?) version of the xunicode package; what sorts of modifications did you have to make? – Mico Nov 01 '17 at 06:50
  • I commented out the group starting at line 107; see the diff here for the changes: https://gist.github.com/zoqaeski/b99e2fb8adab561a3092ff30b01dc4b0 – Robbie Nov 01 '17 at 07:00
  • 1
    Would you mind posting an example that we can compile? – Johannes_B Nov 01 '17 at 07:49
  • @mico fontspec did load xunicode with lualatex in older version. It dropped it with the switch to TU. – Ulrike Fischer Nov 01 '17 at 07:52
  • 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 01 '17 at 07:55
  • @UlrikeFischer - Thanks -- I hadn't realized this. – Mico Nov 01 '17 at 16:56

2 Answers2

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}
David Carlisle
  • 757,742
  • 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 01 '17 at 09:15
  • This workaround fixed the problem without my needing to manually patch xunicode, so I'm marking it as the answer. – Robbie Nov 03 '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

Ulrike Fischer
  • 327,261
  • The support for combining characters in tuenc.def is somewhat limited. – egreg Nov 01 '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 01 '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 03 '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 03 '17 at 10:40