From 8951c689a7812d6557ba65888e549013814e5f8a Mon Sep 17 00:00:00 2001 From: Rasmus Date: Wed, 15 Apr 2015 21:50:53 +0200 Subject: [PATCH 2/2] ox: Change label naming scheme * ox.el (org-export-get-reference): Change labeling scheme. 160820bc94 and later changed the label naming scheme to follow types. This commit maps to types to more standard names, e.g. 'headline' to 'sec'. --- lisp/ox.el | 13 +++++++++++-- 1 file changed, 11 insertions(+), 2 deletions(-) diff --git a/lisp/ox.el b/lisp/ox.el index d6dcc82..f7d0ef5 100644 --- a/lisp/ox.el +++ b/lisp/ox.el @@ -4149,9 +4149,18 @@ alphanumeric characters only." h)))) (or (gethash datum cache) (puthash datum - (format "org%s%d" + (format "%s:%d" (if type - (replace-regexp-in-string "-" "" (symbol-name type)) + (case type + (headline "sec") + (paragraph + (if (org-element-property :caption datum) + "fig" "paragraph")) + (latex-environment "eq") + (table "tbl") + (otherwise + (replace-regexp-in-string "-" "" + (symbol-name type)))) "secondarystring") (incf (gethash type cache 0))) cache)))) -- 2.3.5