长备注框

长备注框

我有以下备注框。但是,我想在其中添加的文本只能容纳 2 页。

\NewEnviron{myremark}[1]
  {\par\medskip\noindent
  \begin{tikzpicture}
    \node[inner sep=0pt] (box) {\parbox[t]{.99\textwidth}{%
      \begin{minipage}{.3\textwidth}
      \centering\tikz[scale=5]\node[scale=3,rotate=30]{\bclampe};
      \end{minipage}%
      \begin{minipage}{.65\textwidth}
      \textbf{#1}\par\smallskip
      \BODY
      \end{minipage}\hfill}%
    };
    \draw[red!75!black,line width=3pt] 
      ( $ (box.north east) + (-5pt,3pt) $ ) -- ( $ (box.north east) + (0,3pt) $ ) -- ( $ (box.south east) + (0,-3pt) $ ) -- + (-5pt,0);
    \draw[red!75!black,line width=3pt] 
      ( $ (box.north west) + (5pt,3pt) $ ) -- ( $ (box.north west) + (0,3pt) $ ) -- ( $ (box.south west) + (0,-3pt) $ ) -- + (5pt,0);
  \end{tikzpicture}\par\medskip%
}

我怎样才能拆分文本而不改变框的形状?

答案1

tcolorbox可以制作装饰好的、易碎的盒子。

\documentclass{article}

\usepackage{bclogo}
\usepackage{lipsum}
\usepackage[most]{tcolorbox}

\newtcolorbox{myremark}[2][]{%
    empty,  
    title={#2}, 
    attach title to upper={\\},
    coltitle=black,
    fonttitle=\bfseries,
    before=\par\medskip\noindent,
    parbox=false, 
    boxsep=0pt,
    left=.3\textwidth,
    right=5mm,
    top=4pt,
    breakable,
    pad at break*=0mm,
    vfill before first,
    overlay unbroken={%
        \draw[red!80!black, line width=3pt]
        ([xshift=5pt]frame.north west)-|(frame.west)|-([xshift=5pt]frame.south west);
        \draw[red!80!black, line width=3pt]
        ([xshift=-5pt]frame.north east)-|(frame.east)|-([xshift=-5pt]frame.south east);
        \node[scale=3, rotate=30] at ([xshift=.15\textwidth]frame.west) {\bclampe};
    },
    overlay first={%
        \draw[red!80!black, line width=3pt]
        ([xshift=5pt]frame.north west)-|(frame.south west);
        \draw[red!80!black, line width=3pt]
        ([xshift=-5pt]frame.north east)-|(frame.south east);
        \node[scale=3, rotate=30] at ([xshift=.15\textwidth]frame.west) {\bclampe};
    },
    overlay middle={%
        \draw[red!80!black, line width=3pt]
        (frame.north west)--(frame.south west);
        \draw[red!80!black, line width=3pt]
        (frame.north east)--(frame.south east);
        \node[scale=3, rotate=30] at ([xshift=.15\textwidth]frame.west) {\bclampe};
    },
    overlay last={%
        \draw[red!80!black, line width=3pt]
        (frame.north west)|-([xshift=5pt]frame.south west);
        \draw[red!80!black, line width=3pt]
        (frame.north east)|-([xshift=-5pt]frame.south east);
        \node[scale=3, rotate=30] at ([xshift=.15\textwidth]frame.west) {\bclampe};
    },
    #1
}

\begin{document}

\begin{myremark}{Title}
\lipsum[1]
\end{myremark}

\begin{myremark}{Title}
\lipsum[1-8]
\end{myremark}
\end{document}

在此处输入图片描述

相关内容