\documentclass{book}
\usepackage{stackengine}
\usepackage{ulem}
\renewcommand{\baselinestretch}{4}
\begin{document}
\stackunder{\uline{this a text this a text this a text this a text this a text this a text this a text this a text this a text this a text this a text this a text this a text this a text this a text this a text this a text this a text}}{text1}
\uline
{
\stackunder{\stackunder{ text this a text this a text this a text this a text this a text this}{\uline{text1}}}{text 2} \\
\stackunder{ text this a text this a text this a text this a text this a text this}{Cont. text1}\\
\stackunder{ text this a text this a text this a text this a text this a text this}{Cont. text1}
}
\end{document}
我正在尝试制作带有下划线的文本。为此,我使用了 stackengine 包在该行下方放置了一些文本。但它是一种 hbox 类型,无法自动换行,并且还应该在文本下进行更新
我可以手动完成,但在大多数情况下,我想要在其下方加下划线的那些内容很长。另一件事是它还应该能够执行嵌套下划线文本,所以请帮助我解决这个问题
答案1
这是一个起点。使用这个简单的解决方案,您必须手动标记要放置标签的单词。
\documentclass{article}
\usepackage{ulem}
\newcommand\tag[2]{%
\begin{tabular}[t]{@{}c@{}}
#1\\
\makebox[0pt]{#2}
\end{tabular}%
}
\begin{document}
\uline{A long, long sentence that goes \tag{beyond}{sentence}
the end of line, and even then does not stop, but
\tag{goes on}{sent.\ continued}, and on, and on, and on.}
\end{document}