How to center \framed on a position?
Hello, how to center vertically and horizontally a \framed text at the layer origin? I'm not able to figure it out... Here's my code: ---- \setuplayout[page] \definelayer[mybg] \setlayer[mybg] [x=\dimexpr.5\paperwidth\relax,y=\dimexpr.5\paperheight\relax,] {\framed [frame=on,offset=5mm,align={middle,lohi},width=fit,rulewidth=2mm,location=lohi,] {% \setupbodyfont[10mm,sans]% \bf Some text% } } \setupbackgrounds[page][background={mybg}] \starttext Hello, world! \stoptext ---- And - where has the text "Hello, world!" disappeared? Any help would be appreciated... Best regards, Lukas -- Ing. Lukáš Procházka | mailto:LPr@pontex.cz Pontex s. r. o. | mailto:pontex@pontex.cz | http://www.pontex.cz Bezová 1658 147 14 Praha 4 Tel: +420 241 096 751 Fax: +420 244 461 038
On 04/06/2016 01:30 PM, Procházka Lukáš Ing. wrote:
Hello,
how to center vertically and horizontally a \framed text at the layer origin?
I'm not able to figure it out... [...] And - where has the text "Hello, world!" disappeared?
Hi Lukáš, here you have the code: \setuplayout[page] \definelayer[mybg][position=middle, location=middle] \setlayer[mybg] [x=.5\paperwidth,y=.5\paperheight] {\framed [frame=on,offset=5mm,width=fit,rulewidth=2mm] {\setupbodyfont[10mm,sans]\bf Some text} } \setupbackgrounds[page][background={mybg}] \setupbodyfont[helvetica] \starttext Hello, world! \stoptext Layer has also position and location. As far as I remember, default values are {top, left}. I recall a comment from Wolfgang about setting the body font when using layers. This is the way to have your text. I hope it helps, Pablo -- http://www.ousia.tk
participants (2)
-
Pablo Rodriguez
-
Procházka Lukáš Ing.