ElegantBook icon indicating copy to clipboard operation
ElegantBook copied to clipboard

宏包cleveref使用问题

Open i-Faye00 opened this issue 1 year ago • 6 comments

在ElegantBook中添加cleveref宏包,运行无法显示相应的前缀“定理”或“定义”;在ElegantPaper中能使用clereref宏包,但\Cref命令将所有的定理、定义、引理等全部显示为“定理”,(编号没问题,有问题的是前缀名称)。

请问如何解决?

i-Faye00 avatar Jul 13 '22 07:07 i-Faye00

参考 https://github.com/ElegantLaTeX/ElegantBook/issues/194

syvshc avatar Jul 13 '22 07:07 syvshc

谢谢!ElegantBook中已没问题。

ElegantPaper中仍然有cleveref问题,依照#194与其中链接提到方法,仍然没成功······

i-Faye00 avatar Jul 13 '22 08:07 i-Faye00

那提供一个mwe吧

syvshc avatar Jul 13 '22 08:07 syvshc

先谢谢了!

\documentclass[11pt,en,cm]{elegantpaper}
\usepackage{cleveref}
\title{}
\date{}

\begin{document}
\maketitle

\begin{lemma}\label{lemm}
	This is testing cleveref. 
\end{lemma}
\Cref{lemm} should appear as Lemma \ref{lemm}.

\end{document}

i-Faye00 avatar Jul 13 '22 09:07 i-Faye00

\documentclass{article}
\usepackage{aliascnt}
\usepackage{cleveref}
% 新定义 theorem 环境, 产生了 theorem 计数器
\newtheorem{theorem}{Theorem}
% 设置 theorem 计数器的别名 lemma
\newaliascnt{lemma}{theorem}
% 用这个 lemma 计数器来设置 lemma 环境
\newtheorem{lemma}[lemma]{Lemma}
% 修复计数器和环境名都叫 lemma 的问题, 见 texdoc aliascnt
\aliascntresetthe{lemma}
% 设置 cref 的名称
\crefname{lemma}{lemma}{lemmas}
\begin{document}
  \begin{lemma}
    \label{test}
    A test for eleveref.
  \end{lemma}
  \Cref{test}
\end{document}

给你一个 article 下的例子, 可能需要自行重新定义定理类环境

syvshc avatar Jul 13 '22 09:07 syvshc

谢谢啦!我试试!

i-Faye00 avatar Jul 13 '22 12:07 i-Faye00