From mboxrd@z Thu Jan 1 00:00:00 1970 X-Msuck: nntp://news.gmane.io/gmane.text.pandoc/29303 Path: news.gmane.io!.POSTED.blaine.gmane.org!not-for-mail From: John MacFarlane Newsgroups: gmane.text.pandoc Subject: Re: epub : footnote backlink character not rendered by Kobo fonts Date: Sun, 26 Sep 2021 18:36:13 -0700 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: text/plain; charset="UTF-8" Content-Transfer-Encoding: quoted-printable Injection-Info: ciao.gmane.io; posting-host="blaine.gmane.org:116.202.254.214"; logging-data="32931"; mail-complaints-to="usenet@ciao.gmane.io" To: Vin Cent , pandoc-discuss Original-X-From: pandoc-discuss+bncBCJZJHG45QDBBGWAYSFAMGQEQPCB4MA-/JYPxA39Uh5TLH3MbocFFw@public.gmane.org Mon Sep 27 03:36:30 2021 Return-path: Envelope-to: gtp-pandoc-discuss@m.gmane-mx.org Original-Received: from mail-qv1-f61.google.com ([209.85.219.61]) by ciao.gmane.io with esmtps (TLS1.3:ECDHE_RSA_AES_128_GCM_SHA256:128) (Exim 4.92) (envelope-from ) id 1mUfZF-0008Ns-Aa for gtp-pandoc-discuss@m.gmane-mx.org; Mon, 27 Sep 2021 03:36:29 +0200 Original-Received: by mail-qv1-f61.google.com with SMTP id cr8-20020ad456e8000000b0038251b6e5c4sf20053782qvb.1 for ; Sun, 26 Sep 2021 18:36:29 -0700 (PDT) ARC-Seal: i=2; a=rsa-sha256; t=1632706588; cv=pass; d=google.com; s=arc-20160816; b=nWZjynAfbewbb7TqQ5oSWjC5kz99+CPZcNnzUOkIpmq5NGkbQsuAubmZdy+Hah6Erm eTAemFTMwe78fgNoilvoIIRIl94U114WH/q5jB3RIpNSLTWsY1ofDWn1oCBzMyE7w69A p37yXepR+jXWFS5LnBNfFcIsEDrsRQ9P437tI0F8sUfLMccZVwhQ6tbdUDex+0LtjETQ GQNKBoflqTxOGqgauQZUfMSc0Ve3gptHw2+f6S8PxcPImoD+UPjx7GJdM82gOiCmJn7c hPf/V0CKK+HsEmDPR+7zdZmXgAFlhmBctY873HQ7E2A4pxwjfTS9vnWDKajtgh8fp47w /UOw== 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:content-transfer-encoding :mime-version:message-id:date:references:in-reply-to:subject:to:from :sender:dkim-signature; bh=CFCZGQWHQ+itXvid3X8JLiPtlyRM+A+zg2BVS+ZzOjc=; b=Kb9GCyJ/1l95XDQo5Mv4nrHqXnsM9s70ZRR/EsWiZ+r3m+l5bvc+iLZBc/33BXQ0MU yO+DxNcCFu7MgAGVFVS3uHfXbB/OMdmpO+atXLMWlrsFa/XeHfSFW73KaXjb7kctcDow L7KOcBZSbp6LcURiyC6L+jdX79Je/hS0Yx5c60fIePyBur+79YwKrKSlKHua9q/m1JL9 kyTneDfRbQYpoSDDok3uVvDLIeGkcnOJgxwJp2l2ZwdqAO9IWyRx997CVvySMXK55AKz Sy6eKL96wCaeOL5c7AqG/SZSPlYIPCeyljO8Mwg2o0xDZ2MtGnSciw/in3w57Sal57d4 ZnnQ== ARC-Authentication-Results: i=2; gmr-mx.google.com; dkim=pass header.i=@berkeley-edu.20210112.gappssmtp.com header.s=20210112 header.b=iKrgaIWf; spf=pass (google.com: domain of jgm-TVLZxgkOlNX2fBVCVOL8/A@public.gmane.org designates 2607:f8b0:4864:20::102d as permitted sender) smtp.mailfrom=jgm-TVLZxgkOlNX2fBVCVOL8/A@public.gmane.org DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=googlegroups.com; s=20210112; h=sender:from:to:subject:in-reply-to:references:date:message-id :mime-version:content-transfer-encoding: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=CFCZGQWHQ+itXvid3X8JLiPtlyRM+A+zg2BVS+ZzOjc=; b=XFZHUdC2JDpYht1HLF+c7kp5W1QlLjpUAkvm0JoA0eXKdw1jXboAdTClBrVx8loevI hMn1TZKrFQhw9DrdWutz0GkQFOB4psAFP0IVLwL5GC6gS21Kj03nbw84fOvcW8V2iC/J Cvo07c23Q7y3Ioaa10y43wrkqjNUvkAPB85RrG6YaFO78tkzYIAyXFag5QzM2fHDS+HY ldhwoXhjlv+o0ApcLKfD9KDJtWXAqSsPm7vBTs/ghwvYnS2GrmCJigt1Arjq6cm1ctMY zfVKHkTsnqJ5LhjZsBJF6Xny5WfIjILI6dgFUhA92vN7ZiNQYMRToDynSMb5FLB2tv1b 991g== X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20210112; h=sender:x-gm-message-state:from:to:subject:in-reply-to:references :date:message-id:mime-version:content-transfer-encoding :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=CFCZGQWHQ+itXvid3X8JLiPtlyRM+A+zg2BVS+ZzOjc=; b=YjB4ZnurySDgEFIxrJxwBGx6b90DOOA4E06730IN3YEzPTlzRIodVBu27gItKu+S7T VYZnCU+sf2y8eaouKShQOdat/rfYrZSlzSRvj8CtjAUbvCv5llPHX2fMbVzIQMVdVDLG xyJUA3ZN3phVWw0quZ3GdCPiYUvOUPDVOga9HUs2JAsbRe8Qh1MVekD4bEQSdm4bLhJ0 g4FzglTVPTuuV2i36q1Oc6fss8x5yQ8oqk5rVLscsxvXb4yzzF24aDQtd5g/D9QZfCQ6 +0G3m9c6lSBLfZsjUjFknoTU7A171QXQLKM+aXXoZaaIOIDBcG+cVQNT/yV5jqEm9RpB Original-Sender: pandoc-discuss-/JYPxA39Uh5TLH3MbocFFw@public.gmane.org X-Gm-Message-State: AOAM532ngZdB7cP7v+kHlJcV60IIbLbEX95RdXVZhvjF9W4+Te3dxK1u dz1Qab+rgLa8fBVX8yos8D8= X-Google-Smtp-Source: ABdhPJyOYlvbQfT0ndXifUHMf2t+FjUBP0c8Zn1yoyM6LJfynW8BLBuM16jgPQAZ7oR1wIbo4uREjA== X-Received: by 2002:a37:a50c:: with SMTP id o12mr21228540qke.181.1632706588071; Sun, 26 Sep 2021 18:36:28 -0700 (PDT) X-BeenThere: pandoc-discuss-/JYPxA39Uh5TLH3MbocFFw@public.gmane.org Original-Received: by 2002:a05:622a:181c:: with SMTP id t28ls8305141qtc.6.gmail; Sun, 26 Sep 2021 18:36:26 -0700 (PDT) X-Received: by 2002:ac8:4a16:: with SMTP id x22mr16233511qtq.253.1632706585999; Sun, 26 Sep 2021 18:36:25 -0700 (PDT) ARC-Seal: i=1; a=rsa-sha256; t=1632706585; cv=none; d=google.com; s=arc-20160816; b=YdQ3JM837sTAGkjXVHeIl6L1+/Fik55lUPjrLN4pTpZlLGVepi0qqD4xvFjtTTJD+6 nMl5k/KVr5PuIwmfDADjxF0yzXnwRuvnEwAKalWK5C7Bi+XK0yHVuYyWgnERJmigGMDV BoOsTkqKP1OKRFft/+p0sqQhbiPfdqkm2UXtvoOqQUMvTfErr0JglmuIZiQxmx5U8/+w 4NEPw9k4vl1bVDaiQ9ddmEiyLynRGFQ9jqTrfz7rzUJ3QwUG7MaHBM1fzmf4WjD7JNhb ZHn3GrbL2+zhkcKtR2+qLUeJFDj9JRmv1USJcbAoK3nkFV6hJJD5i7b5ZCdHbK//Tbld ItHA== ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=google.com; s=arc-20160816; h=content-transfer-encoding:mime-version:message-id:date:references :in-reply-to:subject:to:from:dkim-signature; bh=px1EgkhDbV4v/DFyPp2t7RCZtIKwcjP5EqoUNlxdiAk=; b=yV47VsWLBSaPd3GYDOAoL3eqI8YZ4zLx4hwl5khGC0FBMXtstuPX4M2RqKb1DadJiz m4XaQMWWwjHmZt45pBXb+QTBhTXNA3zYFih8FIBuODBr2N26X2bY6tFqlhbjuWHfN04P ucfmPm3HNp8kj3AwYo91sTw3s5Fxuhvhduw7ymdtHk6qdyfyDreRybhk/LymS4WQSjGt uGlYQOgiqeoEYhnP26KAd3A+gi5yWKMGHgKz/uIS533Z9lLcjOFMukFB6ze27E3XQEbb rGIa8yUyY0tpXQBwMINzTaj36+rm4reTZ1jdD56Yb8JyEuRWSTHGFIP+67fS2Y5ZBvp+ AyRg== ARC-Authentication-Results: i=1; gmr-mx.google.com; dkim=pass header.i=@berkeley-edu.20210112.gappssmtp.com header.s=20210112 header.b=iKrgaIWf; spf=pass (google.com: domain of jgm-TVLZxgkOlNX2fBVCVOL8/A@public.gmane.org designates 2607:f8b0:4864:20::102d as permitted sender) smtp.mailfrom=jgm-TVLZxgkOlNX2fBVCVOL8/A@public.gmane.org Original-Received: from mail-pj1-x102d.google.com (mail-pj1-x102d.google.com. [2607:f8b0:4864:20::102d]) by gmr-mx.google.com with ESMTPS id a1si1347770qtn.2.2021.09.26.18.36.25 for (version=TLS1_3 cipher=TLS_AES_128_GCM_SHA256 bits=128/128); Sun, 26 Sep 2021 18:36:25 -0700 (PDT) Received-SPF: pass (google.com: domain of jgm-TVLZxgkOlNX2fBVCVOL8/A@public.gmane.org designates 2607:f8b0:4864:20::102d as permitted sender) client-ip=2607:f8b0:4864:20::102d; Original-Received: by mail-pj1-x102d.google.com with SMTP id h12so916370pjj.1 for ; Sun, 26 Sep 2021 18:36:25 -0700 (PDT) X-Received: by 2002:a17:90b:1d10:: with SMTP id on16mr16452767pjb.220.1632706585036; Sun, 26 Sep 2021 18:36:25 -0700 (PDT) Original-Received: from johnmacfarlane.net (li55-134.members.linode.com. [74.82.3.134]) by smtp.gmail.com with ESMTPSA id o15sm15905082pfg.14.2021.09.26.18.36.24 (version=TLS1_3 cipher=TLS_AES_256_GCM_SHA384 bits=256/256); Sun, 26 Sep 2021 18:36:24 -0700 (PDT) Original-Received: by johnmacfarlane.net (Postfix, from userid 1000) id 8EFC1A1A8; Sun, 26 Sep 2021 21:36:13 -0400 (EDT) In-Reply-To: X-Original-Sender: jgm-TVLZxgkOlNX2fBVCVOL8/A@public.gmane.org X-Original-Authentication-Results: gmr-mx.google.com; dkim=pass header.i=@berkeley-edu.20210112.gappssmtp.com header.s=20210112 header.b=iKrgaIWf; spf=pass (google.com: domain of jgm-TVLZxgkOlNX2fBVCVOL8/A@public.gmane.org designates 2607:f8b0:4864:20::102d as permitted sender) smtp.mailfrom=jgm-TVLZxgkOlNX2fBVCVOL8/A@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:29303 Archived-At: That's great -- if you add your script to the discussion at https://github.com/jgm/pandoc/issues/3149 then perhaps others who could benefit from it will find it more easily. Vin Cent writes: > Thanks. Shell script written ; works like a charm. > If that counts, I vote for the #3149 change/configure character approach = :) > > If that can ease anybody's life, here is my shell script (more than 3=20 > lines, but should be safe and leave no trace in case of failure) : > > > #!/bin/sh > > FN=3D"ebook.epub" > ZIPNAME=3D"ebook.zip" > CWD=3D`pwd` > > if [ ! -f $FN ]; then > exit 1 > fi > > if [ ! -d $MYDIR ]; then > exit 2 > fi > > MYDIR=3D`mktemp -d` > cleanup() > { > cd $CWD > rm -rf $MYDIR > exit $1 > } > > mv $FN ${MYDIR}/${ZIPNAME} || cleanup 3 > cd $MYDIR || cleanup 4 > unzip $ZIPNAME || cleanup 5 > rm -f $ZIPNAME || cleanup 6 > cd EPUB/text || cleanup 7 > sed -i -e 's/>=E2=86=A9=EF=B8=8E<\/a>/>=E2=80=A1<\/a>/g' *html || cleanup= 8 > rm -f $ZIPNAME || cleanup 9 > cd ../.. || cleanup 10 > zip -8 -r ${CWD}/${ZIPNAME} * || cleanup 11 > cd $CWD || cleanup 12 > mv $ZIPNAME $FN || cleanup 13 > rm -rf $MYDIR > > > On Wednesday, September 22, 2021 at 6:40:14 PM UTC+2 John MacFarlane wrot= e: > >> >> A custom writer is probably overkill. It would be easier to write >> a small script that unzips the epub, does search and replace >> on the xhtml files, and then zips it back up again. This could >> be 3 lines of shell script. >> >> That said, this is a long standing issue and we might consider >> using a different character or making it configurable: >> >> https://github.com/jgm/pandoc/issues/3149 >> >> >> William Lupton writes: >> >> > 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 footnote= s, >> > 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, '(.*)> > -- add a list item with the note to the note table. >> > table.insert(notes, '
  • ' .. 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 nee= d=20 >> 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= =20 >> 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= =20 >> 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= =20 >> when >> >>>> I display the document in calibre, and why they do not when I displ= ay=20 >> the >> >>>> document on a kobo reader... >> >>>> >> >>>> ... until I found the backlink is indeed well present. It is "just"= =20 >> not >> >>>> displayed by kobo because the character set (by pandoc, I think) ha= s=20 >> 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 ko= bo. >> >>>> 2. Change the default font of the document to one that has renderin= g=20 >> for >> >>>> that character. >> >>>> >> >>>> I have tried all available fonts on my device. There are actually= =20 >> three >> >>>> classes of them. >> >>>> (Listing them all below, this might be of interest to somebody in t= he >> >>>> future) >> >>>> >> >>>> Avenir Next ; Georgia ; Kobo Nickel : these fonts render absolutely >> >>>> nothing for that character, leading the human to believe the backli= nk=20 >> does >> >>>> not exist. It is present, clickable, just not rendered. >> >>>> >> >>>> Amasis ; Caecilia ; Gill Sans ; Malabar ; OpenDislexic : these font= s >> >>>> render "__" for that character. I find it "better" than the first= =20 >> family, >> >>>> but still not great. It is not obvious for a non-tehnical human tha= t=20 >> 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= =20 >> font) >> >>>> for the backlink character. >> >>>> >> >>>> >> >>>> Therefore, I tend to favor the first solution. Do you guys know of = a=20 >> way >> >>>> to customize the "backlink =E2=86=A9=EF=B8=8E" character set by pan= doc in epub ? >> >>>> Or is there a third approach ? >> >>>> >> >>>> Thanks, >> >>>> >> >>>> Vincent >> >>>> >> >>> -- >> >> You received this message because you are subscribed to the Google=20 >> Groups >> >> "pandoc-discuss" group. >> >> To unsubscribe from this group and stop receiving emails from it, sen= d=20 >> an >> >> email to pandoc-discus...-/JYPxA39Uh5TLH3MbocFF+G/Ez6ZCGd0@public.gmane.org >> >> To view this discussion on the web visit >> >>=20 >> https://groups.google.com/d/msgid/pandoc-discuss/68257f93-0fd1-46a1-9e99= -46d6045dc4b9n%40googlegroups.com >> >> < >> https://groups.google.com/d/msgid/pandoc-discuss/68257f93-0fd1-46a1-9e99= -46d6045dc4b9n%40googlegroups.com?utm_medium=3Demail&utm_source=3Dfooter >> > >> >> . >> >> >> > >> > --=20 >> > You received this message because you are subscribed to the Google=20 >> Groups "pandoc-discuss" group. >> > To unsubscribe from this group and stop receiving emails from it, send= =20 >> an email to pandoc-discus...-/JYPxA39Uh5TLH3MbocFF+G/Ez6ZCGd0@public.gmane.org >> > To view this discussion on the web visit=20 >> https://groups.google.com/d/msgid/pandoc-discuss/CAEe_xxiSZbwmOYcdd5nKSq= ySuF8L4tvPbrD%2B-kXDcONXu3n4hQ%40mail.gmail.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= email to pandoc-discuss+unsubscribe-/JYPxA39Uh5TLH3MbocFF+G/Ez6ZCGd0@public.gmane.org > To view this discussion on the web visit https://groups.google.com/d/msgi= d/pandoc-discuss/e216efa7-009b-469a-add1-ae8c93d0ffc3n%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/m2pmsuzto2.fsf%40Johns-Air.hsd1.ca.comcast.net.