Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

在WSL下使用Windows平台的字体输出PDF的方法 #71

Open
ilcpm opened this issue Nov 26, 2022 · 1 comment
Open

在WSL下使用Windows平台的字体输出PDF的方法 #71

ilcpm opened this issue Nov 26, 2022 · 1 comment

Comments

@ilcpm
Copy link
Contributor

ilcpm commented Nov 26, 2022

开个贴记录一下

WSL下ctex默认使用fandol字体编译,得到的PDF为fandol字体,和Windows平台的编译结果有肉眼可见的差异
上:Windows平台下得到的PDF文件,下:WSL默认情况下得到的PDF文件 (WSL下的字体更粗,正文的逗号看起来很奇怪)
image
image

具体操作步骤为:

  1. 百度“WSL Windows字体”相关内容,把Windows的字体映射到WSL
  2. 修改cquthesis.dtx第899行和901行,添加参数fontset=none,屏蔽掉ctex自动的系统平台检测
    image
  3. 运行命令latex cquthesis.ins刷新模板
  4. 在main.tex的导言区新增设定\ctexset{fontset=windows}
    image

而后即可正常编译得到以Windows字体输出的PDF文件;如需继续使用fandol字体,修改上述fontset=后的参数即可

使用WSL+Windows字体的编译时间:
image

使用WSL+默认字体的编译时间:
image

使用Windows平台的编译时间:
image

也就是说,在Windows平台下使用WSL虚拟机的编译时间仅为直接使用Windows的编译时间的一半

@nanmu42
Copy link
Owner

nanmu42 commented Nov 27, 2022

厉害了。

感谢你的贡献。

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

No branches or pull requests

2 participants