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 01-17-2014, 01:51 AM   #1
Amalthia
Guru
Amalthia once ate a cherry pie in a record 7 seconds.Amalthia once ate a cherry pie in a record 7 seconds.Amalthia once ate a cherry pie in a record 7 seconds.Amalthia once ate a cherry pie in a record 7 seconds.Amalthia once ate a cherry pie in a record 7 seconds.Amalthia once ate a cherry pie in a record 7 seconds.Amalthia once ate a cherry pie in a record 7 seconds.Amalthia once ate a cherry pie in a record 7 seconds.Amalthia once ate a cherry pie in a record 7 seconds.Amalthia once ate a cherry pie in a record 7 seconds.Amalthia once ate a cherry pie in a record 7 seconds.
 
Amalthia's Avatar
 
Posts: 905
Karma: 1960
Join Date: Jan 2007
Location: Anchorage, AK
Device: Sony Reader PRS-505, PRS-650
CSS <body> vs. <p> question

Hi,

For the longest time I've been specifying a font size in my <P> tag in the css override box, and I'm not sure if I should have been adding it to the <body> tag instead?

What brings this up is that I'm using the Fanfiction Downloader plugin and the source files it converts sometimes don't have a <p> tag at the start of the paragraph. In fact, some of these stories have zero tags at the beginning of the sentence, as a result the text is small and hard to read.

However, I'm not sure how to code for sentences that have no html coding tags to use?

I thought adding the font size to the body tag would fix these types of paragraphs, however before I made a change like that I'd like to know if anyone else adds the font size into their css override body tag? Are there side effects? or does it work just like the paragraph tag? or does the body tag font mess up heading sizes?

I'd appreciate any and all help.
Amalthia is offline   Reply With Quote
Old 01-17-2014, 02:04 AM   #2
eschwartz
Irrational Optimist
eschwartz ought to be getting tired of karma fortunes by now.eschwartz ought to be getting tired of karma fortunes by now.eschwartz ought to be getting tired of karma fortunes by now.eschwartz ought to be getting tired of karma fortunes by now.eschwartz ought to be getting tired of karma fortunes by now.eschwartz ought to be getting tired of karma fortunes by now.eschwartz ought to be getting tired of karma fortunes by now.eschwartz ought to be getting tired of karma fortunes by now.eschwartz ought to be getting tired of karma fortunes by now.eschwartz ought to be getting tired of karma fortunes by now.eschwartz ought to be getting tired of karma fortunes by now.
 
Posts: 2,895
Karma: 4212450
Join Date: Nov 2012
Location: The Beaten Path, USA, Roundworld, This Side of Infinity
Device: Kindle Touch (Wifi only)
If you change the font size in the body tag, then everything within the body tag will inherit that size. Unless overridden by more specific css later on.

http://www.webdesignfromscratch.com/...tance-cascade/

font-size IS an inherited attribute.
eschwartz is offline   Reply With Quote
 
Enthusiast
Old 01-17-2014, 02:49 PM   #3
Amalthia
Guru
Amalthia once ate a cherry pie in a record 7 seconds.Amalthia once ate a cherry pie in a record 7 seconds.Amalthia once ate a cherry pie in a record 7 seconds.Amalthia once ate a cherry pie in a record 7 seconds.Amalthia once ate a cherry pie in a record 7 seconds.Amalthia once ate a cherry pie in a record 7 seconds.Amalthia once ate a cherry pie in a record 7 seconds.Amalthia once ate a cherry pie in a record 7 seconds.Amalthia once ate a cherry pie in a record 7 seconds.Amalthia once ate a cherry pie in a record 7 seconds.Amalthia once ate a cherry pie in a record 7 seconds.
 
Amalthia's Avatar
 
Posts: 905
Karma: 1960
Join Date: Jan 2007
Location: Anchorage, AK
Device: Sony Reader PRS-505, PRS-650
Quote:
Originally Posted by eschwartz View Post
If you change the font size in the body tag, then everything within the body tag will inherit that size. Unless overridden by more specific css later on.

http://www.webdesignfromscratch.com/...tance-cascade/

font-size IS an inherited attribute.
Thank you for the link. I will have to look at my settings and see if font sizes are mentioned anywhere else.

I think the confusing part is that I'm using two different areas to convert ebooks, one is the default Calibre conversion and the other is Fanfiction Downloader conversion settings.

In the Calibre conversion settings I do not have font size listed in my css override codes because it's not needed. In FFDL, I need to specify a font size. Though, maybe that has changed. I will run some tests.
Amalthia is offline   Reply With Quote
Old 01-17-2014, 10:09 PM   #4
davidfor
Wizard
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: 4,245
Karma: 3677994
Join Date: Jul 2011
Location: Australia
Device: Kobo Touch, Kobo Glo
You might be looking at this in the wrong way.

If the code doesn't have p tags to indicate the paragraph, what does it have? Does it use two br's? Or something else? If it is br's, then adding the option "replace_br_with_p: true" into the personal.ini for the site might help. Otherwise, I suggest mentioning it in the FFDL thread might prompt a suggestion or a fix to the downloaded for the site.
davidfor is offline   Reply With Quote
Old 01-20-2014, 12:12 PM   #5
Amalthia
Guru
Amalthia once ate a cherry pie in a record 7 seconds.Amalthia once ate a cherry pie in a record 7 seconds.Amalthia once ate a cherry pie in a record 7 seconds.Amalthia once ate a cherry pie in a record 7 seconds.Amalthia once ate a cherry pie in a record 7 seconds.Amalthia once ate a cherry pie in a record 7 seconds.Amalthia once ate a cherry pie in a record 7 seconds.Amalthia once ate a cherry pie in a record 7 seconds.Amalthia once ate a cherry pie in a record 7 seconds.Amalthia once ate a cherry pie in a record 7 seconds.Amalthia once ate a cherry pie in a record 7 seconds.
 
Amalthia's Avatar
 
Posts: 905
Karma: 1960
Join Date: Jan 2007
Location: Anchorage, AK
Device: Sony Reader PRS-505, PRS-650
Quote:
Originally Posted by davidfor View Post
You might be looking at this in the wrong way.

If the code doesn't have p tags to indicate the paragraph, what does it have? Does it use two br's? Or something else? If it is br's, then adding the option "replace_br_with_p: true" into the personal.ini for the site might help. Otherwise, I suggest mentioning it in the FFDL thread might prompt a suggestion or a fix to the downloaded for the site.
That is the problem with some of these stories there is no code at the start of the paragraph.

for example the author would have:
Quote:
<p>*****</P>
start of paragraph here

<p>new paragraph.
I don't think the "replace_br_with_p: true" option can fix this.
Amalthia is offline   Reply With Quote
Old 01-20-2014, 01:33 PM   #6
theducks
Grand Sorcerer
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: 13,606
Karma: 5126946
Join Date: Aug 2009
Location: The (original) Silicon Valley, USA
Device: Galaxy Tab 2, Astak Pocket Pro, K4NT
Quote:
Originally Posted by Amalthia View Post
That is the problem with some of these stories there is no code at the start of the paragraph.

for example the author would have:


I don't think the "replace_br_with_p: true" option can fix this.
OMG
not only:

The mark opens with a lowercase p and closes with an uppercase /P
theducks is offline   Reply With Quote
Old 01-20-2014, 10:05 PM   #7
davidfor
Wizard
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: 4,245
Karma: 3677994
Join Date: Jul 2011
Location: Australia
Device: Kobo Touch, Kobo Glo
Quote:
Originally Posted by Amalthia View Post
That is the problem with some of these stories there is no code at the start of the paragraph.

for example the author would have:


I don't think the "replace_br_with_p: true" option can fix this.
I agree with theducks, that's bad. It would be interesting to know what the original source looked like. As it might be something they can fix in the FFDL adapter for the site, I would report it on the FFDL thread with a link to a story or two that has the problem.

Or you can fix the code yourself. The following regex should find them these problems:

Code:
(<p>\*.*)</P>(\s+)(\w+.*)(\s+<p>)
and the replace string is:

Code:
\1</p>\2<p>\3</p>\4
I tested that with what you posted and it should work if they are all like that.
davidfor is offline   Reply With Quote
Old 01-21-2014, 01:50 AM   #8
Amalthia
Guru
Amalthia once ate a cherry pie in a record 7 seconds.Amalthia once ate a cherry pie in a record 7 seconds.Amalthia once ate a cherry pie in a record 7 seconds.Amalthia once ate a cherry pie in a record 7 seconds.Amalthia once ate a cherry pie in a record 7 seconds.Amalthia once ate a cherry pie in a record 7 seconds.Amalthia once ate a cherry pie in a record 7 seconds.Amalthia once ate a cherry pie in a record 7 seconds.Amalthia once ate a cherry pie in a record 7 seconds.Amalthia once ate a cherry pie in a record 7 seconds.Amalthia once ate a cherry pie in a record 7 seconds.
 
Amalthia's Avatar
 
Posts: 905
Karma: 1960
Join Date: Jan 2007
Location: Anchorage, AK
Device: Sony Reader PRS-505, PRS-650
Quote:
Originally Posted by davidfor View Post
I agree with theducks, that's bad. It would be interesting to know what the original source looked like. As it might be something they can fix in the FFDL adapter for the site, I would report it on the FFDL thread with a link to a story or two that has the problem.

Or you can fix the code yourself. The following regex should find them these problems:

Code:
(<p>\*.*)</P>(\s+)(\w+.*)(\s+<p>)
and the replace string is:

Code:
\1</p>\2<p>\3</p>\4
I tested that with what you posted and it should work if they are all like that.
I haven't had problems with the <p> tag whether it's uppercase or lowercase...

I can post something at the FFDL thread to see if there is a way to find these orphan paragraphs and add some paragraph tags to them because I've seen it on many stories.

currently, switching to using the font-size in the <body> tag has seemed to fix the problem.
Amalthia 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
force an addition to main body css ? cybmole Conversion 5 01-17-2014 02:35 AM
Adding body style to Extra CSS does nothing Barty Conversion 7 10-23-2013 11:06 PM
How to change the font-size in the body tag in css? naisren Conversion 2 10-01-2012 05:52 PM
CSS question crutledge Workshop 17 12-17-2011 07:52 AM
CSS Question AppleTard Calibre 1 06-12-2011 12:07 AM


All times are GMT -4. The time now is 05:03 AM.


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