From mboxrd@z Thu Jan 1 00:00:00 1970 From: Nicolas Goaziou Subject: Re: Table of contents for just one section? Date: Sun, 26 Oct 2014 14:01:50 +0100 Message-ID: <8761f7dlxd.fsf@nicolasgoaziou.fr> References: <87wq7uzwmm.fsf@nicolasgoaziou.fr> <871tpvmekr.fsf@nicolasgoaziou.fr> <87mw8joylh.fsf@gmx.us> Mime-Version: 1.0 Content-Type: text/plain; charset=utf-8 Content-Transfer-Encoding: quoted-printable Return-path: Received: from eggs.gnu.org ([2001:4830:134:3::10]:53231) by lists.gnu.org with esmtp (Exim 4.71) (envelope-from ) id 1XiNRX-0004ac-Me for emacs-orgmode@gnu.org; Sun, 26 Oct 2014 09:01:19 -0400 Received: from Debian-exim by eggs.gnu.org with spam-scanned (Exim 4.71) (envelope-from ) id 1XiNRP-0000uB-Ke for emacs-orgmode@gnu.org; Sun, 26 Oct 2014 09:01:11 -0400 Received: from relay6-d.mail.gandi.net ([2001:4b98:c:538::198]:46425) by eggs.gnu.org with esmtp (Exim 4.71) (envelope-from ) id 1XiNRP-0000u1-FV for emacs-orgmode@gnu.org; Sun, 26 Oct 2014 09:01:03 -0400 In-Reply-To: <87mw8joylh.fsf@gmx.us> (rasmus@gmx.us's message of "Sun, 26 Oct 2014 12:32:42 +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: Rasmus Cc: emacs-orgmode@gnu.org Hello, Rasmus writes: > I think we can do it with titletoc. I have used other functionality > of titletoc, and it 'doesn't sucks'=E1=B5=80=E1=B4=B9. Below is an examp= le. 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 neceasa= ry > \printcontents[ID-level]{}{(1+ level)}{TOC OPTIONS} > > And, importantly =E2=80=94 and mildely annoyingly =E2=80=94 \startcontent= s[ID] *after* > the next heading of the same level. I don't quite get this part. Does that string need to be inserted only after the second sibling (i.e., not after the third, too)? What happens if there is no other sibling? > There are some preamble options, but since we are doing it > programically, it might be safer to insert it into the body. The patch will not insert "\usepackage{titletoc}" for the user, however, =C3=A0 la `org-latex-listings'. > 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. What do you call the "brute force"? > Maybe doing it like section numbers are determined? What do you mean? > Let me know what you think and whether you will do it. I can try to implement it. I also note that these tocs do not have any title. Would it make sense to remove title from local tocs in other back-ends too? Thanks for your feedback. Regards, --=20 Nicolas Goaziou