diff -r 2f5c47dc24ea doc/auctex.texi --- a/doc/auctex.texi Sun Sep 22 20:43:41 2013 +0900 +++ b/doc/auctex.texi Thu Oct 10 00:32:04 2013 +0900 @@ -315,7 +315,7 @@ indenting and filling and for navigating through the document. @menu -* Quotes:: Inserting double quotes +* Quotes:: Inserting quotes, dollars, and braces * Font Specifiers:: Inserting Font Specifiers * Sectioning:: Inserting chapters, sections, etc. * Environments:: Inserting Environment Templates @@ -471,6 +471,110 @@ it and leave point after the closing brace. @end deffn +When writing complex math formulas in @LaTeX{} documents, you +sometimes need to adjust the size of braces with pairs of macros like address@hidden@samp{\right}, @address@hidden and so on. You +can avoid unbalanced pairs with the help of @code{TeX-insert-macro}, +bound to @kbd{C-c C-m} or @kbd{C-c @key{RET}} (@pxref{Completion}). +If you insert left size adjusting macros such as @samp{\left}, address@hidden etc. with @code{TeX-insert-macro}, it asks for left brace +to use and supplies automatically right size adjusting macros such as address@hidden, @samp{\bigr} etc. and corresponding right brace in +addtion to the intended left macro and left brace. + +The completion by @code{TeX-insert-macro} also applies when entering +macros such as @samp{\langle}, @samp{\lfloor} and @samp{\lceil}, which +produce the left part of the paired braces. For example, inserting address@hidden by @kbd{C-c C-m} is immediately followed by the +insertion of @samp{\rfloor}. In addition, if the point was located +just after @samp{\left} or its friends, the corresponding address@hidden etc. will be inserted in front of @samp{\rfloor}. +In both cases, active region is honored. + +As a side effect, when @code{LaTeX-math-mode} (@pxref{Mathematics}) is +on, just typing @kbd{`(} inserts not only @samp{\langle}, but also address@hidden + +If you don't like such auto completion at all, it can be disabled by +an user option. + address@hidden TeX-arg-right-insert-p +If this option is turned off, the automatic supply of the right macros +and braces is suppressed. address@hidden defopt + +When you edit @LaTeX{} documents, you can enable automatic brace +pairing when typing @kbd{(}, @address@hidden and @kbd{[}. + address@hidden LaTeX-electric-left-right-brace +If this option is on, just typing @kbd{(}, @address@hidden or @kbd{[} +immediately adds the corresponding right brace @samp{)}, @address@hidden or address@hidden The point is left after the opening brace. If there is an +active region, braces are put around it. + +They recognize the preceeding backslash or size adjusting macros such +as @samp{\left}, @samp{\bigl} etc., so the following completions will +occur: address@hidden @bullet + address@hidden +(when typing single left brace) address@hidden @minus + address@hidden address@hidden(} -> @samp{()} + address@hidden address@hidden@{} -> @address@hidden@}} + address@hidden address@hidden -> @samp{[]} address@hidden itemize + address@hidden +(when typing left brace just after a backslash) address@hidden @minus + address@hidden address@hidden(} -> @samp{\(\)} + address@hidden address@hidden@{} -> @address@hidden@}} + address@hidden address@hidden -> @samp{\[\]} address@hidden itemize + address@hidden +(when typing just after @samp{\left} or @samp{\bigl}) address@hidden @minus + address@hidden address@hidden(} -> @samp{\left(\right)} + address@hidden address@hidden -> @samp{\bigl[\bigr]} address@hidden itemize + address@hidden +(when typing just after @samp{\Bigl\}) address@hidden @minus + address@hidden address@hidden@{} -> @address@hidden@}} + address@hidden itemize + address@hidden itemize + +This auto completion feature may be a bit annoying when editing an +already existing @LaTeX{} document. In that case, use @kbd{C-u 1} or address@hidden before typing @kbd{(}, @address@hidden or @kbd{[}. Then no +completion is done and just a single left brace is inserted. In fact, +with optional prefix @var{arg}, just that many open braces are +inserted without any completion. address@hidden defopt + @node Font Specifiers @section Inserting Font Specifiers diff -r 2f5c47dc24ea doc/changes.texi --- a/doc/changes.texi Sun Sep 22 20:43:41 2013 +0900 +++ b/doc/changes.texi Thu Oct 10 00:32:04 2013 +0900 @@ -46,6 +46,24 @@ with @samp{slides} it is @samp{slide}. @item +Brace pairing feature was enhanced in @LaTeX{} documents. Support for address@hidden, @samp{\Bigl}, @samp{\biggl} and @samp{\Biggl}, the same +as the one for @samp{\left}, was added to @code{TeX-insert-macro}. +For example, @kbd{C-c @key{RET} bigl @key{RET} ( @key{RET}} inserts address@hidden(\bigr)}. + +You can insert brace pair @samp{()}, @address@hidden@}} and @samp{[]} by typing +a single left brace if the new user option address@hidden is enabled. + +Macros @samp{\langle}, @samp{\lfloor} and @samp{\lceil}, which produce +the left part of the paired braces, are treated similarly as @samp{(}, address@hidden@{} and @samp{[} during the course of @code{TeX-insert-macro}. address@hidden rawfile address@hidden, for details. address@hidden ifclear + address@hidden Support for dozens of @LaTeX{} packages was added. @end itemize