summaryrefslogtreecommitdiff
path: root/Master/texmf-dist/source/latex/ryethesis
diff options
context:
space:
mode:
authorKarl Berry <karl@freefriends.org>2011-02-06 16:41:21 +0000
committerKarl Berry <karl@freefriends.org>2011-02-06 16:41:21 +0000
commit33b37b61d2318108ad8afe5c7175b91282bf870f (patch)
treed67d4975787e98a7afe447052ef76dc81903f7a1 /Master/texmf-dist/source/latex/ryethesis
parent300c48ee48cd89dab7bc133b81ba84eda8b6d605 (diff)
ryethesis (6feb11)
git-svn-id: svn://tug.org/texlive/trunk@21316 c570f23f-e606-0410-a88d-b1316a301751
Diffstat (limited to 'Master/texmf-dist/source/latex/ryethesis')
-rw-r--r--Master/texmf-dist/source/latex/ryethesis/ryethesis.dtx184
1 files changed, 134 insertions, 50 deletions
diff --git a/Master/texmf-dist/source/latex/ryethesis/ryethesis.dtx b/Master/texmf-dist/source/latex/ryethesis/ryethesis.dtx
index abd7991d48b..84c6c60c61c 100644
--- a/Master/texmf-dist/source/latex/ryethesis/ryethesis.dtx
+++ b/Master/texmf-dist/source/latex/ryethesis/ryethesis.dtx
@@ -22,7 +22,7 @@
%<class>\NeedsTeXFormat{LaTeX2e}[1999/12/01]
%<class>\ProvidesClass{ryethesis}
%<*class>
- [2010/06/18 v1.2 Ryerson University thesis class definition]
+ [2010/06/18 v1.3 Ryerson University thesis class definition]
%</class>
%
%<*driver>
@@ -39,7 +39,7 @@
%</driver>
% \fi
%
-% \CheckSum{755}
+% \CheckSum{845}
%
% \CharacterTable
% {Upper-case \A\B\C\D\E\F\G\H\I\J\K\L\M\N\O\P\Q\R\S\T\U\V\W\X\Y\Z
@@ -63,6 +63,10 @@
% xcolor package earlier in file.}
% \changes{v1.2}{2010/07/05}{Changed \\degree to \\degreeName to avoid
% conflict with package unitsdef.}
+% \changes{v1.3}{2010/07/08}{Removed xcolor. Include hyperref to avoid
+% problems for users with List of Appendices. Fixed \\cleardoublepage
+% for two-sided mode to insert empty page. Fixed draft mode to be
+% one-sided. }
%
% \GetFileInfo{ryethesis.dtx}
%
@@ -175,12 +179,19 @@
% Typically, most documents which include an appendix list the appendices within the Table of Contents. SGS formatting policy indicates a separate List of Appendices. This switch is enabled by default, and any |\chapter| or lower sectioning will appear in a separate List of Appendices. You must use the |\appendix| command for the appendices to be numbered and inserted correctly. No List of Appendices will appear if you do not use the |\appendix| command.
%
% \DescribeToggle{glossary}{noglossary}{\includeglossary}{\noglossary}
-% Glossaries are supported using the |glossaries| package but are optional. You will need to do additional processing using the |makeglossaries| command to generate the glossary content. See the |glossaries| package for more details. Include glossary commands for identifying glossary items but do not issue the |\printglossary| command as this is handled automatically if glossaries are enabled.
+% Glossaries are supported using the |glossaries| package but are
+% optional. You will need to do additional processing using the
+% |makeglossaries| command to generate the glossary content. See the
+% |glossaries| package for more details. Include glossary commands for
+% identifying glossary items but do not issue the |\printglossary|
+% command as this is handled automatically if glossaries are
+% enabled. Acronyms can be defined in the glossary using the
+% |\newacronym| command and will be listed separately within the
+% glossary
%
% \vspace{\baselineskip}\DescribeToggle{index}{noindex}{\includeindex}{\noindex}
% An optional index is supported using the |makeindex| command in the normal fashion. Indicate index items using the |\index| command but do not issue the |\printindex| command as this is handled automatically if indices enabled.
%
-%
% \StopEventually{\PrintChanges\PrintIndex}
%
% \section{Implementation}
@@ -194,7 +205,6 @@
%
% \begin{macrocode}
% A minimal set of packages as required by the class
-\RequirePackage{xcolor}
\RequirePackage{ifthen}
\RequirePackage{fancyhdr}
\RequirePackage{setspace}
@@ -232,6 +242,10 @@
% in a separate list, and not within the ToC.
%
\newboolean{@ryelistofappendices} \setboolean{@ryelistofappendices}{true}
+% As the List of Appendices overrides the |\addtocontents| command,
+% hyperef is included by this class to avoid broken links when
+% including the table of contents or list of appendices.
+\newboolean{@ryehyperref} \setboolean{@ryehyperref}{true}
%
% Ryerson SGS policy does not specify anything about a list of
% symbols or nomenclature, however in engineering, math, and
@@ -242,7 +256,7 @@
% Glossaries and indices require extra processing. These are disabled by default as they are likely uncommon in a thesis or dissertation.
\newboolean{@ryeglossary} \setboolean{@ryeglossary}{false}
\newboolean{@ryeindex} \setboolean{@ryeindex}{false}
-
+%
% This class is based upon the book class
\DeclareOption*{%
\PassOptionsToClass{\CurrentOption}{book}
@@ -254,7 +268,7 @@
\DeclareOption{draft}{
\typeout{Ryerson-Thesis Class Option: `draft'}
\ExecuteOptions{10pt,oneside}
- \PassOptionsToClass{draft}{book}
+ \PassOptionsToClass{draft,oneside}{book}
\setboolean{@ryedraft}{true}
}
@@ -262,7 +276,7 @@
\DeclareOption{final}{
\typeout{Ryerson-Thesis Class Option: `final'}
\ExecuteOptions{10pt,twoside}
- \PassOptionsToClass{final}{book}
+ \PassOptionsToClass{final,twoside}{book}
\setboolean{@ryedraft}{false}
}
@@ -326,6 +340,13 @@
\setboolean{@ryelistofappendices}{false}
}
+% Do not include hyperref
+\DeclareOption{nohyperref}{
+ \typeout{Ryerson-Thesis Class Option: `nohyperref' Do not include hyperref}
+ \setboolean{@ryehyperref}{false}
+}
+
+
% Include a list of symbols (i.e. a nomenclature). Requires additional processing of the document.
\DeclareOption{los}{
\typeout{Ryerson-Thesis Class Option: `los' Enabling Nomenclature}
@@ -406,11 +427,17 @@
% \item \textbf{Back matter} no format specified so keeping same style as main matter
% \end{description}
-% \begin{macro}{\clearemptydoublepage}
-% Create a new page, set page style to empty (no footer or header), then issue a clear page if in |twoside| mode. Used before nearly every ToC, list, or start of new front matter section. This results in part (e.g.\ Table of Contents) starting on the right hand side (odd page number) in |twoside| mode.
+% \begin{macro}{\cleardoublepage}
+% Create a new page, set page style to empty (no footer or header), then issue a clear page if in |twoside| mode. Used before every ToC, list, or start of new chapter. This results in part (e.g.\ Table of Contents) starting on the right hand side (odd page number) in |twoside| mode.
% \begin{macrocode}
-% clearemptydoublepage from page 92 of The LaTeX Companion 1993.
-\newcommand{\clearemptydoublepage}{\newpage{\pagestyle{empty}\cleardoublepage}}
+% based upon clearemptydoublepage from page 92 of
+% The LaTeX Companion, 1993.
+\renewcommand{\cleardoublepage}{\newpage{\pagestyle{empty}%
+\clearpage\if@twoside \ifodd\c@page\else%
+\hbox{}\newpage\if@twocolumn\hbox{}\newpage\fi\fi\fi}}
+% An internal clearpage command
+\newcommand{\ryethesis@clearpage}
+{\if@openright\cleardoublepage\else\clearpage\fi}
% \end{macrocode}
% \end{macro}
@@ -419,13 +446,11 @@
% \begin{macrocode}
\newif\if@ryethesismatchtoc \@ryethesismatchtocfalse
\renewcommand\frontmatter{%
- \cleardoublepage
\@mainmatterfalse
\@ryethesismatchtocfalse
\pagenumbering{roman}
\pagestyle{plain}
\maketitle
- \clearemptydoublepage
\ryethesis@insertdeclaration
\ryethesis@insertabstract
\ryethesis@insertacknowledgements
@@ -437,10 +462,14 @@
\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}{}
}
% \end{macrocode}
% \end{macro}
@@ -449,7 +478,6 @@
% Sets up page style of the main matter (i.e. the body) of the document. This function is called by the class after |\frontmatter| and does not need to be called by the end user.
% \begin{macrocode}
\renewcommand\mainmatter{%
- \clearemptydoublepage
\@mainmattertrue
\pagenumbering{arabic}
\pagestyle{fancy}
@@ -460,7 +488,6 @@
% Insert the back matter, beginning with the appendices, if any. This function is called by the class at the end of the document and does not need to be called by the end user. This means that the appendices and bibliography must be defined in a similar way as the front matter content is defined.
% \begin{macrocode}
\renewcommand\backmatter{%
- \clearemptydoublepage
% Redirect toc entries to toa if a List of Appendices is used
\ifthenelse{\boolean{@ryelistofappendices}}{\@ryethesismatchtoctrue}{\@ryethesismatchtocfalse}
\ryethesis@insertappendix
@@ -469,6 +496,7 @@
\ryethesis@insertreferences
\ryethesis@insertglossary
\ryethesis@insertindex
+ \@mainmatterfalse
}
% \end{macrocode}
% \end{macro}
@@ -513,6 +541,20 @@
% The following commands are used to define the above variable content.
+% \begin{macro}{\title}
+% Override the default behaviour of |\title|
+% \begin{macrocode}
+\def\title#1{\gdef\@title{#1}\if@ryehyperref\hypersetup{pdftitle={#1}}\fi}
+% \end{macrocode}
+% \end{macro}
+
+% \begin{macro}{\author}
+% Override the default behaviour of |\author|
+% \begin{macrocode}
+\def\author#1{\gdef\@author{#1}\if@ryehyperref\hypersetup{pdfauthor={#1}}\fi}
+% \end{macrocode}
+% \end{macro}
+
% \begin{macro}{\documentype}
% Specify the document type (e.g. thesis, dissertation, or project. Users may use this command to override the currently defined options.
% \begin{macrocode}
@@ -543,7 +585,7 @@
% \begin{macrocode}
% Was \degree but changed to the more specific \degreeName to avoid
% conflict with other packages
-\newcommand{\degreeName}[1]{\gdef\ryethesis@degree{#1}}
+\newcommand{\degreeName}[1]{\gdef\ryethesis@degree{#1}\if@ryehyperref\hypersetup{pdfsubject={#1}}\fi}
% \end{macrocode}
% \end{macro}
% \begin{macro}{\degreeYear}
@@ -622,6 +664,7 @@
\end{large}
\end{spacing}
\end{titlepage}
+
}
% \end{macrocode}
% \end{macro}
@@ -648,7 +691,7 @@
\newcommand{\ryethesis@insertdeclaration}{%
\ifthenelse{\boolean{@ryedraft}}
{}
-{\declaration\clearemptydoublepage}
+{\ryethesis@clearpage\declaration}
}
% \end{macrocode}
% \end{macro}
@@ -658,8 +701,9 @@
% \begin{macro}{\ryethesis@insertabstract}
% This code will insert a UMI/ProQuest compatible abstract, double spaced as required. The |\abstract| command is redefined to set the content of the abstract variable |\ryethesis@theabstract|.
% \begin{macrocode}
-\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
% A UMI/ProQuest compatible abstract
\begin{spacing}{2}
\begin{center}
@@ -668,13 +712,13 @@
\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}
%\begin{minipage}{\textwidth}
{\ifx\empty\ryethesis@theabstract{\begin{center}\textit{Abstract goes here!}\end{center}}\else\ryethesis@theabstract\fi}
%\end{minipage}
\end{spacing}
-\clearemptydoublepage
}
% \end{macrocode}
% \end{macro}
@@ -691,11 +735,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
}
@@ -703,11 +747,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
}
@@ -772,30 +816,30 @@ Ryerson University{\ifx\empty\ryethesis@partnerUniv\else{ and \ryethesis@partner
% A number of |\ryethesis@insert*| commands follow. Each command has a similar function, creating a new page with the necessary content (e.g. List of Figures, Table of Contents, etc). None of these commands are intended to be called by the end user.
% \begin{macrocode}
\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}}
@@ -806,37 +850,51 @@ 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}{%
% If a list of appendices is requested, redirect the toc entries into a different file
\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%
+
+% Insert hyperref package, if not disabled by class option
+\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{index}\makeindex
+\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}
@@ -845,23 +903,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
+}
+{}
}
% \end{macrocode}
@@ -888,6 +955,21 @@ Ryerson University{\ifx\empty\ryethesis@partnerUniv\else{ and \ryethesis@partner
% \end{macro}
% \end{macro}
+% \begin{macrocode}
+%Adjust |\addtocontents| to switch from toc to toa file if using List
+%of Appendices
+\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}
+% \end{macrocode}
+
% Final commands to issue at the end of the class. In the case of draft mode, the line spacing is set to double spacing. In final mode, a line spacing of 1.5 is used, as required by SGS. The |\usereferences| command is used to label the bibliographic section as ``References'' by default.
% \begin{macrocode}
@@ -903,7 +985,9 @@ Ryerson University{\ifx\empty\ryethesis@partnerUniv\else{ and \ryethesis@partner
% The |\AtBeginDocument| and |\AtEndDocument| are used to insert the front, main, and back matter in the correct place for the user. This tightly controls the order of appearance of each type of content.
% \begin{macrocode}
% Insert front matter & mainmatter settings before user's material
-\AtBeginDocument{\frontmatter\mainmatter}
+\AtBeginDocument{
+\frontmatter\mainmatter
+}
% Insert back matter at the end
\AtEndDocument{\backmatter}
% \end{macrocode}