ntg-context - mailing list for ConTeXt users
 help / color / mirror / Atom feed
* [NTG-context] Decreasing size of the section number according to its level
@ 2025-01-23 22:00 garulfo
  2025-01-23 22:46 ` [NTG-context] " Wolfgang Schuster
  0 siblings, 1 reply; 3+ messages in thread
From: garulfo @ 2025-01-23 22:00 UTC (permalink / raw)
  To: ntg-context

Hi,

in setuphead, I try to get a decreasing size of the section number according to its level
with \defineconversion and \definestructureconversionset.
 
It works as expected for the first levels, but between 6th and 7th, the variation doesn't occur.
Any clue about what is happening ?

For the MVE, I've added a visual check in dark red to show the discrepancy.

\setuppapersize[A5]

\define[1]\NivA{\tfc #1}
\defineconversion[NA][\NivA]

\define[1]\NivB{\tfb #1}
\defineconversion[NB][\NivB]

\define[1]\NivC{\tfa #1}
\defineconversion[NC][\NivC]

\define[1]\NivD{\tf #1}
\defineconversion[ND][\NivD]

\define[1]\NivE{\tfx #1}
\defineconversion[ND][\NivE]

\definestructureconversionset
  [mysectionnumbers]
  [N,N,NA,NB,NC,ND,NE]
  [N]

\definestructureconversionset
  [mysectionnumbersforlist]
  [N]
  [N]

\setupheads
 [sectionconversionset=mysectionnumbers]

\setuplist
  [section,
   subsection,
   subsubsection,
   subsubsubsection,
   subsubsubsubsection]
  [numberconversionset=mysectionnumbersforlist]

\starttext
\placecontent

\startsection [title={Section}]
  \startsubsection [title={SubSection}]
    \startsubsubsection [title={SubSubSection}]
      \startsubsubsubsection [title={SubSubSubSection}]
        \startsubsubsubsubsection [title={SubSubSubSubSection}]
        \stopsubsubsubsubsection
      \stopsubsubsubsection
    \stopsubsubsection
  \stopsubsection
\stopsection
\color[darkred]{{\tfc 1.}{\tfb 1.}{\tfa 1.}{\tf 1.}{\tfx 1}}
\stoptext
___________________________________________________________________________________
If your question is of interest to others as well, please add an entry to the Wiki!

maillist : ntg-context@ntg.nl / https://mailman.ntg.nl/mailman3/lists/ntg-context.ntg.nl
webpage  : https://www.pragma-ade.nl / https://context.aanhet.net (mirror)
archive  : https://github.com/contextgarden/context
wiki     : https://wiki.contextgarden.net
___________________________________________________________________________________

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

* [NTG-context] Re: Decreasing size of the section number according to its level
  2025-01-23 22:00 [NTG-context] Decreasing size of the section number according to its level garulfo
@ 2025-01-23 22:46 ` Wolfgang Schuster
  2025-01-24  8:42   ` Hans Hagen via ntg-context
  0 siblings, 1 reply; 3+ messages in thread
From: Wolfgang Schuster @ 2025-01-23 22:46 UTC (permalink / raw)
  To: ntg-context

Am 23.01.2025 um 23:00 schrieb garulfo@azules.eu:
> Hi,
> 
> in setuphead, I try to get a decreasing size of the section number according to its level
> with \defineconversion and \definestructureconversionset.
>   
> It works as expected for the first levels, but between 6th and 7th, the variation doesn't occur.

The missing font change occurs between level 5 and 6 when you use the 
correct conversion name as shown below.

The reason for this is the default font size for the sections and the 
fact that \tf doesn't switch to the default font size, i.e. when you use 
\tf after \tfa the a-size remains.

\starttext
\tfa{\tfc 1.}{\tfb 1.}{\tfa 1.}{\tf 1.}{\tfx 1}
\stoptext


> Any clue about what is happening ?
> 
> For the MVE, I've added a visual check in dark red to show the discrepancy.
> 
> \setuppapersize[A5]
> 
> \define[1]\NivA{\tfc #1}
> \defineconversion[NA][\NivA]
> 
> \define[1]\NivB{\tfb #1}
> \defineconversion[NB][\NivB]
> 
> \define[1]\NivC{\tfa #1}
> \defineconversion[NC][\NivC]
> 
> \define[1]\NivD{\tf #1}
> \defineconversion[ND][\NivD]
> 
> \define[1]\NivE{\tfx #1}
> \defineconversion[ND][\NivE]

This should be: \defineconversion[NE][\NivE]

A better alternative is to create a processor for each conversion.

\defineprocessor [level_3] [style=\tfc]
\defineprocessor [level_4] [style=\tfb]
\defineprocessor [level_5] [style=\tfa]
\defineprocessor [level_6] [style=\tf ]
\defineprocessor [level_7] [style=\tfx]

\defineconversionset
   [mysectionnumbers]
   [n,n,level_3->n,level_4->n,level_5->n,level_6->n,level_7->n]
   [n]

Wolfgang

___________________________________________________________________________________
If your question is of interest to others as well, please add an entry to the Wiki!

maillist : ntg-context@ntg.nl / https://mailman.ntg.nl/mailman3/lists/ntg-context.ntg.nl
webpage  : https://www.pragma-ade.nl / https://context.aanhet.net (mirror)
archive  : https://github.com/contextgarden/context
wiki     : https://wiki.contextgarden.net
___________________________________________________________________________________

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

* [NTG-context] Re: Decreasing size of the section number according to its level
  2025-01-23 22:46 ` [NTG-context] " Wolfgang Schuster
@ 2025-01-24  8:42   ` Hans Hagen via ntg-context
  0 siblings, 0 replies; 3+ messages in thread
From: Hans Hagen via ntg-context @ 2025-01-24  8:42 UTC (permalink / raw)
  To: ntg-context; +Cc: Hans Hagen

On 1/23/2025 11:46 PM, Wolfgang Schuster wrote:
> Am 23.01.2025 um 23:00 schrieb garulfo@azules.eu:
>> Hi,
>>
>> in setuphead, I try to get a decreasing size of the section number 
>> according to its level
>> with \defineconversion and \definestructureconversionset.
>> It works as expected for the first levels, but between 6th and 7th, 
>> the variation doesn't occur.
> 
> The missing font change occurs between level 5 and 6 when you use the 
> correct conversion name as shown below.
> 
> The reason for this is the default font size for the sections and the 
> fact that \tf doesn't switch to the default font size, i.e. when you use 
> \tf after \tfa the a-size remains.
> 
> \starttext
> \tfa{\tfc 1.}{\tfb 1.}{\tfa 1.}{\tf 1.}{\tfx 1}
> \stoptext
> 
> 
>> Any clue about what is happening ?
>>
>> For the MVE, I've added a visual check in dark red to show the 
>> discrepancy.
>>
>> \setuppapersize[A5]
>>
>> \define[1]\NivA{\tfc #1}
>> \defineconversion[NA][\NivA]
>>
>> \define[1]\NivB{\tfb #1}
>> \defineconversion[NB][\NivB]
>>
>> \define[1]\NivC{\tfa #1}
>> \defineconversion[NC][\NivC]
>>
>> \define[1]\NivD{\tf #1}
>> \defineconversion[ND][\NivD]
>>
>> \define[1]\NivE{\tfx #1}
>> \defineconversion[ND][\NivE]
> 
> This should be: \defineconversion[NE][\NivE]
> 
> A better alternative is to create a processor for each conversion.
> 
> \defineprocessor [level_3] [style=\tfc]
> \defineprocessor [level_4] [style=\tfb]
> \defineprocessor [level_5] [style=\tfa]
> \defineprocessor [level_6] [style=\tf ]
> \defineprocessor [level_7] [style=\tfx]

A variant:

\defineprocessor [level_3] 
[style=\glyphscale\numericscaled1.5\glyphscale\relax] % \glyphscale 1500
\defineprocessor [level_4] 
[style=\glyphscale\numericscaled1.3\glyphscale\relax] % \glyphscale 1300
\defineprocessor [level_5] 
[style=\glyphscale\numericscaled1.1\glyphscale\relax] % \glyphscale 1100
\defineprocessor [level_6] 
[style=\glyphscale\numericscaled0.9\glyphscale\relax] % \glyphscale 0900
\defineprocessor [level_7] 
[style=\glyphscale\numericscaled0.7\glyphscale\relax] % \glyphscale 0700

> \defineconversionset
>    [mysectionnumbers]
>    [n,n,level_3->n,level_4->n,level_5->n,level_6->n,level_7->n]
>    [n]
> 
> Wolfgang
> 
> ___________________________________________________________________________________
> If your question is of interest to others as well, please add an entry 
> to the Wiki!
> 
> maillist : ntg-context@ntg.nl / https://mailman.ntg.nl/mailman3/lists/ 
> ntg-context.ntg.nl
> webpage  : https://www.pragma-ade.nl / https://context.aanhet.net (mirror)
> archive  : https://github.com/contextgarden/context
> wiki     : https://wiki.contextgarden.net
> ___________________________________________________________________________________


-- 

-----------------------------------------------------------------
                                           Hans Hagen | PRAGMA ADE
               Ridderstraat 27 | 8061 GH Hasselt | The Netherlands
        tel: 038 477 53 69 | www.pragma-ade.nl | 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 / https://mailman.ntg.nl/mailman3/lists/ntg-context.ntg.nl
webpage  : https://www.pragma-ade.nl / https://context.aanhet.net (mirror)
archive  : https://github.com/contextgarden/context
wiki     : https://wiki.contextgarden.net
___________________________________________________________________________________

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

end of thread, other threads:[~2025-01-24  8:47 UTC | newest]

Thread overview: 3+ messages (download: mbox.gz / follow: Atom feed)
-- links below jump to the message on this page --
2025-01-23 22:00 [NTG-context] Decreasing size of the section number according to its level garulfo
2025-01-23 22:46 ` [NTG-context] " Wolfgang Schuster
2025-01-24  8:42   ` Hans Hagen via ntg-context

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