texlive安装及基本使用

下载latex镜像文件(清华大学开源软件镜像站):

官网下载 install-tl-unx.tar.gz:http://www.tug.org/texlive/acquire-netinstall.html 解压后:sudo ./install-tl

直接从链接下载:https://mirrors.tuna.tsinghua.edu.cn/CTAN/systems/texlive/Images/texlive2018-20180414.iso

或者终端:$ wget -c https://mirrors.tuna.tsinghua.edu.cn/CTAN/systems/texlive/Images/texlive2018-20180414.iso

Texlive 安装指南:https://www.tug.org/texlive/doc/texlive-zh-cn/texlive-zh-cn.pdf

安装:

$ su

$ locate texlive | xargs rm -rf

$ mount -o loop texlive2018-20180414.iso /mnt/

$ cd /mnt/

$ sudo ./install-tl

此时,会出现:

Can't locate Digest/MD5.pm in @INC (you may need to install the Digest::MD5 module) (@INC contains: ./tlpkg /usr/local/lib64/perl5 /usr/local/share/perl5 /usr/lib64/perl5/vendor_perl /usr/share/perl5/vendor_perl /usr/lib64/perl5 /usr/share/perl5 .) at tlpkg/TeXLive/TLUtils.pm line 201.

BEGIN failed--compilation aborted at tlpkg/TeXLive/TLUtils.pm line 201.
Compilation failed in require at ./install-tl line 53.

BEGIN failed--compilation aborted at ./install-tl line 53.


$ sudo yum install perl-Digest-MD5

$ sudo ./install-tl

安装成功:

Welcome to TeX Live!

See /usr/local/texlive/2018/index.html for links to documentation.
The TeX Live web site (http://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 http://tug.org/usergroups.html.

Add /usr/local/texlive/2018/texmf-dist/doc/man to MANPATH.
Add /usr/local/texlive/2018/texmf-dist/doc/info to INFOPATH.
Most importantly, add /usr/local/texlive/2018/bin/x86_64-linux

to your PATH for current and future sessions.

Logfile: /usr/local/texlive/2018/install-tl.log

$ cd ~

$ umount /mnt/   #卸载镜像文件.iso

$ vi .bashrc   

#添加

#texlive
PATH=/usr/local/texlive/2018/bin/x86_64-linux:$PATH; export PATH
MANPATH=/usr/local/texlive/2018/texmf-dist/doc/man:$MANPATH; export MANPATH

INFOPATH=/usr/local/texlive/2018/texmf-dist/doc/info:$INFOPATH; export INFOPATH

$ tex --version   #查看版本

$ latex sample2e.tex   #测试编译

$ pdftex sample2e.tex   #在当前目录下生成测试文档的pdf文件

$ tlmgr option repository http://mirror.ctan.org/systems/texlive/tlnet  #自动选择最近的仓库更新

$ tlmgr update -self   #更新宏包管理器

$ tlmgr update -all   #更新所有已安装的宏包

编辑器:vim, gedit 

编译命令:

latex xxx.tex,会产生xxx.dvi文件作为输出;

dviout xxx.dvi,调用dvi查看器查看dvi文件的内容;

dvipdfm xxx.dvi,将dvi文件转换成pdf文件;

dvips xxx.dvi,将dvi文件转换成ps文件;

psv xxx.ps,调用PS_View查看器查看ps文件;

ps2pdf xxx.ps,将xxx.ps文件转换成xxx.pdf文件;

pdflatex xxx.tex,将文件xxx.tex一步到位,直接编译成pdf文件;

epstopdf: converts Encapsulated PostScript (EPS) files to PDF;

pdfcrop: (crops a PDF file)

如果不想手动编译,可以配置交互式编辑器texmaker自动编译。

创建文档: 

\documentclass{article}  
\begin{document}  
Hello world  
\end{document} 

中文:

\documentclass[UTF8]{ctexart}  
\begin{document}  
Hello World! 你好 世界!  
\end{document}

参考:

安装:https://www.jianshu.com/p/3b3a6f1f11bc

https://blog.csdn.net/lixiangyong123/article/details/59520244

使用:https://blog.csdn.net/robertchenguangzhi/article/details/50494697

https://blog.csdn.net/zb1165048017/article/details/52785177

猜你喜欢

转载自blog.csdn.net/luoluo19550418/article/details/80503778