Chinaunix首页 | 论坛 | 博客
  • 博客访问: 1691867
  • 博文数量: 410
  • 博客积分: 9563
  • 博客等级: 中将
  • 技术积分: 4517
  • 用 户 组: 普通用户
  • 注册时间: 2010-07-03 19:59
个人简介

文章分类

全部博文(410)

文章存档

2017年(6)

2016年(1)

2015年(3)

2014年(4)

2013年(32)

2012年(45)

2011年(179)

2010年(140)

分类: LINUX

2011-04-08 01:07:14

 yaht-cn.pdf (一篇中文的xetex设置的文章,非常不错,值得看看)
 虽然cjk能够支持中文,但是貌似现在不是很流行,而且还要自己做字体,于是转战到xetex
主要参考一下几篇文章
如果需要输入箭头一类的特殊符号,需要安装包
sudo apt-get install texlive-fonts-extra
lyx+xetex的安装配置(手工操作步骤是对的,但脚本是错误的)
latex的常用中文问题配置
用latex写漂亮的论文
一个完整的模板
我修改过的lyx 模板,感觉不错,能够正常使用
  1. % define the title
  2. \usepackage{graphicx}
  3. \usepackage{array}
  4. \usepackage{amsmath}
  5. %\usepackage{natbib}
  6. \usepackage{xeCJK}
  7. \usepackage{titlesec} %设置标题
  8. \usepackage{titletoc}
  9. \usepackage[dvipdfm,
  10. pdfstartview=FitH,
  11. CJKbookmarks=true,
  12. bookmarksnumbered=true,
  13. bookmarksopen=true,
  14. colorlinks, %注释掉此项则交叉引用为彩色边框(将colorlinks和pdfborder同时注释掉)
  15. pdfborder=001, %注释掉此项则交叉引用为彩色边框
  16. linkcolor=blue,
  17. anchorcolor=blue,
  18. citecolor=blue
  19. ]{hyperref}

  20. % xetex设置

  21. \setmainfont[BoldFont=SimHei,ItalicFont=KaiTi_GB2312]{SimSun}
  22. \setsansfont[BoldFont=SimHei]{KaiTi_GB2312}
  23. \setmonofont{NSimSun}
  24. \XeTeXlinebreaklocale "zh"
  25. \XeTeXlinebreakskip = 0pt plus 1pt

  26. %===================== 重定义字体、字号命令 =====================%
  27. \newcommand{\song}{\CJKfamily{song}} % 宋体 (Windows自带simsun.ttf)
  28. \newcommand{\fs}{\CJKfamily{fs}} % 仿宋体 (Windows自带simfs.ttf)
  29. \newcommand{\kai}{\CJKfamily{kai}} % 楷体 (Windows自带simkai.ttf)
  30. \newcommand{\hei}{\CJKfamily{hei}} % 黑体 (Windows自带simhei.ttf)
  31. \newcommand{\li}{\CJKfamily{li}} % 隶书 (Windows自带simli.ttf)
  32. \newcommand{\you}{\CJKfamily{you}} % 幼圆 (Windows自带simyou.ttf)
  33. %
  34. \newcommand{\chaoda}{\fontsize{55pt}{\baselineskip}\selectfont}
  35. \newcommand{\chuhao}{\fontsize{42pt}{\baselineskip}\selectfont} % 字号设置
  36. \newcommand{\xiaochuhao}{\fontsize{36pt}{\baselineskip}\selectfont} % 字号设置
  37. \newcommand{\yihao}{\fontsize{28pt}{\baselineskip}\selectfont} % 字号设置
  38. \newcommand{\erhao}{\fontsize{21pt}{\baselineskip}\selectfont} % 字号设置
  39. \newcommand{\xiaoerhao}{\fontsize{18pt}{\baselineskip}\selectfont} % 字号设置
  40. \newcommand{\sanhao}{\fontsize{15.75pt}{\baselineskip}\selectfont} % 字号设置
  41. \newcommand{\xiaosanhao}{\fontsize{15pt}{\baselineskip}\selectfont} % 字号设置
  42. \newcommand{\sihao}{\fontsize{14pt}{\baselineskip}\selectfont} % 字号设置
  43. \newcommand{\xiaosihao}{\fontsize{12pt}{14pt}\selectfont} % 字号设置
  44. \newcommand{\wuhao}{\fontsize{10.5pt}{12.6pt}\selectfont} % 字号设置
  45. \newcommand{\xiaowuhao}{\fontsize{9pt}{11pt}{\baselineskip}\selectfont} % 字号设置
  46. \newcommand{\liuhao}{\fontsize{7.875pt}{\baselineskip}\selectfont} % 字号设置
  47. \newcommand{\qihao}{\fontsize{5.25pt}{\baselineskip}\selectfont} % 字号设置

  48. %=============================================================================%
  49. \renewcommand\listfigurename{图 目 录}
  50. \renewcommand\listtablename{表 目 录}

  51. \renewcommand\figurename{图}
  52. \renewcommand\tablename{表}
  53. \renewcommand{\bibname}{参考文献}

  54. %设置页面大小
  55. \usepackage[top=1in,bottom=1in,left=1.25in,right=1.25in]{geometry}

  56. %设置首行缩进
  57. \usepackage{indentfirst}
  58. \setlength{\parindent}{2em}
  59. \setlength{\baselineskip}{1.8em}
  60. \setlength{\parskip}{1ex}

  61. \usepackage{fancyhdr}
  62. % 设置 plain style 的属性
  63. \fancypagestyle{plain}{%
  64. \fancyhf{} % 清空当前设置

  65. % 设置页眉 (head)
  66. \fancyhead[RE]{\leftmark} % 在偶数页的右侧显示章名
  67. \fancyhead[LO]{\rightmark} % 在奇数页的左侧显示小节名
  68. \fancyhead[LE,RO]{~\thepage~} % 在偶数页的左侧,奇数页的右侧显示页码
  69. % 设置页脚:在每页的右下脚以斜体显示书名
  70. \fancyfoot[RO,RE]{\it 高效编辑利器-VIM}

  71. \renewcommand{\headrulewidth}{0.7pt} % 页眉与正文之间的水平线粗细
  72. \renewcommand{\footrulewidth}{0pt}
  73. }

  74. \pagestyle{fancy} % 选用 fancy style
  75. % 其余同 plain style
  76. \fancyhf{}
  77. \fancyhead[RE]{\leftmark}
  78. \fancyhead[LO]{\rightmark}
  79. \fancyhead[LE,RO]{~\thepage~}
  80. \fancyfoot[RO,RE]{\it 高效编辑利器-VIM}
  81. \renewcommand{\headrulewidth}{0.7pt}
  82. \renewcommand{\footrulewidth}{0pt}


  83. %设置章节标题
  84. %\renewcommand{\chaptername}{第\CJKnumber{\thechapter}章}
  85. %设置目录
  86. \renewcommand{\contentsname}{目\quad 录}
  87. \titleformat{\chapter}[hang]
  88. % {\normalfont\bfseries\huge\filcenter\CJKfamily{hei}}
  89. {\normalfont\bfseries\yihao\filcenter\CJKfamily{hei}}
  90. %{\huge{\chaptertitlename}}
  91. %{第~\CJKnumber{\thechapter}~章}
  92. {第~{\thechapter}~章}
  93. {1em}{\yihao}
  94. \titlespacing{\chapter}{0pt}{*0}{*4}
  95. \titleformat{\section}[hang]{\bfseries}% add \bfseries if you want to use bold fonts
  96. {\sihao 第~{\thesection}~节}{1em}{\sihao}
  97. \titlespacing{\section}%
  98. {0pt}{1.5ex plus .1ex minus .2ex}{\wordsep}%{1ex plus .1ex minus .2ex}
  99. \titlecontents{chapter}
  100. [3mm]
  101. {\addvspace{.1pc}}%
  102. { 第\,\thecontentslabel\,章 \enspace}%
  103. {}
  104. {\titlerule*{$\cdots$}\contentspage}
  105. \titlecontents{section}
  106. [10mm]
  107. {\vspace{.2\baselineskip}}
  108. {第\thecontentslabel 节\enspace}
  109. {}
  110. {\titlerule*{$\cdots$}\contentspage}
  111. \titlecontents{subsection}
  112. [16mm]
  113. {\addvspace{.1pc}}%
  114. { \thecontentslabel \enspace}%
  115. {}
  116. {\titlerule*{$\cdots$}\contentspage}
  117. %====================定义图,公式标编号等格式=============
  118. \numberwithin{figure}{section} \numberwithin{table}{section}
  119. \numberwithin{equation}{section}

  120. \renewcommand{\theequation}{\thesection.\arabic{equation}}
  121. \renewcommand{\thefigure}{\arabic{section}-\arabic{figure}}
  122. \renewcommand{\thetable}{\arabic{section}-\arabic{table}}
  123. %==========================================================
  124. %默认lyx不能正确处理引号,会报错,解决办法
  125. \let\textquotedbl="
  126. %==================================================================
  127. %==================================================================
  128. %==================================================================
  129. %==================================================================
  130. %==================================================================
  131. %==================================================================

阅读(2352) | 评论(0) | 转发(0) |
给主人留下些什么吧!~~