04-17-2021, 03:07 PM | #1 |
Enthusiast
Posts: 37
Karma: 10
Join Date: Nov 2010
Device: none
|
Table of Contents question
Is it possible to have this Sigil point to the same page more than one time in the table of contents?
For example: Table of Contents ABC Listing: A B C Listing by topic: C A B So in other words if I put xhtml pages A, B and C under heading ABC Listing. Can I then put them under Listing by topic but in a different order? I know I can copy the pages and call them a new name but then if I have to change something on page A I would have to do it in more than one location. If I can someone point to the same page I would only have to make the change one time. I hope this is clear. Thank you, Linda |
04-17-2021, 03:13 PM | #2 |
Librocubicularist
Posts: 617
Karma: 11908623
Join Date: Dec 2013
Location: Germany
Device: PocketBook InkPad 3 & Touch HD 3, Kobo Clara HD, Kindle Paperwhite 5
|
It's possible as the ToC only contains links. Just create another link and have it point to any location you need, even one used before already.
|
04-17-2021, 03:24 PM | #3 |
Sigil Developer
Posts: 7,644
Karma: 5433388
Join Date: Nov 2009
Device: many
|
That is fine in an HTML toc, but for the NCX epubcheck frowns on two links to the same destination with different play orders. The trick is to add an anchor with an additional id but no txt right before your desired anchor. Now you can havetwo different destination ids that effectively go to the same location.
|
04-17-2021, 04:07 PM | #4 |
Enthusiast
Posts: 37
Karma: 10
Join Date: Nov 2010
Device: none
|
I am sorry I do not know how to use anchors and ids. Could you point me to instructions or instruct on how to do that?
Thank you! So glad to know there is a way! |
04-17-2021, 06:19 PM | #5 |
Sigil Developer
Posts: 7,644
Karma: 5433388
Join Date: Nov 2009
Device: many
|
Try using google and search the web for beginners guides to html. I am sure there are many of them. And once you have those down, there are many intermediate and advanced guides that are available as well.
Creating a good epub with Sigil/PageEdit does require a basic knowledge of html and css. Learning those skills are valuable for epub production. Last edited by KevinH; 04-17-2021 at 06:24 PM. |
04-17-2021, 10:45 PM | #6 |
just an egg
Posts: 1,586
Karma: 4300000
Join Date: Mar 2015
Device: Kindle, iOS
|
@shore_pk — I find w3schools.com quite helpful. There are tutorials and reference pages to help you learn html/css.
anchors: https://www.w3schools.com/tags/tag_a.asp ids: https://www.w3schools.com/html/html_id.asp |
04-18-2021, 04:13 AM | #7 | |||
Wizard
Posts: 2,297
Karma: 12126329
Join Date: Jul 2012
Device: Kobo Forma, Nook
|
Quote:
TOCs are very important for ebooks, as it lets the EPUB reader know which order chapters go in + how many "pages" are left while reading. And 99.9% of the time, duplicates are accidents. (I'll explain further below.) Quote:
Are you creating a list of recipes by category+main-ingredient? A list of poems by year+author? Perhaps there'll be an alternate way to organize or some other solution. Quote:
Before: Chapter01.xhtml: Code:
<body> <h2>Chapter 1</h2> <p>There once was a time before time [...].</p> Code:
<h2>Table of Contents</h2> <p class="toc"><a href="../Text/Chapter01.xhtml">Chapter 1</a></p> <p class="toc"><a href="../Text/Chapter02.xhtml">Chapter 2</a></p> <p class="toc"><a href="../Text/Chapter03.xhtml">Chapter 3</a></p> [...] <h2>Alternate Table of Contents</h2> <p class="toc"><a href="../Text/Chapter03.xhtml">Chapter 3</a></p> <--- Duplicate Warning <p class="toc"><a href="../Text/Chapter02.xhtml">Chapter 2</a></p> <--- Duplicate Warning <p class="toc"><a href="../Text/Chapter01.xhtml">Chapter 1</a></p> <--- Duplicate Warning You'd want to add an "id" in your anchor, like KevinH suggested: Chapter01.xhtml: Code:
<body>
<h2 id="Chapter01">Chapter 1</h2>
<p>There once was a time before [...].</p>
It doesn't do anything by itself, but... You can tell a link to jump to that exact location by using a special symbol: #: TOC.xhtml: Code:
<h2>Table of Contents</h2>
<p class="toc"><a href="../Text/Chapter01.xhtml">Chapter 1</a></p>
<p class="toc"><a href="../Text/Chapter02.xhtml">Chapter 2</a></p>
<p class="toc"><a href="../Text/Chapter03.xhtml">Chapter 3</a></p>
[...]
<h2>Alternate Table of Contents</h2>
<p class="toc"><a href="../Text/Chapter03.xhtml">Chapter 3</a></p> <--- Duplicate Warning
<p class="toc"><a href="../Text/Chapter02.xhtml">Chapter 2</a></p> <--- Duplicate Warning
<p class="toc"><a href="../Text/Chapter01.xhtml#Chapter01">Chapter 1</a></p>
Code:
<a href="../Text/Chapter01.xhtml">
And the 2nd link: Code:
<a href="../Text/Chapter01.xhtml#Chapter01">
That id just so happens to exist at the tippy top of the file as well, so they act nearly the same when the reader clicks on them. Anyway, this would get rid of your little warnings... but as I said above, there may be a much better solution out there. Last edited by Tex2002ans; 04-18-2021 at 04:23 AM. |
|||
04-19-2021, 11:39 AM | #8 |
Enthusiast
Posts: 37
Karma: 10
Join Date: Nov 2010
Device: none
|
Ok. Ty. I will see what I can come up with later today!
|
04-19-2021, 12:23 PM | #9 |
Enthusiast
Posts: 37
Karma: 10
Join Date: Nov 2010
Device: none
|
I am trying to make a book that is a collection of booklists and reviews. I need all of them listed alphabetically, the historical books listed chronologically and the science and nature books listed alphabetically. I have around 80 listings and will have more in the future. Instead of the toc having so many listings it will have these three (plus a few others that are for other things in the book).
I think I will just create 3 pages that have all of the listings on each page in the order I want them. I think this will keep it cleaner in the toc and also easier for me to. Is there a way to have page numbers in Sigil? I couldn't find one but would like to as I'm going to print a copy of the book. I would also want to put the page number with each hyperlinked listing on each of the 80 listings, if possible. Thanks again! |
04-19-2021, 12:30 PM | #10 |
Sigil Developer
Posts: 7,644
Karma: 5433388
Join Date: Nov 2009
Device: many
|
Create an index
|
04-19-2021, 01:04 PM | #11 |
Enthusiast
Posts: 37
Karma: 10
Join Date: Nov 2010
Device: none
|
Ah! Thank you!
|
04-19-2021, 02:23 PM | #12 | |||
Wizard
Posts: 2,297
Karma: 12126329
Join Date: Jul 2012
Device: Kobo Forma, Nook
|
Quote:
- Table of Contents - Alphabetical - Chronological * * * Tip: In your actual HTML files, be sure to use proper headings: Code:
<h1>Part 1: Animals Doing Wacky Things</h1> <h2>Chapter 1: The Cow Jumps</h2> <h3>1.1. Over the Moon</h3> <h3>1.2. Over the Barn</h3> From there, you'd have to manually recreate the Alphabetical/Chronological versions: Table of Contents (This needs to be in your "actual reading order", like in a physical book, "from Page 1->99".) Code:
<h2>Table of Contents</h2> <p class="toc"><a href="../Text/Chapter01.xhtml">1. The Journey</a></p> <p class="toc"><a href="../Text/Chapter02.xhtml">2. Begins</a></p> <p class="toc"><a href="../Text/Chapter03.xhtml">3. Here</a></p> Code:
<h2>Alphabetical</h2> <h3>B Stories</h3> <p class="toc"><a href="../Text/Chapter02.xhtml">2. Begins</a></p> <h3>H Stories</h3> <p class="toc"><a href="../Text/Chapter03.xhtml">3. Here</a></p> <h3>T Stories</h3> <p class="toc"><a href="../Text/Chapter01.xhtml">1. The Journey</a></p> Code:
<h2>Chronological</h2> <h3>2000 Stories</h3> <p class="toc"><a href="../Text/Chapter03.xhtml">3. Here</a></p> <h3>2001 Stories</h3> <p class="toc"><a href="../Text/Chapter01.xhtml">1. The Journey</a></p> <h3>2002 Stories</h3> <p class="toc"><a href="../Text/Chapter02.xhtml">2. Begins</a></p> ... there's no such thing as "pages" in ebooks. All you'll need to do is link to the correct chapter/subchapter. Quote:
Quote:
In the Print book, yes, include page numbers in the TOC + headers/footers. But in the Ebook, that stuff doesn't belong, because there's no such thing as page #s! Side Note: Over the years, there's been TONS of discussion about this... and a similar idea comes up from "geniuses" who decide to leave the physical book's page numbers smack dab in the middle of text: Code:
<p>This is a very long sentence that</p> <p>199</p> <p>is split between two pages.</p> Last edited by Tex2002ans; 04-19-2021 at 02:39 PM. |
|||
04-21-2021, 10:50 AM | #13 |
mostly an observer
Posts: 1,515
Karma: 987654
Join Date: Dec 2012
Device: Kindle
|
For a print edition, upload a right-sized, error-free PDF, with any images at 300 dots per inch. To look like a trade paperback, choose 5.5x8.5 inches if it's under 300 pages, though you might go to 6x9 if it's longer. 12 point type is best; 11 point if you're really trying to squeeze. (This isn't a mass-market paperback on a revolving rack at the drugstore!)
Choose mirrored pages, margins a minimum of 0.5 inch on the three outside edges, with a gutter (inside edge) 0.8 - 1.0 inch depending on the number of pages from 100 to 400. Spend a LOT of time getting it right. You can do this in Word, though I actually prefer OpenOffice Writer for the final tweaking and outputting the PDF. I don't use headers, so as to avoid the tradition (which I respect) that there should be no headers or footers on any page in the front matter, that begins a chapter, or that is blank or has a full-page image. Rather I center the page number in the footer, which falls outside the bottom margin, but 0.5 inch is enough to avoid trespassing on the no-go zone. Get a physical proof copy if you possibly can and spend a LOT of time examining it. |
04-22-2021, 10:31 PM | #14 | |
Guru
Posts: 668
Karma: 929286
Join Date: Apr 2014
Device: PW-3, iPad, Android phone
|
Quote:
However, you can embed the physical page numbers as anchors, and then an index links to that. e.g. the index has entries like this: Code:
<li class="indexmain" id="idx1_34"><span epub:type="index-term">Apollo program,</span> <a epub:type="index-locator" href="../Text/ch50.xhtml#page_417">417</a></li> Code:
“Every day felt a bit like a roller coaster, where we <span aria-label="page 417" epub:type="pagebreak" id="page_417" role="doc-pagebreak"></span>discovered a new problem If DIY, can use simpler anchors like Code:
<a id="page_417"></a> Last edited by AlanHK; 04-22-2021 at 10:43 PM. |
|
04-23-2021, 12:49 AM | #15 | |
Wizard
Posts: 2,297
Karma: 12126329
Join Date: Jul 2012
Device: Kobo Forma, Nook
|
Quote:
|
|
|
Similar Threads | ||||
Thread | Thread Starter | Forum | Replies | Last Post |
Touch Question about Table of Contents and STR | apastuszak | Barnes & Noble NOOK | 4 | 06-30-2011 08:13 AM |
Table Of Contents Question | Humble | Calibre | 2 | 07-26-2010 09:10 PM |
Question Regarding Table of Contents | Guns4Hire | Sigil | 2 | 01-12-2010 11:15 PM |
Table of contents and time question | lizzielou | Sony Reader | 2 | 11-29-2009 04:48 AM |