## Monday, January 28, 2013

### LaTeX Tips: Displayed Math - adding sections, subsections, etc. to equation numbers

LaTeX Tips: Displayed Math

How to number equations. By default, LaTeX will number equations consecutively, as (1), (2), etc., assuming you use the automatic equation numbering mechanism. If the paper is very short, or if there are only a few numbered equations, this is fine, but once the numbers get into the twenties and higher, a scheme that numbers equations by section, as in (1.1), (1.2), ..., (2.1), etc., is preferable. In fact, for the vast majority of journal articles, the latter is probably the best numbering scheme. To get equations numbered by section, just put the following into the preamble: " \numberwithin{equation}{section} ". For books, theses, or very long papers, an equation numbering scheme that is three levels deep (with numbers like (4.1.1), etc.) may be appropriate. To get this, just replace "section" above by "subsection", or the corresponding innermost level. The same mechanism works for other counters, e.g., theorem counters, instead of "equation".

If you have a thesis or some other class/document type it may be different.  In my case (UTK thesis/diss class) it automatically numbered 3.1 for chapters.  So for "3.1.1" it was "section," and "3.1.1.1" I used "subsection."