[Tex/LaTex] In Lyx, “Part” section in Arabic numbers and numbering the rest of the sections accordingly

lyxnumberingsectioning

The default in lyx is to have

I. First part (roman number)

  1. Section 1

1.1 Subsection 1

and I'd like to have

  1. First part (arabic number)

1.1 Section 1

1.1.1 Subsection 1

etc.

Any suggestion? Thanks a lot in advance!

Best Answer

No idea if this is the preferred LyX way (I haven't really ever used it)… you can add

\renewcommand*\thepart{\arabic{part}}% arabic numbers for part
\makeatletter
\@addtoreset{section}{part}% reset section number when a new part starts
\makeatother
\renewcommand*\thesection{\thepart.\arabic{section}}% section 1.1
\renewcommand*\thesubsection{\thesection.\arabic{subsection}}% subsection 1.1.1

to your documents preamble. In LyX go to Document > Settings… > LaTeX Preamble.

This has one drawback, though: the WYSIWYG (WYM?) won't be WYG any more. In your editor the numbering stays as before. But in the PDF the numbering will have changed.

Edit (reply to the comment below): the following is assuming you're using the standard article class. In the article class the ToC entry for the section is controlled by \l@section. You can patch that command to change the space reserved for the section number. This again goes in the LaTeX preamble:

\usepackage{etoolbox}
\makeatletter
\patchcmd\l@section
  {\setlength\@tempdima{1.5em}}% this is default
  {\setlength\@tempdima{2em}}% this is new; change value to your needs
  {}{}
\makeatother