ntg-context - mailing list for ConTeXt users
 help / color / mirror / Atom feed
From: Hans Hagen <pragma@wxs.nl>
Cc: "ConTeXt Mailing List" <ntg-context@ntg.nl>
Subject: Re: Descriptions/enumerations with a background
Date: Mon, 16 Sep 2002 22:05:56 +0200	[thread overview]
Message-ID: <5.1.0.14.1.20020916215636.026eb7c0@server-1> (raw)
In-Reply-To: <MFEFJNAPONLOLJPIHFBIOENJDGAA.dh@capdm.com>

At 08:22 AM 9/10/2002 +0100, Duncan Hothersall wrote:
>Hello all,
>
>I have been trying to set up an enumeration to have a background screen.
>Having completely failed, I ended up putting a \startbackground ...
>\stopbackground pair inside the \startsubactivity ... \stopsubactivity, but
>this does strange things with page breaks, presumbly because it is
>interfering with the glue between the enumeration title and the body of it.
>
>Can anyone help me with a \defineenumeration or \setupenumeration parameter
>that will make the background go grey? Here's what I have up top:
>
>\defineenumeration[activity]
>         [text=Activity,
>         before={\blank[2*big]},
>         after={\blank[2*big]}]
>
>\setupenumerations[activity]
>         [headstyle=\ss\tfa]
>
>\setupbackground
>         [background=screen,
>         corner=round,
>         offset=6pt]
>
>Here's what I currently do, which doesn't work well:
>
>\startsubactivity
>\startbackground
>This text sometimes jumps over a page break even when there is lots of space
>on the page.
>
>It can have more than one paragraph in it.
>\stopbackground
>\stopsubactivity

hm, probably it's better to move the background commands out of the 
subactivity

>And here's what I'd like to do:
>
>\startsubactivity
>This text behaves well and has a grey box behind it.
>
>It can have more than one paragraph in it too.
>\stopsubactivity
>
>Any pointers as to what to put at the top to make the bottom happen would be
>gratefully received.

The good news is:

\definetextbackground
   [activitybg]
   [location=paragraph,
    before={\blank[2*big]},
    after={\blank[2*big]}]

\defineenumeration
   [activity]
   [text=Activity,
    before=\startactivitybg,
    after=\stopactivitybg,
    headstyle=\ss\tfa]

\starttext

\startactivity
This text behaves well and has a grey box behind it. \par
It can have more than one paragraph in it too.       \par
It can have more than one paragraph in it too.       \par
\stopactivity

\stoptext

However, it will fail in your version due to a grouping mix up 
(before/after need to next properly); it's just a few lines that need to be 
swapped; i will post a new beta version.

[this new backgrounder is still under construction but will stabalize the 
next couple of month]

[a few more settings are needed to get the rounding and an offset, more on 
that later]

Hans
-------------------------------------------------------------------------
                                   Hans Hagen | PRAGMA ADE | pragma@wxs.nl
                       Ridderstraat 27 | 8061 GH Hasselt | The Netherlands
  tel: +31 (0)38 477 53 69 | fax: +31 (0)38 477 53 74 | www.pragma-ade.com
-------------------------------------------------------------------------
                        information: http://www.pragma-ade.com/roadmap.pdf
                     documentation: http://www.pragma-ade.com/showcase.pdf
-------------------------------------------------------------------------


  reply	other threads:[~2002-09-16 20:05 UTC|newest]

Thread overview: 9+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2002-09-10 10:52 Duncan Hothersall
2002-09-16 20:05 ` Hans Hagen [this message]
2002-09-17 16:14   ` Duncan Hothersall
2002-09-19 14:05   ` MathML questions Duncan Hothersall
2002-09-19 16:00     ` Hans Hagen
2002-09-23 10:48       ` MathML questions (long) Duncan Hothersall
2002-09-24  7:46         ` Hans Hagen
2002-09-24 13:14           ` Duncan Hothersall
2002-09-24  7:53         ` Hans Hagen

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=5.1.0.14.1.20020916215636.026eb7c0@server-1 \
    --to=pragma@wxs.nl \
    --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).