博客首页 注册 建议与交流 排行榜 加入友情链接
推荐 投诉 搜索: 帮助

愚者的再聚





  远行的人,走了三天,要停下来休息一天,以等待自己灵魂的归来...

Aeonlove Exheamns  
ocs.cublog.cn


XeTeX 的一个实例
%# -*- coding: utf-8 -*-
\documentclass{book}
\usepackage{fontspec,xunicode,ifthen,indentfirst}
\usepackage[colorlinks,bookmarksopen,pdfstartview=FitH]{hyperref}
\usepackage{fancyhdr}
\usepackage{titlesec, titletoc}
\usepackage{moresize}
 
\begin{document}
\setmainfont[Ligatures={Common, Rare}, Mapping=tex-text, BoldFont=Adobe Heiti Std]{Adobe Song Std}
%% Adobe Reader 8.0 的中文包里包含了这两个中文字体
 
%\def ~{\hspace {0.25em plus 0.125em minus 0.08em}\ignorespaces}
\def\CJKnumber #1{\ifcase #1 \or\or\or\or\or\or\or\or\or\fi}
 
\newcommand{\prechaptername}{}
\newcommand{\postchaptername}{}
\newcommand{\chapterformat}{\prechaptername\CJKnumber{\thechapter}\postchaptername}
\renewcommand{\contentsname}{\quad}
 
\titleformat{\chapter}[display]
{\normalfont\huge\bfseries}{\chapterformat}{20pt}{\Huge}
\titlecontents{chapter}[0em]{\addvspace{1.5ex}\bfseries}
    {\prechaptername\CJKnumber{\thecontentslabel}\postchaptername\quad}{\hspace*{-2.3em}}
    {\hfill{}\contentspage}[\addvspace{0.5ex}]
   
\fancyhead{}
\fancyhead[RO,LE]{\bfseries\chapterformat}
\fancyhead[LO,RE]{\bfseries\thetitle}
\fancyfoot[C]{\thepage}
%      E       偶数页
%      O       奇数页
%      L       页眉或页脚的左边部分
%      C       页眉或页脚的中间部分
%      R       页眉或页脚的右边部分
%      H       页眉
%      F       页脚
 
\newcommand\thetitle{Of Blood And Honor}
\newcommand\theauthor{Chris Metzen}
 
\setlength{\parindent}{2em}
 
%%** End of globle configuration **%%
 
\pagestyle{empty}
%The valid options are:
%    * plain - Just a plain page number.
%    * empty - Produces empty heads and feet - no page numbers.
%    * headings - Puts running headings on each page. The document style specifies what goes in the headings.
%    * myheadings - You specify what is to go in the heading with the \markboth or the \markright commands.
 
\begin{titlepage}
\fontspec[Ligatures={Common, Rare}, Mapping=tex-text]{Zapfino} %% Mac OSX Font: Zapfino.dfont
\centering
\HUGE\thetitle\\
\large\theauthor
\end{titlepage}
 
\frontmatter
\pagestyle{headings}\tableofcontents
 
\XeTeXlinebreaklocale "zh"
\XeTeXlinebreakskip = 0pt plus 1pt
 
\mainmatter\pagestyle{fancy}
 
\input{ch1}
 
\end{document}

 原文地址 http://blog.csdn.net/Tigatron/archive/2007/01/21/1488931.aspx
发表于: 2008-05-01 ,修改于: 2008-05-01 12:15,已浏览1199次,有评论0条 推荐 投诉


网友评论

发表评论