[Top][All Lists]

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

Re: [O] Add ability to force-enable TOC

From: Kaushal Modi
Subject: Re: [O] Add ability to force-enable TOC
Date: Tue, 19 Sep 2017 15:00:17 +0000

On Tue, Sep 19, 2017 at 10:49 AM Kaushal Modi <address@hidden> wrote:
Can we enforce the TOC generation using the "toc:" option. Below does not work at the moment, but would like that to work.

#+OPTIONS: num:nil H:4 toc:4  

Above works after the below patch:

diff --git a/lisp/ox.el b/lisp/ox.el
index 2be77a87b33..1831432df87 100644
--- a/lisp/ox.el
+++ b/lisp/ox.el
@@ -5227,7 +5227,8 @@ Footnote sections and unnumbered headlines are ignored."
     (org-element-map (org-element-contents scope) 'headline
       (lambda (headline)
  (unless (or (org-element-property :footnote-section-p headline)
-    (not (org-export-numbered-headline-p headline info)))
+    (and (null (plist-get info :with-toc))
+ (not (org-export-numbered-headline-p headline info))))
   (let ((level (org-export-get-relative-level headline info)))
     (and (<= level n) headline))))

But I am pretty sure that's not the right way as the default value of org-export-with-toc is t. 

Kaushal Modi

reply via email to

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