* Conditional Column Breaks
@ 2013-10-18 18:48 Thangalin
0 siblings, 0 replies; only message in thread
From: Thangalin @ 2013-10-18 18:48 UTC (permalink / raw)
To: mailing list for ConTeXt users
Hi,
How would you create a conditional column break that is only applied
if inserting the break does not result in a page break? For example,
in the following code the "if" statements exemplify the desired
behaviour:
\setuphead[chapter][
before={\startcolumns[n=2, balance=no,]},
after={\stopcolumns},
]
% If the section is the last section in the chapter
% *and* the section is not in the last column *and*
% inserting a column break does not cause pagination...
\setuphead[section][
before={%
\if_last_section{%
\if_not_last_column{%
\if_fits_in_last_column_without_pagination{\columnbreak}
}
}
},
]
\starttext
\startchapter
\startsection[title=Section1]
\input knuth
\stopsection
\startsection[title=Section2]
\input zapf
\stopsection
\startsection[title=Section3]
\input knuth
\stopsection
\stopchapter
\stoptext
Many kind regards.
___________________________________________________________________________________
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
___________________________________________________________________________________
^ permalink raw reply [flat|nested] only message in thread
only message in thread, other threads:[~2013-10-18 18:48 UTC | newest]
Thread overview: (only message) (download: mbox.gz / follow: Atom feed)
-- links below jump to the message on this page --
2013-10-18 18:48 Conditional Column Breaks Thangalin
This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox;
as well as URLs for NNTP newsgroup(s).