Fixed algorithm numbering
This commit is contained in:
parent
65214feb01
commit
74df3502d1
@ -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
|
||||
|
||||
Loading…
Reference in New Issue
Block a user