Register Guidelines E-Books Today's Posts Search

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

Notices

Reply
 
Thread Tools Search this Thread
Old 09-04-2019, 09:27 PM   #1
C Alberga
Enthusiast
C Alberga began at the beginning.
 
Posts: 38
Karma: 10
Join Date: Jul 2012
Device: none
Compact format with headers--can it be done?

Note. This is not about chapters, though it is about TOC. This is basically a formatted list. I am trying to generate a catalog of .mp3 albums from my digital music library. I am using a fairly simple LISP program to generate HTML based on the directory structure of the library Following is the head and a fragment of the body.

Code:
<!DOCTYPE HTML PUBLIC "-//W3C//DTD HTML 3.2//EN">
<HTML>

<HEAD>
  <META HTTP-EQUIV="Content-Type" CONTENT="text/html;CHARSET=iso-8859-1">
  <META NAME="author" CONTENT="Cyril N. Alberga">
  <META NAME="generator" CONTENT="GNU Common Lisp">
  <META NAME="copy-right" CONTENT="&copy; 2019 Cyril N. Alberga">
  <TITLE>Catalogue of .mp3 Albums</TITLE>
<STYLE>
H3 {margin: 0.0in}
H4 {margin: 0.2in}
</STYLE>
</HEAD>




<H3>Anglo-American</H3>
<H4>2nd South Carolina String Band</H4>
<p style="margin-left:0.7in;text-indent:-0.3in;margin-top:-1em">
Camp Songs of the American Civil War - 2nd South Carolina String Band
</p>
<p style="margin-left:0.9in;text-indent:-0.3in;margin-top:-1em">
1 Southern Soldier
</p>
<p style="margin-left:0.9in;text-indent:-0.3in;margin-top:-1em">
2 Hard Road
</p>
<p style="margin-left:0.9in;text-indent:-0.3in;margin-top:-1em">
3 In High Cotton
</p>
<H4>Adrienne Young</H4>
<p style="margin-left:0.7in;text-indent:-0.3in;margin-top:-1em">
Plow to the End of the Row - Adrienne Young
</p>
<H4>Alan Lomax</H4>
<p style="margin-left:0.7in;text-indent:-0.3in;margin-top:-1em">
Texas Folk Songs - Alan Lomax
</p>
<H4>America's Children</H4>
<p style="margin-left:0.7in;text-indent:-0.3in;margin-top:-1em">
America's Children - America's Children
</p>
<H4>Anita Carter</H4>
<p style="margin-left:0.7in;text-indent:-0.3in;margin-top:-1em">
Ring Of Fire - Anita Carter
</p>
<H4>Ann Mayo Muir</H4>
<p style="margin-left:0.7in;text-indent:-0.3in;margin-top:-1em">
The Music of Ann Mayo Muir - Ann Mayo Muir
</p>
<p style="margin-left:0.7in;text-indent:-0.3in;margin-top:-1em">
The Music of Ann Mayo Muir - Ann Mayo Muir {R}
</p>
The H3 and H4 tags are to generate a TOC. H2 tags resulted in text which overlapped the following text unless a <br> was inserted, so I eliminated them. (There is a higher level structure for which I use H1 tags.)

The result has two levels of problem. When I view this using the Calibre reader it is passable though I would prefer less white space between the H4 groups, see first image. But when displayed on a Kindle Paperwhite the spacing is ridiculous. Is there an alternative way produce the document I want?
Attached Thumbnails
Click image for larger version

Name:	Calibre Reader.jpg
Views:	169
Size:	80.3 KB
ID:	173255   Click image for larger version

Name:	Kindle Paperwhite.jpg
Views:	170
Size:	140.5 KB
ID:	173257  
C Alberga is offline   Reply With Quote
Old 09-04-2019, 09:40 PM   #2
kovidgoyal
creator of calibre
kovidgoyal ought to be getting tired of karma fortunes by now.kovidgoyal ought to be getting tired of karma fortunes by now.kovidgoyal ought to be getting tired of karma fortunes by now.kovidgoyal ought to be getting tired of karma fortunes by now.kovidgoyal ought to be getting tired of karma fortunes by now.kovidgoyal ought to be getting tired of karma fortunes by now.kovidgoyal ought to be getting tired of karma fortunes by now.kovidgoyal ought to be getting tired of karma fortunes by now.kovidgoyal ought to be getting tired of karma fortunes by now.kovidgoyal ought to be getting tired of karma fortunes by now.kovidgoyal ought to be getting tired of karma fortunes by now.
 
kovidgoyal's Avatar
 
Posts: 43,857
Karma: 22666666
Join Date: Oct 2006
Location: Mumbai, India
Device: Various
Convert to azw3 not mobi for your paperwhite.
kovidgoyal is offline   Reply With Quote
Advert
Old 09-05-2019, 11:07 AM   #3
C Alberga
Enthusiast
C Alberga began at the beginning.
 
Posts: 38
Karma: 10
Join Date: Jul 2012
Device: none
That is what I am doing. The displays are from AZW3 files. Is there a way that I could generate a usable TOC in the original HTML file? I think I could figure out the table itself, but not how to get it converted to something that the Kindle would recognize.
C Alberga is offline   Reply With Quote
Old 09-05-2019, 11:24 AM   #4
theducks
Well trained by Cats
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: 29,800
Karma: 54830978
Join Date: Aug 2009
Location: The Central Coast of California
Device: Kobo Libra2,Kobo Aura2v1, K4NT(Fixed: New Bat.), Galaxy Tab A
Quote:
Originally Posted by C Alberga View Post
That is what I am doing. The displays are from AZW3 files. Is there a way that I could generate a usable TOC in the original HTML file? I think I could figure out the table itself, but not how to get it converted to something that the Kindle would recognize.
I don't know about 'the original HTML' part.
Calibre has 2 places that there is a TOC tool available. (Icon is a list with a hand pointing)
1)inside the Editor. 2) as a toolbar Icon (may need to be added)
This tool offers a number of ways to create or edit the (NCX) TOC of a book

The Editor also has a tool to create an INLINE TOC from the NCX one.
It is on the Tools TOC menu
You can move that from where it was created (beginning), if you desire
theducks is offline   Reply With Quote
Old 09-05-2019, 01:10 PM   #5
kovidgoyal
creator of calibre
kovidgoyal ought to be getting tired of karma fortunes by now.kovidgoyal ought to be getting tired of karma fortunes by now.kovidgoyal ought to be getting tired of karma fortunes by now.kovidgoyal ought to be getting tired of karma fortunes by now.kovidgoyal ought to be getting tired of karma fortunes by now.kovidgoyal ought to be getting tired of karma fortunes by now.kovidgoyal ought to be getting tired of karma fortunes by now.kovidgoyal ought to be getting tired of karma fortunes by now.kovidgoyal ought to be getting tired of karma fortunes by now.kovidgoyal ought to be getting tired of karma fortunes by now.kovidgoyal ought to be getting tired of karma fortunes by now.
 
kovidgoyal's Avatar
 
Posts: 43,857
Karma: 22666666
Join Date: Oct 2006
Location: Mumbai, India
Device: Various
azw3 has full support for css 2 so you can control margins and padding to your hearts content.
kovidgoyal is offline   Reply With Quote
Advert
Old 09-05-2019, 01:36 PM   #6
JSWolf
Resident Curmudgeon
JSWolf ought to be getting tired of karma fortunes by now.JSWolf ought to be getting tired of karma fortunes by now.JSWolf ought to be getting tired of karma fortunes by now.JSWolf ought to be getting tired of karma fortunes by now.JSWolf ought to be getting tired of karma fortunes by now.JSWolf ought to be getting tired of karma fortunes by now.JSWolf ought to be getting tired of karma fortunes by now.JSWolf ought to be getting tired of karma fortunes by now.JSWolf ought to be getting tired of karma fortunes by now.JSWolf ought to be getting tired of karma fortunes by now.JSWolf ought to be getting tired of karma fortunes by now.
 
JSWolf's Avatar
 
Posts: 73,970
Karma: 128903378
Join Date: Nov 2006
Location: Roslindale, Massachusetts
Device: Kobo Libra 2, Kobo Aura H2O, PRS-650, PRS-T1, nook STR, PW3
Once you've converted to KF8 for your Kindle, you can use the Calibre Editor to edit it to fix any formatting you feel needs fixing.
JSWolf is offline   Reply With Quote
Old 09-05-2019, 03:55 PM   #7
C Alberga
Enthusiast
C Alberga began at the beginning.
 
Posts: 38
Karma: 10
Join Date: Jul 2012
Device: none
Do I understand that any style attributes that I specify for Hn will override the ones which Calibre sets in the CSS file that it adds? If so, I will try that. Otherwise I will be back with more questions (and probably misunderstandings).

I "theducks" (which family? Whistling, dabbling, scaups?) means about "the original HTML". I thought I made it clear that what I am feeding into the conversion program is an .HTML file which has been generated by a small LISP program. While I have written a bit of HTML and JAVASCRIPT in the distant past, most of my programing has been either LISP or machine assembler code, so I find it simpler to throw together a LISP program to generate the HTML. That's why I'm trying to avoid having to hand tinker with the e-book code.
C Alberga is offline   Reply With Quote
Old 09-05-2019, 05:07 PM   #8
theducks
Well trained by Cats
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: 29,800
Karma: 54830978
Join Date: Aug 2009
Location: The Central Coast of California
Device: Kobo Libra2,Kobo Aura2v1, K4NT(Fixed: New Bat.), Galaxy Tab A
You can specify additional CSS in the Conversion settings.
That is added to the end, so the last one defining applies (just takes an efficiency hit) It may look bloated, ugly and a pain to debug... but it works
theducks is offline   Reply With Quote
Old 09-05-2019, 05:37 PM   #9
C Alberga
Enthusiast
C Alberga began at the beginning.
 
Posts: 38
Karma: 10
Join Date: Jul 2012
Device: none
I'm going to experiment (probably won't be back until next week, be out of town). I did notice that the bit I added at the start:

Code:
<STYLE>
H3 {margin: 0.0in}
H4 {margin: 0.2in}
</STYLE>
was incorporated into the CSS in the HTML -> AWZ3 conversion, so I'll start there.

Thanks for the info, I may have understood it! I know, RTFM!
C Alberga is offline   Reply With Quote
Old 09-05-2019, 06:20 PM   #10
theducks
Well trained by Cats
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: 29,800
Karma: 54830978
Join Date: Aug 2009
Location: The Central Coast of California
Device: Kobo Libra2,Kobo Aura2v1, K4NT(Fixed: New Bat.), Galaxy Tab A
Quote:
Originally Posted by C Alberga View Post
I'm going to experiment (probably won't be back until next week, be out of town). I did notice that the bit I added at the start:

Code:
<STYLE>
H3 {margin: 0.0in}
H4 {margin: 0.2in}
</STYLE>
was incorporated into the CSS in the HTML -> AWZ3 conversion, so I'll start there.

Thanks for the info, I may have understood it! I know, RTFM!
those tags should be lower case:
h3
h4
theducks is offline   Reply With Quote
Old 09-05-2019, 08:33 PM   #11
C Alberga
Enthusiast
C Alberga began at the beginning.
 
Posts: 38
Karma: 10
Join Date: Jul 2012
Device: none
Well, it was at least seven year before I had a key-punch that had lower case. Just stuck in the past. But they do work in UC!
C Alberga is offline   Reply With Quote
Reply

Tags
headings, toc, vertical spacing


Forum Jump

Similar Threads
Thread Thread Starter Forum Replies Last Post
A literal compact ereader BenG General Discussions 4 04-03-2018 04:21 AM
Bought the Xperia compact jocampo Android Devices 1 02-16-2015 03:52 AM
Format Compact flash Fermthe iRex 4 09-03-2009 01:50 PM
Iliad V2 Compact flash Fermthe iRex 2 09-28-2008 06:39 AM
Wikipedia Compact and others MatYadabyte Reading Recommendations 0 07-28-2006 09:06 AM


All times are GMT -4. The time now is 12:10 AM.


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