浏览代码

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.
Jonathan Leech-Pepin 12 年之前
父节点
当前提交
d299ae53dd
共有 1 个文件被更改,包括 13 次插入4 次删除
  1. 13 4
      lisp/ox-texinfo.el

+ 13 - 4
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)))