Page Layoutminitoc | Chapter ToCs shifted

Information and discussion about page layout specific issues (e.g. header and footer lines, page formats, page numbers).
Post Reply
nuanda
Posts: 1
Joined: Thu Nov 24, 2011 1:04 pm

minitoc | Chapter ToCs shifted

Post by nuanda »

Hi,

I am getting crazy with the minitoc package!! :)

The sub-indexes at the beginning of each chapter of my document are shifted : index of Chapter 2 at the beginning of Chapter 1 and so on....

I googled this problem and read the minitoc documentation but I could not find a solution. If anybody could help, it would be great !
Here is my template!
Note that that I do not want the abstract to appear in the general index, so there's a \chapter*{Abstract}

Code: Select all

\documentclass[a4paper,12pt,openright]{book}

% Config
\input{config}

\author{John Doe}

% Index making possible
\makeindex

\begin{document}

\frontmatter
\include{my_front_page}

\newpage

\newpage

% Fancy headers
\pagestyle{fancy}
\fancyhead{}
\fancyhead[LE]{\leftmark}
\fancyhead[RO]{\rightmark}
\cfoot{\thepage}
\renewcommand{\headrulewidth}{0.4pt}
\headheight 14pt

%========================================================
%Toc and minitoc
%========================================================

\doparttoc % minitoc stuff
\dominitoc
\adjustmtc

% Abstract
\chapter*{Abstract}
\phantomsection

\begingroup
%\hypersetup{linkcolor=red}
\tableofcontents
\listoffigures
\listoftables
\endgroup

\mainmatter

\include{intro}
		
\include{my_chap_2}
\newpage
\include{my_chap_3}
\newpage
\include{my_chap_4}
\newpage
\include{conclusion}
\newpage
\backmatter

\end{document}

Does anyone see why minitoc shifts the sub-indexes from this piece of code??

Thanks a lot!

Recommended reading 2024:

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

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

And: Currently, Packt sells ebooks for $4.99 each if you buy 5 of their over 1000 ebooks. If you choose only a single one, $9.99. How about combining 3 LaTeX books with Python, gnuplot, mathplotlib, Matlab, ChatGPT or other AI books? Epub and PDF. Bundle (3 books, add more for higher discount): https://packt.link/MDH5p

vsb1357
Posts: 11
Joined: Wed Jun 23, 2010 11:23 am

Re: minitoc | Chapter ToCs shifted

Post by vsb1357 »

I have the same problem too with the difference that the TOC of chapter 1 appears at the beginning of chapter 2 and so on! SO far haven't found a solution.
User avatar
localghost
Site Moderator
Posts: 9202
Joined: Fri Feb 02, 2007 12:06 pm

minitoc | Chapter ToCs shifted

Post by localghost »

Somehow I can't comprehend this problem. The below example generates a document with correct chapter ToCs.

Code: Select all

\documentclass[12pt]{report}
\usepackage[T1]{fontenc}
\usepackage{minitoc}
\usepackage{lipsum}

\setcounter{tocdepth}{0}

\begin{document}
  \dominitoc
  \tableofcontents

  \chapter{First Chapter}
    \minitoc

    \section{First Section of first Chapter}
      \lipsum[1-8]
    \section{Second Section of first Chapter}
      \lipsum[1-8]
    \section{Third Section of first Chapter}
      \lipsum[1-8]

  \chapter{Second Chapter}
    \minitoc

    \section{First Section of second Chapter}
      \lipsum[1-8]
    \section{Second Section of second Chapter}
      \lipsum[1-8]
    \section{Third Section of second Chapter}
      \lipsum[1-8]

  \chapter{Third Chapter}
    \minitoc

    \section{First Section of third Chapter}
      \lipsum[1-8]
    \section{Second Section of third Chapter}
      \lipsum[1-8]
    \section{Third Section of third Chapter}
      \lipsum[1-8]
\end{document}
You should show by a proper minimal example where the difficulties occur. This example has to be compilable as provided for everybody. Otherwise I'm pessimistic about specific help.


Best regards and welcome to the board
Thorsten
vsb1357
Posts: 11
Joined: Wed Jun 23, 2010 11:23 am

minitoc | Chapter ToCs shifted

Post by vsb1357 »

Here is a minimal example using memoir class. In the pdf output, I see no mini TOC at the beginning of chapter 1, miniTOC of chapter 1 at the beginning of chapter 2, miniTOC of chapter 2 in chapter 3 and miniTOC of chapter 3 cannot be found anywhere!

Code: Select all

\documentclass[12pt,a4paper,twoside,openright]{memoir}
%==========PREAMBLE=======================================================

\usepackage{graphicx}
\usepackage[bookmarks]{hyperref}
\usepackage{amsthm}
\usepackage{url}
\usepackage{minitoc}
\title{Title}
\author{Author}
%==========DOCUMENT=======================================================
\begin{document}
\maketitle			%have to be modified

\frontmatter   %begins greek numbered section

\begin{abstract}
my abstract

\end{abstract}
\newpage

\tableofcontents
\dominitoc
\mainmatter

%----------------------------------------------------------------------------
\chapter{This is Chapter 1} % top 
\label{ch:1}
\minitoc

\begin{abstract}
abstract1
\end{abstract}


\section{Introduction}

\section{Body1}

\subsection{Body1.1}

\subsection{Body1.2}

\section{Conclusion}

%----------------------------------------------------------------------------
\chapter{This is Chapter 2} % top 
\label{ch:2}
\minitoc

\begin{abstract}
abstract2
\end{abstract}

\section{Introduction}

\section{Body2}

\subsection{Body2.1}

\subsection{Body2.2}

\section{Conclusion}


%----------------------------------------------------------------------------
\chapter{This is Chapter 3} % top 
\label{ch:3}
\minitoc

\begin{abstract}
abstract3
\end{abstract}

\section{Introduction}

\section{Body3}

\subsection{Body3.1}

\subsection{Body3.2}

\section{Conclusion}


\end{document}
Last edited by Stefan Kottwitz on Thu Nov 24, 2011 9:35 pm, edited 1 time in total.
User avatar
localghost
Site Moderator
Posts: 9202
Joined: Fri Feb 02, 2007 12:06 pm

minitoc | Chapter ToCs shifted

Post by localghost »

vsb1357 wrote:Here is a minimal example using memoir class. […]
For an adequate problem description you should have given this important information right at the beginning. Otherwise a discussion is lengthened unnecessarily.

Check out Sections 2.22, 2.32, 9.10, 9.81.1.9 and Chapter 12 of the minitoc manual.
vsb1357
Posts: 11
Joined: Wed Jun 23, 2010 11:23 am

minitoc | Chapter ToCs shifted

Post by vsb1357 »

Thanks for the reply. I checked the minitoc manual and tried to apply those fixes and none of them worked. There is a patch in chapter 12 that is supposed to fix the compatibility issue between minitoc and meoir, but it just makes the chapter TOC to disapper. And I forgot to mention that I also use hyperref. Didn't know minitoc has issues with hyperref as well. So, after wasting considerable amount of time, I managed to find a solution on using memoir, hyperref and minitoc together. Here is the solution.

My header starts like this:

Code: Select all

\usepackage{graphicx}
\usepackage{amsthm}
\usepackage{url}
\usepackage{minitoc}
\usepackage[bookmarksdepth=subsection,plainpages=false]{hyperref}
\setcounter{minitocdepth}{1}
My main document is something like this:

Code: Select all

\begin{document}
\maketitle			
\frontmatter

\newpage

\tableofcontents

\dominitoc

\mainmatter

\input{Ch1}
\input{Ch2}
\input{Ch3}
\input{Ch4}
\input{Ch5}
\input{Ch6}
\input{Ch7}
\end{document}
I have 7 chapters and want to have minitoc at the beginning of Chapters 2-6. Chapter 2 should be like this:

Code: Select all

\chapter{CH. 2} 
\adjustmtc
\minitoc
And the rest:

Code: Select all

\chapter{CH. 3}
\minitoc

\chapter{CH. 4}
\minitoc

\chapter{CH. 5}
\minitoc

\chapter{CH. 6}
\minitoc
The \adjustmtc command fixes the issue I had with minitoc appearing in the wrong chapter. But does not let you use hyperref in this format:

Code: Select all

\usepackage[bookmarks]{hyperref}
But if you change the usage of hyperref to

Code: Select all

\usepackage[bookmarksdepth=subsection,plainpages=false]{hyperref}
all will be OK (unless I discover some weird problem somewhere else).
Post Reply