From 33b37b61d2318108ad8afe5c7175b91282bf870f Mon Sep 17 00:00:00 2001 From: Karl Berry Date: Sun, 6 Feb 2011 16:41:21 +0000 Subject: ryethesis (6feb11) git-svn-id: svn://tug.org/texlive/trunk@21316 c570f23f-e606-0410-a88d-b1316a301751 --- .../texmf-dist/tex/latex/ryethesis/ryethesis.cls | 137 ++++++++++++++------- 1 file changed, 93 insertions(+), 44 deletions(-) (limited to 'Master/texmf-dist/tex/latex/ryethesis') diff --git a/Master/texmf-dist/tex/latex/ryethesis/ryethesis.cls b/Master/texmf-dist/tex/latex/ryethesis/ryethesis.cls index f1250b85ade..69b04fa47c0 100644 --- a/Master/texmf-dist/tex/latex/ryethesis/ryethesis.cls +++ b/Master/texmf-dist/tex/latex/ryethesis/ryethesis.cls @@ -22,9 +22,8 @@ %% \NeedsTeXFormat{LaTeX2e}[1999/12/01] \ProvidesClass{ryethesis} - [2010/06/18 v1.2 Ryerson University thesis class definition] + [2010/06/18 v1.3 Ryerson University thesis class definition] -\RequirePackage{xcolor} \RequirePackage{ifthen} \RequirePackage{fancyhdr} \RequirePackage{setspace} @@ -35,10 +34,10 @@ \newboolean{@ryelistoffigures} \setboolean{@ryelistoffigures}{true} \newboolean{@ryelistofillustrations} \setboolean{@ryelistofillustrations}{false} \newboolean{@ryelistofappendices} \setboolean{@ryelistofappendices}{true} +\newboolean{@ryehyperref} \setboolean{@ryehyperref}{true} \newboolean{@ryenomenclature} \setboolean{@ryenomenclature}{false} \newboolean{@ryeglossary} \setboolean{@ryeglossary}{false} \newboolean{@ryeindex} \setboolean{@ryeindex}{false} - \DeclareOption*{% \PassOptionsToClass{\CurrentOption}{book} } @@ -47,14 +46,14 @@ \DeclareOption{draft}{ \typeout{Ryerson-Thesis Class Option: `draft'} \ExecuteOptions{10pt,oneside} - \PassOptionsToClass{draft}{book} + \PassOptionsToClass{draft,oneside}{book} \setboolean{@ryedraft}{true} } \DeclareOption{final}{ \typeout{Ryerson-Thesis Class Option: `final'} \ExecuteOptions{10pt,twoside} - \PassOptionsToClass{final}{book} + \PassOptionsToClass{final,twoside}{book} \setboolean{@ryedraft}{false} } @@ -108,6 +107,11 @@ \setboolean{@ryelistofappendices}{false} } +\DeclareOption{nohyperref}{ + \typeout{Ryerson-Thesis Class Option: `nohyperref' Do not include hyperref} + \setboolean{@ryehyperref}{false} +} + \DeclareOption{los}{ \typeout{Ryerson-Thesis Class Option: `los' Enabling Nomenclature} \typeout{*********************************************************************} @@ -165,17 +169,19 @@ \setmargrb{1.25in}{1in}{1in}{1in} -\newcommand{\clearemptydoublepage}{\newpage{\pagestyle{empty}\cleardoublepage}} +\renewcommand{\cleardoublepage}{\newpage{\pagestyle{empty}% +\clearpage\if@twoside \ifodd\c@page\else% +\hbox{}\newpage\if@twocolumn\hbox{}\newpage\fi\fi\fi}} +\newcommand{\ryethesis@clearpage} +{\if@openright\cleardoublepage\else\clearpage\fi} \newif\if@ryethesismatchtoc \@ryethesismatchtocfalse \renewcommand\frontmatter{% - \cleardoublepage \@mainmatterfalse \@ryethesismatchtocfalse \pagenumbering{roman} \pagestyle{plain} \maketitle - \clearemptydoublepage \ryethesis@insertdeclaration \ryethesis@insertabstract \ryethesis@insertacknowledgements @@ -187,26 +193,29 @@ \ryethesis@insertloi \ryethesis@insertloa \ryethesis@insertnom - % Each of the above \ryethesis@insert commands apply a \clearemptydoublepage - \newpage + \ryethesis@clearpage \pagenumbering{arabic} \pagestyle{fancy} + % If the acronym feature is used with the glossary of terms, \gls + % commands for acronyms will be expanded on first use if used in the + % front matter (e.g. in the abstract). Reset this usage so that the + % first use of a \gls acronym is expanded in the main matter as well. + \ifthenelse{\boolean{@ryeglossary}}{\glsresetall}{} } \renewcommand\mainmatter{% - \clearemptydoublepage \@mainmattertrue \pagenumbering{arabic} \pagestyle{fancy} } \renewcommand\backmatter{% - \clearemptydoublepage \ifthenelse{\boolean{@ryelistofappendices}}{\@ryethesismatchtoctrue}{\@ryethesismatchtocfalse} \ryethesis@insertappendix \@ryethesismatchtocfalse \ryethesis@insertreferences \ryethesis@insertglossary \ryethesis@insertindex + \@mainmatterfalse } \fancyhead{} % Clear all header fields \fancyhead[LE,RO]{\slshape \rightmark} @@ -239,12 +248,16 @@ \global\def\ryethesis@theappendices{} +\def\title#1{\gdef\@title{#1}\if@ryehyperref\hypersetup{pdftitle={#1}}\fi} + +\def\author#1{\gdef\@author{#1}\if@ryehyperref\hypersetup{pdfauthor={#1}}\fi} + \newcommand{\documenttype}[1]{\ifx\empty#1\else\gdef\ryethesis@documentType{#1}\fi} \newcommand{\thesis}{\documenttype{thesis}} \newcommand{\dissertation}{\documenttype{dissertation}} \newcommand{\project}{\documenttype{project}} -\newcommand{\degreeName}[1]{\gdef\ryethesis@degree{#1}} +\newcommand{\degreeName}[1]{\gdef\ryethesis@degree{#1}\if@ryehyperref\hypersetup{pdfsubject={#1}}\fi} \newcommand{\degreeYear}[1]{\gdef\ryethesis@degreeYear{#1}} \newcommand{\program}[1]{\gdef\ryethesis@program{#1}} @@ -292,6 +305,7 @@ \end{large} \end{spacing} \end{titlepage} + } \newcommand{\declaration}{% Author declaration and release per SGS policy Sept. 2009. @@ -310,11 +324,12 @@ \newcommand{\ryethesis@insertdeclaration}{% \ifthenelse{\boolean{@ryedraft}} {} -{\declaration\clearemptydoublepage} +{\ryethesis@clearpage\declaration} } -\newcommand{\abstract}[1]{\ifx\empty#1\else\gdef\ryethesis@theabstract{#1}\fi} +\newcommand{\abstract}[1]{\ifx\empty#1\else\gdef\ryethesis@theabstract{\begin{center}\section*{Abstract}\end{center}#1}\fi} \newcommand{\ryethesis@insertabstract}{% +\ryethesis@clearpage \begin{spacing}{2} \begin{center} \normalsize @@ -322,11 +337,11 @@ \ryethesis@degree{} \ryethesis@degreeYear\\ \@author\\ \ryethesis@program\\ -Ryerson University{\ifx\empty\ryethesis@partnerUniv\else{ and \ryethesis@partnerUniv}\fi}\\ +Ryerson University{\ifx\empty\ryethesis@partnerUniv\else{ and + \ryethesis@partnerUniv}\fi}\\ \end{center} {\ifx\empty\ryethesis@theabstract{\begin{center}\textit{Abstract goes here!}\end{center}}\else\ryethesis@theabstract\fi} \end{spacing} -\clearemptydoublepage } @@ -334,11 +349,11 @@ Ryerson University{\ifx\empty\ryethesis@partnerUniv\else{ and \ryethesis@partner \newcommand{\ryethesis@insertacknowledgements}{% \ifx\empty\ryethesis@theacknowledgements\else{ +\ryethesis@clearpage \begin{center} \section*{Acknowledgements} \end{center} \ryethesis@theacknowledgements -\clearemptydoublepage }\fi } @@ -346,11 +361,11 @@ Ryerson University{\ifx\empty\ryethesis@partnerUniv\else{ and \ryethesis@partner \newcommand{\ryethesis@insertdedication}{% \ifx\empty\ryethesis@thededication\else{ +\ryethesis@clearpage \begin{center} \section*{Dedication} \end{center} \ryethesis@thededication -\clearemptydoublepage }\fi } @@ -373,30 +388,30 @@ Ryerson University{\ifx\empty\ryethesis@partnerUniv\else{ and \ryethesis@partner \newcommand{\noglossary}{\setboolean{@ryeglossary}{false}} \newcommand{\ryethesis@inserttoc}{ +\ryethesis@clearpage \tableofcontents -\clearemptydoublepage } \newcommand{\ryethesis@insertlot}{ -\ifthenelse{\boolean{@ryelistoftables}}{\listoftables\clearemptydoublepage}{} +\ifthenelse{\boolean{@ryelistoftables}}{\ryethesis@clearpage\listoftables}{} } \ifthenelse{\boolean{@ryelistofplates}} {\RequirePackage{float}\newfloat{plate}{h}{lop}}{} \newcommand{\ryethesis@insertlop}{ -\ifthenelse{\boolean{@ryelistofplates}}{\listof{plate}{List of Plates}}{} +\ifthenelse{\boolean{@ryelistofplates}}{\ryethesis@clearpage\listof{plate}{List of Plates}}{} } \newcommand{\ryethesis@insertlof}{ -\ifthenelse{\boolean{@ryelistoftables}}{\listoffigures\clearemptydoublepage}{} +\ifthenelse{\boolean{@ryelistoftables}}{\ryethesis@clearpage\listoffigures}{} } \ifthenelse{\boolean{@ryelistofillustrations}} {\RequirePackage{float}\newfloat{illustration}{h}{loi}}{} \newcommand{\ryethesis@insertloi}{ -\ifthenelse{\boolean{@ryelistofillustrations}}{\listof{illustration}{List of Illustrations}}{} +\ifthenelse{\boolean{@ryelistofillustrations}}{\ryethesis@clearpage\listof{illustration}{List of Illustrations}}{} } \ifthenelse{\boolean{@ryelistofappendices}} @@ -407,36 +422,48 @@ Ryerson University{\ifx\empty\ryethesis@partnerUniv\else{ and \ryethesis@partner {} \newcommand{\ryethesis@insertloa}{% -\ifthenelse{\boolean{@ryelistofappendices}}{\listofappendices\clearemptydoublepage}{} +\ifthenelse{\boolean{@ryelistofappendices}}{\ryethesis@clearpage\listofappendices}{} } \renewcommand{\appendix}[1]{\ifx\empty#1\else\gdef\ryethesis@theappendices{#1}\fi} -\def\addcontentsline#1#2#3{% -\if@ryethesismatchtoc% -{\ifthenelse{\equal{#1}{toc}}% -{\addtocontents{toa}{\protect\contentsline{#2}{#3}{\thepage}}}% -{\addtocontents{#1}{\protect\contentsline{#2}{#3}{\thepage}}}} -\else% -\addtocontents{#1}{\protect\contentsline{#2}{#3}{\thepage}}% -\fi -} - \newcommand{\ryethesis@insertappendix}{% \ifx\empty\ryethesis@theappendices\else{ +\ryethesis@clearpage \renewcommand{\thechapter}{\Alph{chapter}} \renewcommand{\chaptername}{Appendix} \setcounter{chapter}{0} \ryethesis@theappendices -\clearemptydoublepage }\fi } -\ifthenelse{\boolean{@ryeglossary}}{\RequirePackage{glossaries}\makeglossaries% + +\if@ryehyperref +\RequirePackage[pageanchor,hyperindex]{hyperref} +\RequirePackage{bookmark} +\fi + +\ifthenelse{\boolean{@ryeglossary}} +{\RequirePackage[acronym,toc]{glossaries}\makeglossaries% %Glossaries prints a confusing warning \global\let\warn@noprintglossary\relax }{} -\ifthenelse{\boolean{@ryeindex}}{\RequirePackage{makeidx}\makeindex}{} +\ifthenelse{\boolean{@ryeindex}} +{ +\RequirePackage{makeidx}\makeindex +\RequirePackage{multicol} +\renewenvironment{theindex} + {\begin{multicols}{2}[\@makeschapterhead{\indexname}\addcontentsline{toc}{chapter}{\indexname}% + \@mkboth{\MakeUppercase\indexname}% + {\MakeUppercase\indexname}]% + \thispagestyle{plain}\parindent\z@ + \parskip\z@ \@plus .3\p@\relax + \columnseprule \z@ + \columnsep 35\p@ + \let\item\@idxitem} + {\end{multicols}\clearpage} +} +{} \ifthenelse{\boolean{@ryenomenclature}}{% \RequirePackage{nomencl} @@ -445,23 +472,32 @@ Ryerson University{\ifx\empty\ryethesis@partnerUniv\else{ and \ryethesis@partner }{} \newcommand{\ryethesis@insertnom}{% -\ifthenelse{\boolean{@ryenomenclature}}{\printnomenclature\clearemptydoublepage}{} +\ifthenelse{\boolean{@ryenomenclature}}{\ryethesis@clearpage\printnomenclature}{} } \newcommand{\ryethesis@insertreferences}{% -\ifx\emtpy\ryethesis@listofbibfiles\else\bibliography{\ryethesis@listofbibfiles}\addcontentsline{toc}{chapter}{\bibname}\clearemptydoublepage\fi +\ifx\emtpy\ryethesis@listofbibfiles +\else + \ryethesis@clearpage\bibliography{\ryethesis@listofbibfiles} + \addcontentsline{toc}{chapter}{\bibname} +\fi } \newcommand{\ryethesis@insertglossary}{% \ifthenelse{\boolean{@ryeglossary}} -{\printglossaries%glossaries.sty prints a false warning. +{\ryethesis@clearpage% +\printglossaries%glossaries.sty prints a false warning. \global\let\warn@noprintglossary\relax% -\addcontentsline{toc}{chapter}{Glossary}\clearemptydoublepage} +} {} } \newcommand{\ryethesis@insertindex}{% -\ifthenelse{\boolean{@ryeindex}}{\printindex\addcontentsline{toc}{chapter}{Index}\clearemptydoublepage}{} +\ifthenelse{\boolean{@ryeindex}} +{\ryethesis@clearpage% +\printindex +} +{} } @@ -473,6 +509,17 @@ Ryerson University{\ifx\empty\ryethesis@partnerUniv\else{ and \ryethesis@partner \newcommand{\usereferences}{\renewcommand{\bibname}{References}} \newcommand{\useendnotes}{\renewcommand{\bibname}{End Notes}} +\newcommand{\Saved@addtocontents}{} +\let\Saved@addtocontents\addtocontents +\def\addtocontents#1#2{% +\if@ryethesismatchtoc% +{\ifthenelse{\equal{#1}{toc}}% +{\Saved@addtocontents{toa}{#2}} +{\Saved@addtocontents{#1}{#2}}} +\else +{\Saved@addtocontents{#1}{#2}} +\fi} + \AtEndOfClass{ \ifthenelse{\boolean{@ryedraft}} @@ -482,7 +529,9 @@ Ryerson University{\ifx\empty\ryethesis@partnerUniv\else{ and \ryethesis@partner \onehalfspacing} \usereferences } -\AtBeginDocument{\frontmatter\mainmatter} +\AtBeginDocument{ +\frontmatter\mainmatter +} \AtEndDocument{\backmatter} \endinput %% -- cgit v1.2.3