答案1
最简单的方法是使用soulpos
:
%! TEX program = pdflatex
\documentclass{article}
%\usepackage{soul}
\usepackage{soulpos}
\usepackage{xcolor}
\ulposdef{\hlst}{%
\rlap{\textcolor{yellow}{\rule[-.75ex]{\ulwidth}{2.5ex}}}%
\rule[.45ex]{\ulwidth}{.1ex}%
}
\begin{document}
\pagenumbering{gobble}
\textbf{New hlst macro:}
\hlst{This is my text which I want to highlight and strike through. The text goes to the next line instead of going beyond the page.}
\textbf{hl:}
\hl{This is my text which I want to highlight and strike through. The text goes to the next line instead of going beyond the page.}
\textbf{st:}
\st{This is my text which I want to highlight and strike through. The text goes to the next line instead of going beyond the page.}
\end{document}
输出:
另一种方法是lua-ul
使用无法为突出显示的文本添加下划线(灵魂)举个例子。