给出的解决方案是给线的其余部分(从任意点到其末尾)着色,我尝试将文本设置为粗体而不是着色,但无济于事。
由于我对 TeX 的了解不够深入,所以我请教:有哪位 TeX 专家能给我一个解决方案吗?
问候杰克
答案1
您无法在自动换行符处更改字体,因为在选择换行点之前需要选择字体并设置文本。
但是您可以(也许)将文本设置两次,一次更改字体,一次不更改字体,然后重新构成所需的段落。
\documentclass{article}
\begin{document}
\setbox0\vbox{{%
Medium text here
\fontseries{b}\selectfont% b not bx so line breaking (hopefully) not affected
bold starts here and goes on \ldots
the first line of the paragraph has several lines and may have\[math\]
and other stuff, the line break may happen at a hyphenation point.
}}
\setbox2\vbox{{%
Medium text here
bold starts here and goes on \ldots
the first line of the paragraph has several lines and may have\[math\]
and other stuff, the line break may happen at a hyphenation point.
}}
{\vbadness=10000
\setbox4=\vsplit0 to \ht\strutbox
\setbox6=\vsplit2 to \ht\strutbox
\box4
\nointerlineskip
\box2
}
\end{document}