LyXmemoir | Partial ToC for Chapters

Information and discussion about LyX, a WYSIWYM editor, available for Linux, Windows and Mac OS X systems.
Post Reply
LKB
Posts: 19
Joined: Wed Jul 11, 2012 5:19 pm

memoir | Partial ToC for Chapters

Post by LKB »

I seem to be unable to create a partial ToC in front of each chapter in the memoir class. As the minitoc package was not working I decided to try titletoc. So at the beginning of each chapter I added

Code: Select all

\startcontents[chapters]
\printcontents[chapters]{}{1}{\contentsmargin{1em}}
But in every partial ToC I now get first the list of all ToC entries until particular chapter and then then my formated partial ToC (see attachment).

Any idea how can I remove first and last line? Or is there any other package I could use?
Attachments
Example of the problem.
Example of the problem.
LyX-minitoc.jpg (12.22 KiB) Viewed 4307 times
Last edited by localghost on Mon Aug 06, 2012 9:32 pm, edited 1 time in total.

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

localghost
Site Moderator
Posts: 9202
Joined: Fri Feb 02, 2007 12:06 pm

memoir | Partial ToC for Chapters

Post by localghost »

LKB wrote:[…] As the minitoc package was not working I decided to try titletoc. […]
The minitoc package is not compatible with the memoir class. But in Chapter 12 of its manual it introduces a patch in form of the small »mtcmempatch« package. Just include it in your document preamble. It is shipped with the package.

Disclaimer:
Since I'm not a LyX user, the above suggestions only represent an idea. I can't neither help with LyX in general nor with including packages into LyX.


Thorsten
LKB
Posts: 19
Joined: Wed Jul 11, 2012 5:19 pm

Re: memoir | Partial ToC for Chapters

Post by LKB »

Thank you for suggestion but I haven't had any success but managed to figure out few things:
1) \usepackage{mtcpatchmem} seems to make things worse
2) problem occurs in Memoir class only and I do not think its got anything to do with Lyx - other classes compile ok

What seems to happen is the wrong slicing of *.mtc . In my dummy test I should have ave MiniTOCtest.mtc[0-4] but when Memoir is used it becomes [0-5]. This way MiniTOC got moved between chapters and that's first chapter has no miniTOC, 2nd got miniTOC of first ect ect. Any suggestions how to fix this?
LKB
Posts: 19
Joined: Wed Jul 11, 2012 5:19 pm

memoir | Partial ToC for Chapters

Post by LKB »

I think I found a solution, using \setcounter{mtc}{2} which sets MiniTOC to proper mtc[0-4] file

Code: Select all

\usepackage{lipsum}
\usepackage{minitoc}
\makeatother

\begin{document}
\dominitoc %TOC

\tableofcontents{}
\chapter{One}
\setcounter{mtc}{2} %%set it to proper mtc[0-4] file
\minitoc\
\section{This is my goal}
\lipsum[1]
\section{This is my target}
\lipsum[2]


\end{document}
Last edited by Stefan Kottwitz on Fri Aug 10, 2012 8:16 am, edited 1 time in total.
Post Reply