Hansen's ink

Back

一、检查TEX#

通过命令: tex -version  来检查当前用户目录下TexLive是否可用

(base) [wanghh@platform_fat01 tex_test]$ tex -version
TeX 3.141592653 (TeX Live 2025)
kpathsea version 6.4.1
Copyright 2025 D.E. Knuth.
There is NO warranty.  Redistribution of this software is
covered by the terms of both the TeX copyright and
the Lesser GNU General Public License.
For more information about these matters, see the file
named COPYING and the TeX source.
Primary author of TeX: D.E. Knuth.
sh

or 检查软件路径是否有效

(base) [wanghh@platform_fat01 tex_test]$ which tex
/usr/local/texlive/2025/bin/x86_64-linux/tex
sh

二、VSCode安装 Latex Workshop插件#

插件存放地址为 /home/wanghh/Public/vsx 插件安装后重启VSCode,随后新建并打开一个.tex文件,latex插件即可在左侧栏出现。插件使用比较简单,可自行尝试。

使用插件编辑latex前,需要配置一下VSCode的环境,打开setting.json后,添加下列配置即可:

以上个人配置也可自行更改。

编译选项以XeLaTeX为主(其针对中文支持较好)

三、中文字体使用说明#

XeLaTeX本身对于中文的支持较为友好,其次TEX自带了一些中文字体。 通过 fc-list :lang=zh命令可以查看当前已安装的中文字体 image.png

其中/usr/local/texlive/2025/texmf-dist/fonts/路径下为TEX自带的字体, /usr/share/fonts/custom/路径下为我们安装的字体 主要包括以下几类:

% Noto Serif CJK SC
% Source Han Serif SC
% AR PL KaitiM GB
% Source Han Sans SC
plaintext

具体字体细分(黑体、粗体、细体等)可根据需求修改。

VSCode 配置 TeX/LaTeX 开发环境
https://astro-pure.js.org/blog/tex-vscode
Author Hansen W.
Published at March 27, 2025
Comment seems to stuck. Try to refresh?✨