From mboxrd@z Thu Jan 1 00:00:00 1970 X-Msuck: nntp://news.gmane.io/gmane.comp.tex.context/97439 Path: news.gmane.org!.POSTED!not-for-mail From: Antoine Cailliau Newsgroups: gmane.comp.tex.context Subject: Lua code and percent sign Date: Mon, 27 Feb 2017 14:11:14 +0100 Message-ID: Reply-To: mailing list for ConTeXt users NNTP-Posting-Host: blaine.gmane.org Mime-Version: 1.0 Content-Type: multipart/mixed; boundary="===============4716520441685555869==" X-Trace: blaine.gmane.org 1488201141 26970 195.159.176.226 (27 Feb 2017 13:12:21 GMT) X-Complaints-To: usenet@blaine.gmane.org NNTP-Posting-Date: Mon, 27 Feb 2017 13:12:21 +0000 (UTC) To: mailing list for ConTeXt users Original-X-From: ntg-context-bounces@ntg.nl Mon Feb 27 14:12:16 2017 Return-path: Envelope-to: gctc-ntg-context-518@m.gmane.org Original-Received: from zapf.boekplan.nl ([5.39.185.232] helo=zapf.ntg.nl) by blaine.gmane.org with esmtp (Exim 4.84_2) (envelope-from ) id 1ciL62-00069e-R3 for gctc-ntg-context-518@m.gmane.org; Mon, 27 Feb 2017 14:12:10 +0100 Original-Received: from localhost (localhost [127.0.0.1]) by zapf.ntg.nl (Postfix) with ESMTP id B268D80108; Mon, 27 Feb 2017 14:11:49 +0100 (CET) X-Virus-Scanned: Debian amavisd-new at zapf.boekplan.nl Original-Received: from zapf.ntg.nl ([127.0.0.1]) by localhost (zapf.ntg.nl [127.0.0.1]) (amavisd-new, port 10024) with ESMTP id ZcCs0kL4iszt; Mon, 27 Feb 2017 14:11:48 +0100 (CET) Original-Received: from zapf.ntg.nl (localhost [IPv6:::1]) by zapf.ntg.nl (Postfix) with ESMTP id D4C44801AB; Mon, 27 Feb 2017 14:11:48 +0100 (CET) Original-Received: from localhost (localhost [127.0.0.1]) by zapf.ntg.nl (Postfix) with ESMTP id 80FF2801AB for ; Mon, 27 Feb 2017 14:11:47 +0100 (CET) X-Virus-Scanned: Debian amavisd-new at zapf.boekplan.nl Original-Received: from zapf.ntg.nl ([127.0.0.1]) by localhost (zapf.ntg.nl [127.0.0.1]) (amavisd-new, port 10024) with ESMTP id z8EoIeJqg-YX for ; Mon, 27 Feb 2017 14:11:46 +0100 (CET) Original-Received: from mail-io0-f171.google.com (mail-io0-f171.google.com [209.85.223.171]) (using TLSv1.2 with cipher ECDHE-RSA-AES128-GCM-SHA256 (128/128 bits)) (No client certificate requested) by zapf.ntg.nl (Postfix) with ESMTPS id 282DC80108 for ; Mon, 27 Feb 2017 14:11:36 +0100 (CET) Original-Received: by mail-io0-f171.google.com with SMTP id 90so27556285ios.1 for ; Mon, 27 Feb 2017 05:11:35 -0800 (PST) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=gmail.com; s=20161025; h=mime-version:from:date:message-id:subject:to; bh=8Zj4fVFAY2We5bpIPzZMF6kNvdYwFtshrWvc6vI3XmY=; b=JuU7ikktkTqLCDrQTSs9M8GuzolC9k3Dz1mwc9NWip2YZV7YGSZLIPoi8q/1kBr4JY n8GEmQh+ghWhT192BvBRBl1zmsoiJDPRM78Do/gXsK5xOcKUkPl/H/5lp43qOjUsZ0NS ZEiCD9rQaC7w3/Hp1Zfi0ZR5Qdb6wlcaatOusYBjP4tI8d5J8vlTxvdvQK+4APiPPnVD ard9UsmG0ZB+txZhaEAHYe+7RV8XXxGzFfVUhCIo9W7Yqib50ZEicgDnRrNwEeBQPGC+ t4uagyBFFd124zLrgPyVxriBT7t+ouJLbIrkEXefp/APy88Z1PB4BKL8qbn5wxOKLaqj qxrA== X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20161025; h=x-gm-message-state:mime-version:from:date:message-id:subject:to; bh=8Zj4fVFAY2We5bpIPzZMF6kNvdYwFtshrWvc6vI3XmY=; b=mrT7aoxsunOa8b7L49UFc8dE5IZU75s5S88bYs0pQzJncu6/b3IRYRtbGwOezH1BNG QHxBHkfT8/ORdVwQ10qT2Q9gxK2F9VgA8+k6nG2oW+4Doa+o5qlfrjUbpoKI8UsbcO+6 8JryVRPOhWQrWR4N6y2k1DkqxDqtrAu/2d5tPVCqCzgQPwfMv1JLf6+Y0dgqnlQX9slr ca/VeasMnUNUHCvylqrwaAd3QOhQMXEe3oxoUFErQSmGABDsWuQCtAVHcqQoJXnOQywO 9p6fK6a6qrJr85OliB0TxrK32l3LkSSKxTwuCJBn/mszjIMTG376CLMMj3tk8MLffcDV vmpw== X-Gm-Message-State: AMke39m/LIrL6jDRJD9aQZGM1COW12k5/NzBiS4wri/YmA6NyurnvXXxyfOecbeC4w8Iyh6k5MbC6+tie/Jpvw== X-Received: by 10.107.181.2 with SMTP id e2mr13877239iof.20.1488201094574; Mon, 27 Feb 2017 05:11:34 -0800 (PST) Original-Received: by 10.107.133.31 with HTTP; Mon, 27 Feb 2017 05:11:14 -0800 (PST) X-BeenThere: ntg-context@ntg.nl X-Mailman-Version: 2.1.16 Precedence: list List-Id: mailing list for ConTeXt users List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , Errors-To: ntg-context-bounces@ntg.nl Original-Sender: "ntg-context" Xref: news.gmane.org gmane.comp.tex.context:97439 Archived-At: --===============4716520441685555869== Content-Type: multipart/alternative; boundary=001a1144501698c115054982d1f3 --001a1144501698c115054982d1f3 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: quoted-printable The following code, from the wiki, results in a compilation error: \starttext > \ctxlua{context(string.format("\%.2f", math.pi))} > \stoptext The error is: [\directlua]:1: invalid escape sequence near '\%' > 1 \starttext > 2 > 3 >> \ctxlua{context(string.format("\%.2f", math.pi))} > 4 > 5 \stoptext I ended using \letterpercent command but it is not very convenient. Any help is welcome, Antoine C. Full log: mtx-context | warning: synctex is enabled > mtx-context | run 1: luatex > --fmt=3D"/usr/local/texlive/2015/texmf-var/luatex-cache/context/a86c089b3= 84a3076dc514ba966a1fac9/formats/luatex/cont-en" > --jobname=3D"luapercent" > --lua=3D"/usr/local/texlive/2015/texmf-var/luatex-cache/context/a86c089b3= 84a3076dc514ba966a1fac9/formats/luatex/cont-en.lui" > --no-parse-first-line --synctex=3D1 --c:autogenerate --c:currentrun=3D1 > --c:directives=3D"system.synctex=3D1" > --c:fulljobname=3D"/Users/acailliau/Desktop/luapercent.tex" > --c:input=3D"/Users/acailliau/Desktop/luapercent.tex" --c:kindofrun=3D1 > --c:maxnofruns=3D9 --c:synctex=3D"1" "cont-yes.mkiv" > This is LuaTeX, Version beta-0.80.0 (TeX Live 2015) (rev 5238) > \write18 enabled. > system > synctex functionality is enabled (1)! > open source > 1 > 1 > > /usr/local/texlive/2015/texmf-dist/tex/context/base/cont-yes.mkiv > ConTeXt ver: 2015.05.18 12:26 MKIV current fmt: 2016.4.25 int: > english/english > system > 'cont-new.mkiv' loaded > open source > 2 > 2 > > /usr/local/texlive/2015/texmf-dist/tex/context/base/cont-new.mkiv > close source > 2 > 2 > > /usr/local/texlive/2015/texmf-dist/tex/context/base/cont-new.mkiv > system > files > jobname 'luapercent', input > '/Users/acailliau/Desktop/luapercent', result 'luapercent' > fonts > latin modern fonts are not preloaded > languages > language 'en' is active > open source > 2 > 3 > /Users/acailliau/Desktop/luapercent.tex > fonts > preloading latin modern fonts (second stage) > fonts > 'fallback modern-designsize rm 12pt' is loaded > lua error > error on line 3 in file > /Users/acailliau/Desktop/luapercent.tex: > [\directlua]:1: invalid escape sequence near '\%' > 1 \starttext > 2 > 3 >> \ctxlua{context(string.format("\%.2f", math.pi))} > 4 > 5 \stoptext > > ? Type to proceed, S to scroll future error messages, > R to run without stopping, Q to run quietly, > I to insert something, > 1 or ... or 9 to ignore the next 1 to 9 tokens of input, > H for help, X to quit. > ? close source > 2 > 3 > /Users/acailliau/Desktop/luapercent.tex > close source > 1 > 3 > > /usr/local/texlive/2015/texmf-dist/tex/context/base/cont-yes.mkiv > mkiv lua stats > used config file: > selfautoparent:/texmfcnf.lua;selfautoparent:/texmf-dist/web2c/texmfcnf.lu= a > mkiv lua stats > used cache path: > /usr/local/texlive/2015/texmf-var/luatex-cache/context/a86c089b384a3076dc= 514ba966a1fac9 > mkiv lua stats > synctex tracing: synctex has been enabled (extra log > file generated) > mkiv lua stats > resource resolver: loadtime 0.117 seconds, 0 scans with > scantime 0.000 seconds, 0 shared scans, 8 found files, scanned paths: > mkiv lua stats > stored bytecode data: 371 modules (0.309 sec), 78 table= s > (0.008 sec), 449 chunks (0.316 sec) > mkiv lua stats > traced context: maxstack: 1132, freed: 0, unreachable: > 1132 > mkiv lua stats > running in nuts mode: yes > mkiv lua stats > cleaned up reserved nodes: 41 nodes, 439 lists of 438 > mkiv lua stats > node memory usage: 2 glue, 2 penalty, 6 attribute, 26 > glue_spec, 2 attribute_list, 2 temp > mkiv lua stats > node list callback tasks: 6 unique task lists, 2 > instances (re)created, 3 calls > mkiv lua stats > used backend: pdf (backend for directly generating pdf > output) > mkiv lua stats > loaded patterns: en::2, load time: 0.000 > mkiv lua stats > jobdata time: 0.001 seconds saving, 0.000 seconds loadi= ng > mkiv lua stats > callbacks: 60 direct, 243 indirect, 303 total > mkiv lua stats > result saved in file: luapercent.pdf, compresslevel 3, > objectcompresslevel 3 > mkiv lua stats > loaded fonts: 2 files: latinmodern-math.otf, > lmroman12-regular.otf > mkiv lua stats > fonts load time: 0.180 seconds > mkiv lua stats > used platform: osx-64, type: unix, binary subtree: bin > mkiv lua stats > luatex banner: this is luatex, version beta-0.80.0 (tex > live 2015) (rev 5238) > mkiv lua stats > control sequences: 43101 of 65536 + 100000 > mkiv lua stats > lua properties: engine: lua, used memory: 67 MB (ctx: 6= 6 > MB), hash type: lua, hash chars: min(64,40), symbol mask: utf (=CF=84=CE= =B5=CF=87) > mkiv lua stats > runtime: 0.540 seconds > mtx-context | fatal error: return code: 1 --001a1144501698c115054982d1f3 Content-Type: text/html; charset=UTF-8 Content-Transfer-Encoding: quoted-printable
The following code, from the wiki, results in a compilatio= n error:

\starttext
\ctxlua{context(string.format("\%.2f", math.pi))= }
\stoptext

The error is:=C2=A0

[\direc= tlua]:1: invalid escape sequence near '\%'
1 =C2=A0 =C2=A0 \star= ttext
2 =C2=A0 =C2=A0=C2=A0
3 >> =C2=A0\ctxlua{context(string.f= ormat("\%.2f", math.pi))}
4 =C2=A0 =C2=A0=C2=A0
5 =C2=A0 = =C2=A0 \stoptext

I ended using \letterperce= nt command but it is not very convenient.

Any help= is welcome,

Antoine C.

F= ull log:

mtx-context =C2=A0 =C2=A0 | warning: synctex is enabled
mtx-c= ontext =C2=A0 =C2=A0 | run 1: luatex --fmt=3D"/usr/local/texlive/2015/= texmf-var/luatex-cache/context/a86c089b384a3076dc514ba966a1fac9/formats/lua= tex/cont-en" --jobname=3D"luapercent" --lua=3D"/usr/loc= al/texlive/2015/texmf-var/luatex-cache/context/a86c089b384a3076dc514ba966a1= fac9/formats/luatex/cont-en.lui" --no-parse-first-line --synctex=3D1 -= -c:autogenerate --c:currentrun=3D1 --c:directives=3D"system.synctex=3D= 1" --c:fulljobname=3D"/Users/acailliau/Desktop/luapercent.tex&quo= t; --c:input=3D"/Users/acailliau/Desktop/luapercent.tex" --c:kind= ofrun=3D1 --c:maxnofruns=3D9 --c:synctex=3D"1" "cont-yes.mki= v"
This is LuaTeX, Version beta-0.80.0 (TeX Live 2015) (rev 5238)= =C2=A0
=C2=A0\write18 enabled.
system =C2=A0 =C2=A0 =C2=A0 =C2=A0 =C2= =A0> synctex functionality is enabled (1)!
open source =C2=A0 =C2=A0 = > 1 > 1 > /usr/local/texlive/2015/texmf-dist/tex/context/base/cont= -yes.mkiv
ConTeXt =C2=A0ver: 2015.05.18 12:26 MKIV current =C2=A0fmt: 20= 16.4.25 =C2=A0int: english/english
system =C2=A0 =C2=A0 =C2=A0 =C2=A0 = =C2=A0> 'cont-new.mkiv' loaded
open source =C2=A0 =C2=A0 >= 2 > 2 > /usr/local/texlive/2015/texmf-dist/tex/context/base/cont-new= .mkiv
close source =C2=A0 =C2=A0> 2 > 2 > /usr/local/texlive/20= 15/texmf-dist/tex/context/base/cont-new.mkiv
system =C2=A0 =C2=A0 =C2=A0= =C2=A0 =C2=A0> files > jobname 'luapercent', input '/Use= rs/acailliau/Desktop/luapercent', result 'luapercent'
fonts = =C2=A0 =C2=A0 =C2=A0 =C2=A0 =C2=A0 > latin modern fonts are not preloade= d
languages =C2=A0 =C2=A0 =C2=A0 > language 'en' is activeopen source =C2=A0 =C2=A0 > 2 > 3 > /Users/acailliau/Desktop/luap= ercent.tex
fonts =C2=A0 =C2=A0 =C2=A0 =C2=A0 =C2=A0 > preloading lati= n modern fonts (second stage)
fonts =C2=A0 =C2=A0 =C2=A0 =C2=A0 =C2=A0 &= gt; 'fallback modern-designsize rm 12pt' is loaded
lua error =C2= =A0 =C2=A0 =C2=A0 > error on line 3 in file /Users/acailliau/Desktop/lua= percent.tex:
[\directlua]:1: invalid escape sequence near '\%'1 =C2=A0 =C2=A0 \starttext
2 =C2=A0 =C2=A0=C2=A0
3 >> =C2=A0\= ctxlua{context(string.format("\%.2f", math.pi))}
4 =C2=A0 =C2= =A0=C2=A0
5 =C2=A0 =C2=A0 \stoptext

? Type =C2=A0to proceed, S to= scroll future error messages,
R to run without stopping, Q to run quiet= ly,
I to insert something,=C2=A0
1 or ... or 9 to ignore the next 1 t= o 9 tokens of input,
H for help, X to quit.
? close source =C2=A0 =C2= =A0> 2 > 3 > /Users/acailliau/Desktop/luapercent.tex
close sour= ce =C2=A0 =C2=A0> 1 > 3 > /usr/local/texlive/2015/texmf-dist/tex/c= ontext/base/cont-yes.mkiv
mkiv lua stats =C2=A0> used config file: se= lfautoparent:/texmfcnf.lua;selfautoparent:/texmf-dist/web2c/texmfcnf.luamkiv lua stats =C2=A0> used cache path: /usr/local/texlive/2015/texmf-v= ar/luatex-cache/context/a86c089b384a3076dc514ba966a1fac9
mkiv lua stats = =C2=A0> synctex tracing: synctex has been enabled (extra log file genera= ted)
mkiv lua stats =C2=A0> resource resolver: loadtime 0.117 seconds= , 0 scans with scantime 0.000 seconds, 0 shared scans, 8 found files, scann= ed paths:=C2=A0
mkiv lua stats =C2=A0> stored bytecode data: 371 modu= les (0.309 sec), 78 tables (0.008 sec), 449 chunks (0.316 sec)
mkiv lua = stats =C2=A0> traced context: maxstack: 1132, freed: 0, unreachable: 113= 2
mkiv lua stats =C2=A0> running in nuts mode: yes
mkiv lua stats = =C2=A0> cleaned up reserved nodes: 41 nodes, 439 lists of 438
mkiv lu= a stats =C2=A0> node memory usage: 2 glue, 2 penalty, 6 attribute, 26 gl= ue_spec, 2 attribute_list, 2 temp
mkiv lua stats =C2=A0> node list ca= llback tasks: 6 unique task lists, 2 instances (re)created, 3 calls
mkiv= lua stats =C2=A0> used backend: pdf (backend for directly generating pd= f output)
mkiv lua stats =C2=A0> loaded patterns: en::2, load time: 0= .000
mkiv lua stats =C2=A0> jobdata time: 0.001 seconds saving, 0.000= seconds loading
mkiv lua stats =C2=A0> callbacks: 60 direct, 243 ind= irect, 303 total
mkiv lua stats =C2=A0> result saved in file: luaperc= ent.pdf, compresslevel 3, objectcompresslevel 3
mkiv lua stats =C2=A0>= ; loaded fonts: 2 files: latinmodern-math.otf, lmroman12-regular.otf
mki= v lua stats =C2=A0> fonts load time: 0.180 seconds=C2=A0
mkiv lua sta= ts =C2=A0> used platform: osx-64, type: unix, binary subtree: bin
mki= v lua stats =C2=A0> luatex banner: this is luatex, version beta-0.80.0 (= tex live 2015) (rev 5238)
mkiv lua stats =C2=A0> control sequences: 4= 3101 of 65536 + 100000
mkiv lua stats =C2=A0> lua properties: engine:= lua, used memory: 67 MB (ctx: 66 MB), hash type: lua, hash chars: min(64,4= 0), symbol mask: utf (=CF=84=CE=B5=CF=87)
mkiv lua stats =C2=A0> runt= ime: 0.540 seconds
mtx-context =C2=A0 =C2=A0 | fatal error: return code:= 1
--001a1144501698c115054982d1f3-- --===============4716520441685555869== Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: base64 Content-Disposition: inline X19fX19fX19fX19fX19fX19fX19fX19fX19fX19fX19fX19fX19fX19fX19fX19fX19fX19fX19f X19fX19fX19fX19fX19fX19fX19fX19fX18KSWYgeW91ciBxdWVzdGlvbiBpcyBvZiBpbnRlcmVz dCB0byBvdGhlcnMgYXMgd2VsbCwgcGxlYXNlIGFkZCBhbiBlbnRyeSB0byB0aGUgV2lraSEKCm1h aWxsaXN0IDogbnRnLWNvbnRleHRAbnRnLm5sIC8gaHR0cDovL3d3dy5udGcubmwvbWFpbG1hbi9s aXN0aW5mby9udGctY29udGV4dAp3ZWJwYWdlICA6IGh0dHA6Ly93d3cucHJhZ21hLWFkZS5ubCAv IGh0dHA6Ly9jb250ZXh0LmFhbmhldC5uZXQKYXJjaGl2ZSAgOiBodHRwczovL2JpdGJ1Y2tldC5v cmcvcGhnL2NvbnRleHQtbWlycm9yL2NvbW1pdHMvCndpa2kgICAgIDogaHR0cDovL2NvbnRleHRn YXJkZW4ubmV0Cl9fX19fX19fX19fX19fX19fX19fX19fX19fX19fX19fX19fX19fX19fX19fX19f X19fX19fX19fX19fX19fX19fX19fX19fX19fX19fX19fX19f --===============4716520441685555869==--