Take the 2-minute tour ×
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.

That's it. I want to use a image pattern, let's say this image. But I can't figure how to do this on ConTeXt, 'cause neither \setupbackgrounds or \setupframed have an option to tile backgrounds. I suppose that could be done with Metapost, but I'm very noob at it... Any help is very appreciated!

share|improve this question
add comment

1 Answer

up vote 4 down vote accepted

Use \backgroundimage to tile any image. The syntax of this command is

\backgroundimage{repeat_type}{width}{height}{content}

where

  • repeat_type is either 1 (tile both x and y directions), 2 (tile in x direction), or 3 (tile in y direction),

  • width is a TeX dimension

  • height is a TeX dimension
  • content is the material you want to tile

The image is repeated until it equals width and height (if repeat_type is 1) or just the width (if repeat_type is 2), or height (if repeat_type is 3).

Thus you can use:

\defineoverlay
  [pattern]
  [\backgroundimage{1}{\overlaywidth}{\overlayheight}{\externalfigure[http://www.carolrivello.com/wp-content/themes/v7/imgs/bg.jpg]}]

\setupbackgrounds[page][background=pattern]

\starttext
\input knuth
\stoptext
share|improve this answer
    
It worked, thank you so much! I never thought the answer were so easy. However, I don't understand why \backgroundimage is not in any manual of ConTeXt... Thanks! –  acidrums4 Aug 29 '12 at 23:52
    
Because the ConTeXt manual is not exhaustive. You can help with the documentation by adding the above information to the wiki at contextgarden.net –  Aditya Aug 29 '12 at 23:54
add comment

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.