我是法国人,我想更改 crefname。问题是,添加以重音字母开头的 crefname 在使用\Cref
命令时会导致错误。这是我的 MWE:
\documentclass[11pt, a4paper]{article}
\usepackage[utf8]{inputenc}
\usepackage[T1]{fontenc}
\usepackage[french]{babel}
\usepackage[french]{cleveref}
\crefname{figure}{équation}{équation}
\begin{document}
\begin{figure}
foobar
\caption{baz}
\label{qux}
\end{figure}
\Cref{qux}
Équation
\end{document}
取消注释该行\crefname{figure}{équation}{équation}
会产生以下错误:
! Argument of \UTFviii@two@octets has an extra }.
<inserted text>
\par
l.20 \Cref{qux}
Runaway argument?
! Paragraph ended before \UTFviii@two@octets was complete.
<to be read again>
\par
l.20 \Cref{qux}
! Package inputenc Error: Keyboard character used is undefined
(inputenc) in inputencoding `utf8'.
See the inputenc package documentation for explanation.
Type H <return> for immediate help.
...
l.20 \Cref{qux}
! Argument of \UTFviii@two@octets has an extra }.
<inserted text>
\par
l.20 \Cref{qux}
Runaway argument?
! Paragraph ended before \UTFviii@two@octets was complete.
<to be read again>
\par
l.20 \Cref{qux}
! Package inputenc Error: Keyboard character used is undefined
(inputenc) in inputencoding `utf8'.
See the inputenc package documentation for explanation.
Type H <return> for immediate help.
...
l.20 \Cref{qux}
您知道如何使用 cleveref 来强调首字母吗?
谢谢。
答案1
两种可能:
\crefname{figure}{{é}quation}{{é}quations}
或者
\crefname{figure}{équation}{équations}
\Crefname{figure}{Équation}{Équations}
我认为后者最好。