ntg-context - mailing list for ConTeXt users
 help / color / mirror / Atom feed
From: Hans Hagen <pragma@wxs.nl>
Subject: Re: centered headertexts ??
Date: Thu, 27 Jul 2006 12:28:33 +0200	[thread overview]
Message-ID: <44C89551.1050208@wxs.nl> (raw)
In-Reply-To: <9116CE2A-4BDC-41EC-AF76-7412E5085D3B@st.estfiles.de>

Steffen Wolfrum wrote:
> Hi,
>
> apologies, I guess this one is a pretty easy question, but after  
> trying (almost) every combination I gave up...
>
> How do I get xxx and yyy set in the header's center??
>
>   
the ugly way :

\setupheadertexts[text][\hfill xxx \hfill][][][\hfill yyy\hfill]

> \setuppagenumbering [alternative=doublesided,location= 
> {header,marginedge}]
> \setupheadertexts[][xxx][yyy][]
>
>
> \starttext
>
> \input tufte
>
> \input knuth
>
> \input tufte
>
> \input knuth
>
> \input tufte
>
> \input knuth
>
> \stoptext
>   
we can consider a more explicit variant: 

\def\settext
  {\doquintupleempty\dosettext}

\def\dosettext[#1][#2][#3][#4][#5]% text header middle text/text
  {\iffifthargument
     \setvalue{\??tk#1#2\executeifdefined{\c!text:#3}\c!middletext}%
       {\dodoubletexts{\??tk#1}{#2}%
          {\c!leftstyle \c!leftcolor \c!leftwidth }{#4}%
          {\c!rightstyle\c!rightcolor\c!rightwidth}{#5}}%
   \else\iffourthargument
     \setvalue{\??tk#1#2\executeifdefined{\c!text:#3}\c!middletext}%
       {\dodoubletexts{\??tk#1}{#2}%
          {\c!leftstyle \c!leftcolor \c!leftwidth }{#4}%
          {\c!rightstyle\c!rightcolor\c!rightwidth}{#4}}%
   \else\ifthirdargument
     \setvalue{\??tk#1#2\c!middletext}%
       {\dodoubletexts{\??tk#1}{#2}%
          {\c!leftstyle \c!leftcolor \c!leftwidth }{#3}%
          {\c!rightstyle\c!rightcolor\c!rightwidth}{#3}}%
   \fi\fi\fi}

\def\resettext
  {\dotripleempty\doresettext}

\def\doresettext[#1][#2][#3]% text header middle
  {\ifthirdargument
     \letvalue{\??tk#1#2\executeifdefined{\c!text:#3}\c!middletext}\empty
   \else\ifsecondargument
     \letvalue{\??tk#1#2\c!lefttext  }\empty
     \letvalue{\??tk#1#2\c!middletext}\empty
     \letvalue{\??tk#1#2\c!righttext }\empty
   \fi\fi}

\setvalue{\c!middle:\c!text}{\c!middletext}
\setvalue{\c!left  :\c!text}{\c!lefttext  }
\setvalue{\c!right :\c!text}{\c!righttext }

\settext[text][header][middle][xxx][yyy]

(or maybe \setpagetext \resetpagetext) 

-----------------------------------------------------------------
                                          Hans Hagen | PRAGMA ADE
              Ridderstraat 27 | 8061 GH Hasselt | The Netherlands
     tel: 038 477 53 69 | fax: 038 477 53 74 | www.pragma-ade.com
                                             | www.pragma-pod.nl
-----------------------------------------------------------------

      parent reply	other threads:[~2006-07-27 10:28 UTC|newest]

Thread overview: 3+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2006-07-26 16:04 Steffen Wolfrum
2006-07-26 16:44 ` Peter Rolf
2006-07-27 10:28 ` Hans Hagen [this message]

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=44C89551.1050208@wxs.nl \
    --to=pragma@wxs.nl \
    --cc=ntg-context@ntg.nl \
    /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).