From mboxrd@z Thu Jan 1 00:00:00 1970 From: Rasmus Subject: Re: Table of contents for just one section? Date: Sun, 11 Jan 2015 23:37:47 +0100 Message-ID: <87387h9c5g.fsf@gmx.us> References: <87wq7uzwmm.fsf@nicolasgoaziou.fr> <871tpvmekr.fsf@nicolasgoaziou.fr> <87mw8joylh.fsf@gmx.us> <8761f7dlxd.fsf@nicolasgoaziou.fr> <87egtuq3ih.fsf@gmx.us> <87y4p9dm2r.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]:52657) by lists.gnu.org with esmtp (Exim 4.71) (envelope-from ) id 1YAR97-0004DP-HU for emacs-orgmode@gnu.org; Sun, 11 Jan 2015 17:38:10 -0500 Received: from Debian-exim by eggs.gnu.org with spam-scanned (Exim 4.71) (envelope-from ) id 1YAR94-0002j4-87 for emacs-orgmode@gnu.org; Sun, 11 Jan 2015 17:38:09 -0500 Received: from plane.gmane.org ([80.91.229.3]:36291) by eggs.gnu.org with esmtp (Exim 4.71) (envelope-from ) id 1YAR94-0002j0-1P for emacs-orgmode@gnu.org; Sun, 11 Jan 2015 17:38:06 -0500 Received: from list by plane.gmane.org with local (Exim 4.69) (envelope-from ) id 1YAR8z-0003rk-Tu for emacs-orgmode@gnu.org; Sun, 11 Jan 2015 23:38:01 +0100 Received: from 46.166.186.236 ([46.166.186.236]) by main.gmane.org with esmtp (Gmexim 0.1 (Debian)) id 1AlnuQ-0007hv-00 for ; Sun, 11 Jan 2015 23:38:01 +0100 Received: from rasmus by 46.166.186.236 with local (Gmexim 0.1 (Debian)) id 1AlnuQ-0007hv-00 for ; Sun, 11 Jan 2015 23:38:01 +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 Nicolas Goaziou writes: > Hello, > > Rasmus writes: > >> Ah, it's much easier to use \stopcontents[level-i] to end contents >> collection. Revising the 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} >> \stopcontents[level-1] >> \chapter{c2} >> \section{s3} >> \stopcontents[level-0] >> \part{p2}\chapter{c3} >> \end{document} >> >> Note that the contents is determined by the .pcf file. Maybe that's >> easier to to understand than my babeling. Also, "pcf" should be >> added >> to `org-latex-logfiles-extensions'. > > Done. That looks cool! Thanks! One more thing. For LaTeX, *we must load titletoc before hyperref*. E.g. cf. here: http://tex.stackexchange.com/questions/79547/weird-behavior-of-partial-toc-with-titletoc Or just try this document: #+LATEX_HEADER: \usepackage{titletoc} * section 1 #+TOC: headlines 1 local ** sub 1 Which produces (in LaTeX): [full-TOC] 1. SECTION 1 section.1 ← artifact from loading after hyperref [sub-toc] 1.1 SUB 1 * Solutions 1. We could use org-latex-packages-alist but that's another forced dependency; ugh! 2. Alternatively, we could ensure that hyperref is always loaded last which is the almost-always safe rule of thumb rule anyway¹. Since we already have org-latex-hyperref-template we could drop hyperref from org-latex-packages-alist and make its presence implicit based on that variable. 3. Or we can add to the manual this deficit and advice how to solve it "manually". 4. It's also possible to solve it on the LaTeX side with something like \BeforePackage from KOMA-Script. Again, more dependencies. 5. We could provide placement mechanisms to #+LATEX_HEADER-keywords Of these I think 2. or 1. are the acceptable solutions. 1. is easier, but as adds more dependencies which sucks. So I prefer 2. WDYT? —Rasmus Footnotes: ¹ Exceptions, including some notable ones (it's a mess): http://tex.stackexchange.com/questions/1863/which-packages-should-be-loaded-after-hyperref-instead-of-before -- A page of history is worth a volume of logic