%% %% This is file `usthesis.sty', %% generated with the docstrip utility. %% %% The original source files were: %% %% usthesis.dtx (with options: `mem') %% Copyright (C) 2003--2011 Danie Els %% %% ------------------------------------------------------------------- %% University of Stellenbosch Thesis style %% for use with Memoir %% ------------------------------------------------------------------- %% This work may be distributed and/or modified under the conditions %% of the LaTeX Project Public License, either version 1.3c of this %% license or (at your option) any later version. The latest version %% of this license is in %% http://www.latex-project.org/lppl.txt %% and version 1.3c or later is part of all distributions of LaTeX %% version 2008/05/04 or later. %% %% This work has the LPPL maintenance status 'maintained'. %% %% This Current Maintainer of this work is Danie Els (dnjels@sun.ac.za) %% ------------------------------------------------------------------- %% \newcommand{\USfileversion}{v4.2} \newcommand{\USfiledate}{2011/09/08} \NeedsTeXFormat{LaTeX2e}[1999/12/01] \ProvidesPackage{usthesis}[\USfiledate\space \USfileversion\space Stellenbosh Thesis class for use with Memoir (DNJ ELS)] \@ifclassloaded{memoir}% {\PackageInfo{usthesis}{Stellenbosch thesis style for MEMOIR class}}% {\PackageError{usthesis}{You must use the Memoir class}{}} \RequirePackage{calc} \providecommand{\phantomsection}{} \AtBeginDocument{% \@ifpackageloaded{graphicx}{}{% \PackageError{usthesis}{You must load the graphicx package}{}% }% } \edef\US@AFRstr{\string afrikaans} \newcommand{\AorE}[2]{% \ifx\US@AFRstr\languagename #1\else #2\fi} \newenvironment{Afr}% {\ifx\languagename\US@AFRstr\relax\else \selectlanguage{afrikaans}% \fi}% {} \newcommand*\US@ENGstr{} \let\US@ENGstr=\relax \newenvironment{Eng}% {\ifx\relax\US@ENGstr\relax\else \ifx\languagename\US@ENGstr\relax\else \edef\US@tempa{\noexpand\selectlanguage{\US@ENGstr}}% \US@tempa \fi \fi}% {} \newcommand\DegreeName{% \PackageWarning{usthesis}{No degree or subject supplied}% \textfb{[No degree!]}} \newcommand\DegreeNameLong{% \PackageWarning{usthesis}{No degree or subject supplied}% \textfb{[No degree!]}} \newcommand*\USName{} \newcommand*\AuthByTxt{} \newcommand*\StudyLeaderType{} \newcommand*\StudyLeadersType{} \newcommand*\PromotorType{} \newcommand*\PromotorsType{} \newcommand*\TypeReport{} \newcommand*\TypeAssignment{} \newcommand*\TypeThesis{} \newcommand*\TypePhD{} \newcommand*\CopyrightHolder{} \newcommand*\CopyrightTxt{} \newcommand*\CopyrightAnot{} \newcommand*\Signat{} \newcommand*\Datetxt{} \newcommand*\MasterDescript{} \newcommand*\PhDDescript{} \newcommand*\PhDFinalDescript{} \newcommand*\ThesisDeclare{} \newcommand*\MonthName{} \newcommand*\DeclarationName{} \newcommand*\AbstractName{} \InputIfFileExists{usthesis.afr} {\PackageInfo{usthesis}{Input file 'usthesis.afr' loaded}} {\PackageError{usthesis}{No file 'usthesis.afr'}{}} \InputIfFileExists{usthesis.eng} {\PackageInfo{usthesis}{Input file 'usthesis.eng' loaded}} {\PackageError{usthesis}{No file 'usthesis.eng'}{}} \USextrasenglish \UScaptionsenglish \def\US@addto#1#2{% #2% \@temptokena{#2}% \ifx#1\relax \let#1\@empty \fi \ifx#1\undefined \edef#1{\the\@temptokena}% \else \toks@\expandafter{#1}% \edef#1{\the\toks@\the\@temptokena}% \fi \@temptokena{}\toks@\@temptokena} \newcommand\US@addlangextras[2]{% \AtBeginDocument{% \expandafter\US@addto\csname extras#1\endcsname #2}} \newcommand\US@addlangcaptions[2]{% \AtBeginDocument{% \expandafter\US@addto\csname captions#1\endcsname #2}} \DeclareOption{english}{% \edef\US@ENGstr{\string english}% \US@addlangextras{english}{\USextrasenglish}% \US@addlangcaptions{english}{\UScaptionsenglish}} \DeclareOption{UKenglish}{% \edef\US@ENGstr{\string UKenglish}% \US@addlangextras{UKenglish}{\USextrasenglish}% \US@addlangcaptions{UKenglish}{\UScaptionsenglish}} \DeclareOption{USenglish}{% \edef\US@ENGstr{\string USenglish}% \US@addlangextras{USenglish}{\USextrasenglish}% \US@addlangcaptions{USenglish}{\UScaptionsenglish}} \DeclareOption{british}{% \edef\US@ENGstr{\string british}% \US@addlangextras{british}{\USextrasenglish}% \US@addlangcaptions{british}{\UScaptionsenglish}} \DeclareOption{afrikaans}{% \US@addlangextras{afrikaans}{\USextrasafrikaans}% \US@addlangcaptions{afrikaans}{\UScaptionsafrikaans}} \newif\if@Report \@Reporttrue \newif\if@Masters \@Mastersfalse \newif\if@PhD \@PhDfalse \newif\if@Final \@Finalfalse \newcommand{\ThesisType}{} \newcommand{\PromotorText}{} \newcommand{\PromotorsText}{} \DeclareOption{report}{% \renewcommand{\ThesisType}{\TypeReport}% \renewcommand{\PromotorText}{\StudyLeaderType} \renewcommand{\PromotorsText}{\StudyLeadersType} \@Reporttrue \@Mastersfalse \@PhDfalse} \DeclareOption{masters-a}{% \renewcommand{\ThesisType}{\TypeAssignment}% \renewcommand{\PromotorText}{\StudyLeaderType} \renewcommand{\PromotorsText}{\StudyLeadersType} \@Reportfalse \@Masterstrue \@PhDfalse} \DeclareOption{masters-t}{% \renewcommand{\ThesisType}{\TypeThesis}% \renewcommand{\PromotorText}{\StudyLeaderType}% \renewcommand{\PromotorsText}{\StudyLeadersType}% \@Reportfalse \@Masterstrue \@PhDfalse} \DeclareOption{PhD}{% \renewcommand{\ThesisType}{\TypePhD}% \renewcommand{\PromotorText}{\PromotorType}% \renewcommand{\PromotorsText}{\PromotorsType}% \@Reportfalse \@Mastersfalse \@PhDtrue \@Finalfalse} \DeclareOption{PhDfinal}{% \renewcommand{\ThesisType}{\TypePhD}% \renewcommand{\PromotorText}{\PromotorType}% \renewcommand{\PromotorsText}{\PromotorsType}% \@Reportfalse \@Mastersfalse \@PhDtrue \@Finaltrue} \newif\if@ABlock \newif\if@GBlock \newif\if@WBlock \@ABlockfalse \@GBlockfalse \@WBlockfalse \DeclareOption{a5block}{% \@ABlocktrue \@GBlockfalse \@WBlockfalse} \DeclareOption{goldenblock}{% \@GBlocktrue \@ABlockfalse \@WBlockfalse} \DeclareOption{wideblock}{% \@GBlockfalse \@ABlockfalse \@WBlocktrue} \DeclareOption{stdblock}{% \@GBlockfalse \@ABlockfalse \@WBlockfalse} \ExecuteOptions{report} \ProcessOptions*\relax \newlength{\US@tdima} \newlength{\US@tdimb} \newsavebox{\US@tboxa} \newcounter{US@tcnta} \newcounter{US@tcntb} \if@ABlock \setstocksize{297.3mm}{210.2mm}% A4 paper \settrimmedsize{\stockheight}{\stockwidth}{*} \settypeblocksize{\paperwidth} {.5\paperheight}{*}% A5 text block \setulmargins{*}{*}{1.666667} % 5:3 \if@twoside %\setlrmargins{*}{*}{1.666667} % 5:3 \setlrmargins{*}{*}{1.000000} % 1:1 Changed in v3.0 \else \setlrmargins{*}{*}{1.000000} % 1:1 \fi \checkandfixthelayout \setlength{\headwidth}{\textwidth} \fi \if@GBlock \setstocksize{297.3mm}{210.2mm} \settrimmedsize{\stockheight}{\stockwidth}{*} \settypeblocksize{0.747547\paperheight} {0.666667\paperwidth}{*}% Golden ratio block \setulmargins{*}{*}{1.666667} % 5:3 \if@twoside %\setlrmargins{*}{*}{1.666667} % 5:3 \setlrmargins{*}{*}{1.000000} % 1:1 Changed in v3.0 \else \setlrmargins{*}{*}{1.000000} % 1:1 \fi \checkandfixthelayout \setlength{\headwidth}{\textwidth} \fi \if@WBlock \setstocksize{297.3mm}{210.2mm} \settrimmedsize{\stockheight}{\stockwidth}{*} \setlrmarginsandblock{25mm}{25mm}{*} \setulmarginsandblock{25mm}{25mm}{*} \checkandfixthelayout \setlength{\headwidth}{\textwidth} \fi \begingroup \catcode`\Q=3 \long\gdef\US@ifempt#1{\US@xifempt#1QQ\@secondoftwo\@firstoftwo\@nil} \long\gdef\US@xifempt#1#2Q#3#4#5\@nil{#4} \endgroup \newenvironment{US@adjustwidth}[2]{% \begin{list}{}{% \setlength{\topsep}{0pt}% \setlength{\partopsep}{0pt}% \setlength{\leftmargin}{#1}% \setlength{\rightmargin}{#2}% \setlength{\listparindent}{\parindent}% \setlength{\itemindent}{\parindent}% \setlength{\parsep}{\parskip}% }% \item[]}{\end{list}} \newenvironment{SetMargins}[2]% {\setlength{\US@tdima}{-1in-\hoffset-\oddsidemargin}% \setlength{\US@tdimb}{-\US@tdima}% \addtolength{\US@tdima}{#1}% \addtolength{\US@tdimb}{-\paperwidth+\textwidth+#2}% \begin{US@adjustwidth}{\US@tdima}{\US@tdimb}% }% {\end{US@adjustwidth}} \newenvironment{US@titlepage}[4] {\cleardoublepage \if@twocolumn \@restonecoltrue\onecolumn \else \@restonecolfalse\newpage \fi \thispagestyle{empty}% \setcounter{page}\@ne \setlength{\US@tdima}{1in+\voffset+\topmargin+\headheight+\headsep+\topskip}% \setlength{\US@tdimb}{#1 -\US@tdima}% \vspace*{\US@tdimb}% \addtolength{\US@tdima}{\textheight-\paperheight-\topskip}% \addtolength{\US@tdima}{#2}% \enlargethispage{-\US@tdima}% \setlength{\US@tdima}{-1in-\hoffset-\oddsidemargin}% \setlength{\US@tdimb}{-\US@tdima}% \addtolength{\US@tdima}{#3}% \addtolength{\US@tdimb}{-\paperwidth+\textwidth+#4}% \begin{US@adjustwidth}{\US@tdima}{\US@tdimb}% }% {\end{US@adjustwidth}% \if@restonecol\twocolumn \else \newpage \fi \if@twoside\else \setcounter{page}\@ne \fi} \let\maketitle\relax \newcommand{\TitlePage}{% \begingroup \let\footnote\relax \begin{US@titlepage}{2cm}{2.5cm}{2.5cm}{2.5cm}% \centering \if@Report \includegraphics[width=100mm]{USlogo-top}\par \else %\includegraphics[width=88mm]{UScrest-top}\par \fi \vfill {\LARGE \@title \par} \vspace{2em} \if@Authorpresent {\large \AuthByTxt\par} \vspace{2em} {\Large \lineskip .75em\relax% \begin{tabular}[t]{c}% \US@authorlong \end{tabular}\par}% \vfill \fi \if@Report\if@Subjectpresent {\large\DegreeNameLong\par} \vfill \fi\fi {\large\slshape \begin{US@adjustwidth}{1.5cm}{1.5cm} \centering\US@ThesisDescript \end{US@adjustwidth}\par} \vfill {\US@address\par} \vfill {\normalsize \US@promotorset \par} \vfill {\large \US@date\par}% \end{US@titlepage}% \endgroup \global\let\TitlePage\relax \setcounter{footnote}{0}% \global\let\thanks\relax \global\let\@thanks\@empty } \newif\if@Authorpresent \@Authorpresentfalse \renewcommand\author[2]{% \@Authorpresenttrue% \gdef\US@author{#1}% \gdef\US@authorlong{#2}} \newcommand\US@author{% \PackageWarning{usthesis}{No author supplied}% } \newcommand\US@authorlong{% \PackageWarning{usthesis}{No author supplied}% } \newcommand{\US@ThesisDescript}{} \newcommand\ThesisDescript[1]{% \long\gdef\US@ThesisDescript{#1}} \let\ReportDescript=\ThesisDescript \if@Masters \ThesisDescript{\MasterDescript} \fi \if@PhD \if@Final \ThesisDescript{\PhDFinalDescript} \else \ThesisDescript{\PhDDescript}% \fi \fi \newif\if@Subjectpresent \@Subjectpresentfalse \newcommand\degree[2]{% \@Subjectpresenttrue \gdef\DegreeName{#1}% \gdef\DegreeNameLong{#2}} \let\subject=\degree \newcommand\address[1]{\gdef\US@address{#1}} \let\adress\address % backward compatibility :-) \newcommand\US@address{% \PackageWarning{usthesis}{No institutional address supplied}} \newcommand\faculty[1]{\gdef\USfaculty{#1}} \newcommand\USfaculty{% \PackageWarning{usthesis}{No faculty supplied}} \newif\if@Promotorpresent \@Promotorpresentfalse \newif\ifUS@multprm\US@multprmfalse \newif\ifUS@prmstacked\US@prmstackedfalse \newcommand\US@promotor{} \newcommand*\US@prmalign{l} \newcommand*\US@prmnewline{~} \newcommand{\promotor}{% \@ifstar{\US@prmstackedtrue\@promotor}% {\US@prmstackedfalse\@promotor}} \newcommand{\@promotor}[2][l]{% \US@ifempt{#2}{}{\@Promotorpresenttrue}% \renewcommand*\US@prmalign{#1}% \renewcommand\US@promotor{#2}} \newcommand{\US@promotorset}{% \if@Promotorpresent \edef\US@beginTab{% \noexpand\begin{tabular}[t]{@{}\US@prmalign @{}}}% \edef\US@endTab{% \noexpand\end{tabular}}% \sbox{\US@tboxa}{% \let\and\US@prm@and% \US@beginTab% \US@promotor% \US@endTab}% \ifUS@prmstacked \makebox[\wd\US@tboxa][\US@prmalign]{% \ifUS@multprm\PromotorsText\else\PromotorText\fi}\\[1ex]% \usebox{\US@tboxa}% \else \ifUS@multprm\PromotorsText\else\PromotorText\fi \US@prmnewline% \usebox{\US@tboxa}% \fi \fi } \newcommand*{\US@prm@and}[1][2ex]{% \gdef\US@prmnewline{\\[2ex]}% \global\US@multprmtrue% \ifUS@prmstacked \\[#1]% \else \US@endTab \hskip 1em \@plus.17fil\relax \US@beginTab \fi \ignorespaces} \let\studyleader\promotor \let\supervisor\promotor \newcount\US@month \newcount\US@year \US@month=0 \US@year=\number\year \def\US@date{\MonthName{\US@month}\ \number\US@year} \newcommand{\setdate}[2]{% \US@ifempt{#1}{\US@month=0}{\US@month=#1}% \US@year=#2 \gdef\US@date{\MonthName{\US@month}\ \number\US@year}} \newcommand\CopyrightPage[1][\CopyrightHolder]{% %\clearpage %\thispagestyle{empty} %\mbox{}\par\vfill %\begin{center} % \CopyrightTxt\ \copyright\ \number\US@year\ #1\\ % \CopyrightAnot %\end{center} %\vfill\mbox{}\par %\clearpage } \newcommand\SetCopyrightHolder[1]{% \renewcommand\CopyrightHolder{#1}} \newif\ifUS@Copyright \US@Copyrighttrue \newcommand\SetCopyrightOff{% \US@Copyrightfalse} \let\US@DeclSign\@empty \let\US@DeclDate\@empty \newcommand{\DeclarationSign}[1]{\renewcommand\US@DeclSign{#1}} \newcommand{\DeclarationDate}[1]{\renewcommand\US@DeclDate{#1}} \newcommand\US@putdeclsign{% \ifx\US@DeclSign\@empty\relax\else \vspace{0.5cm} \noindent \begin{minipage}{.5\textwidth} \noindent \phantom{\Signat:}~\hfill\US@DeclSign\hfill\mbox{}\\[-.5\baselineskip] \Signat:~\dotfill\mbox{}\\ \phantom{\Signat:}~\hfill\makebox[0pt][c]{\US@author}\hfill\mbox{} \end{minipage} \par \fi} \newcommand\US@putdecldate{% \vspace{1cm} \noindent \begin{minipage}{.5\textwidth} \noindent \ifx\US@DeclDate\@empty\relax\else \phantom{\Signat:}~\hfill\makebox[0pt][c]{\US@DeclDate}\hfill\mbox{}\\[-.5\baselineskip] \fi \Datetxt:~ \dotfill\mbox{}\par \end{minipage} \par} \newcommand{\DeclarationPage}[1][\ThesisDeclare]{% \if@twocolumn \@restonecoltrue\onecolumn \else \@restonecolfalse \fi \par \thispagestyle{plain}% \chapter*{\DeclarationName}% \declaremark \phantomsection \addcontentsline{toc}{chapter}{\DeclarationName}% #1\par \US@putdeclsign \US@putdecldate \ifUS@Copyright \mbox{}\par \vfill \vfill \noindent\CopyrightTxt\ \copyright\ \number\US@year\ \CopyrightHolder\\ \noindent\CopyrightAnot \vfill \mbox{}\par \fi \if@restonecol\twocolumn\fi} \renewenvironment{abstract}[1][\languagename]% {\edef\@tempa{\expandafter\string #1}% \ifx\@tempa\languagename\relax\else \edef\@tempa{\noexpand\selectlanguage{#1}}\@tempa% \fi \if@twocolumn \@restonecoltrue\onecolumn \else \@restonecolfalse \fi \par \chapter*{\AbstractName}% \abstractmark \phantomsection \addcontentsline{toc}{chapter}{\AbstractName}% \if@Report\else \begin{center} {\large\bfseries \@title \par} \medskip {\lineskip .75em\relax% \begin{tabular}[t]{@{}c@{}}% \US@author \end{tabular}\par} \smallskip {\small\itshape\US@address\par} \smallskip {\ThesisType: \DegreeName\par} \smallskip {\US@date\par} \end{center} \fi \if@restonecol\twocolumn\fi% }{} \newcommand*{\US@headfnt}[1]{{\slshape\small#1}} \newcommand*{\US@numfnt}[1]{{\normalsize\bfseries#1}} \makepagestyle{usthesis} \setlength{\headwidth}{\textwidth} \makerunningwidth{usthesis}{\headwidth} \makeheadposition{usthesis}{flushright}{flushleft}{flushright}{flushleft} \if@twoside \makepsmarks{usthesis}{% \let\@mkboth\markboth \def\chaptermark##1{% \markboth{\MakeUppercase{% \ifnum \c@secnumdepth >\m@ne \if@mainmatter \@chapapp\ \thechapter. \ % \fi \fi ##1}}{}}% \def\sectionmark##1{% \markright{\MakeUppercase{% \ifnum \c@secnumdepth > \z@ \thesection. \ % \fi ##1}}}% \def\declaremark{\markboth{\MakeUppercase{\DeclarationName}}{}}% \def\abstractmark{\markboth{\MakeUppercase{\AbstractName}}{}}% \def\tocmark{\markboth{\MakeUppercase{\contentsname}}{}}% \def\lofmark{\markboth{\MakeUppercase{\listfigurename}}{}}% \def\lotmark{\markboth{\MakeUppercase{\listtablename}}{}}% \def\bibmark{\markboth{\MakeUppercase{\bibname}}{}}% \def\indexmark{\markboth{\MakeUppercase{\indexname}}{}}% } \makeevenhead{usthesis}{\US@numfnt{\thepage}}{}{\US@headfnt{\leftmark}} \makeoddhead{usthesis}{\US@headfnt{\rightmark}}{}{\US@numfnt{\thepage}} \else \makepsmarks{usthesis}{% \let\@mkboth\markboth \def\chaptermark##1{% \markright{\MakeUppercase{% \ifnum \c@secnumdepth >\m@ne \if@mainmatter \@chapapp\ \thechapter. \ % \fi \fi ##1}}}% \def\declaremark{\markright{\MakeUppercase{\DeclarationName}}}% \def\abstractmark{\markright{\MakeUppercase{\AbstractName}}}% \def\tocmark{\markright{\MakeUppercase{\contentsname}}}% \def\lofmark{\markright{\MakeUppercase{\listfigurename}}}% \def\lotmark{\markright{\MakeUppercase{\listtablename}}}% \def\bibmark{\markright{\MakeUppercase{\bibname}}}% \def\indexmark{\markright{\MakeUppercase{\indexname}}}% } \makeoddhead{usthesis}{\US@headfnt{\rightmark}}{}{\US@numfnt{\thepage}} \fi \setlength{\headwidth}{\textwidth} \makerunningwidth{plain}{\headwidth} \makeevenfoot{plain}{}{\US@numfnt{\thepage}}{} \makeoddfoot{plain}{}{\US@numfnt{\thepage}}{} \pagestyle{usthesis} \newcommand{\US@headfamily}{\normalfont\rmfamily} \setsecheadstyle{\US@headfamily\Large\bfseries\raggedright} \setsubsecheadstyle{\US@headfamily\large\bfseries\raggedright} \setsubsubsecheadstyle{\US@headfamily\normalsize\bfseries\raggedright} \setparaheadstyle{\US@headfamily\normalsize\bfseries} \setsubparaheadstyle{\US@headfamily\normalsize\bfseries} \setcounter{topnumber}{3} \setcounter{bottomnumber}{2} \setcounter{totalnumber}{4} \setcounter{dbltopnumber}{3} \renewcommand{\topfraction}{.85} \renewcommand{\bottomfraction}{.7} \renewcommand{\textfraction}{.1} \renewcommand{\floatpagefraction}{.7} \renewcommand{\dbltopfraction}{.85} \renewcommand{\dblfloatpagefraction}{.7} \setlength{\floatsep}{15pt plus 12pt} \setlength{\textfloatsep}{\floatsep} \setlength{\intextsep}{\floatsep} \setlength{\dblfloatsep}{15pt plus 12pt} \setlength{\dbltextfloatsep}{15pt plus 12pt} \setlength{\@fptop}{0pt plus1fil} \setlength{\@fpbot}{0pt plus1fil} \setlength{\@fpsep}{8pt plus1fil} \setlength{\@dblfptop}{0pt plus1fil} \setlength{\@dblfpbot}{0pt plus1fil} \setlength{\@dblfpsep}{8pt plus1fil} \captiondelim{: } \captionnamefont{\small\bfseries} \captiontitlefont{\small} \captionstyle{} \endinput %% %% End of file `usthesis.sty'.