yaht-cn.pdf (一篇中文的xetex设置的文章,非常不错,值得看看) 虽然cjk能够支持中文,但是貌似现在不是很流行,而且还要自己做字体,于是转战到xetex
主要参考一下几篇文章
如果需要输入箭头一类的特殊符号,需要安装包
sudo apt-get install texlive-fonts-extra
lyx+xetex的安装配置(手工操作步骤是对的,但脚本是错误的)
latex的常用中文问题配置用latex写漂亮的论文一个完整的模板我修改过的lyx 模板,感觉不错,能够正常使用
- % define the title
-
\usepackage{graphicx}
-
\usepackage{array}
-
\usepackage{amsmath}
-
%\usepackage{natbib}
-
\usepackage{xeCJK}
-
\usepackage{titlesec} %设置标题
-
\usepackage{titletoc}
-
\usepackage[dvipdfm,
-
pdfstartview=FitH,
-
CJKbookmarks=true,
-
bookmarksnumbered=true,
-
bookmarksopen=true,
-
colorlinks, %注释掉此项则交叉引用为彩色边框(将colorlinks和pdfborder同时注释掉)
-
pdfborder=001, %注释掉此项则交叉引用为彩色边框
-
linkcolor=blue,
-
anchorcolor=blue,
-
citecolor=blue
-
]{hyperref}
-
-
% xetex设置
-
-
\setmainfont[BoldFont=SimHei,ItalicFont=KaiTi_GB2312]{SimSun}
-
\setsansfont[BoldFont=SimHei]{KaiTi_GB2312}
-
\setmonofont{NSimSun}
-
\XeTeXlinebreaklocale "zh"
-
\XeTeXlinebreakskip = 0pt plus 1pt
-
-
%===================== 重定义字体、字号命令 =====================%
-
\newcommand{\song}{\CJKfamily{song}} % 宋体 (Windows自带simsun.ttf)
-
\newcommand{\fs}{\CJKfamily{fs}} % 仿宋体 (Windows自带simfs.ttf)
-
\newcommand{\kai}{\CJKfamily{kai}} % 楷体 (Windows自带simkai.ttf)
-
\newcommand{\hei}{\CJKfamily{hei}} % 黑体 (Windows自带simhei.ttf)
-
\newcommand{\li}{\CJKfamily{li}} % 隶书 (Windows自带simli.ttf)
-
\newcommand{\you}{\CJKfamily{you}} % 幼圆 (Windows自带simyou.ttf)
-
%
-
\newcommand{\chaoda}{\fontsize{55pt}{\baselineskip}\selectfont}
-
\newcommand{\chuhao}{\fontsize{42pt}{\baselineskip}\selectfont} % 字号设置
-
\newcommand{\xiaochuhao}{\fontsize{36pt}{\baselineskip}\selectfont} % 字号设置
-
\newcommand{\yihao}{\fontsize{28pt}{\baselineskip}\selectfont} % 字号设置
-
\newcommand{\erhao}{\fontsize{21pt}{\baselineskip}\selectfont} % 字号设置
-
\newcommand{\xiaoerhao}{\fontsize{18pt}{\baselineskip}\selectfont} % 字号设置
-
\newcommand{\sanhao}{\fontsize{15.75pt}{\baselineskip}\selectfont} % 字号设置
-
\newcommand{\xiaosanhao}{\fontsize{15pt}{\baselineskip}\selectfont} % 字号设置
-
\newcommand{\sihao}{\fontsize{14pt}{\baselineskip}\selectfont} % 字号设置
-
\newcommand{\xiaosihao}{\fontsize{12pt}{14pt}\selectfont} % 字号设置
-
\newcommand{\wuhao}{\fontsize{10.5pt}{12.6pt}\selectfont} % 字号设置
-
\newcommand{\xiaowuhao}{\fontsize{9pt}{11pt}{\baselineskip}\selectfont} % 字号设置
-
\newcommand{\liuhao}{\fontsize{7.875pt}{\baselineskip}\selectfont} % 字号设置
-
\newcommand{\qihao}{\fontsize{5.25pt}{\baselineskip}\selectfont} % 字号设置
-
-
%=============================================================================%
-
\renewcommand\listfigurename{图 目 录}
-
\renewcommand\listtablename{表 目 录}
-
-
\renewcommand\figurename{图}
-
\renewcommand\tablename{表}
-
\renewcommand{\bibname}{参考文献}
-
-
%设置页面大小
-
\usepackage[top=1in,bottom=1in,left=1.25in,right=1.25in]{geometry}
-
-
%设置首行缩进
-
\usepackage{indentfirst}
-
\setlength{\parindent}{2em}
-
\setlength{\baselineskip}{1.8em}
-
\setlength{\parskip}{1ex}
-
-
\usepackage{fancyhdr}
-
% 设置 plain style 的属性
-
\fancypagestyle{plain}{%
-
\fancyhf{} % 清空当前设置
-
-
% 设置页眉 (head)
-
\fancyhead[RE]{\leftmark} % 在偶数页的右侧显示章名
-
\fancyhead[LO]{\rightmark} % 在奇数页的左侧显示小节名
-
\fancyhead[LE,RO]{~\thepage~} % 在偶数页的左侧,奇数页的右侧显示页码
-
% 设置页脚:在每页的右下脚以斜体显示书名
-
\fancyfoot[RO,RE]{\it 高效编辑利器-VIM}
-
-
\renewcommand{\headrulewidth}{0.7pt} % 页眉与正文之间的水平线粗细
-
\renewcommand{\footrulewidth}{0pt}
-
}
-
-
\pagestyle{fancy} % 选用 fancy style
-
% 其余同 plain style
-
\fancyhf{}
-
\fancyhead[RE]{\leftmark}
-
\fancyhead[LO]{\rightmark}
-
\fancyhead[LE,RO]{~\thepage~}
-
\fancyfoot[RO,RE]{\it 高效编辑利器-VIM}
-
\renewcommand{\headrulewidth}{0.7pt}
-
\renewcommand{\footrulewidth}{0pt}
-
-
-
%设置章节标题
-
%\renewcommand{\chaptername}{第\CJKnumber{\thechapter}章}
-
%设置目录
-
\renewcommand{\contentsname}{目\quad 录}
-
\titleformat{\chapter}[hang]
-
% {\normalfont\bfseries\huge\filcenter\CJKfamily{hei}}
-
{\normalfont\bfseries\yihao\filcenter\CJKfamily{hei}}
-
%{\huge{\chaptertitlename}}
-
%{第~\CJKnumber{\thechapter}~章}
-
{第~{\thechapter}~章}
-
{1em}{\yihao}
-
\titlespacing{\chapter}{0pt}{*0}{*4}
-
\titleformat{\section}[hang]{\bfseries}% add \bfseries if you want to use bold fonts
-
{\sihao 第~{\thesection}~节}{1em}{\sihao}
-
\titlespacing{\section}%
-
{0pt}{1.5ex plus .1ex minus .2ex}{\wordsep}%{1ex plus .1ex minus .2ex}
-
\titlecontents{chapter}
-
[3mm]
-
{\addvspace{.1pc}}%
-
{ 第\,\thecontentslabel\,章 \enspace}%
-
{}
-
{\titlerule*{$\cdots$}\contentspage}
-
\titlecontents{section}
-
[10mm]
-
{\vspace{.2\baselineskip}}
-
{第\thecontentslabel 节\enspace}
-
{}
-
{\titlerule*{$\cdots$}\contentspage}
-
\titlecontents{subsection}
-
[16mm]
-
{\addvspace{.1pc}}%
-
{ \thecontentslabel \enspace}%
-
{}
-
{\titlerule*{$\cdots$}\contentspage}
-
%====================定义图,公式标编号等格式=============
-
\numberwithin{figure}{section} \numberwithin{table}{section}
-
\numberwithin{equation}{section}
-
-
\renewcommand{\theequation}{\thesection.\arabic{equation}}
-
\renewcommand{\thefigure}{\arabic{section}-\arabic{figure}}
-
\renewcommand{\thetable}{\arabic{section}-\arabic{table}}
-
%==========================================================
- %默认lyx不能正确处理引号,会报错,解决办法
- \let\textquotedbl="
-
%==================================================================
-
%==================================================================
-
%==================================================================
-
%==================================================================
-
%==================================================================
-
%==================================================================
阅读(2432) | 评论(0) | 转发(0) |