* Adjustment for header and footer
@ 2021-08-22 11:13 Fabrice Couvreur via ntg-context
2021-08-22 20:57 ` Wolfgang Schuster via ntg-context
0 siblings, 1 reply; 2+ messages in thread
From: Fabrice Couvreur via ntg-context @ 2021-08-22 11:13 UTC (permalink / raw)
To: mailing list for ConTeXt users; +Cc: Fabrice Couvreur
[-- Attachment #1.1: Type: text/plain, Size: 2478 bytes --]
Hi,
In the file below (not minimal, sorry!) I am using commands from Wolfgang
in different threads. We can see that the top frame overflows into the
text: how to correct this ?
I would also like the top and bottom stroke to be adjusted to the width of
the paper.
Thanks
Fabrice
\useMPlibrary[dum]
\setuplayout
[topspace=1cm,
backspace=3cm,
cutspace=3cm,
leftmargin=.75cm,
leftmargindistance=.5cm,
rightmargin=1.25cm,
rightmargindistance=1cm,
header=20mm,
headerdistance=1cm,
footer=20mm,
footerdistance=1cm,
width=middle,
height=middle,
location=middle]
\setupbodyfont
[newcomputermodern-book,11pt]
\definefont
[TextStyle]
[SansBold*default sa 1.2]
\defineframed
[headerframed]
[frame=off,
height=fit,
width=fit,
]
\setupbackgrounds [header] [text]
[frame=off,bottomframe=on,width=\widthpaper,
framecolor=darkred,rulethickness=1pt]
\setupbackgrounds [footer] [text]
[frame=off,bottomframe=on,width=max,
framecolor=darkred,rulethickness=1pt]
\setupfootertexts
[margin]
[]
[{\offset[y=\strutdp]{\externalfigure[dum][factor=max]}}]
[]
[{\offset[y=\strutdp]{\externalfigure[dum][factor=max]}}]
\startsetups [headertext]
\setupheadertexts
[{
\startframed [headerframed]
[foregroundstyle=TextStyle,align=middle]
\getvariable{headertext}{location}\\
Spécialité mathématiques\\
\getvariable{headertext}{title} n\high{\tfxx \bf
o}\,\getvariable{headertext}{number}
\stopframed
}]
\setupheadertexts
[{
\startframed [headerframed]
[align=flushleft,foregroundstyle=\ssx]
Lycée LA SALLE\\
Durée : \getvariable{headertext}{time}\\
\date[d=\getvariable{headertext}{day},m=\getvariable{headertext}{month},y=\getvariable{headertext}{year}]
\stopframed
}]
[{
\startframed [headerframed]
[align=flushright,foregroundstyle=\ssx]
\externalfigure[dum] [factor=max]
\stopframed
}]
\stopsetups
\setvariable{headertext}{set}{\directsetup{headertext}}
\setvariables
[headertext]
[title={Devoir maison},
number={2},
day={22},
month={08},
year={2021},
location={Terminale},
time={2 heures}]
\starttext
\samplefile{lorem}
\stoptext
[-- Attachment #1.2: Type: text/html, Size: 4291 bytes --]
[-- Attachment #2: Type: text/plain, Size: 493 bytes --]
___________________________________________________________________________________
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
___________________________________________________________________________________
^ permalink raw reply [flat|nested] 2+ messages in thread
* Re: Adjustment for header and footer
2021-08-22 11:13 Adjustment for header and footer Fabrice Couvreur via ntg-context
@ 2021-08-22 20:57 ` Wolfgang Schuster via ntg-context
0 siblings, 0 replies; 2+ messages in thread
From: Wolfgang Schuster via ntg-context @ 2021-08-22 20:57 UTC (permalink / raw)
To: mailing list for ConTeXt users, Fabrice Couvreur via ntg-context
Cc: Wolfgang Schuster
[-- Attachment #1.1: Type: text/plain, Size: 1315 bytes --]
Fabrice Couvreur via ntg-context schrieb am 22.08.2021 um 13:13:
> Hi,
> In the file below (not minimal, sorry!) I am using commands from
> Wolfgang in different threads. We can see that the top frame overflows
> into the text: how to correct this ?
> I would also like the top and bottom stroke to be adjusted to the
> width of the paper.
> Thanks
> Fabrice
>
> [...]
>
> \setupheadertexts
> [{
> \startframed [headerframed]
> [align=flushleft,foregroundstyle=\ssx]
> Lycée LA SALLE\\
> Durée : \getvariable{headertext}{time}\\
> \date[d=\getvariable{headertext}{day},m=\getvariable{headertext}{month},y=\getvariable{headertext}{year}]
> \stopframed
> }]
> [{
> \startframed [headerframed] [align=flushright,foregroundstyle=\ssx]
Add "offset=overlay" to the frame for the image, the graphic has already
the same height of the header and you're adding additional offset from
the frame which pushes the complete header block down.
> \externalfigure[dum] [factor=max]
> \stopframed
> }]
>
> [...]
When you have a similar problem in the future I suggest to enable the
frame for the header line with \showframe and in addition enable the
frame for your \framed blocks.
Wolfgang
[-- Attachment #1.2: Type: text/html, Size: 3596 bytes --]
[-- Attachment #2: Type: text/plain, Size: 493 bytes --]
___________________________________________________________________________________
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
___________________________________________________________________________________
^ permalink raw reply [flat|nested] 2+ messages in thread
end of thread, other threads:[~2021-08-22 20:57 UTC | newest]
Thread overview: 2+ messages (download: mbox.gz / follow: Atom feed)
-- links below jump to the message on this page --
2021-08-22 11:13 Adjustment for header and footer Fabrice Couvreur via ntg-context
2021-08-22 20:57 ` Wolfgang Schuster 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).