Edit: Okay, I worked longer on my issue. I isolated the issue and produced a very minimal code to reproduce the issue.

The following code does not produce what I wish.

  • Each chapter should contain a minitoc at the beginning.
  • Each section should start by tags which are linked to other section through hyperref and should end by a table of section containing a main tag of the section. For instance, if the sec1 define the tag 'a', then all sections referring to the tag 'a' should appear in this last table.

I produced a latex document able to do this. However, \tableof and \minitoc does not work long after the first call.

So there is an example what I want on the left, and what I have on the right : On the left, what I want. On the right, what I have

And here is the new code :



    %1 : title
    %2 : tags reference
    %3 : tags

    %tag the content
    \section[#1]{ \hypertarget{#2}{#1} }
    %for visual content

    % Keyword of the section
    \subsection[Table of tags]{Table of tags}

    \def\nextitem{\def\nextitem{, }}
    \renewcommand*{\do}[1]{\nextitem \hyperlink{##1}{##1} }
    \textbf{tags:} \docsvlist{ #1 }



\chapter{Ch 1}

    \sectionHead{Sec 1}{a}{a,b}



    \sectionHead{Sec 2}{b}{a,b}



    \sectionHead{Sec 3}{c}{c}



\chapter{Ch 2}

    \sectionHead{Sec 4}{d}{a,d}



    \sectionHead{Sec 5}{e}{e,f}



    \sectionHead{Sec 6}{f}{f,b}




Do you know how I should proceed to solve this ?

Edit: I tried the command

\setcounter{mtc}{*number of the chapter*}

without success.

  • 1
    \tableofcontents is defined by the common latex classes. What are you actually trying to do? What's your question? – Teepeemm Mar 11 '17 at 20:46
  • 4
    @ThomasAuriel: Welcome to TeX.SE. You should really provide a compilable example – user31729 Mar 11 '17 at 21:25
  • I made a minimal example. I manage to remove import and input function since they are not causing my issue. – ThomasAu Mar 13 '17 at 16:30
  • It seems to be a problem of tableof with \newpage after \tableof command. I don't know why? – touhami Mar 14 '17 at 14:48
  • @touhami Add Hello right before \end{document}. Else there is an \AtEndDocument command issued by tableof which remains without effet. The main toc file is lacking a \tof@finish at its very end. – user4686 Mar 14 '17 at 15:47

updated answer (october 2018)

Version 1.4b of tableof has been released to fix the root cause of this problem. (sorry for delay...)

original answer

(from comments)

There is a priori no incompatibility of tableof vs minitoc. The issue in your document comes from the fact that the last thing before \end{document} is a \newpage (as pointed out by @touhami). This means that \end{document} gets executed at a time the last page is already shipped out. This causes the loss of some instruction put by tableof in an \AtEndDocument command. As a result a macro is missing from the main toc file and you get the missing TOCs syndrom. The simplest is for the time being to avoid ending your document body with \newpage as the last thing. If this is unavoidable, then a not completely general workaround has been pointed out in comments.

| improve this answer | |

Your Answer

By clicking “Post Your Answer”, you agree to our terms of service, privacy policy and cookie policy

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