3

I have an image that is too wide to be displayed on a page. I'd like to cut the middle part of the image. The edges should be ragged to help the reader understand that a part is missing.

Example:

4

This can be done using tikz and adjustbox:

\usepackage{adjustbox}
\usepackage{tikz}
\usepackage{graphicx}
\usetikzlibrary{decorations.pathmorphing}
\newcommand{\cutimage}[3]{
  \adjustbox{max width=\textwidth}{
    \tikz{
      \node[inner sep=0pt] (A) {
        \adjustbox{trim={0} {0} {#2\width} {0},clip}{\includegraphics{#1}}
      };
      \draw[decoration={zigzag, mirror,segment length=6mm,amplitude=1.1pt}, decorate](A.north east) -- (A.south east)
    }
    \tikz{
      \node[inner sep=0pt] (A) {
        \adjustbox{trim={#3\width} {0} {0} {0},clip}{\includegraphics{#1}}
      };
      \draw[decoration={zigzag, mirror,segment length=6mm,amplitude=1.1pt}, decorate](A.north west) -- (A.south west)
    }
  }
}

Usage:

\cutimage{image.png}{.65}{.87}

Thanks go out to these answers from which I have borrowed parts:

| improve this answer | |

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.