vertically centered aligment of different sized texts
hi there, another question to which shamefully i cannot find the answer. perhaps it's just too late... consider the following example: \definefont[BigFont][Regular sa 3] \starttext {\tfc The {\BigFont 7}\high{th} Seal} \stoptext how can i make that line vertically centered, like --, the /th seal / :) is \startalignment used for this? -f -- every great journey begins with a single step.
On Wed, 17 May 2006, frantisek holop wrote:
hi there,
another question to which shamefully i cannot find the answer. perhaps it's just too late...
consider the following example:
\definefont[BigFont][Regular sa 3] \starttext {\tfc The {\BigFont 7}\high{th} Seal} \stoptext
how can i make that line vertically centered, like --, the /th seal /
:)
I do not know if this is the best way to do this, but you can exploit inframed. {\tfc The \inframed[foregroundstyle=\BigFont,frame=off]{ 7}\high{th} Seal} or {\tfc The \inframed[foregroundstyle=\BigFont,frame=off]{ 7\high{th}} Seal} depending on what you want.
is \startalignment used for this?
I think that startalignment is only for horizontal alignment, but I may be wrong here. Aditya -- Aditya Mahajan, EECS Systems, University of Michigan http://www.eecs.umich.edu/~adityam || Ph: 7342624008
Hi, Vertical positioning requires a \strut as an anchor. Hereafter you might use \vfill .... \vfill \starttext \strut \vfill Your Text \vfill \stoptext Willi Aditya Mahajan wrote:
On Wed, 17 May 2006, frantisek holop wrote:
hi there,
another question to which shamefully i cannot find the answer. perhaps it's just too late...
consider the following example:
\definefont[BigFont][Regular sa 3] \starttext {\tfc The {\BigFont 7}\high{th} Seal} \stoptext
how can i make that line vertically centered, like --, the /th seal /
:)
I do not know if this is the best way to do this, but you can exploit inframed.
{\tfc The \inframed[foregroundstyle=\BigFont,frame=off]{ 7}\high{th} Seal} or {\tfc The \inframed[foregroundstyle=\BigFont,frame=off]{ 7\high{th}} Seal}
depending on what you want.
is \startalignment used for this?
I think that startalignment is only for horizontal alignment, but I may be wrong here.
Aditya
hmm, on Wed, May 17, 2006 at 06:53:47PM +0200, Taco Hoekwater said that
Abusing math mode is easiest:
\def\vcentered#1% {\dontleavehmode\mathematics{\vcenter{\hbox{#1}}}} \starttext {\tfc The \vcentered{{\BigFont 7}\high{th}} Seal} \stoptext
thanks a lot. but if this is the "easiest" then what is the hardest? :) i certainly envy the html/css people here. some things are just much more easier. of course, don't get me wrong, with less powerful constructs come the limitations. -f -- will global warming cancel nuclear winter?
frantisek holop wrote:
hmm, on Wed, May 17, 2006 at 06:53:47PM +0200, Taco Hoekwater said that
Abusing math mode is easiest:
\def\vcentered#1% {\dontleavehmode\mathematics{\vcenter{\hbox{#1}}}} \starttext {\tfc The \vcentered{{\BigFont 7}\high{th}} Seal} \stoptext
thanks a lot. but if this is the "easiest" then what is the hardest? :)
The mathematical center of the line is not necesarily the optical center, so a somewhat more correct approach would put all the stuff in an \hbox and then compute manually how far it has to drop down. For a more pleasing look, it would perhaps be even better to line up a normal '7' as if it was an oldstyle numeral, and then enlarging it while keeping the same vertical alignment ratio. Cheers, Taco
hmm, on Thu, May 18, 2006 at 08:48:23AM +0200, Taco Hoekwater said that
The mathematical center of the line is not necesarily the optical center, so a somewhat more correct approach would put all the stuff in an \hbox and then compute manually how far it has to drop down.
i haven't used latex for quite some time now, so i can't recall how problematic it was to accomplish something like this, but i find it interesting that there is no easy approach to this.
For a more pleasing look, it would perhaps be even better to line up a normal '7' as if it was an oldstyle numeral, and then enlarging it while keeping the same vertical alignment ratio.
i've tried the old style numeral but i didn't like it. by "keeping the same vertical alignment ratio" do you mean something like \raise? -f -- i thank my lucky stars i'm not superstitious.
frantisek holop wrote:
hmm, on Thu, May 18, 2006 at 08:48:23AM +0200, Taco Hoekwater said that
The mathematical center of the line is not necesarily the optical center, so a somewhat more correct approach would put all the stuff in an \hbox and then compute manually how far it has to drop down.
i haven't used latex for quite some time now, so i can't recall how problematic it was to accomplish something like this, but i find it interesting that there is no easy approach to this.
there probably is, so can you describe your problem in more detail? Hans ----------------------------------------------------------------- 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 -----------------------------------------------------------------
hmm, on Thu, May 18, 2006 at 11:57:47AM +0200, Hans Hagen said that
i haven't used latex for quite some time now, so i can't recall how problematic it was to accomplish something like this, but i find it interesting that there is no easy approach to this.
there probably is, so can you describe your problem in more detail? Hans
when i tried to explain it, i found out that i lack a lot of printing jargon :) so here's just a link for a pdf which uses Taco's mathmode vcentered macro. http://obiit.org/minusf/tex/7th-seal.pdf http://obiit.org/minusf/tex/7th-seal.tex basically it's just having different sized fonts aligned based on the bigest one, vertically centered -f -- when all think alike, then no one is thinking.
frantisek holop wrote:
hmm, on Thu, May 18, 2006 at 11:57:47AM +0200, Hans Hagen said that
i haven't used latex for quite some time now, so i can't recall how problematic it was to accomplish something like this, but i find it interesting that there is no easy approach to this.
there probably is, so can you describe your problem in more detail? Hans
when i tried to explain it, i found out that i lack a lot of printing jargon :)
so here's just a link for a pdf which uses Taco's mathmode vcentered macro.
http://obiit.org/minusf/tex/7th-seal.pdf http://obiit.org/minusf/tex/7th-seal.tex
basically it's just having different sized fonts aligned based on the bigest one, vertically centered
taco's solution is pretty clean and texie; (btw, in supp-box you can find many boxing macros, but it's hard to keep an overview of what is needed and provided since each situation differs) -- ----------------------------------------------------------------- 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 -----------------------------------------------------------------
frantisek holop wrote:
i've tried the old style numeral but i didn't like it. by "keeping the same vertical alignment ratio" do you mean something like \raise?
Take the 'normal' 7 in the 'normal' tf size, but place it as if it was an old-style numeral (using something like \lower2pt\hbox{7}). Measure the height of the result box. Now you have a box that is say 4.5pt above (and 2pt below the baseline). Create a new box with the 7 in the increased font size, and use \lower to make sure that 4.5/6 of it is above the baseline. You asked for 'complicated', right? Taco
hmm, on Wed, May 17, 2006 at 06:28:51PM +0200, Willi Egger said that
Hi,
Vertical positioning requires a \strut as an anchor. Hereafter you might use \vfill .... \vfill
\starttext \strut \vfill Your Text \vfill \stoptext
i think this is something else. this centers the line in some context, but not the contents of the line if the line contains fonts in different sizes. i used to use this construct even in latex, very good for title pages, but intead of \strut i just put a used a non breakable space: ~ -f -- 1 + 2 = 3; therefore, 4 + 5 = 6.
participants (5)
-
Aditya Mahajan
-
frantisek holop
-
Hans Hagen
-
Taco Hoekwater
-
Willi Egger