尽管标签名称不同,仍会显示“存在多个定义的标签”错误

尽管标签名称不同,仍会显示“存在多个定义的标签”错误

我最近遇到了一个漂亮的LaTex模板以获得讲座笔记。

在此处输入图片描述

我正在尝试调整它以满足我的需求。我在 overleaf 上编译了以下 tex 模板并收到警告

Label `abc' multiply defined.
Label `abc@cref' multiply defined.
There were multiply-defined labels.

两个标签的名称分别为probaabc,因此它们是不同的。

您能详细说明警告的原因吗?非常感谢您的详细说明!

\documentclass{report}
\usepackage[tmargin=2cm,rmargin=1in,lmargin=1in,margin=0.85in,bmargin=2cm,footskip=.2in]{geometry}
\usepackage[varbb]{newpxmath}
\usepackage{hyperref,theoremref}
\usepackage[noabbrev,capitalize,nameinlink]{cleveref}
\hypersetup{
    pdftitle={Assignment},
    colorlinks=true, linkcolor=doc!90,
    bookmarksnumbered=true,
    bookmarksopen=true
}
\usepackage[most,many,breakable]{tcolorbox}
\usepackage{varwidth}
\usepackage{varwidth}
\definecolor{mytheorembg}{HTML}{F2F2F9}
\definecolor{mytheoremfr}{HTML}{00007B}
\definecolor{mydefinitbg}{HTML}{E5E5FF}
\definecolor{mydefinitfr}{HTML}{3F3FA3}
\definecolor{doc}{RGB}{0,60,110}
\setlength{\parindent}{1cm}


%================================
% THEOREM BOX
%================================
\tcbuselibrary{theorems,skins,hooks}
\newtcbtheorem[number within=chapter, crefname={theorem}{Theorem}]{theorem}{Theorem}
{%
    enhanced,
    breakable,
    colback = mytheorembg,
    frame hidden,
    boxrule = 0sp,
    borderline west = {2pt}{0pt}{mytheoremfr},
    sharp corners,
    detach title,
    before upper = \tcbtitle\par\smallskip,
    coltitle = mytheoremfr,
    fonttitle = \bfseries\sffamily,
    description font = \mdseries,
    separator sign none,
    segmentation style={solid, mytheoremfr},
}{}

%================================
% DEFINITION BOX
%================================
\newtcbtheorem[number within=chapter, crefname={definition}{Definition}]{definition}{Definition}{enhanced,
    before skip=2mm,after skip=2mm, colback=red!5,colframe=red!80!black,boxrule=0.5mm,
    attach boxed title to top left={xshift=1cm,yshift*=1mm-\tcboxedtitleheight}, varwidth boxed title*=-3cm,
    boxed title style={frame code={
                    \path[fill=tcbcolback]
                    ([yshift=-1mm,xshift=-1mm]frame.north west)
                    arc[start angle=0,end angle=180,radius=1mm]
                    ([yshift=-1mm,xshift=1mm]frame.north east)
                    arc[start angle=180,end angle=0,radius=1mm];
                    \path[left color=tcbcolback!60!black,right color=tcbcolback!60!black,
                        middle color=tcbcolback!80!black]
                    ([xshift=-2mm]frame.north west) -- ([xshift=2mm]frame.north east)
                    [rounded corners=1mm]-- ([xshift=1mm,yshift=-1mm]frame.north east)
                    -- (frame.south east) -- (frame.south west)
                    -- ([xshift=-1mm,yshift=-1mm]frame.north west)
                    [sharp corners]-- cycle;
                },interior engine=empty,
        },
    fonttitle=\bfseries,
    title={#2},#1}{def}



\begin{document}

\begin{theorem}[label={proba}]{Ohlala}{}
xyz
\end{theorem}

\begin{definition}[label={abc}]{Markov chain}{}
abc
\end{definition}

Thanks to \Cref{proba} and \cref{abc}

\end{document}

相关内容