Changes

Jump to navigation Jump to search
709 bytes added ,  17:10, 28 October 2021
adding "Measures in Lua"
</context>
= Measures in Lua =
 
There is a way to take them in Lua:
 
<context source="yes">
\setupexternalfigures[location=default]
\setupbodyfont[sans, 20pt]
\starttext
\startTEXpage[offset=1em]
\startluacode
local f = figures.getinfo("cow.pdf")
context(f.used.width)
context.par()
context(f.used.height)
context.getfiguredimensions({ "cow.pdf" })
context.par()
context(context.noffigurepages)
context.par()
context(context.figurewidth)
context.par()
context(context.figureheight)
\stopluacode
\stopTEXpage
\stoptext
</context>
 
The <code>figures.getinfo</code> gives just numbers and it has less options. <code>context.getfiguredimensions</code> gives the same outputs than it TeX counterpart.
= Calculations in Lua =
139

edits

Navigation menu