ntg-context - mailing list for ConTeXt users
 help / color / mirror / Atom feed
* [NTG-context] Adjusted Chapter Headings
@ 2024-03-19 11:59 Jeroen
  2024-03-19 14:45 ` [NTG-context] " Hraban Ramm
  2024-03-19 19:09 ` Wolfgang Schuster
  0 siblings, 2 replies; 4+ messages in thread
From: Jeroen @ 2024-03-19 11:59 UTC (permalink / raw)
  To: mailing list for ConTeXt users


[-- Attachment #1.1: Type: text/plain, Size: 887 bytes --]

I have some style adjustments for the chapters. The chapter "numbers" need
to be Boek I, Boek II, etc. A vertical separator was introduced with an
inframe. The chapter title at the right side does not vertically align
properly with the chapter number in the frame (inside the frame is
vertically centered, the title not). Is there a way to align the chapter
title with the chapter number?



\starttexdefinition MyNumberChapterCommand #1
    \inframed[frame=off,rightframe=on,framecolor=black,
     rulethickness=1px,height=30pt]{#1\enspace}
\stoptexdefinition

\setuphead[chapter][style={\bfc},numbercommand=\MyNumberChapterCommand,
    page=no]

\starttext

\startchapter
  [title={Algemene Beginselen},
   ownnumber={Boek I}]

\samplefile{tufte}

\stopchapter

\startchapter
  [title={Organisatorische Structuren},
   ownnumber={Boek II}]

\samplefile{tufte}

\stopchapter

\stoptext

[-- Attachment #1.2: Type: text/html, Size: 1070 bytes --]

[-- Attachment #2: Type: text/plain, Size: 511 bytes --]

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

* [NTG-context] Re: Adjusted Chapter Headings
  2024-03-19 11:59 [NTG-context] Adjusted Chapter Headings Jeroen
@ 2024-03-19 14:45 ` Hraban Ramm
  2024-03-19 18:51   ` Jeroen
  2024-03-19 19:09 ` Wolfgang Schuster
  1 sibling, 1 reply; 4+ messages in thread
From: Hraban Ramm @ 2024-03-19 14:45 UTC (permalink / raw)
  To: ntg-context


[-- Attachment #1.1: Type: text/plain, Size: 1869 bytes --]

Hi Jeroen,

it might make sense to use

\setuphead[chapter][
   conversion=R,
]
\setuplabeltext[nl][chapter={Boek }]

instead of ownnumber.

I would use one command for number and title and put both in the same 
kind of frame. Probably you should use a \strut in the text or 
\inframed[strut=yes] to assure the same text height.

HTH, Hraban

Am 19.03.24 um 12:59 schrieb Jeroen:
> I have some style adjustments for the chapters. The chapter "numbers" 
> need to be Boek I, Boek II, etc. A vertical separator was introduced 
> with an inframe. The chapter title at the right side does not 
> vertically align properly with the chapter number in the frame (inside 
> the frame is vertically centered, the title not). Is there a way to 
> align the chapter title with the chapter number?
>
>
>
> \starttexdefinition MyNumberChapterCommand #1
>     \inframed[frame=off,rightframe=on,framecolor=black,
>      rulethickness=1px,height=30pt]{#1\enspace}
> \stoptexdefinition
>
> \setuphead[chapter][style={\bfc},numbercommand=\MyNumberChapterCommand,
>     page=no]
>
> \starttext
>
> \startchapter
>   [title={Algemene Beginselen},
>    ownnumber={Boek I}]
>
> \samplefile{tufte}
>
> \stopchapter
>
> \startchapter
>   [title={Organisatorische Structuren},
>    ownnumber={Boek II}]
>
> \samplefile{tufte}
>
> \stopchapter
>
> \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
> ___________________________________________________________________________________

[-- Attachment #1.2: Type: text/html, Size: 3427 bytes --]

[-- Attachment #2: Type: text/plain, Size: 511 bytes --]

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

* [NTG-context] Re: Adjusted Chapter Headings
  2024-03-19 14:45 ` [NTG-context] " Hraban Ramm
@ 2024-03-19 18:51   ` Jeroen
  0 siblings, 0 replies; 4+ messages in thread
From: Jeroen @ 2024-03-19 18:51 UTC (permalink / raw)
  To: mailing list for ConTeXt users


[-- Attachment #1.1: Type: text/plain, Size: 3036 bytes --]

I have been able to achieve it as following, but the first frame width is
fixed so will cause problems with other chapter numbers such as VIII


\unexpanded\def\HeadTitle#1#2%
{\hbox to \hsize \bgroup
\hfill
\setupframed[offset=.5em,frame=off]
\tbox{\framed[width=22mm,align=right]{#1}}%
\tbox{\framed[width=130mm,align=right,leftframe=on,
rulethickness=0.8pt]{#2}}%
\egroup}

\setuplabeltext[chapter=Boek~]

\setuphead[chapter][style={\bfc}, command=\HeadTitle, textstyle=bold]

...

\startchapter
  [title={Algemene Beginselen},
   ownnumber={I}]

Op di 19 mrt 2024 om 15:49 schreef Hraban Ramm <texml@fiee.net>:

> Hi Jeroen,
>
> it might make sense to use
>
> \setuphead[chapter][
>   conversion=R,
> ]
> \setuplabeltext[nl][chapter={Boek }]
>
> instead of ownnumber.
>
> I would use one command for number and title and put both in the same kind
> of frame. Probably you should use a \strut in the text or
> \inframed[strut=yes] to assure the same text height.
>
> HTH, Hraban
> Am 19.03.24 um 12:59 schrieb Jeroen:
>
> I have some style adjustments for the chapters. The chapter "numbers" need
> to be Boek I, Boek II, etc. A vertical separator was introduced with an
> inframe. The chapter title at the right side does not vertically align
> properly with the chapter number in the frame (inside the frame is
> vertically centered, the title not). Is there a way to align the chapter
> title with the chapter number?
>
>
>
> \starttexdefinition MyNumberChapterCommand #1
>     \inframed[frame=off,rightframe=on,framecolor=black,
>      rulethickness=1px,height=30pt]{#1\enspace}
> \stoptexdefinition
>
> \setuphead[chapter][style={\bfc},numbercommand=\MyNumberChapterCommand,
>     page=no]
>
> \starttext
>
> \startchapter
>   [title={Algemene Beginselen},
>    ownnumber={Boek I}]
>
> \samplefile{tufte}
>
> \stopchapter
>
> \startchapter
>   [title={Organisatorische Structuren},
>    ownnumber={Boek II}]
>
> \samplefile{tufte}
>
> \stopchapter
>
> \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
> ___________________________________________________________________________________
>
>
> ___________________________________________________________________________________
> 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
>
> ___________________________________________________________________________________
>

[-- Attachment #1.2: Type: text/html, Size: 5111 bytes --]

[-- Attachment #2: Type: text/plain, Size: 511 bytes --]

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

* [NTG-context] Re: Adjusted Chapter Headings
  2024-03-19 11:59 [NTG-context] Adjusted Chapter Headings Jeroen
  2024-03-19 14:45 ` [NTG-context] " Hraban Ramm
@ 2024-03-19 19:09 ` Wolfgang Schuster
  1 sibling, 0 replies; 4+ messages in thread
From: Wolfgang Schuster @ 2024-03-19 19:09 UTC (permalink / raw)
  To: mailing list for ConTeXt users, Jeroen

Jeroen schrieb am 19.03.2024 um 12:59:
> I have some style adjustments for the chapters. The chapter "numbers" 
> need to be Boek I, Boek II, etc. A vertical separator was introduced 
> with an inframe. The chapter title at the right side does not vertically 
> align properly with the chapter number in the frame (inside the frame is 
> vertically centered, the title not). Is there a way to align the chapter 
> title with the chapter number?
> 
> 
> 
> \starttexdefinition MyNumberChapterCommand #1
>      \inframed[frame=off,rightframe=on,framecolor=black,
>       rulethickness=1px,height=30pt]{#1\enspace}
> \stoptexdefinition
> 
> \setuphead[chapter][style={\bfc},numbercommand=\MyNumberChapterCommand,
>      page=no]

\define[2]\MyNumberChapterCommand
   {#1\space\blackrule[width=1pt,height=22pt,depth=8pt]\space#2}

\setuphead
   [chapter]
   [   page=no,
    command=\MyNumberChapterCommand,
      style=\bfc]

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

end of thread, other threads:[~2024-03-19 19:11 UTC | newest]

Thread overview: 4+ messages (download: mbox.gz / follow: Atom feed)
-- links below jump to the message on this page --
2024-03-19 11:59 [NTG-context] Adjusted Chapter Headings Jeroen
2024-03-19 14:45 ` [NTG-context] " Hraban Ramm
2024-03-19 18:51   ` Jeroen
2024-03-19 19:09 ` Wolfgang Schuster

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