Browse Source

Do some formatting of table and figure captions

Table and figure captions are not fully processed.  Now we at least do
basic formatting, but links and footnotes still do not work.
Carsten Dominik 15 years ago
parent
commit
313f01d297
4 changed files with 16 additions and 0 deletions
  1. 11 0
      lisp/ChangeLog
  2. 1 0
      lisp/org-docbook.el
  3. 2 0
      lisp/org-html.el
  4. 2 0
      lisp/org-latex.el

+ 11 - 0
lisp/ChangeLog

@@ -1,3 +1,14 @@
+2010-03-29  Carsten Dominik  <carsten.dominik@gmail.com>
+
+	* org-docbook.el (org-export-docbook-format-image): Do some
+	formatting on captions.
+
+	* org-latex.el (org-export-latex-tables, org-export-latex-links):
+	Do some formatting on captions.
+
+	* org-html.el (org-export-html-format-image)
+	(org-format-org-table-html): Do some formatting on captions.
+
 2010-03-28  Dan Davison  <davison@stats.ox.ac.uk>
 
 	* org.el (org-hidden-keywords): New customizable variable. This is

+ 1 - 0
lisp/org-docbook.el

@@ -1325,6 +1325,7 @@ string, don't modify these."
 	   (label (org-find-text-property-in-string 'org-label src))
 	   (default-attr org-export-docbook-default-image-attributes)
 	   tmp)
+      (setq caption (and caption (org-html-do-expand caption)))
       (while (setq tmp (pop default-attr))
 	(if (not (string-match (concat (car tmp) "=") attr))
 	    (setq attr (concat attr " " (car tmp) "=" (cdr tmp)))))

+ 2 - 0
lisp/org-html.el

@@ -1524,6 +1524,7 @@ lang=\"%s\" xml:lang=\"%s\">
       (let* ((caption (org-find-text-property-in-string 'org-caption src))
 	     (attr (org-find-text-property-in-string 'org-attributes src))
 	     (label (org-find-text-property-in-string 'org-label src)))
+	(setq caption (and caption (org-html-do-expand caption)))
 	(concat
 	(if caption
 	    (format "%s<div %sclass=\"figure\">
@@ -1618,6 +1619,7 @@ lang=\"%s\" xml:lang=\"%s\">
 
 	 (nline 0) fnum i
 	 tbopen line fields html gr colgropen rowstart rowend)
+    (setq caption (and caption (org-html-do-expand caption)))
     (if splice (setq head nil))
     (unless splice (push (if head "<thead>" "<tbody>") html))
     (setq tbopen t)

+ 2 - 0
lisp/org-latex.el

@@ -1588,6 +1588,7 @@ The conversion is made depending of STRING-BEFORE and STRING-AFTER."
                              (string-match "\\<align=\\([^ \t\n\r,]+\\)" attr)
                              (match-string 1 attr))
                   floatp (or caption label))
+	    (setq caption (and caption (org-export-latex-content caption)))
             (setq lines (org-split-string raw-table "\n"))
             (apply 'delete-region (list beg end))
             (when org-export-table-remove-special-lines
@@ -1844,6 +1845,7 @@ The conversion is made depending of STRING-BEFORE and STRING-AFTER."
 				       raw-path))))))))
        ;; process with link inserting
        (apply 'delete-region remove)
+       (setq caption (and caption (org-export-latex-content caption)))
        (cond ((and imgp
 		   (plist-get org-export-latex-options-plist :inline-images))
 	      ;; OK, we need to inline an image