This probably won't be the answer that you wanted, but you could use a custom writer, e.g., based on the provided sample.lua. See https://pandoc.org/MANUAL.html#custom-writers.

Here's the relevant code (this isn't all the code relating to footnotes, but it's the bit that has the special character!):

function Note(s)
    local num = #notes + 1
    -- insert the back reference right before the final closing tag.
    s = string.gsub(
        s, '(.*)</', '%1 <a href="#fnref' .. num ..  '">&#8617;</a></')
    -- add a list item with the note to the note table.
    table.insert(notes, '<li id="fn' .. num .. '">' .. s .. '</li>')
    -- return the footnote reference, linked to the note.
    return '<a id="fnref' .. num .. '" href="#fn' .. num ..
        '"><sup>' .. num .. '</sup></a>'
end


On Tue, 21 Sept 2021 at 13:23, Vin Cent <irakay17-Re5JQEeQqe8AvxtiuMwx3w@public.gmane.org> wrote:
Ok, after some more reading, I'm still unsure how to proceed ; and I actually don't see how I could to that with a filter.
I have dumped pandoc's native output format ; and the character I need to replace is not part of it. I guess it is added at the time of pandoc's writing the output document.
I don't know how how I can replace that character. Hopefully there is a pandoc setting I can tune so that I won't need to replace it at some late stage.



On Tuesday, September 21, 2021 at 10:42:14 AM UTC+2 Vin Cent wrote:
Sorry for answering myself. I have RTFMed a bit in the while.
I actually hint this can be simply done with a LUA filter.
I will try to implement it as a self-exercice and report the result here.

On Tuesday, September 21, 2021 at 9:34:26 AM UTC+2 Vin Cent wrote:
Hi,

I am generating epub3 from latex source.
I was wondering why footnotes show a backlink to the original text when I display the document in calibre, and why they do not when I display the document on a kobo reader...

... until I found the backlink is indeed well present. It is "just" not displayed by kobo because the character set (by pandoc, I think) has no rendering on their font.

The backlink character, copied and pasted from the .epub document itself, seems to be "↩︎".

I see two possible tricks here so that the link will appear on kobo :
1. Change the character to another one that would be rendered by kobo.
2. Change the default font of the document to one that has rendering for that character.

I have tried all available fonts on my device. There are actually three classes of them.
(Listing them all below, this might be of interest to somebody in the future)

Avenir Next ; Georgia ; Kobo Nickel : these fonts render absolutely nothing for that character, leading the human to believe the backlink does not exist. It is present, clickable, just not rendered.

Amasis ; Caecilia ; Gill Sans ; Malabar ; OpenDislexic : these fonts render "__" for that character. I find it "better" than the first family, but still not great. It is not obvious for a non-tehnical human that this is a backlink to the text.

AR UDJingxihei ; Kobo UD Kakugo ; Kobo Tsukishi Mincho : display oriental character (I think this is chinese / japanese depending on font) for the backlink character.


Therefore, I tend to favor the first solution. Do you guys know of a way to customize the "backlink ↩︎" character set by pandoc in epub ?
Or is there a third approach ?

Thanks,

Vincent

--
You received this message because you are subscribed to the Google Groups "pandoc-discuss" group.
To unsubscribe from this group and stop receiving emails from it, send an email to pandoc-discuss+unsubscribe-/JYPxA39Uh5TLH3MbocFFw@public.gmane.org.
To view this discussion on the web visit https://groups.google.com/d/msgid/pandoc-discuss/68257f93-0fd1-46a1-9e99-46d6045dc4b9n%40googlegroups.com.

--
You received this message because you are subscribed to the Google Groups "pandoc-discuss" group.
To unsubscribe from this group and stop receiving emails from it, send an email to pandoc-discuss+unsubscribe-/JYPxA39Uh5TLH3MbocFFw@public.gmane.org.
To view this discussion on the web visit https://groups.google.com/d/msgid/pandoc-discuss/CAEe_xxiSZbwmOYcdd5nKSqySuF8L4tvPbrD%2B-kXDcONXu3n4hQ%40mail.gmail.com.