From 19a90b19f6ec33aec1291be08fecfece45735a22 Mon Sep 17 00:00:00 2001
From: Norbert Preining <norbert@preining.info>
Date: Sat, 5 Mar 2022 03:00:46 +0000
Subject: CTAN sync 202203050300

---
 macros/latex/contrib/msu-thesis/msu-thesis.cls | 26 +++++++++++++++++++++++---
 1 file changed, 23 insertions(+), 3 deletions(-)

(limited to 'macros/latex/contrib/msu-thesis/msu-thesis.cls')

diff --git a/macros/latex/contrib/msu-thesis/msu-thesis.cls b/macros/latex/contrib/msu-thesis/msu-thesis.cls
index 8fc9939364..9d6c314e6f 100644
--- a/macros/latex/contrib/msu-thesis/msu-thesis.cls
+++ b/macros/latex/contrib/msu-thesis/msu-thesis.cls
@@ -155,11 +155,13 @@
 % 						  Added global chapter counter for proper hyperrefs to appendices
 %						  Added a formatting hook for appendix numbering. We'll see how this works in practice.                   
 %						  Added spacing hooks for bibliographies to make users' lives a little easier
+% Version 3.0b 2021/07/14 Added msu@hchap counter for hyperref targets in appendices (unreleased)
+% Version 3.1  2022/03/03 Added support for List of Algorithms plus fixes for algorithm2e and algorithmicx etc
 %
 % Report bugs/problems/questions to <amunn@msu.edu>
 %
-\def\msu@version{3.0}
-\def\msu@date{2021/06/10}
+\def\msu@version{3.1}
+\def\msu@date{2022/03/03}
 \NeedsTeXFormat{LaTeX2e}
 \ProvidesClass{msu-thesis}[\msu@date\space  Michigan State University Thesis Class version \msu@version]
 \newif\ifmsu@dissertation\msu@dissertationtrue % added v2.7 boolean for \msu@thesistype
@@ -256,6 +258,8 @@
 \newcommand*{\msu@fieldseparator}{\textendash} % this is between the degree name and field of study
 
 \newcounter{msu@hchap} % global counter for chapters used by hyperref
+% This may also be solved by using \hypersetup{hypertexnames=false}
+% hard to tell whether this is a better solution.
 
 
 % make title 2in from top of page
@@ -332,6 +336,21 @@
 	\def\msu@chapfont{\bfseries}
 \fi
 
+% Support for algorithm packages added v3.1
+% If using the algorithm2e package, you must load it with the algo2e package option
+% If you are using algorithmicx or its related versions you should not load
+% the algorithm package, but instead load the float package and then style
+% your algorithms accordingly using \floatstyle 
+% Importantly you MUST load float after defining any new lists since it clobbers
+% the memoir float methods
+
+
+\newlistof{listofalgorithms}{loa}{List of Algorithms}
+\newfloat[chapter]{algorithm}{loa}{Algorithm}
+\newlistentry{algorithm}{loa}{0}
+\renewcommand*{\cftalgorithmname}{Algorithm\space}
+\renewcommand*{\cftalgorithmaftersnum}{\msucaptiondelim}
+
 %
 % This code technique from http://tex.stackexchange.com/q/232121/
 % Makes appendices formatted as sections not chapters in the TOC
@@ -663,6 +682,7 @@
 \let\msucaptiondelim\@contdelim
 % Moved to AtBeginDocument to override apacite
 \@ifpackageloaded{apacite}{\@tocbibfalse}{} % added 6/22/17
+\@ifpackageloaded{algorithm2e}{\let\@chapter=\algocf@original@chapter}{}% undoes algorithm2e redefinition of chapter added v3.1
 % Make bibliography spacing more automatic for biblatex and natbib users 2021/06/10
 % This should cover most cases. Otherwise just set single spacing
 \@ifpackageloaded{biblatex}
@@ -695,7 +715,7 @@
    \l@chapapp{\MakeLinkUppercase #1}{#2}{\cftchaptername}} % Format chapter names
 \renewcommand*{\l@appendix}[2]{%
   \l@chapapp{\MakeLinkUppercase #1}{#2}{\cftappendixname}} % Format appendix names (changed 13/12/17)
-\apptocmd{\@resets@pp}{\gdef\theHchapter{\Alph{msu@hchap}}}{}{} % get hypertargets in appendices right (added v3.0)
+\apptocmd{\@resets@pp}{\gdef\theHchapter{\arabic{msu@hchap}}}{}{} % get hypertargets in appendices right (added v3.0; fixed v3.0b)
 }
   % if no hyperref
 {\relax}
-- 
cgit v1.2.3

