emacs-orgmode@gnu.org archives
 help / color / mirror / code / Atom feed
* Bug: fix for latex export of doi links [8.2.10 (8.2.10-35-g19a7d6-elpaplus @ .../elpa/org-plus-contrib-20150330/)]
@ 2015-04-03 16:38 Derek Feichtinger
  2015-04-03 19:19 ` Nicolas Goaziou
  0 siblings, 1 reply; 5+ messages in thread
From: Derek Feichtinger @ 2015-04-03 16:38 UTC (permalink / raw)
  To: emacs-orgmode

[-- Attachment #1: Type: text/plain, Size: 1148 bytes --]

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

[-- Attachment #2: Type: text/html, Size: 2326 bytes --]

^ permalink raw reply	[flat|nested] 5+ messages in thread

end of thread, other threads:[~2015-04-03 22:05 UTC | newest]

Thread overview: 5+ messages (download: mbox.gz / follow: Atom feed)
-- links below jump to the message on this page --
2015-04-03 16:38 Bug: fix for latex export of doi links [8.2.10 (8.2.10-35-g19a7d6-elpaplus @ .../elpa/org-plus-contrib-20150330/)] Derek Feichtinger
2015-04-03 19:19 ` Nicolas Goaziou
2015-04-03 19:52   ` Derek Feichtinger
2015-04-03 20:34   ` Derek Feichtinger
2015-04-03 22:06     ` Nicolas Goaziou

Code repositories for project(s) associated with this public inbox

	https://git.savannah.gnu.org/cgit/emacs/org-mode.git

This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox;
as well as URLs for read-only IMAP folder(s) and NNTP newsgroup(s).