From mboxrd@z Thu Jan 1 00:00:00 1970 From: Nicolas Goaziou Subject: Re: 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 Message-ID: <874moxyq7m.fsf@nicolasgoaziou.fr> References: Mime-Version: 1.0 Content-Type: text/plain Return-path: Received: from eggs.gnu.org ([2001:4830:134:3::10]:35412) by lists.gnu.org with esmtp (Exim 4.71) (envelope-from ) id 1Ye76p-0004tS-U3 for emacs-orgmode@gnu.org; Fri, 03 Apr 2015 15:18:28 -0400 Received: from Debian-exim by eggs.gnu.org with spam-scanned (Exim 4.71) (envelope-from ) id 1Ye76m-0003nx-HG for emacs-orgmode@gnu.org; Fri, 03 Apr 2015 15:18:27 -0400 Received: from relay6-d.mail.gandi.net ([2001:4b98:c:538::198]:50498) by eggs.gnu.org with esmtp (Exim 4.71) (envelope-from ) id 1Ye76m-0003nn-B4 for emacs-orgmode@gnu.org; Fri, 03 Apr 2015 15:18:24 -0400 In-Reply-To: (Derek Feichtinger's message of "Fri, 3 Apr 2015 18:38:00 +0200") 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: Derek Feichtinger Cc: emacs-orgmode@gnu.org Hello, Derek Feichtinger 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 for details. Regards, -- Nicolas Goaziou