
我試圖在附錄中的文件末尾獲取定義(定理)列表。不幸的是,該列表是空的。我嘗試使用這裡的描述但它不起作用(對我來說)。此處標示「問題清單」的「Definitionsverzeichnis」應如下所示:我沒有發現錯誤,而且我找了 4 個小時都沒有,所以有點令人沮喪。
在使用 tcbtheorem 之前,我使用了 mdtheorem,獲得定理列表沒有問題。不過,現在不行了…
也許有人可以幫助我,因為 tcb 定理看起來非常好,我只是想保留它們。
這是我的 MWE:
\documentclass[ngerman,12pt, listof=totocnumbered, toc=bibliographynumbered,appendixprefix = on]{scrartcl} %scrartcl article}
\usepackage[ngerman]{babel}
% preamble
\usepackage{tcolorbox}
\tcbuselibrary{theorems}
\tcbuselibrary{skins}
\usepackage{amsthm}
\usepackage{thmtools}
\usepackage{cleveref}
\usepackage{thmtools}
\usepackage[framemethod=tikz]{mdframed}
% definiton
\tcbset{
defstyle/.style={fonttitle=\bfseries\upshape,fontupper=\slshape,arc=0mm,colback=blue!5!white,colframe=blue!75!black},
theostyle/.style={fonttitle=\bfseries\upshape, fontupper=\slshape,colback=red!10!white,colframe=red!75!black},
}
\newtcbtheorem[number within=subsection,crefname={definition}{definitions}, list inside={qst}]{Definition}{defstyle}{def}{qst}
\newtcbtheorem[use counter from=Definition, crefname={theorem}{theorems}, list inside={qst}]{Theorem}{theostyle}{theo}{qst}
\newtcbtheorem[use counter from=Definition,crefname={corollary}{corollaries}]{Corollary}{Corollary}{theostyle}{cor}
\newtcbtheorem[use counter from=Definition]{definition}{Definition}{theorem style=plain,enhanced,colframe=blue!50!black,colback=yellow!20!white,coltitle=red!50!black,fonttitle=\upshape\bfseries,fontupper=\itshape,drop fuzzy shadow=blue!50!black!50!white,boxrule=0.4pt}{theo}
% theorem
\newtheorem{satz}{Satz}
\begin{document}
\section{hello}
\subsection{world}
\section{new section}
\subsection{new subsection for definitons}
% example definition
\begin{definition}{Hello}{labelHEY}%
\newline
a nice definition
\end{definition}
% example theorem
\begin{tcolorbox}[colback=gray!10!white,colframe=red!60!black,sharp corners=all ]
\begin{satz}
this is not a proof, just a theorem
\end{satz}
\end{tcolorbox}
% appendix,
\tcblistof[\section]{qst}{Definitionsverzeichnis}
\end{document}
非常感謝您的幫助和時間。
答案1
不要為同一件事加載很多包。這只會讓程式碼變得非常混亂。堅持其中一個,然後檢查文檔,以便獲得正確的論點。
\documentclass[ngerman,12pt, listof=totocnumbered, toc=bibliographynumbered,appendixprefix = on]{scrartcl} %scrartcl article}
\usepackage[ngerman]{babel}
% preamble
\usepackage{tcolorbox}
\tcbuselibrary{theorems}
\tcbuselibrary{skins}
\usepackage{cleveref}
% definiton
\tcbset{
defstyle/.style=
{fonttitle=\bfseries\upshape,fontupper=\slshape,arc=0mm,colback=blue!5!white,colframe=blue!75!black},
theostyle/.style=
{fonttitle=\bfseries\upshape, fontupper=\slshape,colback=red!10!white,colframe=red!75!black},
}
\newtcbtheorem[number within=subsection,
crefname={definition}{definitions},
list inside={qst}] %init
{definition} %name
{Definition} %display
{defstyle} %options
{def} %prefix
\newtcbtheorem[use counter from=definition, crefname={theorem}{theorems},
list inside={qst}]
{theorem}
{Theorem}
{theostyle}
{theo}
\begin{document}
\section{hello}
\subsection{world}
\section{new section}
\subsection{new subsection for definitons}
% example definition
\begin{definition}{Hello Definition}{labelHEY}%
a nice definition
\end{definition}
\begin{theorem}{Hello Theorem}{labelHEY}%
a nice theorem
\end{theorem}
\tcblistof[\section]{qst}{Definitionsverzeichnis}
\end{document}