Register Guidelines E-Books Search Today's Posts Mark Forums Read

Go Back   MobileRead Forums > E-Book Software > Sigil

Notices

Reply
 
Thread Tools Search this Thread
Old 02-06-2012, 09:54 AM   #1
yoss15
Enthusiast
yoss15 began at the beginning.
 
Posts: 37
Karma: 10
Join Date: Jul 2011
Device: Kindle
Foot Note Format

I'm trying to reformat the footnotes throughout my epub which I will be converting to mobi.

The issue was that all of my link id's were inside the <p> tags which referenced the CSS file and so if you used a link on a Kindle to get to a footnote or a chapter, the format of the text would be messed up, but if you flipped to it it was fine.

So I fixed all the chapter headings and the endnotes and I am about to fix the endnote references throughout the chapter so when you go back to them from the endnotes they are still superscripted.

My question is, what is the best way to link back to them? I've been playing with the book and it seems wrong that the links back to the references just give you the reference as the first character of the page but you can't see what the reference was actually for.

I think it would be better if it linked back to the beginning of the sentence or the paragraph that the reference is in. I only have a few purchased books but none of them do this, is this irregular or frowned upon to do?

If not then can anyone give suggestions for the best way to do this, possibly with regex?

Thanks
yoss15 is offline   Reply With Quote
Old 02-06-2012, 07:33 PM   #2
st_albert
Fanatic
st_albert calls his or her ebook reader Vera.st_albert calls his or her ebook reader Vera.st_albert calls his or her ebook reader Vera.st_albert calls his or her ebook reader Vera.st_albert calls his or her ebook reader Vera.st_albert calls his or her ebook reader Vera.st_albert calls his or her ebook reader Vera.st_albert calls his or her ebook reader Vera.st_albert calls his or her ebook reader Vera.st_albert calls his or her ebook reader Vera.st_albert calls his or her ebook reader Vera.
 
Posts: 543
Karma: 64420
Join Date: Feb 2010
Device: none
I'm not sure what you mean by this:

Quote:
Originally Posted by yoss15 View Post
The issue was that all of my link id's were inside the <p> tags which referenced the CSS file and so if you used a link on a Kindle to get to a footnote or a chapter, the format of the text would be messed up, but if you flipped to it it was fine.
Could you post a sample of the xhtml code and the css?
st_albert is offline   Reply With Quote
Old 02-06-2012, 10:38 PM   #3
yoss15
Enthusiast
yoss15 began at the beginning.
 
Posts: 37
Karma: 10
Join Date: Jul 2011
Device: Kindle
Sure, but to be clear, I have already resolved this problem. What I'm asking here is what is the common format for footnotes?

Here is the code just in case.

This is how I fixed it,
Code:
    <a id="Part_1"></a><p class="Section-Heading" id="toc_marker-4"><a id="Anchor"></a>Part I</p>
Whereas before it was

Code:
<p class="Section-Heading" id="toc_marker-4"><a id="Part_1"></a><a id="Anchor"></a>Part I</p>
Here is the CSS

Code:
p.Section-Heading {
	font-size : 1.67em;
	font-style : italic;
	font-weight : normal;
	text-decoration : none;
	font-variant : normal;
	line-height : 0.78;
	text-align : center;
	color : #000000;
	text-indent : 0px;
	margin : 9px 0px;
	line-break-before:always;
}
yoss15 is offline   Reply With Quote
Old 02-07-2012, 02:57 AM   #4
cybmole
Wizard
cybmole ought to be getting tired of karma fortunes by now.cybmole ought to be getting tired of karma fortunes by now.cybmole ought to be getting tired of karma fortunes by now.cybmole ought to be getting tired of karma fortunes by now.cybmole ought to be getting tired of karma fortunes by now.cybmole ought to be getting tired of karma fortunes by now.cybmole ought to be getting tired of karma fortunes by now.cybmole ought to be getting tired of karma fortunes by now.cybmole ought to be getting tired of karma fortunes by now.cybmole ought to be getting tired of karma fortunes by now.cybmole ought to be getting tired of karma fortunes by now.
 
Posts: 2,603
Karma: 1089170
Join Date: Sep 2010
Device: Kobo aura HD, Kobo Arc, Sony T2, Kindle Fire HDX 8.9 , Kindle for PC
in all the footnoted e-books that i have read, the footnote links back to the paragraph it came from. typically, a filepos structure is used e.g. filenote 4 has this coding
Code:
href="../Text/The_Quest__Energy%2C_Security%2C_an_split_041.html#filepos1482143"><span class="calibre10">4</span></a>
what I have messed with though is the footnote superscript styling itself. typically that forces line spacing to expand so a page with several footnote numbers looks unsightly to my eyes.
i.e. the lines with footnotes are spaced wider than other lines. ( in ADE/ sony readers anyway)
So I have altered the footnote numbers from superscripts to regular ( but small font ) numbers to overcome this.

in paper books, this does not seem to be an issue, but in e-books it is often ugly

Last edited by cybmole; 02-07-2012 at 03:01 AM.
cybmole is offline   Reply With Quote
Old 02-07-2012, 11:39 AM   #5
st_albert
Fanatic
st_albert calls his or her ebook reader Vera.st_albert calls his or her ebook reader Vera.st_albert calls his or her ebook reader Vera.st_albert calls his or her ebook reader Vera.st_albert calls his or her ebook reader Vera.st_albert calls his or her ebook reader Vera.st_albert calls his or her ebook reader Vera.st_albert calls his or her ebook reader Vera.st_albert calls his or her ebook reader Vera.st_albert calls his or her ebook reader Vera.st_albert calls his or her ebook reader Vera.
 
Posts: 543
Karma: 64420
Join Date: Feb 2010
Device: none
There are lots of ways to do things, and here's my take.

First of all, the problem I see with your improved code,

Code:
   <a id="Part_1"></a><p class="Section-Heading" id="toc_marker-4"><a id="Anchor"></a>Part I</p>
is that the <a> and <p> tags overlap. This sometimes works, and sometimes doesn't.

I presume that you (OP) and cybmole want to avoid the situation where the return from the footnote places you back on a page with the footnote number itself at the top of the page, losing the context of the footnote until you go back a page.

This can be avoided by putting the return target in a span which encloses however much context you want to include, thus:

Code:
<p class="normal"> blah blah blah... <span id="ret-fn-1">Just a second, Danger, what about my pickle?</span><span class="footnote-reference"><a href="../Text/endnotes.xhtml#fn-1" >1</a></span></span>
and the corresponding footnote itself:

Code:
  <p class="ttb-body-text-11-0-14-0"><span><a href="../Text/Chapter_0022.xhtml#ret-fn-1" id="fn-1">1</a></span> Rocky Rococo, as quoted by Firesign Theatre (1969)</p>
Of course, if you want the whole paragraph containing the footnote, just put the id="ret-fn-1" attribute in the corresponding <p> tag. Sometimes, though, the whole paragraph might be too long.

And for completeness, here's the CSS I use for the superscripted footnote numbers:

Code:
span.footnote-reference {
	font-family: "Times New Roman" , serif;
	font-weight: normal;
	font-style: normal;
	font-size: 1.00em;
	vertical-align:super;
	color: rgb(0,0,0);
	text-decoration: none;
}
And font-size can be adjusted as desired, to minimize the line-spacing effect cybmole noted, versus having the footnote too small to be readily seen.
st_albert is offline   Reply With Quote
Old 02-07-2012, 12:04 PM   #6
HarryT
eBook Enthusiast
HarryT ought to be getting tired of karma fortunes by now.HarryT ought to be getting tired of karma fortunes by now.HarryT ought to be getting tired of karma fortunes by now.HarryT ought to be getting tired of karma fortunes by now.HarryT ought to be getting tired of karma fortunes by now.HarryT ought to be getting tired of karma fortunes by now.HarryT ought to be getting tired of karma fortunes by now.HarryT ought to be getting tired of karma fortunes by now.HarryT ought to be getting tired of karma fortunes by now.HarryT ought to be getting tired of karma fortunes by now.HarryT ought to be getting tired of karma fortunes by now.
 
HarryT's Avatar
 
Posts: 62,564
Karma: 40125235
Join Date: Nov 2006
Location: UK
Device: PW2, iPad Retina Mini, iPhone 4, MS Surface Pro, Onyx T68, N7,
I really wouldn't bother with a link back from the footnote to the text. That's what the "Back" button/menu item/whatever on the reader is there for.
HarryT is online now   Reply With Quote
Old 02-07-2012, 12:34 PM   #7
dwig
Guru
dwig ought to be getting tired of karma fortunes by now.dwig ought to be getting tired of karma fortunes by now.dwig ought to be getting tired of karma fortunes by now.dwig ought to be getting tired of karma fortunes by now.dwig ought to be getting tired of karma fortunes by now.dwig ought to be getting tired of karma fortunes by now.dwig ought to be getting tired of karma fortunes by now.dwig ought to be getting tired of karma fortunes by now.dwig ought to be getting tired of karma fortunes by now.dwig ought to be getting tired of karma fortunes by now.dwig ought to be getting tired of karma fortunes by now.
 
dwig's Avatar
 
Posts: 951
Karma: 1351860
Join Date: Dec 2004
Location: Paradise (Key West, FL)
Device: Current:Kindle 3/WiFi Retired:Clie - UX50, T415, ...
Quote:
Originally Posted by HarryT View Post
I really wouldn't bother with a link back from the footnote to the text. That's what the "Back" button/menu item/whatever on the reader is there for.
So true!

The "Zen of Kindle" dictates that reader uses the Back button to return from an endnote. This results in a clean return with the page displaying the same as before the jump to the endnote.

The only need for a coded link back is if you intend to also keep the ePub version for distribution.
dwig is offline   Reply With Quote
Old 02-07-2012, 12:48 PM   #8
cybmole
Wizard
cybmole ought to be getting tired of karma fortunes by now.cybmole ought to be getting tired of karma fortunes by now.cybmole ought to be getting tired of karma fortunes by now.cybmole ought to be getting tired of karma fortunes by now.cybmole ought to be getting tired of karma fortunes by now.cybmole ought to be getting tired of karma fortunes by now.cybmole ought to be getting tired of karma fortunes by now.cybmole ought to be getting tired of karma fortunes by now.cybmole ought to be getting tired of karma fortunes by now.cybmole ought to be getting tired of karma fortunes by now.cybmole ought to be getting tired of karma fortunes by now.
 
Posts: 2,603
Karma: 1089170
Join Date: Sep 2010
Device: Kobo aura HD, Kobo Arc, Sony T2, Kindle Fire HDX 8.9 , Kindle for PC
for clarity
1. I did not author the example that I posted, just lifted it from a book that I can currently reading.
2. I hardly ever follow thru to read footnotes. as I use a sony touch screen PRS650 it requires using the stylus to accurately tap tha footnote number & the info thus found is usually just a book title. I'd prefer to have the foot note info embedded into the flow of main text, but in a smaller typeface.
3. I'd never thought of using back button to return, for a touch screen device, although the Sony does also have buttons... hmm - doesn't worjk, for this book anyway, the sony back button ( which is same as swipe for previous page) just steps back 1 screen in the footnotes list. the only way back is to tap the hyperlinked number with the stylus, & to carefully only single tap it, otherwise you get into dictionary lookup.

Last edited by cybmole; 02-07-2012 at 12:51 PM.
cybmole is offline   Reply With Quote
Old 02-07-2012, 02:08 PM   #9
mmat1
Det
mmat1 ought to be getting tired of karma fortunes by now.mmat1 ought to be getting tired of karma fortunes by now.mmat1 ought to be getting tired of karma fortunes by now.mmat1 ought to be getting tired of karma fortunes by now.mmat1 ought to be getting tired of karma fortunes by now.mmat1 ought to be getting tired of karma fortunes by now.mmat1 ought to be getting tired of karma fortunes by now.mmat1 ought to be getting tired of karma fortunes by now.mmat1 ought to be getting tired of karma fortunes by now.mmat1 ought to be getting tired of karma fortunes by now.mmat1 ought to be getting tired of karma fortunes by now.
 
mmat1's Avatar
 
Posts: 938
Karma: 1104656
Join Date: Jan 2012
Location: Zischebattem
Device: Acer Lumiread
Footnotes

as far as i can see, actually no one has answered your question.

A reference to a footnote can look like this:
<p class="does not matter"><a href="#footnote1" id="position1">Some visible text</a></p>

The footnote with a backward reference like this
<p class="footnoteclass"><a href="#position1" id="footnote1">Some visible text</a>more footnote text</p>

This works fine for me (well, at xhtml/epub, i dont know what kindel does with this)

How to get there with regex: I do not think that it's possible in one step, try to split the job, and exchange only parts of then string in one step. And there isn't a sample of your footnotes, so i can't see if there is alread a reference to jump back.

to your css: What is line-hight: 0.78 ?? millimeters, centimeters, kilometers ? :-)
mmat1 is offline   Reply With Quote
Old 02-07-2012, 02:20 PM   #10
cybmole
Wizard
cybmole ought to be getting tired of karma fortunes by now.cybmole ought to be getting tired of karma fortunes by now.cybmole ought to be getting tired of karma fortunes by now.cybmole ought to be getting tired of karma fortunes by now.cybmole ought to be getting tired of karma fortunes by now.cybmole ought to be getting tired of karma fortunes by now.cybmole ought to be getting tired of karma fortunes by now.cybmole ought to be getting tired of karma fortunes by now.cybmole ought to be getting tired of karma fortunes by now.cybmole ought to be getting tired of karma fortunes by now.cybmole ought to be getting tired of karma fortunes by now.
 
Posts: 2,603
Karma: 1089170
Join Date: Sep 2010
Device: Kobo aura HD, Kobo Arc, Sony T2, Kindle Fire HDX 8.9 , Kindle for PC
that is well put. I'd never coded footnotes myself & could not see how to compute those file pointer #filepos numbers as per the example I cut n pasted from an actual text. I'm guessing that they are added when book code is converted from some other format into epub ?. I see them also in some retail .toc

PS original kindle had a "browser" back button but what about Kindle touch ?
cybmole is offline   Reply With Quote
Old 02-07-2012, 02:41 PM   #11
theducks
Grand Sorcerer
theducks ought to be getting tired of karma fortunes by now.theducks ought to be getting tired of karma fortunes by now.theducks ought to be getting tired of karma fortunes by now.theducks ought to be getting tired of karma fortunes by now.theducks ought to be getting tired of karma fortunes by now.theducks ought to be getting tired of karma fortunes by now.theducks ought to be getting tired of karma fortunes by now.theducks ought to be getting tired of karma fortunes by now.theducks ought to be getting tired of karma fortunes by now.theducks ought to be getting tired of karma fortunes by now.theducks ought to be getting tired of karma fortunes by now.
 
theducks's Avatar
 
Posts: 14,230
Karma: 5495470
Join Date: Aug 2009
Location: The (original) Silicon Valley, USA
Device: Galaxy Tab 2, Astak Pocket Pro, K4NT
Quote:
Originally Posted by cybmole View Post
that is well put. I'd never coded footnotes myself & could not see how to compute those file pointer #filepos numbers as per the example I cut n pasted from an actual text. I'm guessing that they are added when book code is converted from some other format into epub ?. I see them also in some retail .toc

PS original kindle had a "browser" back button but what about Kindle touch ?
filepos is a computer conversion generated number. The anchor number can be ANY unique string value that does not start with a digit.
"filename1.html#washere"

"filename1.html#tohere"

While relative anchors are legal, Sigil can not cope if yo split the file and you end up with orphan references. I suggest you always include the Full filename path in a reference, just to be solid
theducks is offline   Reply With Quote
Old 02-07-2012, 02:45 PM   #12
DiapDealer
Grand Sorcerer
DiapDealer ought to be getting tired of karma fortunes by now.DiapDealer ought to be getting tired of karma fortunes by now.DiapDealer ought to be getting tired of karma fortunes by now.DiapDealer ought to be getting tired of karma fortunes by now.DiapDealer ought to be getting tired of karma fortunes by now.DiapDealer ought to be getting tired of karma fortunes by now.DiapDealer ought to be getting tired of karma fortunes by now.DiapDealer ought to be getting tired of karma fortunes by now.DiapDealer ought to be getting tired of karma fortunes by now.DiapDealer ought to be getting tired of karma fortunes by now.DiapDealer ought to be getting tired of karma fortunes by now.
 
DiapDealer's Avatar
 
Posts: 8,754
Karma: 39457947
Join Date: Jan 2010
Device: Nexus 7, Kindle Fire HD
Quote:
Originally Posted by mmat1 View Post
as far as i can see, actually no one has answered your question.

A reference to a footnote can look like this:
<p class="does not matter"><a href="#footnote1" id="position1">Some visible text</a></p>

The footnote with a backward reference like this
<p class="footnoteclass"><a href="#position1" id="footnote1">Some visible text</a>more footnote text</p>

This works fine for me (well, at xhtml/epub, i dont know what kindel does with this)
The OP will be using the epub to create a mobi, so to avoid a known issue with Kindlegen, the anchors need to occur before the element the intended target is in. Otherwise, the styling can be rendered incorrectly when following the link. That's the reason for the OP's intiial modifications in the first post.

To make sure the same issue doesn't happen with footnotes, the same hoops would still need jumped through...

The link in the main body of the text:
Code:
<a id="position1" /><p class="does not matter">Some text that might<a href="#footnote1">[1]</a> need some clarification.</p>
The foot/end note with a back link (if you feel you must):
Code:
<a id="footnote1" /><p class="footnoteclass"><a href="#position1">[1]</a> Some clarifying text.</p>
(Note that there is no overlapping of <a> and <p> tags)

What "works" in making an epub is not usually the same as what "works" in making an epub that's going to be converted using Kindlegen.
DiapDealer is offline   Reply With Quote
Old 02-07-2012, 03:41 PM   #13
HarryT
eBook Enthusiast
HarryT ought to be getting tired of karma fortunes by now.HarryT ought to be getting tired of karma fortunes by now.HarryT ought to be getting tired of karma fortunes by now.HarryT ought to be getting tired of karma fortunes by now.HarryT ought to be getting tired of karma fortunes by now.HarryT ought to be getting tired of karma fortunes by now.HarryT ought to be getting tired of karma fortunes by now.HarryT ought to be getting tired of karma fortunes by now.HarryT ought to be getting tired of karma fortunes by now.HarryT ought to be getting tired of karma fortunes by now.HarryT ought to be getting tired of karma fortunes by now.
 
HarryT's Avatar
 
Posts: 62,564
Karma: 40125235
Join Date: Nov 2006
Location: UK
Device: PW2, iPad Retina Mini, iPhone 4, MS Surface Pro, Onyx T68, N7,
Quote:
Originally Posted by cybmole View Post
3. I'd never thought of using back button to return, for a touch screen device, although the Sony does also have buttons... hmm - doesn't worjk, for this book anyway, the sony back button ( which is same as swipe for previous page) just steps back 1 screen in the footnotes list. the only way back is to tap the hyperlinked number with the stylus, & to carefully only single tap it, otherwise you get into dictionary lookup.
No, not the "Page Backward" button; the "Back" function (which is on the menu on the Sony), as in "undo the jump".
HarryT is online now   Reply With Quote
Old 02-07-2012, 03:43 PM   #14
HarryT
eBook Enthusiast
HarryT ought to be getting tired of karma fortunes by now.HarryT ought to be getting tired of karma fortunes by now.HarryT ought to be getting tired of karma fortunes by now.HarryT ought to be getting tired of karma fortunes by now.HarryT ought to be getting tired of karma fortunes by now.HarryT ought to be getting tired of karma fortunes by now.HarryT ought to be getting tired of karma fortunes by now.HarryT ought to be getting tired of karma fortunes by now.HarryT ought to be getting tired of karma fortunes by now.HarryT ought to be getting tired of karma fortunes by now.HarryT ought to be getting tired of karma fortunes by now.
 
HarryT's Avatar
 
Posts: 62,564
Karma: 40125235
Join Date: Nov 2006
Location: UK
Device: PW2, iPad Retina Mini, iPhone 4, MS Surface Pro, Onyx T68, N7,
Quote:
Originally Posted by cybmole View Post
PS original kindle had a "browser" back button but what about Kindle touch ?
On the KT, just tap the top of the screen to display the menu bar, then tap the back arrow at the left side of the menu bar.
HarryT is online now   Reply With Quote
Old 02-07-2012, 05:39 PM   #15
theducks
Grand Sorcerer
theducks ought to be getting tired of karma fortunes by now.theducks ought to be getting tired of karma fortunes by now.theducks ought to be getting tired of karma fortunes by now.theducks ought to be getting tired of karma fortunes by now.theducks ought to be getting tired of karma fortunes by now.theducks ought to be getting tired of karma fortunes by now.theducks ought to be getting tired of karma fortunes by now.theducks ought to be getting tired of karma fortunes by now.theducks ought to be getting tired of karma fortunes by now.theducks ought to be getting tired of karma fortunes by now.theducks ought to be getting tired of karma fortunes by now.
 
theducks's Avatar
 
Posts: 14,230
Karma: 5495470
Join Date: Aug 2009
Location: The (original) Silicon Valley, USA
Device: Galaxy Tab 2, Astak Pocket Pro, K4NT
Quote:
Originally Posted by HarryT View Post
No, not the "Page Backward" button; the "Back" function (which is on the menu on the Sony), as in "undo the jump".
HarryT
Not all readers have a Back feature.
My PEz (HanlinV5) does not . The K4 does (but it does not do EPUB )
theducks is offline   Reply With Quote
Reply

Thread Tools Search this Thread
Search this Thread:

Advanced Search

Forum Jump

Similar Threads
Thread Thread Starter Forum Replies Last Post
[Linux] Note format reader and convertor benlau Sony Reader 11 02-21-2014 05:18 AM
Stylus + PDF support + Open note format dataangel Which one should I buy? 2 12-31-2010 06:11 PM
Text (.txt) files to PRS (.note) format OutaDaDark Sony Reader 3 10-04-2010 01:26 AM
What's the .NOTE format that DR800 uses for saved notes..? martienne iRex 5 06-08-2010 01:40 PM
How to convert .note to another format? benlau Sony Reader 6 12-27-2009 10:09 AM


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


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