CTeX-org / ctex-kit

Macro Packages and Scripts for Chinese TeX users
966 stars 124 forks source link

ctexart + XeLaTeX下,使用 ulem 宏包的 \uline 命令下划线中文无法正常换行。 #647

Closed tn-072 closed 1 year ago

tn-072 commented 1 year ago

环境

可复现问题的代码

\documentclass{ctexart}
\usepackage{ulem}

\begin{document}
    \uline{Hello World. Hello World. Hello World. Hello World. Hello World. Hello World. Hello World. Hello World. Hello World. Hello World.}

    \uline{你好,世界。你好,世界。你好,世界。你好,世界。你好,世界。你好,世界。你好,世界。你好,世界。你好,世界。你好,世界。}

    \uline{你好,世界。
    你好,世界。
    你好,世界。
    你好,世界。
    你好,世界。
    你好,世界。
    你好,世界。
    你好,世界。
    你好,世界。
    你好,世界。}
\end{document}

描述

根据 lshort-zh 的说明

\underline 命令生成下划线的样式不够灵活,不同的单词可能生成高低各异的下划线,并且无法换行。ulem 宏包提供了更灵活的解决方案,它提供的 \uline 命令能够轻松生成自动换行的下划线

因为我要在文章中使用下划线,所以我使用了 ulem 宏包。使用了 ulem 后:发现英文加下划线可以正常换行;而中文无法正常换行,两个案例均会出现中文突破版芯导致 “Overfull \hbox”。

stone-zeng commented 1 year ago

请用 xeCJKfntef 宏包提供的 \CJKunderline 命令。