From d299ae53dd95a103905afed32722afc6a1e2e9bb Mon Sep 17 00:00:00 2001 From: Jonathan Leech-Pepin Date: Mon, 25 Feb 2013 10:14:53 -0500 Subject: [PATCH] ox-texinfo.el: Add support for @appendix headlines * lisp/ox-texinfo.el: Included support for appendices. To include appendices, use a non-nil value for the :APPENDIX: property of a headline. This headline will be exported at the appropriate level as an appendix. --- lisp/ox-texinfo.el | 17 +++++++++++++---- 1 file changed, 13 insertions(+), 4 deletions(-) diff --git a/lisp/ox-texinfo.el b/lisp/ox-texinfo.el index ef2789c94..536c2ee3b 100644 --- a/lisp/ox-texinfo.el +++ b/lisp/ox-texinfo.el @@ -907,6 +907,8 @@ holding contextual information." (class-sectionning (assoc class org-texinfo-classes)) ;; Find the index type, if any (index (org-element-property :INDEX headline)) + ;; Check if it is an appendix + (appendix (org-element-property :APPENDIX headline)) ;; Retrieve headline text (text (org-texinfo--sanitize-headline (org-element-property :title headline) info)) @@ -949,13 +951,20 @@ holding contextual information." ((stringp sec) sec) ;; (numbered-section . unnumbered-section) ((not (consp (cdr sec))) - ;; If an index, always unnumbered - (if index - (concat menu node (cdr sec) "\n%s") + (cond + ;;If an index, always unnumbered + (index + (concat menu node (cdr sec) "\n%s")) + (appendix + (concat menu node (replace-regexp-in-string + "unnumbered" + "appendix" + (cdr sec)) "\n%s")) ;; Otherwise number as needed. + (t (concat menu node (funcall - (if numberedp #'car #'cdr) sec) "\n%s")))))) + (if numberedp #'car #'cdr) sec) "\n%s"))))))) (todo (and (plist-get info :with-todo-keywords) (let ((todo (org-element-property :todo-keyword headline)))