Yanjie's Blog

这个博客已通过认证

Ubuntu 14.04 安装 Tex Live 2015

📅 | 🏷️ , ,
文章目录

准备工作

$ sudo apt-get purge tex-common

安装

$ cd /media/username/TeXLive2015
$ sudo install-tl

输入I即开始安装。

配置环境变量

$ ls /usr/local/texlive/2015/bin/x86_64-linux/xelatex
$ sudo gedit /etc/profile

在文件末尾添加如下三行文本:

export MANPATH=/usr/local/texlive/2015/texmf-dist/doc/man:$MANPATH
export INFOPATH=/usr/local/texlive/2015/texmf-dist/doc/info:$INFOPATH
export PATH=/usr/local/texlive/2015/bin/x86_64-linux:$PATH

输入如下代码,使得环境变量生效

$ source \etc\profile
$ xelatex --version

XeTeX 3.14159265-2.6-0.99992 (TeX Live 2015)

安装Windows字体

从Windwos系统中复制仿宋(simfang.ttf),黑体(simhei.ttf),楷体(simkai.ttf),隶书(simli.ttf),幼圆(simyou.ttf),并将其放入/usr/share/fonts/WinFonts/目录下。(Note:Windows 7系统中没有宋体(simsun.ttf),注意后缀为.ttf,可从网上下载 simsong.ttf

$ sudo mkdir /usr/share/fonts/WinFonts/
# 将前述6个字体复制到该文件下
$ cd /usr/share/fonts/WinFonts/	
$ sudo chmod 777 *
$ sudo mkfontscale
$ sudo mkfontdir
$ sudo fc-cache-fsv
$ fc-list:lang=zh-cn	#检查结果中是否有前述6个中文字体

配置xelatex 的字体配置文件

为了在整个系统中使用 TeX Live 的字体,将配置文件 texlive-fontconfig.conf 复制到 /etc/fonts/conf.d/ 目录下,并命名为 09-texlive.conf

$ sudo cp /usr/local/texlive/2015/texmf-var/fonts/conf/texlive-fontconfig.conf /etc/fonts/conf.d/09-textlive.conf
$ sudo fc-cache -fsv

编译一个中文PDF

新建一个tex文档 main.tex

\documentclass[10pt,UTF8]{ctexbook} 
%\usepackage{latexsym} 
\usepackage{amsmath} 
\usepackage{amssymb}

\usepackage{graphics}
\usepackage{epsfig}

\topmargin=0pt\oddsidemargin=0pt\evensidemargin=0pt 
\textwidth=16.5cm\textheight=23cm\raggedbottom

\newtheorem{thh}{Theorem} 
\newtheorem{dff}{Definition} 
\newtheorem{pr}{Proposition} 
\newtheorem{lm}{Lemma} 
\newtheorem{cl}{Collary} 
%\mathindent=1.5cm 
\begin{document} 

\date{} 
\title{  {\bf\large{标题}}
\footnote {\footnotesize 脚注}} 
\author{作者\\({\footnotesize 作者单位}) 
\\{\footnotesize e-mail:邮箱} }
\maketitle 

\chapter{第一章}

\section{第一节}

这是一个中文书 document class。

\end{document}

cdmain.tex文件所在目录下,用xelatex生成PDF

$ xelatex main.tex

OK,安装完毕。

参考文档

LaTeX的学习之路上布满大坑小坑,大家且填且珍惜!