[NTG-context] framed text question
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
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 ___
Re: [NTG-context] framed text question (Aditya Mahajan)
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 ___
[NTG-context] Framed text question
Hi, I'm new to Context, so hopefully this isn't a completely obvious question, but I was wondering whether it was possible to have framed text split across a page. In this particular case, I have a code sample that I want to be framed and have a different background color than the rest of the text, so I have it surrounded by \startframedtext and \stopframedtext. Is it possible to use \splitfloat to split this if the code sample is too large to fit on a single page? If so, what would be the syntax? If not, is there another mechanism? Thanks for any help! Brian Kahne ___ ntg-context mailing list ntg-context@ntg.nl http://www.ntg.nl/mailman/listinfo/ntg-context
Re: [NTG-context] Framed text question
Brian Kahne wrote: Hi, I'm new to Context, so hopefully this isn't a completely obvious question, but I was wondering whether it was possible to have framed text split across a page. In this particular case, I have a code sample that I want to be framed and have a different background color than the rest of the text, so I have it surrounded by \startframedtext and \stopframedtext. Is it possible to use \splitfloat to split this if the code sample is too large to fit on a single page? If so, what would be the syntax? If not, is there another mechanism? the following background mechanism splits across pages, works over columns, can be used nested, can be applied for very dirty tricks, etc \setupcolors[state=start] \starttext \definetextbackground[more][state=start,backgroundcolor=red] % location=paragraph \definetextbackground[test][state=start,backgroundcolor=green] \page \placefigure[left]{}{} \starttextbackground[test] \readfile{ward}{}{} \starttextbackground[more] \readfile{ward}{}{} \stoptextbackground \readfile{ward}{}{} \stoptextbackground \page \placefigure[right]{}{} \starttextbackground[test] \readfile{ward}{}{} \starttextbackground[more] \readfile{ward}{}{} \stoptextbackground \readfile{ward}{}{} \stoptextbackground \stoptext - 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 - test.pdf Description: Adobe PDF document ___ ntg-context mailing list ntg-context@ntg.nl http://www.ntg.nl/mailman/listinfo/ntg-context