emacs-orgmode
[Top][All Lists]
Advanced

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

Re: [O] LaTeX export: Handle hash symbol in footnote url links


From: Michael Bach
Subject: Re: [O] LaTeX export: Handle hash symbol in footnote url links
Date: Thu, 10 Apr 2014 19:25:16 +0200
User-agent: Mozilla/5.0 (Macintosh; Intel Mac OS X 10.8; rv:24.0) Gecko/20100101 Thunderbird/24.4.0

On 2/26/14 3:11 PM, Nicolas Goaziou wrote:
> Hello,
> 
> Michael Bach <address@hidden> writes:
> 
>> Thanks for your answer. `\url` can handle hash symbols in its argument
>> without escaping alright - as can be expected. AFAICS, the problem lies
>> in the `\footnote` command. And yes, I was thinking of `ox-latex`
>> figuring out that the url is in a footnote and escape accordingly.
>>
>> I can see that the export engine should not and cannot cover all special
>> cases, but since links and footnotes are `first-class` org-mode
>> concepts, it would be nice to have them play along in this situation.
>> From a typographic point of view, I figured url links in footnotes are
>> not that unusual.
> 
> This needs to be properly defined.
> 
> Where protecting characters in verbatim parts of the buffer should
> happen? Within footnotes only? In every verbatim part? And on which
> characters?
> 

Ok, using org-element, we could escape special symbols - for now, only
'#', '%' and '&' come to mind - in http links iff they are inside a
footnote and exporter backend is latex.

As I said, if this is too special a case to be supported, I was playing
around with regexps and `org-export-filter-final-output-functions' as
seen e.g. in [1].

On other occasions that involved in-buffer replacements, I had success
using group matching with the `re-search-forward', `replace-match' and
`match-string' functions (see also [2]).  But IIUC, since the export
filter function gets passed a string with the .tex export results, I
need a function that operates on a string such as
`replace-regexp-in-string' as seen in [1].

Now I assume for in-string regexp replacement and the use case at hand I
would need a (missing) lookbehind feature [3], don't I?

Please let me know whether you think this is feasible.

Best Regards,
Michael


[1] https://lists.gnu.org/archive/html/emacs-orgmode/2014-02/msg00146.html
[2]
http://stackoverflow.com/questions/6395898/emacs-how-do-i-replace-regexp-with-a-lisp-function-in-a-defun
[3] http://comments.gmane.org/gmane.emacs.devel/147844



reply via email to

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