Re: [NTG-context] checking mainlanguage setup
Dear Lucas,
Shouldn't it be (untested):
context("\\def\\lang{English}")
It is working.
context([[\def\lang{English}]])
It is not working. It prints "def lang English". Thank you. Best regards, Dalyoung
On Tue, 31 May 2011 12:45:00 +0200, Jeong Dalyoung
Dear Lucas,
Shouldn't it be (untested):
context("\\def\\lang{English}")
It is working.
context([[\def\lang{English}]])
It is not working. It prints "def lang English".
Thank you.
Best regards,
Dalyoung
OK. I meant just the way how strings in Lua are entered - if inside quotation marks, escaping is required, thus "\\" yields to backslash, - if inside [[ ... ]], single \ gives backslash, and of course \\ gives TWO backslashes. I guessed that your original [[\\def\\lang{English}]] could have caused the problem, so I corrected it to [[\def\lang{English}]] Cheers, Lukas -- Ing. Lukáš Procházka [mailto:LPr@pontex.cz] Pontex s. r. o. [mailto:pontex@pontex.cz] [http://www.pontex.cz] Bezová 1658 147 14 Praha 4 Tel: +420 244 062 238 Fax: +420 244 461 038
On 31-5-2011 4:33, Procházka Lukáš Ing. - Pontex s. r. o. wrote:
On Tue, 31 May 2011 12:45:00 +0200, Jeong Dalyoung
wrote: Dear Lucas,
Shouldn't it be (untested):
context("\\def\\lang{English}")
It is working.
context([[\def\lang{English}]])
It is not working. It prints "def lang English".
Thank you.
Best regards,
Dalyoung
OK.
I meant just the way how strings in Lua are entered
- if inside quotation marks, escaping is required, thus "\\" yields to backslash, - if inside [[ ... ]], single \ gives backslash, and of course \\ gives TWO backslashes.
I guessed that your original
[[\\def\\lang{English}]]
could have caused the problem, so I corrected it to
[[\def\lang{English}]]
[[ ]] vs " " is a lua thing ... but when you pass things from within tex, expansions happens the same in both; you can try context("\detokenize{...}") ----------------------------------------------------------------- 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 -----------------------------------------------------------------
On 1-6-2011 10:14, Hans Hagen wrote:
[[ ]] vs " " is a lua thing ... but when you pass things from within tex, expansions happens the same in both; you can try
context("\detokenize{...}")
Sorry, that should have been \ctxlua{"\detokenize{...}"} which takes care of things at the tex end. When at the lua end, you need to use \\ (or indeed [[with regular \'s]]. Anyhow, it does not hurt to always to take good look at \'s because commands might end up in cycles (or for instance can end up in auxiliary files). This is why many commands are defined using \unexpanded. Even if you pass something using context at the lua end. You can see what gets passed to tex using: \enabletrackers[context.trace] What you see there should look like regular context. (btw, context.setvalue{"Lang","English") also works well and has no backslashes) 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 -----------------------------------------------------------------
participants (3)
-
Hans Hagen
-
Jeong Dalyoung
-
Procházka Lukáš Ing. - Pontex s. r. o.