# How to write infix macro/newcommand?

Is it possible to write a new command/macro in infix syntax instead of prefix syntax; especially I'd like to have this for $\frac{a}{b}$.

I use LuaLaTeX and with \newunicodechar{‾}{\overline} I can write ‾{blah} and this is expanded to \overline{blah}. Analogously I'd like to have $\frac{a}{b}$ to be something like {a}➗{b} or a÷b which would be much more readable.

• It is not possible to get the last argument before a macro or active character and use it the same way as with normal arguments. – Martin Scharrer Dec 18 '11 at 14:55
• In standard TeX, you can use \lastbox (not in math mode, however), but seemingly this doesn't work with single characters, only with "explicit" boxes. I am not sure, however, whether similar things couldn't be possible in LuaTeX-it's quite possible that you could use some lua trickery to retrieve a few last tokens (digits, for instance). Still, it is highly non-standard and would imho qualify for Appendix D of "The LuaTeXbook" (if it ever gets written) ;). – mbork Dec 18 '11 at 17:23

TeX already has primitive \over; try ${a \over b}$.
• the infix names I only would use with unicode-symbols $a \mid b$ reads $a ∣ b$ in my setting which is quite expressive/readable to me. – epsilonhalbe Dec 18 '11 at 16:35
• @epsilonhalbe: there's also at least \atop, \above<rule height>, \atopwithdelims<delim1><delim2>, \abovewithdelims<delim1><delim2><rule height>, \overwithdelims<delim1><delim2> – morbusg Dec 18 '11 at 17:16