Re: [NTG-context] vertical position of framed sucks!

2008-08-29 Thread Hans Hagen
Steffen Wolfrum wrote:
 Hi,
 
 in order to write a command=... for \setuphead I am fighting with the 
 following \framed:
 
 
 \starttext
 \showframe
 
 \def\TestFrame%
 {\hbox to \hsize\bgroup%
 \tbox{\midaligned\framed[frame=on,align=middle,width=0.85\textwidth]{{\kern0.75em}Test}}%
  
 
 \egroup}
 
 \TestFrame
 
 %Test% -
 
 \stoptext
 
 
 
 I only want the framed Test to be at the same vertical position as the 
 plain Test (please compare).
 
 Just how???

i'm not sure what you mean but

\starttext

\def\TestFrame
   {\dontleavehmode
\inframed[align=middle,width=0.85\textwidth]{{\kern0.75em}Test}}%

\TestFrame Test

\stoptext

puts them along side

when making head commands, it often helps to put #1 as well as #2 in a 
framed and then box the whole

a framed ends up as just a vbox with no depth (unless set)


-
   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
-
___
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
___


Re: [NTG-context] vertical position of framed sucks!

2008-08-29 Thread Peter Rolf
Steffen Wolfrum schrieb:
 Hi,
 
 in order to write a command=... for \setuphead I am fighting with the  
 following \framed:
 
 
 \starttext
 \showframe
 
 \def\TestFrame%
 {\hbox to \hsize\bgroup%
 \tbox{\midaligned\framed[frame=on,align=middle,width=0.85\textwidth] 
 {{\kern0.75em}Test}}%
 \egroup}
 
 \TestFrame
 
 %Test% -
 
 \stoptext
 
 
 
 I only want the framed Test to be at the same vertical position as  
 the plain Test (please compare).
 
 Just how???
 

\def\TestFrame%
  {\hbox to \hsize\bgroup
   \midaligned\framed[frame=on,align=middle,width=0.85\textwidth]
   {{\kern0.75em}Test}\egroup}

but i'm also unsure what you exactly want to achieve ;)

best wishes, peter


 
 Thanks,
 
 Steffen
 ___
 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
 ___
 

___
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
___


Re: [NTG-context] vertical position of framed sucks!

2008-08-29 Thread Steffen Wolfrum
Hi,

sorry for my foggy post last night (02:50h ...)

Hopefully this example makes it clearer:
--

\starttext
\showframe

\definehead[EbeneFuenf] [subsubsubsection]
\setupsection[section-6][conversion=characters,previousnumber=yes]
\def\FuenfCommand#1{#1.}

\def\CurrentEbeneFuenfNumber#1#2%
{\hbox to \hsize\bgroup%
\tbox{\midaligned 
\framed[offset=-0.5pt,frame=on,align=middle,width=0.85\textwidth] 
{{\FuenfCommand{\convertnumber{characters} 
{\countervalue{@@sesection-6{\kern0.75em}#2}}%
\egroup}

\setuphead[EbeneFuenf][command=\CurrentEbeneFuenfNumber]% using this  
command moves the line 2mm down?!

\EbeneFuenf{Test}

\stoptext

--
I wanted to define a command with a fixed width in order to determine  
a maximum width for a section.
But using this command (i.e. the framed) also moves the section down  
about 2mm!

How can this be avoided?

Steffen
___
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
___


Re: [NTG-context] vertical position of framed sucks!

2008-08-29 Thread Peter Rolf
Steffen Wolfrum schrieb:
 Hi,
 
 sorry for my foggy post last night (02:50h ...)
 
 Hopefully this example makes it clearer:
 -- 
 
 \starttext
 \showframe
 
 \definehead[EbeneFuenf][subsubsubsection]
 \setupsection[section-6][conversion=characters,previousnumber=yes]
 \def\FuenfCommand#1{#1.}
 
 \def\CurrentEbeneFuenfNumber#1#2%
 {\hbox to \hsize\bgroup%
 \tbox{\midaligned\framed[offset=-0.5pt,frame=on,align=middle,width=0.85\textwidth]{{\FuenfCommand{\convertnumber{characters}{\countervalue{@@sesection-6{\kern0.75em}#2}}%
 
 \egroup}
 
 \setuphead[EbeneFuenf][command=\CurrentEbeneFuenfNumber]% using this
 command moves the line 2mm down?!


% insert here
\showboxes % see differences between \tbox and \hbox

 \EbeneFuenf{Test}
 
 \stoptext
 
 -- 
 I wanted to define a command with a fixed width in order to determine a
 maximum width for a section.
 But using this command (i.e. the framed) also moves the section down
 about 2mm!
 
 How can this be avoided?


have you tried my solution?

same answer :)

the \tbox does exactly what it should do (see p.85, context manual).
use a \hbox instead and the text is (nearly, exactly?) on the same
vertical position as plain text. but this highly depends on the offset
of \framed.

btw: you need the outer \hbox for the right total width and the inner
\framed for the frame and alignment. why the \tbox or any additional box?

best wishes, peter

 Steffen
 

___
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
___


Re: [NTG-context] vertical position of framed sucks!

2008-08-29 Thread Steffen Wolfrum

Am 29.08.2008 um 11:18 schrieb Peter Rolf:

 Steffen Wolfrum schrieb:
 Hi,

 sorry for my foggy post last night (02:50h ...)

 Hopefully this example makes it clearer:
 --  

 \starttext
 \showframe

 \definehead[EbeneFuenf][subsubsubsection]
 \setupsection[section-6][conversion=characters,previousnumber=yes]
 \def\FuenfCommand#1{#1.}

 \def\CurrentEbeneFuenfNumber#1#2%
 {\hbox to \hsize\bgroup%
 \tbox{\midaligned 
 \framed[offset=-0.5pt,frame=on,align=middle,width=0.85\textwidth] 
 {{\FuenfCommand{\convertnumber{characters} 
 {\countervalue{@@sesection-6{\kern0.75em}#2}}%

 \egroup}

 \setuphead[EbeneFuenf][command=\CurrentEbeneFuenfNumber]% using this
 command moves the line 2mm down?!


 % insert here
 \showboxes % see differences between \tbox and \hbox

 \EbeneFuenf{Test}

 \stoptext

 -- 
 I wanted to define a command with a fixed width in order to  
 determine a
 maximum width for a section.
 But using this command (i.e. the framed) also moves the section  
 down
 about 2mm!

 How can this be avoided?


 have you tried my solution?


yes, thank you, it just didn't work as expected: there still was a  
small vertical skip.

this (provided by Wolfgang) is what i wanted to achieve:

\def\CurrentEbeneFuenfNumber#1#2%
  {\midaligned{\inframed[width=.85\textwidth,align=middle] 
{#1\kern0.75em#2}}}

thanks again for your efforts,

steffen



___
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
___


[NTG-context] vertical position of framed sucks!

2008-08-28 Thread Steffen Wolfrum
Hi,

in order to write a command=... for \setuphead I am fighting with the  
following \framed:


\starttext
\showframe

\def\TestFrame%
{\hbox to \hsize\bgroup%
\tbox{\midaligned\framed[frame=on,align=middle,width=0.85\textwidth] 
{{\kern0.75em}Test}}%
\egroup}

\TestFrame

%Test% -

\stoptext



I only want the framed Test to be at the same vertical position as  
the plain Test (please compare).

Just how???


Thanks,

Steffen
___
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
___