Original artical url:

http://www.ylzx8.cn/linux/linux-unix/280361.html

手把手教你在Linux下安装LaTeX环境

一、LaTeX简介

LaTeX(LATEX,音译“拉泰赫”)是一种基于TeX的排版系统,由美国计算机学家莱斯利·兰伯特(Leslie Lamport)在20世纪80年代初期开发,利用这种格式,即使使用者没有排版和程序设计的知识也可以充分发挥由TeX所提供的强大功能,能在几天,甚至几小时内生成很多具有书籍质量的印刷品。

LaTeX在Windows、Linux、Mac OS上都有发行版:

 操作系统  发行版  编辑器
Windows  MikTeX  TeXnicCenter、WinEdt
Unix/Linux TeX Live Emacs、vim、Kile
Mac OS MacTeX TeXShop

二、LaTeX 下载安装

首先我们下载TexLive镜像,这是推荐厦门大学开源软件镜像,上面有最新的TexLive 2012 ,下载速度也很可观。
         http://mirrors.xmu.edu.cn/CTAN/systems/texlive/Images/
下面安装TexLive:
#cd Downloads
#su
passwd:
# mount -t  <span id="8_nwp" style="width: auto; height: auto; float: none;"><a target=_blank id="8_nwl" href="http://cpro.baidu.com/cpro/ui/uijs.php?c=news&cf=5&ch=0&di=128&fv=11&jk=d4075488539088f&k=iso&k0=iso&kdi0=0&luki=1&n=10&p=baidu&q=v77y4_cpr&rb=0&rs=1&seller_id=1&sid=8f0839854875400d&ssp2=1&stid=0&t=tpclicked3_hc&tu=u2102575&u=http%3A%2F%2Fwww%2Eylzx8%2Ecn%2Flinux%2Flinux%2Dunix%2F280361%2Ehtml&urlid=0" target="_blank" mpid="8" style="color: rgb(1, 70, 108); text-decoration: none;"><span style="color: rgb(0, 0, 255); width: auto; height: auto;">iso</span></a></span>9660 -o loop texlive2012-20120701.iso /mnt/
mount: warning: /mnt/ seems to be mounted read-only.
#./install-tl

三、LaTeX 配置

首先我们从别处拷贝需要的字体,比如从Windows的C:/Windows/Fonts下拷贝最常使用的几种字体:
msyh.ttf(微软雅黑)  simfang.ttf(仿宋)  simhei.ttf(黑体)  simkai.ttf(楷体)  simsun.ttc(宋体)
比如说我们拷贝到Linux的/home/username/Fonts目录下:
接下来打开终端进行配置:
# mkdir /usr/share/fonts/winfonts/
# cp ~/Fonts/msyh.ttf /usr/share/fonts/winfonts/
# cp ~/Fonts/simfang.ttf /usr/share/fonts/winfonts/
# cp ~/Fonts/simhei.ttf /usr/share/fonts/winfonts/
# cp ~/Fonts/simkai.ttf /usr/share/fonts/winfonts/
# cp ~/Fonts/simsun.ttf /usr/share/fonts/winfonts/ 

如果需要更多的字体,使用同样办法拷贝即可。
拷贝完成之后一定要注意使用chmod给字体权限:
# sudo chmod a+x  /usr/share/fonts/winfonts/ 

接下来再进行下列操作

# cd /usr/share/fonts/winfonts/
# mkfontscale
# mkfontdir
# fc-cache
以上命令的作用分别是:为X字体创建可裁剪的索引,在一个目录中创建X字体文件的索引,建立字体信息缓存文件。
接下来,使用fc-list 命令查看:
# sudo fc-list :lang=zh-cnNSimSun,新宋体:<span id="6_nwp" style="width: auto; height: auto; float: none;"><a target=_blank id="6_nwl" href="http://cpro.baidu.com/cpro/ui/uijs.php?c=news&cf=5&ch=0&di=128&fv=11&jk=d4075488539088f&k=style&k0=style&kdi0=0&luki=7&n=10&p=baidu&q=v77y4_cpr&rb=0&rs=1&seller_id=1&sid=8f0839854875400d&ssp2=1&stid=0&t=tpclicked3_hc&tu=u2102575&u=http%3A%2F%2Fwww%2Eylzx8%2Ecn%2Flinux%2Flinux%2Dunix%2F280361%2Ehtml&urlid=0" target="_blank" mpid="6" style="color: rgb(1, 70, 108); text-decoration: none;"><span style="color: rgb(0, 0, 255); width: auto; height: auto;">style</span></a></span>=Regular
KaiTi,楷体:style=Regular,Normal,obyčejné,Standard,Κανονικά,Normaali,Normál,Normale,Standaard,Normalny,Обычный,Normálne,Navadno,Arrunta
SimSun,宋体:style=RegularUnibit:style=Regular
WenQuanYi Zen Hei,文泉驛正黑,文泉驿正黑:style=Regular
SimHei,黑体:style=Regular,Normal,obyčejné,Standard,Κανονικά,Normaali,Normál,Normale,Standaard,Normalny,Обычный,Normálne,Navadno,Arrunta
WenQuanYi Zen Hei Mono,文泉驛等寬正黑,文泉驿等宽正黑:<span id="7_nwp" style="width: auto; height: auto; float: none;"><a target=_blank id="7_nwl" href="http://cpro.baidu.com/cpro/ui/uijs.php?c=news&cf=5&ch=0&di=128&fv=11&jk=d4075488539088f&k=style&k0=style&kdi0=0&luki=7&n=10&p=baidu&q=v77y4_cpr&rb=0&rs=1&seller_id=1&sid=8f0839854875400d&ssp2=1&stid=0&t=tpclicked3_hc&tu=u2102575&u=http%3A%2F%2Fwww%2Eylzx8%2Ecn%2Flinux%2Flinux%2Dunix%2F280361%2Ehtml&urlid=0" target="_blank" mpid="7" style="color: rgb(1, 70, 108); text-decoration: none;"><span style="color: rgb(0, 0, 255); width: auto; height: auto;">style</span></a></span>=Regular
WenQuanYi Zen Hei Sharp,文泉驛點陣正黑,文泉驿点阵正黑:style=Regular
最后,咱们根据fc-list命令显示的信息修改文件/usr/local/texlive/2012/texmf-dist/tex/latex/ctex/fontset/ctex-xecjk-winfonts.def
# cat /usr/local/texlive/2012/texmf-dist/tex/latex/ctex/fontset/ctex-xecjk-winfonts.def% ctex-xecjk-winfonts.def: Windows 的 xeCJK 字体设置,默认为六种中易字体  % <span id="5_nwp" style="width: auto; height: auto; float: none;"><a target=_blank id="5_nwl" href="http://cpro.baidu.com/cpro/ui/uijs.php?c=news&cf=5&ch=0&di=128&fv=11&jk=d4075488539088f&k=vim&k0=vim&kdi0=0&luki=9&n=10&p=baidu&q=v77y4_cpr&rb=0&rs=1&seller_id=1&sid=8f0839854875400d&ssp2=1&stid=0&t=tpclicked3_hc&tu=u2102575&u=http%3A%2F%2Fwww%2Eylzx8%2Ecn%2Flinux%2Flinux%2Dunix%2F280361%2Ehtml&urlid=0" target="_blank" mpid="5" style="color: rgb(1, 70, 108); text-decoration: none;"><span style="color: rgb(0, 0, 255); width: auto; height: auto;">vim</span></a></span>:ft=tex  \setCJKmainfont[BoldFont={SimHei},ItalicFont={[SIMKAI.TTF]}]{SimSun}\setCJKsansfont{SimHei}\setCJKmonofont{[SIMFANG.TTF]}\setCJKfamilyfont{zhsong}{SimSun}\setCJKfamilyfont{zhhei}{SimHei}\setCJKfamilyfont{zhkai}{[SIMKAI.TTF]}\setCJKfamilyfont{zhfs}{[SIMFANG.TTF]}% \setCJKfamilyfont{zhli}{LiSu}% \setCJKfamilyfont{zhyou}{YouYuan}\newcommand*{\songti}{\CJKfamily{zhsong}} % 宋体\newcommand*{\heiti}{\CJKfamily{zhhei}}   % 黑体\newcommand*{\kaishu}{\CJKfamily{zhkai}}  % 楷书\newcommand*{\fangsong}{\CJKfamily{zhfs}} % 仿宋% \newcommand*{\lishu}{\CJKfamily{zhli}}    % 隶书% \newcommand*{\youyuan}{\CJKfamily{zhyou}} % 幼圆\endinput 
咱需要对红色标记的做修改,修改成fc-list上与楷体(或者其他)相关的,我这为KaiTi,有的环境上为KaiTi_GB2312,修改需要根据环境上fc-list打印的信息而定。
修改后,咱再来看看:
# cat /usr/local/texlive/2012/texmf-dist/tex/latex/ctex/fontset/ctex-xecjk-winfonts.def% ctex-xecjk-winfonts.def: Windows 的 xeCJK 字体设置,默认为六种中易字体
% <span id="4_nwp" style="width: auto; height: auto; float: none;"><a target=_blank id="4_nwl" href="http://cpro.baidu.com/cpro/ui/uijs.php?c=news&cf=5&ch=0&di=128&fv=11&jk=d4075488539088f&k=vim&k0=vim&kdi0=0&luki=9&n=10&p=baidu&q=v77y4_cpr&rb=0&rs=1&seller_id=1&sid=8f0839854875400d&ssp2=1&stid=0&t=tpclicked3_hc&tu=u2102575&u=http%3A%2F%2Fwww%2Eylzx8%2Ecn%2Flinux%2Flinux%2Dunix%2F280361%2Ehtml&urlid=0" target="_blank" mpid="4" style="color: rgb(1, 70, 108); text-decoration: none;"><span style="color: rgb(0, 0, 255); width: auto; height: auto;">vim</span></a></span>:ft=tex  \setCJKmainfont[BoldFont={SimHei},ItalicFont={KaiTi}]{SimSun}\setCJKsansfont{SimHei}\setCJKmonofont{[SIMFANG.TTF]}\setCJKfamilyfont{zhsong}{SimSun}\setCJKfamilyfont{zhhei}{SimHei}\setCJKfamilyfont{zhkai}{KaiTi}\setCJKfamilyfont{zhfs}{[SIMFANG.TTF]}% \setCJKfamilyfont{zhli}{LiSu}% \setCJKfamilyfont{zhyou}{YouYuan}\newcommand*{\songti}{\CJKfamily{zhsong}} % 宋体\newcommand*{\heiti}{\CJKfamily{zhhei}}   % 黑体\newcommand*{\kaishu}{\CJKfamily{zhkai}}  % 楷书\newcommand*{\fangsong}{\CJKfamily{zhfs}} % 仿宋% \newcommand*{\lishu}{\CJKfamily{zhli}}    % 隶书% \newcommand*{\youyuan}{\CJKfamily{zhyou}} % 幼圆\endinput  
至此,配置完毕。
我在使用xelatex时会有提示,xelatex :command not found 之类的信息,之后通过如下手动配置得以正常使用:
 #vim /etc/bash.bashrc
   在最后添加一行:   PATH=$PATH : /usr/local/texlive/2012/bin/i386-linux/  (这个路径最好一步一步走,使用自动补全找到,不过一般差异为最后,64位机器为x86_64-linux)
  #source /etc/bash.bashrc
之后关闭所有终端,即可!

四、LaTeX学习帮助

LaTeX 学习文档下载:
http://download.csdn.net/detail/longerzone/4703133
http://download.csdn.net/detail/longerzone/4703238
参考文档

【1】 http://www.tug.org/texlive/doc/texlive-zh-cn/texlive-zh-cn.pdf

【2】 http://www.aboutlinux.info/2005/12/adding-windows-fonts-in-linux.html

【3】 http://hi.baidu.com/defeattroy/blog/item/5df1ffcac3348415be09e6de.html

【4】 http://learningloong.blog.163.com/blog/static/1623081242011731102219361/

【5】 http://forum.ubuntu.com.cn/viewtopic.php?f=35&t=350882

【6】http://blog.csdn.net/defeattroy/article/details/7581846

手把手教你在Linux上安装LaTeX环境相关推荐

  1. Linux上安装LaTeX

    Linux上安装LaTeX 1. 安装 1.1 下载安装texlive 1.2 配置中文 1.3 安装XeLatex 1.4 安装编辑器 1.5 设置默认支持中文编译 1.6 配置环境路径 2. la ...

  2. 在Linux上安装ant环境

    在Linux上安装ant环境 1.从http://ant.apache.org 上下载tar.gz版ant 2.复制到/usr下 3.tar -vxzf apahce-ant-1.9.2-bin.ta ...

  3. Linux上安装Apache环境及安装过程报错解决方案toastr弹框

    一.Linux上安装Apache环境及安装 下载apache源代码 1.下载地址:http://httpd.apache.org/download.cgi  找稳定的最新的版本(Stable Rele ...

  4. 【软件安装-UBUNTU】【OLD】手把手教你在Linux上运行IE浏览器

    对于在Linux上安装微软的产品,尤其是IE浏览器,大多数Linux用户会感到比较惊恐,唯恐其污染了纯洁的Linux.但是,在使用普通的Linux下的浏览器浏览网页的时候,例如Firefox或Konq ...

  5. linux系统 能安装ie吗,手把手教你在Linux上运行IE浏览器

    [IT168 产品应用]对于在Linux上安装微软的产品,尤其是IE浏览器,大多数Linux用户会感到比较惊恐,唯恐其污染了纯洁的Linux.但是,在使用普通的Linux下的浏览器浏览网页的时候,例如 ...

  6. linux按照mysql为何如此简单_手把手教你在Linux下安装MySQL

    在Linux操作系统下,安装MYSQL有两种方式:一种tar安装方式,另外一种是rpm安装方式.这两种安装方式有什么区别呢?尽管我们在Linux下常用tar来压缩/解压缩文件,但MYSQL的tar格式 ...

  7. 手把手教你JDK+IDEA的安装和环境配置

      目录 1.先安装JDK 1.1 查看电脑是多少位的系统 1.2 安装和电脑系统相同位的JDK 2.给JDK配置环境 2.1 配置jDK环境三步走 2.2 检查JDK环境配置好没好 3.安装IDEA ...

  8. x200装linux驱动下载,手把手教你在x200上安装原汁原味的mac Os x10.6系统

    [一]准备篇 1.下载 6.1GB的Snow Leopard 10.6原版镜像 下载地址 http://www.verycd.com/topics/2778507/ 这个镜像的md5是1D1FB7EC ...

  9. 手把手教你在Linux上搭建BitTorrent服务器

    网络技术的飞速发展与迅速普及使其成为数据通信的重要手段,网络规模越来越大,连入网络中的计算设备的数量和种类也越来越多,而这些资源并没有得到充分利用,如果能将这些计算单元的处理器计算能力.磁盘存储能力. ...

最新文章

  1. java中磁盘和内存的相互,Java:有没有磁盘和内存一样快的情况?
  2. SaaS新模式:业务、财务与支付无缝对接
  3. C语言3中方法判断32还是64位机
  4. Android Activity使用OnGesture事件以后与子View的Click事件冲突解决办法
  5. CloseableHttpClient加载证书来访问https网站
  6. 中断底半部:softirq、tasklet、workqueue
  7. YBTOJ洛谷P4869:出现位置(线性基)
  8. 《零基础》MySQL 超级入门教程
  9. Promise(异步处理-实现)
  10. Linux环境下rman备份的实例脚本
  11. IDAPython精彩编程(1)
  12. 标量、向量、矩阵、张量
  13. 正在爆发的互联网革命
  14. STM32重上电后,HAL_GetDEVID返回0
  15. 分享《通过开源项目去学习》
  16. 群晖7.1添加NVME固态硬盘
  17. 基于ssm的空气质量监测系统
  18. MS VS 2013下载和安装中文语言包教程
  19. 【js练习】鼠标按下和松开事件
  20. 服务器协议失败,Chrome中的HTTPS服务器“不支持的协议错误”

热门文章

  1. 哭瞎!360云盘将关停,你的几十T照片和文件该怎么办
  2. AGV小车基础知识介绍
  3. Java电话薄期末大作业
  4. Linux下使用utorrent
  5. word中图片不能完全显示的解决办法
  6. 无线定位服务器,智慧社区老人蓝牙APP无线定位系统方案物联网GPS定位系统手环接口...
  7. IELTS words
  8. 【成为架构师课程系列】高并发系统设计的三大目标:高性能、高可用、可扩展
  9. 有薪假无薪假→疫情假
  10. MT7688学习笔记(11)——配置WAN/LAN