答案1
您可以尝试 tcolorbox。请注意,即使看起来像普通文本,它仍然是一个框,例如前后间距可能与正常间距略有不同:
\documentclass{article}
\usepackage{lipsum}
\usepackage[most]{tcolorbox}
\begin{document}
\lipsum[1-4]
\begin{tcolorbox}[breakable,
enhanced jigsaw,
opacityback=0,
sharp corners,
parbox=false,
boxrule=0mm,
top=0mm,bottom=0pt,left=0pt,right=0pt,
boxsep=0pt,
frame hidden,
parbox=false,
before upper=\indent\strut,
before=\par,after=\par,
finish={\draw[thick,red] ([xshift=3cm]frame.north)--([xshift=-3cm]frame.south);}
]
\lipsum[1-2]
\end{tcolorbox}
\lipsum[1-2]
\end{document}