ntg-context - mailing list for ConTeXt users
 help / color / mirror / Atom feed
* Textbackgrounds interrupted by floats
@ 2015-04-07 11:31 Robin.Kirkham
  2015-04-07 11:53 ` Wolfgang Schuster
  0 siblings, 1 reply; 3+ messages in thread
From: Robin.Kirkham @ 2015-04-07 11:31 UTC (permalink / raw)
  To: ntg-context

Folks,

Here is problem that must have been asked about before, but I can’t seem to find a solution on the archive or anywhere else. I want a colour background for verbatim text (for code), and floating figures. However if a figure floats to the bottom (as in the example below), and the verbatim text is broken over to the next page because it is long, I don’t want the colour background under the figure as well — I want no background at all.

What is the correct setup to do that?

Thanks, Robin

\setupexternalfigures[location=default]
\setupcolors[state=start]

\definetextbackground[code][
    frame=off,
    location=paragraph,
    background=color,
    backgroundcolor=yellow]
\setuptyping[typing][
    %option=color,
    before={\starttextbackground[code]},
    after=\stoptextbackground]

\starttext

\startplacefigure[location=bottom]
\externalfigure[cow][width=0.5\textwidth]
\stopplacefigure

\input tufte

\starttyping
Long
Long
Long
Long
Long
Long
Long
Long
Long
Long
Long
Long
Long
Long
Long
Long
Long
Long
Long
Long
Long
Long
Long
Long
Long
Long
Long
\stoptyping

\input tufte

\stoptext
___________________________________________________________________________________
If your question is of interest to others as well, please add an entry to the Wiki!

maillist : ntg-context@ntg.nl / http://www.ntg.nl/mailman/listinfo/ntg-context
webpage  : http://www.pragma-ade.nl / http://tex.aanhet.net
archive  : http://foundry.supelec.fr/projects/contextrev/
wiki     : http://contextgarden.net
___________________________________________________________________________________

^ permalink raw reply	[flat|nested] 3+ messages in thread

end of thread, other threads:[~2015-04-08 12:12 UTC | newest]

Thread overview: 3+ messages (download: mbox.gz / follow: Atom feed)
-- links below jump to the message on this page --
     [not found] <mailman.48.1428421233.2431.ntg-context@ntg.nl>
2015-04-08 12:12 ` Textbackgrounds interrupted by floats Robin.Kirkham
2015-04-07 11:31 Robin.Kirkham
2015-04-07 11:53 ` Wolfgang Schuster

This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox;
as well as URLs for NNTP newsgroup(s).