Text FormattingRemoving sections in a chapter from index

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

Removing sections in a chapter from index

Post by AleCes »

Hi
I know I can put a * before a section name to avoid it ending up in the index, but is there a cleaner way to set this action as a default for a whole chapter? Other chapters should not be affected.

My prologue:

Code: Select all

\documentclass[a4paper, 12pt, openany, draft]{book}
\usepackage{a4wide}
\usepackage{fontspec}
\usepackage{paralist}
\defaultfontfeatures{Mapping=tex-text}
\setmainfont{Tinos}
\usepackage{polyglossia}
\setmainlanguage{french}
\setotherlanguages{dutch, english, german, latin, italian, spanish}
\setotherlanguage[variant=ancient]{greek}
\usepackage{xunicode}
\usepackage{xltxtra}
\usepackage{bookmark}
\setcounter{tocdepth}{1}
\raggedbottom
\usepackage{soul}
\newfontfamily\greekfont[Script=Greek]{Tinos}
\newcommand{\og}{\guillemotleft}
\newcommand{\fg}{\guillemotright}
\usepackage{enumitem}
\setenumerate{nolistsep}
\setitemize{nolistsep, label=$-$}
\usepackage{footmisc}
%\setcounter{secnumdepth}{4}


\makeatletter
	\long \def \@makefntext #1%
		{%
			\noindent 
			\makebox [25pt][r]{\@thefnmark.\,}#1%
      	}
\makeatother

\renewcommand*\thesection{\arabic{section}}
\usepackage{fancyhdr}


\renewcommand{\sectionmark}[1]{\markright{#1}}

\usepackage{titlesec}
\setcounter{secnumdepth}{4}
\renewcommand*{\thesection}{\arabic{section}}
\renewcommand*{\thesubsubsection}{\alph{subsubsection}}
\titleformat{\subsection}[runin]{\normalfont\bfseries}{\thesubsection}{0.5em}{}[\quad]
\titleformat{\subsubsection}[runin]{\normalfont\bfseries}{\thesubsubsection)}{0.5em}{}[\qquad]
Thanks for your help

Recommended reading 2024:

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

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

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

Removing sections in a chapter from index

Post by Stefan Kottwitz »

You can use the tocvsec2 package for this,

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

Re: Removing sections in a chapter from index

Post by AleCes »

Hi Stefan
I just finished reading the pdf guide through and I must confess I didn't understand much about it. Can you please give me some basic explanations about how this works?
Thanks
User avatar
Stefan Kottwitz
Site Admin
Posts: 10345
Joined: Mon Mar 10, 2008 9:44 pm

Re: Removing sections in a chapter from index

Post by Stefan Kottwitz »

The way the package works is explained in section 2 with examples on pages 3 and 4. I don't know yet why to write another explanation.

Perhaps just try it, as described in the documentation, and if there's a problem then show what you did and we could have a look what might be wrong.

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

Removing sections in a chapter from index

Post by AleCes »

Stefan_K wrote:The way the package works is explained in section 2 with examples on pages 3 and 4. I don't know yet why to write another explanation.

Perhaps just try it, as described in the documentation, and if there's a problem then show what you did and we could have a look what might be wrong.

Stefan
You're right, it works. I just didn't know which example to use in particular.

Code: Select all

\usepackage{tocvsec2}
...
\begin{document}
\maxtocdepth{section}
...
\chapter{}
\settocdepth{chapter}
...
\resettochdepth
...
\end{document}
Thanks for your help
Post Reply