我使用cleveref
带有选项的包capitalise
。有一次我想使用小写版本的子部分名称,所以我尝试了\lcnamecrefs
。这对于部分来说很有效,但对于子部分,它会产生以下错误消息:
! Argument of \MakeUppercase has an extra }.
<inserted text>
\par
l.10 \lcnamecrefs{sec:test}
梅威瑟:
\documentclass{book}
\usepackage{hyperref}
\usepackage[capitalise,noabbrev,nameinlink]{cleveref}
\crefname{subsection}{Subsection}{Subsections}
\begin{document}
\lcnamecrefs{sec:test} not working: should be subsections
\namecrefs{sec:test} works correctly: Subsections
\cref{sec:test} works correctly: Subsection 0.0.1
\subsection{test}
\label{sec:test}
\end{document}
答案1
您应该添加明确的大写定义,以便 cleverref 不会使用以下内容构建它\MakeUppercase
:
\documentclass{book}
\usepackage{hyperref}
\usepackage[capitalise,noabbrev,nameinlink]{cleveref}
\Crefname{subsection}{Subsection}{Subsections}
\crefname{subsection}{Subsection}{Subsections}
\begin{document}
\lcnamecrefs{sec:test} works correctly: subsections
\namecrefs{sec:test} works correctly: Subsections
\cref{sec:test} works correctly: Subsection 0.0.1
\subsection{test}
\label{sec:test}
\end{document}