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

Go Back   MobileRead Forums > E-Book Software > Calibre

Notices

Reply
 
Thread Tools Search this Thread
Old 12-17-2010, 06:47 PM   #1
pckopp
Enthusiast
pckopp began at the beginning.
 
Posts: 32
Karma: 44
Join Date: Jul 2010
Location: Seneca, SC
Device: Kindle, eReader
conversion and stylesheet question

I am converting a related series of PDF files to MOBI format for my Kindle. Slowly I am getting the process refined. Here is what I am doing and why. Feel free to suggest a better way.

First is PDF to EPUB. I do this because I need to edit the files and to remove a bunch of added pages, pictures and text that was not part of the original book. So I convert to EPUB and use Sigil to edit. This has recently gotten much easier since Calibre now breaks up the PDF files into chapters quite nicely. Also, I have figured out how to get the headers removed reliably. Since the input is PDF, there are some word breaks and line breaks to fix. No problem.

The only unusual thing I noticed in this step was that the first paragraph of each chapter was tagged with a simple '<p>' paragraph tag. Nearly all the rest were '<p class="calibre1">'.

Almost all the extra stuff I want to remove is in separate chapters, so I just delete them. Easy.

Then I looked at the stylesheet in Sigil and added a new class. Most books do not indent the first paragraph of a chapter, so I just copied the calibre1 class and made a new one called calibre7 (next unused number in all the files) and changed the indent to 0. Saved that and in Sigil, it looks exactly as I want.

When I convert that EPUB to MOBI, I lose that style on the first paragraphs. The first paragraph looks like all the rest with indentation.

Are any edits I make to the stylesheet in Sigil ignored in Calibre?
How do I fix this?

One other note. The resultant MOBI file shows a 'new page' for the start of each chapter if I look at in in my PC Kindle reader. It does not show that in the Calibre ereader app. Odd.
pckopp is offline   Reply With Quote
Old 12-17-2010, 08:49 PM   #2
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
Calibre shouldn't ignore stylesheet changes you made in Sigil. There's probably something else going on. If you can create a reproduction case with some generic non-copyright content you could post it here, otherwise post it to a bug with the file on bugs.calibre-ebook.com.

You did actually change the beginning of each of those paragraphs to <p class="calibre7">, right? One thing I probably wouldn't do is use the name calibre7 or any calibre name in my own css styles. Create an name like 'noindent' or something like that. I don't think calibre actually reserves those names but it's possible that's tripping things up.
ldolse is offline   Reply With Quote
Old 12-17-2010, 10:44 PM   #3
pckopp
Enthusiast
pckopp began at the beginning.
 
Posts: 32
Karma: 44
Join Date: Jul 2010
Location: Seneca, SC
Device: Kindle, eReader
Quote:
Originally Posted by ldolse View Post
Calibre shouldn't ignore stylesheet changes you made in Sigil. There's probably something else going on. If you can create a reproduction case with some generic non-copyright content you could post it here, otherwise post it to a bug with the file on bugs.calibre-ebook.com.
I will do that if I don't get it figured out.

Quote:
Originally Posted by ldolse View Post
You did actually change the beginning of each of those paragraphs to <p class="calibre7">, right? One thing I probably wouldn't do is use the name calibre7 or any calibre name in my own css styles. Create an name like 'noindent' or something like that. I don't think calibre actually reserves those names but it's possible that's tripping things up.
Yes, I did make the changes. I double-checked. I also changed them from 'calibre7' to 'noindent' just to see, but no change. Still not getting to the MOBI file.

I turned on the debug mode and learned something. Four folders are created: input, parsed, structure and processed. My marked up text and stylesheet survive until the processed folder. Both the stylesheet and my text files have the correct tags and definitions in input, parsed and structure. In the processed folder, both are missing. No more 'noindent' class definition in the stylesheet and in the text that string is replaced with 'calibre1', the default style. So somewhere in the last step it goes south. And of course, the MOBI output looks like the processed folder files - all paragraphs are indented.

Thanks ldolse.
pckopp is offline   Reply With Quote
Old 12-18-2010, 07:45 AM   #4
pckopp
Enthusiast
pckopp began at the beginning.
 
Posts: 32
Karma: 44
Join Date: Jul 2010
Location: Seneca, SC
Device: Kindle, eReader
A solution

On the Look & Feel page of the Conversion dialogs, I unchecked the 'Remove spacing between paragraphs' box and it now works like I expect.

I had checked that box for the PDF to EPUB conversion to get rid of the extra blank lines in that conversion process. From EPUB to MOBI there are no blank lines.

Is this a bug? Or just unexpected behavior due to my inexperience?

Thanks all!
pckopp is offline   Reply With Quote
Old 12-18-2010, 09:03 AM   #5
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
That's not a bug - part of that feature adds an indent to every paragraph - that's clearly stated in the tooltips and the help.

If you want the equivalent of the feature without the indents use the extra_css option instead, and add a line like this:
p {margin-top: 0em; margin-bottom: 0em}

It may not be quite as effective on some books, as it wiil need to compete with the settings that are already in the book, but in general it should do the job.
ldolse is offline   Reply With Quote
Old 12-18-2010, 09:18 AM   #6
pckopp
Enthusiast
pckopp began at the beginning.
 
Posts: 32
Karma: 44
Join Date: Jul 2010
Location: Seneca, SC
Device: Kindle, eReader
Quote:
Originally Posted by ldolse View Post
That's not a bug - part of that feature adds an indent to every paragraph - that's clearly stated in the tooltips and the help.
I understand deleting blank lines and adding the indicated indent to every paragraph. I just didn't realize it would override my stylesheet. But since my stylesheet changes were about indenting I guess it makes sense. I will make a stylesheet change for something other than indenting and see if it also gets changed.

Thanks for you help.
pckopp is offline   Reply With Quote
Old 12-26-2010, 02:37 PM   #7
Snakey
What would Snake do?
Snakey began at the beginning.
 
Posts: 49
Karma: 16
Join Date: Dec 2010
Location: Canada
Device: Kindle 3
Question

Quote:
Originally Posted by pckopp View Post
One other note. The resultant MOBI file shows a 'new page' for the start of each chapter if I look at in in my PC Kindle reader. It does not show that in the Calibre ereader app. Odd.
Wow, I think you just solved a problem that's been driving me crazy. I've been converting PDF to EPUB in Calibre, editing in Sigil to create chapters & clean things up, then converting the edited EPUB to MOBI for my Kindle. I don't have the Kindle yet so I've been previewing my results in the Calibre e-book reader. What I couldn't figure out is how to get the final MOBI to do "chapters start on a new page." I knew I was getting Calibre to recognize where the chapters in the edited EPUB were because I was getting it to add a horizontal line after each one, but they were not starting on a new page (when viewed in Calibre reader/viewer.) After I read your post here I tried viewing my MOBI in the Kindle PC viewer and the chapters were starting on new pages! Maybe a bug in the Calibre viewer? I'm just hoping that when viewed on my Kindle it will follow the behavior shown in the Kindle PC reader and start the chapters on new pages like I want. Anyone have input on this?
Snakey is offline   Reply With Quote
Old 12-26-2010, 03:41 PM   #8
pckopp
Enthusiast
pckopp began at the beginning.
 
Posts: 32
Karma: 44
Join Date: Jul 2010
Location: Seneca, SC
Device: Kindle, eReader
Quote:
Originally Posted by Snakey View Post
Wow, I think you just solved a problem that's been driving me crazy. I've been converting PDF to EPUB in Calibre, editing in Sigil to create chapters & clean things up, then converting the edited EPUB to MOBI for my Kindle. I don't have the Kindle yet so I've been previewing my results in the Calibre e-book reader. What I couldn't figure out is how to get the final MOBI to do "chapters start on a new page." I knew I was getting Calibre to recognize where the chapters in the edited EPUB were because I was getting it to add a horizontal line after each one, but they were not starting on a new page (when viewed in Calibre reader/viewer.) After I read your post here I tried viewing my MOBI in the Kindle PC viewer and the chapters were starting on new pages! Maybe a bug in the Calibre viewer? I'm just hoping that when viewed on my Kindle it will follow the behavior shown in the Kindle PC reader and start the chapters on new pages like I want. Anyone have input on this?
Not an exhaustive test, but everything I have looked on the Kindle PC reader looks the same on the Kindle itself.
pckopp is offline   Reply With Quote
Old 12-26-2010, 10:21 PM   #9
Snakey
What would Snake do?
Snakey began at the beginning.
 
Posts: 49
Karma: 16
Join Date: Dec 2010
Location: Canada
Device: Kindle 3
Thanks a lot for the info, from now on I'll do my previewing on the Kindle PC reader instead of the Calibre reader and I'll have my actual Kindle in about 7 days and see the final results then.
Snakey 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
EPub conversion stylesheet.css problem nycaleksey Calibre 1 03-25-2010 11:42 PM
Conversion Question bschase2 Calibre 2 12-22-2009 09:51 PM
Conversion Question kpfeifle Sony Reader 1 11-04-2009 07:41 AM
conversion question Indigo Ink Kindle Formats 3 03-09-2009 11:02 AM
PRS-500 Conversion question gczobel Sony Reader Dev Corner 1 01-15-2008 01:36 AM


All times are GMT -4. The time now is 12:02 PM.


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