Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

appendix: \Hy@chapapp uses \appendixname #34

Open
moewew opened this issue Dec 6, 2018 · 3 comments
Open

appendix: \Hy@chapapp uses \appendixname #34

moewew opened this issue Dec 6, 2018 · 3 comments
Labels

Comments

@moewew
Copy link

moewew commented Dec 6, 2018

Via https://tex.stackexchange.com/q/461125/35864 and ultimately as it turns out a few other questions, most notably https://tex.stackexchange.com/q/67627/35864, https://tex.stackexchange.com/q/58848/35864, https://tex.stackexchange.com/q/41649/35864

The following MWE fails for me (with pdfLaTeX)

\documentclass{book}
\usepackage[T1]{fontenc}
\usepackage[utf8]{inputenc}
\usepackage[magyar]{babel}
\usepackage[titletoc]{appendix}
\usepackage{hyperref}

\begin{document}
\tableofcontents

\begin{appendices}
\chapter{test appendix}
\end{appendices}
\end{document}

with many error messages of the form

! Undefined control sequence.
\GenericError  ...                                
                                                    #4  \errhelp \@err@     ...
l.1 ...ggel�k.a.A}{f\374ggel\351k test appendix}{}
                                                  % 1
? 
! Undefined control sequence.
\GenericError  ...                                
                                                  \let \@err@               ...
l.1 ...ggel�k.a.A}{f\374ggel\351k test appendix}{}
                                                  % 1
? 
! Undefined control sequence.
\GenericError  ...                                
                                                  \@empty \def \MessageBreak...
l.1 ...ggel�k.a.A}{f\374ggel\351k test appendix}{}
                                                  % 1
? 

The issue seems to be the use of the localised term \appendixname as anchor in \Hy@chapapp instead of a safe ASCII-only like \Hy@appendixstring.

moewew added a commit to moewew/herries-press that referenced this issue Dec 6, 2018
See Heiko Oberdiek's bug report reproduced at
https://tex.stackexchange.com/a/67636/ and elsewhere on TeX.SX.
@moewew
Copy link
Author

moewew commented Dec 6, 2018

In case it helps, master...moewew:issue34 contains a possible fix for this issue.

@wspr wspr added the appendix label Jan 10, 2020
@wspr wspr closed this as completed in a1baab0 Feb 8, 2020
@u-fischer
Copy link

Why did the patch change \def to \xdef? Now the setting leaks out of the appendix, see https://tex.stackexchange.com/questions/617916/reference-name-issue-with-multiple-appendices

If I switch back to \def with

\usepackage{etoolbox}
\makeatletter
\patchcmd\@resets@pp{\xdef}{\def}{}{\fail}
\patchcmd\@resets@ppsub{\xdef}{\def}{}{\fail}
\makeatother

The example compiles again.

@moewew
Copy link
Author

moewew commented Oct 6, 2021

As detailed in the linked https://tex.stackexchange.com/a/461142/35864 the \xdef came from hyperref's definition of \appendix, but since that is a switch and with appendices we have an environment a local \edef (or possibly only \def - since expansion then happens when the file is written) might make more sense here.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
Projects
None yet
Development

No branches or pull requests

4 participants