This is not your typical question about latex syntax or packages or usage, so I'm not sure this is the right place for it. If not, please let me know where is the right place!
Is there any way to get some kind of document coordinates telling you where a snippet or subsnippet of latex source is rendered? I'm trying to build a little gui to interact with latex code and it'd be much nicer to be able to interact with rendered formulas than with the latex code. The user would interact with the rendered formulas, but then I'd need a way to map those actions on the screen to pieces of the source that need to be manipulated.
WYSIWYG latex editors like Lyx seem to have a way to do this: the user interacts with and sees latex rendered math, but when they enter commands, lyx must somehow edit the underlying source, and then display.