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 am using ConTeXt to make a document containing many illustrations. Some will appear placed like this (the area in brackets is where the illustration will appear:

This is some text. This is some text.
[                       ] X This is some
[                       ] text. This
[                       ] is some text.
[                       ] This is some
[                       ] text. This
[                       ] is some text.
[                       ] This is some
text. This is some text. This is some

In this example, the graphic is exactly 7 rows high, the width is adjusted to match a 1:1 ratio. The top of the graphic aligns with the top of the text in the 2nd row and the bottom of the graphic aligns with the bottom of the text in the 8th row.

  • How can I place a graphic in my document in this way, by defining the number of rows the graphic must span?
share|improve this question
up vote 5 down vote accepted

Marco has already answered how to place the figure on the left, and how to set the height of the figure to a specific number of lines.

You also wanted the figure to start one line below the start of the paragraph. To do this, add hang to the location parameter. To start two lines below the start of the paragraph, add 2*hang etc.

For example (I use the visual module for dummy text):

\usemodule [visual]

\setupfloats [spacebefore=, spaceafter=]

\startplacefigure [location={left,none,2*hang}]

gives the following (the blue rectangles denote parindent in front of new paragraphs)

enter image description here

share|improve this answer

The following should do what you want.

\useMPlibrary [dum]

\setupfloats [spacebefore=, spaceafter=]

\input ward

\startplacefigure [location={left,none}]
    \externalfigure [dum] [height=8\lineheight]

\input knuth  

The MP library is just used for the dummy graphic. According to your graphic there should be no space above and below the graphic, so I removed it. Then it is as easy as telling ConTeXt that the graphic should be placed on the left and telling \externalfigure the height of the image. The aspect ratio is kept automatically, if you don't want this then specify the width as well.

The result:


share|improve this answer
Does the figure have to be placed at a paragraph break? (I guess yes.) – Bruno Le Floch Mar 1 '12 at 11:58
It's the other way around. \startplacefigure starts a new paragraph. I don't know of any option to avoid that. However, \stopplacefigure doesn't end the paragraph. – Marco Mar 1 '12 at 12:26

Your Answer


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.