0

I'm collaboratively working in a LaTeX document in Overleaf and some team members use German umlauts (ä, ö, ü, Ä, Ö, Ü) in their labels. It works with \ref:

\documentclass{scrartcl}
\usepackage[utf8]{inputenc}
\usepackage{cleveref}

\begin{document}

\section{Introduction}
\label{Ä}
\ref{Ä}
\end{document}

Now, I wanted to introduce cleveref and reference their labels, but cleveref can't handle these umlauts. The following code causes errors:

\documentclass{scrartcl}
\usepackage[utf8]{inputenc}
\usepackage{cleveref}

\begin{document}

\section{Introduction}
\label{Ä}
\cref{Ä}
\end{document}

Is it possible to use cleveref with these labels without changing them? I'm not able to change other people's labels. If it's not possible, I have to stick with \ref.

Here is the log containing the error messages:

This is pdfTeX, Version 3.141592653-2.6-1.40.23 (TeX Live 2021) (preloaded format=pdflatex 2021.9.30)  20 APR 2022 11:02
entering extended mode
 \write18 enabled.
 %&-line parsing enabled.
**main.tex
(./main.tex
LaTeX2e <2021-06-01> patch level 1
L3 programming layer <2021-07-12> (/usr/local/texlive/2021/texmf-dist/tex/latex/koma-script/scrartcl.cls
Document Class: scrartcl 2021/06/25 v3.34 KOMA-Script document class (article)
(/usr/local/texlive/2021/texmf-dist/tex/latex/koma-script/scrkbase.sty
Package: scrkbase 2021/06/25 v3.34 KOMA-Script package (KOMA-Script-dependent basics and keyval usage)
(/usr/local/texlive/2021/texmf-dist/tex/latex/koma-script/scrbase.sty
Package: scrbase 2021/06/25 v3.34 KOMA-Script package (KOMA-Script-independent basics and keyval usage)
(/usr/local/texlive/2021/texmf-dist/tex/latex/koma-script/scrlfile.sty
Package: scrlfile 2021/06/25 v3.34 KOMA-Script package (file load hooks)
(/usr/local/texlive/2021/texmf-dist/tex/latex/koma-script/scrlfile-hook.sty
Package: scrlfile-hook 2021/06/25 v3.34 KOMA-Script package (using LaTeX hooks)
(/usr/local/texlive/2021/texmf-dist/tex/latex/koma-script/scrlogo.sty
Package: scrlogo 2021/06/25 v3.34 KOMA-Script package (logo)
))) (/usr/local/texlive/2021/texmf-dist/tex/latex/graphics/keyval.sty
Package: keyval 2014/10/28 v1.15 key=value parser (DPC)
\KV@toks@=\toks16
)
Applying: [2021/05/01] Usage of raw or classic option list on input line 252.
Already applied: [0000/00/00] Usage of raw or classic option list on input line 368.
)) (/usr/local/texlive/2021/texmf-dist/tex/latex/koma-script/tocbasic.sty
Package: tocbasic 2021/06/25 v3.34 KOMA-Script package (handling toc-files)
\scr@dte@tocline@numberwidth=\skip47
\scr@dte@tocline@numbox=\box50
)
Package tocbasic Info: babel extension for `toc' omitted
(tocbasic)             because of missing \bbl@set@language on input line 135.
Class scrartcl Info: File `scrsize11pt.clo' used instead of
(scrartcl)           file `scrsize11.clo' to setup font sizes on input line 2241.
(/usr/local/texlive/2021/texmf-dist/tex/latex/koma-script/scrsize11pt.clo
File: scrsize11pt.clo 2021/06/25 v3.34 KOMA-Script font size class option (11pt)
) (/usr/local/texlive/2021/texmf-dist/tex/latex/koma-script/typearea.sty
Package: typearea 2021/06/25 v3.34 KOMA-Script package (type area)
\ta@bcor=\skip48
\ta@div=\count182
\ta@hblk=\skip49
\ta@vblk=\skip50
\ta@temp=\skip51
\footheight=\skip52
Package typearea Info: These are the values describing the layout:
(typearea)             DIV  = 10
(typearea)             BCOR = 0.0pt
(typearea)             \paperwidth      = 597.50793pt
(typearea)              \textwidth      = 418.25555pt
(typearea)              DIV departure   = -6%
(typearea)              \evensidemargin = 17.3562pt
(typearea)              \oddsidemargin  = 17.3562pt
(typearea)             \paperheight     = 845.04694pt
(typearea)              \textheight     = 595.80026pt
(typearea)              \topmargin      = -25.16531pt
(typearea)              \headheight     = 17.0pt
(typearea)              \headsep        = 20.40001pt
(typearea)              \topskip        = 11.0pt
(typearea)              \footskip       = 47.6pt
(typearea)              \baselineskip   = 13.6pt
(typearea)              on input line 1742.
)
\c@part=\count183
\c@section=\count184
\c@subsection=\count185
\c@subsubsection=\count186
\c@paragraph=\count187
\c@subparagraph=\count188
\scr@dte@section@maxnumwidth=\skip53
Class scrartcl Info: using compatibility default `runin=bysign'
(scrartcl)           for `\section on input line 4851.
Class scrartcl Info: using compatibility default `afterindent=bysign'
(scrartcl)           for `\section on input line 4851.
\scr@dte@part@maxnumwidth=\skip54
Class scrartcl Info: using compatibility default `afterindent=false'
(scrartcl)           for `\part on input line 4859.
\scr@dte@subsection@maxnumwidth=\skip55
Class scrartcl Info: using compatibility default `runin=bysign'
(scrartcl)           for `\subsection on input line 4869.
Class scrartcl Info: using compatibility default `afterindent=bysign'
(scrartcl)           for `\subsection on input line 4869.
\scr@dte@subsubsection@maxnumwidth=\skip56
Class scrartcl Info: using compatibility default `runin=bysign'
(scrartcl)           for `\subsubsection on input line 4879.
Class scrartcl Info: using compatibility default `afterindent=bysign'
(scrartcl)           for `\subsubsection on input line 4879.
\scr@dte@paragraph@maxnumwidth=\skip57
Class scrartcl Info: using compatibility default `runin=bysign'
(scrartcl)           for `\paragraph on input line 4890.
Class scrartcl Info: using compatibility default `afterindent=bysign'
(scrartcl)           for `\paragraph on input line 4890.
\scr@dte@subparagraph@maxnumwidth=\skip58
Class scrartcl Info: using compatibility default `runin=bysign'
(scrartcl)           for `\subparagraph on input line 4900.
Class scrartcl Info: using compatibility default `afterindent=bysign'
(scrartcl)           for `\subparagraph on input line 4900.
\abovecaptionskip=\skip59
\belowcaptionskip=\skip60
\c@pti@nb@sid@b@x=\box51
Package tocbasic Info: babel extension for `lof' omitted
(tocbasic)             because of missing \bbl@set@language on input line 6075.
\scr@dte@figure@maxnumwidth=\skip61
\c@figure=\count189
Package tocbasic Info: babel extension for `lot' omitted
(tocbasic)             because of missing \bbl@set@language on input line 6087.
\scr@dte@table@maxnumwidth=\skip62
\c@table=\count190
Class scrartcl Info: Redefining `\numberline' on input line 6251.
\bibindent=\dimen138
) (/usr/local/texlive/2021/texmf-dist/tex/latex/base/inputenc.sty
Package: inputenc 2021/02/14 v1.3d Input encoding file
\inpenc@prehook=\toks17
\inpenc@posthook=\toks18
) (/usr/local/texlive/2021/texmf-dist/tex/latex/cleveref/cleveref.sty
Package: cleveref 2018/03/27 v0.21.4 Intelligent cross-referencing
) (/usr/local/texlive/2021/texmf-dist/tex/latex/l3backend/l3backend-pdftex.def
File: l3backend-pdftex.def 2021-07-12 L3 backend support: PDF output (pdfTeX)
\l__color_backend_stack_int=\count191
\l__pdf_internal_box=\box52
) (./output.aux)
\openout1 = `output.aux'.

LaTeX Font Info:    Checking defaults for OML/cmm/m/it on input line 5.
LaTeX Font Info:    ... okay on input line 5.
LaTeX Font Info:    Checking defaults for OMS/cmsy/m/n on input line 5.
LaTeX Font Info:    ... okay on input line 5.
LaTeX Font Info:    Checking defaults for OT1/cmr/m/n on input line 5.
LaTeX Font Info:    ... okay on input line 5.
LaTeX Font Info:    Checking defaults for T1/cmr/m/n on input line 5.
LaTeX Font Info:    ... okay on input line 5.
LaTeX Font Info:    Checking defaults for TS1/cmr/m/n on input line 5.
LaTeX Font Info:    ... okay on input line 5.
LaTeX Font Info:    Checking defaults for OMX/cmex/m/n on input line 5.
LaTeX Font Info:    ... okay on input line 5.
LaTeX Font Info:    Checking defaults for U/cmr/m/n on input line 5.
LaTeX Font Info:    ... okay on input line 5.
Package scrbase Info: activating english \contentsname on input line 5.
Package scrbase Info: activating english \listfigurename on input line 5.
Package scrbase Info: activating english \listtablename on input line 5.
! Missing \endcsname inserted.
<to be read again> 
                   \unhbox 
l.9 \cref{Ä}
             
The control sequence marked <to be read again> should
not appear between \csname and \endcsname.

! Missing \endcsname inserted.
<to be read again> 
                   \unhbox 
l.9 \cref{Ä}
             
The control sequence marked <to be read again> should
not appear between \csname and \endcsname.

! Missing \endcsname inserted.
<to be read again> 
                   \unhbox 
l.9 \cref{Ä}
             
The control sequence marked <to be read again> should
not appear between \csname and \endcsname.

\protect 
! Missing } inserted.
<inserted text> 
                }
l.9 \cref{Ä}
             
I've inserted something that you may have forgotten.
(See the <inserted text> above.)
With luck, this will get me unwedged. But if you
really didn't forget anything, try typing `2' now; then
my insertion and my current dilemma will both disappear.

! Too many }'s.
<argument> ...espaces \relax \accent 127 A\egroup 
                                                  \spacefactor \accent@space...
l.9 \cref{Ä}
             
You've closed more groups than you opened.
Such booboos are generally harmless, so keep going.

! Extra \endcsname.
\cref@getref ...ter #2\csname r@#1@cref\endcsname 
                                                  \expandafter \expandafter ...
l.9 \cref{Ä}
             
I'm ignoring this, since I wasn't doing a \csname.

! Argument of \@firstoftwo has an extra }.
<inserted text> 
                \par 
l.9 \cref{Ä}
             
I've run across a `}' that doesn't seem to match anything.
For example, `\def\a#1{...}' and `\a}' would produce
this error. If you simply proceed now, the `\par' that
I've just inserted will cause me to report a runaway
argument that might be the root of the problem. But if
your `}' was spurious, just type `2' and it will go away.

Runaway argument?
! Paragraph ended before \@firstoftwo was complete.
<to be read again> 
                   \par 
l.9 \cref{Ä}
             
I suspect you've forgotten a `}', causing me to apply this
control sequence to too much text. How can we recover?
My plan is to forget the whole thing and hope for the best.

Runaway argument?
! Paragraph ended before \@@cref@gettype was complete.
<to be read again> 
                   \par 
l.9 \cref{Ä}
             
I suspect you've forgotten a `}', causing me to apply this
control sequence to too much text. How can we recover?
My plan is to forget the whole thing and hope for the best.

! Undefined control sequence.
\cref@gettype ...ter \@cref@gettype \@tempa \@nil 
                                                  #2
l.9 \cref{Ä}
             
The control sequence at the end of the top line
of your error message was never \def'ed. If you have
misspelled it (e.g., `\hobx'), type `I' and the correct
spelling (e.g., `I\hbox'). Otherwise just continue,
and I'll forget about whatever was undefined.

! Undefined control sequence.
<argument> \@type 
                  
l.9 \cref{Ä}
             
The control sequence at the end of the top line
of your error message was never \def'ed. If you have
misspelled it (e.g., `\hobx'), type `I' and the correct
spelling (e.g., `I\hbox'). Otherwise just continue,
and I'll forget about whatever was undefined.

! Undefined control sequence.
\cref@isrefsametype ...after {\csname cref@\@type 
                                                  @format\endcsname {\@dummy...
l.9 \cref{Ä}
             
The control sequence at the end of the top line
of your error message was never \def'ed. If you have
misspelled it (e.g., `\hobx'), type `I' and the correct
spelling (e.g., `I\hbox'). Otherwise just continue,
and I'll forget about whatever was undefined.

! Missing \endcsname inserted.
<to be read again> 
                   \unhbox 
l.9 \cref{Ä}
             
The control sequence marked <to be read again> should
not appear between \csname and \endcsname.

\protect 
! Missing } inserted.
<inserted text> 
                }
l.9 \cref{Ä}
             
I've inserted something that you may have forgotten.
(See the <inserted text> above.)
With luck, this will get me unwedged. But if you
really didn't forget anything, try typing `2' now; then
my insertion and my current dilemma will both disappear.

! Extra \endgroup.
<recently read> \endgroup 
                          
l.9 \cref{Ä}
             
Things are pretty mixed up, but I think the worst is over.

! Extra \endgroup.
<argument> ...n input line 9.}\endgroup \endgroup 
                                                  \relax \let \ignorespaces ...
l.9 \cref{Ä}
             
Things are pretty mixed up, but I think the worst is over.

! Too many }'s.
<argument> ...espaces \relax \accent 127 A\egroup 
                                                  \spacefactor \accent@space...
l.9 \cref{Ä}
             
You've closed more groups than you opened.
Such booboos are generally harmless, so keep going.

! Extra \endcsname.
\cref@getref ...ter #2\csname r@#1@cref\endcsname 
                                                  \expandafter \expandafter ...
l.9 \cref{Ä}
             
I'm ignoring this, since I wasn't doing a \csname.

! Argument of \@firstoftwo has an extra }.
<inserted text> 
                \par 
l.9 \cref{Ä}
             
I've run across a `}' that doesn't seem to match anything.
For example, `\def\a#1{...}' and `\a}' would produce
this error. If you simply proceed now, the `\par' that
I've just inserted will cause me to report a runaway
argument that might be the root of the problem. But if
your `}' was spurious, just type `2' and it will go away.

Runaway argument?
! Paragraph ended before \@firstoftwo was complete.
<to be read again> 
                   \par 
l.9 \cref{Ä}
             
I suspect you've forgotten a `}', causing me to apply this
control sequence to too much text. How can we recover?
My plan is to forget the whole thing and hope for the best.

Runaway argument?
! Paragraph ended before \@@cref@gettype was complete.
<to be read again> 
                   \par 
l.9 \cref{Ä}
             
I suspect you've forgotten a `}', causing me to apply this
control sequence to too much text. How can we recover?
My plan is to forget the whole thing and hope for the best.

! Undefined control sequence.
\cref@gettype ...ter \@cref@gettype \@tempa \@nil 
                                                  #2
l.9 \cref{Ä}
             
The control sequence at the end of the top line
of your error message was never \def'ed. If you have
misspelled it (e.g., `\hobx'), type `I' and the correct
spelling (e.g., `I\hbox'). Otherwise just continue,
and I'll forget about whatever was undefined.

! Undefined control sequence.
<argument> \@type 
                  
l.9 \cref{Ä}
             
The control sequence at the end of the top line
of your error message was never \def'ed. If you have
misspelled it (e.g., `\hobx'), type `I' and the correct
spelling (e.g., `I\hbox'). Otherwise just continue,
and I'll forget about whatever was undefined.

! Undefined control sequence.
\cref@isrefsametype ...after {\csname cref@\@type 
                                                  @format\endcsname {\@dummy...
l.9 \cref{Ä}
             
The control sequence at the end of the top line
of your error message was never \def'ed. If you have
misspelled it (e.g., `\hobx'), type `I' and the correct
spelling (e.g., `I\hbox'). Otherwise just continue,
and I'll forget about whatever was undefined.

! Extra \endgroup.
<recently read> \endgroup 
                          
l.9 \cref{Ä}
             
Things are pretty mixed up, but I think the worst is over.

! Undefined control sequence.
<argument> ...@stack@pull \expandafter {\@nextref 
                                                  }{\@refsubstack }\else \ex...
l.9 \cref{Ä}
             
The control sequence at the end of the top line
of your error message was never \def'ed. If you have
misspelled it (e.g., `\hobx'), type `I' and the correct
spelling (e.g., `I\hbox'). Otherwise just continue,
and I'll forget about whatever was undefined.

! Undefined control sequence.
<argument> \@refsubstack 
                         
l.9 \cref{Ä}
             
The control sequence at the end of the top line
of your error message was never \def'ed. If you have
misspelled it (e.g., `\hobx'), type `I' and the correct
spelling (e.g., `I\hbox'). Otherwise just continue,
and I'll forget about whatever was undefined.

)
Runaway argument?
{}{\@refsubstack }\else \expandafter \cref@stack@pull \expandafter {\@nextref \ETC.
! File ended while scanning use of \@cref@stack@pull.
<inserted text> 
                \par 
<*> main.tex
            
I suspect you have forgotten a `}', causing me
to read past where you wanted me to stop.
I'll try to recover; but if the error is serious,
you'd better type `E' or `X' now and fix your file.

! Emergency stop.
<*> main.tex
            
*** (job aborted, no legal \end found)

 
Here is how much of TeX's memory you used:
 4996 strings out of 478542
 114618 string characters out of 5850413
 539058 words of memory out of 5000000
 22983 multiletter control sequences out of 15000+600000
 404623 words of font info for 31 fonts, out of 8000000 for 9000
 1141 hyphenation exceptions out of 8191
 108i,1n,108p,10626b,270s stack positions out of 5000i,500n,10000p,200000b,80000s
!  ==> Fatal error occurred, no output PDF file produced!
14
  • 5
    The next latex should solve that. You can try it by using pdflatex-dev instead of pdflatex. Apr 20, 2022 at 11:12
  • 1
    Welcome to TeX.SE. I experience no problems compiling your test document under LuaLaTeX or XeLaTeX if I remove the directive \usepackage[utf8]{inputenc} and run \usepackage{fontspec} instead.
    – Mico
    Apr 20, 2022 at 11:22
  • 2
    My suggestion is "don't do that". Labels and references are internals, so there is no need to use non-ascii chars there. Your document will be much more robust. Unless, that is, you switch to an Unicode engine.
    – Rmano
    Apr 20, 2022 at 11:23
  • 3
    @Rmano umlauts in labels and refs works fine in a current latex and imho they should. It is a cleveref problem that it doesn't handle that correctly. Apr 20, 2022 at 11:54
  • 2
    @yo' I would never use spaces in my filenames, but I don't think that you should call umlauts like öäü or greek or cyrillic letters "weird". They are quite normal letters. Apr 20, 2022 at 12:04

1 Answer 1

3

cleveref uses \edef in various places and so break the umlauts.

You can fetch from a current tex system from the latex-dev a newer utf8.def [2022/02/13 v1.3a UTF-8 support] and copy it to your project folder and try if it works.

8
  • \usepackage[T1]{fontenc} doesn't work for me. The errors are gone, but the labels aren't found. I have ?? in the PDF instead of the correct reference.
    – jabaa
    Apr 20, 2022 at 12:20
  • oh, well. Yes. cleveref is a pain here. I removed that. Apr 20, 2022 at 12:27
  • Do you know a way to download this file. TBH I don't even know what to search for or how to install pdflatex-dev or latex-dev. Is this a package or an executable? Do you mean this ctan.org/pkg/latex-base-dev?
    – jabaa
    Apr 20, 2022 at 12:41
  • I downloaded mirrors.ctan.org/install/macros/latex-dev/…, extracted it and found /tex/latex-dev/base/utf8.def. I uploaded the file to Overleaf into the root of my project next to main.tex. It doesn't seem to work. Same errors. Does the compiler really search in the project folder for utf8.def?
    – jabaa
    Apr 20, 2022 at 12:48
  • It worked after I renamed the file. There seems to be a name conflict and the system utf8.def has priority. I changed the filename to utf8x.def and \usepackage[utf8]{inputenc} to \usepackage[utf8x]{inputenc}
    – jabaa
    Apr 20, 2022 at 12:51

You must log in to answer this question.

Not the answer you're looking for? Browse other questions tagged .