Browse Source

LaTeX export: Fix problem with image names containing underscore

Reported by Arne Freyberger.
Carsten Dominik 16 years ago
parent
commit
56cf00c9bc
3 changed files with 11 additions and 3 deletions
  1. 4 0
      lisp/ChangeLog
  2. 4 2
      lisp/org-exp.el
  3. 3 1
      lisp/org-latex.el

+ 4 - 0
lisp/ChangeLog

@@ -1,7 +1,11 @@
 2009-06-23  Carsten Dominik  <carsten.dominik@gmail.com>
 
+	* org-latex.el (org-export-latex-links): Check for no-description
+	marking.
+
 	* org-exp.el (org-export-preprocess-apply-macros): Switch macro
 	argument separator back to comma.
+	(org-export-normalize-links): Mark links without description.
 
 2009-06-22  Carsten Dominik  <carsten.dominik@gmail.com>
 

+ 4 - 2
lisp/org-exp.el

@@ -1800,7 +1800,8 @@ When it is nil, all comments will be removed."
 (defun org-export-normalize-links ()
   "Convert all links to bracket links, and expand link abbreviations."
   (let ((re-plain-link (concat "\\([^[<]\\)" org-plain-link-re))
-	(re-angle-link (concat "\\([^[]\\)" org-angle-link-re)))
+	(re-angle-link (concat "\\([^[]\\)" org-angle-link-re))
+	nodesc)
     (goto-char (point-min))
     (while (re-search-forward re-plain-link nil t)
       (goto-char (1- (match-end 0)))
@@ -1821,13 +1822,14 @@ When it is nil, all comments will be removed."
     (goto-char (point-min))
     (while (re-search-forward org-bracket-link-regexp nil t)
       (goto-char (1- (match-end 0)))
+      (setq nodesc (not (match-end 3)))
       (org-if-unprotected
        (let* ((xx (save-match-data
 		    (org-translate-link
 		     (org-link-expand-abbrev (match-string 1)))))
 	      (s (concat
 		  "[[" (org-add-props (copy-sequence xx)
-			   nil 'org-protected t)
+			   nil 'org-protected t 'org-no-description nodesc)
 		  "]"
 		  (if (match-end 3)
 		      (match-string 2)

+ 3 - 1
lisp/org-latex.el

@@ -1450,7 +1450,9 @@ The conversion is made depending of STRING-BEFORE and STRING-AFTER."
 			      (expand-file-name
 			       raw-path)
 			      org-export-latex-inline-image-extensions)
-			     (equal desc full-raw-path))
+			     (or (get-text-property 0 'org-no-description
+						    raw-path)
+				 (equal desc full-raw-path)))
 			(setq imgp t)
 		      (progn (when (string-match "\\(.+\\)::.+" raw-path)
 			       (setq raw-path (match-string 1 raw-path)))