Prospective question: How can I use LuaTeX to detect the position of a math symbol (unary vs. binary, after/before parantheses) in order to put a custom amount of spacing around it?

Essentially, this question along with this one showed the importance of writing something akin to your own parser to allow dynamic spacing (i.e. dynamic '\medmuskip') around operators. I found out that someone else asked a similar question a while back: Using operator spacing to indicate precedence

I'd like to figure out how to write such a parser, using LuaTeX.

Suspected issue with the question: it requires the answerer to do a lot of work/shows that I didn't do enough of my own research, because one could argue that I could probably figure out the answer if I spent enough time reading docs etc.? Am I just being too lazy?

Your thoughts?

  • 3
    You can use this answer as a starting point, read the LuaTeX docs, and ask a question once you get stuck. If you ask your literally as you proposed it, then yes, you are lazy. – Henri Menke Sep 24 '17 at 9:49
  • Yes. In short, well, erm, yes. – user108682 Sep 24 '17 at 17:15
  • 4
    Just ask the question about your current state, and continue to work on it. When you have done enough research, post an answer. – ShreevatsaR Sep 24 '17 at 19:17
  • Makes sense to me! – user89 Sep 24 '17 at 19:23
  • 2
    It is possible to pirate the xint parser to achieve what you want, without LuaTeX, if you limit yourself to expressions xint currently understands. (it might be possible hijacking l3fp do, but I don't know its implementation). But you seem to be intent into parsing (say à la MathJaX) all that TeX can typeset in math mode am I understanding this correctly? – user4686 Sep 25 '17 at 15:23

You must log in to answer this question.

Browse other questions tagged .