From 24837e87cfe2f905125ddf4f62f02c9ee4c63162 Mon Sep 17 00:00:00 2001 From: Brittany Reiche Date: Wed, 6 Sep 2017 16:11:22 -0400 Subject: [PATCH] fixed algorithm numbering --- book/halbook.tex | 10 ++++++++-- 1 file changed, 8 insertions(+), 2 deletions(-) diff --git a/book/halbook.tex b/book/halbook.tex index 1b8af23..ba825bf 100644 --- a/book/halbook.tex +++ b/book/halbook.tex @@ -472,15 +472,21 @@ \floatname{algorithm}{\textcolor{\algorithmiccolor}{\algorithmicfont Algorithm}} +\makeatletter +\@addtoreset{algorithm}{chapter}% algorithm counter resets every chapter +\makeatother + +\renewcommand{\thealgorithm}{\arabic{chapter}.\arabic{algorithm}} + \newcommand{\newalgorithm}[3]{% \begin{algorithm}[t] - \label{alg:#1} - \caption{#2} \begin{small} \begin{algorithmic}[1] #3 \end{algorithmic} \end{small} + \caption{#2} + \label{alg:#1} \end{algorithm}} \newcommand{\categ}[1]{\textsc{\textcolor{darkgrey}{#1}}}