emacs-orgmode
[Top][All Lists]
Advanced

[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

Re: [O] Table of contents for just one section?


From: Rasmus
Subject: Re: [O] Table of contents for just one section?
Date: Tue, 13 Jan 2015 11:21:34 +0100
User-agent: Gnus/5.13 (Gnus v5.13) Emacs/25.0.50 (gnu/linux)

Nicolas Goaziou <address@hidden> writes:

> Rasmus <address@hidden> 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.

—Rasmus

-- 
When in doubt, do it!




reply via email to

[Prev in Thread] Current Thread [Next in Thread]