Advanced Theorems List from ntheorem Documentation throws errors












2















I have defined my theorems as follows



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=scshapebfseries,
before skip=15pt plus 2pt,after skip=15pt plus 2pt}{th}

setsepchar{,}
readlistmycolors{amaranth,blue,orange,purple}

newcounter{counter}
numberwithin{counter}{subsection}

% defn
theoremstyle{break}
theoremprework{medbreak}
theorempostwork{medbreak}
theorembodyfont{normalfont}
theoremheaderfont{kern-5mmbfseries}
theoremindent=5mm
deftheoremframecommand{colorbox{mycolors[thesection]!10}}
newshadedtheorem{defn}[counter]{textsc{Definition}}

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

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

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}


Now I want to use the following extension from the ntheorem documentation, but counters pop up again :/
Bonus: How can I make a list of all theorems and lemmas?










share|improve this question

























  • Can you specify your question? Which extension of ntheorem? What is the desired result? What is wrong with the counters? You have already a list of all lemmata that are used in your example code.

    – dexteritas
    Feb 3 at 13:03











  • The extension is the newtheorentype. It come directly from the documentation of ntheorem and the desired result is the result from the documentation.

    – Viktor Glombik
    Feb 3 at 13:57











  • Do you mean newtheoremlisttype? There are multiple examples in the documentation. So please be more specific where someone should find the desired result. Give a page number or describe the result directly in the question.

    – dexteritas
    Feb 3 at 14:11











  • Yes, I do. The example is found on the bottom of page 26 and the result on page 27, I copied the code from the documentation as last thing in my preamble.

    – Viktor Glombik
    Feb 3 at 15:02
















2















I have defined my theorems as follows



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=scshapebfseries,
before skip=15pt plus 2pt,after skip=15pt plus 2pt}{th}

setsepchar{,}
readlistmycolors{amaranth,blue,orange,purple}

newcounter{counter}
numberwithin{counter}{subsection}

% defn
theoremstyle{break}
theoremprework{medbreak}
theorempostwork{medbreak}
theorembodyfont{normalfont}
theoremheaderfont{kern-5mmbfseries}
theoremindent=5mm
deftheoremframecommand{colorbox{mycolors[thesection]!10}}
newshadedtheorem{defn}[counter]{textsc{Definition}}

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

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

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}


Now I want to use the following extension from the ntheorem documentation, but counters pop up again :/
Bonus: How can I make a list of all theorems and lemmas?










share|improve this question

























  • Can you specify your question? Which extension of ntheorem? What is the desired result? What is wrong with the counters? You have already a list of all lemmata that are used in your example code.

    – dexteritas
    Feb 3 at 13:03











  • The extension is the newtheorentype. It come directly from the documentation of ntheorem and the desired result is the result from the documentation.

    – Viktor Glombik
    Feb 3 at 13:57











  • Do you mean newtheoremlisttype? There are multiple examples in the documentation. So please be more specific where someone should find the desired result. Give a page number or describe the result directly in the question.

    – dexteritas
    Feb 3 at 14:11











  • Yes, I do. The example is found on the bottom of page 26 and the result on page 27, I copied the code from the documentation as last thing in my preamble.

    – Viktor Glombik
    Feb 3 at 15:02














2












2








2








I have defined my theorems as follows



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=scshapebfseries,
before skip=15pt plus 2pt,after skip=15pt plus 2pt}{th}

setsepchar{,}
readlistmycolors{amaranth,blue,orange,purple}

newcounter{counter}
numberwithin{counter}{subsection}

% defn
theoremstyle{break}
theoremprework{medbreak}
theorempostwork{medbreak}
theorembodyfont{normalfont}
theoremheaderfont{kern-5mmbfseries}
theoremindent=5mm
deftheoremframecommand{colorbox{mycolors[thesection]!10}}
newshadedtheorem{defn}[counter]{textsc{Definition}}

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

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

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}


Now I want to use the following extension from the ntheorem documentation, but counters pop up again :/
Bonus: How can I make a list of all theorems and lemmas?










share|improve this question
















I have defined my theorems as follows



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=scshapebfseries,
before skip=15pt plus 2pt,after skip=15pt plus 2pt}{th}

setsepchar{,}
readlistmycolors{amaranth,blue,orange,purple}

newcounter{counter}
numberwithin{counter}{subsection}

% defn
theoremstyle{break}
theoremprework{medbreak}
theorempostwork{medbreak}
theorembodyfont{normalfont}
theoremheaderfont{kern-5mmbfseries}
theoremindent=5mm
deftheoremframecommand{colorbox{mycolors[thesection]!10}}
newshadedtheorem{defn}[counter]{textsc{Definition}}

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

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

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}


Now I want to use the following extension from the ntheorem documentation, but counters pop up again :/
Bonus: How can I make a list of all theorems and lemmas?







lists theorems ntheorem






share|improve this question















share|improve this question













share|improve this question




share|improve this question








edited Feb 1 at 23:07







Viktor Glombik

















asked Jan 31 at 20:52









Viktor GlombikViktor Glombik

1429




1429













  • Can you specify your question? Which extension of ntheorem? What is the desired result? What is wrong with the counters? You have already a list of all lemmata that are used in your example code.

    – dexteritas
    Feb 3 at 13:03











  • The extension is the newtheorentype. It come directly from the documentation of ntheorem and the desired result is the result from the documentation.

    – Viktor Glombik
    Feb 3 at 13:57











  • Do you mean newtheoremlisttype? There are multiple examples in the documentation. So please be more specific where someone should find the desired result. Give a page number or describe the result directly in the question.

    – dexteritas
    Feb 3 at 14:11











  • Yes, I do. The example is found on the bottom of page 26 and the result on page 27, I copied the code from the documentation as last thing in my preamble.

    – Viktor Glombik
    Feb 3 at 15:02



















  • Can you specify your question? Which extension of ntheorem? What is the desired result? What is wrong with the counters? You have already a list of all lemmata that are used in your example code.

    – dexteritas
    Feb 3 at 13:03











  • The extension is the newtheorentype. It come directly from the documentation of ntheorem and the desired result is the result from the documentation.

    – Viktor Glombik
    Feb 3 at 13:57











  • Do you mean newtheoremlisttype? There are multiple examples in the documentation. So please be more specific where someone should find the desired result. Give a page number or describe the result directly in the question.

    – dexteritas
    Feb 3 at 14:11











  • Yes, I do. The example is found on the bottom of page 26 and the result on page 27, I copied the code from the documentation as last thing in my preamble.

    – Viktor Glombik
    Feb 3 at 15:02

















Can you specify your question? Which extension of ntheorem? What is the desired result? What is wrong with the counters? You have already a list of all lemmata that are used in your example code.

– dexteritas
Feb 3 at 13:03





Can you specify your question? Which extension of ntheorem? What is the desired result? What is wrong with the counters? You have already a list of all lemmata that are used in your example code.

– dexteritas
Feb 3 at 13:03













The extension is the newtheorentype. It come directly from the documentation of ntheorem and the desired result is the result from the documentation.

– Viktor Glombik
Feb 3 at 13:57





The extension is the newtheorentype. It come directly from the documentation of ntheorem and the desired result is the result from the documentation.

– Viktor Glombik
Feb 3 at 13:57













Do you mean newtheoremlisttype? There are multiple examples in the documentation. So please be more specific where someone should find the desired result. Give a page number or describe the result directly in the question.

– dexteritas
Feb 3 at 14:11





Do you mean newtheoremlisttype? There are multiple examples in the documentation. So please be more specific where someone should find the desired result. Give a page number or describe the result directly in the question.

– dexteritas
Feb 3 at 14:11













Yes, I do. The example is found on the bottom of page 26 and the result on page 27, I copied the code from the documentation as last thing in my preamble.

– Viktor Glombik
Feb 3 at 15:02





Yes, I do. The example is found on the bottom of page 26 and the result on page 27, I copied the code from the documentation as last thing in my preamble.

– Viktor Glombik
Feb 3 at 15:02










1 Answer
1






active

oldest

votes


















2





+50









Adaptations:




  • removed: newcounter{counter} and numberwithin{counter}{subsection}

  • added: theoremnumbering{arabic} or theoremnumbering{greek} (see page 17 of the ntheorem documentation)

  • changed: newframedtheorem{lemma}{Lemma}[subsection] to use subsection number + theoremnumbering

  • added: new columntype L fot tabular, so long titles get a linebreak

  • added: defn environments for testing the result

  • note: use UTF8 coding as file encoding to preserve german umlauts. (see line 4)


Code:



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=scshapebfseries,
before skip=15pt plus 2pt,after skip=15pt plus 2pt}{th}

setsepchar{,}
readlistmycolors{amaranth,blue,orange,purple}

% defn
theoremstyle{break}
theoremprework{medbreak}
theorempostwork{medbreak}
theorembodyfont{normalfont}
theoremheaderfont{kern-5mmbfseries}
theoremindent=5mm
deftheoremframecommand{colorbox{mycolors[thesection]!10}}
theoremnumbering{arabic} % <- NEW for arabic counter
newshadedtheorem{defn}{textsc{Definition}}[subsection] % subsection + arabic

%lemma
theoremstyle{break}
theoremprework{%
defFrameCommand{
{color{mycolors[thesection]}{hspace{-8pt}vrule width 2pt hspace{6pt}}}}
medbreak}
theorempostwork{medbreak}
theorembodyfont{itshape}
theoremheaderfont{kern-5mmnormalfontbfseries}
theoremindent0.5cm
theoremnumbering{greek} % <- NEW for greek counter
newframedtheorem{lemma}{Lemma}[subsection] % subsection + greek

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


usepackage{tabularx}
newcolumntype{L}[1]{>{hspace{0pt}raggedrightarraybackslash}p{#1}} % linksbündig mit Breitenangabe

newtheoremlisttype{tab}%
{begin{tabular*}{linewidth}{@{}lrL{85mm}@{extracolsep{fill}}r@{}}}%
{##1&##2&##3&##4\}%
{end{tabular*}}

begin{document}
section{first section}

subsection{first subsection}

begin{lemma}[first lemma]
This is a lemma
end{lemma}

begin{lemma}[second lemma with a very long title to get a linebreak in tabular]
This is a lemma, also.
end{lemma}

begin{defn}[first theorem]
This is a theorem, also.
end{defn}

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

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

begin{defn}[second theorem]
This is a theorem.
end{defn}

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

section{Alle wichtigen Definitionen und Lemmata}
theoremlisttype{tab}
listtheorems{defn,lemma}

end{document}


Result:



enter image description here






share|improve this answer


























  • How can I modify this, so that for longer titles, this doesn't run over the edges?

    – Viktor Glombik
    Feb 3 at 22:53











  • Also, when copying your code into an overleaf document, it throws an error, do you know why?

    – Viktor Glombik
    Feb 3 at 22:54











  • Also, I changed the definition of the definition header font to theoremheaderfont{kern-5mmbfseriesscshape} and removed it in the environment definition: newshadedtheorem{defn}{Definition}[subsection], so that in this listing, the font of "Definition" is a normal one, like for the lemma.

    – Viktor Glombik
    Feb 3 at 23:02













  • Also, I wanted to use: usepackage[bookmarks=true,colorlinks=true,linkcolor=black]{hyperref} and even though I use usepackage[thmmarks,framed,thref,hyperref]{ntheorem}, it still looks like this: lemma.1.1.1 Lemma & 1.1.beta & second lemma.

    – Viktor Glombik
    Feb 3 at 23:19











  • I changed the code, so you get a linebreak in the tabular for long titles. I don't know why overleaf should throw an error. About hyperref look at section 3.4 of the documentation and maybe ask a new question for that one.

    – dexteritas
    Feb 4 at 8:48











Your Answer








StackExchange.ready(function() {
var channelOptions = {
tags: "".split(" "),
id: "85"
};
initTagRenderer("".split(" "), "".split(" "), channelOptions);

StackExchange.using("externalEditor", function() {
// Have to fire editor after snippets, if snippets enabled
if (StackExchange.settings.snippets.snippetsEnabled) {
StackExchange.using("snippets", function() {
createEditor();
});
}
else {
createEditor();
}
});

function createEditor() {
StackExchange.prepareEditor({
heartbeatType: 'answer',
autoActivateHeartbeat: false,
convertImagesToLinks: false,
noModals: true,
showLowRepImageUploadWarning: true,
reputationToPostImages: null,
bindNavPrevention: true,
postfix: "",
imageUploader: {
brandingHtml: "Powered by u003ca class="icon-imgur-white" href="https://imgur.com/"u003eu003c/au003e",
contentPolicyHtml: "User contributions licensed under u003ca href="https://creativecommons.org/licenses/by-sa/3.0/"u003ecc by-sa 3.0 with attribution requiredu003c/au003e u003ca href="https://stackoverflow.com/legal/content-policy"u003e(content policy)u003c/au003e",
allowUrls: true
},
onDemand: true,
discardSelector: ".discard-answer"
,immediatelyShowMarkdownHelp:true
});


}
});














draft saved

draft discarded


















StackExchange.ready(
function () {
StackExchange.openid.initPostLogin('.new-post-login', 'https%3a%2f%2ftex.stackexchange.com%2fquestions%2f472795%2fadvanced-theorems-list-from-ntheorem-documentation-throws-errors%23new-answer', 'question_page');
}
);

Post as a guest















Required, but never shown

























1 Answer
1






active

oldest

votes








1 Answer
1






active

oldest

votes









active

oldest

votes






active

oldest

votes









2





+50









Adaptations:




  • removed: newcounter{counter} and numberwithin{counter}{subsection}

  • added: theoremnumbering{arabic} or theoremnumbering{greek} (see page 17 of the ntheorem documentation)

  • changed: newframedtheorem{lemma}{Lemma}[subsection] to use subsection number + theoremnumbering

  • added: new columntype L fot tabular, so long titles get a linebreak

  • added: defn environments for testing the result

  • note: use UTF8 coding as file encoding to preserve german umlauts. (see line 4)


Code:



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=scshapebfseries,
before skip=15pt plus 2pt,after skip=15pt plus 2pt}{th}

setsepchar{,}
readlistmycolors{amaranth,blue,orange,purple}

% defn
theoremstyle{break}
theoremprework{medbreak}
theorempostwork{medbreak}
theorembodyfont{normalfont}
theoremheaderfont{kern-5mmbfseries}
theoremindent=5mm
deftheoremframecommand{colorbox{mycolors[thesection]!10}}
theoremnumbering{arabic} % <- NEW for arabic counter
newshadedtheorem{defn}{textsc{Definition}}[subsection] % subsection + arabic

%lemma
theoremstyle{break}
theoremprework{%
defFrameCommand{
{color{mycolors[thesection]}{hspace{-8pt}vrule width 2pt hspace{6pt}}}}
medbreak}
theorempostwork{medbreak}
theorembodyfont{itshape}
theoremheaderfont{kern-5mmnormalfontbfseries}
theoremindent0.5cm
theoremnumbering{greek} % <- NEW for greek counter
newframedtheorem{lemma}{Lemma}[subsection] % subsection + greek

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


usepackage{tabularx}
newcolumntype{L}[1]{>{hspace{0pt}raggedrightarraybackslash}p{#1}} % linksbündig mit Breitenangabe

newtheoremlisttype{tab}%
{begin{tabular*}{linewidth}{@{}lrL{85mm}@{extracolsep{fill}}r@{}}}%
{##1&##2&##3&##4\}%
{end{tabular*}}

begin{document}
section{first section}

subsection{first subsection}

begin{lemma}[first lemma]
This is a lemma
end{lemma}

begin{lemma}[second lemma with a very long title to get a linebreak in tabular]
This is a lemma, also.
end{lemma}

begin{defn}[first theorem]
This is a theorem, also.
end{defn}

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

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

begin{defn}[second theorem]
This is a theorem.
end{defn}

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

section{Alle wichtigen Definitionen und Lemmata}
theoremlisttype{tab}
listtheorems{defn,lemma}

end{document}


Result:



enter image description here






share|improve this answer


























  • How can I modify this, so that for longer titles, this doesn't run over the edges?

    – Viktor Glombik
    Feb 3 at 22:53











  • Also, when copying your code into an overleaf document, it throws an error, do you know why?

    – Viktor Glombik
    Feb 3 at 22:54











  • Also, I changed the definition of the definition header font to theoremheaderfont{kern-5mmbfseriesscshape} and removed it in the environment definition: newshadedtheorem{defn}{Definition}[subsection], so that in this listing, the font of "Definition" is a normal one, like for the lemma.

    – Viktor Glombik
    Feb 3 at 23:02













  • Also, I wanted to use: usepackage[bookmarks=true,colorlinks=true,linkcolor=black]{hyperref} and even though I use usepackage[thmmarks,framed,thref,hyperref]{ntheorem}, it still looks like this: lemma.1.1.1 Lemma & 1.1.beta & second lemma.

    – Viktor Glombik
    Feb 3 at 23:19











  • I changed the code, so you get a linebreak in the tabular for long titles. I don't know why overleaf should throw an error. About hyperref look at section 3.4 of the documentation and maybe ask a new question for that one.

    – dexteritas
    Feb 4 at 8:48
















2





+50









Adaptations:




  • removed: newcounter{counter} and numberwithin{counter}{subsection}

  • added: theoremnumbering{arabic} or theoremnumbering{greek} (see page 17 of the ntheorem documentation)

  • changed: newframedtheorem{lemma}{Lemma}[subsection] to use subsection number + theoremnumbering

  • added: new columntype L fot tabular, so long titles get a linebreak

  • added: defn environments for testing the result

  • note: use UTF8 coding as file encoding to preserve german umlauts. (see line 4)


Code:



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=scshapebfseries,
before skip=15pt plus 2pt,after skip=15pt plus 2pt}{th}

setsepchar{,}
readlistmycolors{amaranth,blue,orange,purple}

% defn
theoremstyle{break}
theoremprework{medbreak}
theorempostwork{medbreak}
theorembodyfont{normalfont}
theoremheaderfont{kern-5mmbfseries}
theoremindent=5mm
deftheoremframecommand{colorbox{mycolors[thesection]!10}}
theoremnumbering{arabic} % <- NEW for arabic counter
newshadedtheorem{defn}{textsc{Definition}}[subsection] % subsection + arabic

%lemma
theoremstyle{break}
theoremprework{%
defFrameCommand{
{color{mycolors[thesection]}{hspace{-8pt}vrule width 2pt hspace{6pt}}}}
medbreak}
theorempostwork{medbreak}
theorembodyfont{itshape}
theoremheaderfont{kern-5mmnormalfontbfseries}
theoremindent0.5cm
theoremnumbering{greek} % <- NEW for greek counter
newframedtheorem{lemma}{Lemma}[subsection] % subsection + greek

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


usepackage{tabularx}
newcolumntype{L}[1]{>{hspace{0pt}raggedrightarraybackslash}p{#1}} % linksbündig mit Breitenangabe

newtheoremlisttype{tab}%
{begin{tabular*}{linewidth}{@{}lrL{85mm}@{extracolsep{fill}}r@{}}}%
{##1&##2&##3&##4\}%
{end{tabular*}}

begin{document}
section{first section}

subsection{first subsection}

begin{lemma}[first lemma]
This is a lemma
end{lemma}

begin{lemma}[second lemma with a very long title to get a linebreak in tabular]
This is a lemma, also.
end{lemma}

begin{defn}[first theorem]
This is a theorem, also.
end{defn}

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

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

begin{defn}[second theorem]
This is a theorem.
end{defn}

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

section{Alle wichtigen Definitionen und Lemmata}
theoremlisttype{tab}
listtheorems{defn,lemma}

end{document}


Result:



enter image description here






share|improve this answer


























  • How can I modify this, so that for longer titles, this doesn't run over the edges?

    – Viktor Glombik
    Feb 3 at 22:53











  • Also, when copying your code into an overleaf document, it throws an error, do you know why?

    – Viktor Glombik
    Feb 3 at 22:54











  • Also, I changed the definition of the definition header font to theoremheaderfont{kern-5mmbfseriesscshape} and removed it in the environment definition: newshadedtheorem{defn}{Definition}[subsection], so that in this listing, the font of "Definition" is a normal one, like for the lemma.

    – Viktor Glombik
    Feb 3 at 23:02













  • Also, I wanted to use: usepackage[bookmarks=true,colorlinks=true,linkcolor=black]{hyperref} and even though I use usepackage[thmmarks,framed,thref,hyperref]{ntheorem}, it still looks like this: lemma.1.1.1 Lemma & 1.1.beta & second lemma.

    – Viktor Glombik
    Feb 3 at 23:19











  • I changed the code, so you get a linebreak in the tabular for long titles. I don't know why overleaf should throw an error. About hyperref look at section 3.4 of the documentation and maybe ask a new question for that one.

    – dexteritas
    Feb 4 at 8:48














2





+50







2





+50



2




+50





Adaptations:




  • removed: newcounter{counter} and numberwithin{counter}{subsection}

  • added: theoremnumbering{arabic} or theoremnumbering{greek} (see page 17 of the ntheorem documentation)

  • changed: newframedtheorem{lemma}{Lemma}[subsection] to use subsection number + theoremnumbering

  • added: new columntype L fot tabular, so long titles get a linebreak

  • added: defn environments for testing the result

  • note: use UTF8 coding as file encoding to preserve german umlauts. (see line 4)


Code:



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=scshapebfseries,
before skip=15pt plus 2pt,after skip=15pt plus 2pt}{th}

setsepchar{,}
readlistmycolors{amaranth,blue,orange,purple}

% defn
theoremstyle{break}
theoremprework{medbreak}
theorempostwork{medbreak}
theorembodyfont{normalfont}
theoremheaderfont{kern-5mmbfseries}
theoremindent=5mm
deftheoremframecommand{colorbox{mycolors[thesection]!10}}
theoremnumbering{arabic} % <- NEW for arabic counter
newshadedtheorem{defn}{textsc{Definition}}[subsection] % subsection + arabic

%lemma
theoremstyle{break}
theoremprework{%
defFrameCommand{
{color{mycolors[thesection]}{hspace{-8pt}vrule width 2pt hspace{6pt}}}}
medbreak}
theorempostwork{medbreak}
theorembodyfont{itshape}
theoremheaderfont{kern-5mmnormalfontbfseries}
theoremindent0.5cm
theoremnumbering{greek} % <- NEW for greek counter
newframedtheorem{lemma}{Lemma}[subsection] % subsection + greek

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


usepackage{tabularx}
newcolumntype{L}[1]{>{hspace{0pt}raggedrightarraybackslash}p{#1}} % linksbündig mit Breitenangabe

newtheoremlisttype{tab}%
{begin{tabular*}{linewidth}{@{}lrL{85mm}@{extracolsep{fill}}r@{}}}%
{##1&##2&##3&##4\}%
{end{tabular*}}

begin{document}
section{first section}

subsection{first subsection}

begin{lemma}[first lemma]
This is a lemma
end{lemma}

begin{lemma}[second lemma with a very long title to get a linebreak in tabular]
This is a lemma, also.
end{lemma}

begin{defn}[first theorem]
This is a theorem, also.
end{defn}

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

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

begin{defn}[second theorem]
This is a theorem.
end{defn}

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

section{Alle wichtigen Definitionen und Lemmata}
theoremlisttype{tab}
listtheorems{defn,lemma}

end{document}


Result:



enter image description here






share|improve this answer















Adaptations:




  • removed: newcounter{counter} and numberwithin{counter}{subsection}

  • added: theoremnumbering{arabic} or theoremnumbering{greek} (see page 17 of the ntheorem documentation)

  • changed: newframedtheorem{lemma}{Lemma}[subsection] to use subsection number + theoremnumbering

  • added: new columntype L fot tabular, so long titles get a linebreak

  • added: defn environments for testing the result

  • note: use UTF8 coding as file encoding to preserve german umlauts. (see line 4)


Code:



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=scshapebfseries,
before skip=15pt plus 2pt,after skip=15pt plus 2pt}{th}

setsepchar{,}
readlistmycolors{amaranth,blue,orange,purple}

% defn
theoremstyle{break}
theoremprework{medbreak}
theorempostwork{medbreak}
theorembodyfont{normalfont}
theoremheaderfont{kern-5mmbfseries}
theoremindent=5mm
deftheoremframecommand{colorbox{mycolors[thesection]!10}}
theoremnumbering{arabic} % <- NEW for arabic counter
newshadedtheorem{defn}{textsc{Definition}}[subsection] % subsection + arabic

%lemma
theoremstyle{break}
theoremprework{%
defFrameCommand{
{color{mycolors[thesection]}{hspace{-8pt}vrule width 2pt hspace{6pt}}}}
medbreak}
theorempostwork{medbreak}
theorembodyfont{itshape}
theoremheaderfont{kern-5mmnormalfontbfseries}
theoremindent0.5cm
theoremnumbering{greek} % <- NEW for greek counter
newframedtheorem{lemma}{Lemma}[subsection] % subsection + greek

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


usepackage{tabularx}
newcolumntype{L}[1]{>{hspace{0pt}raggedrightarraybackslash}p{#1}} % linksbündig mit Breitenangabe

newtheoremlisttype{tab}%
{begin{tabular*}{linewidth}{@{}lrL{85mm}@{extracolsep{fill}}r@{}}}%
{##1&##2&##3&##4\}%
{end{tabular*}}

begin{document}
section{first section}

subsection{first subsection}

begin{lemma}[first lemma]
This is a lemma
end{lemma}

begin{lemma}[second lemma with a very long title to get a linebreak in tabular]
This is a lemma, also.
end{lemma}

begin{defn}[first theorem]
This is a theorem, also.
end{defn}

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

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

begin{defn}[second theorem]
This is a theorem.
end{defn}

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

section{Alle wichtigen Definitionen und Lemmata}
theoremlisttype{tab}
listtheorems{defn,lemma}

end{document}


Result:



enter image description here







share|improve this answer














share|improve this answer



share|improve this answer








edited Feb 4 at 8:43

























answered Feb 3 at 17:47









dexteritasdexteritas

3,7621027




3,7621027













  • How can I modify this, so that for longer titles, this doesn't run over the edges?

    – Viktor Glombik
    Feb 3 at 22:53











  • Also, when copying your code into an overleaf document, it throws an error, do you know why?

    – Viktor Glombik
    Feb 3 at 22:54











  • Also, I changed the definition of the definition header font to theoremheaderfont{kern-5mmbfseriesscshape} and removed it in the environment definition: newshadedtheorem{defn}{Definition}[subsection], so that in this listing, the font of "Definition" is a normal one, like for the lemma.

    – Viktor Glombik
    Feb 3 at 23:02













  • Also, I wanted to use: usepackage[bookmarks=true,colorlinks=true,linkcolor=black]{hyperref} and even though I use usepackage[thmmarks,framed,thref,hyperref]{ntheorem}, it still looks like this: lemma.1.1.1 Lemma & 1.1.beta & second lemma.

    – Viktor Glombik
    Feb 3 at 23:19











  • I changed the code, so you get a linebreak in the tabular for long titles. I don't know why overleaf should throw an error. About hyperref look at section 3.4 of the documentation and maybe ask a new question for that one.

    – dexteritas
    Feb 4 at 8:48



















  • How can I modify this, so that for longer titles, this doesn't run over the edges?

    – Viktor Glombik
    Feb 3 at 22:53











  • Also, when copying your code into an overleaf document, it throws an error, do you know why?

    – Viktor Glombik
    Feb 3 at 22:54











  • Also, I changed the definition of the definition header font to theoremheaderfont{kern-5mmbfseriesscshape} and removed it in the environment definition: newshadedtheorem{defn}{Definition}[subsection], so that in this listing, the font of "Definition" is a normal one, like for the lemma.

    – Viktor Glombik
    Feb 3 at 23:02













  • Also, I wanted to use: usepackage[bookmarks=true,colorlinks=true,linkcolor=black]{hyperref} and even though I use usepackage[thmmarks,framed,thref,hyperref]{ntheorem}, it still looks like this: lemma.1.1.1 Lemma & 1.1.beta & second lemma.

    – Viktor Glombik
    Feb 3 at 23:19











  • I changed the code, so you get a linebreak in the tabular for long titles. I don't know why overleaf should throw an error. About hyperref look at section 3.4 of the documentation and maybe ask a new question for that one.

    – dexteritas
    Feb 4 at 8:48

















How can I modify this, so that for longer titles, this doesn't run over the edges?

– Viktor Glombik
Feb 3 at 22:53





How can I modify this, so that for longer titles, this doesn't run over the edges?

– Viktor Glombik
Feb 3 at 22:53













Also, when copying your code into an overleaf document, it throws an error, do you know why?

– Viktor Glombik
Feb 3 at 22:54





Also, when copying your code into an overleaf document, it throws an error, do you know why?

– Viktor Glombik
Feb 3 at 22:54













Also, I changed the definition of the definition header font to theoremheaderfont{kern-5mmbfseriesscshape} and removed it in the environment definition: newshadedtheorem{defn}{Definition}[subsection], so that in this listing, the font of "Definition" is a normal one, like for the lemma.

– Viktor Glombik
Feb 3 at 23:02







Also, I changed the definition of the definition header font to theoremheaderfont{kern-5mmbfseriesscshape} and removed it in the environment definition: newshadedtheorem{defn}{Definition}[subsection], so that in this listing, the font of "Definition" is a normal one, like for the lemma.

– Viktor Glombik
Feb 3 at 23:02















Also, I wanted to use: usepackage[bookmarks=true,colorlinks=true,linkcolor=black]{hyperref} and even though I use usepackage[thmmarks,framed,thref,hyperref]{ntheorem}, it still looks like this: lemma.1.1.1 Lemma & 1.1.beta & second lemma.

– Viktor Glombik
Feb 3 at 23:19





Also, I wanted to use: usepackage[bookmarks=true,colorlinks=true,linkcolor=black]{hyperref} and even though I use usepackage[thmmarks,framed,thref,hyperref]{ntheorem}, it still looks like this: lemma.1.1.1 Lemma & 1.1.beta & second lemma.

– Viktor Glombik
Feb 3 at 23:19













I changed the code, so you get a linebreak in the tabular for long titles. I don't know why overleaf should throw an error. About hyperref look at section 3.4 of the documentation and maybe ask a new question for that one.

– dexteritas
Feb 4 at 8:48





I changed the code, so you get a linebreak in the tabular for long titles. I don't know why overleaf should throw an error. About hyperref look at section 3.4 of the documentation and maybe ask a new question for that one.

– dexteritas
Feb 4 at 8:48


















draft saved

draft discarded




















































Thanks for contributing an answer to TeX - LaTeX Stack Exchange!


  • Please be sure to answer the question. Provide details and share your research!

But avoid



  • Asking for help, clarification, or responding to other answers.

  • Making statements based on opinion; back them up with references or personal experience.


To learn more, see our tips on writing great answers.




draft saved


draft discarded














StackExchange.ready(
function () {
StackExchange.openid.initPostLogin('.new-post-login', 'https%3a%2f%2ftex.stackexchange.com%2fquestions%2f472795%2fadvanced-theorems-list-from-ntheorem-documentation-throws-errors%23new-answer', 'question_page');
}
);

Post as a guest















Required, but never shown





















































Required, but never shown














Required, but never shown












Required, but never shown







Required, but never shown

































Required, but never shown














Required, but never shown












Required, but never shown







Required, but never shown







Popular posts from this blog

How to change which sound is reproduced for terminal bell?

Title Spacing in Bjornstrup Chapter, Removing Chapter Number From Contents

Can I use Tabulator js library in my java Spring + Thymeleaf project?