![]() |
#1 |
Addict
![]() Posts: 234
Karma: 40
Join Date: Apr 2010
Device: The Nook, iPad
|
how to add linkable chapters and notes for epub
I am sure it's asked and answered many times and it must be in the user guide or something, but forgive me I am attentional dyslexia, so can someone help give me a very quick answer as to how to add linkable chapters and notes in Calibre?
I am converting a txt file to epub: there are chapters in the txt file but I am not sure how to compile a linkable chapter list before the main content out of a pure text based txt file? Do I need to convert it to Word or HTML first? Second question is regarding the notes, say, if I have a note link on page 3 and paragraph 2 that has a number "1", once clicked, it will take me to the notes page at the end of each chapter or the whole book - I would like to have the note has a clickable number "1" on it also, so if I click the "1" on the note page, it will bring me back to page 3 (and paragraph 3 preferably, but not required, as bring back to page 3 is good enough). Are these doable in Calibre for txt files? if both are doable, exactly how to do this? Many thanks. |
![]() |
![]() |
![]() |
#2 | ||
US Navy, Retired
![]() ![]() ![]() ![]() ![]() ![]() ![]() ![]() ![]() ![]() ![]() Posts: 9,888
Karma: 13806776
Join Date: Feb 2009
Location: North Carolina
Device: Icarus Illumina XL HD, Kindle PaperWhite SE 11th Gen
|
Quote:
Quote:
Last edited by DoctorOhh; 08-09-2010 at 02:55 AM. |
||
![]() |
![]() |
Advert | |
|
![]() |
#3 |
Guru
![]() ![]() ![]() ![]() ![]() ![]() ![]() ![]() ![]() ![]() ![]() Posts: 776
Karma: 2751519
Join Date: Jul 2010
Location: UK
Device: PW2, Nexus7
|
Calibre works well with Markdown but the links in Markdown are really intended as simple links to web pages rather than as text reference notes. However, it can be done and I have attached an example to get you started.
The attached plain text document contains the necessary markdown and has 2 reference notes which link in both directions. A ToC is also generated which ended up at the end of my ePub but you can move this with any ePub editor. Perhaps it would be useful to have a calibre option to specify where this ToC should go. Full details of how to convert are in the document itself. It's worth reading the full Markdown specification as I have used other elements within the document to produce a better ePub. This will also stop you falling into some Markdown 'traps', e.g. 4 leading spaces on a line! Last edited by Agama; 08-09-2010 at 08:57 AM. |
![]() |
![]() |
![]() |
#4 | |
Grand Sorcerer
![]() ![]() ![]() ![]() ![]() ![]() ![]() ![]() ![]() ![]() ![]() Posts: 6,246
Karma: 16539642
Join Date: Sep 2009
Location: UK
Device: ClaraHD, Forma, Libra2, Clara2E, LibraCol, PBTouchHD3
|
Quote:
Code:
///Table of Contents/// |
|
![]() |
![]() |
![]() |
#5 |
Guru
![]() ![]() ![]() ![]() ![]() ![]() ![]() ![]() ![]() ![]() ![]() Posts: 776
Karma: 2751519
Join Date: Jul 2010
Location: UK
Device: PW2, Nexus7
|
|
![]() |
![]() |
Advert | |
|
![]() |
#6 |
Addict
![]() Posts: 234
Karma: 40
Join Date: Apr 2010
Device: The Nook, iPad
|
Thanks to all of you that replied, especially to Agama that provided the exact examples that I am asking for. Can't wait to give it a try. I forgot to mention that my source txt file is in Chinese, though I doubt there would be any difference (as there is no "#" and alphanumeric characters in Chinese so I don't expect there will be any issue). Will report after I tried.
|
![]() |
![]() |
![]() |
#7 |
Guru
![]() ![]() ![]() ![]() ![]() ![]() ![]() ![]() ![]() ![]() ![]() Posts: 776
Karma: 2751519
Join Date: Jul 2010
Location: UK
Device: PW2, Nexus7
|
The "#" characters are important as they indicate an anchor within the current page in HTML. The rest of the link id is up to you. I used "n" prefix to link to a note, and "r" prefix to return from a note.
I have now attached the ePub which results from conversion. You may well want to style your link references to make them look better, e.g. superscripts or within brackets, but be careful not to clash with Markdown. Last edited by Agama; 08-09-2010 at 10:19 AM. |
![]() |
![]() |
![]() |
#8 |
Addict
![]() Posts: 234
Karma: 40
Join Date: Apr 2010
Device: The Nook, iPad
|
Thanks, Agama, your example works fine. However, mine does not. The issues is my txt file is in Chinese and should be in unicode. If I keep the txt in unicode, the resulting Chinese characters show properly, the chapter links work fine, however the notes link does not, it always point to the first page of the document. If I check Translate unicode characters to ASCII, both the chapter and notes links work fine, but the text is unreadable. In either case, my "///Table of Contents///" does not put the TOC on the place I specified (it did put the TOC at the right place if the text is English).
|
![]() |
![]() |
![]() |
#9 |
Rock Chick
![]() ![]() ![]() ![]() ![]() ![]() ![]() ![]() ![]() ![]() ![]() Posts: 429
Karma: 4965
Join Date: May 2009
Location: near Heathrow
Device: Kindle 2i, Kindle DX, Kindle 3G
|
Agama
Thanks for this, it's really useful. I have some books that didn't work well from PDF that I have resorted to saving to text, but I am used to working with Wikis so this style of markup makes sense. Does it do the same thing if you convert a txt file to mobi? |
![]() |
![]() |
![]() |
#10 |
Guru
![]() ![]() ![]() ![]() ![]() ![]() ![]() ![]() ![]() ![]() ![]() Posts: 776
Karma: 2751519
Join Date: Jul 2010
Location: UK
Device: PW2, Nexus7
|
I don't know mobi format at all as I only use epub but markdown generates html which I guess becomes the input for calibre conversion. So if html to mobi works then I would expect markdown text to mobi to work the same way as for epub.
|
![]() |
![]() |
![]() |
#11 |
Guru
![]() ![]() ![]() ![]() ![]() ![]() ![]() ![]() ![]() ![]() ![]() Posts: 776
Karma: 2751519
Join Date: Jul 2010
Location: UK
Device: PW2, Nexus7
|
I'm not sure that unicode is to blame here as it's possible to code html files in unicode, (presumably with Chinese characters). The output from Markdown processing is html so it may be worth more investigation. Perhaps the intermediate html files, (use calibre's debug mode), may shed some light on this problem.
|
![]() |
![]() |
![]() |
#12 |
i warned you ...
![]() ![]() ![]() Posts: 54
Karma: 222
Join Date: Apr 2010
Device: none
|
You can test online your Markdown experiments here:
http://daringfireball.net/projects/markdown/dingus or here http://markdownr.com/ |
![]() |
![]() |
![]() |
#13 | |
Addict
![]() Posts: 234
Karma: 40
Join Date: Apr 2010
Device: The Nook, iPad
|
Quote:
|
|
![]() |
![]() |
![]() |
#14 |
Grand Sorcerer
![]() ![]() ![]() ![]() ![]() ![]() ![]() ![]() ![]() ![]() ![]() Posts: 6,246
Karma: 16539642
Join Date: Sep 2009
Location: UK
Device: ClaraHD, Forma, Libra2, Clara2E, LibraCol, PBTouchHD3
|
@Sylver,
Does it have any effect if you put something in the Convert|Look&Feel|ExtraCSS box along the lines of: p {text-indent:1.5em} If it makes a difference to the paragraph indent in the epub then you can adjust the 1.5em up or down to suit. |
![]() |
![]() |
![]() |
#15 |
Addict
![]() Posts: 234
Karma: 40
Join Date: Apr 2010
Device: The Nook, iPad
|
Thanks, Jackie_w. Yes, there is a check box on that tab (cannot remember what it's called) that will enable a dropdown on the right side where you can specify the indent (the default is 1.5em). I checked that one and took the default 1.5em and it looked good. I will need to find a way to remove all the two spaces hardcoded in my original txt file. But aside from that, most things now work properly. The TOC is now also working, the only thing is with "///Table of Contents///" it generates the TOC with a literal title "Table of Contents", I wish I could change that literal to something else, that currently is the only English text in a Chinese language book and looks odd.
|
![]() |
![]() |
![]() |
|
![]() |
||||
Thread | Thread Starter | Forum | Replies | Last Post |
[Old Thread] calibre detects chapters, doesn't add to TOC | Corey.Langner | Calibre | 17 | 09-25-2011 07:22 PM |
Order of Chapters in HTML->ePub | alias_neo | Calibre | 9 | 05-16-2011 11:55 AM |
Hacks Is there a way to add multible chapters to make one book | 18Coaster | Amazon Kindle | 4 | 09-10-2010 07:40 PM |
RTF to ePub, Chapters | Daddy Warpig | Calibre | 6 | 05-11-2010 11:06 PM |
ePub Chapters vs. Stanza Chapters | kjk | Sigil | 4 | 09-14-2009 10:50 AM |