Skip to content

Instantly share code, notes, and snippets.

@elegracer
Created December 16, 2019 04:04
Show Gist options
  • Save elegracer/47845cc8abebf19ecd9499355a07ecf6 to your computer and use it in GitHub Desktop.
Save elegracer/47845cc8abebf19ecd9499355a07ecf6 to your computer and use it in GitHub Desktop.
最简单的能用中文的.tex文件,用xetex编译
\documentclass{article}
\usepackage{xeCJK}
\setCJKmainfont{STSong}
\begin{document}
hello 中文
\end{document}
@elegracer
Copy link
Author

vscode下需要配合latex workshop和下面的设置使用:

{
    "latex-workshop.view.pdf.viewer": "tab",
    "latex-workshop.latex.recipes": [
        {
            "name": "xelatex",
            "tools": [
                "xelatex"
            ]
        },
        {
            "name": "pdflatex -> bibtex -> pdflatex*2",
            "tools": [
                "pdflatex",
                "bibtex",
                "pdflatex",
                "pdflatex"
            ]
        },
        {
            "name": "xelatex -> bibtex -> xelatex*2",
            "tools": [
                "xelatex",
                "bibtex",
                "xelatex",
                "xelatex"
            ]
        }
    ],
    "latex-workshop.latex.tools": [
        {
            "name": "xelatex",
            "command": "xelatex",
            "args": [
                "-synctex=1",
                "-interaction=nonstopmode",
                "-file-line-error",
                "-output-directory=%OUTDIR%",
                "%DOC%"
            ]
        },
        {
            "name": "latexmk",
            "command": "latexmk",
            "args": [
                "-synctex=1",
                "-interaction=nonstopmode",
                "-file-line-error",
                "-output-directory=%OUTDIR%",
                "%DOC%"
            ]
        },
        {
            "name": "pdflatex",
            "command": "pdflatex",
            "args": [
                "-synctex=1",
                "-interaction=nonstopmode",
                "-file-line-error",
                "-output-directory=%OUTDIR%",
                "%DOC%"
            ]
        },
        {
            "name": "bibtex",
            "command": "bibtex",
            "args": [
                "%OUTDIR%/%DOCFILE%"
            ]
        }
    ]
}

@elegracer
Copy link
Author

或者直接用XeLaTeX编译

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment