From cae0c63c488067e93b665e9110dc74a634c52529 Mon Sep 17 00:00:00 2001 From: Carsten Dominik Date: Wed, 20 Jan 2010 10:27:45 +0100 Subject: [PATCH] Make hyperref macro customizable This was a request by Martin G. Skjaeveland --- lisp/ChangeLog | 5 +++++ lisp/org-latex.el | 9 ++++++++- 2 files changed, 13 insertions(+), 1 deletion(-) diff --git a/lisp/ChangeLog b/lisp/ChangeLog index b85a71631..071047684 100755 --- a/lisp/ChangeLog +++ b/lisp/ChangeLog @@ -1,3 +1,8 @@ +2010-01-20 Carsten Dominik + + * org-latex.el (org-export-latex-hyperref-format): New option. + (org-export-latex-links): Use `org-export-latex-hyperref-format'. + 2010-01-18 Carsten Dominik * org-ctags.el (org-ctags-enable): Change order of functions. diff --git a/lisp/org-latex.el b/lisp/org-latex.el index 964e421f4..ef575549e 100644 --- a/lisp/org-latex.el +++ b/lisp/org-latex.el @@ -277,6 +277,13 @@ markup defined, the first one in the association list will be used." :group 'org-export-latex :type 'string) +(defcustom org-export-latex-hyperref-format "\\href{%s}{%s}" + "A printf format string to be applied to hyperref links. +The format must contain two %s instances. The first will be filled with +the link, the second with the link description." + :group 'org-export-latex + :type 'string) + (defcustom org-export-latex-tables-verbatim nil "When non-nil, tables are exported verbatim." :group 'org-export-latex @@ -1750,7 +1757,7 @@ The conversion is made depending of STRING-BEFORE and STRING-AFTER." ;; a LaTeX issue, but we here implement a work-around anyway. (setq path (org-export-latex-protect-amp path) desc (org-export-latex-protect-amp desc))) - (insert (format "\\href{%s}{%s}" path desc))) + (insert (format org-export-latex-hyperref-format path desc))) (t (insert "\\texttt{" desc "}")))))))