How does one prevent orphans (the first line nof a paragraph on the last line of a page) and widows (the last line of a paragraph on a new page)? If I have the title of a new section that must not be the last line of a page, how can I do this? Thanks Paul -- ************************ *Paul Tremblay * *phthenry@iglou.com * ************************
On Mon, Mar 28, 2005 at 10:04:58PM -0500, Paul Tremblay wrote:
How does one prevent orphans (the first line nof a paragraph on the last line of a page) and widows (the last line of a paragraph on a new page)?
If I have the title of a new section that must not be the last line of a page, how can I do this?
I've hunted around the web quite a bit, and there doesn't seem to be an easy way to do this. I tried: \clubpenalty=-600 \widowpenalty=-600 But this had no effect. What I would need is some type of macro that can determine how much space is left on the page. If the space is less than some small, pretermined amount (say, 24 points, for example), then put the title on the next page, or put in a \blank[24pt, flexible] I know nothing about writing macros, or if this is possible. Paul -- ************************ *Paul Tremblay * *phthenry@iglou.com * ************************
On 3/29/2005, "Paul Tremblay"
I've hunted around the web quite a bit, and there doesn't seem to be an easy way to do this. I tried:
clubpenalty=-600 widowpenalty=-600
But this had no effect.
You just told TeX that it's a good idea to have widows and orphans. Negative numbers mean there's less of a penalty for widows and orphans. Try assigning a high positive number (up to 10000). (150 is the default in Plain TeX.) Steve
Paul Tremblay wrote:
On Mon, Mar 28, 2005 at 10:04:58PM -0500, Paul Tremblay wrote:
How does one prevent orphans (the first line nof a paragraph on the last line of a page) and widows (the last line of a paragraph on a new page)?
If I have the title of a new section that must not be the last line of a page, how can I do this?
I've hunted around the web quite a bit, and there doesn't seem to be an easy way to do this. I tried:
\clubpenalty=-600 \widowpenalty=-600
But this had no effect.
What I would need is some type of macro that can determine how much space is left on the page. If the space is less than some small, pretermined amount (say, 24 points, for example), then put the title on the next page, or put in a \blank[24pt, flexible]
I know nothing about writing macros, or if this is possible.
\testpage[24pt] ----------------------------------------------------------------- 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 -----------------------------------------------------------------
Hans Hagen wrote (8:53): Paul Tremblay wrote:
What I would need is some type of macro that can determine how much space is left on the page. If the space is less than some small, pretermined amount (say, 24 points, for example), then put the title on the next page, or put in a \blank[24pt, flexible]
I know nothing about writing macros, or if this is possible.
\testpage[24pt]
Vit Zyka wrote (11:35):
\penalty50 \vskip3\baselineskip plus1fil \nobreak \vskip-3\baselineskip plus-1fil
It is useful before section title etc. I believe it is implemented to ConTeXt, but I do not know the interface.
Whawgh! Hans had answered the question before I sent it. Sorry, my homing pigeon was too lazy... Although Hasselt-to-Prague way in 2.5 hrs it is not so bad :) vit
From: Vit Zyka
What I would need is some type of macro that can determine how much space is left on the page. If the space is less than some small, pretermined amount (say, 24 points, for example), then put the
Hans Hagen wrote (8:53): Paul Tremblay wrote: title on
the next page, or put in a \blank[24pt, flexible]
I know nothing about writing macros, or if this is possible.
\testpage[24pt]
Vit Zyka wrote (11:35):
\penalty50 \vskip3\baselineskip plus1fil \nobreak \vskip-3\baselineskip plus-1fil
It is useful before section title etc. I believe it is implemented to ConTeXt, but I do not know the interface.
Whawgh! Hans had answered the question before I sent it. Sorry, my homing pigeon was too lazy... Although Hasselt-to-Prague way in 2.5 hrs it is not so bad :)
Actually, no! Both your responses help me out. Could you explain your snippet of code? I don't quite know what the \penalty50 means. I know TeX applies a penalty to each line, but I'm confused if the penalty is for fitting the line horizontally or vertically, or both. I know what vskip does, but I'm not sure about the other commands, or the strategy. Incidently, I do very much want code that acts on titles for sections and subsections. That is my exact problem right now. I believe that ConTeXt will generally handle widows if they just occur in a regular paragraph. Hans provided a very useful tidbit in \testpage[24pt], but I'm not sure if I should use this in a macro. I have never written a macro in TeX before. I was hoping I would not have to write macros, but maybe I should just learn the basics? I guess there is a section on macros in the big manual. But that is sitting at home next to my computer that has the ConTeXt on it! Thanks Paul
phthenry@iglou.com wrote:
From: Vit Zyka
Hans Hagen wrote (8:53):
Paul Tremblay wrote:
What I would need is some type of macro that can determine how much space is left on the page. If the space is less than some small, pretermined amount (say, 24 points, for example), then put the
title on
the next page, or put in a \blank[24pt, flexible]
I know nothing about writing macros, or if this is possible.
\testpage[24pt]
Vit Zyka wrote (11:35):
\penalty50 \vskip3\baselineskip plus1fil \nobreak \vskip-3\baselineskip plus-1fil
It is useful before section title etc. I believe it is implemented to ConTeXt, but I do not know the interface.
Actually, no! Both your responses help me out.
Could you explain your snippet of code? I don't quite know what the \penalty50 means.
Penalty works for both vertical and horizontal mode. Penalty is place where a break can occure (with some panalization). Border values have these meanings: \penalty10000 => \nobreak, \penalty-10000 => force \break, \penalty0 => neutral value (same penalty as \par or space) But, forget my 'solution', next example shows it does not work in ConTeXt (glues and penalty are not discarded at the top of next page). And in addition it has to cooperate with output routine (needs \raggedbotom). Actually, Hans's \testpage is based on another trick (as I look up, it is defined by comparing \pagegoal and \pagetotal registers) and it is more general. vit ------------- \setuplayout[lines=10] \showgrid \starttext \dorecurse{9}{Line \recurselevel\hfill\break}% \par \penalty50 \vskip 3\baselineskip \nobreak\vskip-3\baselineskip Hallo \stoptext -------------
On Wed, Mar 30, 2005 at 11:53:49AM +0200, Vit Zyka wrote:
Vit Zyka wrote (11:35):
\penalty50 \vskip3\baselineskip plus1fil \nobreak \vskip-3\baselineskip plus-1fil
It is useful before section title etc. I believe it is implemented to ConTeXt, but I do not know the interface.
This didn't work for me. I did some of the other suggestions to work, though. Thanks! Paul -- ************************ *Paul Tremblay * *phthenry@iglou.com * ************************
On Wed, Mar 30, 2005 at 08:53:31AM +0200, Hans Hagen wrote:
What I would need is some type of macro that can determine how much space is left on the page. If the space is less than some small, pretermined amount (say, 24 points, for example), then put the title on the next page, or put in a \blank[24pt, flexible]
I know nothing about writing macros, or if this is possible.
\testpage[24pt]
This produces an unwanted "pt" in my text. But if I use: \testpage[3] I get some very interesting result. It almost seems from my tests that ConTeXt will break if it can't put 3 more "lines" on the page. Almost, anyway. If I have spaces as in: \testpage[3] Title\par \blank[24pt] The code doesn't quite work. It might even make an ugly orphan of poor title. In that case I have to increase the option in \testpage to 5 or 6 to work. So what exactly does the argument stand for? This command might be really useful. Thanks Paul -- ************************ *Paul Tremblay * *phthenry@iglou.com * ************************
Paul Tremblay wrote:
On Wed, Mar 30, 2005 at 08:53:31AM +0200, Hans Hagen wrote:
What I would need is some type of macro that can determine how much space is left on the page. If the space is less than some small, pretermined amount (say, 24 points, for example), then put the title on the next page, or put in a \blank[24pt, flexible]
I know nothing about writing macros, or if this is possible.
\testpage[24pt]
This produces an unwanted "pt" in my text.
But if I use:
\testpage[3]
I get some very interesting result. It almost seems from my tests that ConTeXt will break if it can't put 3 more "lines" on the page. Almost, anyway. If I have spaces as in:
\testpage[3] Title\par \blank[24pt]
The code doesn't quite work. It might even make an ugly orphan of poor title. In that case I have to increase the option in \testpage to 5 or 6 to work.
actually it's \testpage[noflines][dimensions] normally you will indeed use a value of 5 or 6 (whitespacee + title of two lines + whitespace + first line of paragraph) i don't know how you place titles, but why not: \definesection[mytitle][subsubsubsubsubject] \mytitle{...} because that takes care of most situations 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 -----------------------------------------------------------------
Hello, when using modes, the names of all used modes are printed on the first page of the document like [screen] [print] etc. What's the purpose, and how can I get rid of this? I could see this being useful if the disabled modes were stricken out. Thanks, Matthias
Hi Matthias I see there is a problem in your case. Still it is not possible to give you a meaningful answer if there is no detailed information. Could you provide a minimal example which is producing the mentioned bahviour? Willi Matthias Weber wrote:
Hello,
when using modes, the names of all used modes are printed on the first page of the document like
[screen] [print]
etc.
What's the purpose, and how can I get rid of this? I could see this being useful if the disabled modes were stricken out.
Thanks,
Matthias
_______________________________________________ ntg-context mailing list ntg-context@ntg.nl http://www.ntg.nl/mailman/listinfo/ntg-context
Hello Willi, I have just change a major projects to modes, so in producing a minimal example the effect takes a slightly different form: \starttext \disablemode[screen] \enablemode[print] \startmode[screen] Screen Version \stopmode[screen] \startmode[print] Print Version \stopmode[print] \stoptext Matthias On Apr 28, 2005, at 2:00 PM, Willi Egger wrote:
Hi Matthias
I see there is a problem in your case. Still it is not possible to give you a meaningful answer if there is no detailed information.
Could you provide a minimal example which is producing the mentioned bahviour?
Willi
Matthias Weber wrote:
Hello, when using modes, the names of all used modes are printed on the first page of the document like [screen] [print] etc. What's the purpose, and how can I get rid of this? I could see this being useful if the disabled modes were stricken out. Thanks, Matthias _______________________________________________ ntg-context mailing list ntg-context@ntg.nl http://www.ntg.nl/mailman/listinfo/ntg-context
ntg-context mailing list ntg-context@ntg.nl http://www.ntg.nl/mailman/listinfo/ntg-context
Hello again, oh my, this was a stupid mistake. I added the [screen] and [print] parameters to \stopmode. No wonder that is what is being printed. Sorry for the confusion! Matthias On Apr 28, 2005, at 2:00 PM, Willi Egger wrote:
Hi Matthias
I see there is a problem in your case. Still it is not possible to give you a meaningful answer if there is no detailed information.
Could you provide a minimal example which is producing the mentioned bahviour?
Willi
Matthias Weber wrote:
Hello, when using modes, the names of all used modes are printed on the first page of the document like [screen] [print] etc. What's the purpose, and how can I get rid of this? I could see this being useful if the disabled modes were stricken out. Thanks, Matthias _______________________________________________ ntg-context mailing list ntg-context@ntg.nl http://www.ntg.nl/mailman/listinfo/ntg-context
ntg-context mailing list ntg-context@ntg.nl http://www.ntg.nl/mailman/listinfo/ntg-context
Reminds me of this post: http://archive.contextgarden.net/message/20041101.205339.1e76d98d.html I bet that is what we all do! David Matthias Weber :
Hello again,
oh my, this was a stupid mistake. I added the [screen] and [print] parameters to \stopmode. No wonder that is what is being printed.
Sorry for the confusion!
Matthias
Hello Paul,
\clubpenalty=-600 \widowpenalty=-600
But this had no effect.
try inserting things like these after \starttext. There was a problem on the mailinglist like this some time ago. Patrick -- ConTeXt wiki: http://contextgarden.net
On Wed, Mar 30, 2005 at 09:31:07AM +0200, Patrick Gundlach wrote:
\clubpenalty=-600 \widowpenalty=-600
But this had no effect.
try inserting things like these after \starttext. There was a problem on the mailinglist like this some time ago.
Yes, that did the trick. Can anyone tell me if -600 is a reasonable value? My tests seem to say so. There are at least 3 lines on the bottom of my test page. Thanks Paul -- ************************ *Paul Tremblay * *phthenry@iglou.com * ************************
Paul Tremblay wrote:
What I would need is some type of macro that can determine how much space is left on the page. If the space is less than some small, pretermined amount (say, 24 points, for example), then put the title on the next page, or put in a \blank[24pt, flexible]
You can use the trick (untested): \penalty50 \vskip3\baselineskip plus1fil \nobreak \vskip-3\baselineskip plus-1fil It is useful before section title etc. I believe it is implemented to ConTeXt, but I do not know the interface. vit
This works for LaTeX but not for ConTeXt: \widowpenalty=10000 \clubpenalty=10000 \flushbottom ConTeXt has not \flushbottom command. The \flushbottom gives the heigh flexibility. Paul -- ************************ *Paul Tremblay * *phthenry@iglou.com * ************************
Hello Paul,
ConTeXt has not \flushbottom command. The \flushbottom gives the heigh flexibility.
what about looking in the wiki for \flushbottom? Patrick -- ConTeXt wiki: http://contextgarden.net
On Wed, Mar 30, 2005 at 09:24:53AM +0200, Patrick Gundlach wrote:
ConTeXt has not \flushbottom command. The \flushbottom gives the heigh flexibility.
what about looking in the wiki for \flushbottom?
Yes, I see: \setupalign[line] Though it turns out I don't need to use this to get the penalties to work. Still, it is nice to know how to do this. I wasn't even aware that ConTeXt wasn't pushing my text to the bottom of the page. I wonder how \pagesetup[width=middle] is going to affect all this? I hope not at all. Paul -- ************************ *Paul Tremblay * *phthenry@iglou.com * ************************
participants (9)
-
David Munger
-
Hans Hagen
-
Matthias Weber
-
Patrick Gundlach
-
Paul Tremblay
-
phthenry@iglou.com
-
speter@mail.dandy.net
-
Vit Zyka
-
Willi Egger