Register Guidelines E-Books Today's Posts Search

Go Back   MobileRead Forums > E-Book Software > Calibre > Editor

Notices

Reply
 
Thread Tools Search this Thread
Old 01-21-2016, 05:41 AM   #1
roger64
Wizard
roger64 ought to be getting tired of karma fortunes by now.roger64 ought to be getting tired of karma fortunes by now.roger64 ought to be getting tired of karma fortunes by now.roger64 ought to be getting tired of karma fortunes by now.roger64 ought to be getting tired of karma fortunes by now.roger64 ought to be getting tired of karma fortunes by now.roger64 ought to be getting tired of karma fortunes by now.roger64 ought to be getting tired of karma fortunes by now.roger64 ought to be getting tired of karma fortunes by now.roger64 ought to be getting tired of karma fortunes by now.roger64 ought to be getting tired of karma fortunes by now.
 
Posts: 2,624
Karma: 3120635
Join Date: Jan 2009
Device: Kindle PW3 (wifi)
Endnote display in the viewer

Hi

I do not know if this question pertains to the viewer or the editor subforums. Here are two screenshots:

- The -basic- code of two footnotes I see written in the Editor (right screenshot)
- When I click on ftn17 on the viewer, the footnote is displayed this way (left screenshot). Ftn17 is correctly displayed but it also appears a part of Ftn18 (though not the small word in italics).

Ftn18 display is not requested this time and should not appear in the viewer. What triggers it? How to avoid it? Is there something wrong in my code?
Attached Thumbnails
Click image for larger version

Name:	viewer.png
Views:	313
Size:	50.3 KB
ID:	145718   Click image for larger version

Name:	code.png
Views:	316
Size:	101.2 KB
ID:	145719  
roger64 is offline   Reply With Quote
Old 01-21-2016, 06:21 AM   #2
BetterRed
null operator (he/him)
BetterRed ought to be getting tired of karma fortunes by now.BetterRed ought to be getting tired of karma fortunes by now.BetterRed ought to be getting tired of karma fortunes by now.BetterRed ought to be getting tired of karma fortunes by now.BetterRed ought to be getting tired of karma fortunes by now.BetterRed ought to be getting tired of karma fortunes by now.BetterRed ought to be getting tired of karma fortunes by now.BetterRed ought to be getting tired of karma fortunes by now.BetterRed ought to be getting tired of karma fortunes by now.BetterRed ought to be getting tired of karma fortunes by now.BetterRed ought to be getting tired of karma fortunes by now.
 
Posts: 21,660
Karma: 29711016
Join Date: Mar 2012
Location: Sydney Australia
Device: none
@roger64 - why are the div tags there, I just have p tags and all I see in the viewer note pane is the note whose link I last clicked.

But, but... in the viewer I would like the ability to scroll to previous and particularly following notes - provided the note numbers survived. Maybe I should experiment with wrapping the paragraphs in div tags Ψ²

BR
BetterRed is offline   Reply With Quote
Advert
Old 01-21-2016, 06:23 AM   #3
BobC
Guru
BobC ought to be getting tired of karma fortunes by now.BobC ought to be getting tired of karma fortunes by now.BobC ought to be getting tired of karma fortunes by now.BobC ought to be getting tired of karma fortunes by now.BobC ought to be getting tired of karma fortunes by now.BobC ought to be getting tired of karma fortunes by now.BobC ought to be getting tired of karma fortunes by now.BobC ought to be getting tired of karma fortunes by now.BobC ought to be getting tired of karma fortunes by now.BobC ought to be getting tired of karma fortunes by now.BobC ought to be getting tired of karma fortunes by now.
 
Posts: 691
Karma: 3026110
Join Date: Dec 2008
Location: Lancashire, U.K.
Device: BeBook 1, BeBook Pure, Kobo Glo, (and HD),Energy Sistem EReader Pro +
I must admit I wasn't aware that footnotes displayed like that in the viewer but I have just looked at a book I assembled with endnotes in and when there are two footnotes on a page and the first is selected I have also noted that in some (but not all) cases later endnotes also appear but without the endnote number/ backlink.

I haven't seen an example of the invisible italics.

However when I view the book with the Adobe Reader everything looks fine.

Have you checked the book with Adobe or a viewer on an actual Ebook reader ?

BobC
BobC is offline   Reply With Quote
Old 01-21-2016, 08:00 AM   #4
roger64
Wizard
roger64 ought to be getting tired of karma fortunes by now.roger64 ought to be getting tired of karma fortunes by now.roger64 ought to be getting tired of karma fortunes by now.roger64 ought to be getting tired of karma fortunes by now.roger64 ought to be getting tired of karma fortunes by now.roger64 ought to be getting tired of karma fortunes by now.roger64 ought to be getting tired of karma fortunes by now.roger64 ought to be getting tired of karma fortunes by now.roger64 ought to be getting tired of karma fortunes by now.roger64 ought to be getting tired of karma fortunes by now.roger64 ought to be getting tired of karma fortunes by now.
 
Posts: 2,624
Karma: 3120635
Join Date: Jan 2009
Device: Kindle PW3 (wifi)
I am not sure if the div are really useful. They were put by my converter and I let them here.

I can provide other examples where the new footnote appears when it should not and without any div this time. This "extra" display of the next footnote seems to stop when it finds a span or another tag like the i.

I don't use the Adobe viewer because I use Linux.

Two other screenshots from another book (without div) with the same "next" display.
Attached Thumbnails
Click image for larger version

Name:	code2.png
Views:	243
Size:	67.3 KB
ID:	145721   Click image for larger version

Name:	viewer2.png
Views:	285
Size:	109.4 KB
ID:	145722  

Last edited by roger64; 01-21-2016 at 08:58 AM.
roger64 is offline   Reply With Quote
Old 01-21-2016, 10:40 AM   #5
BobC
Guru
BobC ought to be getting tired of karma fortunes by now.BobC ought to be getting tired of karma fortunes by now.BobC ought to be getting tired of karma fortunes by now.BobC ought to be getting tired of karma fortunes by now.BobC ought to be getting tired of karma fortunes by now.BobC ought to be getting tired of karma fortunes by now.BobC ought to be getting tired of karma fortunes by now.BobC ought to be getting tired of karma fortunes by now.BobC ought to be getting tired of karma fortunes by now.BobC ought to be getting tired of karma fortunes by now.BobC ought to be getting tired of karma fortunes by now.
 
Posts: 691
Karma: 3026110
Join Date: Dec 2008
Location: Lancashire, U.K.
Device: BeBook 1, BeBook Pure, Kobo Glo, (and HD),Energy Sistem EReader Pro +
I tend to use Adobe as the "Standard" that I can check ebooks against; I even have a copy on my Linux Laptop (with Wine installed) for exactly that reason.

I've just been looking at a book I created from a Gutenberg text where the endnotes behave correctly in Adobe but not in the Calibre Viewer.

These are fragments of the code together with the targets :

Code:
 <p>Nos. 13 and 20 are justly attributed to the times of the Crusaders,<small><a href="../Text/Maeshowe_0010.html#f4" id="f4.1">[4]</a></small> but many of the other inscriptions
The above displays correctly in a footnote box.

Code:
  <p><i>To the north-west a great treasure has been hid (but few believe that), a great treasure was hid here.</i><small><a href="../Text/Maeshowe_0010.html#f5" id="f5.1">[5]</a></small> <i>Simon sigr (victor)
This one doesn't -it follows the hypelink in the main dispay area

Code:
  <p class="center"><br/>
  <span class="smcap">Bot Ær Oktil at Sokua, Suo in Kotalant.</span><small><a href="../Text/Maeshowe_0010.html#f6" id="f6.1">[6]</a></small> <i>Sua Inklant.<br/>
Again this one follows the link in the main window.


These are the target endnotes :

Code:
<p><a href="../Text/Maeshowe_0009.html#f4.1" id="f4">[4]</a> Professor Munch supposes that the Jerusalem travellers, who are described in No. 13 as having broken into the how, were connected with an expedition organized by Earl Ragnvald to the Holy Land. He says “many of the northern warriors joined the Earl in 1152. They assembled in Orkney, and after passing the winter there, sailed in the spring of 1153, and after being in Spain in December of that year, reached the Holy Land in August 1154; they went thence to Constantinople, where they passed the Christmas of 1154-55, returning home by different routes. During their stay in Orkney they had frequent quarrels with the inhabitants.” As some of the inscriptions seem to indicate the existence of treasure in the tumulus, it is not unlikely that it should have been examined by these warriors, and that they afterwards inscribed their names, together with other remarks, on the walls.</p>

  <p><a href="../Text/Maeshowe_0010.html#f5.1" id="f5">[5]</a> There is a similar allusion to hid treasure on the wall of a rock at Berrig, in the Star valley North Throndheim County—“gull faitu nin alna nither”—They hid some gold nine ells deep in the earth.</p>

  <p><a href="../Text/Maeshowe_0010.html#f6.1" id="f6">[6]</a> This (“evidently very difficult carving,” says Professor Stephens) may be taken as a fair specimen of the Bind-rune form of writing.</p>
All of which form a continuous block of code.

So three footnotes and only one displays in the footnote box of the viewer - something odd there, also when I display the first of these (in the footnote box) the following two also appear but without the reference numbers, i.e. the problem that roger64 originally mentioned.

The book I've constructed is well in the PD and I can attach a copy if anyone wants to examine it - just yell.

It looks to me like a problem with the Calibre Viewer and how it decides just what should be displayed as a footnote, rather than being treated as a simple hypertext link.

BobC

Last edited by BobC; 01-21-2016 at 10:43 AM. Reason: spelling correction
BobC is offline   Reply With Quote
Advert
Old 01-21-2016, 10:31 PM   #6
nqk
Fanatic
nqk does all things with Zen-like beautynqk does all things with Zen-like beautynqk does all things with Zen-like beautynqk does all things with Zen-like beautynqk does all things with Zen-like beautynqk does all things with Zen-like beautynqk does all things with Zen-like beautynqk does all things with Zen-like beautynqk does all things with Zen-like beautynqk does all things with Zen-like beautynqk does all things with Zen-like beauty
 
Posts: 564
Karma: 32228
Join Date: Feb 2012
Device: Onyx Boox Leaf
@BobC and @roger64,

Could you try to move the id to p tag and see how it is displayed.
Code:
<p id="f5"><a href="../Text/Maeshowe_0010.html#f5.1">[5]</a> There is a similar allusion to hid treasure on the wall of a rock at Berrig, in the Star valley North Throndheim County—“gull faitu nin alna nither”—They hid some gold nine ells deep in the earth.</p>
In my case, I even use <aside> tags, I'm not sure if it is an overkill but it works fine. (Calibre Viewer, Moon+ Reader, FBreader, Kindle Paperwhite (converted to azw3)
Code:
<aside id="n1" epub:type="footnote">
    <p class="note"><a href="#nl1">[1]</a>  footnote texts.</p>
</aside>
It looks long but I've set snippnet for it, so it's no big deal.
Attached Files
File Type: epub Endnote testing - NQK.epub (5.1 KB, 186 views)

Last edited by nqk; 01-21-2016 at 11:43 PM.
nqk is offline   Reply With Quote
Old 01-22-2016, 03:25 AM   #7
roger64
Wizard
roger64 ought to be getting tired of karma fortunes by now.roger64 ought to be getting tired of karma fortunes by now.roger64 ought to be getting tired of karma fortunes by now.roger64 ought to be getting tired of karma fortunes by now.roger64 ought to be getting tired of karma fortunes by now.roger64 ought to be getting tired of karma fortunes by now.roger64 ought to be getting tired of karma fortunes by now.roger64 ought to be getting tired of karma fortunes by now.roger64 ought to be getting tired of karma fortunes by now.roger64 ought to be getting tired of karma fortunes by now.roger64 ought to be getting tired of karma fortunes by now.
 
Posts: 2,624
Karma: 3120635
Join Date: Jan 2009
Device: Kindle PW3 (wifi)
@nqk

Thanks for your quite interesting EPUB. I observe also that solutions 2 and 3 work fine for the Calibre viewer (only one note displayed).

However, with Epubcheck, this EPUB triggers 16 errors, mainly because it's an EPUB2 with "incorrect" EPUB3 tags and attributes (noteref, aside, epub-type, etc.).

As such I am afraid that this solution can't be "officially" recommended for EPUB2 books which form the majority of our libraries.

What is curious is that the Calibre Editor does not support EPUB3 while some EPUB3 features like this one seems to fit the Viewer the best.

The idea to insert the id in the p tag does not seem good either because sometimes the a tag can be quite far away from the opening paragraph tag. Maybe putting the id in an attached or encapsulated "dummy" span (I mean just created for this purpose) would do it.

I really would feel better if we had some advice coming from Kovid Goyal on this endnote display topic.

Last edited by roger64; 01-22-2016 at 03:58 AM. Reason: dummy span
roger64 is offline   Reply With Quote
Old 01-22-2016, 04:36 AM   #8
BobC
Guru
BobC ought to be getting tired of karma fortunes by now.BobC ought to be getting tired of karma fortunes by now.BobC ought to be getting tired of karma fortunes by now.BobC ought to be getting tired of karma fortunes by now.BobC ought to be getting tired of karma fortunes by now.BobC ought to be getting tired of karma fortunes by now.BobC ought to be getting tired of karma fortunes by now.BobC ought to be getting tired of karma fortunes by now.BobC ought to be getting tired of karma fortunes by now.BobC ought to be getting tired of karma fortunes by now.BobC ought to be getting tired of karma fortunes by now.
 
Posts: 691
Karma: 3026110
Join Date: Dec 2008
Location: Lancashire, U.K.
Device: BeBook 1, BeBook Pure, Kobo Glo, (and HD),Energy Sistem EReader Pro +
Quote:
Originally Posted by nqk View Post
@BobC and @roger64,

Could you try to move the id to p tag and see how it is displayed.
Code:
<p id="f5"><a href="../Text/Maeshowe_0010.html#f5.1">[5]</a> There is a similar allusion to hid treasure on the wall of a rock at Berrig, in the Star valley North Throndheim County—“gull faitu nin alna nither”—They hid some gold nine ells deep in the earth.</p>
@npk
I've moved all the id tags to within the p tag for the footnotes and I still have the issue where footnotes 5 & 6 are being displayed in the main window rather than within the footnote window. Looking into the differences between the footnotes and I see only 5 & 6 are within the same file as their origin.

So arguably 1 -4 are endnotes but 5 & 6 are footnotes and perhaps this is the reason for the difference in the linking. I split off the file containing the "footnotes" so that they are in a separate file to prove if this is the problem and footnotes 5 & 6 now display in the footnote window

Footnotes 1,2,3 & 4 display in the footnote box and without continuing to the next footnote so moving the id has resolved the issue of the continuing display.

BobC

Last edited by BobC; 01-22-2016 at 04:49 AM. Reason: Footnote file split
BobC is offline   Reply With Quote
Old 01-22-2016, 05:11 AM   #9
BobC
Guru
BobC ought to be getting tired of karma fortunes by now.BobC ought to be getting tired of karma fortunes by now.BobC ought to be getting tired of karma fortunes by now.BobC ought to be getting tired of karma fortunes by now.BobC ought to be getting tired of karma fortunes by now.BobC ought to be getting tired of karma fortunes by now.BobC ought to be getting tired of karma fortunes by now.BobC ought to be getting tired of karma fortunes by now.BobC ought to be getting tired of karma fortunes by now.BobC ought to be getting tired of karma fortunes by now.BobC ought to be getting tired of karma fortunes by now.
 
Posts: 691
Karma: 3026110
Join Date: Dec 2008
Location: Lancashire, U.K.
Device: BeBook 1, BeBook Pure, Kobo Glo, (and HD),Energy Sistem EReader Pro +
[QUOTE=roger64;3244909
I really would feel better if we had some advice coming from Kovid Goyal on this endnote display topic.[/QUOTE]

When you think about it footnotes / endnotes are coded just like any other hypertext links and how we expect them to display depends purely on whether they are real foot/end notes or simple links. I don't think there is any provision in EPUB2 (unlike FB2 for instance where notes appear at the bottom of a page as in WP programs such as Word or LibreOffice) for distinguishing between the two. About the only difference is that end/footnotes usually (but not necessarily) contain a "backlink" to return you to the original text

As most books will probably contain just notes rather than simple links it might be useful if the viewer had an option to disable the display of links in the footnote box as a viewer preference. This would allow someone viewing a book containing internal links rather than notes to view the book as intended, i.e. by following the link in the main window.

BobC
BobC is offline   Reply With Quote
Old 01-22-2016, 06:45 AM   #10
davidfor
Grand Sorcerer
davidfor ought to be getting tired of karma fortunes by now.davidfor ought to be getting tired of karma fortunes by now.davidfor ought to be getting tired of karma fortunes by now.davidfor ought to be getting tired of karma fortunes by now.davidfor ought to be getting tired of karma fortunes by now.davidfor ought to be getting tired of karma fortunes by now.davidfor ought to be getting tired of karma fortunes by now.davidfor ought to be getting tired of karma fortunes by now.davidfor ought to be getting tired of karma fortunes by now.davidfor ought to be getting tired of karma fortunes by now.davidfor ought to be getting tired of karma fortunes by now.
 
Posts: 24,905
Karma: 47303824
Join Date: Jul 2011
Location: Sydney, Australia
Device: Kobo:Touch,Glo, AuraH2O, GloHD,AuraONE, ClaraHD, Libra H2O; tolinoepos
Quote:
Originally Posted by roger64 View Post
@nqk

Thanks for your quite interesting EPUB. I observe also that solutions 2 and 3 work fine for the Calibre viewer (only one note displayed).

However, with Epubcheck, this EPUB triggers 16 errors, mainly because it's an EPUB2 with "incorrect" EPUB3 tags and attributes (noteref, aside, epub-type, etc.).

As such I am afraid that this solution can't be "officially" recommended for EPUB2 books which form the majority of our libraries.

What is curious is that the Calibre Editor does not support EPUB3 while some EPUB3 features like this one seems to fit the Viewer the best.

The idea to insert the id in the p tag does not seem good either because sometimes the a tag can be quite far away from the opening paragraph tag. Maybe putting the id in an attached or encapsulated "dummy" span (I mean just created for this purpose) would do it.

I really would feel better if we had some advice coming from Kovid Goyal on this endnote display topic.
I've just been playing and looking at the code. The short answer is: put the id on the p tag. Or div or whatever you are using.

Basically what is happening is that a footnote is everything from the tag containing the destination id, to the next tag that has an id. So, it the ids are in successive p tags, then only that paragraph will be shown as the footnote.

There's a complication if the id is in a contained tag. For the start of the footnote, the parents of the tag with the id in it are shown. For the end of footnote, the parent tag is shown, but none of the child tags are shown.

As an example of this, taken from nqk's sample, with the following in the footnotes:

Code:
<p class="note"><a href="1.xhtml#nl1" id="n1">[1]</a>  Note 1.</p>
<p class="note"> <b>Note 2.<a href="1.xhtml#nl2" id="n2">[2]</a>Note 2a.</b>Note 2b. <b>Note 2c.</b></p>
<p class="note"><a href="1.xhtml#nl3" id="n3">[3]</a>  Note 3.</p>
And the footnote references are:

Code:
<p>The quick brown fox jumps over the lazy dog.<a href="1_split1.xhtml#n1" id="nl1" epub:type="noteref"><sup>(1)</sup></a></p>
<p>The quick brown fox jumps over the lazy dog.<a href="1_split1.xhtml#n2" id="nl2" epub:type="noteref"><sup>(2)</sup></a></p>
Clicking the first link shows:

Code:
[1] Note 1.
Note 2.Note 2a.Note 2b.
In this, the anchor is not displayed, the text in the parent p is, but no other children of the p are shown.

Clicking the second link, shows:

Code:
Note 2.[2]Note 2a.Note 2b. Note 2c.
Note 3.
davidfor is offline   Reply With Quote
Old 01-22-2016, 09:32 AM   #11
roger64
Wizard
roger64 ought to be getting tired of karma fortunes by now.roger64 ought to be getting tired of karma fortunes by now.roger64 ought to be getting tired of karma fortunes by now.roger64 ought to be getting tired of karma fortunes by now.roger64 ought to be getting tired of karma fortunes by now.roger64 ought to be getting tired of karma fortunes by now.roger64 ought to be getting tired of karma fortunes by now.roger64 ought to be getting tired of karma fortunes by now.roger64 ought to be getting tired of karma fortunes by now.roger64 ought to be getting tired of karma fortunes by now.roger64 ought to be getting tired of karma fortunes by now.
 
Posts: 2,624
Karma: 3120635
Join Date: Jan 2009
Device: Kindle PW3 (wifi)
Quote:
Originally Posted by davidfor View Post
I've just been playing and looking at the code. The short answer is: put the id on the p tag. Or div or whatever you are using.
@davidfor

I am not sure I understood the explanations but nqk and you may be right.

Here is an attached EPUB2 which displays in the Viewer only one footnote at a time because the id attribute has been moved from the a tag to the p tag. Also included is the regex (in .json format) I used to move the ids for the seven endnotes.

So no EPUB3 attribute is used.

This is OK in the Viewer, it remains to be seen how it displays on other software.

Of course, when producing an EPUB3, there will be a need for a new regex.
Attached Files
File Type: zip identifier.zip (173.3 KB, 208 views)

Last edited by roger64; 01-22-2016 at 09:40 AM.
roger64 is offline   Reply With Quote
Old 01-22-2016, 10:34 AM   #12
nqk
Fanatic
nqk does all things with Zen-like beautynqk does all things with Zen-like beautynqk does all things with Zen-like beautynqk does all things with Zen-like beautynqk does all things with Zen-like beautynqk does all things with Zen-like beautynqk does all things with Zen-like beautynqk does all things with Zen-like beautynqk does all things with Zen-like beautynqk does all things with Zen-like beautynqk does all things with Zen-like beauty
 
Posts: 564
Karma: 32228
Join Date: Feb 2012
Device: Onyx Boox Leaf
It doesn't popup in FBreader, but ok in Moon+ and Google play book.
nqk is offline   Reply With Quote
Old 01-22-2016, 12:32 PM   #13
BobC
Guru
BobC ought to be getting tired of karma fortunes by now.BobC ought to be getting tired of karma fortunes by now.BobC ought to be getting tired of karma fortunes by now.BobC ought to be getting tired of karma fortunes by now.BobC ought to be getting tired of karma fortunes by now.BobC ought to be getting tired of karma fortunes by now.BobC ought to be getting tired of karma fortunes by now.BobC ought to be getting tired of karma fortunes by now.BobC ought to be getting tired of karma fortunes by now.BobC ought to be getting tired of karma fortunes by now.BobC ought to be getting tired of karma fortunes by now.
 
Posts: 691
Karma: 3026110
Join Date: Dec 2008
Location: Lancashire, U.K.
Device: BeBook 1, BeBook Pure, Kobo Glo, (and HD),Energy Sistem EReader Pro +
The following is only about whether the footnotes display in a separate window in the Calibre viewer, as I have realised, and not the "continuation " issue.

Some time ago I took a decision that where possible I would, when constructing an ebook, have notes as footnotes (i.e. they would be at the end of the chapter which referred to them) rather than endnotes (all consolidated in a single file at the end of the book). The reason for this was that I mainly viewed books on the Bebook 1, a slow device and I reasoned that it would take less processing to skip between locations in the same file rather than having to open another file and then go back to the first one.

Most of the books I have built in this way are done in LibreOffice and then exported using the writer2epub add-on (IIRC roger64 uses or used this export mechanism), and the links it builds have the id of the footnote not included in the <p> tag.

The result seems to be that on any books I have built this way I have never even seen the "footnote" window which as far as I can see is only triggered when the footnotes themselves are in a different file from the referring link. (The book I provided the extracts from was a modified Gutenberg one so didn't follow that principle)

Having looked at displays in other readers including Adobe, in general they seem to display notes in the same window, although I think ALreader does have an option to display footnotes at the bottom of the page containing the reference, though I haven't had much experience with ALreader only just having acquired an Android ereader.

Designing a book with a particular viewer's idiosyncrasies in mind strikes me as a sure recipe for problems, however if the book is just for your own consumption then your rules apply.

BobC
BobC is offline   Reply With Quote
Old 01-22-2016, 07:34 PM   #14
roger64
Wizard
roger64 ought to be getting tired of karma fortunes by now.roger64 ought to be getting tired of karma fortunes by now.roger64 ought to be getting tired of karma fortunes by now.roger64 ought to be getting tired of karma fortunes by now.roger64 ought to be getting tired of karma fortunes by now.roger64 ought to be getting tired of karma fortunes by now.roger64 ought to be getting tired of karma fortunes by now.roger64 ought to be getting tired of karma fortunes by now.roger64 ought to be getting tired of karma fortunes by now.roger64 ought to be getting tired of karma fortunes by now.roger64 ought to be getting tired of karma fortunes by now.
 
Posts: 2,624
Karma: 3120635
Join Date: Jan 2009
Device: Kindle PW3 (wifi)
@nqk
Thanks for your trials.

Quote:
Originally Posted by BobC View Post
Most of the books I have built in this way are done in LibreOffice and then exported using the writer2epub add-on (IIRC roger64 uses or used this export mechanism), and the links it builds have the id of the footnote not included in the <p> tag.
I use writer2xhtml which is part of writer2latex and is quite different from writer2epub. But il also does not include any id in the p tag.

Quote:
Designing a book with a particular viewer's idiosyncrasies in mind strikes me as a sure recipe for problems, however if the book is just for your own consumption then your rules apply.
Of course you are right.

It's good to know we have a solution that can be implemented easily if one considers this faulty display in the Viewer to be a serious problem but, if we were logical, this should also be applied recursively to all the other EPUB2 (and this would trigger problems because we would need a lot of different versions of the regex).

Basically, the point is that the code we are trying to mend is perfectly sound.

With the EPUB3 incoming, at least we know that a standard compliant code will work (as shown on nqk's first EPUB).

Last edited by roger64; 01-22-2016 at 07:52 PM.
roger64 is offline   Reply With Quote
Old 01-22-2016, 11:18 PM   #15
davidfor
Grand Sorcerer
davidfor ought to be getting tired of karma fortunes by now.davidfor ought to be getting tired of karma fortunes by now.davidfor ought to be getting tired of karma fortunes by now.davidfor ought to be getting tired of karma fortunes by now.davidfor ought to be getting tired of karma fortunes by now.davidfor ought to be getting tired of karma fortunes by now.davidfor ought to be getting tired of karma fortunes by now.davidfor ought to be getting tired of karma fortunes by now.davidfor ought to be getting tired of karma fortunes by now.davidfor ought to be getting tired of karma fortunes by now.davidfor ought to be getting tired of karma fortunes by now.
 
Posts: 24,905
Karma: 47303824
Join Date: Jul 2011
Location: Sydney, Australia
Device: Kobo:Touch,Glo, AuraH2O, GloHD,AuraONE, ClaraHD, Libra H2O; tolinoepos
Quote:
Originally Posted by roger64 View Post
Here is an attached EPUB2 which displays in the Viewer only one footnote at a time because the id attribute has been moved from the a tag to the p tag. Also included is the regex (in .json format) I used to move the ids for the seven endnotes.
Yes, that's the way to do it. And as footnotes tend to be a single paragraph, it will work well.
Quote:
So no EPUB3 attribute is used.

This is OK in the Viewer, it remains to be seen how it displays on other software.

Of course, when producing an EPUB3, there will be a need for a new regex.
The calibre viewer does take hints from epub3 attributes if they exist. If the link has "epub:type=noteref", it will be treated as a link to a footnote. And "epub:type=link" will be treated as a link. If the footnote has "epub:type=footnote", it will also be treated as a footnote. Types 'note' and 'rearnote' will also be treated as footnotes.

There are other things about the link that can help. If the verticAlign is 'sub', 'super', 'top' or 'bottom', it will be treated as a link to a footnote.

As to other applications and readers, I've checked on my Kobo. The RMSDK based epub reader doesn't do popups for footnotes at all. They are always treated as a link and open the page. But, it doesn't like the epup:type attribute. When it finds one, it doesn't render the rest of the page.

The kepub renderer shows a popup for all the samples. The only problem I see is that in my sample where I had the anchor part way through the note, it didn't show the beginning of the sentence. The note started with the text inside the anchor.

The kepub renderer also handled the epub:type attributes. But, it is an epub 3 renderer and my guess is that they aren't checking the epub version when handling these type of attributes. Or maybe it is just ignoring the attributes.
davidfor is offline   Reply With Quote
Reply


Forum Jump

Similar Threads
Thread Thread Starter Forum Replies Last Post
Two columns display in the viewer? femto Calibre 4 06-02-2020 04:45 PM
ebook-viewer display i9mages crutledge Calibre 4 02-07-2014 05:36 PM
0.8.44 E-book Viewer display bug? Lucian Calibre 2 03-30-2012 08:42 AM
Two columns display in the viewer? again...? pollito pito Calibre 1 12-11-2010 11:29 PM
Two columns display in the viewer? (facing pages) pollito pito Calibre 6 04-17-2010 08:09 AM


All times are GMT -4. The time now is 05:58 AM.


MobileRead.com is a privately owned, operated and funded community.