主机平台:Gentoo 11.2内核版本:Linux Kernel 3.2.1即将面临毕业,要写毕业论文,由于自己一直使用Linux,而Linux下的Office软件兼容性实在是达不到论文的要求,以前也听说过Linux下的强大的排版工具--LaTeX。这样就不会出现换台电脑格式就会发生改变,然后忙着修改论文格式的窘境。下面安装环境,看网络上好多都是使用texlive镜像安装,我看了一下,那镜像2个多G,好大。而且通过CJK解决中文问题(现在还不是很了解)。下面是安装XeLaTeX的步骤在Gentoo下直接emerge即可Gentoo下Xetex和默认安装的texlive-core是互相block的,最终方式是选择安装texlive-xetex模块emerge texlive-xetex -av自动解决依赖问题。XeLaTeX可以直接解决字体的问题,直接使用系统的字体,不用像LaTeX手动生成字体。下面是sheriden2006的中文宏包的一个配置文件(字体得自己安装,可以从网上下载,也可以直接在win下copy)
- % xetex/xelatex 字体设定宏包
-
- ProvidesPackage{zhfontcfg}
- usepackage[cm-default]{fontspec} %[cm-default]选项主要用来解决使用数学环境时数学符号不能正常显示的问题
-
- usepackage{xunicode,xltxtra}
- defaultfontfeatures{Mapping=tex-text} %如果没有它,会有一些 tex 特殊字符无法正常使用,比如连字符。
- % 中文断行
- XeTeXlinebreaklocale "zh"
- XeTeXlinebreakskip = 0pt plus 1pt minus 0.1pt
- %将系统字体名映射为逻辑字体名称,主要是为了维护的方便
-
ewcommandfontnamehei{Microsoft YaHei}
-
ewcommandfontnamesong{SimSun}
-
ewcommandfontnamekai{AR PL KaitiM GB}
-
ewcommandfontnamemono{DejaVu Sans Mono}
-
ewcommandfontnameroman{Times New Roman}
- %%设置常用中文字号,方便调用
-
ewcommand{erhao}{fontsize{22pt}{aselineskip}selectfont}
-
ewcommand{xiaoerhao}{fontsize{18pt}{aselineskip}selectfont}
-
ewcommand{sanhao}{fontsize{16pt}{aselineskip}selectfont}
-
ewcommand{xiaosanhao}{fontsize{15pt}{aselineskip}selectfont}
-
ewcommand{sihao}{fontsize{14pt}{aselineskip}selectfont}
-
ewcommand{xiaosihao}{fontsize{12pt}{aselineskip}selectfont}
-
ewcommand{wuhao}{fontsize{10.5pt}{aselineskip}selectfont}
-
ewcommand{xiaowuhao}{fontsize{9pt}{aselineskip}selectfont}
-
ewcommand{liuhao}{fontsize{7.5pt}{aselineskip}selectfont}
- %设置文档正文字体为宋体
- setmainfont[BoldFont=fontnamehei]{fontnamesong}
- setsansfont[BoldFont=fontnamehei]{fontnamekai}
- setmonofont{fontnamemono}
- %楷体
-
ewfontinstanceKAI {fontnamekai}
-
ewcommand{kai}[1]{{KAI#1}}
- %黑体
-
ewfontinstanceHEI{fontnamehei}
-
ewcommand{hei}[1]{{HEI#1}}
- %英文
-
ewfontinstanceENF{fontnameroman}
-
ewcommand{en}[1]{,{ENF#1},}
下面是一个tex测试文件input.tex
- documentclass{article}
-
- usepackage{zhfontcfg}
- usepackage[colorlinks,linkcolor=black]{hyperref}
- %opening
- itle{latex多字体简易示例}
- author{颜开}
- egin{document}
- maketitle
- section{楷体}
- kai{楷体}
- section{黑体}
- hei{黑体}
- end{document}
使用命令xelatex input.tex 这样就生成了input.pdf文件
Linux双线双网卡双IP双网关设置方法Gentoo Linux--使用日志信息完整卸载软件包相关资讯 Gentoo latex XeTeX
- LaTex中文编辑入门 (今 16:13)
- 使用xeCJK解决LaTeX中文问题的最小 (07/27/2015 09:18:25)
- Linux下优秀的文本编辑器( (03/04/2015 17:12:13)
| - Gentoo LiveDVD “Choice Edition (06月01日)
- LaTeX 入门教程 (03/04/2015 17:20:51)
- 基于mimeTex的数学公式WebService (02/26/2015 15:32:59)
|
本文评论 查看全部评论 (1)
评论声明- 尊重网上道德,遵守中华人民共和国的各项有关法律法规
- 承担一切因您的行为而直接或间接导致的民事或刑事法律责任
- 本站管理人员有权保留或删除其管辖留言中的任意内容
- 本站有权在网站内转载或引用您的评论
- 参与本评论即表明您已经阅读并接受上述条款
|
|