![]() |
#1 |
Enthusiast
![]() 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. |
![]() |
![]() |
![]() |
#2 |
Wizard
![]() ![]() ![]() ![]() ![]() ![]() ![]() ![]() ![]() ![]() ![]() 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. |
![]() |
![]() |
Advert | |
|
![]() |
#3 | ||
Enthusiast
![]() Posts: 32
Karma: 44
Join Date: Jul 2010
Location: Seneca, SC
Device: Kindle, eReader
|
Quote:
Quote:
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. |
||
![]() |
![]() |
![]() |
#4 |
Enthusiast
![]() 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! |
![]() |
![]() |
![]() |
#5 |
Wizard
![]() ![]() ![]() ![]() ![]() ![]() ![]() ![]() ![]() ![]() ![]() 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. |
![]() |
![]() |
Advert | |
|
![]() |
#6 | |
Enthusiast
![]() Posts: 32
Karma: 44
Join Date: Jul 2010
Location: Seneca, SC
Device: Kindle, eReader
|
Quote:
Thanks for you help. |
|
![]() |
![]() |
![]() |
#7 |
What would Snake do?
![]() Posts: 49
Karma: 16
Join Date: Dec 2010
Location: Canada
Device: Kindle 3
|
![]()
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?
|
![]() |
![]() |
![]() |
#8 | |
Enthusiast
![]() Posts: 32
Karma: 44
Join Date: Jul 2010
Location: Seneca, SC
Device: Kindle, eReader
|
Quote:
|
|
![]() |
![]() |
![]() |
#9 |
What would Snake do?
![]() 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.
|
![]() |
![]() |
![]() |
|
![]() |
||||
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 |