[NTG-context] Access ConTeXt dimensions in Lua

Hans Hagen pragma at wxs.nl
Sun Oct 9 15:49:48 CEST 2016


On 10/8/2016 10:41 PM, Henning Hraban Ramm wrote:
> Hi all,
>
> I’m trying to write some dimensions to a file, e.g.
>
> \startluacode
> io.savedata("settings.txt", context("\\textwidth"))
> \stopluacode
>
> But that context() construct is nil.
> There’s probably a simple solution... ;)

\starttext

\startluacode
     io.savedata("settings.txt", number.topoints(tex.dimen.textwidth))
\stopluacode

\typefile{settings.txt}

\stoptext


-----------------------------------------------------------------
                                           Hans Hagen | PRAGMA ADE
               Ridderstraat 27 | 8061 GH Hasselt | The Netherlands
        tel: 038 477 53 69 | www.pragma-ade.nl | www.pragma-pod.nl
-----------------------------------------------------------------


More information about the ntg-context mailing list