[ < ] [ > ]   [ << ] [ Up ] [ >> ]         [Top] [Contents] [Index] [ ? ]

2.8 Commenting

It is often necessary to comment out temporarily a region of TeX or LaTeX code. This can be done with the commands C-c ; and C-c %. C-c ; will comment out all lines in the current region, while C-c % will comment out the current paragraph. Type C-c ; again to uncomment all lines of a commented region, or C-c % again to uncomment all comment lines around point. These commands will insert or remove a single ‘%’ respectively.

Command: TeX-comment-or-uncomment-region

(C-c ;) Add or remove ‘%’ from the beginning of each line in the current region. Uncommenting works only if the region encloses solely commented lines. If AUCTeX should not try to guess if the region should be commented or uncommented the commands TeX-comment-region and TeX-uncomment-region can be used to explicitly comment or uncomment the region in concern.

Command: TeX-comment-or-uncomment-paragraph

(C-c %) Add or remove ‘%’ from the beginning of each line in the current paragraph. When removing ‘%’ characters the paragraph is considered to consist of all preceding and succeeding lines starting with a ‘%’, until the first non-comment line.


[ < ] [ > ]   [ << ] [ Up ] [ >> ]         [Top] [Contents] [Index] [ ? ]

This document was generated on January 17, 2024 using texi2html 1.82.