浏览代码

Change underscores to hyphens in section labels

* lisp/org-exp.el (org-export-define-heading-targets): Use dash instead
of underscore to make labels valid.

Currently, the section number (a string of the form "X.Y.Z") is used
to manufacture a section label of the form sec-X_Y_Z. Underscores are
overloaded however, both in org and in LaTeX, and cause conflicts with
some packages.  This patch changes underscores to hyphens in section
labels.

TINYCHANGE
Nick Dokos 14 年之前
父节点
当前提交
438536f615
共有 1 个文件被更改,包括 1 次插入1 次删除
  1. 1 1
      lisp/org-exp.el

+ 1 - 1
lisp/org-exp.el

@@ -1298,7 +1298,7 @@ Also find all ID and CUSTOM_ID properties and store them."
 				       (org-outline-level))))
 	  (setq target (org-solidify-link-text
 			(format "sec-%s" (replace-regexp-in-string
-					  "\\." "_"
+					  "\\." "-"
 					  (org-section-number level)))))
 	  (setq last-section-target target)
 	  (push (cons target target) target-alist)