ntg-context - mailing list for ConTeXt users
 help / color / mirror / Atom feed
* Re: calculating with dimension unit
@ 2013-04-22 11:31 Jan Heinen
  2013-04-22 13:58 ` Aditya Mahajan
  2013-04-22 14:51 ` luigi scarso
  0 siblings, 2 replies; 13+ messages in thread
From: Jan Heinen @ 2013-04-22 11:31 UTC (permalink / raw)
  To: ntg-context

Hello,

thanks for the helpfull tipps. Only one wasn't working:

\defineexpandable\ColumnABii   {\ctxlua{context([==[\ColumnA 
+ \ColumnB]==])}}

ColumnABii: \ColumnABii

The result is:       ColumnABii: 30mm+ 40mm
And it should be ColumnABii: 70mm

And in the other cases I get back:  199.16928pt instead of 
70mm but this seems to be the same.

I think this calculating with dimension is not very well 
documented in the context-wiki.
Thus I would like to write a small article about 
"Calculating with dimension units" in the 
wiki.contextgarden.net to help others a bit.
Or is there already an article somewhere?

Regards
Jannis


___________________________________________________________________________________
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
___________________________________________________________________________________


^ permalink raw reply	[flat|nested] 13+ messages in thread
* Re: calculating with dimension unit
@ 2013-04-23 18:18 Jan Heinen
  0 siblings, 0 replies; 13+ messages in thread
From: Jan Heinen @ 2013-04-23 18:18 UTC (permalink / raw)
  To: ntg-context

Ok, I now put the \ctxlua into an other chapter:

http://wiki.contextgarden.net/Calculating_with_dimension_units

Can you say something to the missing points there? "Wich 
meethod?", "\the" and "Expanding

If you don't know how to edit the context-wiki, please write 
your information here in the mailinglist - then I will put 
it into the wiki.

Regards
Jannis
___________________________________________________________________________________
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
___________________________________________________________________________________


^ permalink raw reply	[flat|nested] 13+ messages in thread
* Re: calculating with dimension unit
@ 2013-04-22 21:28 Jan Heinen
  2013-04-22 21:34 ` Wolfgang Schuster
  0 siblings, 1 reply; 13+ messages in thread
From: Jan Heinen @ 2013-04-22 21:28 UTC (permalink / raw)
  To: ntg-context

Thank you all!!!!!!

My book from last year (15.000 lines text + context-code and 
1.500 lines macro-code  now was compiled without no further 
problems!

I only had to change all
\define\variable ...

to
\defineexpandable\variable ...


I think, now I understand a little bit more about ConTeXt 
and try again to give a little bit back to the community.
I have started a new article on the context-wiki:

http://wiki.contextgarden.net/Calculating_with_dimension_units

Hopefully the more sophisticated ConTeXter help a little bit 
to improve the article. Please have a look what is wrong and 
what I have forgotten (or don't know).

Regards
Janis
___________________________________________________________________________________
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
___________________________________________________________________________________


^ permalink raw reply	[flat|nested] 13+ messages in thread
* calculating with dimension unit
@ 2013-04-21 23:13 Jan Heinen
  2013-04-21 23:59 ` luigi scarso
                   ` (2 more replies)
  0 siblings, 3 replies; 13+ messages in thread
From: Jan Heinen @ 2013-04-21 23:13 UTC (permalink / raw)
  To: ntg-context

In a book I produced with ConTeXt last year, I did a lot of 
calculation to be able to change the layout dynamicaly.

With the actual version of ConTeXt I can't compile the book. 
I have tried a lot of things today ... without success.
I hope my minimal-example helps you to understand, what I 
want to do - and what I am doing wrong:


\starttext
\setupexternalfigures[location={local,global,default}]

\defineexpandable\ColumnA    {30mm}
\defineexpandable\ColumnB    {40mm}
\defineexpandable\ColumnABi    {\dimexpr(\ColumnA + \ColumnB)}
\defineexpandable\ColumnABii   {\ctxlua{context(\ColumnA + 
\ColumnB)}}
\newdimen\ColumnABiii \ColumnABiii = \dimexpr(\ColumnA + 
\ColumnB)

A  \ColumnA% ok

B  \ColumnB% ok

% I sadly get only errors when I delete the comments:
%ColumnABi: \ColumnABi

%ColumnABii: \ColumnABii

%ColumnABiii: \ColumnABiii

%\externalfigure[cow][width=\ColumnABiii]

~
\page
\stoptext



___________________________________________________________________________________
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
___________________________________________________________________________________


^ permalink raw reply	[flat|nested] 13+ messages in thread

end of thread, other threads:[~2013-04-23 18:18 UTC | newest]

Thread overview: 13+ messages (download: mbox.gz / follow: Atom feed)
-- links below jump to the message on this page --
2013-04-22 11:31 calculating with dimension unit Jan Heinen
2013-04-22 13:58 ` Aditya Mahajan
2013-04-22 14:51 ` luigi scarso
  -- strict thread matches above, loose matches on Subject: below --
2013-04-23 18:18 Jan Heinen
2013-04-22 21:28 Jan Heinen
2013-04-22 21:34 ` Wolfgang Schuster
2013-04-21 23:13 Jan Heinen
2013-04-21 23:59 ` luigi scarso
2013-04-22  6:48 ` Wolfgang Schuster
2013-04-22  8:14   ` Hans Hagen
2013-04-22 10:43     ` Wolfgang Schuster
2013-04-22 14:00       ` Aditya Mahajan
2013-04-22  8:23 ` Hans Hagen

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).