Overleaf 中带有 cleveref 的标签中的非 ASCII 字符

Overleaf 中带有 cleveref 的标签中的非 ASCII 字符

我在 Overleaf 中协作处理 LaTeX 文档,一些团队成员在标签中使用德语变音符号 (ä、ö、ü、Ä、Ö、Ü)。它适用于\ref

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

\begin{document}

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

现在,我想引入 cleveref 并引用它们的标签,但 cleveref 无法处理这些变音符号。以下代码会导致错误:

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

\begin{document}

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

是否可以使用这些标签而不更改它们?我无法更改其他人的标签。如果不可能,我必须坚持使用\ref

这是包含错误消息的日志:

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!

答案1

cleveref\edef在各个地方使用,从而打破了变音符号。

您可以从当前 tex 系统中获取latex-dev较新的 utf8.def [2022/02/13 v1.3a UTF-8 support],并将其复制到您的项目文件夹并尝试其是否有效。

相关内容