XJTU Bachelor XeLaTeX package

Posted on 2009-06-17 20:43  wanderxjtu  阅读(367)  评论(0编辑  收藏  举报
%% XJTU Bachelor thesis LaTeX package
%% Origenal written by saga@bmy
%% Modified by wander@bmy
%% Add `\usepackage{xjtupaper}' in your paper
%% and use XeTeX to compile your paper.

\ProvidesPackage{xjtupaper}
%\usepackage[top=1in, bottom=1in, left=1.5in, right=1in, twoside]{geometry}
\usepackage[top=3cm, bottom=2.5cm, left=2.5cm, right=2.5cm,
    headsep=1.2cm,footskip=0.75cm,
    twoside,a4paper]{geometry}
%\renewcommand {\baselinestretch}{1.2}

\usepackage{graphicx,indentfirst,cite,paralist,tabularx}

\setlength{\parindent}{2em}
\setlength{\parskip}{0pt}

\usepackage{fontspec}
%中英混排
\usepackage{zhspacing}
\newfontfamily\zhfont[BoldFont=SimHei]{SimSun}
%\setromanfont{Times LT Std}
%\newfontfamily\zhfont[BoldFont=STHeiti]{STZhongsong}
\setromanfont{Times New Roman MT Std}
\zhspacing
\newcommand {\xiaoer}{\fontsize{18pt}{27pt}\selectfont}
\newcommand {\sanhao}{\fontsize{16pt}{24pt}\selectfont}
\newcommand {\xiaosan}{\fontsize{15pt}{22.5pt}\selectfont}
\newcommand {\sihao}{\fontsize{14pt}{21pt}\selectfont}
\newcommand {\xiaosi}{\fontsize{12pt}{18pt}\selectfont}
\newcommand {\wuhao}{\fontsize{10.5pt}{15.75pt}\selectfont}
\newcommand {\xiaowu}{\fontsize{9pt}{13.5pt}\selectfont}

%摘要格式
\newcommand {\zhabstract}{\section*{\rm 摘\quad 要}\sectionmark{摘\quad 要}}
\newcommand {\zhkeywords}{~\\\hspace{-2em}\wuhao\textbf{关键字:}}

\newcommand {\enabstract}{\section*{ABSTRACT}\sectionmark{ABSTRACT}}
\newcommand {\enkeywords}{\wuhao\textbf{KEY WORDS: }}

\usepackage[raggedleft]{titlesec}    %标题格式
%\titleformat {\section}{\centering\sanhao\bf}{第\thesection 章}{1em}{}
\titleformat {\section}{\center\sanhao\bf}{\thesection}{1em}{}
\titleformat {\subsection}{\sihao\bf}{\thesubsection}{1em}{}
\titleformat {\subsubsection}{\xiaosi\bf}{\thesubsubsection}{1em}{}

\titlespacing {\section}{}{3ex}{*4}
\titlespacing {\subsection}{}{*2}{*1}
\titlespacing {\subsubsection}{1em}{*1}{0}

\usepackage{titletoc}    %目录格式
\titlecontents{section}[0em]{\rm\vspace{0.3\baselineskip}}{\rm\thecontentslabel\quad}{}{\titlerule*[0.6pc]{$\cdot$}\rm\contentspage}
\titlecontents{subsection}[0.5em]{\rm}{\rm\thecontentslabel\quad}{}{\titlerule*[0.6pc]{$\cdot$}\rm\contentspage}
\titlecontents{subsubsection}[1em]{\rm}{\rm\thecontentslabel\quad}{}{\titlerule*[0.6pc]{$\cdot$}\rm\contentspage}

\renewcommand {\contentsname}{目\quad 录}
\renewcommand {\appendixtocname}{附\quad 录}
\renewcommand {\appendixpagename}{附\quad 录}
\renewcommand {\refname}{参考文献}

\renewcommand {\figurename}{\wuhao 图}
\renewcommand {\thefigure}{\arabic{section}-\arabic{figure}}

\renewcommand {\tablename}{\wuhao 表}
\renewcommand {\thetable}{\arabic{section}-\arabic{table}}

\usepackage{booktabs}
\renewcommand {\heavyrulewidth}{2.25pt}    %表格外线宽
\renewcommand {\lightrulewidth}{1pt}    %表格内线宽

\usepackage{fancyhdr}    %页眉页脚
\pagestyle{fancy}
%\renewcommand{\sectionmark}[1]{\markboth{第\thesection 章\quad #1}{}}
\renewcommand{\sectionmark}[1]{\markboth{#1}{}}
\fancyhf{}

\makeatletter %双线页眉
\def\headrule{{\if@fancyplain\let\headrulewidth\plainheadrulewidth\fi%
    \hrule\@height 1.0pt \@width\headwidth\vskip1.0pt%
          \hrule\@height 1.0pt\@width\headwidth%
           \vskip-2\headrulewidth\vskip-1pt}}%\vspace{1cm}}
    \makeatother
\setlength{\headheight}{15pt}

\fancyhead[EC]{\xiaowu 西安交通大学本科生毕业设计(论文)}
\fancyhead[OC]{\xiaowu \leftmark}
\fancyfoot[EL,OR]{\xiaowu\thepage} %奇数页页码在右下脚

\usepackage{fancyvrb}    %代码加框
\DefineVerbatimEnvironment{verbatim}{Verbatim} {frame=single, baselinestretch=1, xleftmargin=5pt, xrightmargin=5pt}

\newcommand{\ucite}[1]{$^{\mbox{\scriptsize \cite{#1}}}$}    %参考文献上标
    %Define a new command \ucite to generate upper-script (i.e., superscript) cite.
    % It is only for paragraph mode. By PENG Zhaowang on July 15, 1999
    % Note: the command \cite generates in-text citation, not superscript one.

Copyright © 2024 wanderxjtu
Powered by .NET 8.0 on Kubernetes