[luatex] Add a callback "process_input_buffer" for an argument, not a line.

Christophe Devalland christophe.devalland at gmail.com
Sun Jun 22 14:38:19 CEST 2014


Hello,
I tried to pass an argument to my_lua_function but I want it as verbatim
argument because it may contain any characters TeX doesn't like.

It's ok with this callback for reading just one line after \Cmath:

\def\Cmath{\directlua{luatexbase.add_to_callback("process_input_buffer",parseCmath,"parseCmath")}}

\directlua{

function parseCmath(line)

luatexbase.remove_from_callback("process_input_buffer","parseCmath")
return my_lua_function(line)

end

}

\begin{document}

\Cmath

1/2

\end{document}


But I'd want to do the same with this syntax \Cmath{1/2}

Is it possible with a callback or anything else ?

Thank's for ideas.
-------------- next part --------------
An HTML attachment was scrubbed...
URL: <http://tug.org/pipermail/luatex/attachments/20140622/9044b410/attachment.html>


More information about the luatex mailing list