Closed XiangyunHuang closed 10 months ago
I doubt that it will ever work. The problem is not the Chinese in itself but all the additional code that ctex inserts (boxes and font hooks and more) and which confuses the soul package. Without ctex it more or less works, if one set the font correctly:
\documentclass{article}
%\usepackage[fontset=fandol]{ctex}
\usepackage{soul}
\usepackage{fontspec}
\setmainfont{FandolSong-Regular.otf}
\setmonofont{FandolSong-Regular.otf}
\makeatletter
\setbox\z@\hbox{\ttfamily\global\let\SOUL@tt\ttfamily}
\setbox\z@\hbox{\SOUL@tt-}
\SOUL@ttwidth\wd\z@
\makeatother
\begin{document}
\st{中文} % Here are two CJK characters
\end{document}
I would suggest to use lualatex and the lua-ul package instead. That is much less fragile:
\documentclass{article}
\usepackage[fontset=fandol]{ctex}
\usepackage[soul]{lua-ul}
\begin{document}
\st{中文} % Here are two CJK characters
\end{document}
There is also the xeCJKfntef
package for xelatex, documented in xeCJK
Thank you for letting me know more and deeper about soul.
Do you have any plan to support Chinese?
When I try to compile using XeLaTeX, an error happens as follow:
! Package soul Error: Reconstruction failed.