Dear all, I’m finishing a book, and getting the following undesired result. Many times I have section or subsection title at the bottom of a page, with no text. Text starts on the next page. I have looked at http://wiki.contextgarden.net/Widows_and_orphans_control but I wasn’t able to solve. I guess it could depend on the formatting of my headlines. Here they are: \setuphead[section] [style=\ss\tfa, before={\blank[0.5cm]\startframedtext[offset=0.25cm,framecolor=black, rulethickness=0.01cm, frame=off, topframe=off, bottomframe=on]\crlf},after={\stopframedtext\noindentation\blank[1cm]}] \setuphead[subsection] [style=\ss, before={\blank[0.5cm]\startframedtext[offset=0.25cm,framecolor=black, rulethickness=0.01cm, frame=off, topframe=off, bottomframe=on]\crlf},after={\stopframedtext\noindentation\blank[1cm]}] thanks Best -a- -------------------------------------------------- Andrea Valle -------------------------------------------------- CIRMA - StudiUm Università degli Studi di Torino --> http://www.cirma.unito.it/andrea/ --> http://www.fonurgia.unito.it/andrea/ --> http://www.flickr.com/photos/vanderaalle/sets/ --> http://vimeo.com/vanderaalle --> andrea.valle@unito.it -------------------------------------------------- "This is a very complicated case, Maude. You know, a lotta ins, a lotta outs, a lotta what-have-yous." (Jeffrey 'The Dude' Lebowski) -------------------------------------------------- Andrea Valle -------------------------------------------------- CIRMA - StudiUm Università degli Studi di Torino --> http://www.cirma.unito.it/andrea/ --> http://www.fonurgia.unito.it/andrea/ --> http://www.flickr.com/photos/vanderaalle/sets/ --> http://vimeo.com/vanderaalle --> andrea.valle@unito.it -------------------------------------------------- "This is a very complicated case, Maude. You know, a lotta ins, a lotta outs, a lotta what-have-yous." (Jeffrey 'The Dude' Lebowski)
On 05/26/2016 10:56 AM, Andrea Valle wrote:
Dear all,
I’m finishing a book, and getting the following undesired result. Many times I have section or subsection title at the bottom of a page, with no text. Text starts on the next page. I have looked at
http://wiki.contextgarden.net/Widows_and_orphans_control
but I wasn’t able to solve.
I guess it could depend on the formatting of my headlines. Here they are:
\setuphead[section] [style=\ss\tfa, before={\blank[0.5cm]\startframedtext[offset=0.25cm,framecolor=black, rulethickness=0.01cm, frame=off, topframe=off, bottomframe=on]\crlf},after={\stopframedtext\noindentation\blank[1cm]}]
\setuphead[subsection] [style=\ss, before={\blank[0.5cm]\startframedtext[offset=0.25cm,framecolor=black, rulethickness=0.01cm, frame=off, topframe=off, bottomframe=on]\crlf},after={\stopframedtext\noindentation\blank[1cm]}]
Hi Andrea, you may replace \blank[1cm] with \blank[samepage,1cm]. This should move the heading to the next page. Just in case it helps, Pablo -- http://www.ousia.tk
Thanks a lot Pablo,
On 26 May 2016, at 17:40, Pablo Rodriguez
wrote: On 05/26/2016 10:56 AM, Andrea Valle wrote: you may replace \blank[1cm] with \blank[samepage,1cm].
This should move the heading to the next page.
alas, it does not, seems ineffective Best -a- -------------------------------------------------- Andrea Valle -------------------------------------------------- CIRMA - StudiUm Università degli Studi di Torino --> http://www.cirma.unito.it/andrea/ --> http://www.fonurgia.unito.it/andrea/ --> http://www.flickr.com/photos/vanderaalle/sets/ --> http://vimeo.com/vanderaalle --> andrea.valle@unito.it -------------------------------------------------- "This is a very complicated case, Maude. You know, a lotta ins, a lotta outs, a lotta what-have-yous." (Jeffrey 'The Dude' Lebowski)
On 05/26/2016 05:45 PM, Andrea Valle wrote:
Thanks a lot Pablo,
On 26 May 2016, at 17:40, Pablo Rodriguez wrote:
On 05/26/2016 10:56 AM, Andrea Valle wrote: you may replace \blank[1cm] with \blank[samepage,1cm].
This should move the heading to the next page.
alas, it does not, seems ineffective
In a much simpler case, it seems to work: \setuphead[section] [style=\ss\tfa, after={\hrule\blank[samepage,big]}] %~ [style=\ss\tfa, after={\hrule\blank[big]}] \setuphead[subsection] [style=\ss, after={\hrule\blank[samepage,medium]}] %~ [style=\ss, after={\hrule\blank[medium]}] \starttext \dorecurse{10}{\section{Section} \input knuth \subsection{Subsection} \input zapf} \stoptext Do you really need headings to be inside framed texts? Pablo -- http://www.ousia.tk
Pablo Rodriguez mailto:oinos@gmx.es 26. Mai 2016 um 21:29
In a much simpler case, it seems to work:
\setuphead[section] [style=\ss\tfa, after={\hrule\blank[samepage,big]}] %~ [style=\ss\tfa, after={\hrule\blank[big]}]
\setuphead[subsection] [style=\ss, after={\hrule\blank[samepage,medium]}] %~ [style=\ss, after={\hrule\blank[medium]}]
\starttext \dorecurse{10}{\section{Section} \input knuth \subsection{Subsection} \input zapf} \stoptext
Do you really need headings to be inside framed texts? A good idea but it can be improved.
\definevspace[sectionrule][3mm] \setuphead [section] [ width=0.8\textwidth, commandafter={\vspace[sectionrule]\hrule}, before={\blank[0.5cm]}, after={\blank[1cm]}] \starttext \section{\input ward } \subject{\input ward } \stoptext Wolfgang
On 05/27/2016 02:49 PM, Wolfgang Schuster wrote:
Pablo Rodriguez 26. Mai 2016 um 21:29
In a much simpler case, it seems to work:
\setuphead[section] [style=\ss\tfa, after={\hrule\blank[samepage,big]}] %~ [style=\ss\tfa, after={\hrule\blank[big]}] [..]
A good idea but it can be improved.
\definevspace[sectionrule][3mm]
\setuphead [section] [ width=0.8\textwidth, commandafter={\vspace[sectionrule]\hrule}, before={\blank[0.5cm]}, after={\blank[1cm]}]
Wolfgang, many thanks for the improvement. I have a question about your code: What prevents page break between heading the next paragraph? I might guess that is the two distinct options commandafter and after. But this is only my suspicion on what may work there. Many thanks for your help, Pablo -- http://www.ousia.tk
On 5/29/2016 11:57 AM, Pablo Rodriguez wrote:
On 05/27/2016 02:49 PM, Wolfgang Schuster wrote:
Pablo Rodriguez 26. Mai 2016 um 21:29
In a much simpler case, it seems to work:
\setuphead[section] [style=\ss\tfa, after={\hrule\blank[samepage,big]}] %~ [style=\ss\tfa, after={\hrule\blank[big]}] [..]
A good idea but it can be improved.
\definevspace[sectionrule][3mm]
\setuphead [section] [ width=0.8\textwidth, commandafter={\vspace[sectionrule]\hrule}, before={\blank[0.5cm]}, after={\blank[1cm]}]
Wolfgang,
many thanks for the improvement.
I have a question about your code:
What prevents page break between heading the next paragraph?
a rather complex method of weighted penalties that also needs to make sure we don't break between successive heads but at the same time makes sure that we don't overflow the page
I might guess that is the two distinct options commandafter and after. But this is only my suspicion on what may work there.
Many thanks for your help,
Pablo
-- ----------------------------------------------------------------- Hans Hagen | PRAGMA ADE Ridderstraat 27 | 8061 GH Hasselt | The Netherlands tel: 038 477 53 69 | www.pragma-ade.com | www.pragma-pod.nl -----------------------------------------------------------------
Andrea Valle mailto:valle@di.unito.it 26. Mai 2016 um 10:56 Dear all,
I’m finishing a book, and getting the following undesired result. Many times I have section or subsection title at the bottom of a page, with no text. Text starts on the next page. I have looked at
http://wiki.contextgarden.net/Widows_and_orphans_control
but I wasn’t able to solve.
I guess it could depend on the formatting of my headlines. Here they are:
\setuphead[section] [style=\ss\tfa, before={\blank[0.5cm]\startframedtext[offset=0.25cm,framecolor=black, rulethickness=0.01cm, frame=off, topframe=off, bottomframe=on]\crlf},after={\stopframedtext\noindentation\blank[1cm]}]
\setuphead[subsection] [style=\ss, before={\blank[0.5cm]\startframedtext[offset=0.25cm,framecolor=black, rulethickness=0.01cm, frame=off, topframe=off, bottomframe=on]\crlf},after={\stopframedtext\noindentation\blank[1cm]}] Your lack of a working minimal example makes it hard to give a solution but adding changing the way how the frame is added should improve things.
\startsetups[section:andrea] \ifconditional\headshownumber \scratchdimenone\dimexpr\headnumberwidth+\headnumberdistance\relax \scratchdimentwo\dimexpr\headnumberdistance\relax \else \scratchdimenone\zeropoint \scratchdimentwo\zeropoint \fi \startframedtext[offset=0.25cm,loffset=\scratchdimenone,rulethickness=0.01cm,frame=off,bottomframe=on] \dontleavehmode\llap{\headnumbercontent\hskip\scratchdimentwo} \headtextcontent \stopframedtext \stopsetups \defineheadalternative[section:andrea][alternative=vertical,renderingsetup=section:andrea] \setuphead [section] [alternative=section:andrea, numberwidth=1em, before={\blank[0.5cm]}, after={\blank[1cm]}] \starttext \section{\input ward } \subject{\input ward } \stoptext Wolfgang
Thanks a lot Wolfgang -------------------------------------------------- Andrea Valle -------------------------------------------------- CIRMA - StudiUm Università degli Studi di Torino --> http://www.cirma.unito.it/andrea/ --> http://www.fonurgia.unito.it/andrea/ --> http://www.flickr.com/photos/vanderaalle/sets/ --> http://vimeo.com/vanderaalle --> andrea.valle@unito.it -------------------------------------------------- "This is a very complicated case, Maude. You know, a lotta ins, a lotta outs, a lotta what-have-yous." (Jeffrey 'The Dude' Lebowski)
Your lack of a working minimal example makes it hard to give a solution
Sorry, I know, but I didn’t know to reproduce the situation.
but adding changing the way how the frame is added should improve things.
\startsetups[section:andrea] \ifconditional\headshownumber \scratchdimenone\dimexpr\headnumberwidth+\headnumberdistance\relax \scratchdimentwo\dimexpr\headnumberdistance\relax \else \scratchdimenone\zeropoint \scratchdimentwo\zeropoint \fi \startframedtext[offset=0.25cm,loffset=\scratchdimenone,rulethickness=0.01cm,frame=off,bottomframe=on] \dontleavehmode\llap{\headnumbercontent\hskip\scratchdimentwo} \headtextcontent \stopframedtext \stopsetups
look likes it solves all the problems! I really have no idea of what’s going on here. Luckily this mailing list is super friendly. Manuals are cool, but I always miss the big picture that would allow me to generalise over a problem! Thanks Best
\defineheadalternative[section:andrea][alternative=vertical,renderingsetup=section:andrea]
\setuphead [section] [alternative=section:andrea, numberwidth=1em, before={\blank[0.5cm]}, after={\blank[1cm]}]
\starttext
participants (4)
-
Andrea Valle
-
Hans Hagen
-
Pablo Rodriguez
-
Wolfgang Schuster