diff --git a/lectures/lecturecommon.sty b/lectures/lecturecommon.sty index bdb18e4..8c614b9 100644 --- a/lectures/lecturecommon.sty +++ b/lectures/lecturecommon.sty @@ -1,4 +1,4 @@ -\def\filedate{9 February 2017} +\def\filedate{26 September 2017} %%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%% % % Common definitions shared across the various lecture document classes. @@ -15,11 +15,12 @@ % v1.2.1 Fixed fontspec option clash and made font handling consistent with XML framework. % v1.2.2 Fixed incorrect Roman font in math mode. % v1.2.3 Switched XeLaTeX fonts to new University standard (Minion Pro + Open Sans). +% v1.2.4 Fixed "class number plus one" so that it can be passed as a number to other macros. % %%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%% \NeedsTeXFormat{LaTeX2e}[2001/06/01] -\ProvidesPackage{lecturecommon}[2017/02/09 INFO standard lecture setup v1.2.3] +\ProvidesPackage{lecturecommon}[2017/09/26 INFO standard lecture setup v1.2.4] % Standard packages common to ALL lecture documents. @@ -152,13 +153,16 @@ % Class number. +\newcounter{chapterplusone} +\setcounter{chapterplusone}{\value{chapter}} +\stepcounter{chapterplusone} \newcommand{\ClassNumber}{\thechapter} -\newcommand{\ClassNumberPlusOne}{% - \addtocounter{chapter}{1}% - \thechapter% - \addtocounter{chapter}{-1}% +\newcommand{\ClassNumberPlusOne}{\thechapterplusone} +\newcommand{\SetClassNumber}[1]{% + \setcounter{chapter}{#1}% + \setcounter{chapterplusone}{#1}% + \stepcounter{chapterplusone}% } -\newcommand{\SetClassNumber}[1]{\setcounter{chapter}{#1}} % Backwards compatibility with the old syntax \newcommand{\ChapterNumber}{\ClassNumber}