有点\marginnote
乱吗tcolorbox
?我改编了一些代码 另一个问题第一个框渲染得很好,但接下来的框渲染得很糟糕。我费了好大劲才重现这个问题,因为在我的 tex 文件中,它不会在第一个边注之后立即发生。在以下 MWE 中还有其他我没有考虑到的影响,例如,有时边注会被完全丢弃(但如果有计数器,它会溢出)。
\documentclass[twoside,a4paper]{tufte-handout}
\usepackage{etoolbox}%
\usepackage{blindtext}%
\usepackage[tikz]{bclogo}%
\usepackage[skins,breakable]{tcolorbox}%
\usepackage{marginfix}
% Code adapted from https://tex.stackexchange.com/questions/198255/bclogo-page-breaks
\newtcolorbox[auto counter]{myexample}{
breakable,
skin= enhanced,
boxrule=0pt,boxsep=0pt,arc=2mm,toptitle=3mm,top=3mm,left=7mm,right=1mm,pad at break=2mm,
colframe=red!20!white,
interior hidden,
coltitle=black,fonttitle=\bfseries,title={Example \thetcbcounter},
overlay unbroken and first={\node[inner sep=0pt] (logo) at ([xshift=4mm,yshift=-5mm]frame.north west) {\bcinfo};
\draw[red,line width=3.5pt] (logo) -- ([xshift=4mm,yshift=1.5mm]frame.south west); },
overlay middle and last={\draw[red,line width=3.5pt] ([xshift=4mm,yshift=-1.5mm]frame.north west) -- ([xshift=4mm,yshift=1.5mm]frame.south west); },
}
\begin{document}
\section{First}
\marginnote{
\begin{myexample}
Bla bla Bla bla Bla bla Bla bla Bla bla $5x^2 + 2x + 3 $ Bla bla la $x$ Bla bla Bla bla Bla bla
\[5\cdot 10^2 + 2\cdot 10 + 3 = 523 \]
Bla bla Bla bla Bla bla Bla bla Bla bla
\end{myexample}}
\blindtext[4]
\marginnote{
\begin{myexample}
\blindtext
\end{myexample}}
\blindtext[4]
\marginnote{
\begin{myexample}
Bla bla Bla bla Bla bla Bla bla Bla bla $5x^2 + 2x + 3 $ Bla bla la $x$ Bla bla Bla bla Bla bla
\[5\cdot 10^2 + 2\cdot 10 + 3 = 523 \]
Bla bla Bla bla Bla bla Bla bla Bla bla
\end{myexample}}
\blindtext[4]
\blindtext[4]
\marginnote{
\begin{myexample}
\blindtext
\end{myexample}}
\blindtext[4]
\blindtext[4]
\end{document}