LaTeX环境配置
这里是Arch Linux,因为Arch kiss KISS,所以要下好多包。
因为要使用中文,所以我选择了luatex,xelatex可能字体方面稍微差一点。
下边是我安装的包
sudo pacman -S texlive-basic texlive-bin texlive-binextra texlive-fontsextra texlive-fontsrecommended texlive-fontutils texlive-langchinese texlive-langcjk texlive-langjapanese texlive-latex texlive-latexrecommended texlive-luatex texlive-pictures
其中texlive-langjapanese是因为luatex编译时需要luatexjp.sty
当编译出错时上网查或者可以直接去archlinux仓库搜缺少的文件,就能找到是在哪个包里。
在vscode下载插件James-Yu.latex-workshop,然后点击选中build里的luatex之后运行就自动使用luatex了。
在.tex文件里使用luatex的包就可以设置中文字体了。
\usepackage{luatexja}
\usepackage{luatexja-fontspec}
\setmainjfont{Noto Serif CJK SC}
\setmainfont{Times New Roman}