定理参考文献未打印定理编号

定理参考文献未打印定理编号

当我引用定理框时,它仅包含章节号和节号,但不包含定理号。这是定理 tcolorbox 的代码


\tcbuselibrary{theorems,skins,hooks}
\newtcbtheorem[number within=section]{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}
}
{th}

现在当我创建一个带有标签的定理时

\begin{Theorem}{}{} 
    \label{limitpoint} $x$ is a limit point of $S$ $\iff$ every neighborhood of $x$ in $X$ contains a point of $S$ other than $S$.
\end{Theorem}
\ref{limitpoint}

它只打印 1.1,而应该打印 1.1.1。

答案1

标签limitpoints必须放在最后一个强制参数中,并且您需要引用它,因为th:limitpointth是您在定义定理环境时声明的。

\documentclass{book}

\usepackage[many]{tcolorbox}
\tcbuselibrary{theorems,skins,hooks}
\newtcbtheorem[number within=section]{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},
}
{th}

\colorlet{mytheorembg}{blue!20}
\colorlet{mytheoremfr}{red!20!blue}

\begin{document}

\chapter{Title}
\section{Title}

\begin{Theorem}{}{limitpoint}
$x$ is a limit point of $S$ if and only if every neighborhood of $x$ in $X$ 
contains a point of $S$ other than $x$.
\end{Theorem}

\ref{th:limitpoint}

\end{document}

在此处输入图片描述

我改变了所有逗号的位置,因为我无法忍受看到它们在左边,因为它们指的是前一行。

我也将其改为$\iff$“当且仅当”:使用文字代替神秘的符号成本很小(并且修复了语句)。

相关内容