ntg-context - mailing list for ConTeXt users
 help / color / mirror / Atom feed
From: Wolfgang Schuster <schuster.wolfgang@gmail.com>
To: mailing list for ConTeXt users <ntg-context@ntg.nl>
Subject: Re: perfect centering of layers in a text area
Date: Sat, 20 Sep 2014 12:31:14 +0200	[thread overview]
Message-ID: <0FDD1CF8-7C16-44A1-8306-193014476B4D@gmail.com> (raw)
In-Reply-To: <201409200256.19305.Bernd.Donner@gmx.net>


Am 20.09.2014 um 02:56 schrieb Bernd Donner <Bernd.Donner@gmx.net>:

> Hello,
> 
> I'm converting some context from mkii to mkiv. Since the definelogo is 
> depreciated I try to use layers to get the same result.
> 
> The problem in the example below is, the text in the header - which is a 
> table - is not perfectly centered with respect to the bottomframe. What is 
> the reason that the table is not perfectly centered with respect to the line 
> and what is the correct solution?
> 
> Thank you,
> Bernd
> 
> 
> 
> 
> \setuppapersize[A4]
> 
> \language[de]
> \enableregime[utf]
> 
> \setuplayout[backspace=2.0cm, height=fit, width=fit, rightmarginwidth=0.0cm,
>        leftmargin=1.8cm, footerdistance=0.0cm,
>        rightmargindistance=0.2cm, rightmargin=1.8cm, bottom=0.5cm,
>        leftmargindistance=0.2cm, header=0.4cm, headerdistance=0.5cm,
>        footer=0.5cm, top=0.0cm, topspace=0.0cm, bottomspace=0.0cm]
> 
> \definelayer[sabel]
>  [x=0mm, y=0mm, width=\paperwidth, height=\paperheight, preset=lefttop]
> 
> \startsetups layer
> 
> \setlayer[sabel]
>  [hoffset=0mm, voffset=0mm]
>  {\tfx{\vbox
>  {\bTABLE[option=stretch]
>  \setupTABLE[rulethickness=0pt]
>  \setupTABLE[column][1][align={right}, width=.4\textwidth]
>  \setupTABLE[column][2][align={center}]
>  \setupTABLE[column][3][align={left}, width=.4\textwidth]
>  \bTR \bTD I want to be \eTD \bTD \eTD \bTD perfectly centered \eTD \eTR
>  \eTABLE}}}
> 
> \stopsetups
> 
> \setupbackgrounds[header][text][bottomframe=on, setups=layer, 
> background=sabel]
> \setuppagenumbering[location=]
> 
> \starttext
> thx
> \stoptext

\mainlanguage[de]

\setuplayout
  [backspace=2.0cm,
   height=middle,
   width=middle,
   leftmargin=1.8cm,
   footerdistance=0.0cm,
   rightmargindistance=0.2cm,
   rightmargin=1.8cm,
   bottom=0.5cm,
   leftmargindistance=0.2cm,
   header=0.4cm,
   headerdistance=0.5cm,
   footer=0.5cm,
   top=0.0cm,
   topspace=0.0cm,
   bottomspace=0.0cm]

\definelayer[sabel]

\startsetups[sabel]

\setlayerframed[sabel][x=0mm,y=0mm][frame=on,offset=none]
  {\setupTABLE[column][1][align=right, width=.4\textwidth]%
   \setupTABLE[column][2][align=center,width=.2\textwidth]%
   \setupTABLE[column][3][align=left, width=.4\textwidth]%
   \bTABLE[frame=off,style=\tfx]
     \bTR \bTD I want to be \eTD \bTD \eTD \bTD perfectly centered \eTD \eTR
   \eTABLE}

\stopsetups

\setupbackgrounds[header][text][bottomframe=on,setups=sabel,background=sabel]
\setuppagenumbering[location=]

\starttext
thx
\stoptext

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://tex.aanhet.net
archive  : http://foundry.supelec.fr/projects/contextrev/
wiki     : http://contextgarden.net
___________________________________________________________________________________


      reply	other threads:[~2014-09-20 10:31 UTC|newest]

Thread overview: 2+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2014-09-20  0:56 Bernd Donner
2014-09-20 10:31 ` Wolfgang Schuster [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=0FDD1CF8-7C16-44A1-8306-193014476B4D@gmail.com \
    --to=schuster.wolfgang@gmail.com \
    --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).