在这段文字中,注释位于多行带有花括号的右侧,且文字以垂直方式书写。
如何实现?我正在使用 paracol 和 xelatex,但我愿意听取建议。
答案1
问题解决了。
\documentclass{scrbook}
\usepackage{paracol}
\usepackage{lipsum,marginnote}
\usepackage{changepage}\strictpagecheck
\usepackage[many]{tcolorbox}
\usepackage{tikz}
\usetikzlibrary{arrows,decorations.pathreplacing,tikzmark}
\tikzset{remember picture}
\newtcolorbox{leftcol}[1]{%\begin{tcbdecor}{<note>}<text>\end{tcbdecor}
colback=white, boxrule=0pt, colframe=white, arc=0pt, outer arc=0pt,
top=0pt, bottom=0pt,%
check odd page,breakable,enhanced jigsaw,oversize,%
overlay={\ifoddpage\draw[decoration={brace},decorate] (frame.north east) --
node[rotate=-90,above=4pt] {#1} (frame.south east);%
\else\draw[decoration={brace},decorate] (frame.north east) --
node[rotate=-90,above=4pt] {#1} (frame.south east);\fi}}
\newtcolorbox{rightcol}[1]{%\begin{tcbdecor}{<note>}<text>\end{tcbdecor}
colback=white, boxrule=0pt, colframe=white, arc=0pt, outer arc=0pt,
top=0pt, bottom=0pt,%
check odd page,breakable,enhanced jigsaw,oversize,%
overlay={\ifoddpage\draw[decoration={brace},decorate] (frame.north west) --
node[rotate=-90,above=4pt] {#1} (frame.south west);%
\else\draw[decoration={brace},decorate] (frame.north east) --
node[rotate=-90,above=4pt] {#1} (frame.south east);\fi}}
\begin{document}
\NewDocumentEnvironment{hangparacol}{mo}
{\IfNoValueTF{#2} {\begin{paracol}{#1}}{\begin{paracol}{#1}[#2]}%
\raggedright
\parindent=3em \leftskip=3em}
{\end{paracol}}
\columnratio{0.5}
\setlength{\columnsep}{50pt}
\begin{paracol}{2}
\begin{leftcol}{I don't like TikZ decorates}
\lipsum[1]\end{leftcol}
\switchcolumn
\begin{rightcol}{I don't like TikZ decorates}
\lipsum[1]\end{rightcol}
\end{paracol}
\end{document}