ntg-context - mailing list for ConTeXt users
 help / color / mirror / Atom feed
* conditional format of headings
@ 2012-06-05  8:34 Jan Pohanka
  2012-06-06  7:52 ` Hans Hagen
  2012-06-06 12:46 ` Wolfgang Schuster
  0 siblings, 2 replies; 5+ messages in thread
From: Jan Pohanka @ 2012-06-05  8:34 UTC (permalink / raw)
  To: mailing list for ConTeXt users

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/
___________________________________________________________________________________
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] 5+ messages in thread

* Re: conditional format of headings
  2012-06-05  8:34 conditional format of headings Jan Pohanka
@ 2012-06-06  7:52 ` Hans Hagen
  2012-06-06 11:12   ` Jan Pohanka
  2012-06-06 12:46 ` Wolfgang Schuster
  1 sibling, 1 reply; 5+ messages in thread
From: Hans Hagen @ 2012-06-06  7:52 UTC (permalink / raw)
  To: mailing list for ConTeXt users

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
-----------------------------------------------------------------
___________________________________________________________________________________
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] 5+ messages in thread

* Re: conditional format of headings
  2012-06-06  7:52 ` Hans Hagen
@ 2012-06-06 11:12   ` Jan Pohanka
  0 siblings, 0 replies; 5+ messages in thread
From: Jan Pohanka @ 2012-06-06 11:12 UTC (permalink / raw)
  To: mailing list for ConTeXt users, Hans Hagen

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 <pragma@wxs.nl> napsal(a):

> 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
> -----------------------------------------------------------------


___________________________________________________________________________________
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] 5+ messages in thread

* Re: conditional format of headings
  2012-06-05  8:34 conditional format of headings Jan Pohanka
  2012-06-06  7:52 ` Hans Hagen
@ 2012-06-06 12:46 ` Wolfgang Schuster
  2012-06-08  9:22   ` Jan Pohanka
  1 sibling, 1 reply; 5+ messages in thread
From: Wolfgang Schuster @ 2012-06-06 12:46 UTC (permalink / raw)
  To: mailing list for ConTeXt users


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
___________________________________________________________________________________


^ permalink raw reply	[flat|nested] 5+ messages in thread

* Re: conditional format of headings
  2012-06-06 12:46 ` Wolfgang Schuster
@ 2012-06-08  9:22   ` Jan Pohanka
  0 siblings, 0 replies; 5+ messages in thread
From: Jan Pohanka @ 2012-06-08  9:22 UTC (permalink / raw)
  To: ntg-context

Far beyond my tex and context skills, but nice :)

regards
Jan

Dne Wed, 06 Jun 2012 14:46:29 +0200 Wolfgang Schuster  
<schuster.wolfgang@googlemail.com> napsal(a):

>
> 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
> ___________________________________________________________________________________


___________________________________________________________________________________
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] 5+ messages in thread

end of thread, other threads:[~2012-06-08  9:22 UTC | newest]

Thread overview: 5+ messages (download: mbox.gz / follow: Atom feed)
-- links below jump to the message on this page --
2012-06-05  8:34 conditional format of headings Jan Pohanka
2012-06-06  7:52 ` Hans Hagen
2012-06-06 11:12   ` Jan Pohanka
2012-06-06 12:46 ` Wolfgang Schuster
2012-06-08  9:22   ` Jan Pohanka

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).