1

Just for the looks of it I would like to have jagged or teared edges on my clipped examples seen in the picture below. Is this possible without major hacking?

MWE:

%

\documentclass[11pt,a4paper]{article}
\usepackage[tikz]{ocgx2}
\usetikzlibrary{shadows,spy}
\usepackage{tikz-dimline}
\usepackage{adjustbox}
\usepackage{float}
\usepackage{xstring}
\newcommand{\PaperTemplate}[4]
    {
    \IfEqCase{#1}{
        {A4L}   {
                \newcommand\ASizeWidth{297}
                \newcommand\ASizeHeight{210}
                \coordinate (ALowerLeftCorner) at (0 mm ,0 mm);
                \coordinate (ALowerRightCorner) at (\ASizeWidth mm ,0 mm);
                \coordinate (ATopLeftCorner) at (0 mm ,\ASizeHeight mm);
                \coordinate (ATopRightCorner) at (\ASizeWidth mm ,\ASizeHeight mm);
                %Ev. header
                \coordinate (AHeaderTopRightCorner) at (\ASizeWidth mm - #2 mm,#2 mm + #4 mm);
                \coordinate (AHeaderTopLeftCorner) at (\ASizeWidth mm - #2 mm - #3 mm,#2 mm + #4 mm);
                \coordinate (AHeaderLowerLeftCorner) at (\ASizeWidth mm - #2 mm - #3 mm,#2 mm);
                \draw[step=5mm, red!20, very thin] ([shift={(-20mm,-20mm)}]ALowerLeftCorner) grid  ([shift={(23mm,20mm)}]ATopRightCorner);
                \fill[white, drop shadow] (ALowerLeftCorner) rectangle (ATopRightCorner);
                \fill[white, draw={black}, very thin] ([shift={(#2 mm,#2 mm)}]ALowerLeftCorner) rectangle  ([shift={(- #2 mm,- #2 mm)}]ATopRightCorner);
                \draw (AHeaderTopRightCorner) -- (AHeaderTopLeftCorner) -- (AHeaderLowerLeftCorner);
                }%
        {A4P}   {
                A4P
                }%
        {A3L}   {
                A3L
                }%
                }
        [\PackageError{PaperTemplate}{Undefined option to paper: #1}{}]%
     }%


\begin{document}
\centering

Frame of the drawing
\begin{figure}[H]
\centering
\scalebox{0.35}{
\begin{tikzpicture}[spy scope={magnification=4, size=10cm},every spy in node/.style={
                                circle, circular drop shadow,
                                fill=white, draw, ultra thick, fill opacity=0.95}]
        \PaperTemplate{A4L}{5}{150}{50}
        \spy on (ATopLeftCorner) in node;
        \dimline[
                line style = {line width=0.5},
                label style={above=0.25ex,font=\tiny, fill=none},
                extension start length=0.85,
                extension end length=0.85
                ]
                {(ATopLeftCorner)}{([shift={(5 mm,0 mm)}]ATopLeftCorner)}{5};
        \dimline[
                line style = {line width=0.5},
                label style={above=0.25ex, font=\tiny, fill=none},
                extension start length=0.85,
                extension end length=0
                ]
                {([shift={(0 mm,-5 mm)}]ATopLeftCorner)}{(ATopLeftCorner)}{5};
        \dimline[
                line style = {line width=0.5},
                label style={above=0.25ex, font=\huge, fill=none}
                ]
                {([shift={(0 mm,15 mm)}]AHeaderTopLeftCorner)}{([shift={(0 mm,15 mm)}]AHeaderTopRightCorner)}{150};
        \dimline[
                line style = {line width=0.5},
                label style={above=0.25ex, font=\huge, fill=none}
                ]
                {([shift={(-15 mm,0 mm)}]AHeaderLowerLeftCorner)}{([shift={(-15 mm,0 mm)}]AHeaderTopLeftCorner)}{50};
\end{tikzpicture}
}
\end{figure}

The main header
\begin{figure}[H]
\centering
\scalebox{0.55}{
\begin{adjustbox}{clip,trim= 120mm 0mm 0mm 110mm} %clip/trim Left, Right, Bottom, Top
\begin{tikzpicture}[spy scope={magnification=4, size=10cm},every spy in node/.style={
                                circle, circular drop shadow,
                                fill=white, draw, ultra thick, fill opacity=0.95}]
        \PaperTemplate{A4L}{5}{150}{50}
        \dimline[
                line style = {line width=0.5},
                label style={above=0.25ex, font=\huge, fill=none}
                ]
                {([shift={(0 mm,15 mm)}]AHeaderTopLeftCorner)}{([shift={(0 mm,15 mm)}]AHeaderTopRightCorner)}{150};
        \dimline[
                line style = {line width=0.5},
                label style={above=0.25ex, font=\huge, fill=none}
                ]
                {([shift={(-15 mm,0 mm)}]AHeaderLowerLeftCorner)}{([shift={(-15 mm,0 mm)}]AHeaderTopLeftCorner)}{50};
\end{tikzpicture}
\end{adjustbox}
}
\end{figure}

\end{document}

Example output:

Jagged edges...

The pink doodle in the picture is what I'd like to accomplish :)

2

Okay so thanks to the comment from Ignasi I came this far:

MWE:

%

\documentclass[11pt,a4paper]{article}
\usepackage[tikz]{ocgx2}
\usetikzlibrary{shadows,spy,decorations.pathmorphing}
\usepackage{tikz-dimline}
\usepackage[many]{tcolorbox}
\usepackage{adjustbox}
\usepackage{float}
\usepackage{xstring}
\newcommand{\PaperTemplate}[4]
    {
    \IfEqCase{#1}{
        {A4L}   {
                \newcommand\ASizeWidth{297}
                \newcommand\ASizeHeight{210}
                \coordinate (ALowerLeftCorner) at (0 mm ,0 mm);
                \coordinate (ALowerRightCorner) at (\ASizeWidth mm ,0 mm);
                \coordinate (ATopLeftCorner) at (0 mm ,\ASizeHeight mm);
                \coordinate (ATopRightCorner) at (\ASizeWidth mm ,\ASizeHeight mm);
                %Ev. header
                \coordinate (AHeaderTopRightCorner) at (\ASizeWidth mm - #2 mm,#2 mm + #4 mm);
                \coordinate (AHeaderTopLeftCorner) at (\ASizeWidth mm - #2 mm - #3 mm,#2 mm + #4 mm);
                \coordinate (AHeaderLowerLeftCorner) at (\ASizeWidth mm - #2 mm - #3 mm,#2 mm);
                \fill[white] ([shift={(-20mm,-20mm)}]ALowerLeftCorner) rectangle ([shift={(23mm,20mm)}]ATopRightCorner);
                \draw[step=5mm, red!20, very thin] ([shift={(-20mm,-20mm)}]ALowerLeftCorner) grid  ([shift={(23mm,20mm)}]ATopRightCorner);
                \fill[white, drop shadow] (ALowerLeftCorner) rectangle (ATopRightCorner);
                \fill[white, draw={black}, very thin] ([shift={(#2 mm,#2 mm)}]ALowerLeftCorner) rectangle  ([shift={(- #2 mm,- #2 mm)}]ATopRightCorner);
                \draw (AHeaderTopRightCorner) -- (AHeaderTopLeftCorner) -- (AHeaderLowerLeftCorner);
                }%
        {A4P}   {
                A4P
                }%
        {A3L}   {
                A3L
                }%
                }
        [\PackageError{PaperTemplate}{Undefined option to paper: #1}{}]%
     }%
\newtcolorbox{tornedges}{%
    colback=white,
    enhanced jigsaw,
    frame hidden, % hide the default frame
    overlay={%
        \draw [
            decorate, % decoration
            decoration={random steps,segment length=2pt,amplitude=1pt}
        ]
        % left line
        ([shift={(5.5mm,3mm)}]frame.south west)--([shift={(5.5mm,-7mm)}]frame.north west)--
        % top line
        ([shift={(5.5mm,-7mm)}]frame.north west)--([shift={(-2mm,-7mm)}]frame.north east)--
        % right line
        ([shift={(-2mm,-7mm)}]frame.north east)--([shift={(-2mm,3mm)}]frame.south east)--
        % bottom line
        ([shift={(-2mm,3mm)}]frame.south east)--([shift={(5.5mm,3mm)}]frame.south west);
    },
}

\begin{document}
\centering

Frame of the drawing
\begin{figure}[H]
\centering
\scalebox{0.35}{
\begin{tikzpicture}[pencildraw/.style={decorate,decoration={random steps,segment length=2pt,amplitude=1pt}},
                                spy scope={magnification=4, size=10cm},
                                every spy in node/.style={
                                circle, circular drop shadow,
                                fill=white, draw, ultra thick, fill opacity=0.95}]
        \PaperTemplate{A4L}{5}{150}{50}
        \spy on (ATopLeftCorner) in node;
        \dimline[
                line style = {line width=0.5},
                label style={above=0.25ex,font=\tiny, fill=none},
                extension start length=0.85,
                extension end length=0.85
                ]
                {(ATopLeftCorner)}{([shift={(5 mm,0 mm)}]ATopLeftCorner)}{5};
        \dimline[
                line style = {line width=0.5},
                label style={above=0.25ex, font=\tiny, fill=none},
                extension start length=0.85,
                extension end length=0
                ]
                {([shift={(0 mm,-5 mm)}]ATopLeftCorner)}{(ATopLeftCorner)}{5};
        \dimline[
                line style = {line width=0.5},
                label style={above=0.25ex, font=\huge, fill=none}
                ]
                {([shift={(0 mm,15 mm)}]AHeaderTopLeftCorner)}{([shift={(0 mm,15 mm)}]AHeaderTopRightCorner)}{150};
        \dimline[
                line style = {line width=0.5},
                label style={above=0.25ex, font=\huge, fill=none}
                ]
                {([shift={(-15 mm,0 mm)}]AHeaderLowerLeftCorner)}{([shift={(-15 mm,0 mm)}]AHeaderTopLeftCorner)}{50};
\end{tikzpicture}
}
\end{figure}

The main header

\begin{tornedges}
\begin{figure}[H]
\centering
\scalebox{0.55}{
\begin{adjustbox}{clip,trim= 120mm 10mm 7mm 110mm} %clip/trim Left, Right, Bottom, Top
\begin{tikzpicture}[    spy scope={magnification=4, size=10cm},
                        every spy in node/.style={
                        circle, circular drop shadow,
                        fill=white, draw, ultra thick, fill opacity=0.95}]
        \PaperTemplate{A4L}{5}{150}{50}
        \dimline[
                line style = {line width=0.5},
                label style={above=0.25ex, font=\huge, fill=none}
                ]
                {([shift={(0 mm,15 mm)}]AHeaderTopLeftCorner)}{([shift={(0 mm,15 mm)}]AHeaderTopRightCorner)}{150};
        \dimline[
                line style = {line width=0.5},
                label style={above=0.25ex, font=\huge, fill=none}
                ]
                {([shift={(-15 mm,0 mm)}]AHeaderLowerLeftCorner)}{([shift={(-15 mm,0 mm)}]AHeaderTopLeftCorner)}{50};
\end{tikzpicture}
\end{adjustbox}
}
\end{figure}
\end{tornedges}

\end{document}

Essentially this is the part needed once the tcolorbox tornedges is defined:

\begin{tornedges}
\begin{adjustbox}{clip,trim= 120mm 10mm 7mm 110mm} %clip/trim Left, Right, Bottom, Top
\begin{tikzpicture}
...
\end{tikzpicture}
\end{adjustbox}
\end{tornedges}

Giving me this output... Good enough and I will mark this question as answered (if no one else gives a better one) but it's not generic.

Jagged edges 2

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.