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 04-02-2012, 07:47 PM   #1
denverh
Enthusiast
denverh began at the beginning.
 
Posts: 25
Karma: 10
Join Date: May 2011
Device: prs-650
Questions about paragraph spacing and indents

Hello,

I've been trying to understand the variety of options for setting paragraph spacings and indents, and I'm a little confused. There seem to be multiple approaches, and I'm having trouble deciding which to use. I've done some experimenting, and I can sometimes, but not always, get the results I want. I've searched around the forum here for ideas and just got more confused. I've also been reading the manual.

What I'm looking for are paragraphs with no space between, with the first line indented, and I don't want to loose any scene breaks. In looking at my books, I can see all the possible variations between spaces, no spaces, indents, no indents. Plus, some books use "p" to delimit paragraphs, and some use "div". There may be more variations, but those two are the ones I've seen so far.

I have a Sony PRS-650 with PRS+, and I usually convert everything, except PDF's, to epub. So right now I'm mostly converting epub to epub. While I'm experimenting with this I'm using ebook-convert in a shell script:

Code:
#!/bin/sh
 
OPTS="
--input-profile=default 
--output-profile=sony 
--filter-css=font-family,margin-left,margin-right,margin-top,margin-bottom 
--extra-css=indents.css 
--linearize-tables 
--smarten-punctuation 
--enable-heuristics 
--disable-unwrap-lines 
"
A=`basename "$1" .epub`
ebook-convert "$1" "$A"-c.epub $OPTS
As you can see, I'm also trying to fix a few other things at the same time. But it's the paragraph formatting that I'm having the most trouble with right now. The results I'm getting range from perfect to awful. I would really like some advice from anyone with more experience with this.

Almost forgot. Here's the indents.css file:
Code:
p {margin-top: 0em; margin-bottom: 0.0em; text-indent:1.5em}
Update:
I think I've figured out part of the problem. At first I thought the extra-css wasn't working at all, but I can change the amount of indent specified, and that works. If I examine the original book and the converted book, I can see that paragraphs look like this:
<p class="calibre2"> paragraph text </p>
The definition for calibre2 is
Code:
original:
.calibre2 {
    display: block;
    font-size: 1.41667em;
    font-weight: bold;
    margin-bottom: 0.83em;
    margin-left: 0;
    margin-right: 0;
    margin-top: 0.83em;
    page-break-before: always;
    text-align: center
    }

converted:
.calibre2 {
    border: 0;
    display: block;
    text-indent: 1.5em
    }
So it looks like the margins have been removed, but the paragraphs still have spaces between them. If I manually add my extra-css to the end of the book's stylesheet they disappear. They also disappear if I simply add "margin: 0;" to the calibre2 definition. At this point I have no idea what is making the inter-paragraph spaces so persistent. This isn't the only book I have that behaves this way either. Does anyone have any ideas about what's happening here?


Thanks,

Denver

Last edited by denverh; 04-03-2012 at 09:55 AM. Reason: update
denverh is offline   Reply With Quote
Old 04-03-2012, 03:32 PM   #2
speakingtohe
Wizard
speakingtohe ought to be getting tired of karma fortunes by now.speakingtohe ought to be getting tired of karma fortunes by now.speakingtohe ought to be getting tired of karma fortunes by now.speakingtohe ought to be getting tired of karma fortunes by now.speakingtohe ought to be getting tired of karma fortunes by now.speakingtohe ought to be getting tired of karma fortunes by now.speakingtohe ought to be getting tired of karma fortunes by now.speakingtohe ought to be getting tired of karma fortunes by now.speakingtohe ought to be getting tired of karma fortunes by now.speakingtohe ought to be getting tired of karma fortunes by now.speakingtohe ought to be getting tired of karma fortunes by now.
 
Posts: 4,812
Karma: 26912940
Join Date: Apr 2010
Device: sony PRS-T1 and T3, Kobo Mini and Aura HD, Tablet
Happens to me too. Usually painful to fix for me.

I will try margin:0

Thanks Helen
speakingtohe is offline   Reply With Quote
Advert
Old 04-03-2012, 03:38 PM   #3
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: 74,033
Karma: 129333114
Join Date: Nov 2006
Location: Roslindale, Massachusetts
Device: Kobo Libra 2, Kobo Aura H2O, PRS-650, PRS-T1, nook STR, PW3
Your doing an ePub > ePub conversion. That's where you've gone wrong. Take the most original ePub you can and run it through Sigil to do your changes. It will work a lot better.
JSWolf is offline   Reply With Quote
Old 04-03-2012, 09:39 PM   #4
denverh
Enthusiast
denverh began at the beginning.
 
Posts: 25
Karma: 10
Join Date: May 2011
Device: prs-650
Quote:
Originally Posted by JSWolf View Post
Your doing an ePub > ePub conversion. That's where you've gone wrong. Take the most original ePub you can and run it through Sigil to do your changes. It will work a lot better.
Oh, that's not good news. I was hoping to use some of Calibre's correcting tools to semi-automatically fix things like stray hyphens, embedded fonts, TOCs in tables, paragraph spacing, etc. I expect I will need to use Sigil for some things, like missing scene breaks, but I was hoping to do a lot of the other things by simply running them through ebook-convert. That would get the bulk of the work done, and the rest I could do as I encounter them while reading.

I did spend some more time trying to figure out what was going on with extra-css, though. My understanding of how extra-css works, from reading the manual, is that whatever you specify gets added to the end of the epub stylesheet. What I've seen, however, is that it seems to modify existing elements, rather than create new ones at the end of the stylesheet. I also noticed that whatever I specified for paragraph margin values in extra-css was affecting values in classes that weren't used for paragraphs. Is that why you say converting epub to epub is a bad idea? Because it doesn't keep track very well of which stylesheet classes are for what? What about things that operate only on the html, and not the css, like stray hyphen removal?

Thanks,

Denver
denverh is offline   Reply With Quote
Old 04-03-2012, 11:33 PM   #5
denverh
Enthusiast
denverh began at the beginning.
 
Posts: 25
Karma: 10
Join Date: May 2011
Device: prs-650
Quote:
Originally Posted by speakingtohe View Post
Happens to me too. Usually painful to fix for me.

I will try margin:0

Thanks Helen
Well, after fiddling around with this a little more, I've figured out that if you want margins set to zero, then don't select to filter out margins and use "Remove spacing between paragraphs". At least for a couple books that I checked it seems to work as desired. I get indented paragraphs, with no extra space between, and scene breaks don't appear to be affected.

Somewhere in all the reading about this that I've done recently I remember reading that "Remove spacing between paragraphs" affects css only, and that the related, but different, "Delete blank lines between paragraphs" affects the html.

I've also read that if you wish to use "Remove spacing between paragraphs", but don't want it to affect all paragraphs, then you should use extra-css instead. That makes sense, except that I haven't been able to affect margins at all with extra-css. So even though I think I have a way to get my paragraphs formatted in a uniform fashion, there's still that extra-css puzzle.

Thanks everyone,

Denver
denverh is offline   Reply With Quote
Advert
Old 04-04-2012, 12:06 AM   #6
speakingtohe
Wizard
speakingtohe ought to be getting tired of karma fortunes by now.speakingtohe ought to be getting tired of karma fortunes by now.speakingtohe ought to be getting tired of karma fortunes by now.speakingtohe ought to be getting tired of karma fortunes by now.speakingtohe ought to be getting tired of karma fortunes by now.speakingtohe ought to be getting tired of karma fortunes by now.speakingtohe ought to be getting tired of karma fortunes by now.speakingtohe ought to be getting tired of karma fortunes by now.speakingtohe ought to be getting tired of karma fortunes by now.speakingtohe ought to be getting tired of karma fortunes by now.speakingtohe ought to be getting tired of karma fortunes by now.
 
Posts: 4,812
Karma: 26912940
Join Date: Apr 2010
Device: sony PRS-T1 and T3, Kobo Mini and Aura HD, Tablet
Well I regularly try all clickable option in look and feel and heuristics. Mostly they are good enough. Then I inspect in the viewer (select text and right click) and use tweak epub.

But there are still enough that have me stymied. I prefer my books blank line between and no indent but some books not cooperative I have used sigil, but it is a bit complex for just one book IMO. Maybe someday. Of course I am still lost in space at CSS and regexes for the most part but eventually I get it done. I am pretty good at search and replace though

Helen
speakingtohe is offline   Reply With Quote
Old 04-04-2012, 01:31 PM   #7
denverh
Enthusiast
denverh began at the beginning.
 
Posts: 25
Karma: 10
Join Date: May 2011
Device: prs-650
Up until now, most of the converting I've done has been for books that weren't in ePub format, and I haven't gotten too adventurous with options. I mostly wanted to just change file format without changing the content. The results have been fairly satisfactory. But the more ebooks I read the more all those little defects become annoying. Calibre has plenty of tools to automatically fix many of those, but up until recently I hadn't really investigated them. I suspect that many of my difficulties right now originate with the keyboard actuator. Like selecting "Remove spacing between paragraphs" in "Look & Feel", and then checking Margins under "Filter Style Information". The first will set all margin values in the stylesheet to zero, but the second deletes them. At least that's what I see when I examine before & after stylesheets.

Thanks for all the replies,

Denver
denverh is offline   Reply With Quote
Reply


Forum Jump

Similar Threads
Thread Thread Starter Forum Replies Last Post
Preference: Paragraph indent or a little paragraph spacing? 1611mac General Discussions 48 11-11-2011 12:43 AM
Losing Indents and Paragraph spacing videopope ePub 11 06-03-2011 07:47 PM
LRF - losing indents and paragraph spacing jjansen Conversion 12 02-04-2011 07:45 AM
Questions about <p> and <div> and paragraph spacing droople Sigil 7 08-14-2010 12:03 PM
Sony PRS-505, text indents, paragraph spacing pdurrant Sigil 7 08-03-2009 06:03 AM


All times are GMT -4. The time now is 07:08 AM.


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