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

Go Back   MobileRead Forums > E-Book Software > Calibre

Notices

Reply
 
Thread Tools Search this Thread
Old 09-15-2010, 12:42 PM   #1
JBNY
Member
JBNY began at the beginning.
 
Posts: 21
Karma: 12
Join Date: Mar 2009
Device: Kindel, iPad
how to make section breaks in epubs

I am converting some mobi files I created. In the mobi, whenever there is a section break in between paragraphs I have the following code.

<P id=break height=30>&nbsp;</P>

This puts some nice spacing in mobi books before the new paragraph.

When doing a conversion in Calibre to epub, I lose the formating. How can I get the epub to put the same spacing for parts that have an id=break in them?

Thanks!
-Joe
JBNY is offline   Reply With Quote
Old 09-15-2010, 01:02 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: 25,265
Karma: 4961457
Join Date: Oct 2006
Location: Mumbai, India
Device: Various
Can you attach a sample mobi showing the problem.
kovidgoyal is offline   Reply With Quote
Old 09-15-2010, 01:38 PM   #3
JBNY
Member
JBNY began at the beginning.
 
Posts: 21
Karma: 12
Join Date: Mar 2009
Device: Kindel, iPad
Sure,

I attached three examples.

ebook.txt is the html file I use to make the mobi book.
ebook.mobi is the finished mobi book
Book Title - Author_ Book.epub is the converted epub from Calibre.

You can see the id tag with "break" in it and the height section, but it does not show up in the conversion.

When I make my mobi files I usually use two ID's for paragraph section breaks id=break and id=secbreak.

Thanks for any help you can give.

-Joe
Attached Files
File Type: mobi ebook.mobi (47.0 KB, 55 views)
File Type: epub Book Title - Author_ Book.epub (37.3 KB, 51 views)
File Type: txt ebook.txt (18.1 KB, 97 views)
JBNY is offline   Reply With Quote
Old 09-15-2010, 02:03 PM   #4
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: 25,265
Karma: 4961457
Join Date: Oct 2006
Location: Mumbai, India
Device: Various
this is really the wrong way to approach creating EPUB+MOBI. Use a proper html file as your source and convert that directly to MOBI and EPUB.

But if you want to continue this way use something like

<p align=center>***</p>

as a section break
kovidgoyal is offline   Reply With Quote
Old 09-15-2010, 02:23 PM   #5
JBNY
Member
JBNY began at the beginning.
 
Posts: 21
Karma: 12
Join Date: Mar 2009
Device: Kindel, iPad
Why is that the wrong way? Normally I take a PDF file that I own (most are copywrite that is why I did not attach a real book), put it into book designer to clean it up, save it, run a script that makes everything exactly the way mobicreator needs it and create a mobi file. I get perfectly formated mobi files out of it, that look at work perfect on my Kindle.

But now I have a lot mobi files that I did not save the source of and would like to convert it to epub, to display on my iPad.

Really just looking to what you think I am doing wrong when creating files this way. I can do it differently going forward, but putting *** always instead of just putting some dead space at the beginning of a paragraph, sometimes changes the look of the book.
JBNY is offline   Reply With Quote
Old 09-15-2010, 02:25 PM   #6
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: 25,265
Karma: 4961457
Join Date: Oct 2006
Location: Mumbai, India
Device: Various
Because your master format (the HTML) should not have MOBI specific markup. Instead create standards compliant HTML and convert that directly to MOBI and EPUB. That way an intelligent converter will be able to gracefully degrade features in the html that dont work in the target output format.
kovidgoyal is offline   Reply With Quote
Old 09-15-2010, 02:34 PM   #7
JBNY
Member
JBNY began at the beginning.
 
Posts: 21
Karma: 12
Join Date: Mar 2009
Device: Kindel, iPad
OK, that makes sense, I wasn't getting the part about the using a "height" attribute within the <P> tag as being not standard. I'll see what I can do with straight complaint HTML going forward.

Thanks for you help.
JBNY is offline   Reply With Quote
Old 09-15-2010, 09:22 PM   #8
DoctorOhh
US Navy, Retired
DoctorOhh ought to be getting tired of karma fortunes by now.DoctorOhh ought to be getting tired of karma fortunes by now.DoctorOhh ought to be getting tired of karma fortunes by now.DoctorOhh ought to be getting tired of karma fortunes by now.DoctorOhh ought to be getting tired of karma fortunes by now.DoctorOhh ought to be getting tired of karma fortunes by now.DoctorOhh ought to be getting tired of karma fortunes by now.DoctorOhh ought to be getting tired of karma fortunes by now.DoctorOhh ought to be getting tired of karma fortunes by now.DoctorOhh ought to be getting tired of karma fortunes by now.DoctorOhh ought to be getting tired of karma fortunes by now.
 
DoctorOhh's Avatar
 
Posts: 8,735
Karma: 12488297
Join Date: Feb 2009
Location: North Carolina
Device: Nexus 7
Quote:
Originally Posted by JBNY View Post
<P id=break height=30>&nbsp;</P>
I have little experience but shouldn't that be:

<p id="break" height="30">&nbsp;</p>
DoctorOhh is offline   Reply With Quote
Old 09-16-2010, 07:36 AM   #9
Agama
Guru
Agama ought to be getting tired of karma fortunes by now.Agama ought to be getting tired of karma fortunes by now.Agama ought to be getting tired of karma fortunes by now.Agama ought to be getting tired of karma fortunes by now.Agama ought to be getting tired of karma fortunes by now.Agama ought to be getting tired of karma fortunes by now.Agama ought to be getting tired of karma fortunes by now.Agama ought to be getting tired of karma fortunes by now.Agama ought to be getting tired of karma fortunes by now.Agama ought to be getting tired of karma fortunes by now.Agama ought to be getting tired of karma fortunes by now.
 
Agama's Avatar
 
Posts: 637
Karma: 436517
Join Date: Jul 2010
Location: UK
Device: PRS-300, PW2
Since the attribute values only contain letters and numbers, (hyphen and dot are also allowed), then the quotes are optional in html, although my preference is to simply quote all attribute values regardless of characters used.
Agama is offline   Reply With Quote
Old 09-16-2010, 08:16 AM   #10
DoctorOhh
US Navy, Retired
DoctorOhh ought to be getting tired of karma fortunes by now.DoctorOhh ought to be getting tired of karma fortunes by now.DoctorOhh ought to be getting tired of karma fortunes by now.DoctorOhh ought to be getting tired of karma fortunes by now.DoctorOhh ought to be getting tired of karma fortunes by now.DoctorOhh ought to be getting tired of karma fortunes by now.DoctorOhh ought to be getting tired of karma fortunes by now.DoctorOhh ought to be getting tired of karma fortunes by now.DoctorOhh ought to be getting tired of karma fortunes by now.DoctorOhh ought to be getting tired of karma fortunes by now.DoctorOhh ought to be getting tired of karma fortunes by now.
 
DoctorOhh's Avatar
 
Posts: 8,735
Karma: 12488297
Join Date: Feb 2009
Location: North Carolina
Device: Nexus 7
Quote:
Originally Posted by Agama View Post
Since the attribute values only contain letters and numbers, (hyphen and dot are also allowed), then the quotes are optional in html, although my preference is to simply quote all attribute values regardless of characters used.
Thanks, maybe you can help me understand further, it doesn't seem as if the height attribute is standard for <p> tags in html 4.01. Was it ever a standard attribute for <p> tags or is this unique to mobi?

It seems to me that top & bottom margins in the CSS for <p> tags is the typical way of currently handling this situation.
DoctorOhh is offline   Reply With Quote
Old 09-16-2010, 09:23 AM   #11
Agama
Guru
Agama ought to be getting tired of karma fortunes by now.Agama ought to be getting tired of karma fortunes by now.Agama ought to be getting tired of karma fortunes by now.Agama ought to be getting tired of karma fortunes by now.Agama ought to be getting tired of karma fortunes by now.Agama ought to be getting tired of karma fortunes by now.Agama ought to be getting tired of karma fortunes by now.Agama ought to be getting tired of karma fortunes by now.Agama ought to be getting tired of karma fortunes by now.Agama ought to be getting tired of karma fortunes by now.Agama ought to be getting tired of karma fortunes by now.
 
Agama's Avatar
 
Posts: 637
Karma: 436517
Join Date: Jul 2010
Location: UK
Device: PRS-300, PW2
Height is a standard CSS property for <p> but I don't think it was ever a standard attribute. I use margin-top / margin-bottom properties to control paragraph spacing, but the padding properties could probably be used as well. The text-indent property can be used to indent only the first line of the paragraph.

All eBook styling is best acheived with CSS rather than with html attributes.

Last edited by Agama; 09-16-2010 at 09:32 AM. Reason: Correction
Agama is offline   Reply With Quote
Old 09-16-2010, 11:54 AM   #12
JBNY
Member
JBNY began at the beginning.
 
Posts: 21
Karma: 12
Join Date: Mar 2009
Device: Kindel, iPad
Putting quotes did not make it work.

What I did was change my way of creating mobi books so I use a CSS file, and added spacing using css.

Works perfect in mobi, on my kindle and when I convert the file with Calibre all the epub formatting moves over perfectly on my iPad as well.

Thanks for your help!
JBNY is offline   Reply With Quote
Old 09-16-2010, 02:57 PM   #13
Agama
Guru
Agama ought to be getting tired of karma fortunes by now.Agama ought to be getting tired of karma fortunes by now.Agama ought to be getting tired of karma fortunes by now.Agama ought to be getting tired of karma fortunes by now.Agama ought to be getting tired of karma fortunes by now.Agama ought to be getting tired of karma fortunes by now.Agama ought to be getting tired of karma fortunes by now.Agama ought to be getting tired of karma fortunes by now.Agama ought to be getting tired of karma fortunes by now.Agama ought to be getting tired of karma fortunes by now.Agama ought to be getting tired of karma fortunes by now.
 
Agama's Avatar
 
Posts: 637
Karma: 436517
Join Date: Jul 2010
Location: UK
Device: PRS-300, PW2
Sorry JBNY, the info on quotes pulled us off topic a bit into a digression on html attributes. It has no bearing on your query.

To put white space above and below a paragraph use margin-top and margin-bottom in your stylesheet. For fixed spacing use a unit of measure such as "pt" and for spacing which sizes with the text use "em". For example:

P { margin-top:0.5em; margin-bottom:0.5em }

would apply 0.5em margins above and below every paragraph.
Agama 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
how to get page breaks before and after images (using epubs In & Out) lhgrappler Calibre 9 10-06-2010 11:57 AM
Force page breaks in epubs alexvallette ePub 11 09-06-2010 07:53 AM
Missing section breaks readingaloud Amazon Kindle 1 08-27-2009 01:49 PM
Section breaks christineb Calibre 11 01-20-2009 05:54 PM
How to make personal EPUBS compatible with Sony Reader PRS-505 georger LRF 4 08-13-2008 07:14 PM


All times are GMT -4. The time now is 04:30 PM.


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