From: Nicolas Goaziou <n.goaziou@gmail.com>
To: Bastien <bzg@gnu.org>
Cc: emacs-orgmode <emacs-orgmode@gnu.org>,
Mark Edgington <edgimar@gmail.com>
Subject: Re: Orgmode fails to export specific web-links as latex/pdf
Date: Tue, 09 Jul 2013 15:48:01 +0200 [thread overview]
Message-ID: <877ggzn8tq.fsf@gmail.com> (raw)
In-Reply-To: <87y59gt27c.fsf@bzg.ath.cx> (Bastien's message of "Tue, 09 Jul 2013 13:14:31 +0200")
Hello,
Bastien <bzg@gnu.org> writes:
> I confirm this bug: "%" in links breaks the export.
>
> The attached patch is a quick fix, but it needs to be double-checked
> and surely amended. Also, I didn't check other link-related functions.
>
> Thanks for reporting this bad bug,
>
>
> diff --git a/lisp/ox-latex.el b/lisp/ox-latex.el
> index aa30cf1..650b7cc 100644
> --- a/lisp/ox-latex.el
> +++ b/lisp/ox-latex.el
> @@ -1748,7 +1748,9 @@ 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 (org-element-property :path link))
> + (raw-path (org-latex-plain-text
> + (org-link-escape (org-element-property :path link))
> + info))
> ;; Ensure DESC really exists, or set it to nil.
> (desc (and (not (string= desc "")) desc))
> (imagep (org-export-inline-image-p
Actually, some characters need to be escaped when used in a URL within
a \href command, but not all of them. `org-latex-plain-text' escapes too
many of them and `org-link-escape' doesn't escape enough (and we don't
need to rely on it).
According to hyperref documentation # and ~ need not be escaped. Though,
%, { and } do. I'm not sure about \, ^ and _.
Also, I don't think \url command has the same problem, so escaping can
happen later in the function, not at the `raw-path' level.
Regards,
--
Nicolas Goaziou
next prev parent reply other threads:[~2013-07-09 13:47 UTC|newest]
Thread overview: 11+ messages / expand[flat|nested] mbox.gz Atom feed top
2013-07-09 2:16 Orgmode fails to export specific web-links as latex/pdf Mark Edgington
2013-07-09 11:14 ` Bastien
2013-07-09 13:48 ` Nicolas Goaziou [this message]
2013-07-09 14:55 ` Bastien
2013-07-10 12:35 ` Nicolas Goaziou
2013-07-10 12:36 ` Bastien
2013-07-16 18:37 ` Yury Bulka
2013-07-16 18:44 ` Yury Bulka
2013-07-16 20:15 ` Nicolas Goaziou
2013-07-16 19:25 ` Nicolas Goaziou
2013-07-24 18:18 ` 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
List information: https://www.orgmode.org/
* Reply using the --to, --cc, and --in-reply-to
switches of git-send-email(1):
git send-email \
--in-reply-to=877ggzn8tq.fsf@gmail.com \
--to=n.goaziou@gmail.com \
--cc=bzg@gnu.org \
--cc=edgimar@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 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).