all messages for Emacs-related lists mirrored at yhetil.org
 help / color / mirror / code / Atom feed
From: Derek Feichtinger <dfeich@gmail.com>
To: emacs-orgmode@gnu.org
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	[thread overview]
Message-ID: <CALGTQTYE3W2NB0LwG2QG=cJx9SwtsMKD32_tCHuDgQbFbZjb8Q@mail.gmail.com> (raw)

[-- 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 --]

             reply	other threads:[~2015-04-03 16:38 UTC|newest]

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

Reply instructions:

You may reply publicly to this message via plain-text email
using any one of the following methods:

* Save the following mbox file, import it into your mail client,
  and reply-to-all from there: mbox

  Avoid top-posting and favor interleaved quoting:
  https://en.wikipedia.org/wiki/Posting_style#Interleaved_style

* Reply using the --to, --cc, and --in-reply-to
  switches of git-send-email(1):

  git send-email \
    --in-reply-to='CALGTQTYE3W2NB0LwG2QG=cJx9SwtsMKD32_tCHuDgQbFbZjb8Q@mail.gmail.com' \
    --to=dfeich@gmail.com \
    --cc=emacs-orgmode@gnu.org \
    /path/to/YOUR_REPLY

  https://kernel.org/pub/software/scm/git/docs/git-send-email.html

* If your mail client supports setting the In-Reply-To header
  via mailto: links, try the mailto: link
Be sure your reply has a Subject: header at the top and a blank line before the message body.
Code repositories for project(s) associated with this external index

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

This is an external index of several public inboxes,
see mirroring instructions on how to clone and mirror
all data and code used by this external index.