Go to page:

Search:   Help

Edit

FAQ /

# Numbering

Categories: FAQ, Numbering, Pagination
<< | Page list | >>

## § Page numbers (Pagination)

### § How can I start page numbering on a different page?

Suppose you want to have some pages without pagination (e.g. title pages, TOC) and want to start with page "1" afterwards. Just suppress, if necessary, the pagination on those pages with \thispagestyle{empty} (if it's only one page) or \pagestyle{empty} (if it concerns multiple pages). Then, start the pagination with \setcounter{page}{1} on the desired page. Note that you might eventually need to reset the pagestyle on that page to get a page number, e.g. by \pagestyle{fancy} or \pagestyle{headings}.

### § How can I have roman pagination (i, ii, iii...) for the first part of my document?

• If you use a book class, simply insert
\frontmatter
at the beginning of the document. This will switch page numbering to roman (i, ii, iii...)
\mainmatter
will switch back to arabic (1, 2, ...) and start from "1".
• With report or article classes, insert at the beginning (in the LaTeX preamble):
\pagenumbering{roman}
and then, where you want to switch back (somewhere on the page in the normal text), in ERT (Ctrl-L):
\pagenumbering{arabic}
\setcounter{page}{1}

### § How do I get headers on my index pages?

printindex sets the pagestyle to plain, to counter this, we can redefine this pagestyle. If we use the fancy pagestyle throughout our document we can add the following to the preamble:
\renewcommand{\ps@plain}{\pagestyle{fancy}}

## § Section numbering

### § How can I set the starting number for a chapter or a section?

Add \setcounter{chapter}{3} or \setcounter{section}{3} to the preamble to set the number to 3 for chapter or section respectively.

### § How can I remove section and subsection numbering in the output?

Use the starred versions of the environments, i.e. Chapter*, Section*, Subsection*. Note: The subdivisions will not appear in the table of contents with this solution.

### § How can I remove section and subsection numbering in the output, but still have the sections appear in the table of contents?

If you want to get rid of the numbering completely, go to Document→Settings→Numbering & TOC and drag the slider "Numbering" to the left.

If you just want to insert some unnumbered sections next to numbered sections to the TOC, either:

• use a class that supports unnumbered TOCed sections, such as KOMA-Script (Addchap, Addsec), or

also cf. this FAQ entry

\makeatletter
\makeatother

### § I'm only using sections, but they show as 0.1, 0.2 etc. How can I fix this?

Use a class that has sections as the highest element (i.e., article, not report or book).

Or, if you want something like 1.1, 1.2, set the counter for chapters. For instance, add this in ERT:

	\setcounter{chapter}{1}


to the beginning of your document. (The preamble ought to work too).

### § How can I have alphabetic section labels (a, b, c..) instead of 1, 2, 3?

• Add the following to the preamble:
\def\thesection{\alph{section}}

See http://help-csli.stanford.edu/tex/latex-sections.shtml(approve sites) for more numbering options.

### § How can I start an appendix (section numbering A, B instead of 10, 11 ...)?

Simple, put the cursor on the first chapter/section you want to be an appendix and select: Document→Start Appendix Here.

## § List numbering

### § How do I get a formatted list which starts with e.g. 1. a)?

If you want a list which looks like

1. a) First alternative
b) Second alternative
c) Third alternative


then try the following

1. {}
a) First alternative
b) Second alternative
c) Third


where {} is in ERT (i.e. a placeholder not generating output. Specifically, set the style to "enumerate", enter the brackets in ERT, change the environment depth, and add the three elements. LyX will auto-label the entries.

### § How can I set the starting number of an enumerated list?

In order to make an enumerated list start with e.g. 5, you can add this ERT as the first thing on the line:

	[5.]\setcounter{enumi}{5}


Or use the Enumerate-Resume style provided by the Enumitem LyX module.

### § How can I interrupt an enumerated list and resume the number later?

For a quick-and-dirty solution (manual setting of the starting number) see the previous question.

More elegant ways that adjust the starting number automatically are provided by the following packages that extend the enumerate environment:

The Enumitem LyX module provides a pretty comfortable way to use one of those, namely enumitem.

Please refer to the packages' documentation for details.

Another solution would be to move away from enumerate and use packages such as covington.sty or gb4e.sty. These packages allow you to have sequential numbering throughout the text without resorting to ERT, and you can set up LyX to include them in your default document class. Covington is described here.

### § How can I change the type of counter used in an enumerated list?

To change all enumerated lists from (1), (2), (3),... to (a), (b), (c), write

	\renewcommand\theenumi{(\alph{enumi})}
\renewcommand\labelenumi{\theenumi}


in the preamble.

To only change this for a single list, write instead

	\bgroup
\renewcommand\theenumi{(\alph{enumi})}
\renewcommand\labelenumi{\theenumi}


as ERT just in front of the list and write

	\egroup{}


as ERT just after the list or use the optional arguments for lists provided with the Enumitem module.

If you need your list to follow the numbering of your sections/subsections then you could use the Enumitem module and an optional argument similar to the following:

	label=\thesection.\arabic*
label=\thesubsection.\arabic*


In the above, the first would insert 2.1, 2.2, 2.3, etc. (for a list in Section 2), while the second would insert 2.1.1, 2.1.2, 2.1.3, etc. (for a list in Section 2 Subsection 1). See the Enumitem example shipped with LyX to see how to properly specify such an argument to the start of a list.

### § How do I get enumerate to number all examples in a text sequentially?

You can use several packages (such as mdwlist.sty). See this page for more.

## § Equation numbering

### § How do I number equations by section?

In recent LyX versions: Go to Document→Settings→Modules and add the module "Number equations by section".

In older LyX versions, add the following line to your LaTeX preamble:

\numberwithin{equation}{section}

(or put subsection etc. in place of section if that's what you want)

This second version requires amsmath, so make sure that "Use AMS math package" is selected in Document→Settings→Math Options.

### § How do I number equations globally?

Try the Covington package, or define your own counter in LaTeX.

## § Figure and Table numbering

### § How do I number figures or tables by section?

In recent LyX versions: Go to Document→Settings→Modules and add the module "Number figures by section" or "Number tables by section", respectively.

In older LyX versions, add the following line to your LaTeX preamble:

\numberwithin{figure}{section}

or

\numberwithin{figure}{section}

(or put subsection etc. in place of section if that's what you want)

This second version requires amsmath, so make sure that "Use AMS math package" is selected in Document→Settings→Math Options.

See this FAQ.

\makeatletter
\makeatother

## § Other numbering

### § How do I get line numbers?

Load the lineno package in the preamble with the following command to get line numbers to the left of every fifth line:
\usepackage[left,modulo]{lineno}

To get a line number next to each and every line leave out the arguments in the preamble:
\usepackage{lineno}

Warning: At this point you will not see any line numbering in the text. You have to proceed with one of the two following directives to actually place any line numbers in the document.

1. One way to place line numbers throughout the entire document is to include this in the preamble after loading the package:
\linenumbers

2. Another way, which can restrict line numbering to a subset of the document is to place the text you want numbered between the following commands in ERT:
\begin{linenumbers}
...
\end{linenumbers}
There are many options to the lineno package, documented in this PDF on CTAN.

<< | FAQ.PageList | >>