memoir-style chapter heading
Am completely new to using Metafun, which I presume I would need to use to achieve a Hansen Memoir-style Chapter heading (chapter title overlayed on a large lightgray number). Of course, I am assuming I would need to use Metafun to create this... So my first question is to ask if I could achieve the same effect without Metafun? I have read through the Metafun manual, and I think I can understand how to overlay text on a graphic (MP), but it would be currently beyond me to draw numbers of the kind we find in, say, the Memoir examples. Has anyone created such an example? I was keenly looking for one in the manual and elsewhere, in terms of ConTeXt/Metafun commands, but could not find one. But I'd be quite prepared to 'have a go' at this, if I had some pointers of just where to start! I assume I would have to \defineoverlay[number] and then add text on top \framed (but without the frame borders). Am I at least correct about this? Julian
On Mon, 17 Aug 2020, jbf wrote:
Am completely new to using Metafun, which I presume I would need to use to achieve a Hansen Memoir-style Chapter heading (chapter title overlayed on a large lightgray number). Of course, I am assuming I would need to use Metafun to create this...
So my first question is to ask if I could achieve the same effect without Metafun?
I have read through the Metafun manual, and I think I can understand how to overlay text on a graphic (MP), but it would be currently beyond me to draw numbers of the kind we find in, say, the Memoir examples.
Has anyone created such an example? I was keenly looking for one in the manual and elsewhere, in terms of ConTeXt/Metafun commands, but could not find one. But I'd be quite prepared to 'have a go' at this, if I had some pointers of just where to start! I assume I would have to \defineoverlay[number] and then add text on top \framed (but without the frame borders). Am I at least correct about this?
You don't need metafun for something this simple. Here is a crude implementation: \setuphead[chapter] [ numberstyle={\switchtobodyfont[48pt]}, numbercolor=gray, alternative=command, command=\MemoirChapter, ] \define[2]\MemoirChapter% {\startoverlay {#1} {#2} \stopoverlay} \starttext \startchapter[title={This is a test}] \stopchapter \stoptext Overlays don't allow tuning the location...for that you need layers. See the chapter on ornaments in the details manual, which also explains an alternative method to set title of chapters (toward the end of that chapter), which is useful if you need absolute positioning. Aditya
Thanks Aditya. The 'quick and simple' explanation below helps me to grasp some concepts I had not been clear about earlier. While you say that overlays 'don't allow tuning' for positioning, is this only in terms of absolute positioning? It would be so helpful if we could get at least a middle or right alignment with this simple approach. I have read the 'Details' approach you have indicated, though am still to get my head around it. Understanding overlays is one thing. Understanding layers yet another. Julian On 17/8/20 4:54 pm, Aditya Mahajan wrote:
On Mon, 17 Aug 2020, jbf wrote:
Am completely new to using Metafun, which I presume I would need to use to achieve a Hansen Memoir-style Chapter heading (chapter title overlayed on a large lightgray number). Of course, I am assuming I would need to use Metafun to create this...
So my first question is to ask if I could achieve the same effect without Metafun?
I have read through the Metafun manual, and I think I can understand how to overlay text on a graphic (MP), but it would be currently beyond me to draw numbers of the kind we find in, say, the Memoir examples.
Has anyone created such an example? I was keenly looking for one in the manual and elsewhere, in terms of ConTeXt/Metafun commands, but could not find one. But I'd be quite prepared to 'have a go' at this, if I had some pointers of just where to start! I assume I would have to \defineoverlay[number] and then add text on top \framed (but without the frame borders). Am I at least correct about this? You don't need metafun for something this simple. Here is a crude implementation:
\setuphead[chapter] [ numberstyle={\switchtobodyfont[48pt]}, numbercolor=gray, alternative=command, command=\MemoirChapter, ]
\define[2]\MemoirChapter% {\startoverlay {#1} {#2} \stopoverlay}
\starttext \startchapter[title={This is a test}] \stopchapter
\stoptext
Overlays don't allow tuning the location...for that you need layers. See the chapter on ornaments in the details manual, which also explains an alternative method to set title of chapters (toward the end of that chapter), which is useful if you need absolute positioning.
Aditya
___________________________________________________________________________________ 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://context.aanhet.net archive : https://bitbucket.org/phg/context-mirror/commits/ wiki : http://contextgarden.net ___________________________________________________________________________________
I meant to include an example of what I mean, since at least it seems to work (am including just the definition part of your example), So at least I can get middle and right alignment. \define[2]\MemoirChapter {\midaligned{\startoverlay {#1} {#2} \stopoverlay}} Julian On 17/8/20 4:54 pm, Aditya Mahajan wrote:
On Mon, 17 Aug 2020, jbf wrote:
Am completely new to using Metafun, which I presume I would need to use to achieve a Hansen Memoir-style Chapter heading (chapter title overlayed on a large lightgray number). Of course, I am assuming I would need to use Metafun to create this...
So my first question is to ask if I could achieve the same effect without Metafun?
I have read through the Metafun manual, and I think I can understand how to overlay text on a graphic (MP), but it would be currently beyond me to draw numbers of the kind we find in, say, the Memoir examples.
Has anyone created such an example? I was keenly looking for one in the manual and elsewhere, in terms of ConTeXt/Metafun commands, but could not find one. But I'd be quite prepared to 'have a go' at this, if I had some pointers of just where to start! I assume I would have to \defineoverlay[number] and then add text on top \framed (but without the frame borders). Am I at least correct about this? You don't need metafun for something this simple. Here is a crude implementation:
\setuphead[chapter] [ numberstyle={\switchtobodyfont[48pt]}, numbercolor=gray, alternative=command, command=\MemoirChapter, ]
\define[2]\MemoirChapter% {\startoverlay {#1} {#2} \stopoverlay}
\starttext \startchapter[title={This is a test}] \stopchapter
\stoptext
Overlays don't allow tuning the location...for that you need layers. See the chapter on ornaments in the details manual, which also explains an alternative method to set title of chapters (toward the end of that chapter), which is useful if you need absolute positioning.
Aditya
___________________________________________________________________________________ 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://context.aanhet.net archive : https://bitbucket.org/phg/context-mirror/commits/ wiki : http://contextgarden.net ___________________________________________________________________________________
Hi Julian, Indeed you can modify slightly what Aditya said to obtain what you want: you can put the overlay into a framed environment as in the following example. Though, to my taste the number is a little bit too low… %% begin example \setuppagenumbering[state=start,location=footer] \setuphead[chapter] [ numberstyle={\switchtobodyfont[48pt]}, numbercolor=gray, alternative=command, command=\MemoirChapter, ] \define[2]\MemoirChapter {\framed[frame=off,width=broad,align=middle] {\startoverlay {#1} {#2} \stopoverlay} } \starttext \startchapter[title={This is a test}] \input knuth.tex \stopchapter \stoptext %% end example Best regards: Otared
On 18 Aug 2020, at 01:18, jbf
wrote: I meant to include an example of what I mean, since at least it seems to work (am including just the definition part of your example), So at least I can get middle and right alignment.
\define[2]\MemoirChapter {\midaligned{\startoverlay {#1} {#2} \stopoverlay}}
Julian
On 17/8/20 4:54 pm, Aditya Mahajan wrote:
On Mon, 17 Aug 2020, jbf wrote:
Am completely new to using Metafun, which I presume I would need to use to achieve a Hansen Memoir-style Chapter heading (chapter title overlayed on a large lightgray number). Of course, I am assuming I would need to use Metafun to create this...
So my first question is to ask if I could achieve the same effect without Metafun?
I have read through the Metafun manual, and I think I can understand how to overlay text on a graphic (MP), but it would be currently beyond me to draw numbers of the kind we find in, say, the Memoir examples.
Has anyone created such an example? I was keenly looking for one in the manual and elsewhere, in terms of ConTeXt/Metafun commands, but could not find one. But I'd be quite prepared to 'have a go' at this, if I had some pointers of just where to start! I assume I would have to \defineoverlay[number] and then add text on top \framed (but without the frame borders). Am I at least correct about this? You don't need metafun for something this simple. Here is a crude implementation:
\setuphead[chapter] [ numberstyle={\switchtobodyfont[48pt]}, numbercolor=gray, alternative=command, command=\MemoirChapter, ]
\define[2]\MemoirChapter% {\startoverlay {#1} {#2} \stopoverlay}
\starttext \startchapter[title={This is a test}] \stopchapter
\stoptext
Overlays don't allow tuning the location...for that you need layers. See the chapter on ornaments in the details manual, which also explains an alternative method to set title of chapters (toward the end of that chapter), which is useful if you need absolute positioning.
Aditya
___________________________________________________________________________________ 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://context.aanhet.net archive : https://bitbucket.org/phg/context-mirror/commits/ 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://context.aanhet.net archive : https://bitbucket.org/phg/context-mirror/commits/ wiki : http://contextgarden.net ___________________________________________________________________________________
participants (3)
-
Aditya Mahajan
-
jbf
-
Otared Kavian