ntg-context - mailing list for ConTeXt users
 help / color / mirror / Atom feed
* Verbatim with color background
@ 2008-09-03 21:50 B. Tommy Jensen
  2008-09-04  8:12 ` Hans Hagen
  0 siblings, 1 reply; 6+ messages in thread
From: B. Tommy Jensen @ 2008-09-03 21:50 UTC (permalink / raw)
  To: ntg-context

Hi,
I have a short question about verbatim areas (\starttyping):

I have been trying to define a background color to verbatim
areas in a document. My method so far is to define a
textbackground named "verbatim" and refer to this in the
setuptyping method:

\setuptyping[typing][margin=0.5cm,bodyfont=8.0pt,
before={\starttextbackground[verbatim]},
after={\stoptextbackground}]

This works only partly. For example, when using long
verbatim texts that spans over more than one page,
the background color disappears on the last page.

Is there any other easy way of controlling the background
color on verbatim areas?

Best regards,
Tommy Jensen
___________________________________________________________________________________
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  : https://foundry.supelec.fr/projects/contextrev/
wiki     : http://contextgarden.net
___________________________________________________________________________________


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

* Re: Verbatim with color background
  2008-09-03 21:50 Verbatim with color background B. Tommy Jensen
@ 2008-09-04  8:12 ` Hans Hagen
  2008-09-04  9:49   ` B. Tommy Jensen
  0 siblings, 1 reply; 6+ messages in thread
From: Hans Hagen @ 2008-09-04  8:12 UTC (permalink / raw)
  To: mailing list for ConTeXt users

B. Tommy Jensen wrote:
> Hi,
> I have a short question about verbatim areas (\starttyping):
> 
> I have been trying to define a background color to verbatim
> areas in a document. My method so far is to define a
> textbackground named "verbatim" and refer to this in the
> setuptyping method:
> 
> \setuptyping[typing][margin=0.5cm,bodyfont=8.0pt,
> before={\starttextbackground[verbatim]},
> after={\stoptextbackground}]
> 
> This works only partly. For example, when using long
> verbatim texts that spans over more than one page,
> the background color disappears on the last page.
> 
> Is there any other easy way of controlling the background
> color on verbatim areas?

can you make a small example that shows where it goes wrong?

-----------------------------------------------------------------
                                           Hans Hagen | PRAGMA ADE
               Ridderstraat 27 | 8061 GH Hasselt | The Netherlands
      tel: 038 477 53 69 | fax: 038 477 53 74 | www.pragma-ade.com
                                              | www.pragma-pod.nl
-----------------------------------------------------------------
___________________________________________________________________________________
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  : https://foundry.supelec.fr/projects/contextrev/
wiki     : http://contextgarden.net
___________________________________________________________________________________


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

* Re: Verbatim with color background
  2008-09-04  8:12 ` Hans Hagen
@ 2008-09-04  9:49   ` B. Tommy Jensen
  2008-09-05 17:41     ` Hans Hagen
  0 siblings, 1 reply; 6+ messages in thread
From: B. Tommy Jensen @ 2008-09-04  9:49 UTC (permalink / raw)
  To: mailing list for ConTeXt users

On Thu, 04 Sep 2008 10:12:47 +0200, Hans Hagen <pragma@wxs.nl> wrote:

>> Is there any other easy way of controlling the background
>> color on verbatim areas?
>
> can you make a small example that shows where it goes wrong?
>

The example I used is shown below. Other observations are:

  - The code works with mkIV but not mkII
  - Removing the chapters in the test file also make it work with mkII
  - I am using the latest win32 standalone ConTeXt

Best regards,
Tommy Jensen


% START EXAMPLE

\setupcolors[state=start]

% We use Palatino as the main body font
\usetypescript[palatino][ec]
\setupbodyfont[palatino,10pt]

\definetextbackground[verbatim]
[background=color,
backgroundcolor=yellow,
backgroundoffset=0cm,
offset=0.5cm,
frame=on,
framecolor=black,
location=paragraph,
color=black]

% Setup verbatim
\setuptyping[typing][margin=1cm,bodyfont=8.0pt,
before={\starttextbackground[verbatim]},
after={\stoptextbackground}]

\starttext

\chapter{One}
Chapter one.

\chapter{Two}
Chapter two.

\chapter{Three}
Chapter three.

\starttyping
This is a long verbatim section.
This is a long verbatim section.
This is a long verbatim section.
This is a long verbatim section.
This is a long verbatim section.
This is a long verbatim section.
This is a long verbatim section.
This is a long verbatim section.
This is a long verbatim section.
This is a long verbatim section.
This is a long verbatim section.
This is a long verbatim section.
This is a long verbatim section.
This is a long verbatim section.
This is a long verbatim section.
This is a long verbatim section.
This is a long verbatim section.
This is a long verbatim section.
This is a long verbatim section.
This is a long verbatim section.
This is a long verbatim section.
This is a long verbatim section.
This is a long verbatim section.
This is a long verbatim section.
This is a long verbatim section.
This is a long verbatim section.
This is a long verbatim section.
This is a long verbatim section.
This is a long verbatim section.
This is a long verbatim section.
This is a long verbatim section.
This is a long verbatim section.
This is a long verbatim section.
This is a long verbatim section.
This is a long verbatim section.
This is a long verbatim section.
This is a long verbatim section.
This is a long verbatim section.
This is a long verbatim section.
This is a long verbatim section.
This is a long verbatim section.
This is a long verbatim section.
This is a long verbatim section.
This is a long verbatim section.
This is a long verbatim section.
This is a long verbatim section.
This is a long verbatim section.
This is a long verbatim section.
This is a long verbatim section.
This is a long verbatim section.
This is a long verbatim section.
This is a long verbatim section.
This is a long verbatim section.
This is a long verbatim section.
This is a long verbatim section.
This is a long verbatim section.
This is a long verbatim section.
This is a long verbatim section.
This is a long verbatim section.
This is a long verbatim section.
This is a long verbatim section.
This is a long verbatim section.
This is a long verbatim section.
This is a long verbatim section.
This is a long verbatim section.
This is a long verbatim section.
This is a long verbatim section.
This is a long verbatim section.
This is a long verbatim section.
This is a long verbatim section.
This is a long verbatim section.
This is a long verbatim section.
This is a long verbatim section.
This is a long verbatim section.
This is a long verbatim section.
This is a long verbatim section.
This is a long verbatim section.
This is a long verbatim section.
This is a long verbatim section.
This is a long verbatim section.
This is a long verbatim section.
This is a long verbatim section.
This is a long verbatim section.
This is a long verbatim section.
This is a long verbatim section.
This is a long verbatim section.
This is a long verbatim section.
This is a long verbatim section.
This is a long verbatim section.
This is a long verbatim section.
This is a long verbatim section.
This is a long verbatim section.
This is a long verbatim section.
This is a long verbatim section.
This is a long verbatim section.
This is a long verbatim section.
This is a long verbatim section.
This is a long verbatim section.
This is a long verbatim section.
This is a long verbatim section.
This is a long verbatim section.
This is a long verbatim section.
This is a long verbatim section.
This is a long verbatim section.
This is a long verbatim section.
This is a long verbatim section.
This is a long verbatim section.
This is a long verbatim section.
This is a long verbatim section.
This is a long verbatim section.
This is a long verbatim section.
This is a long verbatim section.
This is a long verbatim section.
This is a long verbatim section.
This is a long verbatim section.
This is a long verbatim section.
This is a long verbatim section.
This is a long verbatim section.
This is a long verbatim section.
This is a long verbatim section.
This is a long verbatim section.
This is a long verbatim section.
This is a long verbatim section.
This is a long verbatim section.
This is a long verbatim section.
This is a long verbatim section.
This is a long verbatim section.
This is a long verbatim section.
This is a long verbatim section.
This is a long verbatim section.
This is a long verbatim section.
This is a long verbatim section.
This is a long verbatim section.
This is a long verbatim section.
\stoptyping

\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  : https://foundry.supelec.fr/projects/contextrev/
wiki     : http://contextgarden.net
___________________________________________________________________________________


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

* Re: Verbatim with color background
  2008-09-04  9:49   ` B. Tommy Jensen
@ 2008-09-05 17:41     ` Hans Hagen
  2008-09-08  0:51       ` Aditya Mahajan
  0 siblings, 1 reply; 6+ messages in thread
From: Hans Hagen @ 2008-09-05 17:41 UTC (permalink / raw)
  To: mailing list for ConTeXt users

B. Tommy Jensen wrote:
> On Thu, 04 Sep 2008 10:12:47 +0200, Hans Hagen <pragma@wxs.nl> wrote:
> 
>>> Is there any other easy way of controlling the background
>>> color on verbatim areas?
>> can you make a small example that shows where it goes wrong?
>>
> 
> The example I used is shown below. Other observations are:
> 
>   - The code works with mkIV but not mkII
>   - Removing the chapters in the test file also make it work with mkII
>   - I am using the latest win32 standalone ConTeXt

works ok here


-----------------------------------------------------------------
                                           Hans Hagen | PRAGMA ADE
               Ridderstraat 27 | 8061 GH Hasselt | The Netherlands
      tel: 038 477 53 69 | fax: 038 477 53 74 | www.pragma-ade.com
                                              | www.pragma-pod.nl
-----------------------------------------------------------------
___________________________________________________________________________________
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  : https://foundry.supelec.fr/projects/contextrev/
wiki     : http://contextgarden.net
___________________________________________________________________________________


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

* Re: Verbatim with color background
  2008-09-05 17:41     ` Hans Hagen
@ 2008-09-08  0:51       ` Aditya Mahajan
  2008-09-08  0:59         ` Aditya Mahajan
  0 siblings, 1 reply; 6+ messages in thread
From: Aditya Mahajan @ 2008-09-08  0:51 UTC (permalink / raw)
  To: mailing list for ConTeXt users

On Fri, 5 Sep 2008, Hans Hagen wrote:

> B. Tommy Jensen wrote:
>> On Thu, 04 Sep 2008 10:12:47 +0200, Hans Hagen <pragma@wxs.nl> wrote:
>>
>>>> Is there any other easy way of controlling the background
>>>> color on verbatim areas?
>>> can you make a small example that shows where it goes wrong?
>>>
>>
>> The example I used is shown below. Other observations are:
>>
>>   - The code works with mkIV but not mkII
>>   - Removing the chapters in the test file also make it work with mkII
>>   - I am using the latest win32 standalone ConTeXt
>
> works ok here

Works ok here also (linux + latex minimals)

Aditya
___________________________________________________________________________________
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  : https://foundry.supelec.fr/projects/contextrev/
wiki     : http://contextgarden.net
___________________________________________________________________________________


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

* Re: Verbatim with color background
  2008-09-08  0:51       ` Aditya Mahajan
@ 2008-09-08  0:59         ` Aditya Mahajan
  0 siblings, 0 replies; 6+ messages in thread
From: Aditya Mahajan @ 2008-09-08  0:59 UTC (permalink / raw)
  To: mailing list for ConTeXt users

On Sun, 7 Sep 2008, Aditya Mahajan wrote:

> On Fri, 5 Sep 2008, Hans Hagen wrote:
>
>> B. Tommy Jensen wrote:
>>> On Thu, 04 Sep 2008 10:12:47 +0200, Hans Hagen <pragma@wxs.nl> wrote:
>>>
>>>>> Is there any other easy way of controlling the background
>>>>> color on verbatim areas?
>>>> can you make a small example that shows where it goes wrong?
>>>>
>>>
>>> The example I used is shown below. Other observations are:
>>>
>>>   - The code works with mkIV but not mkII
>>>   - Removing the chapters in the test file also make it work with mkII
>>>   - I am using the latest win32 standalone ConTeXt
>>
>> works ok here
>
> Works ok here also (linux + latex minimals)
                               ^^^^^

Sigh... I meant latest minimals


Aditya

___________________________________________________________________________________
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  : https://foundry.supelec.fr/projects/contextrev/
wiki     : http://contextgarden.net
___________________________________________________________________________________


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

end of thread, other threads:[~2008-09-08  0:59 UTC | newest]

Thread overview: 6+ messages (download: mbox.gz / follow: Atom feed)
-- links below jump to the message on this page --
2008-09-03 21:50 Verbatim with color background B. Tommy Jensen
2008-09-04  8:12 ` Hans Hagen
2008-09-04  9:49   ` B. Tommy Jensen
2008-09-05 17:41     ` Hans Hagen
2008-09-08  0:51       ` Aditya Mahajan
2008-09-08  0:59         ` Aditya Mahajan

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).