![如何使 Tufte 侧注在 tcolorbox 环境中正常运行?](https://linux22.com/image/438330/%E5%A6%82%E4%BD%95%E4%BD%BF%20Tufte%20%E4%BE%A7%E6%B3%A8%E5%9C%A8%20tcolorbox%20%E7%8E%AF%E5%A2%83%E4%B8%AD%E6%AD%A3%E5%B8%B8%E8%BF%90%E8%A1%8C%EF%BC%9F.png)
因此,tufte-book 类中的边注(旁注)和引文与 tcolorbox 中的定理框不兼容。我尝试使用检测当前环境的宏重写 tufte 中的引文和边注命令(相关的 链接 这里),但我还无法让它发挥作用。
梅威瑟:
\documentclass[justified, nofonts, notitlepage, openany, debug]{tufte-book}
\usepackage{tcolorbox}
\tcbuselibrary{skins}
\tcbuselibrary{breakable}
\tcbuselibrary{theorems}
\newtcbtheorem{theorem}{Theorem}{parbox=false, breakable, sharp corners, skin=enhanced, frame hidden, colback=white, coltitle=white, colbacktitle=black, adjusted title, fonttitle=\bfseries}{th}
\def\bibsection{~\\ \section*{\refname}}
\begin{document}
\begin{theorem}{Pythagoras\cite{kontsevich-manin}}
$$a^2 + b^2 = c^2$$\marginnote{Lorem ipsum et cetera}
\end{theorem}
\marginnote{Regular marginnote}
Here's a regular citation to illustrate expected behavior:\cite{witten}
\begin{theorem}{\marginnote{The quick brown fox or something}}
$$d^2 + e^2 = f^2$$\cite{hartshorne}
\end{theorem}
\bibliographystyle{plainnat}
\bibliography{sample}
\end{document}
预期(期望)行为是将引用打印到 tcolorbox 之外的边注上,并与文档的其余部分保持编号。
编辑:我尝试修复这问题,将旁注从定理环境中保存下来,并将它们放在环境结束后,但无法使其正常工作。另一种策略是重新定义 \cite 和 \marginnote,使其在不在定理框内时以一种方式运行,在定理框内时以不同的方式运行。