From 1b5bddace01f2a00882c38e13c677f11537042cb Mon Sep 17 00:00:00 2001
From: Karl Berry <karl@freefriends.org>
Date: Sun, 18 Sep 2016 21:07:17 +0000
Subject: turabian-formatting (18sep16)

git-svn-id: svn://tug.org/texlive/trunk@42097 c570f23f-e606-0410-a88d-b1316a301751
---
 .../latex/turabian-formatting/turabian-thesis.cls  | 224 ++++++++++++++++-----
 1 file changed, 171 insertions(+), 53 deletions(-)

(limited to 'Master/texmf-dist/tex/latex/turabian-formatting/turabian-thesis.cls')

diff --git a/Master/texmf-dist/tex/latex/turabian-formatting/turabian-thesis.cls b/Master/texmf-dist/tex/latex/turabian-formatting/turabian-thesis.cls
index 87bd482e3b4..e2b6e6e4a54 100644
--- a/Master/texmf-dist/tex/latex/turabian-formatting/turabian-thesis.cls
+++ b/Master/texmf-dist/tex/latex/turabian-formatting/turabian-thesis.cls
@@ -27,7 +27,7 @@
 
 
 \NeedsTeXFormat{LaTeX2e}
-\ProvidesClass{turabian-thesis}[2016/07/18 Turabian Theses and Dissertations]
+\ProvidesClass{turabian-thesis}[2016/09/17 Turabian Theses and Dissertations]
 
 
 % Default point size
@@ -89,52 +89,116 @@
 \newif\if@doublenumerate\@doublenumeratetrue
 
 
-% Document structure: formatting
+% Figures: number formatting
+\newif\if@figuredblnum\@figuredblnumfalse
+\renewcommand{\thefigure}{\if@figuredblnum \thechapter.\fi \@arabic\c@figure}
+
+
+% Tables: number formatting
+\newif\if@tabledblnum\@tabledblnumfalse
+\renewcommand{\thetable}{\if@tabledblnum \thechapter.\fi \@arabic\c@table}
 
+
+% Document structure: formatting
 \def\frontmatter{%
-	\cleardoublepage
+	\if@openright \cleardoublepage \else \clearpage \fi
 	\@mainmatterfalse
 	\pagenumbering{roman}
-	\pagestyle{empty}}
+	\pagestyle{empty}
+	\def\tf@tocpagestyle{\pagestyle{plain}}}
 
 \def\mainmatter{%
-	\cleardoublepage
+	\if@openright \cleardoublepage \else \clearpage \fi
 	\@mainmattertrue
 	\pagenumbering{arabic}
 	\pagestyle{headings}
-	\if@doublenumerate
-		\setcounter{tf@tempchapfcnt}{\value{figure}}
-		\setcounter{tf@tempchaptcnt}{\value{table}}
-	\fi
 	\addtocontents{toc}{\protect\addvspace{1\baselineskip}}}
 
 \def\backmatter{%
 	\if@openright \cleardoublepage \else \clearpage \fi
 	\@mainmatterfalse
-	\if@doublenumerate
-		\setcounter{chapter}{0}
-		\setcounter{figure}{\value{tf@tempchapfcnt}}
-		\setcounter{table}{\value{tf@tempchaptcnt}}
-	\fi
 	\addtocontents{toc}{\protect\addvspace{1\baselineskip}}}
 
 
-% Set top section command name to "chapter"
-\def\tf@topsecname{chapter}
+% Part: formatting
+\renewcommand\part{%
+	\if@openright \cleardoublepage \else \clearpage \fi
+	\secdef\@part\@spart}
+
+\def\tf@partformat{\normalfont\bfseries\normalsize\singlespacing\centering}
+
+% Part: heading with empty page
+\def\@part[#1]#2{%
+	\ifnum \c@secnumdepth >-2\relax
+		\if@mainmatter
+			\refstepcounter{part}%
+			\addcontentsline{toc}{part}%
+				{\protect\numberline{\partname\space\thepart.}#1}%
+		\else
+			\addcontentsline{toc}{part}{#1}%			
+		\fi
+	\else
+		\addcontentsline{toc}{part}{#1}%
+	\fi
+	\markboth{}{}%
+	{	\tf@partformat
+		\interlinepenalty \@M
+		\thispagestyle{empty}%
+		\ifnum \c@secnumdepth >-2\relax
+			\if@mainmatter
+				\partname\nobreakspace\thepart
+				\par\nobreak
+				\vspace*{1\baselineskip}%
+			\fi
+		\fi
+		#2\par}
+	\@endpart}
+
+% Part: heading with plain page style; allows following part description
+\def\@spart#1{%
+	\ifnum \c@secnumdepth >-2\relax
+		\if@mainmatter
+			\refstepcounter{part}%
+			\addcontentsline{toc}{part}%
+				{\protect\numberline{\partname\space\thepart.}#1}%
+		\fi
+	\fi
+	\markboth{}{}%
+	{	\tf@partformat
+		\interlinepenalty \@M
+		\thispagestyle{plain}%
+		\ifnum \c@secnumdepth >-2\relax
+			\if@mainmatter
+				\partname\nobreakspace\thepart
+				\par\nobreak
+				\vspace*{1\baselineskip}%
+			\fi
+		\fi
+		\ifstrempty{#1}{}{#1\par\nobreak \vspace{1\baselineskip}}}
+	\@afterheading}
 
+\def\@endpart{\if@openright \cleardoublepage \else \clearpage \fi}
+
+
+% Chapter: set top section command name to "chapter"
+\def\tf@topsecname{chapter}
 
-% Figures and tables: adjust counters based on @doublenumerate
+% Chapter: adjust figure/table counters based on @doublenumerate and chapter before
 \newcounter{tf@tempchapfcnt}
 \newcounter{tf@tempchaptcnt}
+
+\newif\if@tfchapterbefore\@tfchapterbeforefalse
+
 \def\tf@chapcounter{%
 	\if@doublenumerate
-		\if@mainmatter
-			\ifnum \c@chapter >\z@ \else
-				\setcounter{tf@tempchapfcnt}{\value{figure}}
-				\setcounter{tf@tempchaptcnt}{\value{table}}
-			\fi
+		\if@tfchapterbefore \else
+			\setcounter{tf@tempchapfcnt}{\value{figure}}
+			\setcounter{tf@tempchaptcnt}{\value{table}}
 		\fi
 		\refstepcounter{chapter}
+		\@tfchapterbeforetrue
+		\@figuredblnumtrue
+		\@tabledblnumtrue
 	\else
 		\setcounter{tf@tempchapfcnt}{\value{figure}}
 		\setcounter{tf@tempchaptcnt}{\value{table}}
@@ -142,11 +206,22 @@
 		\setcounter{figure}{\value{tf@tempchapfcnt}}
 		\setcounter{table}{\value{tf@tempchaptcnt}}
 	\fi}
+	
+\def\tf@restoreftcounters{%
+	\if@doublenumerate
+		\if@tfchapterbefore
+			\setcounter{figure}{\value{tf@tempchapfcnt}}
+			\setcounter{table}{\value{tf@tempchaptcnt}}
+		\fi
+		\@tfchapterbeforefalse
+	\fi}
 
-
-% Chapters: formatting
+% Chapter: formatting
 \def\tf@chapformat{\normalfont\bfseries\normalsize\singlespacing\centering}
+
 \def\@chapter[#1]#2{%
+	\@figuredblnumfalse
+	\@tabledblnumfalse
 	\ifnum \c@secnumdepth >\m@ne
 		\if@mainmatter
 			\tf@chapcounter
@@ -154,6 +229,7 @@
 			\addcontentsline{toc}{chapter}%
 				{\protect\numberline{\@chapapp\space\thechapter.}#1}%
 		\else
+			\tf@restoreftcounters
 			\addcontentsline{toc}{chapter}{#1}%
 		\fi
 	\else
@@ -162,6 +238,14 @@
 	\chaptermark{#1}%
 	\@makechapterhead{#2}%
 	\@afterheading}
+
+\def\@schapter#1{%
+	\@figuredblnumfalse
+	\@tabledblnumfalse
+	\tf@restoreftcounters
+	\@makeschapterhead{#1}%
+	\@afterheading}
+
 \def\@makechapterhead#1{%
 	{	\tf@chapformat
 		\ifnum \c@secnumdepth >\m@ne
@@ -172,10 +256,8 @@
 			\fi
 		\fi
 		\interlinepenalty\@M
-		\ifstrempty{#1}%
-			{}%
-			{#1\par\nobreak \vspace{1\baselineskip}}%
-	}}
+		\ifstrempty{#1}{}{#1\par\nobreak \vspace{1\baselineskip}}}}
+
 \def\@makeschapterhead#1{%
 	{	\tf@chapformat
 		\interlinepenalty\@M
@@ -184,6 +266,11 @@
 
 
 % Title page: commands for use with \maketitle
+\newcommand{\subtitle}[1]{\gdef\tf@subtitle{#1}}
+\subtitle{\@empty}
+
+\newcommand{\submissioninfo}[1]{\gdef\tf@submissioninfo{#1}}
+\submissioninfo{\@empty}
 
 \newcommand{\institution}[1]{\gdef\tf@institution{#1}}
 \institution{\@empty}
@@ -194,9 +281,31 @@
 \newcommand{\location}[1]{\gdef\tf@location{#1}}
 \location{\@empty}
 
+% Title page: command for emptying/completing \maketitle
+\newcommand{\tf@emptymaketitle}{%
+	\global\let\thanks\relax
+	\global\let\maketitle\relax
+
+	\global\let\@thanks\@empty
+	\global\let\@author\@empty
+	\global\let\@date\@empty
+	\global\let\@title\@empty
+	\global\let\tf@subtitle\@empty
+	\global\let\tf@submissioninfo\@empty
+	\global\let\tf@institution\@empty
+	\global\let\tf@department\@empty
+	\global\let\tf@location\@empty
 
-% Title page: renew \maketitle for thesis/dissertation
+	\global\let\title\relax
+	\global\let\author\relax
+	\global\let\date\relax
+	\global\let\subtitle\relax
+	\global\let\submissioninfo\relax
+	\global\let\institution\relax
+	\global\let\department\relax
+	\global\let\location\relax}
 
+% Title page: renew \maketitle for thesis/dissertation
 \submissioninfo{%
 	A Dissertation Submitted to\par
 	[Faculty]\par
@@ -237,20 +346,30 @@
 		\end{center}%
 	\end{titlepage}%
 	\setcounter{page}{2}
+	% if not endnotes, reset footnote counter
+	\if@endnotesformat \else \setcounter{footnote}{0} \fi
 	\tf@emptymaketitle
-	\global\let\tf@institution\@empty
-	\global\let\tf@department\@empty
-	\global\let\tf@location\@empty
-	\global\let\institution\relax
-	\global\let\department\relax
-	\global\let\location\relax
 	\cleardoublepage}
 
 
 % Table of Contents: formatting
-
 \setcounter{tocdepth}{0}	
 
+\renewcommand*{\l@part}[2]{%
+	\ifnum \c@tocdepth >-2\relax
+		\addpenalty{-\@highpenalty}%
+		\addvspace{1\baselineskip}%
+		\setlength\@tempdima{7.5em}%
+		\vskip 1\baselineskip
+		{	\parindent \z@
+			\rightskip \z@
+			\parfillskip -\@rightskip
+			\leavevmode
+			\advance\leftskip\@tempdima
+			\hskip -\leftskip
+			\bfseries #1\nobreak\hfil \nobreak\hb@xt@\@pnumwidth{\hss #2}\par}
+	\fi}
+
 \renewcommand*{\l@chapter}[2]{%
 	\ifnum \c@tocdepth >\m@ne
 		\addpenalty{-\@highpenalty}%
@@ -280,15 +399,7 @@
 	\@dottedtocline{3}{2.5in}{\z@}}
 
 
-% Figures and Tables: conditional double numeration formatting
-
-\renewcommand{\thefigure}{%
-	\if@doublenumerate \ifnum \c@chapter>\z@ \thechapter.\fi\fi \@arabic\c@figure}
-
-\renewcommand{\thetable}{%
-	\if@doublenumerate \ifnum \c@chapter>\z@ \thechapter.\fi\fi \@arabic\c@table}
-
-% Figures and Tables: list formatting
+% List of Figures: formatting
 \renewcommand*{\l@figure}[2]{%
 	\def\tflist@beforesecnum{\hfil}
 	\if@doublenumerate
@@ -306,6 +417,9 @@
 		\leavevmode
 		\advance\leftskip\@tempdima \null\nobreak\hskip -\leftskip
 		#1\nobreak\hfil \nobreak\hb@xt@\@pnumwidth{\hss #2}\par}}
+
+
+% List of Tables: formatting
 \def\l@table{\l@figure}
 
 
@@ -316,15 +430,16 @@
 
 \newenvironment{appendixes}%
 	{%
-		\@appendixestrue
 		\@mainmattertrue
-		\tf@appendix
-		\def\tf@chapcounter{%
-			\refstepcounter{appendix}
-			\gdef\thechapter{\@Alph\c@appendix}}
+		\setcounter{section}{0}%
+		\def\@chapapp{\appendixname}%
+		\def\thechapter{\@Alph\c@appendix}
+		\def\tf@chapcounter{\refstepcounter{appendix}}
 		\if@doublenumerate
-			\setcounter{tf@tempchapfcnt}{\value{figure}}
-			\setcounter{tf@tempchaptcnt}{\value{table}}
+			\if@tfchapterbefore \else
+				\setcounter{tf@tempchapfcnt}{\value{figure}}
+				\setcounter{tf@tempchaptcnt}{\value{table}}
+			\fi
 			\setcounter{figure}{0}
 			\setcounter{table}{0}
 		\fi
@@ -336,7 +451,10 @@
 			\setcounter{figure}{\value{tf@tempchapfcnt}}
 			\setcounter{table}{\value{tf@tempchaptcnt}}
 		\fi
-	}%
+	}
+
+% Appendixes: remove \appendix command
+\def\appendix{\@empty}
 
 
 % Endnotes: layout and formatting
-- 
cgit v1.2.3

