stone-zeng / fduthesis

LaTeX thesis template for Fudan University
LaTeX Project Public License v1.3c
829 stars 208 forks source link

soul包与模板冲突,无法使用 #318

Closed Earthwater closed 8 months ago

Earthwater commented 8 months ago

本身出于的目的是想使用soul包的\hl命令,来实现对段落内特定文字的凸显。

使用的模板就是overleaf默认模板,但是提示package soul error: construction failed

image

网上搜到的一些原因暂时未能解决,平替的方案尝试了\colorbox但是不支持自动换行,\tcolorbox等是画了个框加背景色然后文字放入其中的效果,并不是原本的需求,麻烦大佬帮忙瞅瞅,万分感谢!

note286 commented 8 months ago

请尝试xeCJKfntef包。

Earthwater commented 8 months ago

请尝试xeCJKfntef包。

请教一下大佬,我试了一下但是LLM提示xeCJKfntef包下能够给文字添加背景色的是\colorbox命令,但是这个命令并不支持文字换行,会使得加了背景色的文字直接超出页面宽度,相应这个包下其他命令也搜索了一下,但是没有找到合适的,不知道大佬是否方便分享一下

\colorbox不支持换行的效果如下:

image
note286 commented 8 months ago

请去看官方手册,Ctrl+F CJKsout

note286 commented 8 months ago

http://mirrors.ctan.org/macros/xetex/latex/xecjk/xeCJK.pdf

Earthwater commented 8 months ago

感谢大佬!已解决!

解决方案:

\usepackage{xeCJKfntef} %引入该包
\CJKsout*[thickness=2.5ex, format=\color{yellow}]{你要高亮背景的文字} % 颜色可以自定