From 56cf00c9bc274dafc8617b96000e51be972eedf0 Mon Sep 17 00:00:00 2001 From: Carsten Dominik Date: Tue, 23 Jun 2009 06:15:01 +0200 Subject: [PATCH] LaTeX export: Fix problem with image names containing underscore Reported by Arne Freyberger. --- lisp/ChangeLog | 4 ++++ lisp/org-exp.el | 6 ++++-- lisp/org-latex.el | 4 +++- 3 files changed, 11 insertions(+), 3 deletions(-) diff --git a/lisp/ChangeLog b/lisp/ChangeLog index cdc55048b..4856fcf42 100755 --- a/lisp/ChangeLog +++ b/lisp/ChangeLog @@ -1,7 +1,11 @@ 2009-06-23 Carsten Dominik + * 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 diff --git a/lisp/org-exp.el b/lisp/org-exp.el index e56dae223..e4a42414d 100644 --- a/lisp/org-exp.el +++ b/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) diff --git a/lisp/org-latex.el b/lisp/org-latex.el index 55d0628c7..75509a395 100644 --- a/lisp/org-latex.el +++ b/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)))