diff options
author | Karl Berry <karl@freefriends.org> | 2006-09-28 22:48:12 +0000 |
---|---|---|
committer | Karl Berry <karl@freefriends.org> | 2006-09-28 22:48:12 +0000 |
commit | adcde8f46f8a6c67c213b914bfd011a788cae34a (patch) | |
tree | de12b201baa3a39c7ce6a56993a2cf6b54c6ffa1 /Master/texmf-dist/tex/latex/hepthesis | |
parent | ae4d2166dc7e5d81d2ec04099721cece72004ef8 (diff) |
hepthesis update (29sep06)
git-svn-id: svn://tug.org/texlive/trunk@2215 c570f23f-e606-0410-a88d-b1316a301751
Diffstat (limited to 'Master/texmf-dist/tex/latex/hepthesis')
-rw-r--r-- | Master/texmf-dist/tex/latex/hepthesis/hepthesis.cls | 113 |
1 files changed, 85 insertions, 28 deletions
diff --git a/Master/texmf-dist/tex/latex/hepthesis/hepthesis.cls b/Master/texmf-dist/tex/latex/hepthesis/hepthesis.cls index 36e02ff9d7b..71cf0c6769b 100644 --- a/Master/texmf-dist/tex/latex/hepthesis/hepthesis.cls +++ b/Master/texmf-dist/tex/latex/hepthesis/hepthesis.cls @@ -15,11 +15,10 @@ %% ======================================================================== %% Admin %% ======================================================================== -\def\fileversion{1.2} -\def\filedate{2006/01/26} +\def\fileversion{1.3} +\def\filedate{2006/09/28} \NeedsTeXFormat{LaTeX2e} \ProvidesClass{hepthesis}[\filedate\space HEP thesis class by Andy Buckley (v\fileversion)] -%\typeout{hepthesis v\fileversion{} by Andy Buckley} %% ======================================================================== %% Option parsing @@ -29,7 +28,9 @@ \def\@yes{yes} \def\@requireamsmath{yes} \def\@requirebooktabs{yes} +\def\@requiresfheaders{} \def\@requiremakeidx{} +\def\@requiretitling{} \def\@requirehep{} \def\@requirehyper{} \def\@requiredraft{} @@ -49,6 +50,10 @@ \def\@oneside{} \PassOptionsToClass{twoside}{book}} +%% Sans serif titles? +\DeclareOption{sftitles}{% + \def\@sftitles{yes}} + %% Pad inner margins for binding \DeclareOption{bind}{% \def\@bindmargins{yes}} @@ -118,6 +123,11 @@ \def\@requiremakeidx{yes} } +%% Allows us to make an index +\DeclareOption{titling}{% + \def\@requiretitling{yes} +} + %% Particle physics options \DeclareOption{hep}{% \def\@requirehep{yes} @@ -171,13 +181,17 @@ %% ======================================================================== %% Base class and packages %% ======================================================================== + %% Base class \LoadClass[12pt]{book} + %% Use wide format if using A4 paper \ifx\@requireAFourWide\@empty\else\RequirePackage{a4wide}\fi + %% Hyperlinks (optional, has to come early in the package list) \ifx\@requirehyper\@empty\else\RequirePackage[colorlinks=true,bookmarks=true]{hyperref}\fi -%pdfpagemode=FullScreen +%pdfpagemode=None, FullScreen, UseThumbs, UseOutlines + %% AMS math package (optional) \ifx\@requireamsmath\@empty\else% \RequirePackage{amsmath} @@ -193,8 +207,24 @@ {\expandafter\let\expandafter\@oldoldendalignstar \csname endalign*\endcsname \@oldoldendalignstar \ignorespacesafterend} }% \fi + %% Index building (optional) \ifx\@requiremakeidx\@empty\else\RequirePackage{makeidx}\fi + +%% Use the \title and \author arguments to build the front page etc. +\ifx\@requiretitling\@empty% +%% Re-define \title and \author to store their args in \thetitle, \theauthor variables + \renewcommand*\title[1]{\gdef\@title{#1}\global\let\thetitle\@title}% + \renewcommand*\author[1]{\gdef\@author{#1}\global\let\theauthor\@author}% +\else% + \RequirePackage{titling}% +\fi + +%% Sans serif titles +\ifx\@sftitles\@empty\else% + \RequirePackage{sfheaders} +\fi + %% Nice tables (optional) \ifx\@requirebooktabs\@empty\else% \RequirePackage{booktabs} @@ -213,30 +243,44 @@ %% }% \fi + %% Convenience-included HEP packages (optional) \ifx\@requirehep\@empty\else\RequirePackage{hep}\fi + %% ``DRAFT'' underprint and line numbering in draft mode (optional) \ifx\@requiredraft\@empty\else% \RequirePackage[pagewise, mathlines, displaymath]{lineno} \RequirePackage{draftcopy} \fi + %% The right way to do custom spacing \RequirePackage{setspace} + %% Funky headers \RequirePackage{fancyhdr} + %% Make sure bibliography (but not ToC) appears in the ToC \RequirePackage[nottoc]{tocbibind} + %% Verbatim things \RequirePackage{verbatim,comment} + %% Subfigures \RequirePackage[loose]{subfigure} \subfiglabelskip=0pt + %% Nice captions (with continuation option) \RequirePackage[subfigure]{ccaption} % this one must come first... \RequirePackage[margin=20pt,labelfont=bf]{caption} + %% Rotated figures \RequirePackage{rotating} +%% Make maths in titles go automatically bold +\AtEndOfClass{% + \g@addto@macro\bfseries{\boldmath} +} + %% ======================================================================== %% Length definitions %% ======================================================================== @@ -446,7 +490,10 @@ \cleardoublepage% \vspace*{\@frontmattertopskip}% \begin{center}% - {\Large{\textbf{Acknowledgements}}}% + \begingroup + \ifx\@sftitles\@empty\else\sf\fi + {\LARGE{\textbf{Acknowledgements}}}% + \endgroup \end{center}% \vspace*{1cm}% }{% @@ -460,7 +507,10 @@ \cleardoublepage% \vspace*{\@frontmattertopskip}% \begin{center}% - {\Large{\textbf{Preface}}}% + \begingroup + \ifx\@sftitles\@empty\else\sf\fi + {\LARGE{\textbf{Preface}}}% + \endgroup \end{center}% \vspace*{1cm}% }{% @@ -477,7 +527,10 @@ \cleardoublepage% \vspace*{\@frontmattertopskip}% \begin{center}% - {\Large{\textbf{Declaration}}}% + \begingroup + \ifx\@sftitles\@empty\else\sf\fi + {\LARGE\textbf{Declaration}}% + \endgroup \end{center}% \vspace*{1cm}% }{% @@ -498,7 +551,10 @@ \cleardoublepage% \vspace*{\@frontmattertopskip}% \begin{center}% - {\Large\textbf{#1}}% + \begingroup + \ifx\@sftitles\@empty\else\sf\fi + {\LARGE\textbf{#1}}% + \endgroup \end{center}% \vspace*{1cm}% %\larger{% @@ -509,34 +565,35 @@ \ignorespacesafterend% } -%% Command for defining the title and author in the preamble +%% Deprecated: combined command for defining the title and author in the preamble \DeclareRobustCommand{\definethesis}[2]{% - \DeclareRobustCommand{\@thesistitle}{#1}% - \DeclareRobustCommand{\@thesisauthor}{#2}% - \author{\@thesisauthor}% - \title{\@thesistitle}% - \DeclareRobustCommand{\thetitle}{#1}% - \DeclareRobustCommand{\theauthor}{#2}% + \typeout{hepthesis: definethesis macro is deprecated. Use author and title macros instead.} + \author{#1}% + \title{#2}% } %% Makes a thesis title page \let\@oldtitlepage\titlepage \let\@oldendtitlepage\endtitlepage -\DeclareRobustCommand{\titlepage}[2]{% +\DeclareRobustCommand{\titlepage}[2][]{% \@oldtitlepage% + \begingroup + \ifx\@sftitles\@empty\else\sf\fi \begin{center}% \vspace*{\frontmattertitleskip}% \begin{doublespace}% - {\Large{\textbf{\@thesistitle}}}\\% + {\Huge\textbf{\thetitle}}\\% \end{doublespace}% \vspace*{3cm}% - {\large{{\@thesisauthor} \\ of \\ {#1}}}\\% + {\Large{{\theauthor} \\ {#1}}}\\% \vspace*{8cm}% {#2}% \end{center}% + \endgroup \@oldendtitlepage \cleardoublepage% } +\renewcommand{\maketitle}[1]{\titlepage{}} %% A main quote page \DeclareRobustCommand{\frontquote}[2]{% @@ -609,9 +666,9 @@ %% Table environment \let\@oldtable\table \let\@oldendtable\endtable -\renewenvironment{table}{% +\renewenvironment{table}[1][tbp]{% \vspace{0.4cm}% - \@oldtable[ht]% + \@oldtable[#1]% \begin{center}% }{% \end{center}% @@ -622,8 +679,8 @@ %% Figure environment \let\@oldfigure\figure \let\@oldendfigure\endfigure -\renewenvironment{figure}{ - \@oldfigure% +\renewenvironment{figure}[1][tbp]{ + \@oldfigure[#1]% \begin{center}% }{% \end{center}% @@ -634,8 +691,8 @@ %% Figure* environment (lots of \expandafter and \csname gubbins reqd... *sigh*) \expandafter\let\expandafter\@oldfigurestar \csname figure*\endcsname \expandafter\let\expandafter\@oldendfigurestar \csname endfigure*\endcsname -\renewenvironment{figure*}{ - \@oldfigurestar% +\renewenvironment{figure*}[1][tbp]{ + \@oldfigurestar[#1]% \begin{center}% }{% \end{center}% @@ -646,8 +703,8 @@ %% Sideways figure environment \let\@oldsidewaysfigure\sidewaysfigure \let\@oldendsidewaysfigure\endsidewaysfigure -\renewenvironment{sidewaysfigure}{ - \@oldsidewaysfigure% +\renewenvironment{sidewaysfigure}[1][tbp]{ + \@oldsidewaysfigure[#1]% \begin{center}% }{% \end{center}% @@ -657,7 +714,7 @@ %% ``Thesis''-prefixed duplicate commands and environments (deprecated) -\newcommand{\thesistypeout}{\typeout{hepthesis: thesis- prefix commands are deprecated}} +\newcommand{\thesistypeout}{\typeout{hepthesis: thesis- prefix commands are deprecated and will soon be removed}} \newenvironment{thesistable}{\thesistypeout\table}{\endtable\ignorespacesafterend} \newenvironment{thesistabular}{\thesistypeout\tabular}{\endtabular\ignorespacesafterend} \newenvironment{thesisfigure}{\thesistypeout\expandafter\let\expandafter\@oldoldfigurestar \csname figure*\endcsname \@oldoldfigurestar}% @@ -677,7 +734,7 @@ \newenvironment{thesisfrontmatter}{\thesistypeout\frontmatter}{\ignorespacesafterend} \newenvironment{thesismainmatter}{\thesistypeout\mainmatter}{\ignorespacesafterend} \newenvironment{thesisbackmatter}{\thesistypeout\backmatter}{\ignorespacesafterend} -\DeclareRobustCommand{\thesistitlepage}[2]{\thesistypeout\titlepage{#1}{#2}} +\DeclareRobustCommand{\thesistitlepage}[2][]{\thesistypeout\titlepage{#1}{#2}} \DeclareRobustCommand{\thesisfrontquote}[2]{\thesistypeout\frontquote{#1}{#2}} \DeclareRobustCommand{\thesischapterquote}[2]{\thesistypeout\chapterquote{#1}{#2}} \DeclareRobustCommand{\thesisverysubsection}[1]{\thesistypeout\verysubsection{#1}} |