ntg-context - mailing list for ConTeXt users
 help / color / mirror / Atom feed
* textbackground
@ 2004-06-26 12:47 dr. Hans van der Meer
  2004-06-26 18:13 ` textbackground Hans Hagen Outside
  0 siblings, 1 reply; 9+ messages in thread
From: dr. Hans van der Meer @ 2004-06-26 12:47 UTC (permalink / raw)


Hans,

I definitely see problems  with the 
\starttextbackground[]-\stoptextbackground environment (discussed in 
the "displays"-brochure).

When the textbackground falls at a page crossing -- i.e. starts at the 
top of a page -- the coloring extends backwards on the page just left.
It can be remedied by putting a \null just in front of 
\starttextbackground. The extra vertical space this introduces just 
manages to constrain the background to its own page. However, this is 
not a general solution, on other places the extra vertical space is 
certainly not wanted.

I cannot find the exact nature of the problem. I suspect it has to do 
with the \output-routines, but these are not my speciality, to say the 
least. So, not much help there,

Also, the \starttextbackground does not respect footnotes, these are 
colored. In contrast, the old \startbackground-\stopbackground does 
respect footnotes. The coloring stops at the footnote and restarts at 
the next page. I should like that for \starttextbackground as well.

Hans van der Meer

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

* Re: textbackground
  2004-06-26 12:47 textbackground dr. Hans van der Meer
@ 2004-06-26 18:13 ` Hans Hagen Outside
  2004-06-27  8:38   ` textbackground dr. Hans van der Meer
  0 siblings, 1 reply; 9+ messages in thread
From: Hans Hagen Outside @ 2004-06-26 18:13 UTC (permalink / raw)


dr. Hans van der Meer wrote:

> Hans,
>
> I definitely see problems  with the 
> \starttextbackground[]-\stoptextbackground environment (discussed in 
> the "displays"-brochure).
>
> When the textbackground falls at a page crossing -- i.e. starts at the 
> top of a page -- the coloring extends backwards on the page just left.
> It can be remedied by putting a \null just in front of 
> \starttextbackground. The extra vertical space this introduces just 
> manages to constrain the background to its own page. However, this is 
> not a general solution, on other places the extra vertical space is 
> certainly not wanted.
>
> I cannot find the exact nature of the problem. I suspect it has to do 
> with the \output-routines, but these are not my speciality, to say the 
> least. So, not much help there,
>
> Also, the \starttextbackground does not respect footnotes, these are 
> colored. In contrast, the old \startbackground-\stopbackground does 
> respect footnotes. The coloring stops at the footnote and restarts at 
> the next page. I should like that for \starttextbackground as well.

can you make me a minimal example of where things go wrong (keep in mind that there are two methods, tex and paragraph) 

with respect to footnotes, maybe i can make that an option (there are more exceptions) 

Hans 

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

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

* Re: textbackground
  2004-06-26 18:13 ` textbackground Hans Hagen Outside
@ 2004-06-27  8:38   ` dr. Hans van der Meer
  2004-06-29  9:12     ` textbackground Hans Hagen
  2004-06-29  9:23     ` textbackground Hans Hagen
  0 siblings, 2 replies; 9+ messages in thread
From: dr. Hans van der Meer @ 2004-06-27  8:38 UTC (permalink / raw)



On 26-jun-04, at 20:13, Hans Hagen Outside wrote:

> dr. Hans van der Meer wrote:
>
>> Hans,
>>
>> I definitely see problems  with the 
>> \starttextbackground[]-\stoptextbackground environment (discussed in 
>> the "displays"-brochure).
>>
>> When the textbackground falls at a page crossing -- i.e. starts at 
>> the top of a page -- the coloring extends backwards on the page just 
>> left.
>> It can be remedied by putting a \null just in front of 
>> \starttextbackground. The extra vertical space this introduces just 
>> manages to constrain the background to its own page. However, this is 
>> not a general solution, on other places the extra vertical space is 
>> certainly not wanted.
>>
>> I cannot find the exact nature of the problem. I suspect it has to do 
>> with the \output-routines, but these are not my speciality, to say 
>> the least. So, not much help there,
>>
>> Also, the \starttextbackground does not respect footnotes, these are 
>> colored. In contrast, the old \startbackground-\stopbackground does 
>> respect footnotes. The coloring stops at the footnote and restarts at 
>> the next page. I should like that for \starttextbackground as well.
>
> can you make me a minimal example of where things go wrong (keep in 
> mind that there are two methods, tex and paragraph)
> with respect to footnotes, maybe i can make that an option (there are 
> more exceptions)
> Hans
>

Here is the smallest one I could construct that shows the page crossing 
effect. I used the "location=paragraph". With "location=text" I did not 
experiment.
Here follows the code:

% testing textbackgroundcolor
\setupbodyfont[12pt]	% using the default cmr font
\setuppapersize[S6][S6]
\setuplayout[width=middle,location=middle,header=0pt,footer=4ex]
\setuppagenumbering[location={footer,inright},alternative=singlesided]
%
\setupcolors [state=start]
\definecolor [lavender]		[r=.901961,g=.901961,b=.980392]
\definecolor [lavenderblush]	[r=1,g=.941176,b=.960784]
% general page coloring

\setupbackgrounds[page][background=color,backgroundcolor=lavenderblush]
%
% special background coloring for parts of the text
\definetextbackground[A][frame=off,location=paragraph,
	backgroundcolor=lavender,backgroundoffset=0pt]
\starttext
%
\dorecurse{10}{Some text that must fill a portion of the page. }\par
\dorecurse{10}{Some text that must fill a portion of the page. }\par
\dorecurse{10}{Some text that must fill a portion of the page. }\par
%
% WITH 8 AND 9 IN THE NEXT RECURSION THE FIRST PARAGRAPH ON PAGE 2 HAS
% THE BACKGROUND COLORED BUT THE WHITESPACE BELOW THE LAST PARAGRAPH ON
% PAGE 1 IS COLORED TOO.
% CHANGE THE 8/9 TO 10 AND THE COLORING ON PAGE 1 DISPAPPEARS.
% I HAVE BECOME ACROSS SITUATIONS WERE THE COLORING EXTENDED STILL
% FURTHER BACK OVER MORE PRECEDING PARAGRAPHS, BUT IT IS DIFFICULT TO
% CONSTRUCT A MINIMAL EXAMPLE FOR THAT.
\dorecurse{9}{Some text that must fill a portion of the page. }\par
%
% THIS SHOULD COLOR THE FIRST PARAGRAPH ON PAGE 2
\starttextbackground[A]
\dorecurse{5}{Text with the background. }
\stoptextbackground
\dorecurse{10}{Some text that must fill a portion of the page. }\par
%
\stoptext

I hope you can find what causes it, because I like the effects.

Keeping footnotes free from the coloring would be very great if it 
could be accomplished (same as for interposed floats), like:

-- text on page containing reference to footnote, not colored background
-- text on page with colored background
-- footnote not colored (or perhaps the same coloring as where the 
reference occurs?)
-- text on next page goes on with colored background

Hans van der Meer

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

* Re: textbackground
  2004-06-27  8:38   ` textbackground dr. Hans van der Meer
@ 2004-06-29  9:12     ` Hans Hagen
  2004-06-29  9:23     ` textbackground Hans Hagen
  1 sibling, 0 replies; 9+ messages in thread
From: Hans Hagen @ 2004-06-29  9:12 UTC (permalink / raw)


dr. Hans van der Meer wrote:

> Keeping footnotes free from the coloring would be very great if it 
> could be accomplished (same as for interposed floats), like:

ok then, for your eyes only -)

  \chardef\kindofpagetextareas=1

(so, it was there already but as a kind of experiment)

Hans

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

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

* Re: textbackground
  2004-06-27  8:38   ` textbackground dr. Hans van der Meer
  2004-06-29  9:12     ` textbackground Hans Hagen
@ 2004-06-29  9:23     ` Hans Hagen
  1 sibling, 0 replies; 9+ messages in thread
From: Hans Hagen @ 2004-06-29  9:23 UTC (permalink / raw)


dr. Hans van der Meer wrote:

>
> On 26-jun-04, at 20:13, Hans Hagen Outside wrote:
>
>> dr. Hans van der Meer wrote:
>>
>>> Hans,
>>>
>>> I definitely see problems  with the 
>>> \starttextbackground[]-\stoptextbackground environment (discussed in 
>>> the "displays"-brochure).
>>>
>>> When the textbackground falls at a page crossing -- i.e. starts at 
>>> the top of a page -- the coloring extends backwards on the page just 
>>> left.
>>> It can be remedied by putting a \null just in front of 
>>> \starttextbackground. The extra vertical space this introduces just 
>>> manages to constrain the background to its own page. However, this 
>>> is not a general solution, on other places the extra vertical space 
>>> is certainly not wanted.
>>>
>>> I cannot find the exact nature of the problem. I suspect it has to 
>>> do with the \output-routines, but these are not my speciality, to 
>>> say the least. So, not much help there,
>>>
>>> Also, the \starttextbackground does not respect footnotes, these are 
>>> colored. In contrast, the old \startbackground-\stopbackground does 
>>> respect footnotes. The coloring stops at the footnote and restarts 
>>> at the next page. I should like that for \starttextbackground as well.
>>
>>
>> can you make me a minimal example of where things go wrong (keep in 
>> mind that there are two methods, tex and paragraph)
>> with respect to footnotes, maybe i can make that an option (there are 
>> more exceptions)
>> Hans
>>
>
> Here is the smallest one I could construct that shows the page 
> crossing effect. I used the "location=paragraph". With "location=text" 
> I did not experiment.
> Here follows the code:
>
> % testing textbackgroundcolor
> \setupbodyfont[12pt]    % using the default cmr font
> \setuppapersize[S6][S6]
> \setuplayout[width=middle,location=middle,header=0pt,footer=4ex]
> \setuppagenumbering[location={footer,inright},alternative=singlesided]
> %
> \setupcolors [state=start]
> \definecolor [lavender]        [r=.901961,g=.901961,b=.980392]
> \definecolor [lavenderblush]    [r=1,g=.941176,b=.960784]
> % general page coloring
>
> \setupbackgrounds[page][background=color,backgroundcolor=lavenderblush]
> %
> % special background coloring for parts of the text
> \definetextbackground[A][frame=off,location=paragraph,
>     backgroundcolor=lavender,backgroundoffset=0pt]
> \starttext
> %
> \dorecurse{10}{Some text that must fill a portion of the page. }\par
> \dorecurse{10}{Some text that must fill a portion of the page. }\par
> \dorecurse{10}{Some text that must fill a portion of the page. }\par
> %
> % WITH 8 AND 9 IN THE NEXT RECURSION THE FIRST PARAGRAPH ON PAGE 2 HAS
> % THE BACKGROUND COLORED BUT THE WHITESPACE BELOW THE LAST PARAGRAPH ON
> % PAGE 1 IS COLORED TOO.
> % CHANGE THE 8/9 TO 10 AND THE COLORING ON PAGE 1 DISPAPPEARS.
> % I HAVE BECOME ACROSS SITUATIONS WERE THE COLORING EXTENDED STILL
> % FURTHER BACK OVER MORE PRECEDING PARAGRAPHS, BUT IT IS DIFFICULT TO
> % CONSTRUCT A MINIMAL EXAMPLE FOR THAT.
> \dorecurse{9}{Some text that must fill a portion of the page. }\par
> %
> % THIS SHOULD COLOR THE FIRST PARAGRAPH ON PAGE 2
> \starttextbackground[A]
> \dorecurse{5}{Text with the background. }
> \stoptextbackground
> \dorecurse{10}{Some text that must fill a portion of the page. }\par
> %
> \stoptext
>
> I hope you can find what causes it, because I like the effects.

i think i found a way out and will send you a test file

Hans  

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

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

* Re: textbackground
  2015-02-26  9:22 textbackground Alan BRASLAU
@ 2015-02-26  9:54 ` Hans Hagen
  0 siblings, 0 replies; 9+ messages in thread
From: Hans Hagen @ 2015-02-26  9:54 UTC (permalink / raw)
  To: ntg-context

On 2/26/2015 10:22 AM, Alan BRASLAU wrote:
> Hello,
>
> For a multilingual document, alternating one language or another, not
> necessarily a bilingual, translated text, I thought about using
> textbackground to set-off paragraphs. This technique could also apply
> to a single language text having multiple levels of information,
> perhaps statements followed by discussion, etc.
>
> A problem appears with respect to footnotes that I do not know how to
> handle. If the backgrounded text goes across pages placing footnotes,
> then the footnote also gets the background. This is incorrect, perhaps
> a bug.
>
> Second problem, if a footnote of a backgrounded text gets placed on a
> following page, then it may not get a background. (It is not clear to me
> whether it would be correct for footnotes to get the background or
> not.) Of course, a solution to this secondary problem might be
> 	before={\startlocalfootnotes},
> 	after={\placelocalfootnotes\stoplocalfootnotes},
> although such a solution would postpone backgrounded footnotes to the
> end of the backgrounded text.
>
> Alan
>
>
>
> MWE:
>
> \definetextbackground
>      [spanish]
>      [location=paragraph,
>       frame=off,
>       before={\language[es]},
>       background=color,
>       backgroundcolor=lightgray]
>
> \starttext
>
> \input darwin%
> \startfootnote
> \input dawkins
> \stopfootnote
>
> \input tufte
>
> \startspanish
> \input quevedo-es%
> \startfootnote
> \input cervantes-es
> \stopfootnote
> \stopspanish
>
> \input zapf
>
> \stoptext

\definetextbackground[en]
\definetextbackground[nl]

\setnewconstant\kindofpagetextareas 1 % low level, no high level switch 
(yet)

\starttext

     \starttextbackground[en]
         \dorecurse{10}{\input tufte \footnote{tufte} \par}
     \stoptextbackground

     \starttextbackground[nl]
         \dorecurse{10}{\input tufte \footnote{tufte} \par}
     \stoptextbackground

\stoptext


-----------------------------------------------------------------
                                           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] 9+ messages in thread

* textbackground
@ 2015-02-26  9:22 Alan BRASLAU
  2015-02-26  9:54 ` textbackground Hans Hagen
  0 siblings, 1 reply; 9+ messages in thread
From: Alan BRASLAU @ 2015-02-26  9:22 UTC (permalink / raw)
  To: mailing list for ConTeXt users

Hello,

For a multilingual document, alternating one language or another, not
necessarily a bilingual, translated text, I thought about using
textbackground to set-off paragraphs. This technique could also apply
to a single language text having multiple levels of information,
perhaps statements followed by discussion, etc.

A problem appears with respect to footnotes that I do not know how to
handle. If the backgrounded text goes across pages placing footnotes,
then the footnote also gets the background. This is incorrect, perhaps
a bug.

Second problem, if a footnote of a backgrounded text gets placed on a
following page, then it may not get a background. (It is not clear to me
whether it would be correct for footnotes to get the background or
not.) Of course, a solution to this secondary problem might be
	before={\startlocalfootnotes},
	after={\placelocalfootnotes\stoplocalfootnotes},
although such a solution would postpone backgrounded footnotes to the
end of the backgrounded text.

Alan



MWE: 

\definetextbackground
    [spanish]
    [location=paragraph,
     frame=off,
     before={\language[es]},
     background=color,
     backgroundcolor=lightgray]

\starttext

\input darwin%
\startfootnote
\input dawkins
\stopfootnote

\input tufte

\startspanish
\input quevedo-es%
\startfootnote
\input cervantes-es
\stopfootnote
\stopspanish

\input zapf

\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
___________________________________________________________________________________

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

* textbackground
@ 2011-11-19 12:50 Hans van der Meer
  0 siblings, 0 replies; 9+ messages in thread
From: Hans van der Meer @ 2011-11-19 12:50 UTC (permalink / raw)
  To: ConTeXt NTG

[-- Attachment #1: Type: text/plain, Size: 889 bytes --]

I get the impression that textbackground is not yet completely repaired in:

The small example below shows that location text starts at the left margin instead of at the chosen point in the text. That is, the green part should be "text with background" instead of "result. This is text w".

Paragraph background looks like it works again.

% Testing textbackground
\setuppapersize[A5]A5]
\definetextbackground[testA][%
	location=paragraph,state=start,background=color,backgroundcolor=yellow]
\definetextbackground[testB][%
	location=text,state=start,background=color,backgroundcolor=green]
\starttext
First para for test.
\starttestA
\input tufte
\stoptestA
Last para for text.\blank
Intermediate.\par
This is to fill up things a bit going to the next line in the result.
This is \starttestB text with background \stoptestB within.\blank
Afterwards.\par
\stoptext


[-- Attachment #2: textbackground.pdf --]
[-- Type: application/pdf, Size: 9933 bytes --]

[-- Attachment #3: Type: text/plain, Size: 24 bytes --]




Hans van der Meer




[-- Attachment #4: Type: text/plain, Size: 485 bytes --]

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

* Re: textbackground
@ 2005-03-17 10:38 Duncan Hothersall
  0 siblings, 0 replies; 9+ messages in thread
From: Duncan Hothersall @ 2005-03-17 10:38 UTC (permalink / raw)


Resurrecting a thread from June last year... (sorry!)

On 26-jun-04 Hans van der Meer identified a bug/issue with text backgrounds:

 >>> When the textbackground falls at a page crossing -- i.e. starts at
 >>> the top of a page -- the coloring extends backwards on the page just
 >>> left.

On 29-jun-04 Hans H tantalisingly said:

 >i think i found a way out and will send you a test file
 >
 >Hans

As far as I can tell, I'm currently experiencing the same thing. I'm 
wondering what was in the test file ;-)

Thanks!

Duncan

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

end of thread, other threads:[~2015-02-26  9:54 UTC | newest]

Thread overview: 9+ messages (download: mbox.gz / follow: Atom feed)
-- links below jump to the message on this page --
2004-06-26 12:47 textbackground dr. Hans van der Meer
2004-06-26 18:13 ` textbackground Hans Hagen Outside
2004-06-27  8:38   ` textbackground dr. Hans van der Meer
2004-06-29  9:12     ` textbackground Hans Hagen
2004-06-29  9:23     ` textbackground Hans Hagen
2005-03-17 10:38 textbackground Duncan Hothersall
2011-11-19 12:50 textbackground Hans van der Meer
2015-02-26  9:22 textbackground Alan BRASLAU
2015-02-26  9:54 ` textbackground 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).