[Dev-luatex] # => ## in \directlua

Jonathan Sauer Jonathan.Sauer at silverstroke.com
Wed Oct 8 09:48:43 CEST 2008


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:

%&luatex

\directlua0{%
	texio.write_nl('\luaescapestring{\unexpanded{#}}')%
	texio.write_nl('\luaescapestring{#}')%
	texio.write_nl('#')%
% 	texio.write_nl(#_VERSION)% A
}

\bye


This is LuaTeX, Version snapshot-0.30.0-2008100718 (Web2C 7.5.7)
(MacroParameterCharacter2.tex
#
#
## )
No pages of output.
Transcript written on MacroParameterCharacter2.log.


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 I
try to print the length of the _VERSION string); also it is a bit
inconsistent.

What do you think?


> Best wishes,
> Taco

Jonathan



More information about the dev-luatex mailing list