On Sat, 24 Feb 2007, Mojca Miklavec wrote:

> On 2/21/07, Vyatcheslav Yatskovsky wrote:
>>
>> Hi,
>>
>> I'm struggling against framed text and is beaten again.
>>
>> If the text below doesn't fit the page, it goes below footer and stops pdf
>> file without explanations. After many experiments I should note that frame
>> text is not user-tolerant construction at all, unlike the whole Context is.
>> :(
>
> Hans should probably answer the framed-tet related question. I was
> also a bit disappointed last time when I figured out that framedtext
> doesn't support breaking along pages. But then I discovered an
> alternative:
>
> \setupbackground[frame=on,rulethickness=0.7pt,corner=round,bodyfont=11pt,width=\textwidth]
>
> \startbackground
> ...
> \stopbackground
>
> The only little problem is that background doesn't support
> \definebackground yet, so you should either help yourself with
> something similar to what I did:

Well, my understandin is that backgrounds is obsolete/no longer 
developed and the right thing to use is textbackgrounds. You can 
define textbackgrounds and they work fairly well. The documentation is 
a bit lacking, but details manual as the basics. Defining new 
backgrounds can be tricky, as the backgrounds work well in 
multi-column documents, break across pages and follow grids! You can 
not ask for more.

> \def\starthomework{\dosingleempty\dostarthomework}
> \long\def\dostarthomework[#1]#2\stophomework
>  {\bgroup
>   \setupbackground[frame=on,rulethickness=0.7pt,
>          corner=round,width=\textwidth]
>   \startbackground
>   {\bf Homework\doifsomething{#1}{: #1}}\switchtobodyfont[10pt]\crlf
>     #2
>   \stopbackground
>   \egroup}
>
> or ask someone here to extend the functionality (if you need that).
> (I experinced some problems: a bit weird spacing around backgrounds
> and buggy end of pages - but I didn't yet manage to post a bug
> report.)

textbackgrounds are a bit more robust. They work better with the 
option that Hans suggested in 
http://archive.contextgarden.net/thread/20060523.234652.af86fd7f.en.html


> It would be nice if backgrounds would gain some functionality and if
> they would be more consistent with framedtexts, but I didn't yet take
> time to create a more extensive comparison (long
> bug-report/feature-request list for Hans, or even Aditya, who likes
> such challenges as well).

Last time that I seriously used textbackgrounds (in typesetting 
homework solutions) I had a few problems near the page ends. 
Occasionally a large equation would not split across the page boundary 
and would hang outside the page background. A \page[bigpreference] 
would usually set it right. The math stuff was in the intial stages 
then, and I do not know if it was math alignment at that time (early 
Jan/Feb 2006) or the textbackgrounds. I did not really get time to 
clean up the project and test the whole thing. My cleaned up solution 
of using textbackgrounds is in my practex article
http://tug.org/pracjourn/2006-4/mahajan/

Overall textbackgrounds worked fairly well.

I have been thinking of making a library of different text 
backgrounds, so that one could say
\definetextbackground[whatever][background=background:oval] and get an 
oval background. Basically just a collection of commonly used 
backgrounds (oval, random squeezed, random puked, frame, random frame, 
all of the above with a shadow, etc.). What I had in mind was not 
something with lot of configuration options, since that will be hard 
for my knowledge of metapost context interaction, but something simple 
which shows how to define new backgrounds, so that one can modify the 
examples according to their needs. But it is a bit low on my todo list 
right now :-(

Aditya

_______________________________________________
ntg-context mailing list
ntg-context@ntg.nl
http://www.ntg.nl/mailman/listinfo/ntg-context

Reply via email to