1

I have a multipage frame built with mdframed with method tikz. I need to frame with lines all its parts on every page.

\documentclass[11pt]{article}
\usepackage[framemethod=tikz]{mdframed}
\usepackage[paperwidth=155mm, paperheight=35mm]{geometry}

\begin{document}
    \begin{mdframed}[
        frametitle="Example of the frame",
        linecolor=red,
        nobreak=false,
        everyline=true
    ]
        Lorem ipsum dolor sit amet, consectetuer adipiscing elit. Utpurus elit,
        vestibulum ut, placerat ac, adipiscing vitae, fe-lis.
        Curabitur dictum gravida mauris. Nam arcu libero, nonummy eget,
        consectetuer id, vulputate a, magna.
    \end{mdframed}
\end{document}

I'm searching for a solution (easy or complex) to change styles for all those intermediate horizontal lines that appear automatically with frame breaks. In my case, I need them as a "snaked" zigzag (the one from the tikz library is fine for me).

If you know solutions with any other packages (e.g. tcolorbox), it's also acceptable ...

This is what I have

enter image description here

This is what I want

enter image description here

1

Well, after some research I've found a way how to do that with tcolorbox. The mdframed solution still is not clear for me (any ideas?).

If someone needs it, here that I have done:

\documentclass[11pt]{article}
\usepackage{tikz}
\usepackage[most]{tcolorbox}
\usetikzlibrary{calc}
\usetikzlibrary{snakes}
\usepackage[paperwidth=155mm, paperheight=20mm]{geometry}

\begin{document}
    \begin{tcolorbox}[
        enhanced,
        breakable,
        sharp corners=all,
        colback=white,
        frame hidden,
        parbox=false,
        boxsep=0pt,
        left=10pt,
        right=10pt,
        bottom=10pt,
        top=2.5pt,
        toptitle=10pt,
        bottomtitle=2.5pt,
        before skip=0.75\baselineskip plus 2pt,
        after skip=0.75\baselineskip plus 2pt,
        overlay first={%
            \draw[line width=0.5pt, red] (frame.north west)--(frame.north east);
            \draw[line width=0.2pt, red, decorate, decoration={zigzag, segment length=3pt, amplitude=1pt}] (frame.south west)--(frame.south east);

            \draw[line width=0.5pt, red] ($(frame.north west) + (0, 0.25pt)$)--(frame.south west);
            \draw[line width=0.5pt, red] ($(frame.north east) + (0, 0.25pt)$)--(frame.south east);
        },
        overlay middle={%
            \draw[line width=0.1pt, red, decorate, decoration={zigzag, segment length=3pt, amplitude=1.0pt}] (frame.south west)--(frame.south east);
            \draw[line width=0.1pt, red, decorate, decoration={zigzag, segment length=3pt, amplitude=1.0pt}] (frame.north west)--(frame.north east);

            \draw[line width=0.5pt, red] (frame.north west)--(frame.south west);
            \draw[line width=0.5pt, red] (frame.north east)--(frame.south east);
        },
        overlay last={%
            \draw[line width=0.1pt, red, decorate, decoration={zigzag, segment length=3pt, amplitude=1.0pt}] (frame.north west)--(frame.north east);
            \draw[line width=0.5pt, red] (frame.south west)--(frame.south east);

            \draw[line width=0.5pt, red] (frame.north west)--($(frame.south west) - (0, 0.25pt)$);
            \draw[line width=0.5pt, red] (frame.north east)--($(frame.south east) - (0, 0.25pt)$);
        },
        overlay unbroken={%
            \draw[line width=0.5pt, red] (frame.north west)--(frame.north east);
            \draw[line width=0.5pt, red] (frame.south west)--(frame.south east);

            \draw[line width=0.5pt, red] (frame.north west)--($(frame.south west) - (0, 0.25pt)$);
            \draw[line width=0.5pt, red] (frame.north east)--($(frame.south east) - (0, 0.25pt)$);
        }
    ]
        Lorem ipsum dolor sit amet, consectetuer adipiscing elit. Utpurus elit,
        vestibulum ut, placerat ac, adipiscing vitae, fe-lis.
        Curabitur dictum gravida mauris. Nam arcu libero, nonummy eget,
        consectetuer id, vulputate a, magna.
    \end{tcolorbox}
\end{document}

This how it looks like

Your Answer

By clicking “Post Your Answer”, you agree to our terms of service, privacy policy and cookie policy

Not the answer you're looking for? Browse other questions tagged or ask your own question.