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 have managed to create a minitoc at the start of a chapter and added section* to the minitoc. However I wanted a solution that those section with a star are only visible in the minitoc and not the normal table of contents. How can I realize this?

\documentclass[a4paper,10pt]{report}
\usepackage{minitoc}
\begin{document}
\dominitoc
\tableofcontents %In this table of contents only the sections without a star section{} and not section*{}

\chapter{Title chapter 1}
\section{Title of subsection one}
content... 

\section{Title of subsection two}
content.... 

\chapter{Title chapter 2} 
\minitoc %In this table of contents all sections also section*{}. 

\section{Title of subsection one}
\addcontentsline{toc}{section}{Title of subsection one}
content...

\section{Title of subsection two}
content...
\end{document}
share|improve this question
    
Welcome to TeX.sx! Please add a minimal working example (MWE) that illustrates your problem. It will be much easier for us to reproduce your situation and find out what the issue is when we see compilable code, starting with \documentclass{...} and ending with \end{document}. –  lockstep Nov 29 '12 at 13:28
    
\documentclass[a4paper,10pt]{report} \usepackage{minitoc} \begin{document} \dominitoc \tableofcontents %In this table of contents only the sections without a star section{} and not section*{} \chapter{Title chapter 1} \section{Title of subsection one} content... \section{Title of subsection two} content.... \chapter{Title chapter 2} \minitoc %In this table of contents all sections also section*{}. \section{Title of subsection one} \addcontentsline{toc}{section}{Title of subsection one} content... \section{Title of subsection two} content... \end{document} –  Ruud Nov 29 '12 at 15:15
    
You can edit your question, so rather than adding new information (such as MWEs) in comments, add it to the question itself. You can highlight code by selecting it and clicking the {} button above the text field. –  Torbjørn T. Nov 29 '12 at 15:33

1 Answer 1

Here's one possible solution using the titletoc package; the idea is to use \addcontentsline with extension ptc (the default extension used by titletoc for the partial ToCs) to include information in the partial ToC only:

\documentclass{book}
\usepackage{titletoc}

\begin{document}

\tableofcontents

\startcontents
\chapter{Test Chapter}
\printcontents{}{1}{}

\section{Test Numbered Section}
\section*{Test Unnumbered Section}
\addcontentsline{ptc}{section}{Test Unnumbered Section}
\section{Another Test Numbered Section}
\section*{Another Test Unnumbered Section}
\addcontentsline{ptc}{section}{Another Test Unnumbered Section}

\end{document}

An image of the general ToC:

enter image description here

An image of the partial ToC at the beginning of the chapter:

enter image description here

share|improve this answer

Your Answer

 
discard

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

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