ntg-context - mailing list for ConTeXt users
 help / color / mirror / Atom feed
* About \setupheadertexts : simplify a code
@ 2017-08-17 13:25 Fabrice Couvreur
  2017-08-17 22:39 ` Henri
  0 siblings, 1 reply; 25+ messages in thread
From: Fabrice Couvreur @ 2017-08-17 13:25 UTC (permalink / raw)
  To: mailing list for ConTeXt users


[-- Attachment #1.1: Type: text/plain, Size: 1261 bytes --]

Hello,
To get the alignment, I had to create three \vbox. Can we simplify this
code a bit ?
Thank you
Fabrice

% macros=mkvi
\setuplayout
   [header=3\lineheight,
    headerdistance=\lineheight]

\setupbackgrounds[header][text]
                 [frame=off,
                  bottomframe=on,
                  framecolor=darkgray,
                  rulethickness=2pt]

\defineframed[headerframedleft]
             [frame=off,
              align=left,
              width=fit,height=\headerheight]

\defineframed[headerframedright]
             [frame=off,
              align=right,
              width=fit,height=\headerheight]

\defineframed[headerframedmiddle]
             [frame=off,
              align=middle,
              width=fit,height=\headerheight]

\starttexdefinition MyHeader #where #day #month #year #title #number #time

\setupheadertexts
   [\headerframedmiddle{\\ \ss\sc\bf\red #title n\high{o}\,#number \\ }]

\setupheadertexts
   [\headerframedright{\tfx \ss Lycée JANSON DE SAILLY \\
\date[d=#day,m=#month,y=#year]}]
   [\headerframedleft{\tfx\ss #where \\ {#time}}]

\stoptexdefinition

\MyHeader{Seconde}{17}{08}{2017}{Devoir surveillé}{1}{1h\,30m}

\starttext
\input knuth
\stoptext

[-- Attachment #1.2: Type: text/html, Size: 1836 bytes --]

[-- Attachment #2: Type: text/plain, Size: 492 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] 25+ messages in thread
[parent not found: <mailman.1693.1503094464.2080.ntg-context@ntg.nl>]
[parent not found: <mailman.1.1503136802.15098.ntg-context@ntg.nl>]

end of thread, other threads:[~2017-08-19 16:38 UTC | newest]

Thread overview: 25+ messages (download: mbox.gz / follow: Atom feed)
-- links below jump to the message on this page --
2017-08-17 13:25 About \setupheadertexts : simplify a code Fabrice Couvreur
2017-08-17 22:39 ` Henri
2017-08-18  4:25   ` Aditya Mahajan
2017-08-18  9:45     ` Otared Kavian
2017-08-18 10:46       ` Fabrice Couvreur
2017-08-18 13:05       ` Jean-Pierre Delange
2017-08-18 13:25         ` Fabrice Couvreur
2017-08-18 15:06         ` Fabrice Couvreur
2017-08-18 15:54       ` Aditya Mahajan
2017-08-18 16:44         ` Otared Kavian
2017-08-18 21:34           ` Fabrice Couvreur
2017-08-18 21:57             ` Rik Kabel
2017-08-18 22:14               ` Fabrice Couvreur
2017-08-18 22:23                 ` Rik Kabel
2017-08-18 23:01                   ` Fabrice Couvreur
2017-08-18 23:06                     ` Fabrice Couvreur
2017-08-18 23:15                     ` Rik
2017-08-18 23:25                       ` Fabrice Couvreur
2017-08-18 23:00             ` Aditya Mahajan
     [not found] <mailman.1693.1503094464.2080.ntg-context@ntg.nl>
2017-08-18 23:29 ` Jeong Dal
2017-08-19  9:55   ` Fabrice Couvreur
2017-08-19 10:35     ` Aditya Mahajan
2017-08-19 10:51       ` Fabrice Couvreur
2017-08-19 16:38       ` Jean-Pierre Delange
     [not found] <mailman.1.1503136802.15098.ntg-context@ntg.nl>
2017-08-19 11:58 ` Jeong Dal

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).