From ab0f0949de94da73efd246324ac40f0b47a60688 Mon Sep 17 00:00:00 2001
From: Karl Berry <karl@freefriends.org>
Date: Thu, 18 Jun 2015 23:15:28 +0000
Subject: pkuthss (18jun15)

git-svn-id: svn://tug.org/texlive/trunk@37599 c570f23f-e606-0410-a88d-b1316a301751
---
 Master/texmf-dist/tex/latex/pkuthss/pkuthss.cls | 145 ++++++++++++------------
 1 file changed, 75 insertions(+), 70 deletions(-)

(limited to 'Master/texmf-dist/tex/latex/pkuthss/pkuthss.cls')

diff --git a/Master/texmf-dist/tex/latex/pkuthss/pkuthss.cls b/Master/texmf-dist/tex/latex/pkuthss/pkuthss.cls
index cf9edac2f87..606bf2406a1 100644
--- a/Master/texmf-dist/tex/latex/pkuthss/pkuthss.cls
+++ b/Master/texmf-dist/tex/latex/pkuthss/pkuthss.cls
@@ -26,7 +26,7 @@
 
 \NeedsTeXFormat{LaTeX2e}[1995/12/01]
 \ProvidesClass{pkuthss}
-	[2015/04/28 v1.6.0 Peking University dissertation document class]
+	[2015/06/18 v1.6.2 Peking University dissertation document class]
 
 % Process the encoding options.
 \newif\ifpkuthss@opt@gbk \pkuthss@opt@gbktrue
@@ -86,8 +86,8 @@
 			}
 	\else\ifpdf
 		% Fix garbled text in bookmarks for pdfLaTeX compilation in GBK.
-		% Temporary fix until release of ctex 2.x, which will by itself
-		% load xCJK2uni when necessary.
+		% Compatibility settings for ctex 1.x, to be removed in 2017; ctex 2.x
+		% loads xCJK2uni by itself when necessary.
 		\RequirePackage{xCJK2uni}
 	\fi\fi
 \fi
@@ -99,6 +99,42 @@
 	\fi
 }
 
+% eg. `\pkuthss@int@infoitema{ctitle}' will expand to:
+%   \def\ctitle#1{\def\@ctitle{#1}}
+%   \define@key{pkuthss@info}{ctitle}{\ctitle{#1}}
+\def\pkuthss@int@infoitema#1{
+	\@namedef{#1}##1{\@namedef{@#1}{##1}}
+	\define@key{pkuthss@info}{#1}{\@nameuse{#1}{##1}}
+}
+% eg. `\pkuthss@int@infoitemb{cuniversity}' will expand to:
+%   \define@key{pkuthss@info}{cuniversity}{\def\cuniversity{#1}}
+\def\pkuthss@int@infoitemb#1{
+	\define@key{pkuthss@info}{#1}{\@namedef{#1}{##1}}
+}
+% Set up document information entries.
+\pkuthss@int@infoitema{ctitle}
+\pkuthss@int@infoitema{etitle}
+\pkuthss@int@infoitema{cauthor}
+\pkuthss@int@infoitema{eauthor}
+\pkuthss@int@infoitema{studentid}
+\pkuthss@int@infoitema{date}
+\pkuthss@int@infoitema{school}
+\pkuthss@int@infoitema{cmajor}
+\pkuthss@int@infoitema{emajor}
+\pkuthss@int@infoitema{direction}
+\pkuthss@int@infoitema{cmentor}
+\pkuthss@int@infoitema{ementor}
+\pkuthss@int@infoitema{ckeywords}
+\pkuthss@int@infoitema{ekeywords}
+\pkuthss@int@infoitemb{cuniversity}
+\pkuthss@int@infoitemb{euniversity}
+\pkuthss@int@infoitemb{cthesisname}
+\pkuthss@int@infoitemb{ethesisname}
+\pkuthss@int@infoitemb{cabstractname}
+\pkuthss@int@infoitemb{eabstractname}
+% Set up document information using the `key = value' grammar.
+\newcommand*{\pkuthssinfo}[1]{\setkeys{pkuthss@info}{#1}}
+
 % Set up page layout.
 \geometry{
 	a4paper, includefoot, hmargin = 2.6cm, top = 3cm, bottom = 2.5cm,
@@ -115,21 +151,21 @@
 \CTEXsetup[
 	nameformat = {\zihao{-2}\bfseries},
 	titleformat = {\zihao{-2}\bfseries},
-	beforeskip = {20bp}, afterskip = {18bp}
+	beforeskip = {0bp}, afterskip = {18bp}
 ]{chapter}
 \CTEXsetup[
 	format = {\zihao{-3}\bfseries},
-	beforeskip = {-20bp plus -1ex minus -0.2ex},
+	beforeskip = {20bp plus 1ex minus 0.2ex},
 	afterskip = {6bp plus 0.2ex}
 ]{section}
 \CTEXsetup[
 	format = {\zihao{4}\bfseries},
-	beforeskip = {-12bp plus -1ex minus -0.2ex},
+	beforeskip = {12bp plus 1ex minus 0.2ex},
 	afterskip = {6bp plus 0.2ex}
 ]{subsection}
 \CTEXsetup[
 	format = {\bfseries},
-	beforeskip = {-12bp plus -1ex minus -0.2ex},
+	beforeskip = {12bp plus 1ex minus 0.2ex},
 	afterskip = {6bp plus 0.2ex}
 ]{subsubsection}
 
@@ -167,44 +203,16 @@
 	\pkuthss@int@setpagestyle
 \fi
 
-% eg. `\pkuthss@int@infoitema{ctitle}' will expand to:
-%   \def\ctitle#1{\def\@ctitle{#1}}
-%   \define@key{pkuthss@info}{ctitle}{\ctitle{#1}}
-\def\pkuthss@int@infoitema#1{
-	\@namedef{#1}##1{\@namedef{@#1}{##1}}
-	\define@key{pkuthss@info}{#1}{\@nameuse{#1}{##1}}
-}
-% eg. `\pkuthss@int@infoitemb{cuniversity}' will expand to:
-%   \define@key{pkuthss@info}{cuniversity}{\def\cuniversity{#1}}
-\def\pkuthss@int@infoitemb#1{
-	\define@key{pkuthss@info}{#1}{\@namedef{#1}{##1}}
+% This places a bookmark pointing to somewhere near the page header;
+% Result of simple `\chapter{...} \pdfbookmark{...}' does not look nice,
+% because the bookmark will point to somewhere below the chapter mark.
+\def\pkuthss@int@pdfmark#1#2{%
+	\if@openright\cleardoublepage\else\clearpage\fi
+	\pdfbookmark[1]{#1}{#2}%
 }
-% Set up document information entries.
-\pkuthss@int@infoitema{ctitle}
-\pkuthss@int@infoitema{etitle}
-\pkuthss@int@infoitema{cauthor}
-\pkuthss@int@infoitema{eauthor}
-\pkuthss@int@infoitema{studentid}
-\pkuthss@int@infoitema{date}
-\pkuthss@int@infoitema{school}
-\pkuthss@int@infoitema{cmajor}
-\pkuthss@int@infoitema{emajor}
-\pkuthss@int@infoitema{direction}
-\pkuthss@int@infoitema{cmentor}
-\pkuthss@int@infoitema{ementor}
-\pkuthss@int@infoitema{ckeywords}
-\pkuthss@int@infoitema{ekeywords}
-\pkuthss@int@infoitemb{cuniversity}
-\pkuthss@int@infoitemb{euniversity}
-\pkuthss@int@infoitemb{cthesisname}
-\pkuthss@int@infoitemb{ethesisname}
-\pkuthss@int@infoitemb{cabstractname}
-\pkuthss@int@infoitemb{eabstractname}
-% Set up document information using the `key = value' grammar.
-\newcommand*{\pkuthssinfo}[1]{\setkeys{pkuthss@info}{#1}}
 
 % Usage: \pkuthss@int@fillinblank{(number of lines)}{(line width)}{(contents)}
-\def\pkuthss@int@fillinblank#1#2#3{
+\def\pkuthss@int@fillinblank#1#2#3{%
 	\makebox[0pt][l]{\parbox[t]{#2}{\centering{#3}}}\mbox{}%
 	\parbox[t]{#2}{%
 		\newcount\pkuthss@tmp@linecount
@@ -222,71 +230,68 @@
 		\repeat%
 	}%
 }
-% Set format of the title page (cover).
-\renewcommand{\maketitle}{
-	\cleardoublepage
-	% Add PDF bookmark for the title page.
-	\pdfbookmark[1]{\titlepagename}{titlepage}
+
+% Set up format of the title page (cover).
+\renewcommand{\maketitle}{%
+	\pkuthss@int@pdfmark{\titlepagename}{titlepage}
 	\begin{titlepage}
 		% It will be nicer to use this line skip level in the title page.
 		\linespread{1.6}\selectfont
 		% Make the title page centered.
 		\begin{center}
 			% Emblem and inscription of the university, and type of thesis.
-			{
+			{%
 				\zihao{1}%
 				\includegraphics[height = 2.4em]{pkulogo}\hspace{0.4em}%
 				\raisebox{0.4em}{\includegraphics[height = 1.6em]{pkuword}}\\[0.8em]
-				{\bfseries{\cthesisname}}
+				{\bfseries{\cthesisname}}%
 			}
 			\vfill
 			% Title of the thesis.
-			{
+			{%
 				\zihao{2}{\label@ctitle}%
-				\pkuthss@int@fillinblank{2}{0.64\textwidth}{\textbf{\@ctitle}}
+				\pkuthss@int@fillinblank{2}{0.64\textwidth}{\textbf{\@ctitle}}%
 			}
 			\vfill
 			% Information about the author.
-			{
+			{%
 				% Slightly adjust the line skip when using new font size.
 				\zihao{3}\linespread{1.75}\selectfont
 				\def\pkuthss@tmp@len{0.56\textwidth}
 				\begin{tabular}{l@{\extracolsep{0.2em}}c}
-					{\heiti\label@cauthor}		&
+					{\bfseries\label@cauthor}		&
 					\pkuthss@int@fillinblank{1}{\pkuthss@tmp@len}{\fangsong\@cauthor}		\\
-					{\heiti\label@studentid}	&
+					{\bfseries\label@studentid}	&
 					\pkuthss@int@fillinblank{1}{\pkuthss@tmp@len}{\fangsong\@studentid}	\\
-					{\heiti\label@school}			&
+					{\bfseries\label@school}		&
 					\pkuthss@int@fillinblank{1}{\pkuthss@tmp@len}{\fangsong\@school}		\\
-					{\heiti\label@cmajor}			&
+					{\bfseries\label@cmajor}		&
 					\pkuthss@int@fillinblank{1}{\pkuthss@tmp@len}{\fangsong\@cmajor}		\\
-					{\heiti\label@direction}	&
+					{\bfseries\label@direction}	&
 					\pkuthss@int@fillinblank{1}{\pkuthss@tmp@len}{\fangsong\@direction}	\\
-					{\heiti\label@cmentor}		&
+					{\bfseries\label@cmentor}		&
 					\pkuthss@int@fillinblank{1}{\pkuthss@tmp@len}{\fangsong\@cmentor}		\\
-				\end{tabular}
+				\end{tabular}%
 			}
 			\vfill
 			% Date.
 			{\zihao{-2}\@date}
 		\end{center}
-	\end{titlepage}
+	\end{titlepage}%
 }
 
 % Typeset the Chinese abstract.
-\newenvironment{cabstract}{
-	\cleardoublepage
-	\pdfbookmark[1]{\cabstractname}{cabstract}
+\newenvironment{cabstract}{%
+	\pkuthss@int@pdfmark{\cabstractname}{cabstract}
 	\chapter*{\cabstractname}
-	\markboth{\cabstractname}{}
+	\markboth{\cabstractname}{}%
 }{% Keywords at the bottom of the page.
-	\vfill\noindent\textbf{\label@ckeywords}{\@ckeywords}
+	\vfill\noindent\textbf{\label@ckeywords}{\@ckeywords}%
 }
 
 % Typeset the English abstract.
-\newenvironment{eabstract}{
-	\cleardoublepage
-	\pdfbookmark[1]{\eabstractname}{eabstract}
+\newenvironment{eabstract}{%
+	\pkuthss@int@pdfmark{\eabstractname}{eabstract}
 	\chapter*{\sffamily\@etitle}
 	\markboth{\eabstractname}{}
 	\begin{center}
@@ -294,9 +299,9 @@
 		{\label@ementor}{\@ementor}\\[2em]
 		\textbf{\sffamily\eabstractname}
 	\end{center}
-	\par
+	\par%
 }{% Keywords at the bottom of the page.
-	\vfill\noindent\textbf{\label@ekeywords}{\@ekeywords}
+	\vfill\noindent\textbf{\label@ekeywords}{\@ekeywords}%
 }
 
 \endinput
-- 
cgit v1.2.3

