Ubuntu下TeX live的安装与配置
2018-10-07 本文已影响0人
Yeyuntian
TeX live是可以作为Tex文件生成的软件系统,提供了在Unix(包括LInux)环境下的完整Tex 系统。
由于前期我们提到了用Texshade 进行序列的可视化,但是最近感觉那文章中仅仅介绍Texshade的使用,但没有对TeXlive作为环境的介绍,因此今天就讲讲在Ubuntu下安装TeXlive的方法并结合前面的Texshade对多重序列比对进行可视化进行进一步完善。
首先是安装软件
参考网站指导中的描述:
http://tug.org/texlive/acquire-mirror.html
选择清华镜像进行安装:
访问镜像列表网站
找到后查看路径:
https://mirrors.tuna.tsinghua.edu.cn/CTAN/systems/texlive/Images/
然后进行下载
yeyuntian@yeyuntian-RESCUER-R720-15IKBN:~/Software$ rsync -a --delete rsync://mirrors.tuna.tsinghua.edu.cn/CTAN/systems/texlive/Images/README.md . -v
+==================================================+
| Tsinghua University |
| -= Open Source Mirror Site =- |
+--------------------------------------------------+
| Welcome to Tsinghua Open Source Mirror Site. |
| |
| This mirror is also available on HTTP. |
| HTTP [https://mirrors.tuna.tsinghua.edu.cn] |
| RSYNC [rsync://mirrors.tuna.tsinghua.edu.cn] |
| |
| If you have any issues, please contact us |
| via GitHub @ https://github.com/tuna/issues |
| or IRC at #tuna on freenode |
| or Fishroom at https://fishroom.tuna.moe/ |
| |
| Supported by |
| Tsinghua Information Technology Center |
| Maintained by |
| Tsinghua University TUNA Association |
| Service Provided by |
| neomirrors |
| |
+==================================================+
Note: This service is provided with a modified
version of rsync. For detailed information, please
visit: https://github.com/tuna/rsync
receiving incremental file list
README.md
sent 43 bytes received 1,313 bytes 904.00 bytes/sec
total size is 1,222 speedup is 0.90
yeyuntian@yeyuntian-RESCUER-R720-15IKBN:~/Software$ l
code_1.27.2-1536736588_amd64.deb shadowsocksr-linux-client-CLI/ texlive2018.iso*
README.md sogoupinyin_2.2.0.0108_amd64.deb
yeyuntian@yeyuntian-RESCUER-R720-15IKBN:~/Software$ cat README.md
TeX Live ISO Images
-------------------
This directory contains the ISO image for the official TeX Live
release; md5 and sha512 checksums are provided, and the sha checksum is
GPG-signed. The generic names (texliveYYYY.iso and texlive.iso) are
symlinks to the dated release .iso.
The TeX Live web pages <https://tug.org/texlive/> have information on:
- other ways to acquire the distribution <https://tug.org/texlive/acquire.html>,
- quick installation <https://tug.org/texlive/quickinstall.html>,
- documentation <https://tug.org/texlive/doc.html>,
- reporting bugs and known issues <https://tug.org/texlive/bugs.html>,
and more.
Instead of dealing with this giant image, for typical use we recommend
the small installer package(s)
<https://tug.org/texlive/acquire-netinstall.html> available from
CTAN <https://ctan.org/>).
If you have problems with installation or running TeX after
installation, please check your environment variables: settings,
including your PATH, that end up referencing previously-installed TeX
systems (TeX Live or otherwise), can cause trouble, especially on Windows.
This is free software: you are free to change and redistribute it.
There is NO WARRANTY, to the extent permitted by law.
这个是READ.md的内容
接下来进行下载:
yeyuntian@yeyuntian-RESCUER-R720-15IKBN:~/Software$ rsync -a --delete rsync://mirrors.tuna.tsinghua.edu.cn/CTAN/systems/texlive/Images/texlive2018-20180414.iso . -v
+==================================================+
| Tsinghua University |
| -= Open Source Mirror Site =- |
+--------------------------------------------------+
| Welcome to Tsinghua Open Source Mirror Site. |
| |
| This mirror is also available on HTTP. |
| HTTP [https://mirrors.tuna.tsinghua.edu.cn] |
| RSYNC [rsync://mirrors.tuna.tsinghua.edu.cn] |
| |
| If you have any issues, please contact us |
| via GitHub @ https://github.com/tuna/issues |
| or IRC at #tuna on freenode |
| or Fishroom at https://fishroom.tuna.moe/ |
| |
| Supported by |
| Tsinghua Information Technology Center |
| Maintained by |
| Tsinghua University TUNA Association |
| Service Provided by |
| neomirrors |
| |
+==================================================+
Note: This service is provided with a modified
version of rsync. For detailed information, please
visit: https://github.com/tuna/rsync
receiving incremental file list
texlive2018-20180414.iso
sent 43 bytes received 3,455,940,464 bytes 1,334,597.61 bytes/sec
total size is 3,455,096,832 speedup is 1.00
yeyuntian@yeyuntian-RESCUER-R720-15IKBN:~/Software$ rsync -a --delete rsync://mirrors.tuna.tsinghua.edu.cn/CTAN/systems/texlive/Images/texlive2018-20180414.iso.md5 .+==================================================+
| Tsinghua University |
| -= Open Source Mirror Site =- |
+--------------------------------------------------+
| Welcome to Tsinghua Open Source Mirror Site. |
| |
| This mirror is also available on HTTP. |
| HTTP [https://mirrors.tuna.tsinghua.edu.cn] |
| RSYNC [rsync://mirrors.tuna.tsinghua.edu.cn] |
| |
| If you have any issues, please contact us |
| via GitHub @ https://github.com/tuna/issues |
| or IRC at #tuna on freenode |
| or Fishroom at https://fishroom.tuna.moe/ |
| |
| Supported by |
| Tsinghua Information Technology Center |
| Maintained by |
| Tsinghua University TUNA Association |
| Service Provided by |
| neomirrors |
| |
+==================================================+
Note: This service is provided with a modified
version of rsync. For detailed information, please
visit: https://github.com/tuna/rsync
yeyuntian@yeyuntian-RESCUER-R720-15IKBN:~/Software$ l
code_1.27.2-1536736588_amd64.deb sogoupinyin_2.2.0.0108_amd64.deb texlive2018-20180414.iso.md5
README.md texlive/ texlive2018.iso*
shadowsocksr-linux-client-CLI/ texlive2018-20180414.iso
yeyuntian@yeyuntian-RESCUER-R720-15IKBN:~/Software$ rm texlive2018.iso
yeyuntian@yeyuntian-RESCUER-R720-15IKBN:~/Software$ mv texlive2018-20180414.iso* texlive
yeyuntian@yeyuntian-RESCUER-R720-15IKBN:~/Software$ l
code_1.27.2-1536736588_amd64.deb shadowsocksr-linux-client-CLI/ texlive/
README.md sogoupinyin_2.2.0.0108_amd64.deb
yeyuntian@yeyuntian-RESCUER-R720-15IKBN:~/Software$ cd texlive/
yeyuntian@yeyuntian-RESCUER-R720-15IKBN:~/Software/texlive$ md5sum texlive2018-20180414.iso
5b547f6949d9688e56b11633f55806cf texlive2018-20180414.iso
yeyuntian@yeyuntian-RESCUER-R720-15IKBN:~/Software/texlive$ cat texlive2018-20180414.iso.md5
5b547f6949d9688e56b11633f55806cf texlive2018-20180414.iso
下载后的结果,经过md5sum进行计算后校验完整性。
接下来进行安装
yeyuntian@yeyuntian-RESCUER-R720-15IKBN:~/Software/texlive$ sudo mount texlive2018-20180414.iso /mnt/
yeyuntian@yeyuntian-RESCUER-R720-15IKBN:~/Software/texlive$ sudo perl /mnt/install-tl
#然后 进入一个界面后 输入 I 后回车
最后安装完成后进行路径配置
yeyuntian@yeyuntian-RESCUER-R720-15IKBN:~$ echo 'export PATH=/usr/local/texlive/2018/bin/x86_64-linux:$PATH' >> ~/.bashrc
yeyuntian@yeyuntian-RESCUER-R720-15IKBN:~$ echo 'export MANPATH=/usr/local/texlive/2018/texmf-dist/doc/man:$MANPATH' >> ~/.bashrc
yeyuntian@yeyuntian-RESCUER-R720-15IKBN:~$ echo 'export INFOPATH=/usr/local/texlive/2018/texmf-dist/doc/info:$INFOPATH' >> ~/.bashrc
yeyuntian@yeyuntian-RESCUER-R720-15IKBN:~$ tail ~/.bashrc
. /usr/share/bash-completion/bash_completion
elif [ -f /etc/bash_completion ]; then
. /etc/bash_completion
fi
fi
export https_proxy='127.0.0.1:8118'
export http_proxy='127.0.0.1:8118'
export PATH=/usr/local/texlive/2018/bin/x86_64-linux:$PATH
export MANPATH=/usr/local/texlive/2018/texmf-dist/doc/man:$MANPATH
export INFOPATH=/usr/local/texlive/2018/texmf-dist/doc/info:$INFOPATH
yeyuntian@yeyuntian-RESCUER-R720-15IKBN:~$ source ~/.bashrc
yeyuntian@yeyuntian-RESCUER-R720-15IKBN:~$ which pdftex
/usr/local/texlive/2018/bin/x86_64-linux/pdftex
至此,Texlive就已经安装完毕了。
配置完成后的验证
由于使用Texlive主要是用于构建多重序列比对,我们就再次进行一次尝试看能不能完成以前的工作。
yeyuntian@yeyuntian-RESCUER-R720-15IKBN:~/Biodata/test$ ll
total 20
drwxrwxr-x 2 yeyuntian yeyuntian 4096 10月 7 23:20 ./
drwxrwxr-x 4 yeyuntian yeyuntian 4096 10月 7 21:38 ../
-rw-rw-r-- 1 yeyuntian yeyuntian 816 10月 7 23:16 latextest.tex # 这个是关于多重序列比对的标注文件
-rw-rw-r-- 1 yeyuntian yeyuntian 1290 10月 7 21:42 maffttest.fa #这个是几个序列的元数据
-rw-rw-r-- 1 yeyuntian yeyuntian 1584 10月 7 21:42 maffttest.fa.aln #这个是经过mafft比对后的文件
yeyuntian@yeyuntian-RESCUER-R720-15IKBN:~/Biodata/test$ cat latextest.tex
\documentclass[15pt,a3paper]{report}
\usepackage{geometry}
\geometry{a4paper,left=0.2cm,right=0.2cm,top=1.5cm,bottom=0.1cm}
\usepackage{texshade}
\begin{document}
\begin{texshade}{/home/yeyuntian/Biodata/test/maffttest.fa.aln}
\shadingmode{T-coffe}
\setends{1}{0..361}
\showruler{1}{top}
\rulersteps{5}
\feature{top}{1}{7..15}{helix[Red]}{Alpha-helix1}
\feature{top}{1}{18..39}{helix[Red]}{Alpha-helix2}
\feature{top}{1}{58..63}{helix[Red]}{Alpha-helix3}
\feature{top}{1}{83..95}{helix[Red]}{Alpha-helix4}
\feature{top}{1}{105..116}{helix[Red]}{Alpha-helix5}
\feature{top}{1}{212..223}{helix[Red]}{Alpha-helix6}
\feature{bottom}{1}{5..47}{box[LimeGreen,LimeGreen]}{B-box domain}
\feature{bottom}{1}{53..97}{box[LimeGreen,LimeGreen]}{B-box domain}
\showsequencelogo{top}
\end{texshade}
\end{document}
这个里面有三个文件,其中 tex 文件可以作为后期的模版进行使用,接下来我们进行编译排版
yeyuntian@yeyuntian-RESCUER-R720-15IKBN:~/Biodata/test$ cat latextest.tex
\documentclass[15pt,a3paper]{report}
\usepackage{geometry}
\geometry{a4paper,left=0.2cm,right=0.2cm,top=1.5cm,bottom=0.1cm}
\usepackage{texshade}
\begin{document}
\begin{texshade}{/home/yeyuntian/Biodata/test/maffttest.fa.aln}
\shadingmode{T-coffe}
\setends{1}{0..361}
\showruler{1}{top}
\rulersteps{5}
\feature{top}{1}{7..15}{helix[Red]}{Alpha-helix1}
\feature{top}{1}{18..39}{helix[Red]}{Alpha-helix2}
\feature{top}{1}{58..63}{helix[Red]}{Alpha-helix3}
\feature{top}{1}{83..95}{helix[Red]}{Alpha-helix4}
\feature{top}{1}{105..116}{helix[Red]}{Alpha-helix5}
\feature{top}{1}{212..223}{helix[Red]}{Alpha-helix6}
\feature{bottom}{1}{5..47}{box[LimeGreen,LimeGreen]}{B-box domain}
\feature{bottom}{1}{53..97}{box[LimeGreen,LimeGreen]}{B-box domain}
\showsequencelogo{top}
\end{texshade}
\end{document}
yeyuntian@yeyuntian-RESCUER-R720-15IKBN:~/Biodata/test$ ll
total 124
drwxrwxr-x 2 yeyuntian yeyuntian 4096 10月 7 23:23 ./
drwxrwxr-x 4 yeyuntian yeyuntian 4096 10月 7 21:38 ../
-rw-rw-r-- 1 yeyuntian yeyuntian 143 10月 7 23:23 latextest.aux
-rw-rw-r-- 1 yeyuntian yeyuntian 11571 10月 7 23:23 latextest.log
-rw-rw-r-- 1 yeyuntian yeyuntian 86143 10月 7 23:23 latextest.pdf
-rw-rw-r-- 1 yeyuntian yeyuntian 816 10月 7 23:16 latextest.tex
-rw-rw-r-- 1 yeyuntian yeyuntian 1290 10月 7 21:42 maffttest.fa
-rw-rw-r-- 1 yeyuntian yeyuntian 1584 10月 7 21:42 maffttest.fa.aln
最后我们需要补充一些关于 TeXlive 在VScode中搭建编写环境
参考:
Visual Studio Code 搭建 LaTeX 编写环境
如何在 VS Code 上编写 LaTeX(附入门指南)