[NTG-context] How to center a MP graphics generated by Lua?

Wolfgang Schuster schuster.wolfgang at googlemail.com
Thu Oct 14 10:00:29 CEST 2010


Am 14.10.2010 um 09:49 schrieb Procházka Lukáš Ing. - Pontex s. r. o.:

> Hello,
> 
> I'm trying to center a MP graphics generated by Lua.
> 
> Although the inline Ctx code is (or seems to be) the same as generated by Lua, I cannot understand why the red line is drawn on the left and not centered.
> 
> So how to make the Lua->MP graphics centered?
> 
>  \startalignment[center]

\dontleavehmode

>    \startluacode
>      context.startMPcode()
>      context("draw (0,0)--(1in,0) withrgbcolor (1,0,0)") % Red line LEFT?
>      context.stopMPcode()
>    \stopluacode
>  \stopalignment

Wolfgang



More information about the ntg-context mailing list