* Re: perfect centering of layers in a text area
2014-09-20 0:56 perfect centering of layers in a text area Bernd Donner
@ 2014-09-20 10:31 ` Wolfgang Schuster
0 siblings, 0 replies; 2+ messages in thread
From: Wolfgang Schuster @ 2014-09-20 10:31 UTC (permalink / raw)
To: mailing list for ConTeXt users
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
___________________________________________________________________________________
^ permalink raw reply [flat|nested] 2+ messages in thread