[NTG-context] Using pgf graphics in context

2009-12-23 Thread Jos van Gisbergen
Hi,

I would like to use pgf graphics in my context documents.
How do I go about it -- I googled for the answer, but can't really
find anything useful.

Thanks in advance,

Jos



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


[NTG-context] placefigure[right] draws figures inside framed text

2009-07-08 Thread Jos van Gisbergen
Hello,

I'm using framed text to display verbatim sourse code. The frame should use
the entire textwidth, so I use width=broad.
A problem occurs when I use a figure placed at the right side of the page,
before a framed text section: the figure is drawn *inside* the frame.
With non-framed text everything works fine.

I include an example. It consists of a d.tex file and METAPOST file
a.mp. To reproduce the problem, first convert a.mp to a-1.pdf using
the mptopdf utility. Then texexec --pdf d.tex

   d.tex -
\starttext

Whran crmpqcayng lqyruas crnaqynyng cralls ahqa yncludra fyxrad shqpras,
rvrarcrnsarqynas mqy yssura qs q crnsraqurancra rf hyrarqrchy-rvrarlqp rulras
brayng qpplyrad braawraran such fyxrad shqpras. An rvrarcrnsarqyna rf ahys aypra
mygha bra rrasrlvrad by rralqxyng srmra rf ahra hyrarqrchy-rvrarlqp crnsarqynas
ahqa qrra cqusyng ya, qnd fyllyng up ahra rrasulayng gqps braawraran ahra
fyxrad shqpras. Syncra ahra crmpqcayrn rangynra cqnnra prarfrrm ahys kynd rf
rvrarcrnsarqyna rrasrluayrn, q wrrkqrrund ys prrprsrad yn ahra frrm rf

\placefigure
   [right][fig:nano]
   {nano}
   {\externalfigure[a-1][width=0.4\textwidth]}

Whran crmpqcayng lqyruas crnaqynyng cralls ahqa yncludra fyxrad shqpras,
rvrarcrnsarqynas mqy yssura qs q crnsraqurancra rf hyrarqrchy-rvrarlqp rulras
brayng qpplyrad braawraran such fyxrad shqpras. An rvrarcrnsarqyna rf ahys aypra
mygha bra rrasrlvrad by rralqxyng srmra rf ahra hyrarqrchy-rvrarlqp crnsarqynas
ahqa qrra cqusyng ya, qnd fyllyng up ahra rrasulayng gqps braawraran ahra
fyxrad shqpras. Syncra ahra crmpqcayrn rangynra cqnnra prarfrrm ahys kynd rf
rvrarcrnsarqyna rrasrluayrn, q wrrkqrrund ys prrprsrad yn ahra frrm rf

\placefigure
   [right][fig:pico]
   {pico}
   {\externalfigure[a-1][width=0.4\textwidth]}

\framed[width=broad]{
\vbox{
\starttyping

Whran crmpqcayng lqyruas crnaqynyng cralls ahqa yncludra fyxrad
shqpras, rvrarcrnsarqynas mqy yssura qs q crnsraqurancra rf
hyrarqrchy-rvrarlqp rulras brayng qpplyrad braawraran such
fyxrad shqpras. An rvrarcrnsarqyna rf ahys aypra mygha bra
rrasrlvrad by rralqxyng srmra rf ahra hyrarqrchy-rvrarlqp
crnsarqynas ahqa qrra cqusyng ya, qnd fyllyng up ahra
rrasulayng gqps braawraran ahra fyxrad shqpras. Syncra ahra
crmpqcayrn rangynra cqnnra prarfrrm ahys kynd rf rvrarcrnsarqyna
rrasrluayrn, q wrrkqrrund ys prrprsrad yn ahra frrm rf

\stoptyping
}}
\stoptext

  --- a.mp 
beginfig(1);
fill(0,0)..(0,3cm)..(3cm,1cm)..(1cm,5cm)..cycle withcolor green;
endfig;end;


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


Re: [NTG-context] placefigure[right] draws figures inside framed text (Willi Egger)

2009-07-08 Thread Jos van Gisbergen
Hello Willi,

Thanks for your answer.
Your suggestion works ... if I would be free to choose the framed text to be 0.5
textwidth. However, the framed text is source code and I do need the entire 
textwidth
because otherwise I'm going to get line wraps and that'll make things look ugly.
I expected  placefigure[right] to be clever enough to see that there is no room
beside the framed text, and either place the figure above it or beneath it.
My current workaround is to put the placefigure[right] macro earlier in the flow
of text if possible, or use placefigure[force].

Regards,

Jos






Message: 4
Date: Wed, 8 Jul 2009 16:44:11 +0200
From: Willi Egger w.eg...@boede.nl
Subject: Re: [NTG-context] placefigure[right] draws figures inside
framedtext
To: mailing list for ConTeXt users ntg-context@ntg.nl
Message-ID: c9d22320-b2b1-4a77-b38c-6dd553ec2...@boede.nl
Content-Type: text/plain; charset=US-ASCII; delsp=yes; format=flowed

Hi,

use \framedtext[width=.5\textwidth]{...}. Framed text breaks over the  
lines. Do not use a \vbox

Willi

On Jul 8, 2009, at 1:54 PM, Jos van Gisbergen wrote:

 Hello,

 I'm using framed text to display verbatim sourse code. The frame  
 should use
 the entire textwidth, so I use width=broad.
 A problem occurs when I use a figure placed at the right side of  
 the page,
 before a framed text section: the figure is drawn *inside* the frame.
 With non-framed text everything works fine.

 I include an example. It consists of a d.tex file and METAPOST file
 a.mp. To reproduce the problem, first convert a.mp to a-1.pdf using
 the mptopdf utility. Then texexec --pdf d.tex


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


Re: [NTG-context] re-posting example of header at page bottom

2009-05-20 Thread Jos van Gisbergen
Hi,

I'm re-posting my previous reply to a request from Wolfgang Schuster to supply
an example that exhibits the problem of headers at page bottom.  In my previous
reply the attached example was more or less obscurely hidden in a link at the
bottom of the Digest.

This time I included the example in the e-mail -- it's a bit long I'm afraid.


Here's an example of a ConTeXt file where a header occurs at page bottom.
The subsection named Perl snippet occurs at the bottom of page 2, followed
by framed text on page 3. It would be much nicer if the header would be
written on page 3. Note: I extracted this example from a real-life text; for 
some reason
the frames in the example are drawn wrongly, but this is beside the point.

Run the example with texexec --pdf test.tex

These are the outputs of pdfetex --version and texexec --version on my system 
(Fedora Core 6):

  texexec : TeXExec 5.2.4 - ConTeXt / PRAGMA ADE 1997-2005
  texutil : TeXUtil 9.0.0 - ConTeXt / PRAGMA ADE 1992-2004
  tex : pdfeTeX, 3.141592-1.21a-2.2 (Web2C 7.5.4)
  context : ver: 2005.01.31
  cont-en : ver: 2005.01.31  fmt: 2009.1.26  mes: english

  pdfeTeX 3.141592-1.21a-2.2 (Web2C 7.5.4)
  kpathsea version 3.5.4


    Example  -  


\def\Doctitle{
  Yoyo reference guide
}

\def\Author{
  Flavius Aurelius
}

\def\Copyrightyear{
  2023
}

\def\Revision{
  (revision 0.1)
}

\def\Footertext{
  {\copyright} {\Copyrightyear} Yoyomatic {\Revision}
}

\installlanguage[en]

%--  Set papersize  
\setuppapersize[A4]

%--  Define layout geometry  ---
\definelayout[myCustomLayout][
 header=10mm,% height of header
 footer=10mm,% height of footer
 topspace=8mm,   % space above header
 bottomspace=\topspace,  % space below footer
 backspace=25mm,
 cutspace=20mm,
 width=middle,
 height=middle,
 marking=on, % enable the marking of text
 grid=no,
]

\setuplayout[myCustomLayout]

% Experimental
\definelayout[TitlePageLayout][header=0pt,
   footer=0pt,
   backspace=0.25\paperwidth,
   topspace=0.25\paperheight]

\definestartstop
  [TitlePageLayout]
  [before={\setuplayout[TitlePageLayout]},
   after={\page[left]\setuplayout[reset]}]

%--  Page numbering  ---
\setuppagenumbering [alternative=doublesided,
 location={footer,right},  % where should page number appear
 left={Page }] % text to the left of page number

%--  Custom colors  
\setupcolors[state=start]
\definecolor[DarkYellow] [r=0.5,g=0.5,b=0.1]
\definecolor[LightYellow][r=1.0,g=1.0,b=0.8]
\definecolor[LightBlue]  [r=0.1,g=0.1,b=1.0]
\definecolor[VeryLightBlue]  [r=0.9,g=0.9,b=1.0]
\definecolor[DarkBlue]   [r=0.0,g=0.0,b=0.4]
\definecolor[LightBlack] [r=0.4,g=0.4,b=0.4]
\definecolor[DarkWhite]  [r=0.8,g=0.8,b=0.9]

%-  Custom font definitions  ---
% Define custom fonts for title, chapter etc.
\definebodyfont [10pt,11pt,12pt][rm][chapterFont=SansBold at 36pt,
 sectionFont=SansBold at 24pt,
 subsectionFont=SansBold at 24pt,
 subsubsectionFont=SansBold at 18pt,
 titleFont=SansBold at 36pt]

% The following setup defines the attributes for drawing horizontal lines
% across the page. These lines are drawn with macros \thinline and \hairline.
%\setupthinrules[color=black,rulethickness=0.5mm]
\setupthinrules[color=black]


\setuphead[title][style=\titleFont,
  color=black]
\setuphead[chapter]  [before=\crlf, % insert empty line before chapter title
  style=\chapterFont,
  color=black,
  prefix=+]
\setuphead[section]  [before=\crlf,
  style=\sectionFont,
  color=black,
  prefix=+]
\setuphead[subsection]   [before=\crlf,
  style=\subsectionFont,
  color=black,
  prefix=+]
\setuphead[subsubsection][before=\crlf,
  style=\subsubsectionFont,
  color=black,
  prefix=+]

\definehead[myhead][section]
\setuphead[myhead] [before=\crlf,
page=yes, % start on new page
number=no,
style=\subsectionFont,
color=black]

\definehead[submyhead][myhead]
\setuphead[submyhead] [page=no, % don't 

Re: [NTG-context] header at page bottom example

2009-05-19 Thread Jos van Gisbergen
Hi,

Here's an example of a ConTeXt file where a header occurs at page bottom.
The subsection named Perl snippet occurs at the bottom of page 2, followed
by framed text on page 3. It would be much nicer if the header would be
written on page 3. Note: I extracted this example from a real-life text; for 
some reason
the frames in the example are drawn wrongly, but this is beside the point.

Run the example with texexec --pdf test.tex

These are the outputs of pdfetex --version and texexec --version on my system 
(Fedora Core 6):

   texexec : TeXExec 5.2.4 - ConTeXt / PRAGMA ADE 1997-2005
   texutil : TeXUtil 9.0.0 - ConTeXt / PRAGMA ADE 1992-2004
   tex : pdfeTeX, 3.141592-1.21a-2.2 (Web2C 7.5.4)
   context : ver: 2005.01.31
   cont-en : ver: 2005.01.31  fmt: 2009.1.26  mes: english

   pdfeTeX 3.141592-1.21a-2.2 (Web2C 7.5.4)
   kpathsea version 3.5.4

Thanks in advance,

Jos






From: ntg-context-requ...@ntg.nl ntg-context-requ...@ntg.nl
To: ntg-context@ntg.nl
Sent: Monday, May 18, 2009 2:55:18 PM
Subject: ntg-context Digest, Vol 59, Issue 99

Send ntg-context mailing list submissions to
ntg-context@ntg.nl

To subscribe or unsubscribe via the World Wide Web, visit
http://www.ntg.nl/mailman/listinfo/ntg-context
or, via email, send a message with subject or body 'help' to
ntg-context-requ...@ntg.nl

You can reach the person managing the list at
ntg-context-ow...@ntg.nl

When replying, please edit your Subject line so it is more specific
than Re: Contents of ntg-context digest...


Today's Topics:

   1. Re: how to prevent header at page bottom (Wolfgang Schuster)
   2. Re: interlinespace (Thomas A. Schmitz)
   3. Re: formula-style alignment (afsmith)
   4. Re: columns(ets) and itemize[columns] (Alan BRASLAU)
   5. Re: replacing words by underlines (Alan Stone)
   6. Re: Fresh install  t-letter module (Markus Hubig)


--

Message: 1
Date: Mon, 18 May 2009 12:12:00 +0200
From: Wolfgang Schuster schuster.wolfg...@googlemail.com
Subject: Re: [NTG-context] how to prevent header at page bottom
To: mailing list for ConTeXt users ntg-context@ntg.nl
Message-ID: 47526efc-131b-4ad0-a804-d5c98155f...@gmail.com
Content-Type: text/plain; charset=US-ASCII; format=flowed; delsp=yes


Am 18.05.2009 um 12:07 schrieb Jos van Gisbergen:

 Hi Aditya,

 Your solution works for normal text following the header.
 But if I have a framed text with a background, which also
 has a before={\testpage[3]} (\definetextbackground[FramedText][
 ...,before={\testpage[3]},...]) and the section starts with such a  
 framed
 text, it can still go wrong. And I guess it can also go wrong if a  
 section
 starts with a figure. Is there some way to specify that if less than a
 certain number of items (lines of text, frames, figures etc.) fit on  
 the
 remainder of the current page, the next page should be taken?

Send a example.

Wolfgang


--

Message: 2
Date: Mon, 18 May 2009 12:45:27 +0200
From: Thomas A. Schmitz thomas.schm...@uni-bonn.de
Subject: Re: [NTG-context] interlinespace
To: mailing list for ConTeXt users ntg-context@ntg.nl
Message-ID: 4115ff75-aa44-4355-ab30-1532b7fa1...@uni-bonn.de
Content-Type: text/plain; charset=US-ASCII; format=flowed


On May 18, 2009, at 11:56 AM, Taco Hoekwater wrote:

 {\switchtobodyfont[10pt]
 \setupinterlinespace[line=12pt] \input tufte \par }

*palmforehead*

Thanks, Taco and Wolfgang! Painful...

All best

Thomas


--

Message: 3
Date: Mon, 18 May 2009 03:53:15 -0700
From: afsmith adventurecompl...@gmail.com
Subject: Re: [NTG-context] formula-style alignment
To: ntg-context ntg-context@ntg.nl
Message-ID:
5df5befa0905180353t7e3036b6s7092d1c6d5d6e...@mail.gmail.com
Content-Type: text/plain; charset=ISO-8859-1

Thanks Wolfgang. That works...

Now how about inside a definition or subject header?

Here is an example. \localhsize in this case seems to resolve to a
width of 0, making the contained text break as often as it can...

\defineframed[lrframe][
width=\localhsize,
align=normal,
rulethickness=1pt]

\setuplayout[header=0pt,footer=0pt]
\definedescription[topdesc][
inbetween={\blank[none]},
headstyle={\bf},
style={\tf\rm},
location=top,
width=broad]

\define[3]\CHRONDESC
{\starttopdesc
{\dontleavehmode\lrframe{#1\hfill#2}}
\startnarrower[left]{#3}\stopnarrower
\stoptopdesc}

\definehead[mysubject][subject]
\setuphead[mysubject][style={\bf}]
\define[3]\CHRONSUB
{\mysubject{\dontleavehmode\lrframe{#1\hfill#2}}
\startnarrower[left]{#3}\stopnarrower}

\showframe[text]

\starttext

\startnarrower[left]
\dontleavehmode\lrframe[width=broad]
{leftleftleft \hfill right rightrightright}
\stopnarrower \crlf

\startnarrower[left]
\dontleavehmode\lrframe[width=\localhsize]
{leftleftleftleft\hfill right rightrightright}
\stopnarrower \crlf

\CHRONDESC

Re: [NTG-context] how to prevent header at page bottom

2009-05-18 Thread Jos van Gisbergen
Hi Aditya,

Your solution works for normal text following the header.
But if I have a framed text with a background, which also
has a before={\testpage[3]} (\definetextbackground[FramedText][
...,before={\testpage[3]},...]) and the section starts with such a framed
text, it can still go wrong. And I guess it can also go wrong if a section
starts with a figure. Is there some way to specify that if less than a
certain number of items (lines of text, frames, figures etc.) fit on the
remainder of the current page, the next page should be taken?

Thanks in advance,

Jos





From: ntg-context-requ...@ntg.nl ntg-context-requ...@ntg.nl
To: ntg-context@ntg.nl
Sent: Thursday, May 14, 2009 5:21:26 PM
Subject: ntg-context Digest, Vol 59, Issue 85

Send ntg-context mailing list submissions to
ntg-context@ntg.nl

To subscribe or unsubscribe via the World Wide Web, visit
http://www.ntg.nl/mailman/listinfo/ntg-context
or, via email, send a message with subject or body 'help' to
ntg-context-requ...@ntg.nl

You can reach the person managing the list at
ntg-context-ow...@ntg.nl

When replying, please edit your Subject line so it is more specific
than Re: Contents of ntg-context digest...


Today's Topics:

   1. Re: How to prevent header at page bottom (Aditya Mahajan)
   2. Re: beta: figure boundingbox (Hans Hagen)
   3. Re: bugs in beta (footnotes) (Hans Hagen)
   4. Re: docs (Mari Voipio)
   5. Re: Updating bug: linux-64 (bbvo...@home.nl)
   6. Re: Updating bug: linux-64 (Taco Hoekwater)
   7. Re: docs (R. Bastian)
   8. Re: beta (12.05.2009,22:36): footnote marker and
  overprinting (Hans Hagen)
   9. Re: Updating bug: linux-64 (Arthur Reutenauer)


--

Message: 1
Date: Thu, 14 May 2009 10:02:32 -0400 (EDT)
From: Aditya Mahajan adit...@umich.edu
Subject: Re: [NTG-context] How to prevent header at page bottom
To: mailing list for ConTeXt users ntg-context@ntg.nl
Message-ID: alpine.lnx.2.00.0905141001180.6...@ybpnyubfg.ybpnyqbznva
Content-Type: TEXT/PLAIN; charset=US-ASCII; format=flowed

On Thu, 14 May 2009, Jos van Gisbergen wrote:

 Hi,

 I have defined my own header:
  \definehead[myhead][subsection]
  \setuphead[myhead][ page=no, number=no ]
 All works fine, except sometimes the head appears at page bottom and
 the text starts on the next page. How can I specify that if less than, say,
 3 lines of text fit on the current page below the head, the head and text
 should start on the next page.

\testpage[3] checks that you have space for atleast 3 lines in the current 
page. So you can use

\setuphead[myhead][before={\testpage[3]\blank}]

Aditya


--

Message: 2
Date: Thu, 14 May 2009 16:09:24 +0200
From: Hans Hagen pra...@wxs.nl
Subject: Re: [NTG-context] beta: figure boundingbox
To: mailing list for ConTeXt users ntg-context@ntg.nl
Message-ID: 4a0c2614.1040...@wxs.nl
Content-Type: text/plain; charset=ISO-8859-1; format=flowed

Peter Rolf wrote:
 Hans Hagen schrieb:
 Peter Rolf wrote:
 Hi,

 while comparing the PDF of mkii and mkiv I noticed a slight differ in 
 the boundingboxes (bb) of MP figures.
 While all mkii bb have the form [0 0 w h], the mkiv counterparts use 
 [-1 -1 w+1 h+1]. So the bb of mkiv is enlarged 1bp in all directions. 
 Is this intended?

 harmless ... it prevents clipping of lines
 mh, you mean if something is \framed (with default frame settings)?

if the bbox goes through the middle of a line in an xform then you get 
(in acrobat) clipped lines so this avoids that problem


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


--

Message: 3
Date: Thu, 14 May 2009 16:08:13 +0200
From: Hans Hagen pra...@wxs.nl
Subject: Re: [NTG-context] bugs in beta (footnotes)
To: mailing list for ConTeXt users ntg-context@ntg.nl
Message-ID: 4a0c25cd.6030...@wxs.nl
Content-Type: text/plain; charset=ISO-8859-1; format=flowed

Wolfgang Schuster wrote:
 
 Am 12.05.2009 um 19:07 schrieb Henning Hraban Ramm:
 
 Only footnotes in section titles don't work - should they?

 [...]

 I couldn't construct a minimal failing example - any hints?
 
 
 No solution but here is a test file:
 
 \setupinteraction[state=start]
 \starttext
 \section{foo\footnote{bar}}
 \stoptext

repaired


-
   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

[NTG-context] How to prevent header at page bottom

2009-05-14 Thread Jos van Gisbergen
Hi,

I have defined my own header:
  \definehead[myhead][subsection]
  \setuphead[myhead][ page=no, number=no ]
All works fine, except sometimes the head appears at page bottom and
the text starts on the next page. How can I specify that if less than, say,
3 lines of text fit on the current page below the head, the head and text
should start on the next page.

Thanks in advance,

Jos



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


[NTG-context] multi page TABLE and placetable

2009-05-04 Thread Jos van Gisbergen
Hi,

I'm using TABLE macros for typesetting tables. Since the tables I'm using
may get very long, I set split=yes. This works ... except if I surround
a TABLE with \placetable:

  \placetable[here]{caption} {
\bTABLE ...
\eTABLE
  }

In such a case a table that is too long to fit on a single page is truncated
at page bottom and nothing is printed on the next page.
What am I doing wrong?

Thanks in advance,

Jos



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


[NTG-context] framed text question

2009-04-21 Thread Jos van Gisbergen
Hi,

I have a question regarding framed text.
To obtain framed verbatim text that breaks over pages, I use the macro
\definetextbackground. I have encountered a slight problem, however:
sometimes the upper part of the frame appears on the bottom of the
page with no text in it (because there's not enough room). The strange
thing is that if I comment out the setupcolors macro the problem
disappears (in the example that is).
I have included an example of this below. Run with texexec --pdf test.tex

The version of texexec I'm using is:

 TeXExec 5.2.4 - ConTeXt / PRAGMA ADE 1997-2005

   texexec : TeXExec 5.2.4 - ConTeXt / PRAGMA ADE 1997-2005
   texutil : TeXUtil 9.0.0 - ConTeXt / PRAGMA ADE 1992-2004
   tex : pdfeTeX, 3.141592-1.21a-2.2 (Web2C 7.5.4)
   context : ver: 2005.01.31
   cont-en : ver: 2005.01.31  fmt: 2009.1.26  mes: english


Thanks in advance

Trychius


--  test.tex  --
\installlanguage[en]
\setuppapersize[A4]

\definelayout[myCustomLayout][
 header=10mm,% height of header
 footer=10mm,% height of footer
 topspace=8mm,   % space above header
 bottomspace=\topspace,  % space below footer
 backspace=25mm,
 cutspace=20mm,
 width=middle,
 height=middle,
 marking=on, % enable the marking of text
 grid=yes,
]

\setuplayout[myCustomLayout]

\setuptyping[margin=10mm,
 space=off,   % Do not show space characters explicitely
 color=black, % Color of verbatim text
]

\setupcolors[state=start]

\definetextbackground[FramedText][
location=paragraph,
rulethickness=0.5pt,
framecolor=red,
background=color,backgroundcolor=yellow,
leftoffset=1.0\bodyfontsize,rightoffset=1.0\bodyfontsize,
topoffset=1.0\bodyfontsize,bottomoffset=1.0\bodyfontsize,
frame=on]



\starttext
in this story took place, some of the most
important mines of the Scottish coal beds
had been exhausted by too rapid working. In
the region which extends between Edinburgh
and Glasgow, for a distance of ten or twelve
miles, lay the Aberfoyle colliery, of which
Now, at the time when the events related
in this story took place, some of the most
important mines of the Scottish coal beds
had been exhausted by too rapid working. In
the region which extends between Edinburgh
and Glasgow, for a distance of ten or twelve
miles, lay the Aberfoyle colliery, of which
Now, at the time when the events related
in this story took place, some of the most
important mines of the Scottish coal beds
had been exhausted by too rapid working. In
the region which extends between Edinburgh
and Glasgow, for a distance of ten or twelve
miles, lay the Aberfoyle colliery, of which
Now, at the time when the events related
in this story took place, some of the most
important mines of the Scottish coal beds
had been exhausted by too rapid working. In
the region which extends between Edinburgh
and Glasgow, for a distance of ten or twelve
miles, lay the Aberfoyle colliery, of which
had been exhausted by too rapid working. In
the region which extends between Edinburgh
and Glasgow, for a distance of ten or twelve
miles, lay the Aberfoyle colliery, of which
had been exhausted by too rapid working. In
the region which extends between Edinburgh
and Glasgow, for a distance of ten or twelve
miles, lay the Aberfoyle colliery, of which
had been exhausted by too rapid working. In
the region which extends between Edinburgh
and Glasgow, for a distance of ten or twelve
miles, lay the Aberfoyle colliery, of which
had been exhausted by too rapid working. In
the region which extends between Edinburgh
and Glasgow, for a distance of ten or twelve
miles, lay the Aberfoyle colliery, of which
had been exhausted by too rapid working. In
the region which extends between Edinburgh
and Glasgow, for a distance of ten or twelve
miles, lay the Aberfoyle colliery, of which
had been exhausted by too rapid working. In
the region which extends between Edinburgh
and Glasgow, for a distance of ten or twelve
miles, lay the Aberfoyle colliery, of which
had been exhausted by too rapid working. In
had been exhausted by too rapid working. In
had been exhausted 

Re: [NTG-context] framed text question (Aditya Mahajan)

2009-04-21 Thread Jos van Gisbergen
Okay, the before={\testpage[] ...}  seems to solve my problems with the 
hanging empty text backgrounds.
Thanks Aditya







Message: 3
Date: Tue, 21 Apr 2009 09:10:16 -0400 (EDT)
From: Aditya Mahajan adit...@umich.edu
Subject: Re: [NTG-context] framed text question
To: mailing list for ConTeXt users ntg-context@ntg.nl
Message-ID: alpine.lnx.2.00.0904210908150.8...@ybpnyubfg.ybpnyqbznva
Content-Type: TEXT/PLAIN; charset=US-ASCII; format=flowed

On Tue, 21 Apr 2009, Jos van Gisbergen wrote:

 Hi,

 I have a question regarding framed text.
 To obtain framed verbatim text that breaks over pages, I use the macro
 \definetextbackground. I have encountered a slight problem, however:
 sometimes the upper part of the frame appears on the bottom of the
 page with no text in it (because there's not enough room). The strange
 thing is that if I comment out the setupcolors macro the problem
 disappears (in the example that is).

I sometimes use

\definetextbackground[][before={\testpage[3], .. other options .. ]

The \testpage[3] checks if there is enough space to put three lines, if 
not it issues a page break. In most cases this gets rid of the hanging 
empty text backgrounds at the bottom of a page.

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