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 10-19-2011, 02:09 AM   #16
ldolse
Wizard
ldolse is an accomplished Snipe hunter.ldolse is an accomplished Snipe hunter.ldolse is an accomplished Snipe hunter.ldolse is an accomplished Snipe hunter.ldolse is an accomplished Snipe hunter.ldolse is an accomplished Snipe hunter.ldolse is an accomplished Snipe hunter.ldolse is an accomplished Snipe hunter.ldolse is an accomplished Snipe hunter.ldolse is an accomplished Snipe hunter.ldolse is an accomplished Snipe hunter.
 
Posts: 1,337
Karma: 123455
Join Date: Apr 2009
Location: Malaysia
Device: PRS-650, iPhone
Quote:
Originally Posted by dwanthny View Post
The left and right margins are in the CSS see post 12 above for exactly where they are located.
True, I forgot about that.
ldolse is offline   Reply With Quote
Old 10-19-2011, 02:48 AM   #17
cybmole
Wizard
cybmole ought to be getting tired of karma fortunes by now.cybmole ought to be getting tired of karma fortunes by now.cybmole ought to be getting tired of karma fortunes by now.cybmole ought to be getting tired of karma fortunes by now.cybmole ought to be getting tired of karma fortunes by now.cybmole ought to be getting tired of karma fortunes by now.cybmole ought to be getting tired of karma fortunes by now.cybmole ought to be getting tired of karma fortunes by now.cybmole ought to be getting tired of karma fortunes by now.cybmole ought to be getting tired of karma fortunes by now.cybmole ought to be getting tired of karma fortunes by now.
 
Posts: 3,720
Karma: 1759970
Join Date: Sep 2010
Device: none
this is gettign much cleaere - thanks all.

my only remaining CSS puzzle is body vs .body - no joy googling css syntax for explanation of when not to add the dot

on the default 5pt margins - just out of curiosity how were they chosen - democratically or Kovid's view of what looks best.

If I wanted more margin all around, in the style of some adobe xgpt styles, I guess its better to tweak common preferences & reconvert rather than edit CSS & find /replace the @page stuff; that way there will be an original-epub to revert to.

on a quick test, I see the visual appeal of more surrounding white space - it is more "paper book like" but when I am actually reading i like to minimize page turns so will probably stick with calibre defaults.
cybmole is offline   Reply With Quote
Old 10-19-2011, 04:49 AM   #18
pietvo
Reader
pietvo can name that song in three notespietvo can name that song in three notespietvo can name that song in three notespietvo can name that song in three notespietvo can name that song in three notespietvo can name that song in three notespietvo can name that song in three notespietvo can name that song in three notespietvo can name that song in three notespietvo can name that song in three notespietvo can name that song in three notes
 
pietvo's Avatar
 
Posts: 520
Karma: 24612
Join Date: Aug 2009
Location: Utrecht, NL
Device: Kobo Aura 2, iPhone, iPad
Quote:
Originally Posted by cybmole View Post
my only remaining CSS puzzle is body vs .body - no joy googling css syntax for explanation of when not to add the dot
‘body’ applies to the element ‘body’. ‘.body’ applies to all elements with class="body". Similar ‘#body' would apply to the element with id="body".

Combined: p.xxxx would apply to elements <p class="xxxx">.
pietvo is offline   Reply With Quote
Old 10-19-2011, 05:08 AM   #19
cybmole
Wizard
cybmole ought to be getting tired of karma fortunes by now.cybmole ought to be getting tired of karma fortunes by now.cybmole ought to be getting tired of karma fortunes by now.cybmole ought to be getting tired of karma fortunes by now.cybmole ought to be getting tired of karma fortunes by now.cybmole ought to be getting tired of karma fortunes by now.cybmole ought to be getting tired of karma fortunes by now.cybmole ought to be getting tired of karma fortunes by now.cybmole ought to be getting tired of karma fortunes by now.cybmole ought to be getting tired of karma fortunes by now.cybmole ought to be getting tired of karma fortunes by now.
 
Posts: 3,720
Karma: 1759970
Join Date: Sep 2010
Device: none
Quote:
Originally Posted by pietvo View Post
‘body’ applies to the element ‘body’. ‘.body’ applies to all elements with class="body".
sorry - I still don't get that distinction.

each page of epub html (before conversion) contains

<head> blah blah

<body>

<p blah blah

so does body in css apply to that, or only .body in CSS

adding / removing that leading dot in css does change the margins
cybmole is offline   Reply With Quote
Old 10-19-2011, 07:43 AM   #20
jackie_w
Grand Sorcerer
jackie_w ought to be getting tired of karma fortunes by now.jackie_w ought to be getting tired of karma fortunes by now.jackie_w ought to be getting tired of karma fortunes by now.jackie_w ought to be getting tired of karma fortunes by now.jackie_w ought to be getting tired of karma fortunes by now.jackie_w ought to be getting tired of karma fortunes by now.jackie_w ought to be getting tired of karma fortunes by now.jackie_w ought to be getting tired of karma fortunes by now.jackie_w ought to be getting tired of karma fortunes by now.jackie_w ought to be getting tired of karma fortunes by now.jackie_w ought to be getting tired of karma fortunes by now.
 
Posts: 6,252
Karma: 16544692
Join Date: Sep 2009
Location: UK
Device: ClaraHD, Forma, Libra2, Clara2E, LibraCol, PBTouchHD3
if your css file contains
Code:
.body {margin-left:5pt; ... etc} (with dot)
it would affect any text in your html marked up with <??? class="body"> e.g.
<p class="body">
<div class="body">
<blockquote class="body">
<body class="body">

If your css file contains
Code:
body {margin-left:5pt; margin-right:5pt; ... etc} (without dot)
it would affect any text in your html marked up with <body ...> e.g
<body>
it would also affect any text in your html marked up with
<body class="xyz"> but with a caveat. If your css also contains
Code:
.xyz {margin-left:10pt}
then, by rules of cascading css, the .xyz would take preference for the left margin. You would get a 10pt left margin and a 5pt right margin

If the css contains
Code:
body.xyz {margin-left:5pt; margin-right:5pt; ... etc}
then only html files with <body class="xyz"> will have the 5pt margins

For your specific epub, it's hard to say more without seeing it. The fact that a typical html file for a chapter only has a plain <body> tag rather than a <body class="calibre??"> suggests it was not created by a Calibre conversion, but I stand to be corrected on that. I manually add those 5pt L/R margins to non-Calibre epubs all the time. I can't say I've noticed any problems.
jackie_w is offline   Reply With Quote
Old 10-19-2011, 08:40 AM   #21
cybmole
Wizard
cybmole ought to be getting tired of karma fortunes by now.cybmole ought to be getting tired of karma fortunes by now.cybmole ought to be getting tired of karma fortunes by now.cybmole ought to be getting tired of karma fortunes by now.cybmole ought to be getting tired of karma fortunes by now.cybmole ought to be getting tired of karma fortunes by now.cybmole ought to be getting tired of karma fortunes by now.cybmole ought to be getting tired of karma fortunes by now.cybmole ought to be getting tired of karma fortunes by now.cybmole ought to be getting tired of karma fortunes by now.cybmole ought to be getting tired of karma fortunes by now.
 
Posts: 3,720
Karma: 1759970
Join Date: Sep 2010
Device: none
i have no instances of class="body" in the original epub ( which has not come from calibre)
i have just <body>
then <h2 chapter header stuff....
then <p class="indent".... stuff
and no instances of 5pt margins in either the body or the indent definitions- the relevent bits are:
p.indent
{
text-indent: 1.00em;
margin-left: 0em;
margin-right: 0em;
text-align: justify;
}
body
{
margin-left: 0em;
margin-right: 0em;
}

so with those definitions, and your explanation, I'd expect to see text flow right up to bevel - which it does. - TICK

I now understand what calibre does, & where it does it, to add 5pt margins - TICK

I can also "prove" your explanation of the overrides, by setting e.g. left margin 5em in body to make a big visible difference.
body (without dot) then hugely indents the whole chapter. body (with dot) is over-ridden by p.indent & thus has no effect. TICK



but a zero left margin in body ( no dot) does not look the same as a zero left margin in p.indent & that is just mystifying - unless it is a side effect of justify...
YES. THAT IS IT. if i set p.indent text-align:left; then the text flows right up to left edge and all behaviour is consistent with explanations given:

body , with dot, is overridden by p.indent, and the text-align :justify in that definition adds something akin to a 5pt left & right border

I'm going tp quit while I think I'm winning & go read something :0)
cybmole is offline   Reply With Quote
Old 10-19-2011, 11:44 AM   #22
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: 31,067
Karma: 60358908
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 cybmole View Post
i'd checked the body tag already
before there was no class on body, just....

</head>

<body>
....
with a CSS definition:
body
{
font-size: medium;
line-height: 1.2em;
margin-top: 1em;
margin-left: 0em;
margin-right: 0em;
margin-bottom: 5.000000pt;
margin-top: 5.000000pt;
font-family: "Charis";
}
NB original CSS has body , not .body
after
<body class="calibre1">

.calibre1 {
display: block;
font-family: "Times New Roman", Times, serif;
font-size: 1em;
line-height: 1.2em;

padding-left: 0;
padding-right: 0
}

so I'm still not seeing it ( assuming lack of explicit padding definition defaults to zero )
body applies to any Body tag
.body only applies to something with the class="body"
Both are valid
Both can do the same
the second way just allows finer application control
theducks is offline   Reply With Quote
Reply


Forum Jump

Similar Threads
Thread Thread Starter Forum Replies Last Post
Can't seem to change epub margins Desertway Calibre 7 01-19-2012 04:28 AM
Neat solution for a misbehaving reader screen Tunney enTourage eDGe 8 12-02-2011 03:07 AM
Epub to mobi margins.. Corran006 Calibre 0 08-27-2010 08:39 PM
epub vs lrf - why choose epub for sony reader? Mitchll Calibre 25 03-11-2010 09:39 PM
Testing margins in ePUB. Jellby Workshop 8 01-03-2010 11:57 AM


All times are GMT -4. The time now is 02:41 AM.


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