4

I'm using titlesec to manipulate title and section and other. Here is what I'm using:

\titleformat{\chapter}
    [frame]
    {\normalfont}
    {\filright \footnotesize \enspace LP \thechapter \enspace}
    {6pt}
    {\Large \bfseries \filcenter }

\titleformat{\section}%
  [hang]
  {\Large\bfseries\color{bleu}}
  {\thesection}
  {1em}
  {}

But in my PDF the section are numbered as 1.1 then 1.2 etc... I would like to suppress the chapter number and only have 1 section 1; 2 section 2 etc...

How can I do that while keeping the rest?

  • What about cross-references to the sections? Should they also appear as only 1, 2, ...? This may be misleading to the user since you'll have duplicate section numbers across chapters? – Werner Jun 1 '14 at 13:01
  • actually, every chapter is completly independant without any cross-references. That's why I don't think it's necessary to keep them. – sailx Jun 1 '14 at 13:02
7

By default, the section numbering would be done on a per-chapter basis with the chapter number included in the representation. In LaTeX terms, this is done using

\renewcommand{\thesection}{\thechapter.\arabic{section}}

In the above construction, \thesection is the way the section number is presented, and includes \thechapter (the way the chapter number is presented). So to remove the chapter from the section number, add

\renewcommand{\thesection}{\arabic{section}}

to your preamble.

|improve this answer|||||
  • Thank you! It's works exactly as I wanted and now I know how it works :) – sailx Jun 1 '14 at 13:07
  • Or, more simply, in your original code for \titleformat{\section}…, replace \thesection with \arabic{section}, or \arabic{section}. if you want a dot after the section number. – Bernard Jun 1 '14 at 13:46
  • @Bernard: While this might display correctly, any \labels set for the section will use \thesection as the reference which, by default, still includes the chapter number representation \thechapter. – Werner Jun 1 '14 at 15:17
  • @Werner: I often forget the references problem… – Bernard Jun 1 '14 at 15:47

Your Answer

By clicking “Post Your Answer”, you agree to our terms of service, privacy policy and cookie policy

Not the answer you're looking for? Browse other questions tagged or ask your own question.