我是法國人,我想更改一個名字。問題在於,新增以重音字母開頭的 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}
我相信後者是最好的。