From mboxrd@z Thu Jan 1 00:00:00 1970 From: Derek Feichtinger Subject: Bug: fix for latex export of doi links [8.2.10 (8.2.10-35-g19a7d6-elpaplus @ .../elpa/org-plus-contrib-20150330/)] Date: Fri, 3 Apr 2015 18:38:00 +0200 Message-ID: Mime-Version: 1.0 Content-Type: multipart/alternative; boundary=20cf301d3a284a29b90512d4928d Return-path: Received: from eggs.gnu.org ([2001:4830:134:3::10]:58914) by lists.gnu.org with esmtp (Exim 4.71) (envelope-from ) id 1Ye4ba-0002Rt-Im for emacs-orgmode@gnu.org; Fri, 03 Apr 2015 12:38:03 -0400 Received: from Debian-exim by eggs.gnu.org with spam-scanned (Exim 4.71) (envelope-from ) id 1Ye4bZ-0002CG-JW for emacs-orgmode@gnu.org; Fri, 03 Apr 2015 12:38:02 -0400 Received: from mail-ig0-x231.google.com ([2607:f8b0:4001:c05::231]:35024) by eggs.gnu.org with esmtp (Exim 4.71) (envelope-from ) id 1Ye4bZ-0002C8-Ee for emacs-orgmode@gnu.org; Fri, 03 Apr 2015 12:38:01 -0400 Received: by igcau2 with SMTP id au2so103316786igc.0 for ; Fri, 03 Apr 2015 09:38:00 -0700 (PDT) List-Id: "General discussions about Org-mode." List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , Errors-To: emacs-orgmode-bounces+geo-emacs-orgmode=m.gmane.org@gnu.org Sender: emacs-orgmode-bounces+geo-emacs-orgmode=m.gmane.org@gnu.org To: emacs-orgmode@gnu.org --20cf301d3a284a29b90512d4928d Content-Type: text/plain; charset=UTF-8 Hi 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) ############# Best regards, Derek --20cf301d3a284a29b90512d4928d Content-Type: text/html; charset=UTF-8 Content-Transfer-Encoding: quoted-printable
Hi

The current org latex exp= ort will export a link doi:10.xyz/abcd without
the protocol prefi= x as 10.xyz/abcd. Correctly, it should retain the
prefix.

An easy fix is adding "doi" to the list of prot= ocols that retain
the link type string in ox-latex.el, below.

################### ox-latex.el ###############
=
(defun org-latex-link (link desc info)
=C2=A0 "Transcod= e a LINK object from Org to LaTeX.

DESC is the des= cription part of the link, or the empty string.
INFO is a plist h= olding contextual information.=C2=A0 See
`org-export-data'.&q= uot;
=C2=A0 (let* ((type (org-element-property :type link))
=
(raw-path (replace= -regexp-in-string
=C2=A0 =C2=A0"%" "\\%" (org-element-property :pat= h link) nil t))
;; Ensure DESC really exists, or set it to nil.
(desc (and (not (string=3D desc "= ;")) desc))
(imagep (org-export-inline-image-p
=C2=A0link org-latex-inline-image-rules))
<= div> (path (cond
=C2=A0 =C2=A0 =C2=A0 =C2=A0 =C2=A0 =C2=A0 =C2=A0 =C2=A0 ;; ----- NEXT LI= NE CONTAINS THE FIX -------
((member type '("http" "https" "= ;ftp" "mailto" "doi"))
(concat type ":" raw-path))
((and (string= =3D type "file") (file-name-absolute-p raw-path))
(concat "file:" r= aw-path))
(t = raw-path)))
p= rotocol)
#############

Best regards,
Derek

--20cf301d3a284a29b90512d4928d--