正在重述定义。MWE 在定义列表中列出了原始版本。我希望重述版本也出现。(如果列表条目相同,则没问题。)
\documentclass[11pt]{book}
\usepackage{tcolorbox}%---This is where the PACKAGE must be.
\tcbuselibrary{%Begin load libraries for tcolorbox
skins,%
}%End load libraries for tcolorbox
\usepackage[hyperfootnotes=false]{hyperref}%[pdfborder={0 0 0}]
\usepackage{cleveref}
%$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$ Begin new tcolorbox - COMMANDS must be after cleveref.
\newcounter{dft}%
\newtcolorbox%
[%beginForReferences
use counter= dft,
number within=chapter,
list inside= dft,%creates the list under tcblistof
crefname={definition}{definitions},
Crefname={Definition}{Definitions},
]%endForReferences
{efinition}%
[2][]%
{%
detach title,
coltitle=black,
nameref={#2},%
before upper={\tcbtitle\quad},%
code={\gdef\mytitleagree{\textbf{#2}}},%%Used to include mytitle in the ``number''
title=DEFINITION \thetcbcounter \, #2,%
nameref=#2,%
list entry={DEFINITION ~\thetcbcounter ~ #2},%
#1,%Required for references.
}%
%=======Begin To restate an already stated definition STURM after YASMAR
\newtcolorbox%
{efinitionRphr}%
[3][]%
{%
detach title,%This prevents the top from being the color of the frame
before upper={\tcbtitle\quad},%This prevents the top from being the color of the frame
enhanced,%
arc=0.2mm,%
colback= yellow,%
colframe= black,%
coltitle=black,%
title= DEFINITION ~\ref{#2}~\nameref{#2},%
list entry={Definition~\thetcbcounter},
#1%
}%
%=======End To restate an already stated definition STURM after YASMAR
%$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$ End new tcolorbox
\begin{document}
\chapter{Original}
\begin{efinition}[label={dft:1-1}]{Maximum}
An input whose output is larger than the outputs for nearby inputs
\end{efinition}
\chapter{Restated}
\begin{efinitionRphr}[label={dft:1-1a}]{dft:1-1}{~}
The biggest of all
\end{efinitionRphr}
\tcblistof[\chapter]{dft}{List of Definitions}
\end{document}
答案1
为了满足你的习惯tcolorbox
出现在定义列表,你必须引用它。这是经过一些更改后的代码
\newtcolorbox[%
use counter= dft,
number within=chapter,
list inside= dft,
crefname={definition}{definitions}
]
{efinitionRphr}
[2][] {%
detach title,
before upper={\tcbtitle\quad},
enhanced,
nameref={#2},
arc=0.2mm,
colback= yellow,
colframe= black,
coltitle=black,
title=DEFINITION~\ref{#2}~\nameref{#2},
list entry={DEFINITION~\ref{#2}~\nameref{#2}},
#1%
}
请注意,你的参数数量tcb
现在只有 2,因此已重启盒子必须像这样改变
\chapter{Restated}
\begin{efinitionRphr}[label={dft:1-1a}]{dft:1-1}
The biggest of all
\end{efinitionRphr}