I'm using minitoc with a book class. At each chapter I print a minitoc using the minitoc package.
Is there any way to print it without the chapter number at each line. Something like
Chapter 2
minitoc :
section one .....
section two .....
instead of :
2.1. section one .....
2.2. section two .....
I couldn't find the right command to redefine which customize the \numberline
part on the mtc files!
MWE:
\documentclass{book}
\usepackage{minitoc}
\begin{document}
\dominitoc
\tableofcontents
\chapter{Introduction}
\chapter{chapter two}
\minitoc
\section{section one}
\section{section two}
\section{section three}
\end{document}
EDIT :
I'm not sure but it is some thing related to this macro. I don't figure how to change the value of #2 :
\def\MTC@contentsline#1#2#3#4{%
\gdef\themtc{\arabic{mtc}}%
\expandafter\ifx\csname #1\endcsname\chapter
\stepcounter{mtc}%
\if@mtc@longext@%
\mtcPackageInfo[I0033]{minitoc}%
{Writing\space\jobname.mtc\themtc\@gobble}%
\def\mtcname{\jobname.mtc\themtc}%
\else
\mtcPackageInfo[I0033]{minitoc}%
{Writing\space\jobname.M\themtc\@gobble}%
\def\mtcname{\jobname.M\themtc}%
\fi
\immediate\closeout\tf@mtc
\immediate\openout\tf@mtc=\mtcname
\fi
\expandafter\ifx\csname #1\endcsname\appendix
\stepcounter{mtc}%
\if@mtc@longext@%
\mtcPackageInfo[I0033]{minitoc}%
{Writing\space\jobname.mtc\themtc\@gobble}%
\def\mtcname{\jobname.mtc\themtc}%
\else
\mtcPackageInfo[I0033]{minitoc}%
{Writing\space\jobname.M\themtc\@gobble}%
\def\mtcname{\jobname.M\themtc}%
\fi
\immediate\closeout\tf@mtc
\immediate\openout\tf@mtc=\mtcname
\fi
\mtc@toks{\noexpand\leavevmode #2}%
\expandafter\ifx\csname #1\endcsname\section
\MTC@WriteContentsline{#1}{mtcS}{#3}{#4}%
\fi
\expandafter\ifx\csname #1\endcsname\subsection
\MTC@WriteContentsline{#1}{mtcSS}{#3}{#4}%
\fi
\expandafter\ifx\csname #1\endcsname\subsubsection
\MTC@WriteContentsline{#1}{mtcSSS}{#3}{#4}%
\fi
\expandafter\ifx\csname #1\endcsname\paragraph
\MTC@WriteContentsline{#1}{mtcP}{#3}{#4}%
\fi
\expandafter\ifx\csname #1\endcsname\subparagraph
\MTC@WriteContentsline{#1}{mtcSP}{#3}{#4}%
\fi
\expandafter\ifx\csname #1\endcsname\coffee
\MTC@WriteCoffeeline{#1}{#3}%
\fi
\expandafter\ifx\csname #1\endcsname\starchapter
\stepcounter{mtc}%
\if@mtc@longext@
\mtcPackageInfo[I0033]{minitoc}%
{Writing\space\jobname.mtc\themtc\@gobble}%
\def\mtcname{\jobname.mtc\themtc}%
\else
\mtcPackageInfo[I0033]{minitoc}%
{Writing\space\jobname.M\themtc\@gobble}%
\def\mtcname{\jobname.M\themtc}%
\fi
\immediate\closeout\tf@mtc
\immediate\openout\tf@mtc=\mtcname
\fi
\expandafter\ifx\csname #1\endcsname\starsection
\MTC@WriteContentsline{#1}{mtcS}{#3}{#4}%
\fi
\expandafter\ifx\csname #1\endcsname\starsubsection
\MTC@WriteContentsline{#1}{mtcSS}{#3}{#4}%
\fi
\expandafter\ifx\csname #1\endcsname\starsubsubsection
\MTC@WriteContentsline{#1}{mtcSSS}{#3}{#4}%
\fi
\expandafter\ifx\csname #1\endcsname\starparagraph
\MTC@WriteContentsline{#1}{mtcP}{#3}{#4}%
\fi
\expandafter\ifx\csname #1\endcsname\starsubparagraph
\MTC@WriteContentsline{#1}{mtcSP}{#3}{#4}%
\fi
}
This produces for example lines like this one:
{\reset@font\mtcSfont\mtc@string\contentsline{section}{\noexpand \leavevmode \numberline {2.1}section one .}{\reset@font\mtcSfont 5}}
\documentclass{...}
and ending with\end{document}
.\renewcommand{\thesection}{\arabic{section}}
, you get the expected result, but it will remove the chapter number everywhere the section is numbered (toc, titles ...).\begingroup \renewcommand{\thesection}{\arabic{section}} \minitoc \endgroup
should do it. (test it, and make it an answer if it works as proposed.) localizing things like this in a group is often a useful tactic.minitoc
. if that's just the same "line" in the.aux
file as is written out for the regular toc, then the situation becomes much more complicated. but this is a really nice question, and i'd like to see a good answer. (i'm surprised it hasn't gotten many upvotes.)