- 下载vscode,并安装插件latex workshop,插件安装位置在左边第五个按钮
- 下载miktex,根据指导安装即可
- 在vscode设置中的用户设置中添加内容
(点击界面左下角的齿轮 -> 点击settings -> 进入user settings)
"latex-workshop.latex.magic.args": [
"-shell-escape",
"-synctex=1",
"-interaction=nonstopmode",
"-file-line-error",
"%DOC%"
],
- 创建一个.tex文件,输入以下代码,注意要加第一句代码,表示使用魔法注释 ( Magic Comment ) 设置 tex 编译命令,然后直接保存即可生成pdf文件,可以在右边进行pdf文件的预览(点击右上角的pdf preview)
%!TEX program = xelatex
% 使用 ctexart 文类,UTF-8 编码
\documentclass[UTF8]{ctexart}
\title{文章标题}
\author{Siwind}
\date{\today}
\begin{document}
\maketitle
This is the context of the article.
这就是文章的所有内容
\end{document}
