Elevated text blocks
Hi, in the book which I'm translating there are many exercises which should be elevated. The original sets grey bars at the beginning and the end. My solutions tends to light grey background over the whole text block. Partially the exercises exceed a page. If possible they should kept as wholes. What is the suitable logical isolation of these blocks in context? Framedtexts? Textblocks? Gerhard -- Gerhard Kugler Psychotherapeut http://www.psychotherapie-kugler.de
On Wed, 27 Dec 2006 22:25:38 +0100
Gerhard Kugler
Hi Gerhard, you can keep text togehther by putting them into a vbox and it will move to the next page if it will not fit on the current page. There are to many ways how you defined your example, you can find one way below. The important things are saved into the before and after commands in the defintion. <example> \defineenumeration [Example] [before=\null\vbox\bgroup, after=\egroup] \starttext \input knuth \startExample \dorecurse{30}{This is a example\crlf} \stopExample \input knuth \stoptext </example> Wolfgang
On Thu, Dec 28, 2006 at 01:58:02PM +0100, Wolfgang Schuster wrote:
you can keep text togehther by putting them into a vbox and it will move to the next page if it will not fit on the current page.
Thank you Wolfgang, this will be an important possibility. Where is the best documentation about vbox?
Why "enumeration"? The exercises are not numbered. Gerhard -- Gerhard Kugler Psychotherapeut http://www.psychotherapie-kugler.de
On Thu, 28 Dec 2006 20:34:03 +0100
Gerhard Kugler
Can can find the explanations from vboc in the TeXbook, there is also a german book about plain TeX available. It is out of print and can be downloaded from the following page: http://www.ruhr-uni-bochum.de/www-rz/schwanbs/TeX/
It was only an example to show you the use of the before and after parameters. There are to many ways in ConTeXt to define an example environment, you can do it in the following ways: - \defineframedtext - \defineenumeration - \definedescription - ... You could also defined you own macros: \def\startexample#1\stopexample{...} or used only a header like \subject{Example} You can see, there are so many ways too achieve one thing and im couldn't know which way you have choosen. If you want unnumbered examples with enumeration you can disable the number with \setupenumeration[number=no] . Wolfgang
On Wed, 27 Dec 2006, Gerhard Kugler wrote:
He Gerhard, Can you be more specific on what is the desired behaviour, that is what do you mean by "if possible they should be kept as wholes" What do you want in the following border cases? 1. The current page is half full, and your exercise is half-page plus two lines. Should TeX leave the rest of the page empty and start a new page, or fill the current page with exercise and put two lines in the next page. 2. The same case as above, but the text is one and a half page long. 3. Or a more drastic case, when the current page has only two lines and the text block is exactly one page long. Should the text split or not. 4. Can you allow the text block to float, or should it occur where you place it, even if it means a lot of empty space on the page. Basically, the difficulty is specifying how much blankspace on a page are you willing to accept, and under what conditions. Aditya
Hi Aditya, thank you for your detailed answer. The exercises are so much providing the structure of the book, that it may be that I will choose the format (size) of the page considering the solutions of your questions: On Thu, Dec 28, 2006 at 11:48:06AM -0500, Aditya Mahajan wrote:
rather the second option. But it would be suboptimal.
2. The same case as above, but the text is one and a half page long.
In this case it would be clear, that the exercise begins instantly.
No.
4. Can you allow the text block to float, or should it occur where you place it, even if it means a lot of empty space on the page.
The text block must not float because it is part of the ongoing text. In some chapters there is more text in the exercises than outside.
Basically, the difficulty is specifying how much blankspace on a page are you willing to accept, and under what conditions.
Perhaps I should fill blank parts of pages with elements of pure decoration. The English (American) original is shorter than the German text. Sometimes I have the impression that the authors have made content and appearance simultaneously. This is not reproducible in a translation. -- Gerhard Kugler Psychotherapeut http://www.psychotherapie-kugler.de
On Thu, 28 Dec 2006, Gerhard Kugler wrote:
If choosing page size is an option, and there are only a few that are larger than a page, things may be much easier. Keep all of them in one page, and typeset. Note the ones that are larger than a page, and mark them using a differnt environment. That is, you decide which exercises should break and which should not.
This seems inconsistent with case 1. There the text was less than one page, but you want it to be split. In this case, the text is exactly one page, but you do not want it to be split?
Is something like this acceptable: if length < 1 page keep the whole thing together, even if it means ending the current page with lots of empty space. if length > 1 page split whereever you want That would means, do a trial typesetting to find the length of the block, if length is less than one page put in a framedtext (which is just a highly customizable vbox) if length > 1 page, don't do anything and let it break pages anywhere. Just one more bit of information is needed. Do your exercises contain display math?
This is always hard to do, and TeX glue makes it harder. Things can be bizzare when you want to fit all you can in page limits imposed in conferences: removing material takes more space, adding material reduces space, and you end up beating your head ;) Aditya
participants (3)
-
Aditya Mahajan
-
Gerhard Kugler
-
Wolfgang Schuster