答案1
使用 MetaFun 在 ConTeXt 中做到这一点相对容易。
\startuseMPgraphic{textframe}
begingroup;
for i=1 upto nofmultipars :
draw ( ulcorner multipars[i] -- llcorner multipars[i] )
xshifted (-2*EmWidth)
withcolor "darkgreen"
withpen pensquare scaled (EmWidth);
endfor ;
endgroup;
\stopuseMPgraphic
\definetextbackground
[TextFrame]
[mp=textframe,
location=paragraph]
\starttext
\starttextbackground[TextFrame]
\startsection[title=Knuth]
\input knuth
\stopsection
\startsection[title=Tufte]
\input tufte
\stopsection
\startsection[title=Ward]
\input ward
\stopsection
\startsection[title=Zapf]
\input zapf
\stopsection
\startsection[title=Dawkins]
\input dawkins
\stopsection
\startsection[title=Bryson]
\input bryson
\stopsection
\stoptextbackground
\stoptext
答案2
@leandriis 对我的问题的回答非常有效。
因此我现在使用以下内容:
\documentclass{book}
\usepackage[color, leftbars]{changebar}
\usepackage{lipsum}
\setlength\changebarsep{10pt}
\begin{document}
\lipsum[4]
\cbstart % the marked Text starts here
\cbcolor{green}
\lipsum[4]
\lipsum\footnote{a footnote}
\lipsum
\cbend % and ends here
\end{document}