Explorar o código

org-odt.el: Make label references consistent with LaTeX export

* lisp/org-odt.el (org-odt-label-styles): Add a new style.
(org-odt-category-map-alist):  Use it.

Andreas Leha writes:

The following snippet exports correctly to LaTeX and to html, but
produces the text "Figure Figure" in odt.

Could the behaviour be synchronized?

=== example.org ==========================
* Test ref
  plot(1:10, 1:10)

Here is a reference to Figure \ref{fig:bar}
=== example.org ==========================
Jambunathan K %!s(int64=13) %!d(string=hai) anos
pai
achega
f24dbe15c1
Modificáronse 1 ficheiros con 9 adicións e 4 borrados
  1. 9 4
      lisp/org-odt.el

+ 9 - 4
lisp/org-odt.el

@@ -2017,7 +2017,8 @@ See `org-odt-entity-labels-alist' for known CATEGORY-NAMEs.")
 
 
 (defvar org-odt-label-styles
 (defvar org-odt-label-styles
   '(("text" "(%n)" "text" "(%n)")
   '(("text" "(%n)" "text" "(%n)")
-    ("category-and-value" "%e %n%c" "category-and-value" "%e %n"))
+    ("category-and-value" "%e %n%c" "category-and-value" "%e %n")
+    ("value" "%e %n%c" "value" "%n"))
   "Specify how labels are applied and referenced.
   "Specify how labels are applied and referenced.
 This is an alist where each element is of the
 This is an alist where each element is of the
 form (LABEL-STYLE-NAME LABEL-ATTACH-FMT LABEL-REF-MODE
 form (LABEL-STYLE-NAME LABEL-ATTACH-FMT LABEL-REF-MODE
@@ -2039,10 +2040,14 @@ specifiers - %e and %n.  %e is replaced with the CATEGORY-NAME.
 `org-odt-format-label-reference'.")
 `org-odt-format-label-reference'.")
 
 
 (defvar org-odt-category-map-alist
 (defvar org-odt-category-map-alist
-  '(("__Table__" "Table" "category-and-value")
-    ("__Figure__" "Figure" "category-and-value")
+  '(("__Table__" "Table" "value")
+    ("__Figure__" "Figure" "value")
     ("__MathFormula__" "Equation" "text")
     ("__MathFormula__" "Equation" "text")
-    ("__DvipngImage__" "Equation" "category-and-value"))
+    ("__DvipngImage__" "Equation" "value")
+    ;; ("__Table__" "Table" "category-and-value")
+    ;; ("__Figure__" "Figure" "category-and-value")
+    ;; ("__DvipngImage__" "Equation" "category-and-value")
+    )
   "Map a CATEGORY-HANDLE to CATEGORY-NAME and LABEL-STYLE.
   "Map a CATEGORY-HANDLE to CATEGORY-NAME and LABEL-STYLE.
 This is an alist where each element is of the form
 This is an alist where each element is of the form
 \\(CATEGORY-HANDLE CATEGORY-NAME LABEL-STYLE\\).  CATEGORY_HANDLE
 \\(CATEGORY-HANDLE CATEGORY-NAME LABEL-STYLE\\).  CATEGORY_HANDLE