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

Undefined control sequence \DeclareUnicodeCharacter redux #1096

Open
andreasabel opened this issue Sep 25, 2023 · 3 comments
Open

Undefined control sequence \DeclareUnicodeCharacter redux #1096

andreasabel opened this issue Sep 25, 2023 · 3 comments

Comments

@andreasabel
Copy link

This is a reopening of #800, which was not resolved, but sidestepped by using \newunicodechar instead of \DeclareUnicodeCharacter.

MWE:

\documentclass{article}
\usepackage[utf8]{inputenc}
\DeclareUnicodeCharacter{00AC}{\ensuremath{\neg}}
\begin{document}
¬
\end{document}
$ pdflatex MWE.tex
...
Output written on MWE.pdf ...
...
$ tectonic MWE.tex
...
error: MWE.tex:3: Undefined control sequence
...
$ tectonic -V
Tectonic 0.14.1

The contract of executing \usepackage[utf8]{inputenc} is that \DeclareUnicodeCharacter is then defined. See https://mirror.math.princeton.edu/pub/CTAN/macros/latex/base/inputenc.pdf.

@ratmice
Copy link
Contributor

ratmice commented Sep 25, 2023

Seems worth noting that tectonic is based on xelatex,
if you run your MWE.tex through xelatex it gives a slightly more descriptive error.

(/usr/share/texlive/texmf-dist/tex/latex/base/inputenc.sty

Package inputenc Warning: inputenc package ignored with utf8 based engines.

)
! Undefined control sequence.
<recently read> \DeclareUnicodeCharacter

I haven't really looked into it a lot, but that at least gave me the impression it wasn't expected to work.

@andreasabel
Copy link
Author

Seems worth noting that tectonic is based on xelatex,

Ah, ok, good to know. I had used tectonic on pdflatex documents, and it had worked out of the box (which is great!), so I assumed it would be pdflatex compatible.

Package inputenc Warning: inputenc package ignored with utf8 based engines.

I think one should either get this warning or have \DeclareUnicodeCharacter defined.

@ratmice
Copy link
Contributor

ratmice commented Sep 26, 2023

Package inputenc Warning: inputenc package ignored with utf8 based engines.

I think one should either get this warning or have \DeclareUnicodeCharacter defined.

Yeah, It occurred to me that this message is probably just not being printed by default, but still exists if you run tectonic with the --print option (which turns out to be the case).

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

No branches or pull requests

2 participants