I recently wrote a function which could cycle through LaTeX math delimiters. It relies on the texmathp function, built into AucTeX, which will return t if the point is inside an equation region. In addition, I use the texmathp-why function in order to determine what the math environment is (which was important to answering the posed question).
However, it was pointed out by the asker that the function does not work when the point is inside \text{} inside the equation (which I assume is intentional behavior within AucTeX). Is there a simple way to avoid this escape, or should I write a work around in the function to account for this?
\[,\(and\begin{equation'.\text{}the sole exception inside?texmathpreturns nil if point is inside the argument of\textand other similar macros (seetexmathp-tex-commands-defaultvariable).nilwhen it's inside\text, that was the edge case I wanted to avoid.