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

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

Notices

Reply
 
Thread Tools Search this Thread
Old 12-09-2012, 01:15 PM   #1
btab
Junior Member
btab began at the beginning.
 
Posts: 3
Karma: 10
Join Date: Jul 2011
Location: Austria
Device: Sony PRS-T1
Suppress indentation of first paragraph

Hi,
I often convert from epub to epub to remove spacing between paragraphs and set the text justification to "justified". It works fine, but I have not found a way to suppress the indentation of the first paragraph. I have tried to specify an "Extra CSS":

p:first-child {text-indent: 0pt;}

but it seems to have no effect in the generated output.
I would be very thankful for any hints.
Thanks in advance,
Behnam
btab is offline   Reply With Quote
Old 12-09-2012, 06:13 PM   #2
davidfor
Grand Sorcerer
davidfor ought to be getting tired of karma fortunes by now.davidfor ought to be getting tired of karma fortunes by now.davidfor ought to be getting tired of karma fortunes by now.davidfor ought to be getting tired of karma fortunes by now.davidfor ought to be getting tired of karma fortunes by now.davidfor ought to be getting tired of karma fortunes by now.davidfor ought to be getting tired of karma fortunes by now.davidfor ought to be getting tired of karma fortunes by now.davidfor ought to be getting tired of karma fortunes by now.davidfor ought to be getting tired of karma fortunes by now.davidfor ought to be getting tired of karma fortunes by now.
 
Posts: 5,675
Karma: 5656630
Join Date: Jul 2011
Location: Australia
Device: Kobo Touch, Kobo Glo
I think that isn't working because the first-child of the parent is probably a heading. Or at least that is my reading of the definition.

What I use to achieve what you want is:

h2 + p , h4 + p, hr + p {text-indent:0}

The exact heading levels and hr might get adjusted for different books but that works.
davidfor is online now   Reply With Quote
 
Enthusiast
Old 12-10-2012, 03:37 PM   #3
btab
Junior Member
btab began at the beginning.
 
Posts: 3
Karma: 10
Join Date: Jul 2011
Location: Austria
Device: Sony PRS-T1
Thank you davidfor for your answer.
You're right: My initial attempt with "p:first-child" would work only in cases where all paragraphs are inside an enclosing element like "div", which is not always the case.

Based on your solution with adjacent siblings (and after some experiments) I finally get good results with the following:

"Remove spacing between paragraphs" (checked)
"Indent size" (set to "No change")
Extra CSS:
p {text-indent: 0}
p + p {text-indent: 1.5em}

Setting the indent size in the dialog box to "No change" seems to be essential, otherwise the given value will override the value given in the extra CSS.
btab is offline   Reply With Quote
Old 12-11-2012, 01:49 AM   #4
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,861
Karma: 12755553
Join Date: Feb 2009
Location: North Carolina
Device: Nexus 7
Quote:
Originally Posted by btab View Post
"Remove spacing between paragraphs" (checked)
"Indent size" (set to "No change")
Extra CSS:
p {text-indent: 0}
p + p {text-indent: 1.5em}
Thanks for sharing your solution.

Quote:
Originally Posted by btab View Post
Setting the indent size in the dialog box to "No change" seems to be essential, otherwise the given value will override the value given in the extra CSS.
You are correct. The checkbox next to "Remove spacing between paragraphs" also activates the "Indent size" field. If the box is not checked neither of these features are activated. It is sometimes hard to realize that the checkbox is for the entire line of features.

Good Reading.
DoctorOhh 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
[Suggestion] Change indentation to one letter per indentation level. John Peterson Development 1 10-22-2012 02:05 PM
Preference: Paragraph indent or a little paragraph spacing? 1611mac General Discussions 48 11-11-2011 12:43 AM
control blockquote indentation bobb40 Conversion 9 08-10-2011 05:04 AM
Preserving Indentation zaph0d Conversion 5 05-30-2011 04:41 PM
Epub and negative indentation Nate the great ePub 6 04-27-2009 11:48 AM


All times are GMT -4. The time now is 06:22 AM.


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