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
___________________________________________________________________________________

Reply via email to