From mboxrd@z Thu Jan 1 00:00:00 1970 From: Rasmus Subject: Re: Table of contents for just one section? Date: Tue, 13 Jan 2015 11:21:34 +0100 Message-ID: <87oaq36kwh.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> <87387h9c5g.fsf@gmx.us> <87ppake6mr.fsf@nicolasgoaziou.fr> <87sifgi8fe.fsf@gmx.us> <877fwregpu.fsf@nicolasgoaziou.fr> <87vbkbiica.fsf@pank.eu> <87387fdo31.fsf@nicolasgoaziou.fr> 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]:57569) by lists.gnu.org with esmtp (Exim 4.71) (envelope-from ) id 1YAybV-0000fl-V8 for emacs-orgmode@gnu.org; Tue, 13 Jan 2015 05:21:42 -0500 Received: from Debian-exim by eggs.gnu.org with spam-scanned (Exim 4.71) (envelope-from ) id 1YAybR-0007qn-VV for emacs-orgmode@gnu.org; Tue, 13 Jan 2015 05:21:41 -0500 Received: from mout.gmx.net ([212.227.15.15]:57625) by eggs.gnu.org with esmtp (Exim 4.71) (envelope-from ) id 1YAybR-0007pl-KB for emacs-orgmode@gnu.org; Tue, 13 Jan 2015 05:21:37 -0500 Received: from W530 ([109.201.154.154]) by mail.gmx.com (mrgmx002) with ESMTPSA (Nemesis) id 0M1Ee8-1XvNay2uCG-00tBZF for ; Tue, 13 Jan 2015 11:21:36 +0100 In-Reply-To: <87387fdo31.fsf@nicolasgoaziou.fr> (Nicolas Goaziou's message of "Tue, 13 Jan 2015 10:30:58 +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: > Rasmus writes: > >> As said, I'd prefer load hyperref via org-latex-hyperref-template, but >> it's probably too big a change too late. Though, it would resolve the >> "issue" that if I do >> >> (setq org-latex-default-packages-alist >> (delete '("" "hyperref" nil) >> org-latex-default-packages-alist)) >> >> Hypersetup is still inserted. > > The issue is not to remove hyperref, which is a default package for > a good reason. The problem is to require titletoc before hyperref. I was putting this to further support another solution, namely moving hyperref to a single defcustom, allowing hyperref to be inserted after all other header-lines. > IOW, this is orthogonal to the problem at hand. I disagree. >> Unless I've managed to convenience you otherwise I will add a footnote >> explaining and recommending the following snippet >> >> (with-eval-after-load 'ox-latex >> (require 'cl) >> (let* ((packages (mapcar (lambda (elt) (and (listp elt) (nth 1 elt))) >> org-latex-default-packages-alist)) >> (pos (position "hyperref" packages :test 'equal)) >> (titletocp (member "titletoc" packages))) >> (when (and pos (not titletocp)) >> (push '("" "titletoc" nil) >> (nthcdr pos org-latex-default-packages-alist))))) > > It is way too opaque IMO. Suggesting to put ("" "titletoc" nil) before > ("" hyperref nil) should be enough. That's what it does... But without the need of having a direct copy of org-latex-default-packages-alist in your init.el. I'm not suggesting to put the snippet there without any prose. =E2=80=94Rasmus --=20 When in doubt, do it!