I'm writing a program that uses LaTeX to display formula's. The user must be allowed to click on different parts of the formula, and the program should know on which part the user clicked.
Is there a way to retrieve the coordinates of all characters in a formula? I would like to output these coordinates with LaTeX to a file and then read this file with the external program.
Perhaps there is some LaTeX command that can be used like this:
$a=\sqrt{b^2+c^{\getcoords{2}}}$
which saves the coordinates of the digit 2 in a variable, which I can then write to an output file.
Does anybody know anyway to achieve this?
OP's comment transcribed from comment section below:
"The eventual goal of my program is that when the user clicks an element of the formula, the definition of this piece is displayed"




pdfcommentpackage seems to be relevant here: http://tex.stackexchange.com/questions/6306/how-to-annotate-pdf-files-generated-by-pdflatex, http://tex.stackexchange.com/questions/81846/dynamic-picture-in-beamer-presentation, http://tex.stackexchange.com/questions/14842/creating-fillable-pdfs, http://tex.stackexchange.com/questions/57657/how-to-create-page-with-non-printing-annotation ... These still aren't the one I vividly recall, but I will keep looking. – Steven B. Segletes Sep 13 '14 at 18:00pdfcomment, other relevant packages might beocgtools,fancytooltipsandcooltooltips. – Steven B. Segletes Sep 13 '14 at 18:07standaloneclass) – Carucel Sep 23 '17 at 11:15