mirror of
https://git.savannah.gnu.org/git/emacs/org-mode.git
synced 2024-08-24 15:32:52 +00:00
LaTeX export: Use special formatting by link type interface
Patch by Christian Moe, who writes: > It looks like support for formatting custom link types in LaTeX export > is broken? > > I was trying to implement a custom link type with its own formatting > function for HTML and LaTeX export, following the steps in > org-bbdb.el. > > I've found that org-bbdb-export does not italicize bbdb links in > LaTeX, nor does my own org-cite-export turn my custom =cite:= links > into LaTeX =\cite{}= citations. Everything works fine in HTML export, > but in LaTeX all custom link types get formatted as =\texttt{descr}=. > > I see that org-export-as-html and org-export-as-docbook look up > org-link-protocols to get the function for formatting the link, but it > seems that org-export-as-latex doesn't. > >
This commit is contained in:
parent
336456d0c3
commit
8a671f8d4d
|
@ -1,5 +1,8 @@
|
||||||
2010-05-12 Carsten Dominik <carsten.dominik@gmail.com>
|
2010-05-12 Carsten Dominik <carsten.dominik@gmail.com>
|
||||||
|
|
||||||
|
* org-latex.el (org-export-latex-links): Use the formatting
|
||||||
|
function of the link type, if it is available.
|
||||||
|
|
||||||
* org-table.el (org-table-get-remote-range): Return to
|
* org-table.el (org-table-get-remote-range): Return to
|
||||||
original buffer when retrieving remote reference.
|
original buffer when retrieving remote reference.
|
||||||
|
|
||||||
|
|
|
@ -1822,7 +1822,7 @@ The conversion is made depending of STRING-BEFORE and STRING-AFTER."
|
||||||
(attr (or (org-find-text-property-in-string 'org-attributes raw-path)
|
(attr (or (org-find-text-property-in-string 'org-attributes raw-path)
|
||||||
(plist-get org-export-latex-options-plist :latex-image-options)))
|
(plist-get org-export-latex-options-plist :latex-image-options)))
|
||||||
(label (org-find-text-property-in-string 'org-label raw-path))
|
(label (org-find-text-property-in-string 'org-label raw-path))
|
||||||
imgp radiop
|
imgp radiop fnc
|
||||||
;; define the path of the link
|
;; define the path of the link
|
||||||
(path (cond
|
(path (cond
|
||||||
((member type '("coderef"))
|
((member type '("coderef"))
|
||||||
|
@ -1876,6 +1876,13 @@ The conversion is made depending of STRING-BEFORE and STRING-AFTER."
|
||||||
(setq path (org-export-latex-protect-amp path)
|
(setq path (org-export-latex-protect-amp path)
|
||||||
desc (org-export-latex-protect-amp desc)))
|
desc (org-export-latex-protect-amp desc)))
|
||||||
(insert (format org-export-latex-hyperref-format path desc)))
|
(insert (format org-export-latex-hyperref-format path desc)))
|
||||||
|
|
||||||
|
((functionp (setq fnc (nth 2 (assoc type org-link-protocols))))
|
||||||
|
;; The link protocol has a function for formatting the link
|
||||||
|
(insert
|
||||||
|
(save-match-data
|
||||||
|
(funcall fnc (org-link-unescape raw-path) desc 'latex))))
|
||||||
|
|
||||||
(t (insert "\\texttt{" desc "}")))))))
|
(t (insert "\\texttt{" desc "}")))))))
|
||||||
|
|
||||||
|
|
||||||
|
|
Loading…
Reference in a new issue