ntg-context - mailing list for ConTeXt users
 help / color / mirror / Atom feed
From: <Robin.Kirkham@csiro.au>
To: <ntg-context@ntg.nl>
Subject: Textbackgrounds interrupted by floats
Date: Tue, 7 Apr 2015 11:31:18 +0000	[thread overview]
Message-ID: <024375AD-46AD-4F85-AEE3-D09FB765EBB9@csiro.au> (raw)

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
___________________________________________________________________________________

             reply	other threads:[~2015-04-07 11:31 UTC|newest]

Thread overview: 3+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2015-04-07 11:31 Robin.Kirkham [this message]
2015-04-07 11:53 ` Wolfgang Schuster
     [not found] <mailman.48.1428421233.2431.ntg-context@ntg.nl>
2015-04-08 12:12 ` Robin.Kirkham

Reply instructions:

You may reply publicly to this message via plain-text email
using any one of the following methods:

* Save the following mbox file, import it into your mail client,
  and reply-to-all from there: mbox

  Avoid top-posting and favor interleaved quoting:
  https://en.wikipedia.org/wiki/Posting_style#Interleaved_style

* Reply using the --to, --cc, and --in-reply-to
  switches of git-send-email(1):

  git send-email \
    --in-reply-to=024375AD-46AD-4F85-AEE3-D09FB765EBB9@csiro.au \
    --to=robin.kirkham@csiro.au \
    --cc=ntg-context@ntg.nl \
    /path/to/YOUR_REPLY

  https://kernel.org/pub/software/scm/git/docs/git-send-email.html

* If your mail client supports setting the In-Reply-To header
  via mailto: links, try the mailto: link
Be sure your reply has a Subject: header at the top and a blank line before the message body.
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).