Hello, is it possible to have some "conditional format"? I mean I'd like to have different vertical spacing for \section and \subsection when they follows immediately each other and when there is some text between them. best regards Jan -- Tato zpráva byla vytvořena převratnou poštovní aplikací Opery: http://www.opera.com/mail/
On 5-6-2012 10:34, Jan Pohanka wrote:
Hello,
is it possible to have some "conditional format"? I mean I'd like to have different vertical spacing for \section and \subsection when they follows immediately each other and when there is some text between them.
No, at least not now. There are some possibilities with weighted skips so that some win over others but I'm not sure if that solves your case. Hans ----------------------------------------------------------------- Hans Hagen | PRAGMA ADE Ridderstraat 27 | 8061 GH Hasselt | The Netherlands tel: 038 477 53 69 | voip: 087 875 68 74 | www.pragma-ade.com | www.pragma-pod.nl -----------------------------------------------------------------
Ok, thank you. I will solve this manually by creating some additional
headings.
regards
Jan
Dne Wed, 06 Jun 2012 09:52:40 +0200 Hans Hagen
On 5-6-2012 10:34, Jan Pohanka wrote:
Hello,
is it possible to have some "conditional format"? I mean I'd like to have different vertical spacing for \section and \subsection when they follows immediately each other and when there is some text between them.
No, at least not now. There are some possibilities with weighted skips so that some win over others but I'm not sure if that solves your case.
Hans
----------------------------------------------------------------- Hans Hagen | PRAGMA ADE Ridderstraat 27 | 8061 GH Hasselt | The Netherlands tel: 038 477 53 69 | voip: 087 875 68 74 | www.pragma-ade.com | www.pragma-pod.nl -----------------------------------------------------------------
Am 05.06.2012 um 10:34 schrieb Jan Pohanka:
Hello,
is it possible to have some "conditional format"? I mean I'd like to have different vertical spacing for \section and \subsection when they follows immediately each other and when there is some text between them.
% SectionBlank \def\DefineSectionBlank {\dotripleempty\doDefineSectionBlank} \def\doDefineSectionBlank[#1][#2][#3]#4% {\edef\CurrentSection{#1}% \setvalue{#1:#2:\ifthirdargument\the\dimexpr#3\relax\fi}{#4}} \def\SectionBlank#1#2% {\edef\CurrentSection{#1}% \executeifdefined{#1:#2:\LastSectionBlankSignal}{\executeifdefined{#1:#2:\the\dimexpr\zeropoint\relax}{\getvalue{#1:#2:}}}} \let\LastSectionBlankSignal\zeropoint \EveryPar{\let\LastSectionBlankSignal\zeropoint} \def\SectionBlankSignal {\setevalue{LastSectionBlankSignal}{\the\dimexpr\csname\CurrentSection Signal\endcsname\relax}} % Heading \newsignal\PartSignal \DefineSectionBlank [Part] [before] {\blank[force,48pt]} \DefineSectionBlank [Part] [after] {\blank[15pt]\SectionBlankSignal} \setuphead [Part] [before=\SectionBlank{Part}{before}, after=\SectionBlank{Part}{after}] \newsignal\ChapterSignal \DefineSectionBlank [Chapter] [before] [\PartSignal] {\blank[\the\dimexpr 12pt*200/100-6pt\relax]} \DefineSectionBlank [Chapter] [before] {\blank[\the\dimexpr 12pt*200/100\relax]} \DefineSectionBlank [Chapter] [after] {\blank[\the\dimexpr 12pt*150/100\relax]\SectionBlankSignal} \setuphead [chapter] [before=\SectionBlank{Chapter}{before}, after=\SectionBlank{Chapter}{after}] \newsignal\SectionSignal \DefineSectionBlank [Section] [before] [\PartSignal] {\blank[\the\dimexpr 12pt*175/100\relax]} %\DefineSectionBlank [Section] [before] [\ChapterSignal] {\blank[\the\dimexpr 12pt*175/100-3pt\relax]} \DefineSectionBlank [Section] [before] [\ChapterSignal] {\blank[\the\dimexpr 12pt*175/100+2cm\relax]} \DefineSectionBlank [Section] [before] {\blank[\the\dimexpr 12pt*175/100\relax]} \DefineSectionBlank [Section] [after] {\blank[\the\dimexpr 12pt*133/100\relax]\SectionBlankSignal} \setuphead [section] [before=\SectionBlank{Section}{before}, after=\SectionBlank{Section}{after}] \starttext \chapter{Chapter 1} \section{Section 1.1} \chapter{Chapter 2} text \section{Section 2.1} \stoptext Wolfgang
Far beyond my tex and context skills, but nice :)
regards
Jan
Dne Wed, 06 Jun 2012 14:46:29 +0200 Wolfgang Schuster
Am 05.06.2012 um 10:34 schrieb Jan Pohanka:
Hello,
is it possible to have some "conditional format"? I mean I'd like to have different vertical spacing for \section and \subsection when they follows immediately each other and when there is some text between them.
% SectionBlank
\def\DefineSectionBlank {\dotripleempty\doDefineSectionBlank}
\def\doDefineSectionBlank[#1][#2][#3]#4% {\edef\CurrentSection{#1}% \setvalue{#1:#2:\ifthirdargument\the\dimexpr#3\relax\fi}{#4}}
\def\SectionBlank#1#2% {\edef\CurrentSection{#1}% \executeifdefined{#1:#2:\LastSectionBlankSignal}{\executeifdefined{#1:#2:\the\dimexpr\zeropoint\relax}{\getvalue{#1:#2:}}}}
\let\LastSectionBlankSignal\zeropoint
\EveryPar{\let\LastSectionBlankSignal\zeropoint}
\def\SectionBlankSignal {\setevalue{LastSectionBlankSignal}{\the\dimexpr\csname\CurrentSection Signal\endcsname\relax}}
% Heading
\newsignal\PartSignal
\DefineSectionBlank [Part] [before] {\blank[force,48pt]} \DefineSectionBlank [Part] [after] {\blank[15pt]\SectionBlankSignal}
\setuphead [Part] [before=\SectionBlank{Part}{before}, after=\SectionBlank{Part}{after}]
\newsignal\ChapterSignal
\DefineSectionBlank [Chapter] [before] [\PartSignal] {\blank[\the\dimexpr 12pt*200/100-6pt\relax]} \DefineSectionBlank [Chapter] [before] {\blank[\the\dimexpr 12pt*200/100\relax]} \DefineSectionBlank [Chapter] [after] {\blank[\the\dimexpr 12pt*150/100\relax]\SectionBlankSignal}
\setuphead [chapter] [before=\SectionBlank{Chapter}{before}, after=\SectionBlank{Chapter}{after}]
\newsignal\SectionSignal
\DefineSectionBlank [Section] [before] [\PartSignal] {\blank[\the\dimexpr 12pt*175/100\relax]} %\DefineSectionBlank [Section] [before] [\ChapterSignal] {\blank[\the\dimexpr 12pt*175/100-3pt\relax]} \DefineSectionBlank [Section] [before] [\ChapterSignal] {\blank[\the\dimexpr 12pt*175/100+2cm\relax]} \DefineSectionBlank [Section] [before] {\blank[\the\dimexpr 12pt*175/100\relax]} \DefineSectionBlank [Section] [after] {\blank[\the\dimexpr 12pt*133/100\relax]\SectionBlankSignal}
\setuphead [section] [before=\SectionBlank{Section}{before}, after=\SectionBlank{Section}{after}]
\starttext
\chapter{Chapter 1}
\section{Section 1.1}
\chapter{Chapter 2}
text
\section{Section 2.1}
\stoptext
Wolfgang ___________________________________________________________________________________ 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 ___________________________________________________________________________________
participants (3)
-
Hans Hagen
-
Jan Pohanka
-
Wolfgang Schuster