[NTG-context] breaking framed text across pages

2007-02-21 Thread Vyatcheslav Yatskovsky
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. :(

\defineframedtext[assignment][rulethickness=0.7pt, corner=round, bodyfont=11pt, 
width=\textwidth]

\startassignment
Write an M-file which inputs matrixes $A$, $B$, initial $N$ and number of 
iterations, and which plots 3D bars. 
\startcolumns[n=3]
\par\thinrule 
\par\thinrule
\par\thinrule 
\par\thinrule
\par\thinrule
\par\thinrule 
\par\thinrule
\par\thinrule
\par\thinrule 
\par\thinrule 
\stopcolumns

Find relative distribution (in percents) of population within age classes and 
store the result into new matrix $P$. Plot it too. 
\startcolumns[n=3]
\par\thinrule 
\par\thinrule 
\par\thinrule
\par\thinrule
\par\thinrule
\par\thinrule 
\par\thinrule
\stopcolumns
\stopassignment

Best,
Vyatcheslav___
ntg-context mailing list
ntg-context@ntg.nl
http://www.ntg.nl/mailman/listinfo/ntg-context


Re: [NTG-context] breaking framed text across pages

2007-02-23 Thread Mojca Miklavec
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:

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

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

> \defineframedtext[assignment][rulethickness=0.7pt,
> corner=round, bodyfont=11pt, width=\textwidth]
>
>
>
>
> \startassignment
>
> Write an M-file which inputs matrixes $A$, $B$, initial $N$ and number of
> iterations, and which plots 3D bars.
>
> \startcolumns[n=3]
>
> \par\thinrule
>
> \par\thinrule
>
> \par\thinrule
>
> \par\thinrule
>
> \par\thinrule
>
> \par\thinrule
>
> \par\thinrule
>
> \par\thinrule
>
> \par\thinrule
>
> \par\thinrule

Why not simply \dorecurse{10}{\par\thinrule}?

> \stopcolumns
>
>
>
>
> Find relative distribution (in percents) of population within age classes
> and store the result into new matrix $P$. Plot it too.
>
> \startcolumns[n=3]
>
> \par\thinrule
>
> \par\thinrule
>
> \par\thinrule
>
> \par\thinrule
>
> \par\thinrule
>
> \par\thinrule
>
> \par\thinrule
>
> \stopcolumns
>
> \stopassignment
>
>
>
>
> Best,
>
> Vyatcheslav
___
ntg-context mailing list
ntg-context@ntg.nl
http://www.ntg.nl/mailman/listinfo/ntg-context


Re: [NTG-context] breaking framed text across pages

2007-02-23 Thread Aditya Mahajan
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


Re: [NTG-context] breaking framed text across pages

2007-02-24 Thread Hans Hagen
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
>   
framed just takes a box and boxes don't break 

try to imagine how to implement breaking across pages with backgrounds ... als 
try to figure out (without looking at the source) how the text background 
mechanism works ... it may turn you rdisappointment into amazement on how a 25 
year old tex can still keep up with it 

> 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
>   
dependin gon usage, this mechanism also provides background behind parts  of 
paragraphs, nested backgrounds, arbitrary mp backgrounds, etc 

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
-

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