summaryrefslogtreecommitdiff
path: root/Master/texmf-dist/tex/latex/pkuthss/pkuthss.cls
diff options
context:
space:
mode:
authorKarl Berry <karl@freefriends.org>2013-12-26 23:20:04 +0000
committerKarl Berry <karl@freefriends.org>2013-12-26 23:20:04 +0000
commit407b969501bb500853f34eb44afffd3db568c9a8 (patch)
tree76472579fdb941ba0d0a1d2f1cf31293b9262940 /Master/texmf-dist/tex/latex/pkuthss/pkuthss.cls
parentb52d30f89f74e929a7d66242dea6c39c8df9adfb (diff)
pkuthss (26dec13)
git-svn-id: svn://tug.org/texlive/trunk@32492 c570f23f-e606-0410-a88d-b1316a301751
Diffstat (limited to 'Master/texmf-dist/tex/latex/pkuthss/pkuthss.cls')
-rw-r--r--Master/texmf-dist/tex/latex/pkuthss/pkuthss.cls127
1 files changed, 71 insertions, 56 deletions
diff --git a/Master/texmf-dist/tex/latex/pkuthss/pkuthss.cls b/Master/texmf-dist/tex/latex/pkuthss/pkuthss.cls
index b7cfc3e9186..0df8967a097 100644
--- a/Master/texmf-dist/tex/latex/pkuthss/pkuthss.cls
+++ b/Master/texmf-dist/tex/latex/pkuthss/pkuthss.cls
@@ -24,13 +24,17 @@
\NeedsTeXFormat{LaTeX2e}[1995/12/01]
\ProvidesClass{pkuthss}
- [2013/04/07 v1.4-rc3 Peking University dissertation document class]
+ [2013/12/26 v1.4-rc4 Peking University dissertation document class]
% Process the encoding options.
\newif\ifpkuthss@opt@gbk \pkuthss@opt@gbktrue
\DeclareOption{GBK}{\pkuthss@opt@gbktrue\PassOptionsToClass{GBK}{ctexbook}}
\DeclareOption{UTF8}%
{\pkuthss@opt@gbkfalse\PassOptionsToClass{UTF8}{ctexbook}}
+% Whether to enable `\Uppercase' (works problematically) in heading marks.
+\newif\ifpkuthss@opt@uppermark \pkuthss@opt@uppermarkfalse
+\DeclareOption{uppermark}{\pkuthss@opt@uppermarktrue}
+\DeclareOption{nouppermark}{\pkuthss@opt@uppermarkfalse}
% Whether to enable the default extra settings.
\newif\ifpkuthss@opt@extra \pkuthss@opt@extratrue
\DeclareOption{extra}{\pkuthss@opt@extratrue}
@@ -47,7 +51,6 @@
\pkuthss@int@extraopt{spacing}
\pkuthss@int@extraopt{tightlist}
\pkuthss@int@extraopt{pdftoc}
-\pkuthss@int@extraopt{uppermark}
\pkuthss@int@extraopt{spechap}
\pkuthss@int@extraopt{pdfprop}
\pkuthss@int@extraopt{colorlinks}
@@ -56,10 +59,10 @@
% Process all class options now.
\ProcessOptions\relax
-% pkuthss is based on ctexbook; We use A4 paper, and `xiao 4' as default font size.
+% pkuthss is based on ctexbook; We use `xiao 4' as default font size.
% CJKfntef provides \CJKunderline used in \maketitle.
% fancyhdr provides utilities for setting headers and footers.
-\LoadClass[hyperref, a4paper, cs4size, fntef, fancyhdr]{ctexbook}[2011/03/11]
+\LoadClass[hyperref, cs4size, fntef, fancyhdr]{ctexbook}[2011/03/11]
% Provide support for `key = val' grammar.
\RequirePackage{keyval}
% Graphics support.
@@ -87,18 +90,48 @@
}
% Set page layout.
-\geometry{height = 240mm, width = 150mm, includeheadfoot, headheight = 1.2em}
-% Set headers and footers.
-\pagestyle{fancy}\fancyhf{}
-\fancyhead[LE]{\small\normalfont\leftmark}
-\fancyhead[RO]{\small\normalfont\rightmark}
-\fancyhead[LO,RE]{\small\normalfont\cuniversity\cthesisname}
-\fancyfoot[RO,LE]{\small\normalfont --~\thepage~--}
-% Set the headers and footers on the first page in every chapter.
-\fancypagestyle{plain}{
- \fancyhf{}\renewcommand{\headrulewidth}{0pt}
- \fancyfoot[RO,LE]{\small\normalfont --~\thepage~--}
+\geometry{
+ a4paper, height = 240mm, width = 150mm, includeheadfoot, headheight = 1.2em
}
+% Internal command to set headers and footers.
+\def\pkuthss@int@setpagestyle{
+ % Set the headers and footers on the first page in every chapter.
+ \fancypagestyle{plain}{
+ \fancyhf{}\renewcommand{\headrulewidth}{0pt}
+ \if@twoside
+ \fancyfoot[RO,LE]{\small\normalfont --~\thepage~--}
+ \else
+ \fancyfoot[C]{\small\normalfont --~\thepage~--}
+ \fi
+ }
+ % Set the headers and footers on other pages.
+ \fancypagestyle{pkuthss}{
+ \fancyhf{}
+ \if@twoside
+ \fancyhead[LE]{\small\normalfont\pkuthss@int@setcase{\leftmark}}
+ \fancyhead[RO]{\small\normalfont\pkuthss@int@setcase{\rightmark}}
+ \fancyhead[LO,RE]{%
+ \small\normalfont\pkuthss@int@setcase{\cuniversity\cthesisname}%
+ }
+ \fancyfoot[RO,LE]{\small\normalfont --~\thepage~--}
+ \else
+ \fancyhead[L]{\small\normalfont\pkuthss@int@setcase{\leftmark}}
+ \fancyhead[R]{\small\normalfont\pkuthss@int@setcase{\rightmark}}
+ \fancyfoot[C]{\small\normalfont --~\thepage~--}
+ \fi
+ }
+ \pagestyle{pkuthss}
+}
+% `\MakeUppercase' works problematically.
+% eg. it converts `\cite{ctex}' into `\cite{CTEX}'.
+% This option can disable `\MakeUppercase' in left/right heading marks.
+\ifpkuthss@opt@uppermark
+ \def\pkuthss@int@setcase#1{#1}
+ \pkuthss@int@setpagestyle
+\else
+ \def\pkuthss@int@setcase#1{\nouppercase{#1}}
+ \pkuthss@int@setpagestyle
+\fi
% eg. `\pkuthss@int@infoitema{ctitle}' will expand to:
% \def\ctitle#1{\def\@ctitle{#1}}
@@ -190,12 +223,12 @@
{\label@studentid} &
\pkuthss@int@fillinblank{1}{\pkuthss@tmp@len}{\kaishu\@studentid} \\
{\label@school} &
- \pkuthss@int@fillinblank{1}{\pkuthss@tmp@len}{\kaishu\@school} \\
+ \pkuthss@int@fillinblank{1}{\pkuthss@tmp@len}{\kaishu\@school} \\
{\label@cmajor} &
- \pkuthss@int@fillinblank{1}{\pkuthss@tmp@len}{\kaishu\@cmajor} \\
+ \pkuthss@int@fillinblank{1}{\pkuthss@tmp@len}{\kaishu\@cmajor} \\
{\label@direction} &
\pkuthss@int@fillinblank{1}{\pkuthss@tmp@len}{\kaishu\@direction} \\
- {\label@cmentora} &
+ {\label@cmentor} &
\pkuthss@int@fillinblank{1}{\pkuthss@tmp@len}{\kaishu\@cmentor} \\
\end{tabular}
}
@@ -206,51 +239,33 @@
\end{titlepage}
}
-% Internal environment for typesetting abstracts.
-\newenvironment{pkuthss@int@abstract}{
+% Typesetting the Chinese abstract.
+\newenvironment{cabstract}{
+ \cleardoublepage
+ \pdfbookmark[1]{\cabstractname}{cabstract}
+ \chapter*{\zihao{-2}\cabstractname}
+ \markboth{\cabstractname}{}
+}{% Keywords at the bottom of the page.
+ \vfill\noindent\textbf{\label@ckeywords}{\@ckeywords}
+}
+
+% Typesetting the English abstract.
+\newenvironment{eabstract}{
\cleardoublepage
- \pdfbookmark[1]{\pkuthss@tmp@abstractname}{\pkuthss@tmp@abstlabel}
- \chapter*{\zihao{-2}\pkuthss@tmp@title}
- \markboth{\pkuthss@tmp@abstractname}{}
+ \pdfbookmark[1]{\eabstractname}{eabstract}
+ \chapter*{\zihao{-2}\@etitle}
+ \markboth{\eabstractname}{}
\vspace{-2em}\par
\begin{center}
- \zihao{-3}
- {\pkuthss@tmp@author}\quad{\pkuthss@tmp@major}\\
- {\pkuthss@tmp@label@mentor}{\pkuthss@tmp@mentor}
+ \zihao{-3}
+ {\@eauthor} ({\@emajor})\\
+ {\label@ementor}{\@ementor}
\end{center}
\vspace{1em}\par
- \section*{\zihao{4}\pkuthss@tmp@abstractname}
+ \section*{\zihao{4}\eabstractname}
\vskip 0.5em
}{% Keywords at the bottom of the page.
- \vfill\noindent\textbf{\pkuthss@tmp@label@keywords}{\pkuthss@tmp@keywords}
+ \vfill\noindent\textbf{\label@ekeywords}{\@ekeywords}
}
-% Typesetting the Chinese abstract.
-\newenvironment{cabstract}{
- \def\pkuthss@tmp@abstlabel{cabstract}
- \let\pkuthss@tmp@title\@ctitle
- \let\pkuthss@tmp@author\@cauthor
- \let\pkuthss@tmp@major\@cmajor
- \let\pkuthss@tmp@mentor\@cmentor
- \let\pkuthss@tmp@keywords\@ckeywords
- \let\pkuthss@tmp@label@mentor\label@cmentorb
- \let\pkuthss@tmp@label@keywords\label@ckeywords
- \let\pkuthss@tmp@abstractname\cabstractname
- \begin{pkuthss@int@abstract}
-}{\end{pkuthss@int@abstract}}
-
-% Typesetting the English abstract.
-\newenvironment{eabstract}{
- \def\pkuthss@tmp@abstlabel{eabstract}
- \let\pkuthss@tmp@title\@etitle
- \let\pkuthss@tmp@author\@eauthor
- \let\pkuthss@tmp@major\@emajor
- \let\pkuthss@tmp@mentor\@ementor
- \let\pkuthss@tmp@keywords\@ekeywords
- \let\pkuthss@tmp@label@mentor\label@ementor
- \let\pkuthss@tmp@label@keywords\label@ekeywords
- \let\pkuthss@tmp@abstractname\eabstractname
- \begin{pkuthss@int@abstract}
-}{\end{pkuthss@int@abstract}}
-
\endinput