Text FormattingExclude numbered Sections from ToC

Information and discussion about LaTeX's general text formatting features (e.g. bold, italic, enumerations, ...)
Post Reply
AleCes
Posts: 286
Joined: Sat Nov 13, 2010 9:54 pm

Exclude numbered Sections from ToC

Post by AleCes »

Hi there,

Is there a way for getting automatically numbered sections that still don't go into the ToC without adding * and manually inserting numbers?

Regards

Recommended reading 2024:

LaTeXguide.org • LaTeX-Cookbook.net • TikZ.org

NEW: TikZ book now 40% off at Amazon.com for a short time.

localghost
Site Moderator
Posts: 9202
Joined: Fri Feb 02, 2007 12:06 pm

Exclude numbered Sections from ToC

Post by localghost »

AleCes wrote:[…] Is there a way for getting automatically numbered sections that still don't go into the ToC without adding * and manually inserting numbers? […]
Yes, there is.


Thorsten
AleCes
Posts: 286
Joined: Sat Nov 13, 2010 9:54 pm

Exclude numbered Sections from ToC

Post by AleCes »

No, wait localghost, I didn't think you need a working example for this, it's just a general question! However, here is my basic example:

Code: Select all

\documentclass[a4paper, 12pt, oneside, openany]{book}
\usepackage{fontspec}
\defaultfontfeatures{Mapping=tex-text}
\setmainfont{FreeSerif}
\usepackage{polyglossia}
\setmainlanguage{english}
\usepackage{xunicode}
\usepackage{xltxtra}
Regards
User avatar
localghost
Site Moderator
Posts: 9202
Joined: Fri Feb 02, 2007 12:06 pm

Exclude numbered Sections from ToC

Post by localghost »

AleCes wrote:[…] it's just a general question![…]
And you got a general answer.

What you provided is not a minimal example. How often do we have to ask for self-contained examples and adequate problem descriptions? You are not new to the forum, so you should know how to ask questions in the right way. But instead you only provide a useless snippet of code (once again).

An adequate problem description consists at least of the following information.
  • The aforementioned self-contained and minimal example.
  • An exact description of what has been tried so far as well as occurring problems.
  • And as a possible result targeted questions about how to fix those problems.
At the moment I can only ask back if you want to exclude only certain sections or all from the ToC. See you later after you've done your homework.
AleCes
Posts: 286
Joined: Sat Nov 13, 2010 9:54 pm

Exclude numbered Sections from ToC

Post by AleCes »

Oh, wait, the example is indeed incomplete, but something must have been lost in the meanders of the net... anyhow here's the missing part:

Code: Select all

\begin{document}

\chapter{}

\section{} %normal sections with automatic numeration that go into the TOC

\section{}

\chapter{}

\section*{2.1} % I want to avoid writing those pesky numbers 

\section*{2.2} % without those sections going into the TOC

\end{document}

User avatar
Stefan Kottwitz
Site Admin
Posts: 10345
Joined: Mon Mar 10, 2008 9:44 pm

Exclude numbered Sections from ToC

Post by Stefan Kottwitz »

You can use tocvsec2 for this.

Stefan
LaTeX.org admin
AleCes
Posts: 286
Joined: Sat Nov 13, 2010 9:54 pm

Exclude numbered Sections from ToC

Post by AleCes »

Stefan_K wrote:You can use tocvsec2 for this.

Stefan
The manual is kind of cryptic to me. Could you please be of help to me? 8-)
User avatar
localghost
Site Moderator
Posts: 9202
Joined: Fri Feb 02, 2007 12:06 pm

Exclude numbered Sections from ToC

Post by localghost »

AleCes wrote:The manual is kind of cryptic to me. […]
Section 2.1 of the tocvsec2 manual describes the necessary command(s) and has a very simple example which you only need to adapt to your document. Just choose chapter as level and put the command where needed. The application of the package couldn't be explained easier here.


Thorsten
AleCes
Posts: 286
Joined: Sat Nov 13, 2010 9:54 pm

Exclude numbered Sections from ToC

Post by AleCes »

localghost wrote:
AleCes wrote:The manual is kind of cryptic to me. […]
Section 2.1 of the tocvsec2 manual describes the necessary command(s) and has a very simple example which you only need to adapt to your document. Just choose chapter as level and put the command where needed. The application of the package couldn't be explained easier here.


Thorsten
OK, thanks for your help, by cryptic I meant I couldn't get to locate the matter in the manual.
Post Reply