ntg-context - mailing list for ConTeXt users
 help / color / mirror / Atom feed
From: Fabrice Couvreur via ntg-context <ntg-context@ntg.nl>
To: mailing list for ConTeXt users <ntg-context@ntg.nl>
Cc: Fabrice Couvreur <fabrice1.couvreur@gmail.com>
Subject: Adjustment for header and footer
Date: Sun, 22 Aug 2021 13:13:38 +0200	[thread overview]
Message-ID: <CACyK-erXNa15hzytbHg8TGY1VcC++Gus7WQd7QQr3YDeGJ6v8g@mail.gmail.com> (raw)


[-- 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
___________________________________________________________________________________

             reply	other threads:[~2021-08-22 11:13 UTC|newest]

Thread overview: 2+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2021-08-22 11:13 Fabrice Couvreur via ntg-context [this message]
2021-08-22 20:57 ` Wolfgang Schuster via ntg-context

Reply instructions:

You may reply publicly to this message via plain-text email
using any one of the following methods:

* Save the following mbox file, import it into your mail client,
  and reply-to-all from there: mbox

  Avoid top-posting and favor interleaved quoting:
  https://en.wikipedia.org/wiki/Posting_style#Interleaved_style

* Reply using the --to, --cc, and --in-reply-to
  switches of git-send-email(1):

  git send-email \
    --in-reply-to=CACyK-erXNa15hzytbHg8TGY1VcC++Gus7WQd7QQr3YDeGJ6v8g@mail.gmail.com \
    --to=ntg-context@ntg.nl \
    --cc=fabrice1.couvreur@gmail.com \
    /path/to/YOUR_REPLY

  https://kernel.org/pub/software/scm/git/docs/git-send-email.html

* If your mail client supports setting the In-Reply-To header
  via mailto: links, try the mailto: link
Be sure your reply has a Subject: header at the top and a blank line before the message body.
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).