[NTG-context] ! LuaTeX error [string "\directlua "]:1: invalid escape sequence

Hans Hagen pragma at wxs.nl
Fri Apr 19 09:07:26 CEST 2013


On 4/19/2013 7:39 AM, Kip Warner wrote:
> Hey list,
>
> I am having problems typesetting the following minimal to try and
> extract the current revision number from my revision control system:
>
>          % Bzr revision...
>          \def\initializeBzr
>                  {\ctxlua{context("\\global\\edef\\BzrRevision{\%s}",
>                           os.resultof"bzr revno | tr -d '\\n'")}}
>          \initializeBzr
>
>          \starttex
>          foo
>          \stoptex
>
> The error I receive is:
>
>          ! LuaTeX error [string "\directlua "]:1: invalid escape sequence
>          near '\%'.
>          system          > tex > error on line 5 in file minimal.tex:
>          LuaTeX error  ...
>
> Line 5 is the \initializeBzr invocation. This was working with TeX Live
> 2012, but perhaps the correct usage has changed. I am now using ConTeXt
> 2013.04.11 19:55 with LuaTeX beta-0.76.0-2013041612  (TeX Live 2013)
> (rev 4627).

use [[ ]] for passing strings and \letterpercent , of do:

\ctxlua{context.setxvalue("BzrRevision",os.resultof("bzr revno | tr -d 
'\string\n'"))}



Hans


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


More information about the ntg-context mailing list