3

So I've come to the following problems while writing something in LaTeX, first, I want to have the numbering of a section of the output to be just a number not depending of the chapter. (not like 1.1, 1.2 etc)

i.e.

Chapter 1

  1. Section 1
  2. Section 2

Chapter 2

  1. Section 1 in chapter 2
  2. Section 2 in chapter 2

etc, but, on the TOC I want it to look like

Chapter 1

§1. Section 1
§2. Section 2

Chapter 2

§1. Section 1 in chapter 2

§2. Section 2 in chapter 2

To have the first one I used

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

with

\documentclass[leqno, 12pt, twoside,letterpaper]{book}

But I can't get the TOC with the symbol §, any help would be welcome. Thanks!

  • Can you show us a minimal working example? It is important to know which documentclass you are using. – Johannes_B Dec 15 '14 at 8:47
  • How do you want to reference to sections in the different chapters? Might be confusing for the reader. – Johannes_B Dec 15 '14 at 8:48
  • @Johannes_B The documentclass is \documentclass[leqno, 12pt, twoside,letterpaper]{book} I'll try to write an MWE later. – Aram Dec 15 '14 at 9:01
  • 1
    See packages titlesec and titletoc. – jmc Dec 15 '14 at 10:21
5

To have the number preceeded by the symbol § in the TOC, it suffices to to load the package tocloft and issue the command:

\renewcommand{\cftsecpresnum}{\S}

Complete MWE:

\documentclass[leqno,12pt,twoside,letterpaper]{book}

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

\usepackage{tocloft}
\renewcommand{\cftsecpresnum}{\S}

\begin{document}

\tableofcontents

\chapter{Test}
\section{Section 1}
\section{Section 2}

\chapter{Test}
\section{Section 1 in chapter 2}
\section{Section 2 in chapter 2}

\end{document} 

Output

enter image description here

Note that I've used

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

instead of yours

\renewcommand{\thesection}{\thepart \arabic{section}}
  • So this half helped me but I should have written the question differently, please can you see the edit? – Aram Dec 15 '14 at 19:51
  • Now sections numbering is totally independent of chapter, but I wanted to have sections in the following form 1 to 10 in the first chapter, sections 1 to 7 in the second chapter, etc, right now with your solution im getting section 1 to 10 in the first chapter, and sections 11 to 17 in the second chapter. – Aram Dec 15 '14 at 19:54
  • @Aram In this case \renewcommand{\thesection}{\arabic{section}} should do. – karlkoeller Dec 15 '14 at 20:10
  • @Aram You're welcome. I've changed the answer accordingly. – karlkoeller Dec 15 '14 at 20:15

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.