{{todo|Add more examples of usage of textbackgrounds.}}
== Basics == Pages, paragraphs, words can have a background color or frame[[Overlays|overlay]]. ConTeXt creates these using [[MetaPost]]. But a usual frame is only one object, its contents can’t flow over to the next page. You can use {{cmd|definetextbackground}} to define a named text background. The environment is based on {{cmd|framed}} and understands its parameters, but can contain several paragraphs and page breaks. After `\definetextbackground[Name]` you can use `\startName ... \stopName` (if there’s no name conflict) or `\starttextbackground[Name] ... \stoptextbackground`. Usually you won’t need {{cmd|setuptextbackground}}. The `location` parameter changes the behaviour between `text` (highlighting running text) and `paragraph` (boxed paragraphs).
(See, eventually, the [[manual:details.pdf| details]] manual or the {{src|anch-bck.mkvi|source}} for further explanations.)
'''Beware''': The examples using {{cmd|startnarrower}} may be misleading – of course you can use {{cmd|startbackground}} without the `narrower` environment; it behaves differently without `\starttext ... \stoptext`.
== Example: multi-page backgrounded text ==
frame=off,]
\input starttext\samplefile{knuth}
\startsecondary
\input samplefile{knuth}
\stopsecondary
\input samplefile{knuth}\stoptext
</context>
frame=off,]
\input starttext\samplefile{knuth}
\startsecondary
\input samplefile{knuth}
\stopsecondary
\input samplefile{knuth}\stoptext
</context>
Underlining is generally frowned upon by experienced TeXnicians. Occasionally,
however, it is necessary and <{{cmd>|ul</cmd> }} or <{{cmd>|underbar</cmd> }} doesn’t do what you want. In thosecases using <{{cmd>|definetextbackground</cmd> }} for the underlining may also be tried.