I'm using package hyperref to write a book in Portuguese. Appendices should appear in TOC as in Apêndice A Title of the appendix.
When I compile it with LuaLatex on a computer with Ubuntu 16.04, I get this error message:
! Missing \endcsname inserted.
<to be read again>
\char
l.2 ....a.A}{Ap\352ndice T\355tulo de ap\352ndice}{}
The file main.out looks like this:
\BOOKMARK [0][-]{chapter.1}{Blabla}{}% 1
\BOOKMARK [0][-]{Ap\char "00EA\relax ndice.a.A}{Ap\352ndice T\355tulo de ap\352ndice}{}% 2
But, when I compile the same project with LuaLatex on a computer with Ubuntu 18.10, I get no error message and the file main.out looks like this:
\BOOKMARK [0][-]{chapter.1}{Blabla}{}% 1
\BOOKMARK [0][-]{Apêndice.a.A}{Ap\352ndice T\355tulo de ap\352ndice}{}% 2
What can possible be wrong with LuaLatex on my Ubuntu 16.04?
MWE:
\documentclass[10pt]{book}
\usepackage[utf8]{luainputenc}
\usepackage[title,titletoc]{appendix}
\renewcommand{\appendixname}{Apêndice}
\usepackage{fontspec}
\usepackage[breaklinks=true]{hyperref}
\usepackage{tocloft}
\usepackage[notlof,notlot,nottoc]{tocbibind}
\title{TÍTULO DO LIVRO}
\author{Nome do Autor}
\begin{document}
\frontmatter
\pagestyle{empty}
\maketitle
\tableofcontents\thispagestyle{empty}
\cleardoublepage
\mainmatter
\chapter{Blabla}
Blablabla.
\begin{appendices}
\chapter{Título de apêndice}
Texto.
\newpage
Mais texto.
\end{appendices}
\end{document}
\'aetc. – manooooh Jan 30 '19 at 16:38\usepackage[utf8]{luainputenc}. But I think I included that line because I needed it in my document for some purpose. Why shouldn't I useluainputenc? – Leonardo Castro Jan 30 '19 at 16:41\renewcommand{\appendixname}{Apêndice}with\renewcommand{\appendixname}{Ap\^endice}, but the error message didn't change. – Leonardo Castro Jan 30 '19 at 16:43luainputencif you had to combine legacy encodings and Unicode in the same document, using LuaLaTeX. If at all possible, I would advise you to instead remove any legacy font packages, and use Unicode throughout. – Davislor Jan 30 '19 at 18:24\usepackage[greek,portuguese]{babel}to the MWE,lualatexdoesn't work after thebibtexcommand. The same error described in my question appears. – Leonardo Castro Mar 06 '19 at 23:09hyperrefmanual says that bookmarks must be in Unicode anyway. Your source files for LuaTeX should always be UTF-8, and you should givehyperreftheunicode=trueoption. The only time you’d needluainputencis if you’re trying to mix Unicode with legacy 7- and 8-bit fonts, but in the real world there’s no reason to ever do that. If you’re writing your book in LuaTeX, you can just consistently use Unicode. – Davislor Mar 11 '19 at 15:17luainputenc, you should stop doing it. – Davislor Mar 11 '19 at 15:30