Ubuntu中texlive编译win字体报错

因为ctex会自动检测系统,在linux下默认调用fandol字体,没有隶书、雅黑和幼圆等字体,因此在写LaTeX源码时需要注意

如下图所示,在用到Windows中的字体时会显示以下错误

解决方案:

前面说过新版本的ctex宏包会自动检测操作系统,因此显示声明使用Windows字体就可以了

\documentclass[fontset=windows]{ctexart}

%!TEX program = xelatex  
\documentclass[fontset=windows]{ctexart}
\begin{document}
\songti
中文测试。\\
\kaishu
中文测试。\\
\fangsong
中文测试。\\
\youyuan
中文测试。\\
\heiti
中文测试。\\
\lishu
中文测试。\\
\yahei
中文测试。\\
\end{document}

附上效果图


猜你喜欢

转载自blog.csdn.net/iversonx/article/details/80314176