emacs-orgmode
[Top][All Lists]
Advanced

[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

Re: [O] Bug: fix for latex export of doi links [8.2.10 (8.2.10-35-g19a7d


From: Nicolas Goaziou
Subject: Re: [O] Bug: fix for latex export of doi links [8.2.10 (8.2.10-35-g19a7d6-elpaplus @ .../elpa/org-plus-contrib-20150330/)]
Date: Fri, 03 Apr 2015 21:19:41 +0200

Hello,

Derek Feichtinger <address@hidden> writes:

> The current org latex export will export a link doi:10.xyz/abcd without
> the protocol prefix as 10.xyz/abcd. Correctly, it should retain the
> prefix.
>
> An easy fix is adding "doi" to the list of protocols that retain
> the link type string in ox-latex.el, below.
>
> ################### ox-latex.el ###############
> (defun org-latex-link (link desc info)
>   "Transcode a LINK object from Org to LaTeX.
>
> DESC is the description part of the link, or the empty string.
> INFO is a plist holding contextual information.  See
> `org-export-data'."
>   (let* ((type (org-element-property :type link))
>  (raw-path (replace-regexp-in-string
>     "%" "\\%" (org-element-property :path link) nil t))
>  ;; Ensure DESC really exists, or set it to nil.
>  (desc (and (not (string= desc "")) desc))
>  (imagep (org-export-inline-image-p
>   link org-latex-inline-image-rules))
>  (path (cond
>                 ;; ----- NEXT LINE CONTAINS THE FIX -------
> ((member type '("http" "https" "ftp" "mailto" "doi"))
>  (concat type ":" raw-path))
> ((and (string= type "file") (file-name-absolute-p raw-path))
>  (concat "file:" raw-path))
> (t raw-path)))
>  protocol)
> #############

Indeed. Thank you. 

Would you mind preparing a patch with "git format-patch" for correct
attribution? See <http://orgmode.org/worg/org-contribute.html> for
details.

Regards,

-- 
Nicolas Goaziou



reply via email to

[Prev in Thread] Current Thread [Next in Thread]