From mboxrd@z Thu Jan 1 00:00:00 1970 X-Msuck: nntp://news.gmane.io/gmane.text.pandoc/29270 Path: news.gmane.io!.POSTED.blaine.gmane.org!not-for-mail From: William Lupton Newsgroups: gmane.text.pandoc Subject: Re: epub : footnote backlink character not rendered by Kobo fonts Date: Tue, 21 Sep 2021 15:09:02 +0100 Message-ID: References: <349480b0-92cd-450f-abc0-f3d65140d23cn@googlegroups.com> <23e0bec1-2642-49d7-b6d5-d440caf74fdcn@googlegroups.com> <68257f93-0fd1-46a1-9e99-46d6045dc4b9n@googlegroups.com> Reply-To: pandoc-discuss-/JYPxA39Uh5TLH3MbocFFw@public.gmane.org Mime-Version: 1.0 Content-Type: multipart/alternative; boundary="000000000000dede5305cc81f15e" Injection-Info: ciao.gmane.io; posting-host="blaine.gmane.org:116.202.254.214"; logging-data="35772"; mail-complaints-to="usenet@ciao.gmane.io" To: pandoc-discuss Original-X-From: pandoc-discuss+bncBCS4HJ6WSAHBBFGQU6FAMGQE7Y7BPEA-/JYPxA39Uh5TLH3MbocFFw@public.gmane.org Tue Sep 21 16:11:34 2021 Return-path: Envelope-to: gtp-pandoc-discuss@m.gmane-mx.org Original-Received: from mail-wr1-f58.google.com ([209.85.221.58]) by ciao.gmane.io with esmtps (TLS1.3:ECDHE_RSA_AES_128_GCM_SHA256:128) (Exim 4.92) (envelope-from ) id 1mSgUg-00098C-Nh for gtp-pandoc-discuss@m.gmane-mx.org; Tue, 21 Sep 2021 16:11:34 +0200 Original-Received: by mail-wr1-f58.google.com with SMTP id u10-20020adfae4a000000b0016022cb0d2bsf1161085wrd.19 for ; Tue, 21 Sep 2021 07:11:34 -0700 (PDT) ARC-Seal: i=2; a=rsa-sha256; t=1632233494; cv=pass; d=google.com; s=arc-20160816; b=LTZtDHGc4tDdr5Fr14DIEmagoNI4sxd5rK2dyKS/5Jx1iOdkCErsWPO0/Yn0+cQQ6g hbCIPM3zmlfuEaV3c8kkD++gT3HKYnlNkmXWsYbxMZtaFi7D/sEg0TG9LBh3nJeWNDrm 8WV2Xpd/pwdrOMVyzmS2RoDKF9sXvlhsXVLb4Pc0UBB/jc40XrnunUR7JdjJU2PXdtOG rXnJm38vuATDJtr8jgrrj3YGV3EX/XiR0BfYRnhLTh35h2iFSErP7NwnHG2wrp9gEuuU f7nz7g5cbiLVfDbtJ2Wnp+grZOyMV9m/B0nshTwyjM1/mSZ/gD65QK5U8If/Y5Gl9cvQ PDkA== ARC-Message-Signature: i=2; a=rsa-sha256; c=relaxed/relaxed; d=google.com; s=arc-20160816; h=list-unsubscribe:list-subscribe:list-archive:list-help:list-post :list-id:mailing-list:precedence:reply-to:to:subject:message-id:date :from:in-reply-to:references:mime-version:sender:dkim-signature; bh=/fKDz3+yuRKjU1D4vsxgK/8cS/LCZ9Gdj2IVDx7Hv8Q=; b=PKNww/ZGTyfoTS/J5IkHw0kueIDw33HfytxNZuHhJcB8AXGOn5E7llIcsOULXEferL Y8QdgInea4kuhvO0grcVTidNvTifHJyybNtPQvPtH0aQDhMw8yz4ovNngqjx+L7LfxMI zoJv+2QlQD5d8knGHtHWdvAM7CoGa07SfXI9fLn3a6iB4ezyUe/RGKwMclRQAx1L9L1/ q5mOy5B+VH1LtLXq1CuCLE6uHXRllnEb1qpLLhskVplcOewlMyp7KJOFfvElgCUhNTx2 aSJvrFwvvmDcVStN+PhpA/jU7rRTREAM6wW65lD012sYdHWp2fbd1OkKvx3QQO+glB9k uCTg== ARC-Authentication-Results: i=2; gmr-mx.google.com; dkim=pass header.i=@broadband-forum-org.20210112.gappssmtp.com header.s=20210112 header.b=XQkptWCq; spf=pass (google.com: domain of wlupton-QSt+ys/nuMyEUIsrzH9SikB+6BGkLq7r@public.gmane.org designates 2a00:1450:4864:20::52f as permitted sender) smtp.mailfrom=wlupton-QSt+ys/nuMyEUIsrzH9SikB+6BGkLq7r@public.gmane.org DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=googlegroups.com; s=20210112; h=sender:mime-version:references:in-reply-to:from:date:message-id :subject:to:x-original-sender:x-original-authentication-results :reply-to:precedence:mailing-list:list-id:list-post:list-help :list-archive:list-subscribe:list-unsubscribe; bh=/fKDz3+yuRKjU1D4vsxgK/8cS/LCZ9Gdj2IVDx7Hv8Q=; b=t36XB8IYu3rfO2iaU1z7hSWhYPz/Sf8oL30DvPHl8yhw3GocUbZvHuDZBeSGNdZHmZ gHi6Vin2Jp+5tSuxE+gX7ueui/TAkLlfjDRM0Vs649Gn4VWd9zK2FHSiDs4m2r0JH+VX J798aGWCM0U1EveUcsEyfITqy0THTvPO5lULr9AmxFjfxoYNedZn+1i8C+hUAiGevHq9 85mZLPswHhAssUXXPopRkk14hGO5naf9SouOixtBj1yn1BqXczwpoPKuaOTDSR/kBB/L Pa9HzvQLatqxAjnn+AAA5vzG+wzgh14pUk/RXXXT1UDTlmrU1qd8zICDn11La8U5FwQu JBzA== X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20210112; h=sender:x-gm-message-state:mime-version:references:in-reply-to:from :date:message-id:subject:to:x-original-sender :x-original-authentication-results:reply-to:precedence:mailing-list :list-id:x-spam-checked-in-group:list-post:list-help:list-archive :list-subscribe:list-unsubscribe; bh=/fKDz3+yuRKjU1D4vsxgK/8cS/LCZ9Gdj2IVDx7Hv8Q=; b=7vgFpS0F0R/NWd/mWDqhinnjQo6kOPdEWbWjAx1NT2RYabxcv5kduCaHqvGArpclGY DojzXksnnBEtepqm3a6/2s/Fyxn7riD24wX8hT/2TG8XvhZin8K6ps8vUWYv/ZNPZN+X xtfFzqh0taigNBlgUdpokAwqTn8SG0xztb7QL9HgOKxRsEv2sJkhnk8nfyqg3BE3UFxa 7QtPIx/V3ff6zsheZaRS1j9swg/Ad3f4//QzSnOLrXT1b5vL8rbzdrhNFRbu53EV+zM6 PRzpCGsjNe29gcmXck38eg00FmmBqVbEBsECpSNnjlg5IrsXvMCpvyaIAcDhaL0NuSsx qV4w== Original-Sender: pandoc-discuss-/JYPxA39Uh5TLH3MbocFFw@public.gmane.org X-Gm-Message-State: AOAM530VtXjUuC3gU3BGOdUBvuCoPjTUiOrJMfwcbibHNTyxU9UNwCDg IrSkFRdwTt3KyjzPI5bz0bo= X-Google-Smtp-Source: ABdhPJyKReGafsiUGIXnczY1eF1to5//SWvlD3D27s5or6r2CYYA91hZk9rExS/MYAucgm+pkbZTYw== X-Received: by 2002:adf:a3c3:: with SMTP id m3mr35935509wrb.237.1632233494331; Tue, 21 Sep 2021 07:11:34 -0700 (PDT) X-BeenThere: pandoc-discuss-/JYPxA39Uh5TLH3MbocFFw@public.gmane.org Original-Received: by 2002:adf:9bd7:: with SMTP id e23ls3323292wrc.2.gmail; Tue, 21 Sep 2021 07:11:31 -0700 (PDT) X-Received: by 2002:a5d:47ce:: with SMTP id o14mr35008027wrc.30.1632233491555; Tue, 21 Sep 2021 07:11:31 -0700 (PDT) ARC-Seal: i=1; a=rsa-sha256; t=1632233491; cv=none; d=google.com; s=arc-20160816; b=COu5u01uuMyrZqNGbjPuaGrFXicbTTHuSBRAXvQu2Y5iuxUdK0GFhjr8QHvu6BDIwq BhdnPPYJJeFkO/CxyMmgwjTD1Qwan/QeMnOdjev/5U2AcxpTjOlVWJ79UKjZ72nzXtJr Z9fEut/VfhmyEHsaqzZ2xuDLQeM69SYXV6gjxuIDMPFtWOUehXVNhtiu/JIJlWGiKQsg 7jExSe+7KSRT6oF1dE5SX8OX96r2XCnZNkHj4USkRE7ewdzgaE4svmHy4wrGTF8/k8wd PrPoDKPrvti94HOAOqjN2h4LoPplf0EiyMgk17ayM7mNTk89gSoQvWMbN5uGECXmzGlj c5MQ== ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=google.com; s=arc-20160816; h=to:subject:message-id:date:from:in-reply-to:references:mime-version :dkim-signature; bh=U/B2zhuEw17GDK87aLfZtTFRvHIunXqdRrT5Ypcljmo=; b=ENu3Qno+wdiy9oS2YiQQZu93UQxxyoaVjSCIn3/ZNwIP+KTlN994Y1DE+Orj9XxDPl ML9Z22YbbdF0ziNWT452I0/vzbEV9sMGcRMEJ2CJf9w8FRtbBNW8xGBNT9sqFFAYEEv2 E4Jhp1KCbqmT0Ayg4YpmOAhQp8eWIDNxjoldWUdh8/cF8gqhiRpsDRaV49hntMJQR4Du gz1aKEHnGCU22CgV8Lmsskna+1tNob2xJQBT+66WTkQ49vIowLv/BopHLCkelDsR5h/X K29HlfW+I+POTP1K/xOhmmaEeBJQYi7EFCvfGL7Tp+gBI2kGbv+tjoWMic6x/tfZGykO aUVQ== ARC-Authentication-Results: i=1; gmr-mx.google.com; dkim=pass header.i=@broadband-forum-org.20210112.gappssmtp.com header.s=20210112 header.b=XQkptWCq; spf=pass (google.com: domain of wlupton-QSt+ys/nuMyEUIsrzH9SikB+6BGkLq7r@public.gmane.org designates 2a00:1450:4864:20::52f as permitted sender) smtp.mailfrom=wlupton-QSt+ys/nuMyEUIsrzH9SikB+6BGkLq7r@public.gmane.org Original-Received: from mail-ed1-x52f.google.com (mail-ed1-x52f.google.com. [2a00:1450:4864:20::52f]) by gmr-mx.google.com with ESMTPS id e2si864699wrj.4.2021.09.21.07.11.31 for (version=TLS1_3 cipher=TLS_AES_128_GCM_SHA256 bits=128/128); Tue, 21 Sep 2021 07:11:31 -0700 (PDT) Received-SPF: pass (google.com: domain of wlupton-QSt+ys/nuMyEUIsrzH9SikB+6BGkLq7r@public.gmane.org designates 2a00:1450:4864:20::52f as permitted sender) client-ip=2a00:1450:4864:20::52f; Original-Received: by mail-ed1-x52f.google.com with SMTP id v22so70089843edd.11 for ; Tue, 21 Sep 2021 07:11:31 -0700 (PDT) X-Received: by 2002:a05:6402:319a:: with SMTP id di26mr36070450edb.84.1632233364306; Tue, 21 Sep 2021 07:09:24 -0700 (PDT) In-Reply-To: <68257f93-0fd1-46a1-9e99-46d6045dc4b9n-/JYPxA39Uh5TLH3MbocFFw@public.gmane.org> X-Original-Sender: wlupton-QSt+ys/nuMyEUIsrzH9SikB+6BGkLq7r@public.gmane.org X-Original-Authentication-Results: gmr-mx.google.com; dkim=pass header.i=@broadband-forum-org.20210112.gappssmtp.com header.s=20210112 header.b=XQkptWCq; spf=pass (google.com: domain of wlupton-QSt+ys/nuMyEUIsrzH9SikB+6BGkLq7r@public.gmane.org designates 2a00:1450:4864:20::52f as permitted sender) smtp.mailfrom=wlupton-QSt+ys/nuMyEUIsrzH9SikB+6BGkLq7r@public.gmane.org Precedence: list Mailing-list: list pandoc-discuss-/JYPxA39Uh5TLH3MbocFFw@public.gmane.org; contact pandoc-discuss+owners-/JYPxA39Uh5TLH3MbocFFw@public.gmane.org List-ID: X-Google-Group-Id: 1007024079513 List-Post: , List-Help: , List-Archive: , List-Unsubscribe: , Xref: news.gmane.io gmane.text.pandoc:29270 Archived-At: --000000000000dede5305cc81f15e Content-Type: text/plain; charset="UTF-8" Content-Transfer-Encoding: quoted-printable 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 =3D #notes + 1 -- insert the back reference right before the final closing tag. s =3D string.gsub( s, '(.*)' .. s .. '') -- return the footnote reference, linked to the note. return '' .. num .. '' end On Tue, 21 Sept 2021 at 13:23, Vin Cent 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 t= he >>> 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 "=E2=86=A9=EF=B8=8E". >>> >>> 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 fo= r >>> 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 d= oes >>> 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 famil= y, >>> but still not great. It is not obvious for a non-tehnical human that th= is >>> 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 fon= t) >>> for the backlink character. >>> >>> >>> Therefore, I tend to favor the first solution. Do you guys know of a wa= y >>> to customize the "backlink =E2=86=A9=EF=B8=8E" 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-/JYPxA39Uh5TLH3MbocFF+G/Ez6ZCGd0@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 > > . > --=20 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 e= mail to pandoc-discuss+unsubscribe-/JYPxA39Uh5TLH3MbocFF+G/Ez6ZCGd0@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. --000000000000dede5305cc81f15e Content-Type: text/html; charset="UTF-8" Content-Transfer-Encoding: quoted-printable
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= =C2=A0https://pan= doc.org/MANUAL.html#custom-writers.

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

function Note(s)
=C2=A0 =C2=A0 local num =3D #notes = + 1
=C2=A0 =C2=A0 -- insert the back reference right before the final cl= osing tag.
=C2=A0 =C2=A0 s =3D string.gsub(
=C2=A0 =C2=A0 =C2=A0 =C2= =A0 s, '(.*)</', '%1 <a href=3D"#fnref' .. num .= . =C2=A0'">&#8617;</a></')
=C2=A0 =C2=A0 --= add a list item with the note to the note table.
=C2=A0 =C2=A0 table.in= sert(notes, '<li id=3D"fn' .. num .. '">' .= . s .. '</li>')
=C2=A0 =C2=A0 -- return the footnote refer= ence, linked to the note.
=C2=A0 =C2=A0 return '<a id=3D"fnr= ef' .. num .. '" href=3D"#fn' .. num ..
=C2=A0 =C2= =A0 =C2=A0 =C2=A0 '"><sup>' .. num .. '</sup&g= t;</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 do= n'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 o= f it. I guess it is added at the time of pandoc's writing the output do= cument.
I don't know how how I can replace that character. Ho= pefully there is a pandoc setting I can tune so that I won't need to re= place it at some late stage.



On Tu= esday, September 21, 2021 at 10:42:14 AM UTC+2 Vin Cent wrote:
Sorry for answering mys= elf. I have RTFMed a bit in the while.
I actually hint this can be sim= ply done with a LUA filter.
I will try to implement it as a self-exerci= ce and report the result here.

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

I am generating epub3 from latex source.<= /div>
I was wondering why footnotes show a backlink to the original tex= t when I display the document in calibre, and why they do not when I displa= y the document on a kobo reader...

... until I fou= nd the backlink is indeed well present. It is "just" not displaye= d by kobo because the character set (by pandoc, I think) has no rendering o= n their font.

The backlink character, copied and p= asted from the .epub document itself, seems to be "=E2=86=A9=EF=B8=8E&= quot;.

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 th= e document to one that has rendering for that character.

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

Avenir Next ; Ge= orgia ; Kobo Nickel : these fonts render absolutely nothing for that charac= ter, leading the human to believe the backlink does not exist. It is presen= t, clickable, just not rendered.

Amasis ; Caecilia= ; Gill Sans ; Malabar ; OpenDislexic : these fonts render "__" f= or 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 Kak= ugo ; Kobo Tsukishi Mincho : display oriental character (I think this is ch= inese / japanese depending on font) for the backlink character.
<= br>

Therefore, I tend to favor the first solution.= Do you guys know of a way to customize the "backlink =E2=86=A9=EF=B8= =8E" character set by pandoc in epub ?
Or is there a third a= pproach ?

Thanks,

Vincent=

--
You received this message because you are subscribed to the Google Groups &= quot;pandoc-discuss" group.
To unsubscribe from this group and stop receiving emails from it, send an e= mail 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-46d6045= dc4b9n%40googlegroups.com.

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