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 #800

Closed
nixpulvis opened this issue Jun 30, 2021 · 8 comments
Closed

Undefined control sequence \DeclareUnicodeCharacter #800

nixpulvis opened this issue Jun 30, 2021 · 8 comments

Comments

@nixpulvis
Copy link

Running tectonic on the document I'm currently working on fails with the following error message:

error: ./head/preamble.tex:8: Undefined control sequence
error: something bad happened inside TeX; its output follows:

===============================================================================
(professional.tex
LaTeX2e <2020-02-02> patch level 5
L3 programming layer <2020-03-06> (./head/preamble.tex (article.cls
Document Class: article 2019/12/20 v1.4l Standard LaTeX document class
(size10.clo)) (geometry.sty (keyval.sty) (ifvtex.sty (iftex.sty))) (mdwlist.sty
) (color.sty (color.cfg) (xetex.def)) (varwidth.sty) (hyperref.sty (ltxcmds.sty
) (pdftexcmds.sty (infwarerr.sty)) (kvsetkeys.sty) (kvdefinekeys.sty)
(pdfescape.sty) (hycolor.sty) (letltxmacro.sty) (auxhook.sty) (kvoptions.sty)
(pd1enc.def) (intcalc.sty) (etexcmds.sty) (url.sty) (bitset.sty (bigintcalc.sty
)) (atbegshi.sty)) (hxetex.def (puenc.def) (stringenc.sty) (rerunfilecheck.sty
(atveryend.sty) (uniquecounter.sty)))
! Undefined control sequence.
l.8 \DeclareUnicodeCharacter
                            {03BB}{\ensuremath{\lambda}}
No pages of output.
Transcript written on professional.log.
===============================================================================
error: the TeX engine had an unrecoverable error
caused by: halted on potentially-recoverable error as specified

Seems like this should be coming from the newunicodechar package. Am I missing something, or is this an issue?

@pkgw
Copy link
Collaborator

pkgw commented Jul 1, 2021

Well, I don't see newunicodechar in the list of files that are being loaded in the output, so that might be the proximate explanation for why the command is failing. But it is quite possible that the package should be getting loaded, but isn't due to a quirk in Tectonic's behavior relative to XeTeX. Are you able to come up with a short example document that compiles with mainline XeTeX but fails with Tectonic?

@nixpulvis
Copy link
Author

nixpulvis commented Jul 1, 2021

@pkgw gladly.

minimal.tex:

\documentclass{minimal}
\DeclareUnicodeCharacter{03BB}{\ensuremath{\lambda}}
\begin{document}
hello world
\end{document}

Run with xelatex minimal.tex.

Or did you need me to figure out how to run this with xetex itself?

@pkgw
Copy link
Collaborator

pkgw commented Jul 2, 2021

No, that's perfect, thanks!

@ralismark
Copy link
Contributor

That example also seems to break with xelatex minimal.tex -- I'm getting this output:

This is XeTeX, Version 3.141592653-2.6-0.999993 (TeX Live 2021/Arch Linux) (preloaded format=xelatex)
 restricted \write18 enabled.
entering extended mode
(./minimal.tex
LaTeX2e <2020-10-01> patch level 4
L3 programming layer <2021-02-18>
(/usr/share/texmf-dist/tex/latex/base/minimal.cls
Document Class: minimal 2001/05/25 Standard LaTeX minimal class
)
! Undefined control sequence.
l.3 \DeclareUnicodeCharacter
                            {03BB}{\ensuremath{\lambda}}
? X
No pages of output.
Transcript written on minimal.log.

@nixpulvis
Copy link
Author

@ralismark how strange, sorry. I have since opening this issue reinstalled my LaTeX distribution and indeed it does give me the same error.

I'm starting to think I just need to find a new way to do this if I want to use xelatex or tectonic`.

@ratmice
Copy link
Contributor

ratmice commented Aug 16, 2021

@nixpulvis newunicodechar has worked for me with both xelatex and tectonic.
I assume you're trying to use lambda outside math mode?

\documentclass{minimal}
\usepackage{newunicodechar}
\newunicodechar{λ}{\ensuremath{\lambda}}
\begin{document}
hello world λ
\end{document}

@nixpulvis
Copy link
Author

@ratmice yes and that method seems to work perfectly for me, in all three of pdflatex, xelatex, and tectonic.

Closing, as a misuse of XeLaTeX features.

@pkgw
Copy link
Collaborator

pkgw commented Aug 16, 2021

Thanks for looking into this, folks!

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

4 participants