ubuntu下各种软件的安装

配置Tex中文环境

  • 首先安装texlive编译环境
sudo apt-get install texlive #基本包
sudo apt-get install texlive-full # 全部
选择基本包的话,利用第二条命令检查要安装什么包
安装lang语言包
  • 安装Texmaker
    在linux下首先要安装qt环境,直接在软件中心搜索qt,下载一个 Qt4 设置即可.到官网下载一个deb的安装包,比如我的是texmaker_ubuntu_15.04_4.5_amd64.deb.
sudo dpkg -i texmaker_ubuntu_15.04_4.5_amd64.deb

至此,它已经完全可以支持英文的写作了. for example:

%创建一个tex文档,如test.tex
\documentclass{article}
\begin{document}
Hello, texlive!
\end{document}

点击编译产生pdf.或者使用命令行.

xelatex test.tex
  • 中文支持
    默认情况下是不显示中文的.此时texlive自带的包ctex默认使用windows字体,而linux系统中没有,因此需要手动安装.
  1. 复制windows字体
$cd /usr/share/fonts/truetype/
$sudo mkdir windows
$cd windows
# 假设Windows字体放在/media/cjl/Win7/Windows/Fonts目录下
$sudo cp /media/用户名/系统盘的名字/Windows/Fonts/*.tt* .
# 修改权限,这步一定要记住
$sudo chmod 644 *
  1. 刷新fontconfig的字体缓存
$cd ..
$sudo fc-cache -fsv
  1. 测试
    记住要使用 UTF-8 编码格式,不然中文输出是乱码的.
%test2.tex
\documentclass[UTF8]{article}
\usepackage{ctex}
\begin{document}
你好, texlive!
\end{document}

至此,简单的中文支持就设置好了.

参考:

  1. http://tex.stackexchange.com/questions/134365/installation-of-texlive-full-on-ubuntu-12-04
  2. http://cs-cjl.com/2014/06/02/texlive_install_guide
  3. http://tex.stackexchange.com/questions/17611/how-does-one-type-chinese-in-latex

你可能感兴趣的:(ubuntu下各种软件的安装)