Hello,
> > So with \luaescapestring, the `#' is not doubled anymore, without it
> > still is. Although most of the time, strings will be passed to Lua
> > through \luaescapestring, this behaviour still creates problems when
> > `#' is used inside Lua code (as in the commented line A above, where
Jonathan Sauer wrote:
>
> So with \luaescapestring, the `#' is not doubled anymore, without it
> still is. Although most of the time, strings will be passed to Lua
> through \luaescapestring, this behaviour still creates problems when
> `#' is used inside Lua code (as in the commented line A abo
Hello,
> Actually the problem was with \luaescapestring. Commit #1544 changes
> the behaviour of \luaescapestring so that it no longer duplicates
> characters with catcode 6. Please verify that that does what you want.
Thank you very much! I tried it with the following (simpler) example:
%&luat
Jonathan Sauer wrote:
> Hello,
>
>> So `#' is transformed into `##' when passed from TeX to Lua.
[...]
This currently uses TeX's tokenlist print function, but I could
make it behave differently, no problem (after all, this
generated string is only 'seen' by the lua inter
Hello,
> >> >> So `#' is transformed into `##' when passed from TeX to Lua.
> >> [...]
> >> This currently uses TeX's tokenlist print function, but I could
> >> make it behave differently, no problem (after all, this
> >> generated string is only 'seen' by the lua interpreter).
> >
> > In that ca
"Jonathan Sauer" <[EMAIL PROTECTED]> writes:
> Hello,
>
>> >> So `#' is transformed into `##' when passed from TeX to Lua.
>> [...]
>> This currently uses TeX's tokenlist print function, but I could
>> make it behave differently, no problem (after all, this
>> generated string is only 'seen' by t
David Kastrup wrote:
>>
>> So `#' is transformed into `##' when passed from TeX to Lua.
>
> No, when TeX prints.
You are saying the same thing. The tokenlist that results from
the that is read after the \directlua is internally
converted to a string before the lua interpreter gets a look at it
Hello,
> >> So `#' is transformed into `##' when passed from TeX to Lua.
> [...]
> This currently uses TeX's tokenlist print function, but I could
> make it behave differently, no problem (after all, this
> generated string is only 'seen' by the lua interpreter).
In that case: Please make it so.
David Kastrup a écrit :
>> So `#' is transformed into `##' when passed from TeX to Lua.
>
> No, when TeX prints.
>
>> Is this a bug or a feature?
>
> Feature. Quite an annoying one in my opinion, but there you are.
>
By the way, using LaTeX, the "ted" package has a command \ShowTokens
which is
"Jonathan Sauer" <[EMAIL PROTECTED]> writes:
> take the following PlainTeX file:
>
> %&luatex
> \def\recatcode#1{%
> \directlua0{%
> tex.sprint('\luaescapestring{\unexpanded{#1}}')%
> texio.write_nl('\luaescapestring{\unexpanded{#1}}')%
> }%
> }
>
> \recatco
Hello,
take the following PlainTeX file:
%&luatex
\def\recatcode#1{%
\directlua0{%
tex.sprint('\luaescapestring{\unexpanded{#1}}')%
texio.write_nl('\luaescapestring{\unexpanded{#1}}')%
}%
}
\recatcode{%
\def\test#1{`#1'}%
}
\bye
This res
11 matches
Mail list logo