Changes

Jump to navigation Jump to search
89 bytes added ,  16:48, 8 June 2020
m
no edit summary
ConTeXt implements extensions from eTeX including the evaluation of expressions
(quoted from the [[http://www.ntg.nl/maps/20/38.pdf| eTeX manual]]):
== Expressions ==
as first value after the <code>\dimexpr</code> command and then the numeric values.
Notice that the following expression is also valid:
<texcode>
\placesidebyside {\externalfigure[cow][width=.4\textwidth]}
{\framed[width=.4\textwidth,height=\dimexpr.4\textwidth*200/275\relax]
{\vbox{this is a box}}}
</texcode>
<contextsource="yes">
\setupexternalfigures[location={local,default}]
\placesidebyside{\externalfigure[cow][width=.4\textwidth]}
\fi
</context>
 
The important point to keep in mind is that TeX performs '''integer''' arithmetic in units of scaled points.
Therefore, one must be careful, especially when using divisions that may lead to integer rounding.
== LuaTeX ==
\ifdim\dimexpr100\dimen0/\dimen2\relax<\dimexpr100\dimen4/\dimen6\relax
The second fraction is now greater.
\else
The first fraction is still greater.
\fi
</context>
''The output is now correct in both cases without making use of any tricks.''
 
[[Category:Programming and Databases]]
[[Category:Tools]]

Navigation menu