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: Sun, 15 May 2005 06:02:26 -0600	[thread overview]
Message-ID: <42DFD4AE@webmail.colostate.edu> (raw)

I forgot about $\vcenter$ (I hardly ever need math mode, so...)

The following works for the framed boxes, and the text is well positioned 
also, but is there a better/more efficient way to center the text between 
frames?

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

\setuppagenumbering[state=stop]
\starttext\showstruts

\setupfloats[location=middle]
\placefigure
[here][tab:enclosure]{4 Stages.}
{
 \midaligned{
 \framed
 [width=12\baselineskip,height=12\baselineskip,strut=yes]
 {\midaligned{\raise.25ex\hbox{Stage 1}}
   $\vcenter%
   {\framed[width=9\baselineskip,height=9\baselineskip,strut=yes]
     {\midaligned{\raise.25ex\hbox{Stage 2}}
       $\vcenter%
       {\framed[width=6\baselineskip,height=6\baselineskip,strut=yes]
         {\midaligned{\raise.25ex\hbox{Stage 3}}
           $\vcenter%
           {\framed[width=3\baselineskip,height=3\baselineskip,strut=yes]
            {\midaligned{\raise.25ex\hbox{Stage 4}}}
           }$
         \midaligned{\null}}%
       }$
     \midaligned{\null}}%
   }$
 \midaligned{\null}}
 }
}

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

===============original message=============
Dear gang,

I need a way to overlay four framed boxes so that each inner box is exactly in
the center of its respective outer box. So far I have the following, but
careful inspection will show that the boxes are not precisely centered with
respect to each other. I could go on by trial and error but I'm sure there is
a direct way to do this.

The text should also be precisely centered between frames.

Thank you in advance!
Idris

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

             reply	other threads:[~2005-05-15 12:02 UTC|newest]

Thread overview: 5+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2005-05-15 12:02 Idris Samawi Hamid [this message]
  -- strict thread matches above, loose matches on Subject: below --
2005-05-17 13:39 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=42DFD4AE@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).