From mboxrd@z Thu Jan 1 00:00:00 1970 From: Rasmus Subject: Re: Table of contents for just one section? Date: Sun, 26 Oct 2014 12:32:42 +0100 Message-ID: <87mw8joylh.fsf@gmx.us> References: <87wq7uzwmm.fsf@nicolasgoaziou.fr> <871tpvmekr.fsf@nicolasgoaziou.fr> Mime-Version: 1.0 Content-Type: text/plain; charset=utf-8 Content-Transfer-Encoding: 8bit Return-path: Received: from eggs.gnu.org ([2001:4830:134:3::10]:42324) by lists.gnu.org with esmtp (Exim 4.71) (envelope-from ) id 1XiM4E-0008W5-GC for emacs-orgmode@gnu.org; Sun, 26 Oct 2014 07:33:08 -0400 Received: from Debian-exim by eggs.gnu.org with spam-scanned (Exim 4.71) (envelope-from ) id 1XiM48-0001fw-Fh for emacs-orgmode@gnu.org; Sun, 26 Oct 2014 07:33:02 -0400 Received: from plane.gmane.org ([80.91.229.3]:46362) by eggs.gnu.org with esmtp (Exim 4.71) (envelope-from ) id 1XiM48-0001fr-8R for emacs-orgmode@gnu.org; Sun, 26 Oct 2014 07:32:56 -0400 Received: from list by plane.gmane.org with local (Exim 4.69) (envelope-from ) id 1XiM46-0000q1-Ll for emacs-orgmode@gnu.org; Sun, 26 Oct 2014 12:32:54 +0100 Received: from 217.130.110.20 ([217.130.110.20]) by main.gmane.org with esmtp (Gmexim 0.1 (Debian)) id 1AlnuQ-0007hv-00 for ; Sun, 26 Oct 2014 12:32:54 +0100 Received: from rasmus by 217.130.110.20 with local (Gmexim 0.1 (Debian)) id 1AlnuQ-0007hv-00 for ; Sun, 26 Oct 2014 12:32:54 +0100 List-Id: "General discussions about Org-mode." List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , Errors-To: emacs-orgmode-bounces+geo-emacs-orgmode=m.gmane.org@gnu.org Sender: emacs-orgmode-bounces+geo-emacs-orgmode=m.gmane.org@gnu.org To: emacs-orgmode@gnu.org Hi, Nicolas Goaziou writes: > I skipped latex because using minitoc looks too tricky to > automate. Sorry, I didn't see this when I posted my other post. I think we can do it with titletoc. I have used other functionality of titletoc, and it 'doesn't sucks'ᵀᴹ. Below is an example. The output is more inline with normal tocs, but you can also style it [I've used this for making paragraph-TOCs in the past]. So ox-latex needs to insert at least the following to initialize a local TOC \startcontents[ID-level] % need not be unique and might not be neceasary \printcontents[ID-level]{}{(1+ level)}{TOC OPTIONS} And, importantly — and mildely annoyingly — \startcontents[ID] *after* the next heading of the same level. There are some preamble options, but since we are doing it programically, it might be safer to insert it into the body. It seems it need not be same unique ID. An example: \documentclass{book} \usepackage{titletoc} \begin{document} \part{p1} \startcontents[level-0] \printcontents[level-0]{}{0}{\setcounter{tocdepth}{2}} \chapter{c1} \startcontents[level-1] \printcontents[level-1]{}{1}{\setcounter{tocdepth}{1}} \section{s1} \subsection{s2} \chapter{c2} \startcontents[level-1] \section{s3} \part{p2} \startcontents[level-0] \chapter{c3} \end{document} The only "challenge" is to insert \startcontents[ID] in the next headline of same level. The brute force method would be very bad. Maybe doing it like section numbers are determined? Let me know what you think and whether you will do it. —Rasmus -- What will be next?