列表定理和 ntheorem 存在问题。与 hyperref 冲突?

列表定理和 ntheorem 存在问题。与 hyperref 冲突?

我对我的定理的定义如下

\documentclass[a4paper,twoside]{article}

\usepackage{amsmath,amsfonts,mathtools,framed}
\usepackage{enumitem} % einfacher Nummerierung verändern
\usepackage{listofitems} % für Farben für Kapitel

%%%%%%%%%%%%%%%%%%Theoreme%%%%%%%%%%%%%%%%%%%%%%%%%%
\usepackage[thmmarks,framed,thref]{ntheorem} % [thmmarks] guarantees endmarks

%theorem
\usepackage{tcolorbox}
\tcbuselibrary{theorems}
\newtcbtheorem[number within=subsection]{thm}{Satz} 
{{colback=\mycolors[\thesection]!5},
{colframe=\mycolors[\thesection]!95!black},
fonttitle=\scshape\bfseries,
before skip=15pt plus 2pt,after skip=15pt plus 2pt}{th}

\setsepchar{,}
\readlist\mycolors{amaranth,blue,orange,purple}

\newcounter{counter} 
\numberwithin{counter}{subsection}

% defn
\theoremstyle{break}
\theoremprework{\medbreak}
\theorempostwork{\medbreak}
\theorembodyfont{\normalfont}
\theoremheaderfont{\kern-5mm\bfseries} 
\theoremindent=5mm
\def\theoremframecommand{\colorbox{\mycolors[\thesection]!10}}
\newshadedtheorem{defn}[counter]{\textsc{Definition}}
\newframedtheorem{altdef}[counter]{\textsc{Alternative Definition}}

%lemma
\theoremstyle{break}
\theoremprework{%
\def\FrameCommand{
{\color{\mycolors[\thesection]}{\hspace{-8pt}\vrule width 2pt     \hspace{6pt}}}}
\medbreak}
\theorempostwork{\medbreak}
\theorembodyfont{\itshape}
\theoremheaderfont{\kern-5mm\normalfont\bfseries} 
\theoremindent0.5cm
\newframedtheorem{lemma}[counter]{Lemma}

\definecolor{amaranth}{HTML}{a82337}
\definecolor{orange}{HTML}{BF7F00}
\definecolor{blue}{HTML}{016FB9}
\definecolor{purple}{HTML}{603C96}

\usepackage[bookmarks=true,colorlinks=true,linkcolor=black]{hyperref}
\usepackage[headheight=12.6pt, includehead, includefoot, hscale=0.60, vscale=0.90]{geometry}

\newtheoremlisttype{tab}%
{\begin{tabular*}{\linewidth}{@{}lrl@{\extracolsep{\fill}}r@{}}}%
{##1&##2&##3&##4\\}%
{\end{tabular*}}
\begin{document}
\section{first section}
\begin{lemma}[first lemma]
This is a lemma
\end{lemma}

oh, another lemma!

\begin{lemma}[second lemma]
This is a lemma, also.
\end{lemma}

oh, another lemma!

\begin{lemma}[third lemma]
This is a lemma, also.
\end{lemma}

oh, another lemma!

\begin{lemma}[fourth lemma]
This is a lemma, also.
\end{lemma}

\begin{lemma}[another lemma]
This is a lemma, also.
\end{lemma}

\begin{lemma}[another lemma]
This is a lemma, also.
\end{lemma}
\begin{lemma}[another lemma]
This is a lemma, also.
\end{lemma}
\begin{lemma}[another lemma]
This is a lemma, also.
\end{lemma}
\begin{lemma}[another lemma]
This is a lemma, also.
\end{lemma}        
\section{Alle wichtigen Definitionen und Lemmata}
\theoremlisttype{tab}
\listtheorems{defn,lemma}
\end{document}

现在我想使用 ntheorem 文档中的以下扩展,但计数器再次弹出 :/ 奖励:如何列出所有定理和引理?

答案1

ntheorem包有一个特殊的选项,使其与该hyperref包兼容:

\documentclass[a4paper,twoside]{article}

\usepackage{amsmath,amsfonts,mathtools,framed}
\usepackage{enumitem} % einfacher Nummerierung verändern
\usepackage{listofitems} % für Farben für Kapitel

%%%%%%%%%%%%%%%%%%Theoreme%%%%%%%%%%%%%%%%%%%%%%%%%%
\usepackage[thmmarks,framed,thref,hyperref]{ntheorem} % [thmmarks] guarantees endmarks

%theorem
\usepackage{tcolorbox}
\tcbuselibrary{theorems}
\newtcbtheorem[number within=subsection]{thm}{Satz} 
{{colback=\mycolors[\thesection]!5},
{colframe=\mycolors[\thesection]!95!black},
fonttitle=\scshape\bfseries,
before skip=15pt plus 2pt,after skip=15pt plus 2pt}{th}

\setsepchar{,}
\readlist\mycolors{amaranth,blue,orange,purple}

\newcounter{counter} 
\numberwithin{counter}{subsection}

% defn
\theoremstyle{break}
\theoremprework{\medbreak}
\theorempostwork{\medbreak}
\theorembodyfont{\normalfont}
\theoremheaderfont{\kern-5mm\bfseries} 
\theoremindent=5mm
\def\theoremframecommand{\colorbox{\mycolors[\thesection]!10}}
\newshadedtheorem{defn}[counter]{\textsc{Definition}}
\newframedtheorem{altdef}[counter]{\textsc{Alternative Definition}}

%lemma
\theoremstyle{break}
\theoremprework{%
\def\FrameCommand{
{\color{\mycolors[\thesection]}{\hspace{-8pt}\vrule width 2pt     \hspace{6pt}}}}
\medbreak}
\theorempostwork{\medbreak}
\theorembodyfont{\itshape}
\theoremheaderfont{\kern-5mm\normalfont\bfseries} 
\theoremindent0.5cm
\newframedtheorem{lemma}[counter]{Lemma}

\definecolor{amaranth}{HTML}{a82337}
\definecolor{orange}{HTML}{BF7F00}
\definecolor{blue}{HTML}{016FB9}
\definecolor{purple}{HTML}{603C96}

\usepackage[bookmarks=true,colorlinks=true,linkcolor=black]{hyperref}
\usepackage[headheight=12.6pt, includehead, includefoot, hscale=0.60, vscale=0.90]{geometry}
\begin{document}
\section{first section}
\begin{lemma}[first lemma]
This is a lemma
\end{lemma}

oh, another lemma!

\begin{lemma}[second lemma]
This is a lemma, also.
\end{lemma}

\section{Alle wichtigen Definitionen und Lemmata}
\listtheorems{defn,lemma}
\end{document}

在此处输入图片描述

相关内容