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

使用AutoFakeBold但中文复制乱码的解决方法 #24

Open
wangyifantech opened this issue Feb 25, 2021 · 0 comments
Open

使用AutoFakeBold但中文复制乱码的解决方法 #24

wangyifantech opened this issue Feb 25, 2021 · 0 comments

Comments

@wangyifantech
Copy link

编译环境

操作系统为Linux (本地ShareLaTex系统),TeX发行版为TeX Live 2017

描述问题

在使用服务器上自行搭建的ShareLeTex系统编译本模板时,发现无法实现楷体加粗,在参考GitatHub/iNSFC分支,对insfc.sty文件进行如下修改后,可以实现楷体加粗效果,但是此时生成的pdf文件中,所有的楷体中文会出现复制乱码的问题,进而导致了文本无法进行内容搜索。

% \setlength{\parskip}{0.5\baselineskip}

 \let\kaishu\relax % 清除旧定义
 \newCJKfontfamily\kaishu{KaiTi}[AutoFakeBold] % 重定义 \kaishu

% xcolor command		 % xcolor command

在网上搜索解决方案时,发现这个好像是TeX Live 2019之前版本一个长久的问题,即使用系统KaiTi字体时,若使用AutoFakeBold则楷体中文会出现复制乱码。

解决方案

在本地安装AdobeKaitiStd-Regular.otf字体,将\newCJKfontfamily\kaishu{KaiTi}[AutoFakeBold]中的KaiTi更换成AdobeKaitiStd-Regular即可同时兼容楷体字体加粗和中文正常复制了。

在本地ShareLaTex系统中添加字体的方法可以参考这篇文章:Overleaf以及sharelatex如何安装各种字库

备注

原则上,直接在项目目录添加AdobeKaitiStd-Regular.otf文件应该也可以解决字体的问题,不需要去安装字体,不过在这个模板中我没有找到对应的解决方案,还需要再研究一下。希望上述的方案可以帮助到大家。

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

No branches or pull requests

1 participant