免责声明:网站内容仅供个人学习记录,禁做商业用途,转载请注明出处。

版权所有 © 2017-2020 NEUSNCP个人学习笔记 辽ICP备17017855号-2

VS Code + LaTex workshop 排版

hxy    2019年12月13日 21:45:23

首先在VS的应用商店里搜索 Latex, 安装LaTex language Support 和 Latex workshop插件。  然后点击设置,编辑settings.json, 在末尾添加如下配置:
    "latex-workshop.view.pdf.viewer": "tab",
    // Latex workshop 
    "latex-workshop.latex.recipes": [
        {
            "name": "texify", //放在最前面为默认编译方案, 适用于MikTex
            "tools": [
                "texify"
            ]
        },
        {
            "name": "xelatex",
            "tools": [
                "xelatex"
            ]
        },
        {
            "name": "xe->bib->xe->xe",
            "tools": [
                "xelatex",
                "bibtex",
                "xelatex",
                "xelatex"
            ]
        }
    ],
    "latex-workshop.latex.tools": [
        {
            "name": "texify",
            "command": "texify",
            "args": [
                "--synctex",
                "--pdf",
                "--tex-option=\"-interaction=nonstopmode\"",
                "--tex-option=\"-file-line-error\"",
                "%DOC%.tex"
            ]
        },
        {
            // 编译工具和命令
            "name": "xelatex",
            "command": "xelatex",
            "args": [
                "-synctex=1",
                "-interaction=nonstopmode",
                "-file-line-error",
                "%DOC%"
            ]
        },
        {
            "name": "pdflatex",
            "command": "pdflatex",
            "args": [
                "-synctex=1",
                "-interaction=nonstopmode",
                "-file-line-error",
                "%DOC%"
            ]
        },
        {
            "name": "bibtex",
            "command": "bibtex",
            "args": [
                "%DOCFILE%"
            ]
        }
    ],
    "latex-workshop.latex.autoClean.run": "onBuilt",
    "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",
      ],
    "languageTool.language": "en",
    "editor.wordWrap": "on",
    "editor.renderIndentGuides": false,
    "workbench.colorTheme": "One Monokai",


配置 git 的用户名和密码:
 

git config --global user.name xxx
git config --global user.email xxx@xx.com 

注意:Latex 自动换行需要设置
打开设置,切换json视图,添加如下语句
 
editor.wordWrap: true;


扩展阅读:

LaTeX is a type-setting language. Unlike Microsoft Word, it isn’t a WYSIWYG, it is a markup language where labels in the file define formatting and style. LaTeX is a particular favourite of mathematicians and physicists, because complex equations can be easily and precisely represented. It is based on TeX, from Donald Knuth, and the first version was written by Leslie Lamport in 1985.

A tex file contains the words you want to put in the final output along with some tags to say what kind of text it is, e.g. an equation, title or bullet point. Many publishers offer an sty file containing style information that you just need to put into the same folder as your tex file when you compile. You can compile the tex file to create a beautifully formatted PDF, many LaTeX editors have a single button to do this.

latex example

The text on the left is used to generate the PDF file on the right. Text tags (in red and blue) contain all the instructions for formatting.

Why use LaTeX?

Here are a few reasons authors choose to write in LaTeX:

  • It’s quicker than a word processor if there are lots of equations
  • Formatting takes care of itself
  • References can easily be rendered in different styles (using BibTeX)
  • It’s free and open source
  • LaTeX is a standard software in many disciplines

There are some things that become more difficult with LaTeX, but very few that can’t be overcome:

  • There is a learning curve, but once you’ve mastered a few commands it becomes much easier, and there are lots of online help guides and templates. A good editor will have common functions in menus and icons.
  • Custom formatting can be tricky. Almost anything is possible, but some changes are easier to implement than others.
  • Once you start writing in LaTeX, you can’t easily switch to a word processor: your colleagues also need to use LaTeX, or you can send them a PDF to annotate.

Learning LaTeX

There are many LaTeX tools, website and forums, including for absolute beginners. Here are a few that can help you get started:

  1. https://latex-project.org/guides/
  2. https://www.overleaf.com/tutorial
  3. https://tobi.oetiker.ch/lshort/lshort.pdf


 

最近更新: 2020年2月29日 19:59:36
浏览: 2.1K

[[total]] 条评论

添加评论
  1. [[item.time]]
    [[item.user.username]] [[item.floor]]楼
  2. 点击加载更多……
  3. 添加评论