summaryrefslogtreecommitdiff
path: root/Master/texmf-dist/tex/latex/pkuthss/pkuthss-extra.sty
diff options
context:
space:
mode:
authorKarl Berry <karl@freefriends.org>2015-04-29 21:18:58 +0000
committerKarl Berry <karl@freefriends.org>2015-04-29 21:18:58 +0000
commit29740d0452a743ccdc3345b0cf600c1a99424d8d (patch)
tree89dddbed44d5ad21b8bff7b855330751ba285d94 /Master/texmf-dist/tex/latex/pkuthss/pkuthss-extra.sty
parent7a2fe1d9507a254c7a80626380fc6af3449b5fee (diff)
pkuthss (28apr15)
git-svn-id: svn://tug.org/texlive/trunk@37123 c570f23f-e606-0410-a88d-b1316a301751
Diffstat (limited to 'Master/texmf-dist/tex/latex/pkuthss/pkuthss-extra.sty')
-rw-r--r--Master/texmf-dist/tex/latex/pkuthss/pkuthss-extra.sty106
1 files changed, 73 insertions, 33 deletions
diff --git a/Master/texmf-dist/tex/latex/pkuthss/pkuthss-extra.sty b/Master/texmf-dist/tex/latex/pkuthss/pkuthss-extra.sty
index 203978fdfb7..570f8c48bb0 100644
--- a/Master/texmf-dist/tex/latex/pkuthss/pkuthss-extra.sty
+++ b/Master/texmf-dist/tex/latex/pkuthss/pkuthss-extra.sty
@@ -3,7 +3,7 @@
% Peking University dissertation document class
%
% Copyright (c) 2008-2009 solvethis
-% Copyright (c) 2010-2013 Casper Ti. Vector
+% Copyright (c) 2010-2015 Casper Ti. Vector
%
% This work may be distributed and/or modified under the conditions of the
% LaTeX Project Public License, either version 1.3 of this license or (at
@@ -26,7 +26,7 @@
\NeedsTeXFormat{LaTeX2e}[1995/12/01]
\ProvidesPackage{pkuthss-extra}
- [2014/07/07 v1.5.5 Common extra settings for the pkuthss document class]
+ [2015/04/28 v1.6.0 Common extra settings for the pkuthss document class]
% Check the dependency of pkuthss.
\@ifclassloaded{pkuthss}{}{
@@ -45,54 +45,82 @@
\DeclareOption{#1}{\@nameuse{pkuthssextra@opt@#1true}}
\DeclareOption{no#1}{\@nameuse{pkuthssextra@opt@#1false}}
}
+% Whethet to modify footnote format.
+\pkuthssextra@int@boolopt{footfmt}{true}
+% Whethet to modify spacing according to school regulation.
+\pkuthssextra@int@boolopt{pkuspace}{true}
% Whethet to use some common settings for adjusting spacing.
\pkuthssextra@int@boolopt{spacing}{true}
-% Whether to use list environments that are tighter than LaTeX defaults.
-\pkuthssextra@int@boolopt{tightlist}{true}
-% Whether to let captions use a different font from the main text.
-\pkuthssextra@int@boolopt{caption}{true}
% Add PDF bookmark for table of contents.
\pkuthssextra@int@boolopt{pdftoc}{true}
% Whether to enable the `\spacialchap' command.
\pkuthssextra@int@boolopt{spechap}{true}
-% Whether to automatically set properties for generated PDF from user defined
-% document information (author, title, etc.).
+% Whether to automatically set up properties for generated PDF from user
+% defined document information (author, title, etc.).
\pkuthssextra@int@boolopt{pdfprop}{true}
% Whether to use coloured hyperlinks in generated PDF.
\pkuthssextra@int@boolopt{colorlinks}{true}
% Process all class options now.
\ProcessOptions\relax
+\ifpkuthssextra@opt@footfmt
+ % Handle the `Unparsed material' issue with latex/dvipdfmx compilation.
+ \unless\ifxetex\unless\ifpdf
+ \newcommand*\pgfsysdriver{pgfsys-dvipdfm.def}
+ \fi\fi
+ % Circled text, cf. <https://tex.stackexchange.com/questions/7032/>.
+ \RequirePackage{tikz}
+ \newcommand*\pkuthssextra@int@circled[1]{%
+ \scalebox{0.8}{\tikz[baseline = (char.base)]{
+ \node[
+ shape = circle, draw = black, minimum size = 1.25em, inner sep = 0pt
+ ] (char) {#1};
+ }}%
+ }
+ % Use circled numbers as footnote symbols. Does not affect title page, but
+ % footnote is rarely used in dissertation covers ;)
+ \renewcommand\thefootnote%
+ {\protect\pkuthssextra@int@circled{\arabic{footnote}}}
+ % Provides utility to modify footnote spacing.
+ % Option used to make sure it does not render interleaf pages totally blank.
+ \RequirePackage[cleardoublepage = current]{scrextend}
+ % Set up footnote spacing: symbol indent 2 ccwd, paragraph indent 3.5 ccwd,
+ % 0.75 ccwd between symbol and paragraph.
+ \deffootnote{2\ccwd}{3.5\ccwd}{\thefootnotemark\hspace{0.75\ccwd}}
+\fi
+
+\ifpkuthssextra@opt@pkuspace
+ % lineskip / baselineskip = 20 bp / (12 bp * (6 / 5)).
+ \linespread{1.39}\selectfont
+ % Quite harmless and frequently used package. Loaded together with `tocloft'
+ % plus a compatibility option to avoid package clash.
+ \RequirePackage{subfig}
+ % Provides utilities for setting TOC format; `titles' applied to avoid
+ % interfering with LaTeX's own title mechanism.
+ \RequirePackage[subfigure, titles]{tocloft}
+ \setlength{\cftbeforechapskip}{6bp plus 1bp}
+ \setlength{\cftsecindent}{\ccwd}
+ \setlength{\cftsubsecindent}{2\ccwd}
+ % Modify font size and separator of captions.
+ \RequirePackage{caption}
+ \DeclareCaptionFont{cfive}{\zihao{5}}
+ \DeclareCaptionLabelSeparator{quad}{\quad}
+ \captionsetup{font = cfive, labelsep = quad}
+\fi
+
\ifpkuthssextra@opt@spacing
- % Automatically ignore spaces between CJK characters and preserve spaces in other
- % situations. XeCJK itself will handle this issue, therefore we do not use
+ % Automatically ignore spaces between CJK characters, or otherwise preserve
+ % spaces. XeCJK itself will handle this issue, therefore we do not use
% `CJKspace' when using XeLaTeX.
\unless\ifxetex\RequirePackage{CJKspace}\fi
% Make spacing nicer in some situations (eg. footnotes and verbatims).
\RequirePackage{setspace}
- % Make the text area centered in the page.
- \geometry{centering}
- % Set line skip.
- \linespread{1.41}\selectfont
- % Automatically insert a space between the label and the text in footnotes.
- \RequirePackage{footmisc}
- \renewcommand*{\footnotelayout}{\ }
-\fi
-
-\ifpkuthssextra@opt@tightlist
- % Lists often appear to be too sparse when items are just one or two lines long.
- % Here we cancel the extra vertical spacing between list items.
- % Biblatex uses `\itemsep' as default `\bibitemsep', no need to change it.
+ % Lists often appear to be too sparse when items are just one or two lines
+ % long. Here we cancel the extra vertical spacing between list items.
\RequirePackage{enumitem}
\setlist{nolistsep}
\fi
-\ifpkuthssextra@opt@caption
- % According to common aesthetics of typography, it is nice to make the font of
- % captions lighter than main text, and tables lighter than captions.
- \RequirePackage[font = it]{caption}
-\fi
-
\ifpkuthssextra@opt@pdftoc
% Add PDF bookmark for table of contents.
\let\pkuthssextra@tmp@tableofcontents\tableofcontents
@@ -108,7 +136,7 @@
\ifpkuthssextra@opt@spechap
% This command is used to start a chapter without numbering, and correctly set
- % the headers and footers in the chapter.
+ % up the headers and footers in the chapter.
\newcommand\specialchap[1]{
\chapter*{#1}\addcontentsline{toc}{chapter}{#1}
\markboth{#1}{}\phantomsection
@@ -116,6 +144,18 @@
\fi
\AtBeginDocument{
+ \ifpkuthssextra@opt@pkuspace
+ % Kludge for `tocloft' used with `ctex'.
+ % <http://bbs.ctex.org/forum.php?mod=redirect&goto=findpost&ptid=43535&pid=310238>.
+ \renewcommand{\numberline}[1]{%
+ \settowidth\@tempdimb{#1\hspace{0.5em}}%
+ \ifdim\@tempdima<\@tempdimb%
+ \@tempdima=\@tempdimb%
+ \fi%
+ \hb@xt@\@tempdima{\@cftbsnum #1\@cftasnum\hfil}\@cftasnumb%
+ }%
+ \fi
+
\ifpkuthssextra@opt@pdfprop
% Automatically generate properties for generated PDF.
% Use English properties to avoid problems with character encodings.
@@ -125,7 +165,7 @@
pdfsubject = {\euniversity\ \ethesisname}, pdfkeywords = {\@ekeywords}
}
}
- % Set the properties when generating the title page because the document
+ % Set up the properties when generating the title page because the document
% information should have been all defined before this.
\let\pkuthssextra@tmp@maketitle\maketitle
% NOTE: `\hypersetup' must appear before `\maketitle', otherwise it might not
@@ -137,8 +177,8 @@
% Use coloured hyperlinks in generated PDF.
\hypersetup{colorlinks = true, allcolors = blue}
\else
- % Set hyperlink colour to black in order to prevent hyperlinks from being too
- % hard-to-recognise in printed thesis.
+ % Set hyperlink colour to black in order to prevent hyperlinks from being
+ % too hard-to-recognise in printed thesis.
\hypersetup{hidelinks}
\fi
}