在官网下载镜像当然可以,但是速度就太慢了,这里推荐清华源:
https://mirrors.tuna.tsinghua.edu.cn/CTAN/systems/texlive/Images/
进入网页后点击texlive2019.iso进行下载,大概是3.3G
镜像下载完成后,首先为了图形化界面安装要执行命令:
sudo apt-get install perl-tk
然后加载镜像文件:
sudo mount -o loop texlive2019.iso /mnt 或者 sudo mount texlive2019.iso /mnt
然后启动图形界面安装:
cd /mnt
sudo ./install-tl -gui
根据提示一路安装就可以了,最后安装完成会出现提示添加环境变量
根据要求添加环境变量
sudo gedit ~/.bashrc
文件最后按照安装界面提示添加相应环境变量:
export PATH=/usr/local/texlive/2019/bin/x86_64-linux:$PATH
export MANPATH=/usr/local/texlive/2019/texmf-dist/doc/man:$MANPATH
export INFOPATH=/usr/local/texlive/2019/texmf-dist/doc/info:$INFOPATH
最后卸载镜像文件
sudo umount /mnt
在VScode的Extensions中搜索下载LaTex language support, LaTex Workshop插件
然后点左下角的齿轮进入setting中并搜索latex-workshop.latex.recipes,填入下列代码:
"latex-workshop.latex.recipes": [
{
"name": "xelatex",
"tools": [
"xelatex"
]
},
{
"name": "xelatex->bibtex->exlatex*2",
"tools": [
"xelatex",
"bibtex",
"xelatex",
"xelatex"
]
}],
"latex-workshop.latex.tools":[
{
"name":"xelatex",
"command": "xelatex",
"args": [
"-synctex=1",
"-interaction=nonstopmode",
"-file-line-error",
"%DOC%"
]
}, {
"name":"bibtex",
"command": "bibtex",
"args": [
"%DOCFILE%"
]
}
],
ctrl+s保存之后,重启VScode即可
创建一个test.tex文件,输入以下内容:
\documentclass[UTF8]{ctexart}
\title{文章标题}
\author{Songze He}
\date{\today}
\begin{document}
\maketitle
Hello! 你成功啦!
\end{document}
ctrl+s保存完成编译,即可在左侧的LaTex命令界面查看pdf
参考资料
https://blog.csdn.net/qq_36265860/article/details/82972402
https://blog.csdn.net/ddydavie/article/details/83020615
https://blog.csdn.net/engreal/article/details/80704755