emacs-orgmode
[Top][All Lists]
Advanced

[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

Re: [O] Orgmode fails to export specific web-links as latex/pdf


From: Nicolas Goaziou
Subject: Re: [O] Orgmode fails to export specific web-links as latex/pdf
Date: Tue, 09 Jul 2013 15:48:01 +0200

Hello,

Bastien <address@hidden> 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



reply via email to

[Prev in Thread] Current Thread [Next in Thread]