diff --git a/latex/thesis/common.tex b/latex/thesis/common.tex index c59447a..762b755 100644 --- a/latex/thesis/common.tex +++ b/latex/thesis/common.tex @@ -156,13 +156,13 @@ % % defines algorithm counter for chapter-level -\newcounter{nalg} +\newcounter{genericAlgorithmCounter} \let\OldChapter\chapter -\renewcommand{\chapter}{\setcounter{nalg}{1}\OldChapter} +\renewcommand{\chapter}{\setcounter{genericAlgorithmCounter}{1}\OldChapter} %defines appearance of the algorithm counter -\renewcommand{\thenalg}{\thechapter .\arabic{nalg}} +\renewcommand{\thegenericAlgorithmCounter}{\thechapter .\arabic{genericAlgorithmCounter}} % defines a new caption label as Algorithm x.y -\DeclareCaptionLabelFormat{algocaption}{Algorithm \thenalg} +\DeclareCaptionLabelFormat{algocaption}{Algorithm \thegenericAlgorithmCounter} \lstnewenvironment{genericAlgorithm}[1][] { @@ -185,7 +185,7 @@ #1 % This is to add custom settings } } -{} +{\addtocounter{genericAlgorithmCounter}{1}} % % Allows for pausing and resuming the numbering in an lstlisting environment