Deepin下安装搭建latex编写环境

一、引言

  作为一名学生,经常需要写学术论文,那么可选的有Latex和MS office。但是大家知道在linux上没办法用office。而linux上的wps对公式支持不太行。因此,学会用Latex来写论文比较好。在这里,博主就用texlive2020+TexStudio来为Deepin系统搭配latex编写环境。

二、下载链接

  【texlive2020】链接: https://mirrors.tuna.tsinghua.edu.cn/CTAN/systems/texlive/Images/

  【TexStudio】在深度商店里面有,自行下载安装即可。

三、安装texlive2020

  1.  首先确定自己的iso文件放在哪。比如博主的就放在/home/qling/Downloads这个位置(qling是博主的电脑用户名)。记住这个地址

  2. 使用图形化安装界面,安装perl-tk:

sudo apt-get install perl-tk

   3. 挂载texlive2020.iso安装文件,并安装,命令如下:

sudo mount -o loop ‘/home/qling/Downloads/texlive2017.iso’ /mnt  //红色部分要改为你们自己的文件位置
cd /mnt
sudo ./install-tl -gui

  接着会出现安装界面,直接点安装即可。

  3. 安装完了后,卸载镜像文件:

cd /
sudo umount /mnt

   4. 字体配置:

sudo cp /usr/local/texlive/2020/texmf-var/fonts/conf/texlive-fontconfig.conf /etc/fonts/conf.d/09-texlive.conf
sudo fc-cache -fsv

  5. 接着搭配环境变量。在 ~/.bashrc 和 ~/.profile 中最后一行均添加如下代码:

export MANPATH=${MANPATH}:/usr/local/texlive/2019/texmf-dist/doc/man 
export INFOPATH=${INFOPATH}:/usr/local/texlive/2019/texmf-dist/doc/info
export PATH=${PATH}:/usr/local/texlive/2019/bin/x86_64-linux

  完成后更新下配置,打开新的终端,输入:

source ~/.bashrc 
source ~/.profile

  6. 全局变量配置 /etc/manpath.config 下添加:

MANPATH_MAP /usr/local/texlive/2020/bin/x86_64-linux /usr/local/texlive/2020/texmf-dist/doc/man

   7. 测试是否成功

tex --version

  若出现下面即成功:

TeX 3.14159265 (TeX Live 2020)
kpathsea version 6.3.2
Copyright 2020 D.E. Knuth.
There is NO warranty.  Redistribution of this software is
covered by the terms of both the TeX copyright and
the Lesser GNU General Public License.
For more information about these matters, see the file
named COPYING and the TeX source.
Primary author of TeX: D.E. Knuth.

四、安装TexStudio

  在深度商店里面即可以找到TexStudio,点击安装便可。

五、配置TexStudio

  依次打开Option - Configure - Commands,把Xelatex的路径选为/usr/local/texlive/2020/bin/x86_64-linux/xelatex即可。build的方式根据用户喜好选择,默认是pdflatex,笔者遇到的都是需要用Xelatex的,因此需要改一下。

六、关于微软字体的安装。

  执行以下命令:

sudo apt install ttf-mscorefonts-installer # 安装
sudo fc-cache # 生效

  检查是否成功:

fc-match Arial # 查看Arial
fc-match Times # 查看Times New Roman

  大功高成,现在应该可以在TexStudio里面写Latex了。

原文地址:https://www.cnblogs.com/Qling/p/9534805.html