latlex 环境

latlex 环境

  1. 下载与安装texlive
    TeX套装下载
    TeX Live — 由国际TeX 用户组织 TUG 开发,支持不同的操作系统平台。
    MiKTeX — Windows 系统下的 TeX 系统。
    MacTeX — Mac OS 系统下的 TeX 系统。
    以上套装只需安装一个即可,严禁不同套装或不同版本混用。
  2. 安装 编辑器
    常用的编辑有如下:

TeX专用的:
TeXworks -常见的 TeX 套装都自带这款编辑器,界面比较清爽,支持代码和 pdf 查看,左右分屏显示。
TeXStudio 开源免费的编辑器,界面集成度好。其源于:TeXmaker - 开源免费的编辑器。
TeXShop (Mac 版) - MacTeX 自带的编辑器,界面比较简洁,与 TeXworks 功能接近。
TeXPad (Mac 版) - Mac OS 平台下的收费编辑器
非TeX专用的:
WinEdt - 收费软件,对初学者界面友好。
VScode 这个最好用的文本编辑器
3. 安装 VSCode 及TeX插件
装上微软的 VScode后,然后在其插件市场(左下角齿轮中Extension)里搜索 latex,找到 LaTeX Workshop!点击 install,装上即可!

  1. 配置 VSCode 的 settings.json
    打开 VSCode 默认配置文件:Ctrl + Shift + P,输入 default settings.json,
    比较如下内容,缺少的复制到 settings.json 文件中
    // ======================== LaTeX 设置 BEGIN ========================
    // bibtex 格式
    “latex-workshop.bibtex-format.tab”: “tab”,

     // 自动编译,全部关闭,当且仅当你认为有需要的时候才会去做编译
     "latex-workshop.latex.autoBuild.run": "never",
     "latex-workshop.latex.autoBuild.cleanAndRetry.enabled": false,
    
     // 设置 latex-workshop 的 PDF 预览程序,external 指的是外部程序
     "latex-workshop.view.pdf.viewer": "external",
     "latex-workshop.view.pdf.ref.viewer": "external",
     "latex-workshop.view.pdf.external.viewer.command": "D:/Users/newton/Documents/Softwares/software_windows/design/SumatraPDF-3.2-64.exe",
     "latex-workshop.view.pdf.external.viewer.args": [
         "%PDF%"
     ],
    
     // 配置正向、反向搜索:.tex -> .pdf
     "latex-workshop.view.pdf.external.synctex.command": "D:/Users/newton/Documents/Softwares/software_windows/design/SumatraPDF-3.2-64.exe",
     "latex-workshop.view.pdf.external.synctex.args": [
         // 正向搜索
         "-forward-search",
         "%TEX%",
         "%LINE%",
         "-reuse-instance",
         // 反向搜索
         "-inverse-search",
         "\"C:/Program Files/Microsoft VS Code/Code.exe\" \"C:/Program Files/Microsoft VS Code/resources/app/out/cli.js\" -gr %f:%l",
         "%PDF%"
     ],
    
     // 这是一些独立的编译选项,可以作为工具被编译方案调用
     "latex-workshop.latex.tools": [
         {
             // Windows 原生安装 TeX Live 2020 的编译选项
             "name": "Windows XeLaTeX",
             "command": "xelatex",
             "args": [
                 "-synctex=1",
                 "-interaction=nonstopmode",
                 "-file-line-error",
                 "-pdf",
                 "%DOCFILE%"
             ]
         },
         {
             // Windows Biber 编译
             "name": "Windows Biber",
             "command": "biber",
             "args": [
                 "%DOCFILE%"
             ]
         },
         {
             // WSL XeLaTeX 编译一般的含有中文字符的文档
             "name": "WSL XeLaTeX",
             "command": "wsl",
             "args": [
                 "/usr/local/texlive/2020/bin/x86_64-linux/xelatex",
                 "-synctex=1",
                 "-interaction=nonstopmode",
                 "-file-line-error",
                 "-pdf",
                 //"-output-directory=%OUTDIR%",
                 //"-aux-directory=%OUTDIR%",
                 "%DOCFILE%"
             ]
         },
         {
             // WSL biber / bibtex 编译带有 citation 标记项目的文档
             "name": "WSL Biber",
             "command": "wsl",
             "args": [
                 "/usr/local/texlive/2020/bin/x86_64-linux/biber",
                 "%DOCFILE%"
             ]
         },
         {
             // macOS 或者 Linux 的简单编译
             // 两种操作系统的操作方式相同
             "name": "macOS / Linux XeLaTeX",
             "commmand": "xelatex",
             "args": [
                 "-synctex=1",
                 "-interaction=nonstopmode",
                 "-file-line-error",
                 "-pdf",
                 "%DOCFILE%"
             ]
         },
         {
             // macOS 或者 Linux 的索引编译
             // 两种操作系统的操作方式相同
             "name": "macOS / Linux Biber",
             "command": "biber",
             "args": [
                 "%DOCFILE%"
             ]
         }
     ],
    
     // 这是一些编译方案,会出现在 GUI 菜单里
     "latex-workshop.latex.recipes": [
         {
             // 1.1 Windows 编译简单的小文档,这个选项不太常用,因为绝大多数文章都需要有参考文献索引
             "name": "Windows XeLaTeX 简单编译",
             "tools": [
                 "Windows XeLaTeX"
             ]
         },
         {
             // 1.2 Windows 编译带有索引的论文,需要进行四次编译;-> 符号只是一种标记而已,没有程序上的意义
             "name": "Windows xe->bib->xe->xe 复杂编译",
             "tools": [
                 "Windows XeLaTeX",
                 "Windows Biber",
                 "Windows XeLaTeX",
                 "Windows XeLaTeX"
             ]
         },
         {
             // 2.1  WSL 编译简单的小文档,这个选项不太常用,因为我绝大多数文章都需要有引用。
             "name": "XeLaTeX 简单编译",
             "tools": [
                 "WSL XeLaTeX"
             ]
         },
         {
             // 2.2 带有 citation 索引的文档,需要进行四次编译;-> 符号只是一种标记而已,没有程序上的意义
             "name": "xe->bib->xe->xe 复杂编译",
             "tools": [
                 "WSL XeLaTeX",
                 "WSL Biber",
                 "WSL XeLaTeX",
                 "WSL XeLaTeX"
             ]
         },
         {
             // 3.1 macOS 简单 小文档
             "name": "macOS XeLaTeX 简单编译",
             "tools": [
                 "macOS XeLaTeX"
             ]
         },
         {
             // 3.2 macOS 四次编译
             "name": "macOS xe->bib->xe->xe 复杂编译",
             "tools": [
                 "macOS / Linux XeLaTeX",
                 "macOS / Linux Biber",
                 "macOS / Linux XeLaTeX",
                 "macOS / Linux XeLaTeX"
             ]
         }
     ],
    
     // 清空中间文件
     "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",
         "*.bcf",
         "*.run.xml",
         "*.synctex.gz"
     ],
    

    // ======================== LaTeX 设置 END ========================

  • 0
    点赞
  • 0
    收藏
    觉得还不错? 一键收藏
  • 0
    评论
评论
添加红包

请填写红包祝福语或标题

红包个数最小为10个

红包金额最低5元

当前余额3.43前往充值 >
需支付:10.00
成就一亿技术人!
领取后你会自动成为博主和红包主的粉丝 规则
hope_wisdom
发出的红包
实付
使用余额支付
点击重新获取
扫码支付
钱包余额 0

抵扣说明:

1.余额是钱包充值的虚拟货币,按照1:1的比例进行支付金额的抵扣。
2.余额无法直接购买下载,可以购买VIP、付费专栏及课程。

余额充值