Re: [NTG-context] Adjustment for header and footer

2021-08-22 Thread Wolfgang Schuster via ntg-context

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

___
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
___


[NTG-context] Adjustment for header and footer

2021-08-22 Thread Fabrice Couvreur via ntg-context
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
___
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
___