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 02-06-2009, 04:41 PM   #61
llasram
Reticulator of Tharn
llasram ought to be getting tired of karma fortunes by now.llasram ought to be getting tired of karma fortunes by now.llasram ought to be getting tired of karma fortunes by now.llasram ought to be getting tired of karma fortunes by now.llasram ought to be getting tired of karma fortunes by now.llasram ought to be getting tired of karma fortunes by now.llasram ought to be getting tired of karma fortunes by now.llasram ought to be getting tired of karma fortunes by now.llasram ought to be getting tired of karma fortunes by now.llasram ought to be getting tired of karma fortunes by now.llasram ought to be getting tired of karma fortunes by now.
 
llasram's Avatar
 
Posts: 618
Karma: 400000
Join Date: Jan 2007
Location: EST
Device: Sony PRS-505
Quote:
Originally Posted by Gudy View Post
Unless I'm missing something major, the whole mechanism seems to be completely b0rked in 0.4.133.
It appears to work just fine to me. I'm going to guess that the source you're converting from contains CSS with a more specific rule which is trumping your override rule's single-element 'p' selector. Try something like "html body p { text-indent: 1em; margin: 0; }". If that doesn't work either, open a bug on the calibre trac and attach a file which is failing to convert as expected.

Quote:
Originally Posted by Gudy View Post
As a general usability complaint, I find it rather unacceptable that I need to resort to handcoding CSS in order to set something as basic as a paragraph indent in EPUB and MOBI files, especially since there is a far simpler way available for LRF files.
Hmm. I may agree with you, especially given situations like what I believe is your current issue. Paragraph marking is probably one of the formatting areas users most frequently wish to control, and might deserve a direct interface which can use use some sort of heuristics to detect normal paragraphs and style them accordingly.

Quote:
Originally Posted by Gudy View Post
In the same vein, having to use XPath expressions to detect chapter headings pretty much ensures that I will never use that feature in calibre but will instead hand-massage the html file before import.
What sort of interface would you prefer to see?

-Marshall
llasram is offline   Reply With Quote
Old 02-06-2009, 04:42 PM   #62
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: 43,866
Karma: 22666666
Join Date: Oct 2006
Location: Mumbai, India
Device: Various
Quote:
Originally Posted by Gudy View Post

As a general usability complaint, I find it rather unacceptable that I need to resort to handcoding CSS in order to set something as basic as a paragraph indent in EPUB and MOBI files, especially since there is a far simpler way available for LRF files. In the same vein, having to use XPath expressions to detect chapter headings pretty much ensures that I will never use that feature in calibre but will instead hand-massage the html file before import.
Paragrpah indents will eventually be settable with a simple control. As for XPath, I think it is easier to use than the various LRF settings, if you spend 5 minutes reading the XPath tutorial in the calibre User Manual
kovidgoyal is online now   Reply With Quote
Advert
Old 02-06-2009, 06:33 PM   #63
Amalthia
Wizard
Amalthia does all things with Zen-like beautyAmalthia does all things with Zen-like beautyAmalthia does all things with Zen-like beautyAmalthia does all things with Zen-like beautyAmalthia does all things with Zen-like beautyAmalthia does all things with Zen-like beautyAmalthia does all things with Zen-like beautyAmalthia does all things with Zen-like beautyAmalthia does all things with Zen-like beautyAmalthia does all things with Zen-like beautyAmalthia does all things with Zen-like beauty
 
Amalthia's Avatar
 
Posts: 1,159
Karma: 32196
Join Date: Jan 2007
Location: Anchorage, AK
Device: Sony Reader PRS-505, PRS-650, PRS-T3, Pocketbook HD2
Quote:
Originally Posted by kovidgoyal View Post
Paragrpah indents will eventually be settable with a simple control. As for XPath, I think it is easier to use than the various LRF settings, if you spend 5 minutes reading the XPath tutorial in the calibre User Manual
I think for people unfamilar with css or Xpath it's not as easy to figure out what you need to do to set settings. I think the LRF conversion is more intutive for people that are starting out with little or no knowledge of programming or html coding.

I'm still not quite sure what to do with xpath but I have used command line to try some stuff out?

And I've also run into troubles using css to make paragraph indents. The code should work but it doesn't always? I found that I have to convert the file. Turn off the program, re-open and convert the file again and on the second pass the indents stick. It's worked like that two times...and maybe with the newer version the css you gave me will do the trick on first try.

But considering Epub and Mobi are still in beta I expect a few bumps in the road and am willing to try and figure out what's happening.

However, I don't think I'm your average user.

edit: forgot to mention...having said everything I said I'm still rather excited about the ablity to set paragraph indents like I do for the LRF settings.

Last edited by Amalthia; 02-06-2009 at 06:58 PM.
Amalthia is offline   Reply With Quote
Old 02-06-2009, 06:49 PM   #64
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: 43,866
Karma: 22666666
Join Date: Oct 2006
Location: Mumbai, India
Device: Various
At some point I will get around to coding an XPath expression builder, but for the time being, you have to enter them by hand.
kovidgoyal is online now   Reply With Quote
Old 02-07-2009, 06:09 AM   #65
Gudy
Wizard
Gudy ought to be getting tired of karma fortunes by now.Gudy ought to be getting tired of karma fortunes by now.Gudy ought to be getting tired of karma fortunes by now.Gudy ought to be getting tired of karma fortunes by now.Gudy ought to be getting tired of karma fortunes by now.Gudy ought to be getting tired of karma fortunes by now.Gudy ought to be getting tired of karma fortunes by now.Gudy ought to be getting tired of karma fortunes by now.Gudy ought to be getting tired of karma fortunes by now.Gudy ought to be getting tired of karma fortunes by now.Gudy ought to be getting tired of karma fortunes by now.
 
Gudy's Avatar
 
Posts: 1,154
Karma: 3252017
Join Date: Jan 2008
Location: Germany
Device: Pocketbook Touch Lux (623)
Quote:
Originally Posted by Amalthia View Post
And I've also run into troubles using css to make paragraph indents. The code should work but it doesn't always? I found that I have to convert the file. Turn off the program, re-open and convert the file again and on the second pass the indents stick. It's worked like that two times...and maybe with the newer version the css you gave me will do the trick on first try.
Some more experimenting revealed that this is precisely the problem, yes. Changes in the CSS Override input box only take effect after completely restarting Calibre. This is true, at least for Mobipocket, in both 0.4.133 and 0.4.134

Quote:
Originally Posted by kovidgoyal View Post
Paragrpah indents will eventually be settable with a simple control. As for XPath, I think it is easier to use than the various LRF settings, if you spend 5 minutes reading the XPath tutorial in the calibre User Manual
I'm definitely looking forward to the simple settings. :-)

As for XPath vs. the LRF settings, with the latter it took me 30 seconds of thinking about what I'm supposed to enter into those fields and exactly one failed attempt until I had the chapters detected and page breaks inserted exactly where I wanted them. I have no doubt that XPath is far more powerful and versatile a tool, but I doubt I would have gotten up to speed with XPath within two minutes...
Gudy is offline   Reply With Quote
Advert
Old 02-07-2009, 07:54 AM   #66
mtravellerh
book creator
mtravellerh ought to be getting tired of karma fortunes by now.mtravellerh ought to be getting tired of karma fortunes by now.mtravellerh ought to be getting tired of karma fortunes by now.mtravellerh ought to be getting tired of karma fortunes by now.mtravellerh ought to be getting tired of karma fortunes by now.mtravellerh ought to be getting tired of karma fortunes by now.mtravellerh ought to be getting tired of karma fortunes by now.mtravellerh ought to be getting tired of karma fortunes by now.mtravellerh ought to be getting tired of karma fortunes by now.mtravellerh ought to be getting tired of karma fortunes by now.mtravellerh ought to be getting tired of karma fortunes by now.
 
mtravellerh's Avatar
 
Posts: 9,635
Karma: 3856660
Join Date: Oct 2008
Location: Luxembourg
Device: PB360°
Quote:
Originally Posted by Gudy View Post
Some more experimenting revealed that this is precisely the problem, yes. Changes in the CSS Override input box only take effect after completely restarting Calibre. This is true, at least for Mobipocket, in both 0.4.133 and 0.4.134



I'm definitely looking forward to the simple settings. :-)

As for XPath vs. the LRF settings, with the latter it took me 30 seconds of thinking about what I'm supposed to enter into those fields and exactly one failed attempt until I had the chapters detected and page breaks inserted exactly where I wanted them. I have no doubt that XPath is far more powerful and versatile a tool, but I doubt I would have gotten up to speed with XPath within two minutes...
Ah, to be quite plain about it, Kovid's XPath default expression is REALLY a catch-all put there to well catch nearly all chapters. If you have a specific file, one simple expression including a tag per hierarchic level is generally enough.

It might be a good habit for anyone involved in bookmaking in some way to just mark TOC files (parts, sections, chapters) in a uniform hierarchical way with tags or at least with uniform class labels and not use those tags or labels for other tasks.
mtravellerh is offline   Reply With Quote
Old 02-07-2009, 08:12 AM   #67
Gudy
Wizard
Gudy ought to be getting tired of karma fortunes by now.Gudy ought to be getting tired of karma fortunes by now.Gudy ought to be getting tired of karma fortunes by now.Gudy ought to be getting tired of karma fortunes by now.Gudy ought to be getting tired of karma fortunes by now.Gudy ought to be getting tired of karma fortunes by now.Gudy ought to be getting tired of karma fortunes by now.Gudy ought to be getting tired of karma fortunes by now.Gudy ought to be getting tired of karma fortunes by now.Gudy ought to be getting tired of karma fortunes by now.Gudy ought to be getting tired of karma fortunes by now.
 
Gudy's Avatar
 
Posts: 1,154
Karma: 3252017
Join Date: Jan 2008
Location: Germany
Device: Pocketbook Touch Lux (623)
Quote:
Originally Posted by mtravellerh View Post
It might be a good habit for anyone involved in bookmaking in some way to just mark TOC files (parts, sections, chapters) in a uniform hierarchical way with tags or at least with uniform class labels and not use those tags or labels for other tasks.
Probably, yes. The thing is, I don't often make books myself. I've converted about two dozen books to FB2 for my own use using Bookdesigner, and this was my first attempt to go beyond that single format. So I'm still working out an optimal work flow. I've gone Word .doc -> Bookdesigner -> .html -> Cleanup with VIM -> Calibre with this one, but that's probably not optimal at all, especially since the BD html output leaves a lot to be desired as a basis for further work on a book.
Gudy is offline   Reply With Quote
Old 02-07-2009, 05:17 PM   #68
Amalthia
Wizard
Amalthia does all things with Zen-like beautyAmalthia does all things with Zen-like beautyAmalthia does all things with Zen-like beautyAmalthia does all things with Zen-like beautyAmalthia does all things with Zen-like beautyAmalthia does all things with Zen-like beautyAmalthia does all things with Zen-like beautyAmalthia does all things with Zen-like beautyAmalthia does all things with Zen-like beautyAmalthia does all things with Zen-like beautyAmalthia does all things with Zen-like beauty
 
Amalthia's Avatar
 
Posts: 1,159
Karma: 32196
Join Date: Jan 2007
Location: Anchorage, AK
Device: Sony Reader PRS-505, PRS-650, PRS-T3, Pocketbook HD2
I have a question about <br > tags. For some reason when I convert to mobi there is an extra space added after using them. So they kind of act like paragraph breaks. Is there anyway to make the break tag work like a regular break tag? I don't use break tags often but they are a big part of my TOC and with LRF my TOC is single spaced. I'd like to replicate that result with my mobi files.
Amalthia is offline   Reply With Quote
Old 02-08-2009, 06:24 PM   #69
giddion
Connoisseur
giddion doesn't littergiddion doesn't litter
 
Posts: 73
Karma: 186
Join Date: Feb 2009
Location: CT, USA
Device: samsung i910 now - cybook later
Meta Data

Is it possible now that Calibre has MOBI output to save the updated meta data?

I don't want to do the full convert because I don't want to reformat the ebook, I'm happy with the format, I just want to put a better cover in the file and add series information to the meta.
Mobi2Mobi_gui will let me update some of the meta but it doesn't give series and it doesn't have the great lookup function Calibre has to find the correct cover graphic and meta data.
giddion is offline   Reply With Quote
Old 02-08-2009, 11:29 PM   #70
llasram
Reticulator of Tharn
llasram ought to be getting tired of karma fortunes by now.llasram ought to be getting tired of karma fortunes by now.llasram ought to be getting tired of karma fortunes by now.llasram ought to be getting tired of karma fortunes by now.llasram ought to be getting tired of karma fortunes by now.llasram ought to be getting tired of karma fortunes by now.llasram ought to be getting tired of karma fortunes by now.llasram ought to be getting tired of karma fortunes by now.llasram ought to be getting tired of karma fortunes by now.llasram ought to be getting tired of karma fortunes by now.llasram ought to be getting tired of karma fortunes by now.
 
llasram's Avatar
 
Posts: 618
Karma: 400000
Join Date: Jan 2007
Location: EST
Device: Sony PRS-505
Quote:
Originally Posted by Amalthia View Post
I have a question about <br > tags. For some reason when I convert to mobi there is an extra space added after using them. So they kind of act like paragraph breaks. Is there anyway to make the break tag work like a regular break tag? I don't use break tags often but they are a big part of my TOC and with LRF my TOC is single spaced. I'd like to replicate that result with my mobi files.
It sounds like what's probably going on is that you have <br/> tags directly in the <body/>. In XHTML and HTML <br/> tags aren't actually allowed there, so the way they get interpreted varies with the renderer. MSReader and (most? all?) the Mobipocket viewers will renderer a <br/> in the <body/> following a block as a blank line, but AdobeDE will only render the blank line if there are two <br/> tags.

Anyway, try wrapping your table of contents or whatever in a <div> </div> tags so that your <br/> tags aren't directly in the <body/>.
llasram is offline   Reply With Quote
Old 02-08-2009, 11:32 PM   #71
llasram
Reticulator of Tharn
llasram ought to be getting tired of karma fortunes by now.llasram ought to be getting tired of karma fortunes by now.llasram ought to be getting tired of karma fortunes by now.llasram ought to be getting tired of karma fortunes by now.llasram ought to be getting tired of karma fortunes by now.llasram ought to be getting tired of karma fortunes by now.llasram ought to be getting tired of karma fortunes by now.llasram ought to be getting tired of karma fortunes by now.llasram ought to be getting tired of karma fortunes by now.llasram ought to be getting tired of karma fortunes by now.llasram ought to be getting tired of karma fortunes by now.
 
llasram's Avatar
 
Posts: 618
Karma: 400000
Join Date: Jan 2007
Location: EST
Device: Sony PRS-505
Quote:
Originally Posted by giddion View Post
Is it possible now that Calibre has MOBI output to save the updated meta data?
Er, yes? It should be automatic. If you import a Mobipocket version, update the metadata, then "save to disk" as Mobipocket, it should just write out a copy of the Mobipocket version w/ the updated metadata.
llasram is offline   Reply With Quote
Old 02-08-2009, 11:43 PM   #72
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: 43,866
Karma: 22666666
Join Date: Oct 2006
Location: Mumbai, India
Device: Various
Quote:
Originally Posted by llasram View Post
Er, yes? It should be automatic. If you import a Mobipocket version, update the metadata, then "save to disk" as Mobipocket, it should just write out a copy of the Mobipocket version w/ the updated metadata.
It will in the next release. There were a couple of bugs in the mobipocket metadata setting code that needed to be fixed first.
kovidgoyal is online now   Reply With Quote
Old 02-09-2009, 07:00 AM   #73
giddion
Connoisseur
giddion doesn't littergiddion doesn't litter
 
Posts: 73
Karma: 186
Join Date: Feb 2009
Location: CT, USA
Device: samsung i910 now - cybook later
Quote:
Originally Posted by kovidgoyal View Post
It will in the next release. There were a couple of bugs in the mobipocket metadata setting code that needed to be fixed first.
Ok thank you very much, I was about to reply that I have tried the save as mobi and the cover graphic isn't being saved. Have to admit though I didn't double check whether the rest of the meta updated, was going to go back and check that before my reply - can still check which elements updated and which didn't if it would be helpful.
giddion is offline   Reply With Quote
Old 02-09-2009, 02:01 PM   #74
Amalthia
Wizard
Amalthia does all things with Zen-like beautyAmalthia does all things with Zen-like beautyAmalthia does all things with Zen-like beautyAmalthia does all things with Zen-like beautyAmalthia does all things with Zen-like beautyAmalthia does all things with Zen-like beautyAmalthia does all things with Zen-like beautyAmalthia does all things with Zen-like beautyAmalthia does all things with Zen-like beautyAmalthia does all things with Zen-like beautyAmalthia does all things with Zen-like beauty
 
Amalthia's Avatar
 
Posts: 1,159
Karma: 32196
Join Date: Jan 2007
Location: Anchorage, AK
Device: Sony Reader PRS-505, PRS-650, PRS-T3, Pocketbook HD2
Quote:
Originally Posted by llasram View Post
It sounds like what's probably going on is that you have <br/> tags directly in the <body/>. In XHTML and HTML <br/> tags aren't actually allowed there, so the way they get interpreted varies with the renderer. MSReader and (most? all?) the Mobipocket viewers will renderer a <br/> in the <body/> following a block as a blank line, but AdobeDE will only render the blank line if there are two <br/> tags.

Anyway, try wrapping your table of contents or whatever in a <div> </div> tags so that your <br/> tags aren't directly in the <body/>.
yeah I tried that but it only worked for one table of contents and I have about 5 or 6 stories mixed into one file and they have summary, title, author notes and etc...it doesn't look so great when it's paragraph indented but when I tried to use css to remove the paragraph indents for just those sections it didn't work.

Basically, yes I'm using <br > tags within the body of the html but what I still don't get is why when I convert to LRF the <br > tags work like they do on web browsers but when I convert to MOBI it adds an extra line.
Amalthia is offline   Reply With Quote
Old 02-09-2009, 02:27 PM   #75
llasram
Reticulator of Tharn
llasram ought to be getting tired of karma fortunes by now.llasram ought to be getting tired of karma fortunes by now.llasram ought to be getting tired of karma fortunes by now.llasram ought to be getting tired of karma fortunes by now.llasram ought to be getting tired of karma fortunes by now.llasram ought to be getting tired of karma fortunes by now.llasram ought to be getting tired of karma fortunes by now.llasram ought to be getting tired of karma fortunes by now.llasram ought to be getting tired of karma fortunes by now.llasram ought to be getting tired of karma fortunes by now.llasram ought to be getting tired of karma fortunes by now.
 
llasram's Avatar
 
Posts: 618
Karma: 400000
Join Date: Jan 2007
Location: EST
Device: Sony PRS-505
Quote:
Originally Posted by Amalthia View Post
Basically, yes I'm using <br > tags within the body of the html but what I still don't get is why when I convert to LRF the <br > tags work like they do on web browsers but when I convert to MOBI it adds an extra line.
The any2* tools are mostly for e-book conversion, and in MSReader and Mobipocket a <br/> tag there will create a new blank line. If calibre didn't convert such <br/>s then people converting books from those formats would find that they were missing blank lines in e.g. their EPUB versions.

More abstractly, the problem is that you should never be using the <br/> tag in hand-written HTML. You should use semantic markup around anything you want to be rendered as a block-level box and use CSS to set appropriate display and margins.

For example:

Code:
<div class="lines">
  <div class="line">This is on a line!</div>
  <div class="line">This is on another line!</div>
</div>
Then have CSS like:

Code:
.lines { margin: 0; }
.line { margin: 0; }
The CSS2.1 spec has lots of examples.
llasram is offline   Reply With Quote
Reply


Forum Jump

Similar Threads
Thread Thread Starter Forum Replies Last Post
main menu, section menu, css for calibre mobipocket output naisren Calibre 2 08-23-2010 11:42 PM
Trying to get consistent look to all output daveps Calibre 0 03-08-2010 02:18 PM
Anyone Have mobipocket desktop? Mobipocket server is down. Ireadfreely Kindle Formats 3 10-27-2008 10:29 AM
convert from 'new' mobipocket to 'old' mobipocket? Indigo Ink Kindle Formats 11 06-22-2008 01:43 AM
Mobipocket Reader 4.8 and Mobipocket eNews Creator Mobipocket Reading and Management 1 01-29-2004 08:03 AM


All times are GMT -4. The time now is 11:14 AM.


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