ntg-context - mailing list for ConTeXt users
 help / color / mirror / Atom feed
* Simple backgrounds not working
@ 2012-05-26  2:57 Aditya Mahajan
  2012-05-26  8:56 ` Wolfgang Schuster
  0 siblings, 1 reply; 5+ messages in thread
From: Aditya Mahajan @ 2012-05-26  2:57 UTC (permalink / raw)
  To: mailing list for ConTeXt users

Hi,

Simple backgrounds are not working with the latest beta. The following has 
no background color.

\setupbackground
   [background=color, backgroundcolor=red]
\starttext
\startbackground
   ABC
\stopbackground
\stoptext

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


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

* Re: Simple backgrounds not working
  2012-05-26  2:57 Simple backgrounds not working Aditya Mahajan
@ 2012-05-26  8:56 ` Wolfgang Schuster
  2012-05-26  9:26   ` Hans Hagen
  0 siblings, 1 reply; 5+ messages in thread
From: Wolfgang Schuster @ 2012-05-26  8:56 UTC (permalink / raw)
  To: mailing list for ConTeXt users; +Cc: Hans Hagen


Am 26.05.2012 um 04:57 schrieb Aditya Mahajan:

> Hi,
> 
> Simple backgrounds are not working with the latest beta. The following has no background color.
> 
> \setupbackground
>  [background=color, backgroundcolor=red]
> \starttext
> \startbackground
>  ABC
> \stopbackground
> \stoptext

Name clash in pack-rul.mkiv.

\startbackgorund uses \currentbackground for the instance of the environment and \framed uses also \currentbackground when it does process the list of backgrounds, changing the macro name in pack-rul.mkiv to \m_framed_background helps.

\unprotect

%\let\currentbackground\empty
\let\m_framed_background\empty

\def\pack_framed_process_background
%  {\ifcsname\??overlaybuiltin\currentbackground\endcsname
  {\ifcsname\??overlaybuiltin\m_framed_background\endcsname
     \pack_framed_process_background_indeed_internal
%   \else\ifcsname\??overlay\currentbackground\endcsname
   \else\ifcsname\??overlay\m_framed_background\endcsname
     \pack_framed_process_background_indeed_external
   \fi\fi}

\def\pack_framed_process_background_indeed_internal % : in name
  {\bgroup
   \setbox\b_framed_extra\hbox{%\bgroup
     \ifzeropt\framedbackgroundoffset
%       \csname\??overlaybuiltin\currentbackground\endcsname
       \csname\??overlaybuiltin\m_framed_background\endcsname
     \else
       \kern-\framedbackgroundoffset
%       \hbox{\csname\??overlaybuiltin\currentbackground\endcsname}%
       \hbox{\csname\??overlaybuiltin\m_framed_background\endcsname}%
     \fi
   }%\egroup
   \wd\b_framed_extra\zeropoint
   \ht\b_framed_extra\framedbackgroundheight
   \dp\b_framed_extra\framedbackgrounddepth
   \box\b_framed_extra
   \egroup}

\def\pack_framed_process_background_indeed_external
  {\pack_framed_overlay_initialize
   \bgroup
   \setbox\b_framed_extra\hbox{%\bgroup
     \ifzeropt\framedbackgroundoffset
%       \csname\??overlay\currentbackground\endcsname
       \csname\??overlay\m_framed_background\endcsname
     \else
       \kern-\framedbackgroundoffset
%       \hbox{\csname\??overlay\currentbackground\endcsname}%
       \hbox{\csname\??overlay\m_framed_background\endcsname}%
     \fi
   }%\egroup
   \wd\b_framed_extra\zeropoint
   \ht\b_framed_extra\framedbackgroundheight
   \dp\b_framed_extra\framedbackgrounddepth
   \box\b_framed_extra
   \egroup}

\def\pack_framed_process_backgrounds#1,#2% #2 gobbles spaces (we could avoid one catch if we have nextbackground)
%  {\edef\currentbackground{#1}%
  {\edef\m_framed_background{#1}%
%   \ifx\currentbackground\s!unknown\else
   \ifx\m_framed_background\s!unknown\else
     \pack_framed_process_background
     \expandafter\pack_framed_process_backgrounds
   \fi#2}

\protect

\setupbackground
 [background=color,
  backgroundcolor=yellow]

\starttext

\startbackground
 ABC
\stopbackground

\stoptext

Wolfgang
___________________________________________________________________________________
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] 5+ messages in thread

* Re: Simple backgrounds not working
  2012-05-26  8:56 ` Wolfgang Schuster
@ 2012-05-26  9:26   ` Hans Hagen
  2012-05-26 14:07     ` Aditya Mahajan
  0 siblings, 1 reply; 5+ messages in thread
From: Hans Hagen @ 2012-05-26  9:26 UTC (permalink / raw)
  To: Wolfgang Schuster; +Cc: mailing list for ConTeXt users

On 26-5-2012 10:56, Wolfgang Schuster wrote:
>
> Am 26.05.2012 um 04:57 schrieb Aditya Mahajan:
>
>> Hi,
>>
>> Simple backgrounds are not working with the latest beta. The following has no background color.
>>
>> \setupbackground
>>   [background=color, backgroundcolor=red]
>> \starttext
>> \startbackground
>>   ABC
>> \stopbackground
>> \stoptext
>
> Name clash in pack-rul.mkiv.
>
> \startbackgorund uses \currentbackground for the instance of the environment and \framed uses also \currentbackground when it does process the list of backgrounds, changing the macro name in pack-rul.mkiv to \m_framed_background helps.
>
> \unprotect
>
> %\let\currentbackground\empty
> \let\m_framed_background\empty

Ha, you beat me in maling ... i just changed that in the same way ... 
but i was wondering why a public name was used .. can it be that 
\currentbackground is used in modules or styles (e.g. implementing 
alternative built in backgrounds as I remember that Aditya has some 
plugs)?  If so then at some point we might need a public name but let's 
wait till it shows up.

Hans



-----------------------------------------------------------------
                                           Hans Hagen | PRAGMA ADE
               Ridderstraat 27 | 8061 GH Hasselt | The Netherlands
     tel: 038 477 53 69 | voip: 087 875 68 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  : http://foundry.supelec.fr/projects/contextrev/
wiki     : http://contextgarden.net
___________________________________________________________________________________


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

* Re: Simple backgrounds not working
  2012-05-26  9:26   ` Hans Hagen
@ 2012-05-26 14:07     ` Aditya Mahajan
  2012-05-26 14:44       ` Hans Hagen
  0 siblings, 1 reply; 5+ messages in thread
From: Aditya Mahajan @ 2012-05-26 14:07 UTC (permalink / raw)
  To: Hans Hagen; +Cc: mailing list for ConTeXt users

On Sat, 26 May 2012, Hans Hagen wrote:

> Ha, you beat me in maling ... i just changed that in the same way ...

Thanks to both of you.

>  but i 
> was wondering why a public name was used .. can it be that \currentbackground 
> is used in modules or styles (e.g. implementing alternative built in 
> backgrounds as I remember that Aditya has some plugs)?  If so then at some 
> point we might need a public name but let's wait till it shows up.

I remeber using

\setupbackgrounds[page][background={bck1, \currentbackground, bck2}]

in some of my local styles. It is easy for me to adapt that.

\currentbackground is not used in any of my public modules.

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


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

* Re: Simple backgrounds not working
  2012-05-26 14:07     ` Aditya Mahajan
@ 2012-05-26 14:44       ` Hans Hagen
  0 siblings, 0 replies; 5+ messages in thread
From: Hans Hagen @ 2012-05-26 14:44 UTC (permalink / raw)
  To: Aditya Mahajan; +Cc: mailing list for ConTeXt users

On 26-5-2012 16:07, Aditya Mahajan wrote:
> On Sat, 26 May 2012, Hans Hagen wrote:
>
>> Ha, you beat me in maling ... i just changed that in the same way ...
>
> Thanks to both of you.
>
>> but i was wondering why a public name was used .. can it be that
>> \currentbackground is used in modules or styles (e.g. implementing
>> alternative built in backgrounds as I remember that Aditya has some
>> plugs)? If so then at some point we might need a public name but let's
>> wait till it shows up.
>
> I remeber using
>
> \setupbackgrounds[page][background={bck1, \currentbackground, bck2}]
>
> in some of my local styles. It is easy for me to adapt that.
>
> \currentbackground is not used in any of my public modules.

maybe we can have \currentframedbackground then (if needed)

Hans

-----------------------------------------------------------------
                                           Hans Hagen | PRAGMA ADE
               Ridderstraat 27 | 8061 GH Hasselt | The Netherlands
     tel: 038 477 53 69 | voip: 087 875 68 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  : http://foundry.supelec.fr/projects/contextrev/
wiki     : http://contextgarden.net
___________________________________________________________________________________


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

end of thread, other threads:[~2012-05-26 14:44 UTC | newest]

Thread overview: 5+ messages (download: mbox.gz / follow: Atom feed)
-- links below jump to the message on this page --
2012-05-26  2:57 Simple backgrounds not working Aditya Mahajan
2012-05-26  8:56 ` Wolfgang Schuster
2012-05-26  9:26   ` Hans Hagen
2012-05-26 14:07     ` Aditya Mahajan
2012-05-26 14:44       ` Hans Hagen

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