TeX - LaTeX Asked by mrks on May 9, 2021
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.
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} {#2width} {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={#3width} {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:
Answered by mrks on May 9, 2021
Get help from others!
Recent Questions
Recent Answers
© 2024 TransWikia.com. All rights reserved. Sites we Love: PCI Database, UKBizDB, Menu Kuliner, Sharing RPP