Take the 2-minute tour ×
TeX - LaTeX Stack Exchange is a question and answer site for users of TeX, LaTeX, ConTeXt, and related typesetting systems. It's 100% free, no registration required.

I'm looking for advise about handling sections a a special way. What I want:

  1. Sections should not be numbered,

  2. they should be listed in the TOC and be available in the page header,

  3. and they should have not left indention.

A very much abridged version of what I'm currently trying is this:

\documentclass{book}

% No section numbers.
\renewcommand{\thesection}{}

\begin{document}

\tableofcontents

\chapter{Foo}

% This section should be in the TOC and the page header.
\section{Bar}

Lorem ipsum dolor sit amet, consetetur sadipscing elitr, sed diam nonumy
eirmod tempor invidunt ut labore et dolore magna aliquyam erat, sed diam
voluptua. 

\end{document}

Unfortunately this does not produce the desired result. 1. and 2 work but 3. doesn't: the section titles have a left indention in the text.

How can I make all three requirenments work at the same time?

share|improve this question
add comment

1 Answer

up vote 8 down vote accepted

You only need to set the counter secnumdepth to 0:

\setcounter{secnumdepth}{0}

The value of this counter determines the depth of the numbering. 0 means until chapter, 1 means until section, 2 until subsection, etc.

This counter doesn't determine if the numbered or unnumbered section gets an entry into the table of contents. This can be customized in a similar way but with the counter tocdepth.

So to the requirements:

  1. Done by \setcounter{secnumdepth}{0}
  2. Ensured by a value of tocdepth of 1 or higher - no change needed, since 2 is default
  3. There's no indentation since there's no number and no reserved space for it.
share|improve this answer
    
Thank you, it works! –  user10883 Jan 25 '12 at 8:07
add comment

Your Answer

 
discard

By posting your answer, you agree to the privacy policy and terms of service.