From mboxrd@z Thu Jan 1 00:00:00 1970 From: Nicolas Goaziou Subject: Re: Table of contents for just one section? Date: Tue, 13 Jan 2015 10:30:58 +0100 Message-ID: <87387fdo31.fsf@nicolasgoaziou.fr> 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> Mime-Version: 1.0 Content-Type: text/plain Return-path: Received: from eggs.gnu.org ([2001:4830:134:3::10]:45813) by lists.gnu.org with esmtp (Exim 4.71) (envelope-from ) id 1YAxnX-0002kf-Eb for emacs-orgmode@gnu.org; Tue, 13 Jan 2015 04:30:04 -0500 Received: from Debian-exim by eggs.gnu.org with spam-scanned (Exim 4.71) (envelope-from ) id 1YAxnS-0005mQ-Cl for emacs-orgmode@gnu.org; Tue, 13 Jan 2015 04:30:03 -0500 Received: from relay6-d.mail.gandi.net ([2001:4b98:c:538::198]:46482) by eggs.gnu.org with esmtp (Exim 4.71) (envelope-from ) id 1YAxnS-0005lP-5z for emacs-orgmode@gnu.org; Tue, 13 Jan 2015 04:29:58 -0500 In-Reply-To: <87vbkbiica.fsf@pank.eu> (rasmus@gmx.us's message of "Tue, 13 Jan 2015 02:23:49 +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 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. IOW, this is orthogonal to the problem at hand. > Of course, but isn't it contradicting the docstring of > org-latex-default-packages-alist? No it isn't. It is a defcustom after all, and the manual can ensure the user knows what he is doing. > 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. Regards,