How do insert image between text and text wrap with shapepar or other package? enter image description here

  • Although this is not an exact duplicate, the following post should guide you through the steps using Xfig: tex.stackexchange.com/questions/32997/….
    – Werner
    Nov 12, 2011 at 3:07
  • I used the steps in the link that you passed, but I can not subtract the signal section with -. It does not work. Nov 12, 2011 at 5:21

2 Answers 2


Use package cutwin and run the example with xelatex because I use an eps image as vector graphic which has no background. Using a png image with clipping may also be possible.



0.4\textwidth, 0.4\textwidth,
0.35\textwidth, 0.35\textwidth,
0.32\textwidth, 0.32\textwidth,
0.3\textwidth, 0.3\textwidth,
0.28\textwidth, 0.28\textwidth,
0.26\textwidth, 0.26\textwidth,
0.26\textwidth, 0.26\textwidth,
0.28\textwidth, 0.28\textwidth,
0.3\textwidth, 0.3\textwidth,
0.32\textwidth, 0.32\textwidth,
0.35\textwidth, 0.35\textwidth,
0.4\textwidth, 0.4\textwidth}
\begin{shapedcutout}{2}{12}{\Margins}% 2 normal lines, 12 shaped lines


enter image description here


Here is a similar play-by-play of what was described by @KarlOveHufthammer in his excellent answer regarding the coat-of-arms construction using Xfig. I'm running Windows 7 with Cygwin/X, and is therefore also able to use Xfig (version 3.2.5b). I also have transfig (version 3.2.5c-1, also called fig2dev) installed as part of the Cygwin/X distribution setup:

  1. Open Xfig and set up a comfortable view/zoom level that is detailed enough. It does not have to be perfect, since LaTeX will resize the paragraph shape as specified using \shapepar to match whatever text you want to put into it.

    enter image description here

  2. Draw the outer shape of the paragraph. In this case I used the rectangle tool to draw a square.

    enter image description here

  3. Once complete, edit the rectangle and add the comment "+" (without the quotes).

    enter image description here

  4. Now draw the interior cut-out shape. In this case I used the circle tool.

    enter image description here

  5. Once complete, edit the rectangle and add the comment "-" (without the quotes).

    enter image description here

  6. Save the image in Xfig format as (say) myshape.fig.

    enter image description here

    The Xfig file looks like this:

    #FIG 3.2  Produced by xfig version 3.2.5b
    1200 2
    # -
    1 3 0 1 0 7 50 -1 -1 0.000 1 0.0000 3000 3000 1500 1500 3000 3000 4500 3000
    # +
    2 2 0 1 0 7 50 -1 -1 0.000 0 0 -1 0 0 5
         0 0 6000 0 6000 6000 0 6000 0 0
  7. Execute:

    fig2dev -L shape -n myshape myshape.fig myshape.shape

    The flag -L sets the output language used to shape (that conforms to shapepar). Other languages also exist, but this option should be specified first. The flag -n sets the name to be used within the output file myshape.shape. So, using -L shape -n <name> will create \<name>par. The output myshape.shape from myshape.fig now contains the newly-created macro \myshapepar{<par>} where the paragraph definition in "shape language" is given by \myshapeshape:

  8. Create and compile your TeX file:

    \usepackage{shapepar}% http://ctan.org/pkg/shapepar
    \usepackage{lipsum}% http://ctan.org/pkg/lipsum
    \input{myshape.shape}% Contains \myshapepar{<par>}

    enter image description here

    As mentioned, the size of the shape is not necessary. If you supply \lipsum*[1] instead (a shorter paragraph text), the output resembles:

    enter image description here

    Also note the use of \lipsum*. \shapepar does not allow the use of \par. Line breaking is achieved using \\.

Image insertion is achieved with an overlay, by moving the image to appropriate position using horizontal/vertical skips or otherwise.

  • Thank you, is not working because I could not install the transfig plugin in Ubuntu. Nov 12, 2011 at 5:34
  • With the shape defined already in the code above, you can just use it without having to install transfig. The answer merely shows how it can be achieved. In your specific case, the answer (shape-wise) matches your post exactly.
    – Werner
    Nov 12, 2011 at 5:36
  • @RegisdaSilva: Your original question shows the shape of a square-ish block with a circle in the middle that has the text removed. That shape is contained in my answer. If that is sufficient for your purpose, then you can use the code as provided. If you want the shape to be different (say, taller vertically, or with the cut-out circle not centered), then you either have to edit the \myshapeshape macro manually using the guidelines of the shapepar documentation, or use the above steps to recreate an alternative shape.
    – Werner
    Nov 12, 2011 at 6:42
  • You can override the command rput some other way to dispose of the package pstricks? Nov 14, 2011 at 3:09
  • 1
    @NikosAlexandris: You could use tikz and it's remember overlay specification; textpos or esopic. Any one of those would work. Alternatively you could make the image non-existent (in terms of its real estate and then push it left/right up/down into position (\smash{\raisebox[<down>]{<up>}{\makebox[0pt]{\hspace{<left>}\includegraphics{...}\hspace{<right>}}}}).
    – Werner
    Sep 3, 2012 at 14:50

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.