On 28-10-2011 10:35, Wolfgang Schuster wrote:

Am 28.10.2011 um 08:55 schrieb Thomas A. Schmitz:

Luigi, Patrick,

thanks for your explanations! The point of my question was: can I feed the content of 
tex.dimen["textwidth"] directly back to TeX, and the answer to this appears to be "no"; 
you need to add some unit to it (otherwise, you get an error message). Which was a bit confusing to me at 
first, because the name tex.dimen implies that it holds a "real" dimension, like \newdim does.


You can get the same value in TeX when you print the value of a dimension with 
\number:

\starttext

\scratchdimen=3pt

\number\scratchdimen

\ctxlua{context(tex.dimen["scratchdimen"])}

\stoptext

which also means that you can say \scratchcounter=\scratchdimen and test dimens as if they are numbers ... this is why we can have

\let\ifzeropt\ifcase

which probably no one ever noticed in the source.

Hans


-----------------------------------------------------------------
                                          Hans Hagen | PRAGMA ADE
              Ridderstraat 27 | 8061 GH Hasselt | The Netherlands
    tel: 038 477 53 69 | voip: 087 875 68 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  : http://foundry.supelec.fr/projects/contextrev/
wiki     : http://contextgarden.net
___________________________________________________________________________________

Reply via email to