ntg-context - mailing list for ConTeXt users
 help / color / mirror / Atom feed
From: Idris Samawi Hamid <ishamid@lamar.colostate.edu>
Subject: RE: centering framed boxes
Date: Tue, 17 May 2005 07:39:46 -0600	[thread overview]
Message-ID: <42EA3F08@webmail.colostate.edu> (raw)

>===== Original Message From Hans Hagen <pragma@wxs.nl> =====
>\starttext
>
>\definelayer[test][width=12\bodyfontsize,height=12\bodyfontsize]
>
>\setlayerframed[test][preset=middle][width=12\bodyfontsize,height=12\bodyfont
size]{one}
>\setlayerframed[test][preset=middle][width= 9\bodyfontsize,height=
>9\bodyfontsize]{two}
>\setlayerframed[test][preset=middle][width= 6\bodyfontsize,height=
>6\bodyfontsize]{three}
>\setlayerframed[test][preset=middle][width= 3\bodyfontsize,height=
>3\bodyfontsize]{four}
>
>\tightlayer[test]
>
>\stoptext

Hi Hans,

I tried your code (so beautiful and simple!): it properly stacks the frames 
but places the text for each level, not midway between frames as desired, but 
in the middle frame (on top of one another).

Anyway, the following file illustrates the exact effect I'm trying to acheive 
(note the final overlay of some text across all four levels). I certainly 
would prefer to do this the ConTeXt way (e.g. is there a better way to stretch 
the word `testing'?)!

Thanks as always for your guidance and help.

Best
Idris
============================================
\setupoutput[pdftex]%

\setuppagenumbering[state=stop]
\starttext\showstruts

\startbuffer[Test]
\setupfloats[location=middle]
\placefigure
[here][fig:Test]{4 levels.}
{\startbuffer[test]\vbox{
 \midaligned{\it
 \framed
 [width=12\baselineskip,height=12\baselineskip,strut=yes]
 {\midaligned{\raise.25ex\hbox{level 1}}
   $\vcenter%
   {\framed[width=9\baselineskip,height=9\baselineskip,strut=yes]
     {\midaligned{\raise.25ex\hbox{level 2}}
       $\vcenter%
       {\framed[width=6\baselineskip,height=6\baselineskip,strut=yes]
         {\midaligned{\raise.25ex\hbox{level 3}}
           $\vcenter%
           {\framed[width=3\baselineskip,height=3\baselineskip,strut=yes]
            {\midaligned{\raise3.6ex\hbox{level 4}}}
           }$
         \midaligned{\null}}%
       }$
     \midaligned{\null}}%
   }$
 \midaligned{\null}}
 }
}
\stopbuffer

\startbuffer[testing]\vbox{\midaligned{\kern-6\baselineskip\itb
                           \lower1.4ex\hbox{t\,e\,s\,t\,i\,n\,g}}}
\stopbuffer
\hbox{$\vcenter{\getbuffer[test]}\llap{$\vcenter{\getbuffer[testing]}$}$}
}
\stopbuffer

\getbuffer[Test]

\stoptext
===============================================

============================
Professor Idris Samawi Hamid
Department of Philosophy
Colorado State University
Fort Collins, CO 80523

             reply	other threads:[~2005-05-17 13:39 UTC|newest]

Thread overview: 5+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2005-05-17 13:39 Idris Samawi Hamid [this message]
  -- strict thread matches above, loose matches on Subject: below --
2005-05-15 12:02 Idris Samawi Hamid
2005-05-15  2:39 Idris Samawi Hamid
2005-05-17  7:23 ` Hans Hagen
2005-05-17  7:30 ` Hans Hagen

Reply instructions:

You may reply publicly to this message via plain-text email
using any one of the following methods:

* Save the following mbox file, import it into your mail client,
  and reply-to-all from there: mbox

  Avoid top-posting and favor interleaved quoting:
  https://en.wikipedia.org/wiki/Posting_style#Interleaved_style

* Reply using the --to, --cc, and --in-reply-to
  switches of git-send-email(1):

  git send-email \
    --in-reply-to=42EA3F08@webmail.colostate.edu \
    --to=ishamid@lamar.colostate.edu \
    --cc=ntg-context@ntg.nl \
    /path/to/YOUR_REPLY

  https://kernel.org/pub/software/scm/git/docs/git-send-email.html

* If your mail client supports setting the In-Reply-To header
  via mailto: links, try the mailto: link
Be sure your reply has a Subject: header at the top and a blank line before the message body.
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).