Latex-vscode settings

using latex in mac and win

windows10

  • 安装vscode
  • 安装ctex
  • 添加你安装的ctex的路径到windows的环境变量中
  • user settings如下

    1
    2
    3
    4
    5
    6
    7
    8
    9
    10
    11
    12
    13
    14
    15
    16
    17
    18
    19
    20
    21
    22
    23
    24
    25
    26
    27
    28
    29
    30
    31
    32
    33
    34
    35
    36
    37
    38
    39
    40
    41
    42
    43
    44
    45
    46
    47
    48
    49
    50
    51
    52
    53
    54
    55
    56
    57
    58
    59
    60
    61
    62
    63
    64
    65
    66
    67
    68
    69
    70
    71
    72
    73
    "latex-workshop.latex.tools": [
    {
    "name": "latexmk",
    "command": "latexmk",
    "args": [
    "-synctex=1",
    "-interaction=nonstopmode",
    "-file-line-error",
    "-pdf",
    "%DOC%"
    ]
    },
    {
    "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.recipes": [
    {
    "name": "xelatex",
    "tools": [
    "xelatex"
    ]
    },
    {
    "name": "pdflatex",
    "tools": [
    "pdflatex"
    ]
    },
    {
    "name": "latexmk",
    "tools": [
    "latexmk"
    ]
    },
    {
    "name": "pdflatex -> bibtex -> pdflatex*2",
    "tools": [
    "pdflatex",
    "bibtex",
    "pdflatex",
    "pdflatex"
    ]
    }
    ],
    "files.associations": {
    "*.tex": "latex"
    },
    "latex-workshop.latex.clean.onFailBuild.enabled": true,
  • 支持中文

    1
    2
    3
    4
    5
    6
    7
    8
    9
    10
    11
    12
    13
    %-- coding: UTF-8 --

    \documentclass[12pt]{article}
    \usepackage[UTF8]{ctex}

    \title{模板}
    \author{Kevin}
    \date{2008/10/12}
    \begin{document}
    \maketitle
    \tableofcontents
    hello world
    \end{document}

Mac os

  • 安装vscode
  • 安装mactex
  • user settings

    1
    2
    3
    4
    5
    6
    7
    8
    9
    10
    11
    12
    13
    14
    15
    16
    17
    18
    19
    20
    21
    22
    23
    24
    25
    26
    27
    28
    29
    30
    31
    32
    33
    34
    35
    36
    37
    38
    39
    40
    41
    42
    43
    44
    45
    46
    47
    48
    49
    50
    51
    52
    53
    54
    55
    56
    57
    58
    59
    60
    61
    62
    63
    64
    65
    66
    67
    68
    69
    70
    71
    72
    73
    "latex-workshop.latex.tools": [
    {
    "name": "latexmk",
    "command": "latexmk",
    "args": [
    "-synctex=1",
    "-interaction=nonstopmode",
    "-file-line-error",
    "-pdf",
    "%DOC%"
    ]
    },
    {
    "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.recipes": [
    {
    "name": "xelatex",
    "tools": [
    "xelatex"
    ]
    },
    {
    "name": "pdflatex",
    "tools": [
    "pdflatex"
    ]
    },
    {
    "name": "latexmk",
    "tools": [
    "latexmk"
    ]
    },
    {
    "name": "pdflatex -> bibtex -> pdflatex*2",
    "tools": [
    "pdflatex",
    "bibtex",
    "pdflatex",
    "pdflatex"
    ]
    }
    ],
    "files.associations": {
    "*.tex": "latex"
    },
    "latex-workshop.latex.clean.onFailBuild.enabled": true,
  • 支持中文

    1
    2
    3
    4
    5
    6
    7
    8
    9
    10
    11
    12
    13
    %!TEX program = pdflatex
    \documentclass{article}

    \usepackage{CJKutf8}
    \usepackage{color}

    \begin{document}
    \begin{CJK}{UTF8}{bsmi}

    hello world

    \end{CJK}
    \end{document}
Donate comment here