如何将类似框的图像放在左侧?

如何将类似框的图像放在左侧?

在此处输入图片描述

如何使用这样的代码?我需要它来解释和总结书中的答案。能帮帮我吗!

答案1

以下是tornpagecmhughes 在其回答中最初定义的环境的改编版本撕页效果

与原始环境相比,我在左上角添加了小标题框。我还稍微改变了颜色,限制了框的宽度并删除了阴影:

在此处输入图片描述

\documentclass{article}
\usepackage[many]{tcolorbox}
\usetikzlibrary{decorations.pathmorphing}
\usetikzlibrary{shadows}
\definecolor{paper}{RGB}{254,246,101}
\usepackage{lipsum}
\newtcolorbox{tornpage}[1]{%
    enhanced jigsaw, % allow page breaks
    frame hidden, % hide the default frame
    overlay={%
        \draw [
            fill=paper!75!white, % fill paper
            draw=red, % boundary colour
            decorate, % decoration
            decoration={random steps,segment length=2pt,amplitude=1pt},
%            drop shadow, % shadow
        ]
        % top line
        (frame.north west)--(frame.north east)--
        % right line
        (frame.north east)--(frame.south east)--
        % bottom line
        (frame.south east)--(frame.south west)--
        % left line
        (frame.south west)--(frame.north west);
    },
    finish={%
        \node[%
            draw=red, 
            rounded corners, 
            fill=paper, 
            anchor=west, 
            xshift=0.25cm, 
            yshift=2pt, 
            minimum width=2cm] at (frame.north west) {#1};},
    % paragraph skips obeyed within tcolorbox
    parbox=false,
    text width=5cm, 
}
\begin{document}
\begin{tornpage}{my title}
    \lipsum[1][1-3]
\end{tornpage}
\lipsum[1]
\end{document}

相关内容