TeX - LaTeX Stack Exchange is a question and answer site for users of TeX, LaTeX, ConTeXt, and related typesetting systems. It's 100% free, no registration required.

Sign up
Here's how it works:
  1. Anybody can ask a question
  2. Anybody can answer
  3. The best answers are voted up and rise to the top

I would like to make visibly clear, that an inserted graphic is just part of the whole. Since a straight cut just appears as inserted falsy, I was wondering if there are any tricks to show jags for the trimmed sides. Something like this for instance:

jagged page

share|improve this question
    
lpic package may help you – touhami Mar 25 at 15:51
    
I will have a look for this, thanks! – Eric Mar 25 at 15:55
    
related tex.stackexchange.com/questions/9559/… – touhami Mar 25 at 16:11
up vote 15 down vote accepted

You can use decorations in TikZ to morph a path using random steps. Of course, you can customize these random steps.

I used a \clip with hard-coded coordinates starting from the top left of the image, then top right, down to about 2/3 then left again before closing the path. If you change the width of the includegraphics, make sure to change the clipping coordinates accordingly.

Although this can be solved easily using variables.

Output

enter image description here

Code

\documentclass[margin=15pt]{standalone}

\usepackage{tikz}
\usetikzlibrary{calc, decorations.pathmorphing}

\newcommand\myimgwidth{\linewidth} % one measure to rule them all

\begin{document}
\begin{tikzpicture}
\pgfmathsetmacro\myheight{(\myimgwidth/4)*2}
\clip[preaction={draw, line width=.8pt}] (0,0) -- (\myimgwidth,0) -- (\myimgwidth,-\myheight pt) decorate[decoration={random steps,segment length=2mm,amplitude=.1cm}] {(\myimgwidth,-\myheight pt) -- (0,-\myheight pt)} -- (0,0);

\node[inner sep=0pt, outer sep=0pt, anchor=north west] at (0,0) {\includegraphics[width=\myimgwidth,keepaspectratio]{example-image-a}};

\end{tikzpicture}
\end{document}
share|improve this answer
    
This seems to be a great solution. Would you mind to show quickly how to apply this TikZ effect on a includegraphic? – Eric Mar 25 at 16:36
    
@Eric This effect was applied on an includegraphics from the start. I only edited it because the randomized line was not horizontal. :D – Alenanno Mar 25 at 16:37
    
I have some tricky effects of resolution --- namely, sometime half of the border line of the graphics appears. Changing \fill to draw[red, fill=white] I have this: i.imgur.com/QIi04xU.png (viewer dependent, but also probably printer dependent...) – Rmano Mar 25 at 17:21
    
@Rmano That's not a tricky effect, that's the rectangle I have drawn on top of the graphics that is filled with white. I'll find a solution to draw only the decoration. – Alenanno Mar 25 at 17:28
1  
@Eric See new edit. If using this in an article class gives you an overfull \hbox I suggest reducing the width. – Alenanno Mar 25 at 19:11

Your Answer

 
discard

By posting your answer, you agree to the privacy policy and terms of service.

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