自从有了它,我终于能完成我的学术论文了

前言

最近在完善一篇学术论文,格式要用到LaTeX,LaTeX比较庞大,只能装在电脑上面,本人经常奔波于宿舍、教室、图书馆和实验室之间,电脑真的很沉。疫情原因必须按照学校规划的路径走,没有代步工具,距离还很远。每次背着电脑跑一趟都要累的休息一会,很影响创作。有时候灵感一来还要打开电脑再记录,可能这个时间灵感都散掉了。今天偶然和朋友抱怨了一下,朋友马上给我推荐了一个方案,就是上次的在线VScose加上LaTeX,这两个完全开源,且搭配起来非常好用,简直神器,那我们接下来赶紧开整吧!

准备

一台已经部署好在线VScode的服务器,具体部署方案可以看我上一篇文章,可以 登录服务器的SSH客户端,这里我采用orcaterm。

话不多说,我们马上开始进行部署阶段,首先我们需要准备一个服务器,这里我选用的是腾讯云的轻量应用服务器,如果你想选用同款,可以点击链接:https://url.cn/eUVMuTlG

部署

登录服务器

登录服务器控制台,选择Centos7.6系统,进行购买或者重装系统。

image-20221002203611794

如何利用自己喜欢的SSH客户端进行登录服务器,这里采用的是腾讯云新开发的WebShell——orcaterm

image-20221002212415506

安装TeXLive

下载镜像文件

wget https://mirrors.tuna.tsinghua.edu.cn/CTAN/systems/texlive/Images/texlive2022-20220321.iso

image-20221006200117203

挂载iso文件

进入下载的iso文件所在目录

挂载

sudo mount -o loop texlive2021-20210325.iso /mnt
image-20221006200627095

安装

切入/mnt目录(也就是之前挂载iso的目录)

cd /mnt

开始安装texlive

sudo ./install-tl

image-20221006200709511

有提示的时候输入I后回车即可。

这一步会比较费时,请耐心等待。

image-20221006200730496

安装完成标志

image-20221006203147236

配置环境变量

进入.bashrc

vi ~/.bashrc

在最后一行开始输入以下内容

Texlive 说明:这一行是说明给texlive配置环境变量的,不是必须的

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

卸载iso文件

sudo umount /mnt

支持中文,需要安装中文包

sudo apt-get install texlive-lang-chinese

如果报错,记得升级依赖包

sudo apt-get install update

使用更多的字体和软件包

sudo apt-get install texlive-latex-base texlive-latex-extra texlive-latex-recommended texlive-fonts-recommended

安装XeLaTex

sudo apt-get install texlive-xetex

对接VScode

安装LaTeX Workshop插件

image-20221006205713074

进入json设置

image-20221006205830759

输入下面的配置json

{
    "settingsSync.ignoredSettings": [
        "vslilypond.general.pathToLilypond"
    ],
    
    "latex-workshop.latex.autoBuild.run": "never",
    "latex-workshop.showContextMenu": true,
    "latex-workshop.intellisense.package.enabled": true,
    "latex-workshop.message.error.show": false,
    "latex-workshop.message.warning.show": false,
    "latex-workshop.latex.tools": [
        {
            "name": "lualatex",
            "command": "lualatex",
            "args": [
                "-synctex=1",
                "-interaction=nonstopmode",
                "-file-line-error",
                "-shell-escape", //这个命令行在网上的Latex Workshop设置里一般没有,所以直接recipe会报错
                "%DOCFILE%"
            ]
        },
        {
            "name": "xelatex",
            "command": "xelatex",
            "args": [
                "-synctex=1",
                "-interaction=nonstopmode",
                "-file-line-error",
                "%DOCFILE%"
            ]
        },
        {
            "name": "bibtex",
            "command": "bibtex",
            "args": [
                "%DOCFILE%"
            ]
        }
    ],
       "latex-workshop.latex.recipes": [
        {
            "name": "LuaLaTeX",
            "tools": [
                "lualatex"
            ]
        },
        {
            "name": "XeLaTeX",
            "tools": [
                "xelatex"
            ]
        },
        {
            "name": "xelatex -> bibtex -> xelatex*2",
            "tools": [
                "xelatex",
                "bibtex",
                "xelatex",
                "xelatex"
            ]
        },
        {
            "name": "BibTeX",
            "tools": [
                "bibtex"
            ]
        },
        {
            "name": "lualatex -> bibtex -> lualatex*2",
            "tools": [
                "lualatex",
                "bibtex",
                "lualatex",
                "lualatex"
            ]
        },
    ],
  "latex-workshop.latex.clean.fileTypes": [
        "*.aux",
        "*.bbl",
        "*.blg",
        "*.idx",
        "*.ind",
        "*.lof",
        "*.lot",
        "*.out",
        "*.toc",
        "*.acn",
        "*.acr",
        "*.alg",
        "*.glg",
        "*.glo",
        "*.gls",
        "*.ist",
        "*.fls",
        "*.log",
        "*.fdb_latexmk"
    ],
        "latex-workshop.latex.autoClean.run": "onFailed",
        "latex-workshop.latex.recipe.default": "lastUsed",
        "latex-workshop.view.pdf.internal.synctex.keybinding": "double-click",
        "latex-workshop.view.pdf.external.viewer.command": "C:\\\\Program Files (x86)\\\\Adobe\\\\Acrobat DC\\\\Acrobat\\\\Acrobat.exe",
        //双引号里是pdf浏览器的执行文件,可以根据实际情况更换
        "latex-workshop.view.pdf.viewer": "tab",
        "workbench.editorAssociations": {
            "*.pdf": "lilypond.pdf.preview"
        },
        "editor.maxTokenizationLineLength": 99999,
        "jupyter.interactiveWindowMode": "perFile",
        "lilypondFormatter.general.reformatTimeout": 100000,
        "git.confirmSync": false,
        "jupyter.askForKernelRestart": false,
        "vslilypond.general.pathToLilypond": "/usr/local/Cellar/lilypond/2.22.2/bin/lilypond",
        "git.ignoreLegacyWarning": true,
        "explorer.confirmDelete": false,
        "latex-workshop.intellisense.biblatexJSON.replace": {
            

        
        },
        "PandocCiter.DefaultBib": "/Users/xhhdd/Documents/test.bib",
        "editor.inlineSuggest.enabled": true,
        "security.workspace.trust.untrustedFiles": "open",
        "python.defaultInterpreterPath": "C:\\\\Users\\\\cqtwx\\\\AppData\\\\Local\\\\Programs\\\\Python\\\\Python39\\\\python.exe"
}

接下来就能创建tex后缀文件愉快的玩耍啦

另外:

特惠续费:

老用户专属续费折扣,1年?1.5年?2年?用得越久,折扣越6,低至0.5折,dddd,速来。

活动链接:https://qmoe.me/lhtw

新老同享新购:

两周年新购福利,诚意而来:

1、新购Lighthouse低至5.5折,境内境外多地域享受优惠;

2、轻量数据盘低至 99 元/年,全场 0.95 折起;

活动链接:https://qmoe.me/3Mn1

本站文章资源均来源自网络,除非特别声明,否则均不代表站方观点,并仅供查阅,不作为任何参考依据!
如有侵权请及时跟我们联系,本站将及时删除!
如遇版权问题,请查看 本站版权声明
THE END
分享
二维码
海报
自从有了它,我终于能完成我的学术论文了
最近在完善一篇学术论文,格式要用到LaTeX,LaTeX比较庞大,只能装在电脑上面,本人经常奔波于宿舍、教室、图书馆和实验室之间,电脑真的很沉。疫情原因必须按照...
<<上一篇
下一篇>>