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 a twocolumn document and I should insert the minitoc in the first chapters with titlesec and titletoc. I read the answer to Customize minitoc; however, if I change the \titleformat before appendices, all the sections of the appendix chapters will appear within the last minitoc:

\documentclass{book}
\usepackage{titlesec}
\usepackage{titletoc}

\newcommand\partialtocname{\contentsname}
% depending on this boolean, \chapter will create or not a partial ToC
\newif\ifchapterwithtoc
\chapterwithtocfalse

\titleformat{\chapter}[display]
  {\normalfont\huge\bfseries}{\chaptertitlename\ \thechapter}{20pt}{\Huge}
  [\ifchapterwithtoc
     \vspace*{2pc}\titlerule\vspace*{1pc}%
     \startcontents\vbox{\Large\partialtocname}\vskip1ex
     \printcontents{l}{1}{\setcounter{tocdepth}{1}}\vspace*{1pc}\titlerule%
   \else\fi%
  ]

\titlecontents*{lsection}[0pt]
{\small\normalfont}{\thecontentslabel\space}{}
{,~\itshape\thecontentspage}[\space\textbullet\space][.]
\titlecontents*{lsubsection}[0pt]{}{}{}{}

\begin{document}

\frontmatter
\chapter*{Acknowledgements}
\chapter*{Preface}
\tableofcontents

\mainmatter
\chapterwithtoctrue

\chapter{Chapter One}
\section{Section One One}
\section{Section One Two}
\section{Section One Three}

\chapter{Chapter Two}
\section{Section Two One}
\section{Section Two Two}

\appendix
\chapterwithtocfalse

\chapter{Appenix One}
\section{Section A One}
\section{Section A Two}
\chapter{Appenix Two}
\section{Section B One}
\section{Section B Two}

\end{document}

Any suggestion?

share|improve this question
    
Welcome to TeX.sx! No need to add thanks and signature to the post. Your user badge is automatically included in th epost and to thank any help, simply upvote any good answewr you may receive. This keeps our posts shorter. –  Peter Jansson Mar 2 '13 at 16:21
add comment

1 Answer

up vote 4 down vote accepted

To copy here what I already answered you your crosspost Switching off titletoc for some chapters on LaTeX-Community.org - you could use \stopcontents at the beginning of the appendix to prevent that the appendix sections would appear in the last minitoc:

\appendix
\chapterwithtocfalse
\stopcontents

\startcontents already stops the previous partial content, however to finally stop you need an explicit \stopcontents here.

share|improve this answer
add comment

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.