<div dir="ltr"><div><div>Hello,<br></div>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.<br></div><br>It's ok with this callback for reading just one line after \Cmath:<br>
<br>
<p style="margin:0px;text-indent:0px"><span style="font-family:courier new,monospace">\def\Cmath{\directlua{luatexbase.add_to_callback("process_input_buffer",parseCmath,"parseCmath")}}</span></p><span style="font-family:courier new,monospace">
</span><span style="font-family:courier new,monospace">
</span><p style="margin:0px;text-indent:0px"><span style="font-family:courier new,monospace">\directlua{</span></p><span style="font-family:courier new,monospace">
</span><p style="margin:0px;text-indent:0px"><span style="font-family:courier new,monospace">function parseCmath(line)</span></p><span style="font-family:courier new,monospace">
</span><p style="margin:0px;text-indent:0px"><span style="font-family:courier new,monospace"> luatexbase.remove_from_callback("process_input_buffer","parseCmath")</span></p><span style="font-family:courier new,monospace">return my_lua_function(line)
</span><p style="margin:0px;text-indent:0px"><span style="font-family:courier new,monospace">end</span></p><span style="font-family:courier new,monospace">
</span><p style="margin:0px;text-indent:0px"><span style="font-family:courier new,monospace">}</span></p><span style="font-family:courier new,monospace">
</span><p style="margin:0px;text-indent:0px"><span style="font-family:courier new,monospace">\begin{document}</span></p><span style="font-family:courier new,monospace">
</span><span style="font-family:courier new,monospace">
</span><p style="margin:0px;text-indent:0px"><span style="font-family:courier new,monospace">\Cmath</span></p><span style="font-family:courier new,monospace">
</span><p style="margin:0px;text-indent:0px"><span style="font-family:courier new,monospace">1/2<br></span></p><p style="margin:0px;text-indent:0px"><span style="font-family:courier new,monospace">\end{document}</span></p>
<p style="margin:0px;text-indent:0px"><br></p><p style="margin:0px;text-indent:0px">But I'd want to do the same with this syntax \Cmath{1/2}</p><p style="margin:0px;text-indent:0px">Is it possible with a callback or anything else ?</p>
<p style="margin:0px;text-indent:0px">Thank's for ideas.<br></p><p style="margin:0px;text-indent:0px"><br></p><p style="margin:0px;text-indent:0px"><br></p></div>