Search:   Help

Navigation

Groups

LyX documentation

Edit

Shared groups

Links

FAQ /

Numbering

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

Frequently Asked Question about Numbering, Pagination etc.

Table of contents (hide)

  1.   1.  Page numbers (Pagination)
    1.   1.1  How can I remove the page number from the first page?
    2.   1.2  How can I start page numbering on a different page?
    3.   1.3  How can I have roman pagination (i, ii, iii...) for the first part of my document?
    4.   1.4  How do I get headers on my index pages?
    5.   1.5  How can I get an empty pagestyle (no pagination) on a page where I have a big float?
  2.   2.  Section numbering
    1.   2.1  How can I set the starting number for a chapter or a section?
    2.   2.2  How can I remove section and subsection numbering in the output?
    3.   2.3  How can I remove section and subsection numbering in the output, but still have the sections appear in the table of contents?
    4.   2.4  How do I number sections by parts?
    5.   2.5  I'm only using sections, but they show as 0.1, 0.2 etc. How can I fix this?
    6.   2.6  How can I have alphabetic section labels (a, b, c..) instead of 1, 2, 3?
    7.   2.7  How can I start an appendix (section numbering A, B instead of 10, 11 ...)?
  3.   3.  List numbering
    1.   3.1  How do I get a formatted list which starts with e.g. 1. a)?
    2.   3.2  How can I set the starting number of an enumerated list?
    3.   3.3  How can I interrupt an enumerated list and resume the number later?
    4.   3.4  How can I change the type of counter used in an enumerated list?
    5.   3.5  How do I get enumerate to number all examples in a text sequentially?
  4.   4.  Equation numbering
    1.   4.1  How do I number equations by section?
    2.   4.2  How do I number equations globally?
    3.   4.3  Where can I get more information about equation numbering?
  5.   5.  Figure and Table numbering
    1.   5.1  How do I number figures or tables by section?
    2.   5.2  Why do longtables increment the table counter? How can I avoid that?
  6.   6.  Footnote numbering
    1.   6.1  How do I number footnotes by section?
    2.   6.2  How do I change to footnote numbers to symbols (star, dagger, etc.)?
  7.   7.  Other numbering
    1.   7.1  How do I get line numbers?

1.  Page numbers (Pagination)

§1.1  How can I remove the page number from the first page?

§1.2  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}.

§1.3  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}

§1.4  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}}

§1.5  How can I get an empty pagestyle (no pagination) on a page where I have a big float?

See unfloating figure on empty page

§2.  Section numbering

§2.1  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.

§2.2  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.

§2.3  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
  • use a Section* and add below in ERT \addcontentsline{toc}{section}{Section Name}

also cf. this FAQ entry

§2.4  How do I number sections by parts?

Add the following lines to your LaTeX preamble:

\makeatletter
\@addtoreset{section}{part}
\makeatother

§2.5  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).

§2.6  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.

§2.7  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.

§3.  List numbering

§3.1  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.

§3.2  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}

also see the example, uploads:/Examples/Setting_starting_number_of_enumerated_list.lyx

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

§3.3  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.

§3.4  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.

§3.5  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.

§4.  Equation numbering

§4.1  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.

§4.2  How do I number equations globally?

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

§4.3  Where can I get more information about equation numbering?

§5.  Figure and Table numbering

§5.1  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.

§5.2  Why do longtables increment the table counter? How can I avoid that?

See this FAQ.

§6.  Footnote numbering

§6.1  How do I number footnotes by section?

Add the following lines to your LaTeX preamble:

\makeatletter
\@addtoreset{footnote}{section}
\makeatother

§6.2  How do I change to footnote numbers to symbols (star, dagger, etc.)?

Add \renewcommand{\thefootnote}{\fnsymbol{footnote}} to your LaTeX preamble.

§7.  Other numbering

§7.1  How do I get line numbers?

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

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}
\linenumbers

These methods give line numbers throughout the entire document.

To restrict line numbering to a subset of the document remove \linenumbers and 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 Numbering Pagination

<< | FAQ.PageList | >>

Edit - History - Print - Recent Changes - All Recent Changes - Search
Page last modified on 2021-11-10 14:45 UTC