diff options
author | Karl Berry <karl@freefriends.org> | 2009-03-03 00:55:52 +0000 |
---|---|---|
committer | Karl Berry <karl@freefriends.org> | 2009-03-03 00:55:52 +0000 |
commit | 2046a35855fc1cccdd896f31e355067d0a439362 (patch) | |
tree | 3452a55d72eb94e9b395ed48f5836bc5db4396bb /Master/texmf-dist/tex/latex/thuthesis/thuthesis.cls | |
parent | 5f64b37bca0d72846da5567ee6f03dc574df261d (diff) |
thuthesis update (2mar09)
git-svn-id: svn://tug.org/texlive/trunk@12293 c570f23f-e606-0410-a88d-b1316a301751
Diffstat (limited to 'Master/texmf-dist/tex/latex/thuthesis/thuthesis.cls')
-rw-r--r-- | Master/texmf-dist/tex/latex/thuthesis/thuthesis.cls | 522 |
1 files changed, 271 insertions, 251 deletions
diff --git a/Master/texmf-dist/tex/latex/thuthesis/thuthesis.cls b/Master/texmf-dist/tex/latex/thuthesis/thuthesis.cls index f5bf295232f..e64755b4337 100644 --- a/Master/texmf-dist/tex/latex/thuthesis/thuthesis.cls +++ b/Master/texmf-dist/tex/latex/thuthesis/thuthesis.cls @@ -8,7 +8,7 @@ %% %% This is a generated file. %% -%% Copyright (C) 2005-2008 by Xue Ruini <xueruini@gmail.com> +%% Copyright (C) 2005-2009 by Ruini Xue <xueruini@gmail.com> %% %% This file may be distributed and/or modified under the %% conditions of the LaTeX Project Public License, either version 1.3a @@ -23,12 +23,17 @@ %% To produce the documentation run the original source files ending with `.dtx' %% through LaTeX. %% + \NeedsTeXFormat{LaTeX2e}[1999/12/01] \ProvidesClass{thuthesis} -[2007/11/08 4.0 Tsinghua University Thesis Template] +[2008/02/28 4.5.1 Tsinghua University Thesis Template] +\newif\ifthu@UTF +\newif\ifthu@GBK +\DeclareOption{utf}{\thu@UTFtrue\thu@GBKfalse} +\DeclareOption{gbk}{\thu@GBKtrue\thu@UTFfalse} \hyphenation{Thu-Thesis} \def\thuthesis{\textsc{ThuThesis}} -\def\version{4.0} +\def\version{4.5} \newif\ifthu@bachelor\thu@bachelorfalse \newif\ifthu@master\thu@masterfalse \newif\ifthu@doctor\thu@doctorfalse @@ -37,30 +42,14 @@ \DeclareOption{master}{\thu@mastertrue} \DeclareOption{doctor}{\thu@doctortrue} \DeclareOption{secret}{\thu@secrettrue} -\AtEndOfClass{% - \ifthu@bachelor\relax\else - \ifthu@master\relax\else - \ifthu@doctor\relax\else - \ClassError{thuthesis}% - {You have to specify one of thesis options: bachelor, master or doctor.}{} - \fi - \fi - \fi} \newif\ifthu@dvips \newif\ifthu@dvipdfm +\newif\ifthu@xetex +\newif\ifthu@pdftex \DeclareOption{dvips}{\thu@dvipstrue} \DeclareOption{dvipdfm}{\thu@dvipdfmtrue} -\AtEndOfClass{% - \ifpdf - \ifthu@dvips - \ClassError{thuthesis}% - {Please remove `dvips' if you run pdflatex.}{} - \fi - \ifthu@dvipdfm - \ClassError{thuthesis}% - {Please remove `dvipdfm' if you run pdflatex.}{} - \fi - \fi} +\DeclareOption{pdftex}{\thu@pdftextrue} +\DeclareOption{xetex}{\thu@xetextrue} \newif\ifthu@arial \DeclareOption{arial}{\thu@arialtrue} \newif\ifthu@arialtoc @@ -68,33 +57,79 @@ \newif\ifthu@arialtitle \DeclareOption{arialtitle}{\thu@arialtitletrue} \DeclareOption*{\PassOptionsToClass{\CurrentOption}{book}} -\ExecuteOptions{arialtitle} -\ProcessOptions -\ifthu@bachelor - %\thu@arialtoctrue % hard code - \LoadClass[12pt, a4paper, openright]{book} -\else - \LoadClass[12pt, a4paper, openany]{book} +\ExecuteOptions{utf,arialtitle} +\ProcessOptions\relax +\LoadClass[12pt,a4paper,openany]{book} +\ifthu@bachelor\relax\else + \ifthu@master\relax\else + \ifthu@doctor\relax\else + \ClassError{thuthesis}% + {You have to specify one of thesis options: bachelor, master or doctor.}{} + \fi + \fi \fi -\RequirePackage{ifthen} -\RequirePackage{calc} -\RequirePackage{ifpdf} -\RequirePackage{amsmath, amssymb} +\RequirePackage{ifpdf,ifxetex} +\ifthu@xetex\RequireXeTeX\fi +\def\RequirePDFTeX{% + \ifpdf\else + \ClassError{thuthesis}% + {pdflatex is required to compile this document!}{} + \fi} +\ifthu@pdftex\RequirePDFTeX\fi +\def\thu@checkoption#1#2{% + \@for\reserved@a:=#2\do{% + \csname ifthu@\reserved@a\endcsname + \ClassError{thuthesis}% + {Please remove `\reserved@a' option when you run #1.}{} + \fi}} +\ifpdf\thu@checkoption{pdflatex}{dvips,dvipdfm,xetex}\thu@pdftextrue\fi % force the option to be true +\ifxetex\thu@checkoption{xelatex}{dvips,dvipdfm,pdftex}\thu@xetextrue\fi +\RequirePackage{ifthen,calc} +\RequirePackage{amsmath,amssymb} \RequirePackage{txfonts} -\ifthu@arial - \IfFileExists{arial.sty}{\RequirePackage{arial}}% - {\ClassWarning{thuthesis}{no arial.sty availiable!}} -\fi \RequirePackage{graphicx} \RequirePackage[config]{subfig} \RequirePackage{indentfirst} \RequirePackage[neverdecrease]{paralist} -\RequirePackage{CJK, CJKnumb} -\RequirePackage{CJKpunct} -\ifpdf % We're not running pdftex - \RequirePackage{ccmap} % Óà pdflatex ±àÒë +\ifthu@xetex + \RequirePackage{xunicode,xltxtra} + \RequirePackage[CJKnumber,CJKtextspaces,CJKmathspaces]{xeCJK} + \punctstyle{kaiming} + % todo: minor fix of CJKnumb + \def\CJK@null{\kern\CJKnullspace\Unicode{48}{7}\kern\CJKnullspace} + \defaultfontfeatures{Mapping=tex-text} % after fontspec + \setCJKmainfont[BoldFont={Adobe Heiti Std}, ItalicFont={Adobe Kaiti Std}]{Adobe Song Std} + \setCJKsansfont{Adobe Heiti Std} + \setCJKmonofont{Adobe Kaiti Std} + \setCJKfamilyfont{song}{Adobe Song Std} + \setCJKfamilyfont{hei}{Adobe Heiti Std} + \setCJKfamilyfont{fs}{Adobe Fangsong Std} + \setCJKfamilyfont{kai}{Adobe Kaiti Std} + \setCJKfamilyfont{li}{Adobe Kaiti Std} % todo: 用隶书å—体代替 + \setCJKfamilyfont{you}{Adobe Kaiti Std} % todo: 用幼圆å—体代替 + + \setmainfont{Times New Roman} + \setsansfont{Arial} + \setmonofont{Courier New} \else - % \RequirePackage{cmap} + \RequirePackage{CJKutf8} + \RequirePackage{CJKnumb} + \ifthu@GBK % CJKpunct 在 UTF 下工作的ä¸å¥½ã€‚ + \IfFileExists{CJKpunct.sty}% + {\RequirePackage{CJKpunct}}% + {\ClassWarning{thuthesis}{no CJKpunct.sty availiable!}} + \fi + \RequirePackage{CJKspace} + \ifthu@arial + \IfFileExists{arial.sty}% + {\RequirePackage{arial}}% + {\ClassWarning{thuthesis}{no arial.sty availiable!}} + \fi +\fi +\ifthu@dvips\else + \ifthu@xetex\else + \RequirePackage{ccmap} + \fi \fi \RequirePackage[amsmath,thmmarks,hyperref]{ntheorem} \RequirePackage{array} @@ -102,9 +137,15 @@ \RequirePackage{booktabs} \RequirePackage[numbers,super,sort&compress]{natbib} \RequirePackage{hyperref} +\ifxetex + \hypersetup{% + CJKbookmarks=true} +\else + \hypersetup{% + unicode=true, + CJKbookmarks=false} +\fi \hypersetup{% - unicode=true, - CJKbookmarks=true, bookmarksnumbered=true, bookmarksopen=true, bookmarksopenlevel=1, @@ -113,6 +154,9 @@ plainpages=false, pdfpagelabels, pdfborder=0 0 0} +\ifthu@dvips + \RequirePackage{breakurl} +\fi \urlstyle{same} \RequirePackage{hypernat} \renewcommand\frontmatter{% @@ -124,22 +168,21 @@ \if@openright\cleardoublepage\else\clearpage\fi \@mainmattertrue \pagenumbering{arabic} - \pagestyle{thu@headings}} + \ifthu@bachelor\pagestyle{thu@plain}\else\pagestyle{thu@headings}\fi} \renewcommand\backmatter{% \if@openright\cleardoublepage\else\clearpage\fi - %\@mainmatterfalse - \ifthu@bachelor\pagenumbering{Roman}\fi} -\newcommand{\song}{\CJKfamily{song}} % ËÎÌå + \@mainmattertrue} +\newcommand{\song}{\CJKfamily{song}} % 宋体 \def\songti{\song} -\newcommand{\fs}{\CJKfamily{fs}} % ·ÂËÎÌå +\newcommand{\fs}{\CJKfamily{fs}} % 仿宋体 \def\fangsong{\fs} -\newcommand{\kai}{\CJKfamily{kai}} % ¿¬Ìå +\newcommand{\kai}{\CJKfamily{kai}} % 楷体 \def\kaishu{\kai} -\newcommand{\hei}{\CJKfamily{hei}} % ºÚÌå +\newcommand{\hei}{\CJKfamily{hei}} % 黑体 \def\heiti{\hei} -\newcommand{\li}{\CJKfamily{li}} % Á¥Êé +\newcommand{\li}{\CJKfamily{li}} % 隶书 \def\lishu{\li} -\newcommand{\you}{\CJKfamily{you}} % Ó×Ô² +\newcommand{\you}{\CJKfamily{you}} % 幼圆 \def\youyuan{\you} \newlength\thu@linespace \newcommand{\thu@choosefont}[2]{% @@ -221,11 +264,21 @@ \vskip2pt\hbox{\vrule width\textwidth height0.4pt depth0pt}}} \def\@oddfoot{\hfil\wuhao\thepage\hfil} \let\@evenfoot=\@oddfoot} -\renewcommand{\chaptermark}[1]{\@mkboth{\@chapapp\ ~~#1}{}} -\newlength\CJKtwospaces +\renewcommand{\chaptermark}[1]{\@mkboth{\@chapapp\ ~~#1}{}} +\newlength\CJK@twochars +\ifxetex + \def\CJK@spaceChar{\Unicode{48}{7}} +\else + \ifthu@UTF + \def\CJK@spaceChar{\CJKchar{"080}{"080}} + \fi + \ifthu@GBK + \def\CJK@spaceChar{\CJKchar{"0A1}{"0A1}} + \fi +\fi \def\CJKindent{% - \settowidth\CJKtwospaces{\CJKchar{"0A1}{"0A1}\CJKchar{"0A1}{"0A1}}% - \parindent\CJKtwospaces} + \settowidth\CJK@twochars{\CJK@spaceChar\CJK@spaceChar}% + \parindent\CJK@twochars} \setlength{\parskip}{0pt \@plus2pt \@minus0pt} \def\thu@item@space{% \let\itemize\compactitem @@ -276,28 +329,19 @@ #1 \par\egroup} \allowdisplaybreaks[4] +\renewcommand\theequation{\ifnum \c@chapter>\z@ \thechapter-\fi\@arabic\c@equation} \def\make@df@tag{\@ifstar\thu@make@df@tag@@\make@df@tag@@@} -\def\thu@make@df@tag@@#1{% - \gdef\df@tag{\thu@maketag{#1}\def\@currentlabel{#1}}} - % redefinitation of tagform broken eqref! -\renewcommand{\eqref}[1]{\textup{\ref{#1}}} +\def\thu@make@df@tag@@#1{\gdef\df@tag{\thu@maketag{#1}\def\@currentlabel{#1}}} +\renewcommand{\eqref}[1]{\textup{(\ref{#1})}} \renewcommand\theequation{\ifnum \c@chapter>\z@ \thechapter-\fi\@arabic\c@equation} -\ifthu@bachelor - \def\thu@maketag#1{\maketag@@@{% - (\ignorespaces\text{\equationname\hskip0.5em}#1\unskip\@@italiccorr)}} - \def\tagform@#1{\maketag@@@{% - (\ignorespaces\text{\equationname\hskip0.5em}#1\unskip\@@italiccorr)\equcaption{#1}}} -\else - \def\thu@maketag#1{\maketag@@@{(\ignorespaces #1\unskip\@@italiccorr)}} - \def\tagform@#1{\maketag@@@{% - (\ignorespaces #1\unskip\@@italiccorr)\equcaption{#1}}} -\fi +\def\thu@maketag#1{\maketag@@@{(\ignorespaces #1\unskip\@@italiccorr)}} +\def\tagform@#1{\maketag@@@{(\ignorespaces #1\unskip\@@italiccorr)\equcaption{#1}}} \gdef\@endtrivlist#1{% % from \endtrivlist \if@inlabel \indent\fi \if@newlist \@noitemerr\fi \ifhmode - \ifdim\lastskip >\z@ #1\unskip \par %<<<<<<<<<<<<<<<<<<<<<< - \else #1\unskip \par \fi + \ifdim\lastskip >\z@ #1\unskip \par %<<<<<<<<<<<<<<<<<<<<<< + \else #1\unskip \par \fi \fi \if@noparlist \else \ifdim\lastskip >\z@ @@ -309,11 +353,6 @@ \fi #1} \theorembodyfont{\song\rmfamily} \theoremheaderfont{\hei\rmfamily} - % \theoremsymbol{\ensuremath{\blacksquare}} -\theoremsymbol{\ensuremath{\square}} -\theoremstyle{nonumberplain} -\theoremstyle{plain} -\theoremsymbol{} \setlength{\floatsep}{12bp \@plus4pt \@minus1pt} \setlength{\intextsep}{12bp \@plus4pt \@minus2pt} \setlength{\textfloatsep}{12bp \@plus4pt \@minus2pt} @@ -330,19 +369,11 @@ \DeclareCaptionLabelSeparator{thu}{\hspace{1em}} \DeclareCaptionFont{thu}{\dawu[1.5]} \captionsetup{labelformat=thu,labelsep=thu,font=thu} -\captionsetup[table]{position=top,belowskip={12bp-\intextsep},aboveskip=3bp} -\captionsetup[figure]{position=bottom,belowskip={12bp-\intextsep},aboveskip=-2bp} -\captionsetup[subfloat]{font=thu,captionskip=6bp,nearskip=6bp,farskip=0bp,topadjust=0bp} - %\renewcommand{\thesubfigure}{\thefigure--(\arabic{subfigure})} - % \renewcommand{\p@subfigure}{:} -\def\LT@c@ption#1[#2]#3{% change code from longtable.sty - \LT@makecaption#1\fnum@table{#3}% - \def\@tempa{#2}% - \ifx\@tempa\@empty\else - {\let\\\space - \addcontentsline{\csname ext@table\endcsname}{table}% - {\protect\numberline{\tablename\hskip0.5em\thetable}{#2}}}% - \fi} +\captionsetup[table]{position=top,belowskip={12bp-\intextsep},aboveskip=6bp} +\captionsetup[figure]{position=bottom,belowskip={12bp-\intextsep},aboveskip=6bp} +\captionsetup[subfloat]{labelformat=simple,font=thu,captionskip=6bp,nearskip=6bp,farskip=0bp,topadjust=0bp} +\renewcommand{\thesubfigure}{(\alph{subfigure})} +\renewcommand{\thesubtable}{(\alph{subtable})} \let\thu@LT@array\LT@array \def\LT@array{\dawu[1.5]\thu@LT@array} % set default font size \def\hlinewd#1{% @@ -394,6 +425,7 @@ \interlinepenalty\@M #1\par\nobreak \vskip 24bp}} +\newcounter{thu@bookmark} \def\thu@chapter*{% \@ifnextchar [ % ] {\thu@@chapter} @@ -409,7 +441,8 @@ \def\@tmpa{#1} \def\@tmpb{#3} \ifx\@tmpa\@empty - \pdfbookmark[0]{#2}{\expandafter\@gobble\string#2} + \addtocounter{thu@bookmark}\@ne + \pdfbookmark[0]{#2}{thuchapter.\thethu@bookmark} \else \addcontentsline{toc}{chapter}{#1} \fi @@ -420,15 +453,15 @@ \@mkboth{#3}{#3} \fi} \renewcommand\section{\@startsection {section}{1}{\z@}% - {-24bp \@plus -1ex \@minus -.2ex}% + {\ifthu@bachelor -20bp\else -24bp\fi\@plus -1ex \@minus -.2ex}% {6bp \@plus .2ex}% {\hei\csname thu@title@font\endcsname\sihao[1.429]}} \renewcommand\subsection{\@startsection{subsection}{2}{\z@}% - {-16bp \@plus -1ex \@minus -.2ex}% + {\ifthu@bachelor -12bp\else -16bp\fi\@plus -1ex \@minus -.2ex}% {6bp \@plus .2ex}% - {\hei\csname thu@title@font\endcsname\banxiaosi[1.538]}} + {\hei\csname thu@title@font\endcsname\ifthu@bachelor\xiaosi[1.667]\else\banxiaosi[1.538]\fi}} \renewcommand\subsubsection{\@startsection{subsubsection}{3}{\z@}% - {-16bp \@plus -1ex \@minus -.2ex}% + {\ifthu@bachelor -12bp\else -16bp\fi\@plus -1ex \@minus -.2ex}% {6bp \@plus .2ex}% {\hei\csname thu@title@font\endcsname\xiaosi[1.667]}} \setcounter{secnumdepth}{3} @@ -439,13 +472,13 @@ \fi \renewcommand\tableofcontents{% \thu@chapter*[]{\contentsname} - \ifthu@bachelor\wuhao[1.8]\else\xiaosi[1.5]\fi\@starttoc{toc}\normalsize} + \ifthu@bachelor\xiaosi[1.8]\else\xiaosi[1.5]\fi\@starttoc{toc}\normalsize} \ifthu@arialtoc \def\thu@toc@font{\sffamily} \fi -\def\@pnumwidth{2em} % Õâ¸ö²ÎÊýûÓÃÁË +\def\@pnumwidth{2em} % 这个å‚数没用了 \def\@tocrmarg{2em} -\def\@dotsep{1} % Ŀ¼µã¼äµÄ¾àÀë +\def\@dotsep{1} % 目录点间的è·ç¦» \def\@dottedtocline#1#2#3#4#5{% \ifnum #1>\c@tocdepth \else \vskip \z@ \@plus.2\p@ @@ -471,15 +504,15 @@ \leavevmode \advance\leftskip\@tempdima \hskip -\leftskip - {\hei\csname thu@toc@font\endcsname #1} % numberline is called here, and it use @tempdima + {\hei\ifthu@bachelor\sffamily\else\csname thu@toc@font\endcsname\fi #1} % numberline is called here, and it uses \@tempdima \leaders\hbox{$\m@th\mkern \@dotsep mu\hbox{.}\mkern \@dotsep mu$}\hfill \nobreak{\normalfont\normalcolor #2}\par \penalty\@highpenalty \endgroup \fi} -\renewcommand*\l@section{\@dottedtocline{1}{1.2em}{2.1em}} -\renewcommand*\l@subsection{\@dottedtocline{2}{2em}{3em}} -\renewcommand*\l@subsubsection{\@dottedtocline{3}{3.5em}{3.8em}} +\renewcommand*\l@section{\@dottedtocline{1}{\ifthu@bachelor 1.0em\else 1.2em\fi}{2.1em}} +\renewcommand*\l@subsection{\@dottedtocline{2}{\ifthu@bachelor 1.6em\else 2em\fi}{3em}} +\renewcommand*\l@subsubsection{\@dottedtocline{3}{\ifthu@bachelor 2.4em\else 3.5em\fi}{3.8em}} \def\thu@define@term#1{ \expandafter\gdef\csname #1\endcsname##1{% \expandafter\gdef\csname thu@#1\endcsname{##1}} @@ -489,11 +522,11 @@ \thu@define@term{ctitle} \thu@define@term{cdegree} \newcommand\cdepartment[2][]{\def\thu@cdepartment@short{#1}\def\thu@cdepartment{#2}} -\def\caffil{\cdepartment} % for compatibility +\def\caffil{\cdepartment} % todo: for compatibility \def\thu@cdepartment@short{} \def\thu@cdepartment{} \thu@define@term{cmajor} -\def\csubject{\cmajor} % for compatibility +\def\csubject{\cmajor} % todo: for compatibility \thu@define@term{cauthor} \thu@define@term{csupervisor} \thu@define@term{cassosupervisor} @@ -544,15 +577,18 @@ \par\vskip1.2cm {\ziju{18bp}\xiaochu\hei\thu@bachelor@subtitle} \vskip2.5cm - \hspace*{-0.3cm}\noindent\hei\xiaoer\thu@bachelor@title@pre\thu@title@sep + \noindent\hei\xiaoer\thu@bachelor@title@pre\thu@title@sep \parbox[t]{12cm}{% - \begin{picture}(0,0)(0,0) - \setlength\unitlength{1cm} - \linethickness{1.3pt} - \put(0,-0.25){\line(1,0){12}} - \put(0,-1.68){\line(1,0){12}} - \end{picture}% - \ignorespaces\yihao[1.55]\thu@ctitle} %TODO: CJKulem.sty + \setbox0=\hbox{{\yihao[1.55]\thu@ctitle}} + \begin{picture}(0,0)(0,0) + \setlength\unitlength{1cm} + \linethickness{1.3pt} + \put(0,-0.25){\line(1,0){12}} + \ifdim\wd0>12cm + \put(0,-1.68){\line(1,0){12}} + \fi + \end{picture}% + \ignorespaces\yihao[1.55]\thu@ctitle} %TODO: CJKulem.sty \vskip1.55cm \else \parbox[t][9cm][t]{\paperwidth-8cm}{ @@ -567,39 +603,51 @@ \xiaoer[1] \textrm{{\ziju{2bp}\thu@apply}} \end{center}} \fi - \parbox[t][7.8cm][t]{\textwidth}{{\sanhao[1.5] - \begin{center}\fs - \ifthu@bachelor + \ifthu@bachelor + \vskip1cm + \parbox[t][7.0cm][t]{\textwidth}{{\sanhao[1.8] + \hspace*{1.65cm}\fs \setlength{\thu@title@width}{4em} \setlength{\extrarowheight}{6pt} - \begin{tabular}{p{\thu@title@width}@{}l@{\extracolsep{4pt}}l} - \thu@put@title{\thu@bachelor@departmenttitle} & \thu@title@sep & \thu@cdepartment\\ - \thu@put@title{\thu@bachelor@majortitle} & \thu@title@sep & \thu@cmajor\\ - \thu@put@title{\thu@bachelor@authortitle} & \thu@title@sep & \thu@cauthor \\ - \thu@put@title{\thu@csupervisortitle} & \thu@title@sep & \thu@csupervisor\\ - \ifx\thu@cassosupervisor\@empty\else - \thu@put@title{\thu@cassosupertitle} & \thu@title@sep & \thu@cassosupervisor\\ - \fi - \end{tabular} - \else + \ifxetex % todo: ugly codes + \begin{tabular}{p{\thu@title@width}@{}l@{\extracolsep{8pt}}l} + \else + \begin{tabular}{p{\thu@title@width}l@{}l} + \fi + \thu@put@title{\thu@bachelor@departmenttitle} & \thu@title@sep & \thu@cdepartment\\ + \thu@put@title{\thu@bachelor@majortitle} & \thu@title@sep & \thu@cmajor\\ + \thu@put@title{\thu@bachelor@authortitle} & \thu@title@sep & \thu@cauthor \\ + \thu@put@title{\thu@csupervisortitle} & \thu@title@sep & \thu@csupervisor\\ + \ifx\thu@cassosupervisor\@empty\else + \thu@put@title{\thu@cassosupertitle} & \thu@title@sep & \thu@cassosupervisor\\ + \fi + \end{tabular} + }} + \else + \parbox[t][7.8cm][t]{\textwidth}{{\sanhao[1.5] + \begin{center}\fs \setlength{\thu@title@width}{6em} \setlength{\extrarowheight}{4pt} - \begin{tabular}{p{\thu@title@width}c@{\extracolsep{4pt}}l} - \thu@put@title{\thu@cdepartmenttitle} & \thu@title@sep & {\ziju{3bp}\thu@cdepartment}\\ - \thu@put@title{\thu@cmajortitle} & \thu@title@sep & {\ziju{3bp}\thu@cmajor}\\ - \thu@put@title{\thu@cauthortitle} & \thu@title@sep & {\ziju{11bp}\thu@cauthor}\\ - \thu@put@title{\thu@csupervisortitle} & \thu@title@sep & {\ziju{11bp}\thu@csupervisor}\\ - \ifx\thu@cassosupervisor\@empty\else - \thu@put@title{\thu@cassosupertitle} & \thu@title@sep & {\ziju{11bp}\thu@cassosupervisor}\\ - \fi - \ifx\thu@ccosupervisor\@empty\else - \thu@put@title{\thu@ccosupertitle} & \thu@title@sep & {\ziju{11bp}\thu@ccosupervisor}\\ - \fi - \end{tabular} - \fi - \end{center}}} + \ifxetex % todo: ugly codes + \begin{tabular}{p{\thu@title@width}@{}c@{\extracolsep{8pt}}l} + \else + \begin{tabular}{p{\thu@title@width}c@{\extracolsep{4pt}}l} + \fi + \thu@put@title{\thu@cdepartmenttitle} & \thu@title@sep & {\ziju{3bp}\thu@cdepartment}\\ + \thu@put@title{\thu@cmajortitle} & \thu@title@sep & {\ziju{3bp}\thu@cmajor}\\ + \thu@put@title{\thu@cauthortitle} & \thu@title@sep & {\ziju{11bp}\thu@cauthor}\\ + \thu@put@title{\thu@csupervisortitle} & \thu@title@sep & {\ziju{11bp}\thu@csupervisor}\\ + \ifx\thu@cassosupervisor\@empty\else + \thu@put@title{\thu@cassosupertitle} & \thu@title@sep & {\ziju{11bp}\thu@cassosupervisor}\\ + \fi + \ifx\thu@ccosupervisor\@empty\else + \thu@put@title{\thu@ccosupertitle} & \thu@title@sep & {\ziju{11bp}\thu@ccosupervisor}\\ + \fi + \end{tabular} + \end{center}}} + \fi \begin{center} - {\ifthu@bachelor\xiaosi\else\sanhao\fi \song \thu@cdate} + {\ifthu@bachelor\hskip-0.9cm\xiaosi\else\sanhao\fi \song \thu@cdate} \end{center} \end{center}} % end of titlepage \newcommand{\thu@doctor@engcover}{% @@ -632,6 +680,8 @@ Dissertation Supervisor : & \thu@esupervisor\\ \ifx\thu@eassosupervisor\@empty \else Associate Supervisor : & \thu@eassosupervisor\\\fi + \ifx\thu@ecosupervisor\@empty + \else Cooperate Supervisor : & \thu@ecosupervisor\\\fi \end{tabular}} \parbox[t][2cm][b]{\paperwidth-7.2cm}{ \begin{center} @@ -645,9 +695,9 @@ \ifthu@bachelor\vskip\baselineskip\else\vskip18pt\sihao[2.03]\fi\par \thu@authorization\par \textbf{\thu@authorizationaddon}\par - \ifthu@bachelor\vskip2.54cm\else\vskip1.9cm\fi + \ifthu@bachelor\vskip1.0cm\else\vskip1.9cm\fi \ifthu@bachelor - \noindent\thu@authorsig\thu@underline\relax% + \ifthu@bachelor\indent\else\noindent\fi\thu@authorsig\thu@underline\relax% \thu@teachersig\thu@underline\relax\thu@frontdate\thu@underline\relax \else \begingroup @@ -663,15 +713,15 @@ \pdfbookmark[-1]{\thu@ctitle}{ctitle} \normalsize% \begin{titlepage} -\thu@first@titlepage -\ifthu@doctor - \cleardoublepage\thu@doctor@engcover -\fi -\cleardoublepage\thu@authorization@mk - \end{titlepage} -\normalsize -\thu@makeabstract -\let\@tabular\thu@tabular} + \thu@first@titlepage + \ifthu@doctor + \cleardoublepage\thu@doctor@engcover + \fi + \cleardoublepage\thu@authorization@mk + \end{titlepage} + \normalsize + \thu@makeabstract + \let\@tabular\thu@tabular} \newcommand{\thu@makeabstract}{% \cleardoublepage % always openright for Abstract \thu@chapter*[]{\cabstractname} % no tocline @@ -683,27 +733,29 @@ \pagenumbering{Roman} \thu@cabstract \vskip12bp - \setbox0=\hbox{{\hei \thu@ckeywords@title}} - \noindent\hangindent\wd0\hangafter1\box0\thu@ckeywords + \setbox0=\hbox{{\hei\thu@ckeywords@title}} + \ifthu@bachelor\indent\else\noindent\hangindent\wd0\hangafter1\fi + \box0\thu@ckeywords \thu@chapter*[]{\eabstractname} % no tocline \thu@eabstract \vskip12bp \setbox0=\hbox{\textbf{Key words:\enskip}} - \noindent\hangindent\wd0\hangafter1\box0\thu@ekeywords} + \ifthu@bachelor\indent\else\noindent\hangindent\wd0\hangafter1\fi + \box0\thu@ekeywords} \newenvironment{denotation}[1][2.5cm]{ \thu@chapter*[]{\thu@denotation@name} % no tocline \noindent\begin{list}{}% {\vskip-30bp\xiaosi[1.6] \renewcommand\makelabel[1]{##1\hfil} - \setlength{\labelwidth}{#1} % ±êÇ©ºÐ×Ó¿í¶È - \setlength{\labelsep}{0.5cm} % ±êÇ©ÓëÁбíÎı¾¾àÀë - \setlength{\itemindent}{0cm} % ±êÇ©Ëõ½øÁ¿ - \setlength{\leftmargin}{\labelwidth+\labelsep} % ×ó±ß½ç + \setlength{\labelwidth}{#1} % æ ‡ç¾ç›’å宽度 + \setlength{\labelsep}{0.5cm} % æ ‡ç¾ä¸Žåˆ—表文本è·ç¦» + \setlength{\itemindent}{0cm} % æ ‡ç¾ç¼©è¿›é‡ + \setlength{\leftmargin}{\labelwidth+\labelsep} % 左边界 \setlength{\rightmargin}{0cm} - \setlength{\parsep}{0cm} % ¶ÎÂä¼ä¾à - \setlength{\itemsep}{0cm} % ±êÇ©¼ä¾à - \setlength{\listparindent}{0cm} % ¶ÎÂäËõ½øÁ¿ - \setlength{\topsep}{0pt} % ±êÇ©ÓëÉÏÎĵļä¾à + \setlength{\parsep}{0cm} % 段è½é—´è· + \setlength{\itemsep}{0cm} % æ ‡ç¾é—´è· + \setlength{\listparindent}{0cm} % 段è½ç¼©è¿›é‡ + \setlength{\topsep}{0pt} % æ ‡ç¾ä¸Žä¸Šæ–‡çš„é—´è· }}{\end{list}} \newenvironment{ack}{% \ifthu@bachelor @@ -731,41 +783,29 @@ {\xiaosi\hfill\thu@signature\thu@underline[2.5cm]\relax% \thu@backdate\thu@underline[2.5cm]\relax}% } -\long\def\@caption#1[#2]#3{% - \par - \addcontentsline{\csname ext@#1\endcsname}{#1}% - {\protect\numberline{\csname #1name\endcsname\hskip0.5em\csname the#1\endcsname}% - {\ignorespaces #2}}% - \begingroup - \@parboxrestore - \if@minipage - \@setminipage - \fi - \normalsize - \@makecaption{\csname fnum@#1\endcsname}{\ignorespaces #3}\par - \endgroup} -\def\thu@listof#1#2{% +\def\thu@starttoc#1{% #1: float type, prepend type name in \listof*** entry. + \let\oldnumberline\numberline + \def\numberline##1{\oldnumberline{\csname #1name\endcsname\hskip.4em ##1}} + \@starttoc{\csname ext@#1\endcsname} + \let\numberline\oldnumberline} +\def\thu@listof#1{% #1: float type \@ifstar - {\thu@chapter*[]{#1}\@starttoc{#2}} - {\thu@chapter*{#1}\@starttoc{#2}}} -\renewcommand\listoffigures{\thu@listof{\listfigurename}{\ext@figure}} + {\thu@chapter*[]{\csname list#1name\endcsname}\thu@starttoc{#1}} + {\thu@chapter*{\csname list#1name\endcsname}\thu@starttoc{#1}}} +\renewcommand\listoffigures{\thu@listof{figure}} \renewcommand*\l@figure{\@dottedtocline{1}{0em}{4em}} -\renewcommand\listoftables{\thu@listof{\listtablename}{\ext@table}} +\renewcommand\listoftables{\thu@listof{table}} \let\l@table\l@figure \def\ext@equation{loe} \def\equcaption#1{% \addcontentsline{\ext@equation}{equation}% - {\protect\numberline{\equationname\hskip0.5em #1}}} -\newcommand\listofequations{\thu@listof{\listequationname}{\ext@equation}} -\ifthu@bachelor - \newcommand*\l@equation{\@dottedtocline{1}{0em}{4em}} -\else - \newcommand*\l@equation{\@dottedtocline{1}{0em}{4.2em}} -\fi + {\protect\numberline{#1}}} +\newcommand\listofequations{\thu@listof{equation}} +\let\l@equation\l@figure \bibpunct{[}{]}{,}{s}{}{,} -\renewcommand\NAT@citesuper[3]{\ifNAT@swa -\unskip\kern\p@\textsuperscript{\NAT@@open #1\NAT@@close}% - \if*#3*\else\ (#3)\fi\else #1\fi\endgroup} +\renewcommand\NAT@citesuper[3]{\ifNAT@swa% + \unskip\kern\p@\textsuperscript{\NAT@@open #1\NAT@@close}% + \if*#3*\else\ (#3)\fi\else #1\fi\endgroup} \DeclareRobustCommand\onlinecite{\@onlinecite} \def\@onlinecite#1{\begingroup\let\@cite\NAT@citenum\citep{#1}\endgroup} \def\thudot{\ifthu@bachelor\else\unskip.\fi} @@ -777,14 +817,14 @@ \list{\@biblabel{\@arabic\c@enumiv}}% {\renewcommand{\makelabel}[1]{##1\hfill} \settowidth\labelwidth{1.1cm} - \setlength{\labelsep}{0.6em} + \setlength{\labelsep}{0.4em} \setlength{\itemindent}{0pt} \setlength{\leftmargin}{\labelwidth+\labelsep} \addtolength{\itemsep}{-0.7em} \usecounter{enumiv}% \let\p@enumiv\@empty \renewcommand\theenumiv{\@arabic\c@enumiv}}% - \sloppy + \sloppy\frenchspacing \clubpenalty4000 \@clubpenalty \clubpenalty \widowpenalty4000% @@ -792,7 +832,7 @@ \sfcode`\.\@m} {\def\@noitemerr {\@latex@warning{Empty `thebibliography' environment}}% - \endlist} + \endlist\frenchspacing} \let\thu@appendix\appendix \renewenvironment{appendix}{% \thu@appendix @@ -802,80 +842,57 @@ \newenvironment{resume}{% % \cleardoublepage \thu@chapter*{\thu@resume@title}}{} -\newcommand{\resumeitem}[1]{\vspace{2.5em}{\sihao \hei \centerline{#1}}\par} -\newcommand{\thu@verticle}{% - \renewcommand{\CJKsymbol}[1]{% - \setbox0=\hbox{\symbol{##1}}% - \newcommand{\POS}{}% - \ifthenelse{\lengthtest{\ht0<.39\wd0}}% - {\renewcommand{\POS}{c}}{\renewcommand{\POS}{r}}% - \makebox[1.3\wd0][\POS]{\rotatebox[origin=lB]{90}{\symbol{##1}}}% - \ifCJK@bold@% - \hbox to \CJKboldshift{\hss\makebox[1.3\wd0][\POS]{% - \rotatebox[origin=lB]{90}{\symbol{##1}}}}% - \hbox to \CJKboldshift{\hss\makebox[1.3\wd0][\POS]{% - \rotatebox[origin=lB]{90}{\symbol{##1}}}}% - \fi}} -\newsavebox{\thu@saverotate}% -\newcommand{\shupai}[2][\textheight]{% - \savebox{\thu@saverotate}{\parbox[t]{#1}{\thu@verticle #2}} - \hfill\rotatebox[origin=lt]{-90}{\usebox{\thu@saverotate}}} +\newcommand{\resumeitem}[1]{\vspace{2.5em}{\sihao\hei\centerline{#1}}\par} \newcommand{\shuji}[1][\thu@ctitle]{ - \newpage% - \thispagestyle{empty} - \vspace*{1cm} - \shupai[\textheight-2cm]{\fs\xiaosan #1\hfill\thu@cauthor}} + \newpage\thispagestyle{empty}\ziju{0.4em}\fs\xiaosan + \hfill\rotatebox{-90}{\hb@xt@ \textheight{#1\hfill\thu@cauthor}}} \iffalse \newcommand{\bs}{\symbol{'134}}%Print backslash - % \newcommand{\bs}{\ensuremath{\mathtt{\backslash}}}%Print backslash - % Index entry for a command (\cih for hidden command index \newcommand{\cih}[1]{% -\index{commands!#1@\texttt{\bs#1}}% -\index{#1@\texttt{\hspace*{-1.2ex}\bs #1}} -} + \index{commands!#1@\texttt{\bs#1}}% + \index{#1@\texttt{\hspace*{-1.2ex}\bs #1}}} \newcommand{\ci}[1]{\cih{#1}\texttt{\bs#1}} - % Package \newcommand{\pai}[1]{% -\index{packages!#1@\textsf{#1}}% -\index{#1@\textsf{#1}}% -\textsf{#1}} - % Index entry for an environment + \index{packages!#1@\textsf{#1}}% + \index{#1@\textsf{#1}}% + \textsf{#1}} \newcommand{\ei}[1]{% -\index{environments!\texttt{#1}}% -\index{#1@\texttt{#1}}% -\texttt{#1}} - % Indexentry for a word (Word inserted into the text) + \index{environments!\texttt{#1}}% + \index{#1@\texttt{#1}}% + \texttt{#1}} \newcommand{\wi}[1]{\index{#1}#1} \fi \newcommand*{\ziju}[1]{\renewcommand{\CJKglue}{\hskip #1}} \newcommand{\pozhehao}{\kern0.3ex\rule[0.8ex]{2em}{0.1ex}\kern0.3ex} \def\thu@active@cjk{ % Activate all >128 characters. - \count@=127 - \@whilenum\count@<255 \do{% + \count@=128 + \@whilenum\count@<254 \do{% \advance\count@ by 1 \lccode`\~=\count@ \catcode\count@=\active \lowercase{\def~{\kern1ex}}}} -\AtEndOfClass{\thu@active@cjk\input{thuthesis.cfg}}% +\AtEndOfClass{\ifxetex\else\thu@active@cjk\fi\input{thuthesis.cfg}} \def\thu@fixselectfont{% - \DeclareRobustCommand{\selectfont}{% + \ifx\@EverySelectfont@EveryHook\@undefined\else% everysel package is loaded + \DeclareRobustCommand{\selectfont}{% \ifx\f@linespread\baselinestretch \else \set@fontsize\baselinestretch\f@size\f@baselineskip \fi \xdef\font@name{% \csname\curr@fontshape/\f@size\endcsname}% \pickup@font \font@name - % CJK addition: + % CJK addition: \CJK@bold@false \csname \curr@fontshape\endcsname - % everysel addition: + % everysel addition: \@EverySelectfont@EveryHook \@EverySelectfont@AtNextHook \gdef\@EverySelectfont@AtNextHook{}% - % end additions + % end additions \size@update - \enc@update}} + \enc@update} + \fi} \def\thu@setup@pdfinfo{% \hypersetup{% pdftitle={\thu@ctitle}, @@ -884,18 +901,21 @@ pdfkeywords={\thu@ckeywords}, pdfcreator={\thu@cauthor}, pdfproducer={\thuthesis}}} -\def\thu@beginCJK{% - \thu@fixselectfont% - \begin{CJK*}{GBK}{song}% - \sloppy\CJKindent\CJKtilde} -\def\thu@endCJK{\clearpage\end{CJK*}} -\let\thu@begindocumenthook\@begindocumenthook -\let\thu@enddocumenthook\@enddocumenthook -\def\AtBeginDocument{\g@addto@macro\thu@begindocumenthook} -\def\AtEndDocument{\g@addto@macro\thu@enddocumenthook} -\def\@begindocumenthook{\thu@begindocumenthook\thu@beginCJK} -\def\@enddocumenthook{\thu@endCJK\thu@enddocumenthook} -\AtBeginDocument{\thu@setup@pdfinfo\thu@item@space} +\ifxetex + \AtBeginDocument{\CJKindent} +\else + \def\thu@beginCJK{% + \thu@fixselectfont% + \begin{CJK*}{UTF8}{song}\CJKindent} + \def\thu@endCJK{\clearpage\end{CJK*}} + \let\thu@begindocumenthook\@begindocumenthook + \let\thu@enddocumenthook\@enddocumenthook + \def\AtBeginDocument{\g@addto@macro\thu@begindocumenthook} + \def\AtEndDocument{\g@addto@macro\thu@enddocumenthook} + \def\@begindocumenthook{\thu@begindocumenthook\thu@beginCJK} + \def\@enddocumenthook{\thu@endCJK\thu@enddocumenthook} +\fi +\AtEndOfClass{\sloppy\thu@item@space} \endinput %% %% End of file `thuthesis.cls'. |