# How to find the matching environment command in tex mode?

A latex environment looks like this:

\begin{envName}
body
\end{envName}


Is there a command to jump back-and-forth between matching \begin and \end commands? (One cannot simply use a regex search because environments can be nested)

LaTeX-find-matching-begin and LaTeX-find-matching-end functions do this.
   AUCTeX offers keyboard shortcuts for moving point to the beginning

• It should be noted that C-M-a and C-M-e are bound to beginning-of-defun and end-of-defun resp. in most modes and they are available in every mode, not just LaTeX-mode. They are supposed to do the "right" thing in each case: e.g. C-M-a moves to the beginning of the environment in LaTeX-mode, the beginning of a function in C mode, the beginning of a defun (doh!) in emacs-lisp-mode and so on. Nov 22, 2021 at 23:17