* centering & fit question
@ 2009-02-13 15:03 Alan Stone
2009-02-13 19:21 ` Wolfgang Schuster
0 siblings, 1 reply; 4+ messages in thread
From: Alan Stone @ 2009-02-13 15:03 UTC (permalink / raw)
To: mailing list for ConTeXt users
[-- Attachment #1.1: Type: text/plain, Size: 1305 bytes --]
Hello,
In the underneath example, the only way I found to have everything
horizontally and vertically centered in the text and margin header,
as well as fit into the margin header, is as follows:
\setuplayout[margin=3cm]
\showframe
\def\myText{%
% \hfill some text \hfill}
%\starthiding
\framed[%
width=\textwidth,
height=\headerheight,
align=middle,
top=\vss,
bottom=\vss,
frame=off]
{some text}}
%\stophiding
\def\myMarginText{%
% \hfill this is some margin text \hfill}
%\starthiding
\framed[%
width=\marginwidth,
height=\headerheight,
align=middle,
top=\vss,
bottom=\vss,
frame=off]
{this is some longer margin text}}
%\stophiding
\setuppagenumbering[location=footer]
%\setupheader[%
% before=\vss,
% after=\vss]
\setupheadertexts[text]
[\myText]
[\myText]
\setupheadertexts[margin]
[\myMarginText]
[\myMarginText]
\starttext
test
\stoptext
What's the way to get the same result without using \framed
and without making the margin wider ?
Uncommenting what's commented in the code above centers
everything ok, but the margin text doesn't fit.
Thanks.
--
Best,
Alan
* TeX engine = LuaTeX
* ConTeXt minimals ver: 2009.01.18 14:39 MKIV fmt: 2009.1.22 int:
english/english
* Ubuntu 8.04 Hardy Heron, Windows XP SP3 Home
[-- Attachment #1.2: Type: text/html, Size: 2256 bytes --]
[-- Attachment #2: Type: text/plain, Size: 487 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://tex.aanhet.net
archive : https://foundry.supelec.fr/projects/contextrev/
wiki : http://contextgarden.net
___________________________________________________________________________________
^ permalink raw reply [flat|nested] 4+ messages in thread
* Re: centering & fit question
2009-02-13 15:03 centering & fit question Alan Stone
@ 2009-02-13 19:21 ` Wolfgang Schuster
2009-02-13 20:16 ` Alan Stone
0 siblings, 1 reply; 4+ messages in thread
From: Wolfgang Schuster @ 2009-02-13 19:21 UTC (permalink / raw)
To: mailing list for ConTeXt users
Am 13.02.2009 um 16:03 schrieb Alan Stone:
> Hello,
>
> In the underneath example, the only way I found to have everything
> horizontally and vertically centered in the text and margin header,
> as well as fit into the margin header, is as follows:
[..]
> What's the way to get the same result without using \framed
> and without making the margin wider ?
>
> Uncommenting what's commented in the code above centers
> everything ok, but the margin text doesn't fit.
You text is too long and you need a vertical box to break
the along lines.
\setuplayout[margin=3cm]
%\showframe
\def\myText
{\hfill some text \hfill}
\def\myMarginText
{\hbox{$\vcenter{\vbox{\raggedcenter this is some margin text}}$}}
\def\myMarginText
{\framed
[location=middle,
align=middle,
width=\hsize,
frame=off]
{this is some margin text}}
\setuppagenumbering[location=footer]
\setupheader
[before=\vss,
after=\vss]
\setupheadertexts
[text]
[\myText]
[\myText]
\setupheadertexts
[margin]
[\myMarginText]
[\myMarginText]
\starttext
test
\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 : https://foundry.supelec.fr/projects/contextrev/
wiki : http://contextgarden.net
___________________________________________________________________________________
^ permalink raw reply [flat|nested] 4+ messages in thread
* Re: centering & fit question
2009-02-13 19:21 ` Wolfgang Schuster
@ 2009-02-13 20:16 ` Alan Stone
2009-02-13 20:43 ` Wolfgang Schuster
0 siblings, 1 reply; 4+ messages in thread
From: Alan Stone @ 2009-02-13 20:16 UTC (permalink / raw)
To: mailing list for ConTeXt users
[-- Attachment #1.1: Type: text/plain, Size: 1545 bytes --]
On Fri, Feb 13, 2009 at 8:21 PM, Wolfgang Schuster <
schuster.wolfgang@googlemail.com> wrote:
>
> Am 13.02.2009 um 16:03 schrieb Alan Stone:
>
> Hello,
>>
>> In the underneath example, the only way I found to have everything
>> horizontally and vertically centered in the text and margin header,
>> as well as fit into the margin header, is as follows:
>>
>
> [..]
>
> What's the way to get the same result without using \framed
>> and without making the margin wider ?
>>
>> Uncommenting what's commented in the code above centers
>> everything ok, but the margin text doesn't fit.
>>
>
>
> You text is too long and you need a vertical box to break
> the along lines.
>
> \setuplayout[margin=3cm]
>
> %\showframe
>
> \def\myText
> {\hfill some text \hfill}
>
> \def\myMarginText
> {\hbox{$\vcenter{\vbox{\raggedcenter this is some margin text}}$}}
>
> \def\myMarginText
> {\framed
> [location=middle,
> align=middle,
> width=\hsize,
> frame=off]
> {this is some margin text}}
Thanks Wolfgang. I don't understanf the use of location=middle though...
\starttext
\framed[%
location=middle,
align=middle,
height=5cm,
width=\hsize,
frame=on]
{some text}
\framed[%
align=middle,
height=5cm,
width=\hsize,
frame=on]
{some text}
\stoptext
> \setuppagenumbering[location=footer]
>
> \setupheader
> [before=\vss,
> after=\vss]
>
> \setupheadertexts
> [text]
> [\myText]
> [\myText]
>
> \setupheadertexts
> [margin]
> [\myMarginText]
> [\myMarginText]
>
> \starttext
> test
> \stoptext
>
> Wolfgang
[-- Attachment #1.2: Type: text/html, Size: 2765 bytes --]
[-- Attachment #2: Type: text/plain, Size: 487 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://tex.aanhet.net
archive : https://foundry.supelec.fr/projects/contextrev/
wiki : http://contextgarden.net
___________________________________________________________________________________
^ permalink raw reply [flat|nested] 4+ messages in thread
* Re: centering & fit question
2009-02-13 20:16 ` Alan Stone
@ 2009-02-13 20:43 ` Wolfgang Schuster
0 siblings, 0 replies; 4+ messages in thread
From: Wolfgang Schuster @ 2009-02-13 20:43 UTC (permalink / raw)
To: mailing list for ConTeXt users
Am 13.02.2009 um 21:16 schrieb Alan Stone:
> Thanks Wolfgang. I don't understanf the use of location=middle
> though...
>
> \starttext
>
> \framed[%
> location=middle,
> align=middle,
> height=5cm,
> width=\hsize,
> frame=on]
> {some text}
>
> \framed[%
> align=middle,
> height=5cm,
> width=\hsize,
> frame=on]
> {some text}
>
> \stoptext
You need text before/after the box to see the effect of location.
\def\showbox#1%
{\ruledvbox{#1: text \framed[location=#1,width=1cm,align=right]
{text text text} text}}
\starttext
\showbox{normal}
\showbox{middle}
\showbox{top}
\showbox{bottom}
\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 : https://foundry.supelec.fr/projects/contextrev/
wiki : http://contextgarden.net
___________________________________________________________________________________
^ permalink raw reply [flat|nested] 4+ messages in thread
end of thread, other threads:[~2009-02-13 20:43 UTC | newest]
Thread overview: 4+ messages (download: mbox.gz / follow: Atom feed)
-- links below jump to the message on this page --
2009-02-13 15:03 centering & fit question Alan Stone
2009-02-13 19:21 ` Wolfgang Schuster
2009-02-13 20:16 ` Alan Stone
2009-02-13 20:43 ` Wolfgang Schuster
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).