reftex-what-environment

reftex-what-environment is an autoloaded Lisp function in `reftex-parse.el'.

(reftex-what-environment WHICH &optional BOUND)

Find out if point is inside a LaTeX environment.
The return value is (e.g.) either ("equation" . (point)) or a list of
them.

If WHICH is nil, immediately return nil.
If WHICH is 1, return innermost enclosing environment.
If WHICH is t, return list of all environments enclosing point.
If WHICH is a list of environments, look only for those environments and
return the name of the first environment in this list found to enclose
point.

If the optional BOUND is an integer, bound backwards directed searches to
this point. If it is nil, limit to nearest \section - like statement.