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

發表評論
所有評論
還沒有人評論,想成為第一個評論的人麼? 請在上方評論欄輸入並且點擊發布.
相關文章