Difference between revisions of "Dimensions"
Jump to navigation
Jump to search
Line 1: | Line 1: | ||
+ | ConTeXt allows different methods to initialize variables and to calculate with dimension units. | ||
=== \definemeasure === | === \definemeasure === | ||
Line 29: | Line 30: | ||
\externalfigure[cow][width=\ColumnAB] | \externalfigure[cow][width=\ColumnAB] | ||
+ | |||
+ | |||
+ | The behavior of \define has changed. At first the default was expanded, now it is unexpanded. If "unexpanded" is wished some extracommands are neccesary: | ||
+ | |||
+ | \defineexpandable\... | ||
+ | same as the lowlevel-TeX-Macro \def\... | ||
+ | |||
+ | \define\... | ||
+ | same as the low-level-textmacro \unexpanded\def\... | ||
=== \newdimen === | === \newdimen === | ||
Line 44: | Line 54: | ||
\externalfigure[cow][width=\the\ColumnAB] | \externalfigure[cow][width=\the\ColumnAB] | ||
− | \externalfigure | + | \externalfigure ist also working without "\the". |
=== \ctxlua === | === \ctxlua === | ||
Line 57: | Line 67: | ||
\externalfigure[cow][width=\dimexpr(\ColumnABii)\relax] | \externalfigure[cow][width=\dimexpr(\ColumnABii)\relax] | ||
− | |||
− | |||
− | |||
− | |||
− | |||
− | |||
− | |||
− | |||
− | |||
− | |||
− | |||
− | |||
− | |||
− | |||
− | |||
− | |||
− | |||
− | |||
− | |||
=== Offene Fragen === | === Offene Fragen === |
Revision as of 21:01, 22 April 2013
ConTeXt allows different methods to initialize variables and to calculate with dimension units.
\definemeasure
\setupexternalfigures[location={local,global,default}] \definemeasure[ColumnC][30mm] \definemeasure[ColumnD][40mm] \definemeasure[ColumnCD][\the\dimexpr(\measure{ColumnC}+\measure{ColumnD})\relax] C \measure{ColumnC} D \measure{ColumnD} CD \measure{ColumnCD} \externalfigure[cow][width=\measure{ColumnCD}]
\defineexpandable
\setupexternalfigures[location={local,global,default}] \defineexpandable\ColumnA {30mm} \defineexpandable\ColumnB {40mm} \defineexpandable\ColumnAB {\the\dimexpr(\ColumnA + \ColumnB)\relax} A \ColumnA B \ColumnB AB: \ColumnAB \externalfigure[cow][width=\ColumnAB]
The behavior of \define has changed. At first the default was expanded, now it is unexpanded. If "unexpanded" is wished some extracommands are neccesary:
\defineexpandable\... same as the lowlevel-TeX-Macro \def\...
\define\... same as the low-level-textmacro \unexpanded\def\...
\newdimen
\setupexternalfigures[location={local,global,default}] \defineexpandable\ColumnA {30mm} \defineexpandable\ColumnB {40mm} \newdimen\ColumnAB \ColumnAB=\dimexpr(\ColumnA + \ColumnB) A \ColumnA B \ColumnB ColumnAB: \the\ColumnAB \externalfigure[cow][width=\the\ColumnAB]
\externalfigure ist also working without "\the".
\ctxlua
\setupexternalfigures[location={local,global,default}] \defineexpandable\ColumnA {30mm} \defineexpandable\ColumnB {40mm} \defineexpandable\ColumnABii {\ctxlua{context([==[\ColumnA + \ColumnB]==])}} ColumnABii: \the\dimexpr \ColumnABii\relax \externalfigure[cow][width=\dimexpr(\ColumnABii)\relax]
Offene Fragen
\the expand \relax