使用 `cleveref` 分离推论

使用 `cleveref` 分离推论

我问了一个问题这里关于分离推论,得到了很好的答案。但是,我应该说明我也在使用cleveref,我不清楚如何调整这些答案,以免在必须通过\cref{}& co 引用推论时崩溃。@egreg例如,在尝试了 的答案后,在引用定理 3.7 的第一个推论后,我得到了

??3.7.1

其中 3.7 奇怪地链接到了主定理而不是推论。”推论3.7.1”原文中也有类似的超链接。

我的推论目前定义如下:

\documentclass[11pt,a4paper]{book}
\usepackage[utf8]{inputenc}
\usepackage[english]{babel}
\usepackage{amsmath,mathtools,amsthm,thmtools}
\usepackage[capitalize]{cleveref}

\declaretheoremstyle[
spaceabove=6pt, spacebelow=6pt,
headfont=\normalfont\bfseries,
notefont=\normalfont\bfseries, notebraces={\bfseries(}{\bfseries)},
bodyfont=\normalfont\itshape,
postheadspace=1em,
]{accent}
\declaretheoremstyle[
spaceabove=6pt, spacebelow=6pt,
headfont=\small\normalfont\bfseries,
notefont=\small\normalfont\bfseries, notebraces={\small\bfseries(}{\small\bfseries)},
bodyfont=\small\normalfont\itshape,
postheadspace=1em,
]{*accent}

\newcommand{\difficultsignal}{$\boldsymbol\ast$}

% names (needed because I work with multiple languages)
\newcommand{\theoremname}{theoremname}
\newcommand{\theoremnames}{theoremnames}
\newcommand{\Theoremname}{Theoremname}
\newcommand{\Theoremnames}{Theoremnames}
\newcommand{\propositionname}{propositionname}
\newcommand{\propositionnames}{propositionnames}
\newcommand{\Propositionname}{Propositionname}
\newcommand{\Propositionnames}{Propositionnames}
\newcommand{\lemmaname}{lemmaname}
\newcommand{\lemmanames}{lemmanames}
\newcommand{\Lemmaname}{Lemmaname}
\newcommand{\Lemmanames}{Lemmanames}
\newcommand{\corollaryname}{corollaryname}
\newcommand{\corollarynames}{corollarynames}
\newcommand{\Corollaryname}{Corollaryname}
\newcommand{\Corollarynames}{Corollarynames}

\renewcommand{\theoremname}{theorem}
\renewcommand{\theoremnames}{theorems}
\renewcommand{\Theoremname}{Theorem}
\renewcommand{\Theoremnames}{Theorems}
\renewcommand{\propositionname}{proposition}
\renewcommand{\propositionnames}{propositions}
\renewcommand{\Propositionname}{Proposition}
\renewcommand{\Propositionnames}{Propositions}
\renewcommand{\lemmaname}{lemma}
\renewcommand{\lemmanames}{lemmas}
\renewcommand{\Lemmaname}{Lemma}
\renewcommand{\Lemmanames}{Lemmas}
\renewcommand{\corollaryname}{corollary}
\renewcommand{\corollarynames}{corollaries}
\renewcommand{\Corollaryname}{Corollary}
\renewcommand{\Corollarynames}{Corollaries}

% theorems
\declaretheorem[
    style=accent,
    name={\Theoremname},
    refname={\theoremname,\theoremnames},
    Refname={\Theoremname,\Theoremnames},
    numberwithin=chapter,
]{thm}
\declaretheorem[
    style=*accent,
    name={\difficultsignal\Theoremname},
    refname={\theoremname,\theoremnames},
    Refname={\Theoremname,\Theoremnames},
    numberlike=thm,
]{*thm}
\declaretheorem[
    style=accent,
    name={\Theoremname},
    refname={\theoremname,\theoremnames},
    Refname={\Theoremname,\Theoremnames},
    unnumbered,
]{thm*}

% propositions
\declaretheorem[
    style=accent,
    name={\Propositionname},
    refname={\propositionname,\propositionnames},
    Refname={\Propositionname,\Propositionnames},
    numberlike=thm,
    %qed=$\diamondsuit$
]{prop}
\declaretheorem[
    style=*accent,
    name={\difficultsignal\Propositionname},
    refname={\propositionname,\propositionnames},
    Refname={\Propositionname,\Propositionnames},
    numberlike=thm,
    %qed=$\diamondsuit$
]{*prop}
\declaretheorem[
    style=accent,
    name={\Propositionname},
    refname={\propositionname,\propositionnames},
    Refname={\Propositionname,\Propositionnames},
    unnumbered,
    %qed=$\diamondsuit$
]{prop*}

% lemmas
\declaretheorem[
    style=accent,
    name={\Lemmaname},
    refname={\lemmaname,\lemmanames},
    Refname={\Lemmaname,\Lemmanames},
    numberlike=thm,
    %qed=$\diamondsuit$
]{lem}
\declaretheorem[
    style=*accent,
    name={\difficultsignal\Lemmaname},
    refname={\lemmaname,\lemmanames},
    Refname={\Lemmaname,\Lemmanames},
    numberlike=thm,
    %qed=$\diamondsuit$
]{*lem}
\declaretheorem[
    style=accent,
    name={\Lemmaname},
    refname={\lemmaname,\lemmanames},
    Refname={\Lemmaname,\Lemmanames},
    unnumbered,
    %qed=$\diamondsuit$
]{lem*}

% corollaries
\declaretheorem[
    style=accent,
    name={\Corollaryname},
    refname={\corollaryname,\corollarynames},
    Refname={\Corollaryname,\Corollarynames},
    parent=thm,
    %qed=$\diamondsuit$
]{cor}
\declaretheorem[
    style=*accent,
    name={\difficultsignal\Corollaryname},
    refname={\corollaryname,\corollarynames},
    Refname={\Corollaryname,\Corollarynames},
    parent=thm,
    %qed=$\diamondsuit$
]{*cor}
\declaretheorem[
    style=accent,
    name={\Corollaryname},
    refname={\corollaryname,\corollarynames},
    Refname={\Corollaryname,\Corollarynames},
    unnumbered,
    %qed=$\diamondsuit$
]{cor*}

有没有办法用 来做到这一点\declaretheorem,以便我仍然可以指定refnameRefname

相关内容