目录
  1. 1. Linux下texlive2019安装笔记
    1. 1.1. 准备
    2. 1.2. 安装流程
    3. 1.3. 配置中文环境
    4. 1.4. 出现的一些问题
      1. 1.4.1. 问题1
Linux下texlive2019安装笔记

Linux下texlive2019安装笔记

准备

  • 下载镜像
    从中科大镜像站下载texlive2019的iso镜像,这里使用的是axel命令行工具进行下载。
1
axel -n 12 "http://mirrors.ustc.edu.cn/CTAN/systems/texlive/Images/texlive2019-20190410.iso" -o texlive2019-20190410.iso
  • 挂载镜像
1
2
3
sudo mount ~/texlive2019-20190410.iso /mnt #将镜像挂载到mnt目录
cd /mnt/
./install_tl #执行安装程序

安装流程

  1. 执行sudo ./install_tl进入初始化界面
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
Loading ./tlpkg/texlive.tlpdb
Installing TeX Live 2019 from: . (verified)
Platform: x86_64-linux => 'GNU/Linux on x86_64'
Distribution: inst (compressed)
Directory for temporary files: /tmp/nxPvl2SvBX
======================> TeX Live installation procedure <=====================

======> Letters/digits in <angle brackets> indicate <=======
======> menu items for actions or customizations <=======

Detected platform: GNU/Linux on x86_64

<B> set binary platforms: 1 out of 5 #安装平台

<S> set installation scheme: scheme-full #安装模式

<C> set installation collections: #安装选项
40 collections out of 41, disk space required: 5845 MB

<D> set directories: #安装目录
TEXDIR (the main TeX directory):
!! default location: /usr/local/texlive/2019
!! is not writable or not allowed, please select a different one!
TEXMFLOCAL (directory for site-wide local files):
/usr/local/texlive/texmf-local
TEXMFSYSVAR (directory for variable and automatically generated data):
/usr/local/texlive/2019/texmf-var
TEXMFSYSCONFIG (directory for local config):
/usr/local/texlive/2019/texmf-config
TEXMFVAR (personal directory for variable and automatically generated data):
~/.texlive2019/texmf-var
TEXMFCONFIG (personal directory for local config):
~/.texlive2019/texmf-config
TEXMFHOME (directory for user-specific files):
~/texmf

<O> options: #选项
[ ] use letter size instead of A4 by default
[X] allow execution of restricted list of programs via \write18
[X] create all format files
[X] install macro/font doc tree
[X] install macro/font source tree
[ ] create symlinks to standard directories
[X] after install, set CTAN as source for package updates

<V> set up for portable installation

Actions:
<I> start installation to hard disk
<P> save installation profile to 'texlive.profile' and exit
<H> help
<Q> quit

Enter command: O #这里输入选项O,进入选项界面,选择自己需要的模块
  1. 输入选项O,勾选必要选项
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
===============================================================================
Options customization:

<P> use letter size instead of A4 by default: [ ] #使用信纸尺寸而不是默认的A4纸
<E> execution of restricted list of programs: [X]
<F> create all format files: [X] #创建所有的格式文件
<D> install font/macro doc tree: [X] #安装字体或者宏的文档树
<S> install font/macro source tree: [X] #安装字体或者宏的源码树
<L> create symlinks in standard directories: [ ] #在标准目录创建符号连接
binaries to:
manpages to:
info to:
<Y> after install, set CTAN as source for package updates: [X] #安装之后,设置CTAN作为包更新

Actions: (disk space required: 5845 MB)
<R> return to main menu
<Q> quit

Enter command: L
  1. 敲击Enter键,使用默认路径
1
2
3
New value for binary directory [/usr/local/bin]: #二进制目录
New value for man directory [/usr/local/man]: #man帮助手册目录
New value for info directory [/usr/local/info]:#info手册目录
  1. 重新回到选项界面,并将L选项选中(用X作为选中标记)
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
===============================================================================
Options customization:

<P> use letter size instead of A4 by default: [ ]
<E> execution of restricted list of programs: [X]
<F> create all format files: [X]
<D> install font/macro doc tree: [X]
<S> install font/macro source tree: [X]
<L> create symlinks in standard directories: [X]
binaries to: /usr/local/bin
manpages to: /usr/local/man
info to: /usr/local/info
<Y> after install, set CTAN as source for package updates: [X]

Actions: (disk space required: 5845 MB)
<R> return to main menu
<Q> quit

Enter command: R
  1. 返回初始化界面(正式进行安装)
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
 <O> options:
[ ] use letter size instead of A4 by default
[X] allow execution of restricted list of programs via \write18
[X] create all format files
[X] install macro/font doc tree
[X] install macro/font source tree
[X] create symlinks to standard directories
[X] after install, set CTAN as source for package updates

<V> set up for portable installation

Actions:
<I> start installation to hard disk
<P> save installation profile to 'texlive.profile' and exit
<H> help
<Q> quit

Enter command: I
  1. 选中I选项开始正式安装到硬盘
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
#大约需要半个小时的时间
Enter command: I
Installing to: /usr/local/texlive/2019
Installing [0001/3768, time/total: ??:??/??:??]: 12many [376k]
Installing [0002/3768, time/total: 00:01/02:07:26]: 2up [66k]
Installing [0003/3768, time/total: 00:01/01:48:31]: Asana-Math [482k]
Installing [0004/3768, time/total: 00:01/51:50]: ESIEEcv [137k]
Installing [0005/3768, time/total: 00:01/45:09]: FAQ-en [4971k]
Installing [0006/3768, time/total: 00:02/15:51]: GS1 [1125k]
Installing [0007/3768, time/total: 00:03/20:02]: HA-prosper [266k]
Installing [0008/3768, time/total: 00:03/19:19]: IEEEconf [188k]
Installing [0009/3768, time/total: 00:03/18:51]: IEEEtran [1323k]
Installing [0010/3768, time/total: 00:03/16:03]: MemoirChapStyles [739k]
Installing [0011/3768, time/total: 00:04/19:46]: SIstyle [338k]
Installing [0012/3768, time/total: 00:04/19:06]: SIunits [284k]
Installing [0013/3768, time/total: 00:04/18:35]: Tabbing [217k]
Installing [0014/3768, time/total: 00:04/18:12]: Type1fonts [516k]
Installing [0015/3768, time/total: 00:05/21:41]: a0poster [119k]
Installing [0016/3768, time/total: 00:05/21:27]: a2ping [69k]
Installing [0017/3768, time/total: 00:05/21:19]: a2ping.x86_64-linux [1k]
Installing [0018/3768, time/total: 00:05/21:19]: a4wide [133k]
  1. 安装完成
1
2
3
4
5
6
7
8
9
Welcome to TeX Live!


See /usr/local/texlive/2019/index.html for links to documentation.
The TeX Live web site (https://tug.org/texlive/) contains any updates and
corrections. TeX Live is a joint project of the TeX user groups around the
world; please consider supporting it by joining the group best for you. The
list of groups is available on the web at https://tug.org/usergroups.html.
Logfile: /usr/local/texlive/2019/install-tl.log

配置中文环境

  1. 设置更新源和texlive字体
1
2
3
4
5
6
#将texlive自带的字体配置放入系统字体配置中,使得系统能使用texlive的系统配置
sudo cp -r /usr/local/texlive/2019/texmf-var/fonts/conf/texlive-fontconfig.conf /etc/fonts/conf.d/09-textlive.conf
sudo fc-cache -fsv
#设置CTAN的更新源,这里选择的是中科大的更新源
sudo tlmgr option repository https://mirrors.tuna.ustc.edu.cn/CTAN/systems/texlive/tlnet
sudo tlmgr update --self --all
  1. 加入windows中文字体
    下载字体
    下载工具
1
2
3
4
5
6
7
8
9
tar -zxvf fonts.tar.gz #解压字体
tar -zxvf gbkfonts-linux-0.3.tar.gz #解压字体工具
./gbkfonts simsun.ttf song
./gbkfonts simkai.ttf kai
./gbkfonts simhei.ttf hei
./gbkfonts SIMLI.TTF li

#更新系统搜索路径
mktexlsr
  1. picins下载
    如果不安装这个包,在用xelatex编译中文时会出现错误。
1
2
3
4
mkdir picins ; mv picins.zip picins
cd picins ; unzip picins.zip
cp -r picins cd /usr/local/texlive/2019/texmf-dist/tex/latex/
mktexlsr

出现的一些问题

问题1
  • 问题:
    使用xelatex编译生成的pdf后,用evince查看pdf无法显示中文
  • 解决:xeCJK+xelatex
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
%%=====================================================================================
%%
%% Filename: 1.tex
%%
%% Description:
%%
%% Version: 1.0
%% Created: 2019年05月26日
%% Revision: none
%%
%% Author: YOUR NAME (),
%% Organization:
%% Copyright: Copyright (c) 2019, YOUR NAME
%%
%% Notes:
%%
%%=====================================================================================
\documentclass[UTF8]{article}
%1.若设置ctexart是使用ctex的article。
%2.代码意思为:文本类下的article(p.s:It also include report,slides(PPT)&book,)使用[UTF8]编码
%3.代码调用Article Templates
%4.[]内为补充项,{}内为选定项,[]内可以设定全局字体大小如15.75pt中文三号,10pt(default);a4paper,letterpaper(default);twoside(book默认),oneside(article,report默认);one column,two column(将文本分为两列排版)。
%5.这里既是设置[utf8]编码也需要重新将txt另存为UTF8编码才管用

%%%%%%%%%%宏包我使用的%%%%%%%%%%
\usepackage{xeCJK}
%1.google说XeLaTeX+xeCJK是最好的中文排版解决方案
%2.xeCJK 是一个在 XeTeX 引擎下处理CH文字断行、标点调整、字体选择的一个基础性宏包
\usepackage{fontspec,xunicode,xltxtra}
%1.fontspec允许本地字体支持,xunicode(p.s我老读成虚拟code···
%2.其实是x-unicode)扩展统一编码,xltxtra is means of “XeLaTeX Extras”
%3.CTAN上解释是很多他的功能被fontspec容纳,但是它存在的意义是为LaTeX使用XeTeX提供后向支持,配合使用fontspec,metalogo,realscript。
\usepackage{geometry}%允许页面边距的调整
\usepackage{lscape}%允许设置页面horizontal
\usepackage{indentfirst}%允许设置段首锁进


%%%%%%%%%%paragraph%%%%%%%%%%
\usepackage[raggedleft]{titlesec}%默认左对齐,也可以设置center or raggedright
\usepackage{indentfirst}%段首缩进需要的宏包
\setlength{\parindent}{2em}%设置段首缩进两个汉字
\setlength{\parskip}{1em}%paragraph skip,调整的是段落间距离
\renewcommand{\baselinestretch}{1.8}%重新定义行间距为单倍的1.28倍
\setlength{\parindent}{2em}%设置每个段首缩进两个字节
%%%%%%%%%%pageSetting%%%%%%%%%%
\geometry{left=3.0cm,right=2.5cm,top=2.8cm,bottom=2.5cm}
\begin{document}
\newgeometry{left=2.0cm,right=2.0cm,top=2.0cm,bottom=2.0cm}%重新定义本页页面
\begin{center}%居中环境
吾皇无双,武侯韬略
\clearpage%另起一页

\begin{landscape}%使当下页面为横向页面
\begin{center}
天下太平,万世无疆
\end{center}
\end{landscape}
\end{center}
\restoregeometry%恢复原先的页面设置
\end{document}
文章作者: rack-leen
文章链接: http://yoursite.com/2019/05/25/Latex/%E5%AE%89%E8%A3%85%E5%92%8C%E9%85%8D%E7%BD%AE/Linux%E4%B8%8Btexlive2019%E5%AE%89%E8%A3%85%E7%AC%94%E8%AE%B0/
版权声明: 本博客所有文章除特别声明外,均采用 CC BY-NC-SA 4.0 许可协议。转载请注明来自 rack-leen's blog
打赏
  • 微信
  • 支付宝

评论