ntg-context - mailing list for ConTeXt users
 help / color / mirror / Atom feed
* vertical position of framed sucks!
@ 2008-08-29  0:46 Steffen Wolfrum
  2008-08-29  7:40 ` Hans Hagen
  2008-08-29  8:02 ` Peter Rolf
  0 siblings, 2 replies; 6+ messages in thread
From: Steffen Wolfrum @ 2008-08-29  0:46 UTC (permalink / raw)
  To: mailing list for ConTeXt users

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
___________________________________________________________________________________


^ permalink raw reply	[flat|nested] 6+ messages in thread

* Re: vertical position of framed sucks!
  2008-08-29  0:46 vertical position of framed sucks! Steffen Wolfrum
@ 2008-08-29  7:40 ` Hans Hagen
  2008-08-29  8:02 ` Peter Rolf
  1 sibling, 0 replies; 6+ messages in thread
From: Hans Hagen @ 2008-08-29  7:40 UTC (permalink / raw)
  To: Steffen Wolfrum; +Cc: mailing list for ConTeXt users

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
___________________________________________________________________________________


^ permalink raw reply	[flat|nested] 6+ messages in thread

* Re: vertical position of framed sucks!
  2008-08-29  0:46 vertical position of framed sucks! Steffen Wolfrum
  2008-08-29  7:40 ` Hans Hagen
@ 2008-08-29  8:02 ` Peter Rolf
  2008-08-29  8:36   ` Steffen Wolfrum
  1 sibling, 1 reply; 6+ messages in thread
From: Peter Rolf @ 2008-08-29  8:02 UTC (permalink / raw)
  To: mailing list for ConTeXt users

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
___________________________________________________________________________________


^ permalink raw reply	[flat|nested] 6+ messages in thread

* Re: vertical position of framed sucks!
  2008-08-29  8:02 ` Peter Rolf
@ 2008-08-29  8:36   ` Steffen Wolfrum
  2008-08-29  9:18     ` Peter Rolf
  0 siblings, 1 reply; 6+ messages in thread
From: Steffen Wolfrum @ 2008-08-29  8:36 UTC (permalink / raw)
  To: mailing list for ConTeXt users; +Cc: Hans Hagen

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
___________________________________________________________________________________


^ permalink raw reply	[flat|nested] 6+ messages in thread

* Re: vertical position of framed sucks!
  2008-08-29  8:36   ` Steffen Wolfrum
@ 2008-08-29  9:18     ` Peter Rolf
  2008-08-29  9:33       ` Steffen Wolfrum
  0 siblings, 1 reply; 6+ messages in thread
From: Peter Rolf @ 2008-08-29  9:18 UTC (permalink / raw)
  To: mailing list for ConTeXt users

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
___________________________________________________________________________________


^ permalink raw reply	[flat|nested] 6+ messages in thread

* Re: vertical position of framed sucks!
  2008-08-29  9:18     ` Peter Rolf
@ 2008-08-29  9:33       ` Steffen Wolfrum
  0 siblings, 0 replies; 6+ messages in thread
From: Steffen Wolfrum @ 2008-08-29  9:33 UTC (permalink / raw)
  To: mailing list for ConTeXt users


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
___________________________________________________________________________________


^ permalink raw reply	[flat|nested] 6+ messages in thread

end of thread, other threads:[~2008-08-29  9:33 UTC | newest]

Thread overview: 6+ messages (download: mbox.gz / follow: Atom feed)
-- links below jump to the message on this page --
2008-08-29  0:46 vertical position of framed sucks! Steffen Wolfrum
2008-08-29  7:40 ` Hans Hagen
2008-08-29  8:02 ` Peter Rolf
2008-08-29  8:36   ` Steffen Wolfrum
2008-08-29  9:18     ` Peter Rolf
2008-08-29  9:33       ` Steffen Wolfrum

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).