On Sat, 21 Mar 2009, Wolfgang Schuster wrote:
Am 21.03.2009 um 23:26 schrieb Arthur Reutenauer:
Can I divide dimensions to get a number in pdftex?
LaTeX has a package to do exactly that, fp. You could look into its
code. Or you could use LuaTeX :-)
It's easy to do with etex but I would use lua if possible.
\starttext
\unprotect
\!!dimena=1cm
\!!dimenb=2cm
\!!dimenc=1cm
\!!dimend=3cm
\ifdim\dimexpr\!!dimena*100/\!!dimenb\relax>\dimexpr\!!dimenc*100/\!!dimend\relax
this
\else
that
\fi
Ah. I was using \dimexpr\!!dimena/\!!dimenb with crazy results. So the
trick is to mulitply by a number in between. Thanks Wolfgang.
Aditya
___________________________________________________________________________________
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
___________________________________________________________________________________