View Full Version : File splitting and endnotes links


mtrahan
04-23-2011, 06:06 PM
I'm still working on the same ePub I was talking about a couple days ago (http://www.mobileread.com/forums/showthread.php?t=130300)—and thus still trying to learn a thing or two about the ideal workflow I should stick to for the next books I format.

This book was split in 17 files when I first opened it. After reformating a lot of things, I created an 18th file to put the original endnotes (that weren't in the original ePub file—I'm doing this by hand). I managed to correctly create over a hundred of those endnotes, thanks to the information I found on this forum.

The original edition of this book (end of 18th century) was in six volumes, so I now want to mark the change of volume in the ePub version I'm doing. So I added a "h2.sectiontitle" class in the stylesheet, where I specified "page-break-before: always;" so that when a new volume starts, it starts on a new page.

But then I read around here that the only way to make a page-break on certain reader, like iPad, is to actually split the files at the correct place... Is that true? So the CSS I did will have no effect (the "page-break-before: always;" I mean)?

If that is true, it means I have to resplit the files in order to have the beginning of a section to start on a new page. Unfortunately, after linking all those endnotes, I don't think I will split the files differently, as I guess I will have to re-do all the linking correctly after? Am I mistaken? Or does Sigil re-adjust all the endnotes correctly when files are re-split? I would guess not. Would be too good to be true.

So, is there an easy way to split the files differently without breaking all the endnotes?

I guess the next time I will see that the file splitting/chaptering is correctly done before going to the endnotes step.

Thanks in advance for your help.

Toxaris
04-24-2011, 05:25 AM
Any good reader should honor the page-break-before. So, I would not be suprised if the iBooks would not.
The other way is to split the files more. Every new file will function as a new-chapter and thus a page break.

st_albert
04-24-2011, 11:40 AM
My experience has been that Sigil modifies the endnote links appropriately when files are split (ver 0.3.4 and below).

mtrahan
04-24-2011, 12:03 PM
Thanks again for the info. I guess I'll leave my book as it is now (too afraid to break the endnotes at this point), but I'll give it a try on another book sometime to see how exactly file splitting affect endnotes links in Sigil.

Toxaris
04-24-2011, 12:35 PM
As long as the notes are defined correctly, splitting in Sigil will work.

mtrahan
04-24-2011, 09:54 PM
Seems I haven't done my endnotes correctly... I thought I was done with the books, and passing it into FlightCrew gave me one error like this for every endnote: "value 'x' is invalid NCName".

I don't exactly understand what that means or what I didn't do correctly. I will explain what I did to create the endnotes and if anyone can show me the wrong part I would be grateful.

First, in the text I put this: <a href="../Text/index_split_18.html#1" id="1"><sup>1</sup></a>

And in the index_split_18.html files where the notes are located I put this:<p class="footnote"><a href="../Text/index_split_0.html#1" id="1">1</a>. NOTE TEXT</p> with index_split_0.html being the file where I put the first part.

I did the 130 notes like this, changing the number every time of course.

Any idea what I did wrong?

It's my last question for this ePub I swear. :)

pholy
04-24-2011, 11:49 PM
It took some searching to verify my memory, but here it is:

The id attribute value must begin with a letter in the roman alphabet (a–z or A–Z); this can be followed by any combination of letters (a–z or A–Z), digits (0–9), hyphens (-), underscores (_), colons (:), and periods (.). The id value is case sensitive, thus <span id="me">This is me</span> and <span id="ME">This is me</a> would be considered to be separate and uniquely identifiable elements on the same web page.

Maybe make your ids like "en-1" instead of "1".

mtrahan
04-25-2011, 12:19 AM
Ah, I see!

Thanks a lot, I appreciate it.

sjkramer
04-26-2011, 03:52 PM
The question of whether the page break bug has been fixed in ibooks was still up in the air as of February 2011. See Pigs, Gourds & Wikis (http://www.pigsgourdsandwikis.com/2011/02/page-breaks-turning-off-hyphenation-and.html). Someone comments that it doesn't appear to have been fixed.

mtrahan
05-01-2011, 01:50 PM
My experience has been that Sigil modifies the endnote links appropriately when files are split (ver 0.3.4 and below).

Is there something special to do after splitting a file to get Sigil modify correctly the endnotes links? I just tried splitting a file and nothing was changed in my endnotes links... (using Sigil 0.3.4)

My endnotes are done like this: in the text I put <a href="../Text/index_split_18.html#en-1" id="en-1"><sup>1</sup></a>

And in the index_split_18.html files where the notes are located I put this:<p class="footnote"><a href="../Text/index_split_0.html#en-1" id="en-1">1</a>. NOTE TEXT</p> with index_split_0.html being the file where I put the first part.

Thanks again for the help.

st_albert
05-01-2011, 04:39 PM
Is there something special to do after splitting a file to get Sigil modify correctly the endnotes links? I just tried splitting a file and nothing was changed in my endnotes links... (using Sigil 0.3.4)

My endnotes are done like this: in the text I put <a href="../Text/index_split_18.html#en-1" id="en-1"><sup>1</sup></a>

And in the index_split_18.html files where the notes are located I put this:<p class="footnote"><a href="../Text/index_split_0.html#en-1" id="en-1">1</a>. NOTE TEXT</p> with index_split_0.html being the file where I put the first part.

Thanks again for the help.

I notice that the link target "#en-1" is the same as the link id (id="en-1"). You are probably able to get away with this initially, because the endnote link and the return-from-endnote link are in separate files. But IMHO this is asking for trouble, and may be confusing the logic in Sigil that adjusts the link targets.

I advise using, say

<a href="../Text/index_split_18.html#en-1" id="txt-1"><sup>1</sup></a>

in the body of text, and then

<p class="footnote"><a href="../Text/index_split_0.html#txt-1" id="en-1">1</a>. NOTE TEXT</p>

in the endnotes. That way, there's less chance for confusion.

mtrahan
05-01-2011, 05:07 PM
st_albert, thanks a lot—you just made me understand clearly a simple thing about anchors (I'm such a noob hehe). I was doing them a bit blindly by keeping the same id for everything because I wasn't too sure how it worked...

Will update my book and re-try file splitting and see how my endnotes links react.