* [NTG-context] Customizing chapter titles
@ 2024-08-06 19:26 Shiv Shankar Dayal
2024-08-06 19:30 ` [NTG-context] " Henning Hraban Ramm
0 siblings, 1 reply; 5+ messages in thread
From: Shiv Shankar Dayal @ 2024-08-06 19:26 UTC (permalink / raw)
To: mailing list for ConTeXt users
[-- Attachment #1: Type: text/plain, Size: 194 bytes --]
Hi,
What is the general method of customizing chapter titles? For example,
I would like something like the attachment. Is it achievable without
using Metapost?
--
Respect,
Shiv Shankar Dayal
[-- Attachment #2: image.png --]
[-- Type: image/png, Size: 2562 bytes --]
[-- Attachment #3: 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] 5+ messages in thread
* [NTG-context] Re: Customizing chapter titles
2024-08-06 19:26 [NTG-context] Customizing chapter titles Shiv Shankar Dayal
@ 2024-08-06 19:30 ` Henning Hraban Ramm
2024-08-06 20:20 ` Shiv Shankar Dayal
0 siblings, 1 reply; 5+ messages in thread
From: Henning Hraban Ramm @ 2024-08-06 19:30 UTC (permalink / raw)
To: mailing list for ConTeXt users
Am 06.08.24 um 21:26 schrieb Shiv Shankar Dayal:
> What is the general method of customizing chapter titles? For example,
> I would like something like the attachment. Is it achievable without
> using Metapost?
If you can create it with a macro, you can use it for a title.
This looks just like \framed and \rotate with \offset.
Hraban
___________________________________________________________________________________
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] 5+ messages in thread
* [NTG-context] Re: Customizing chapter titles
2024-08-06 19:30 ` [NTG-context] " Henning Hraban Ramm
@ 2024-08-06 20:20 ` Shiv Shankar Dayal
2024-08-06 21:05 ` Shiv Shankar Dayal
0 siblings, 1 reply; 5+ messages in thread
From: Shiv Shankar Dayal @ 2024-08-06 20:20 UTC (permalink / raw)
To: mailing list for ConTeXt users
This is what I came up with:
\setupcolors[state=start]
\definecolor [maincolor] [r=, g=.5, b=.7]
\setupinteraction
[
state=start,
color=maincolor,
contrastcolor=maincolor,
style=,
]
\define[2]\MyChapterCommand%
{\rotate[rotation=90]{\rm\small\sc \headtext{chapter}}
\framed[backgroundcolor=maincolor, background=color,
frame=off, foregroundcolor=white, foreground=color, style=\bfd]{#1}
\blank#2}
\setuphead[chapter][command=\MyChapterCommand]
\setupheadtext[chapter=Chapter]
\starttext
\chapter{Hello world}
\stoptext
The size of chapter no. is too small and I would like the title on new
line. I do not know how to do it.
On Wed, Aug 7, 2024 at 1:01 AM Henning Hraban Ramm <texml@fiee.net> wrote:
>
> Am 06.08.24 um 21:26 schrieb Shiv Shankar Dayal:
> > What is the general method of customizing chapter titles? For example,
> > I would like something like the attachment. Is it achievable without
> > using Metapost?
>
> If you can create it with a macro, you can use it for a title.
>
> This looks just like \framed and \rotate with \offset.
>
> Hraban
> ___________________________________________________________________________________
> 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
> ___________________________________________________________________________________
--
Respect,
Shiv Shankar Dayal
___________________________________________________________________________________
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] 5+ messages in thread
* [NTG-context] Re: Customizing chapter titles
2024-08-06 20:20 ` Shiv Shankar Dayal
@ 2024-08-06 21:05 ` Shiv Shankar Dayal
2024-08-06 21:10 ` Shiv Shankar Dayal
0 siblings, 1 reply; 5+ messages in thread
From: Shiv Shankar Dayal @ 2024-08-06 21:05 UTC (permalink / raw)
To: mailing list for ConTeXt users
Hi,
My final version is below:
\setupcolors[state=start]
\definecolor [maincolor] [r=, g=.5, b=.7]
\define[2]\MyChapterCommand
{\framed[align=flushright,
frame=off]{\rotate[rotation=90]{\rm\small\sc \headtext{chapter}}
\framed[backgroundcolor=maincolor, background=color,
frame=off, foregroundcolor=white, foreground=color,
loffset=-20pt]{\setupbodyfont[60pt] \ss#1}
\blank[force,4*medium] #2}}
\setuphead[chapter][command=\MyChapterCommand]
\setupheadtext[chapter=Chapter]
\setupbodyfont[10pt]
\starttext
\chapter{Hello world}
Hello
\stoptext
This is what will work but I want all of it to have right alignment
but it does not go to right.
On Wed, Aug 7, 2024 at 1:50 AM Shiv Shankar Dayal
<shivshankar.dayal@gmail.com> wrote:
>
> This is what I came up with:
>
> \setupcolors[state=start]
> \definecolor [maincolor] [r=, g=.5, b=.7]
> \setupinteraction
> [
> state=start,
> color=maincolor,
> contrastcolor=maincolor,
> style=,
> ]
>
> \define[2]\MyChapterCommand%
> {\rotate[rotation=90]{\rm\small\sc \headtext{chapter}}
> \framed[backgroundcolor=maincolor, background=color,
> frame=off, foregroundcolor=white, foreground=color, style=\bfd]{#1}
> \blank#2}
> \setuphead[chapter][command=\MyChapterCommand]
> \setupheadtext[chapter=Chapter]
> \starttext
> \chapter{Hello world}
> \stoptext
>
> The size of chapter no. is too small and I would like the title on new
> line. I do not know how to do it.
>
> On Wed, Aug 7, 2024 at 1:01 AM Henning Hraban Ramm <texml@fiee.net> wrote:
> >
> > Am 06.08.24 um 21:26 schrieb Shiv Shankar Dayal:
> > > What is the general method of customizing chapter titles? For example,
> > > I would like something like the attachment. Is it achievable without
> > > using Metapost?
> >
> > If you can create it with a macro, you can use it for a title.
> >
> > This looks just like \framed and \rotate with \offset.
> >
> > Hraban
> > ___________________________________________________________________________________
> > 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
> > ___________________________________________________________________________________
>
>
>
> --
> Respect,
> Shiv Shankar Dayal
--
Respect,
Shiv Shankar Dayal
___________________________________________________________________________________
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] 5+ messages in thread
* [NTG-context] Re: Customizing chapter titles
2024-08-06 21:05 ` Shiv Shankar Dayal
@ 2024-08-06 21:10 ` Shiv Shankar Dayal
0 siblings, 0 replies; 5+ messages in thread
From: Shiv Shankar Dayal @ 2024-08-06 21:10 UTC (permalink / raw)
To: mailing list for ConTeXt users
Hi,
Finally got it working with:;
\setupcolors[state=start]
\definecolor [maincolor] [r=, g=.5, b=.7]
\define[2]\MyChapterCommand
{\framed[align=flushright, width=\textwidth,
frame=off]{\rotate[rotation=90]{\rm\small\sc \headtext{chapter}}
\framed[backgroundcolor=maincolor, background=color,
frame=off, foregroundcolor=white, foreground=color,
loffset=-20pt]{\setupbodyfont[60pt] \ss#1}
\blank[force,4*medium]\ss\setupbodyfont[20pt] #2}}
\setuphead[chapter][command=\MyChapterCommand]
\setupheadtext[chapter=Chapter]
\setupbodyfont[10pt]
\starttext
\chapter{Hello world}
Hello
\stoptext
On Wed, Aug 7, 2024 at 2:35 AM Shiv Shankar Dayal
<shivshankar.dayal@gmail.com> wrote:
>
> Hi,
>
> My final version is below:
>
> \setupcolors[state=start]
> \definecolor [maincolor] [r=, g=.5, b=.7]
> \define[2]\MyChapterCommand
> {\framed[align=flushright,
> frame=off]{\rotate[rotation=90]{\rm\small\sc \headtext{chapter}}
> \framed[backgroundcolor=maincolor, background=color,
> frame=off, foregroundcolor=white, foreground=color,
> loffset=-20pt]{\setupbodyfont[60pt] \ss#1}
> \blank[force,4*medium] #2}}
> \setuphead[chapter][command=\MyChapterCommand]
> \setupheadtext[chapter=Chapter]
> \setupbodyfont[10pt]
> \starttext
> \chapter{Hello world}
> Hello
> \stoptext
>
> This is what will work but I want all of it to have right alignment
> but it does not go to right.
>
> On Wed, Aug 7, 2024 at 1:50 AM Shiv Shankar Dayal
> <shivshankar.dayal@gmail.com> wrote:
> >
> > This is what I came up with:
> >
> > \setupcolors[state=start]
> > \definecolor [maincolor] [r=, g=.5, b=.7]
> > \setupinteraction
> > [
> > state=start,
> > color=maincolor,
> > contrastcolor=maincolor,
> > style=,
> > ]
> >
> > \define[2]\MyChapterCommand%
> > {\rotate[rotation=90]{\rm\small\sc \headtext{chapter}}
> > \framed[backgroundcolor=maincolor, background=color,
> > frame=off, foregroundcolor=white, foreground=color, style=\bfd]{#1}
> > \blank#2}
> > \setuphead[chapter][command=\MyChapterCommand]
> > \setupheadtext[chapter=Chapter]
> > \starttext
> > \chapter{Hello world}
> > \stoptext
> >
> > The size of chapter no. is too small and I would like the title on new
> > line. I do not know how to do it.
> >
> > On Wed, Aug 7, 2024 at 1:01 AM Henning Hraban Ramm <texml@fiee.net> wrote:
> > >
> > > Am 06.08.24 um 21:26 schrieb Shiv Shankar Dayal:
> > > > What is the general method of customizing chapter titles? For example,
> > > > I would like something like the attachment. Is it achievable without
> > > > using Metapost?
> > >
> > > If you can create it with a macro, you can use it for a title.
> > >
> > > This looks just like \framed and \rotate with \offset.
> > >
> > > Hraban
> > > ___________________________________________________________________________________
> > > 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
> > > ___________________________________________________________________________________
> >
> >
> >
> > --
> > Respect,
> > Shiv Shankar Dayal
>
>
>
> --
> Respect,
> Shiv Shankar Dayal
--
Respect,
Shiv Shankar Dayal
___________________________________________________________________________________
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] 5+ messages in thread
end of thread, other threads:[~2024-08-06 21:12 UTC | newest]
Thread overview: 5+ messages (download: mbox.gz / follow: Atom feed)
-- links below jump to the message on this page --
2024-08-06 19:26 [NTG-context] Customizing chapter titles Shiv Shankar Dayal
2024-08-06 19:30 ` [NTG-context] " Henning Hraban Ramm
2024-08-06 20:20 ` Shiv Shankar Dayal
2024-08-06 21:05 ` Shiv Shankar Dayal
2024-08-06 21:10 ` Shiv Shankar Dayal
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).