Register Guidelines E-Books Today's Posts Search

Go Back   MobileRead Forums > E-Book Software > Calibre

Notices

Reply
 
Thread Tools Search this Thread
Old 07-22-2010, 10:01 PM   #736
JSWolf
Resident Curmudgeon
JSWolf ought to be getting tired of karma fortunes by now.JSWolf ought to be getting tired of karma fortunes by now.JSWolf ought to be getting tired of karma fortunes by now.JSWolf ought to be getting tired of karma fortunes by now.JSWolf ought to be getting tired of karma fortunes by now.JSWolf ought to be getting tired of karma fortunes by now.JSWolf ought to be getting tired of karma fortunes by now.JSWolf ought to be getting tired of karma fortunes by now.JSWolf ought to be getting tired of karma fortunes by now.JSWolf ought to be getting tired of karma fortunes by now.JSWolf ought to be getting tired of karma fortunes by now.
 
JSWolf's Avatar
 
Posts: 79,792
Karma: 146391129
Join Date: Nov 2006
Location: Roslindale, Massachusetts
Device: Kobo Libra 2, Kobo Aura H2O, PRS-650, PRS-T1, nook STR, PW3
Quote:
Originally Posted by marliv View Post
I used installed unicode fonts on my PRS-505 by extra css


but it don't work anymore for body text as in epub css there:


any ideas?
Try removing font-family: "Times New Roman", Times, serif; from the CSS. That's bad code given that it's looking for a font that doesn't exist.
JSWolf is offline   Reply With Quote
Old 07-22-2010, 10:56 PM   #737
jayman
Enthusiast
jayman began at the beginning.
 
Posts: 33
Karma: 10
Join Date: Dec 2009
Device: iphone
Quote:
Originally Posted by nrapallo View Post
And if it IS surround by <pre> tags, then your best bet would be to edit the .html file(s) within the .epub (open the .epub up with a zip archiver and edit/extract the .html files) and do the following:

1) at the end of each line within the <pre> tags append a <br /> tag (or two <br /><br /> based on your preference for blank line separation), and

2) replace the surrounding <pre> ... </pre> tags with <p> ... </p> instead.

That should make sure the lines don't run into each other, but still allow each long line to wrap around so that you can see the ending...

BTW, in 2) above, you can play with indents using <p style="text-intent: 2em"> ... </p> or hanging indents using <p style="text-intent: 0em; margin-left: 2em"> ... </p>. Experimentation is your friend!
thanks! will try it.
jayman is offline   Reply With Quote
Old 07-22-2010, 11:09 PM   #738
nrapallo
GuteBook/Mobi2IMP Creator
nrapallo ought to be getting tired of karma fortunes by now.nrapallo ought to be getting tired of karma fortunes by now.nrapallo ought to be getting tired of karma fortunes by now.nrapallo ought to be getting tired of karma fortunes by now.nrapallo ought to be getting tired of karma fortunes by now.nrapallo ought to be getting tired of karma fortunes by now.nrapallo ought to be getting tired of karma fortunes by now.nrapallo ought to be getting tired of karma fortunes by now.nrapallo ought to be getting tired of karma fortunes by now.nrapallo ought to be getting tired of karma fortunes by now.nrapallo ought to be getting tired of karma fortunes by now.
 
nrapallo's Avatar
 
Posts: 2,958
Karma: 2530691
Join Date: Dec 2007
Location: Toronto, Canada
Device: REB1200 EBW1150 Device: T1 NSTG iLiad_v2 NC Device: Asus_TF Next1 WPDN
Quote:
Originally Posted by jayman View Post
thanks! will try it.
Oops, just noticed a typo in the hanging indents <p> code; it should be: <p style="text-intent: -2em; margin-left: 2em">
nrapallo is offline   Reply With Quote
Old 07-23-2010, 04:46 PM   #739
SkindleDX
Junior Member
SkindleDX began at the beginning.
 
Posts: 1
Karma: 10
Join Date: Jul 2010
Device: Kindle DX
Smile input epub - output mobi for Kindle DX

Hi,

I have input a pdf to output epub to create on Sigil a TOC, that's done and it works, if I open my epub file.

But now I have tried output the epub to a mobi file for my kindle dx, but the TOC is not showing up.

I have put everything on default.

Thank you so much!

Suhan

p.s. does the kindle speech text option also read german? thanks
SkindleDX is offline   Reply With Quote
Old 07-23-2010, 08:47 PM   #740
jayman
Enthusiast
jayman began at the beginning.
 
Posts: 33
Karma: 10
Join Date: Dec 2009
Device: iphone
Quote:
Originally Posted by nrapallo View Post
And if it IS surround by <pre> tags, then your best bet would be to edit the .html file(s) within the .epub (open the .epub up with a zip archiver and edit/extract the .html files) and do the following:

1) at the end of each line within the <pre> tags append a <br /> tag (or two <br /><br /> based on your preference for blank line separation), and

2) replace the surrounding <pre> ... </pre> tags with <p> ... </p> instead.

That should make sure the lines don't run into each other, but still allow each long line to wrap around so that you can see the ending...

BTW, in 2) above, you can play with indents using <p style="text-intent: 2em"> ... </p> or hanging indents using <p style="text-intent: -2em; margin-left: 2em"> ... </p>. Experimentation is your friend!
Is there any other faster way than doing it? This book I have has a lot of computer text and pre tags. Is there any way in conversion of the book from chm to epub to automatically have the <br /> tags at the end of each line inside the <pre> tags? Otherwise, going through each line is pretty laborious. thanks.
jayman is offline   Reply With Quote
Old 07-23-2010, 09:13 PM   #741
nrapallo
GuteBook/Mobi2IMP Creator
nrapallo ought to be getting tired of karma fortunes by now.nrapallo ought to be getting tired of karma fortunes by now.nrapallo ought to be getting tired of karma fortunes by now.nrapallo ought to be getting tired of karma fortunes by now.nrapallo ought to be getting tired of karma fortunes by now.nrapallo ought to be getting tired of karma fortunes by now.nrapallo ought to be getting tired of karma fortunes by now.nrapallo ought to be getting tired of karma fortunes by now.nrapallo ought to be getting tired of karma fortunes by now.nrapallo ought to be getting tired of karma fortunes by now.nrapallo ought to be getting tired of karma fortunes by now.
 
nrapallo's Avatar
 
Posts: 2,958
Karma: 2530691
Join Date: Dec 2007
Location: Toronto, Canada
Device: REB1200 EBW1150 Device: T1 NSTG iLiad_v2 NC Device: Asus_TF Next1 WPDN
Quote:
Originally Posted by jayman View Post
Is there any other faster way than doing it?
I usually use a RegEx capable Text Editor to do this type of substitution, but only when it's localized to one contiguous span of text. It may be harder to do this "globally" for every <pre> ... </pre> simultaneously. Your best bet would be to set up a macro but this type of stuff is very hard to "pull off" without a lot of trial and error. And to boot, it's probably ever going to be used ONCE since your next book may be formatted differently and "break" your macro!

Quote:
This book I have has a lot of computer text and pre tags.
Are you sure it's the <pre> tags not being properly recognized by your ebook reader/iPhone? Perhaps, it could be the way it's formatted. Can you post a snippet of one or better yet PM me a copy so that I can further test it. I usually create ebooks from .html and can easily explode .chm to .html using the following code noted in our CHM wiki:
Code:
C:\> hh -decompile Destdir Source.chm
However, then to properly structure an ebook from that can take a lot of effort since you usually have to manually reconstruct the index and ordering/links of the .html pages.

Quote:
Is there any way in conversion of the book from chm to epub to automatically have the <br /> tags at the end of each line inside the <pre> tags? Otherwise, going through each line is pretty laborious. thanks.
I've only manually converted .chm to .html and then to .epub / .prc, but only after I've "cleansed" the extracted .html files. I'm not sure how calibre does this conversion, but I would look at two-stage solution as I do manually.

In the end, this type of conversion DOES take a lot of elbow grease...
nrapallo is offline   Reply With Quote
Old 07-23-2010, 09:29 PM   #742
DoctorOhh
US Navy, Retired
DoctorOhh ought to be getting tired of karma fortunes by now.DoctorOhh ought to be getting tired of karma fortunes by now.DoctorOhh ought to be getting tired of karma fortunes by now.DoctorOhh ought to be getting tired of karma fortunes by now.DoctorOhh ought to be getting tired of karma fortunes by now.DoctorOhh ought to be getting tired of karma fortunes by now.DoctorOhh ought to be getting tired of karma fortunes by now.DoctorOhh ought to be getting tired of karma fortunes by now.DoctorOhh ought to be getting tired of karma fortunes by now.DoctorOhh ought to be getting tired of karma fortunes by now.DoctorOhh ought to be getting tired of karma fortunes by now.
 
DoctorOhh's Avatar
 
Posts: 9,897
Karma: 13806776
Join Date: Feb 2009
Location: North Carolina
Device: Icarus Illumina XL HD, Kindle PaperWhite SE 11th Gen
You have a lot of good ideas. I'm glad that someone that knows what they're doing is helping out.

Quote:
Originally Posted by nrapallo View Post
Are you sure it's the <pre> tags not being properly recognized by your ebook reader/iPhone? Perhaps, it could be the way it's formatted.
One thought from an amateur. The problem isn't the "<pre> tags not being properly recognized by your ebook reader" the problem is that the tags are properly recognized.

This causes code to scroll right off of the screen. It's a feature not a bug, designed so the code is presented exactly how the programming book wants it seen. The trouble, a reader is only so large and this code prevents wrapping before the end of the given code.

If the user has many books like this a combination of a larger reader or landscape vice portrait might be in order.
DoctorOhh is offline   Reply With Quote
Old 07-23-2010, 09:53 PM   #743
nrapallo
GuteBook/Mobi2IMP Creator
nrapallo ought to be getting tired of karma fortunes by now.nrapallo ought to be getting tired of karma fortunes by now.nrapallo ought to be getting tired of karma fortunes by now.nrapallo ought to be getting tired of karma fortunes by now.nrapallo ought to be getting tired of karma fortunes by now.nrapallo ought to be getting tired of karma fortunes by now.nrapallo ought to be getting tired of karma fortunes by now.nrapallo ought to be getting tired of karma fortunes by now.nrapallo ought to be getting tired of karma fortunes by now.nrapallo ought to be getting tired of karma fortunes by now.nrapallo ought to be getting tired of karma fortunes by now.
 
nrapallo's Avatar
 
Posts: 2,958
Karma: 2530691
Join Date: Dec 2007
Location: Toronto, Canada
Device: REB1200 EBW1150 Device: T1 NSTG iLiad_v2 NC Device: Asus_TF Next1 WPDN
Quote:
Originally Posted by dwanthny View Post
This causes code to scroll right off of the screen. It's a feature not a bug, designed so the code is presented exactly how the programming book wants it seen. The trouble, a reader is only so large and this code prevents wrapping before the end of the given code.
If the right margin on the ebook reader is NOT honoured, then it's a bug!

Quote:
If the user has many books like this a combination of a larger reader or landscape vice portrait might be in order.
Another mode of attack would be to change the font to a fixed point and be as small as is legible, so as to fit the max. amount of line text on the screen before it runs off. If the original .chm had a finite length (which is common for letter-sized pages) then perhaps this approach may work. In my reader, I would simply use:
Code:
<pre style="font-family: smallfont; font-size: xx-small">...</pre>
and the text would appear like this Click image for larger version

Name:	Clipboard01.jpg
Views:	522
Size:	101.0 KB
ID:	55624.

Within .epub files, that syntax may have to be change to something like
Code:
<pre style="font-family: courier; font-size: 1">...</pre>
If this doesn't work, then cropping the lines or reflowing them would be the only alternative (other than getting a large screened ebook reader... ). That's why you would need to remove the <pre> tags, reflow the text using <p> tags and then manually breaking each line with <br /> to avoid them running into each other.

Any way you do it, if the original (e)book was not formatted for small screened ebook readers, then doing so afterward will NOT yield good results! That's why I avoid .pdf ebooks at all cost even though they are wonderfully presented and visually stunning most of the time; substance over form?
nrapallo is offline   Reply With Quote
Old 07-23-2010, 10:12 PM   #744
DoctorOhh
US Navy, Retired
DoctorOhh ought to be getting tired of karma fortunes by now.DoctorOhh ought to be getting tired of karma fortunes by now.DoctorOhh ought to be getting tired of karma fortunes by now.DoctorOhh ought to be getting tired of karma fortunes by now.DoctorOhh ought to be getting tired of karma fortunes by now.DoctorOhh ought to be getting tired of karma fortunes by now.DoctorOhh ought to be getting tired of karma fortunes by now.DoctorOhh ought to be getting tired of karma fortunes by now.DoctorOhh ought to be getting tired of karma fortunes by now.DoctorOhh ought to be getting tired of karma fortunes by now.DoctorOhh ought to be getting tired of karma fortunes by now.
 
DoctorOhh's Avatar
 
Posts: 9,897
Karma: 13806776
Join Date: Feb 2009
Location: North Carolina
Device: Icarus Illumina XL HD, Kindle PaperWhite SE 11th Gen
Quote:
Originally Posted by nrapallo View Post
If the right margin on the ebook reader is NOT honoured, then it's a bug!
Again, not a bug, just outside of the epub specification. <pre> tags don't respect the right margin of any html renderer. Just like the code tags here break the liquid format of this board, when you resize the font, it goes right off the screen.

Quote:
Originally Posted by nrapallo View Post
Another mode of attack would be to change the font to a fixed point and be as small as is legible, so as to fit the max.
A fixed font combined with landscape might fit most books to a six inch reader. Nice suggestion.
DoctorOhh is offline   Reply With Quote
Old 07-24-2010, 02:05 PM   #745
jayman
Enthusiast
jayman began at the beginning.
 
Posts: 33
Karma: 10
Join Date: Dec 2009
Device: iphone
Quote:
Originally Posted by nrapallo View Post
If the right margin on the ebook reader is NOT honoured, then it's a bug!



Another mode of attack would be to change the font to a fixed point and be as small as is legible, so as to fit the max. amount of line text on the screen before it runs off. If the original .chm had a finite length (which is common for letter-sized pages) then perhaps this approach may work. In my reader, I would simply use:
Code:
<pre style="font-family: smallfont; font-size: xx-small">...</pre>
and the text would appear like this Attachment 55624.

Within .epub files, that syntax may have to be change to something like
Code:
<pre style="font-family: courier; font-size: 1">...</pre>
If this doesn't work, then cropping the lines or reflowing them would be the only alternative (other than getting a large screened ebook reader... ). That's why you would need to remove the <pre> tags, reflow the text using <p> tags and then manually breaking each line with <br /> to avoid them running into each other.

Any way you do it, if the original (e)book was not formatted for small screened ebook readers, then doing so afterward will NOT yield good results! That's why I avoid .pdf ebooks at all cost even though they are wonderfully presented and visually stunning most of the time; substance over form?
Thanks for the suggestion. Will try it when I get home. Thanks again.
jayman is offline   Reply With Quote
Old 07-30-2010, 03:03 AM   #746
starrigger
Jeffrey A. Carver
starrigger ought to be getting tired of karma fortunes by now.starrigger ought to be getting tired of karma fortunes by now.starrigger ought to be getting tired of karma fortunes by now.starrigger ought to be getting tired of karma fortunes by now.starrigger ought to be getting tired of karma fortunes by now.starrigger ought to be getting tired of karma fortunes by now.starrigger ought to be getting tired of karma fortunes by now.starrigger ought to be getting tired of karma fortunes by now.starrigger ought to be getting tired of karma fortunes by now.starrigger ought to be getting tired of karma fortunes by now.starrigger ought to be getting tired of karma fortunes by now.
 
starrigger's Avatar
 
Posts: 1,355
Karma: 1107383
Join Date: Aug 2008
Location: Massachusetts, USA
Device: Lenovo Yoga Tab Plus, Droid phone, Nook HD+
Don't know if this has been brought up before or not. Something that's been bugging me (in a minor way) is blank line spaces. Generally when I convert something to epub, I tell it to remove blank lines between paragraphs. (Or I might run an existing epub through to do that, if it was made with spaces between paragraphs.) It generally works well.

The problem is, there are some lines you want left blank: scene breaks, spaces between chapter number and text, etc. Is there any way of telling Calibre to leave these blanks alone? I'm not sure how it would know the difference, but Calibre is a very clever program, and I wondered if there was a way.
starrigger is offline   Reply With Quote
Old 07-30-2010, 10:12 AM   #747
Phil_C
Addict
Phil_C ought to be getting tired of karma fortunes by now.Phil_C ought to be getting tired of karma fortunes by now.Phil_C ought to be getting tired of karma fortunes by now.Phil_C ought to be getting tired of karma fortunes by now.Phil_C ought to be getting tired of karma fortunes by now.Phil_C ought to be getting tired of karma fortunes by now.Phil_C ought to be getting tired of karma fortunes by now.Phil_C ought to be getting tired of karma fortunes by now.Phil_C ought to be getting tired of karma fortunes by now.Phil_C ought to be getting tired of karma fortunes by now.Phil_C ought to be getting tired of karma fortunes by now.
 
Phil_C's Avatar
 
Posts: 274
Karma: 391602
Join Date: Oct 2009
Location: Chicago, IL USA
Device: Sony PRS-350; Kobo Clara HD; Kobo Clara 2E; Kobo Clara BW
Quote:
Originally Posted by starrigger View Post
Don't know if this has been brought up before or not. Something that's been bugging me (in a minor way) is blank line spaces. Generally when I convert something to epub, I tell it to remove blank lines between paragraphs. (Or I might run an existing epub through to do that, if it was made with spaces between paragraphs.) It generally works well.

The problem is, there are some lines you want left blank: scene breaks, spaces between chapter number and text, etc. Is there any way of telling Calibre to leave these blanks alone? I'm not sure how it would know the difference, but Calibre is a very clever program, and I wondered if there was a way.
Exactly! The answer is supposed to be a lot of editing in HTML, which I don't do. Not all of us have the time/inclination to spend on this. My collection of several hundred ebooks (mostly formatted by me in Book Designer) is in lrf. I foresee that someday these will have to be converted to epub.

It seems to me that the Calibre conversion process ought to recognize this situation. After all, if there is a blank line in the existing document, there must be a reason for it. And the conversion process should see and account for it. Why is the current option all or nothing? Why can't Calibre see a blank line and just leave it there?
Phil_C is offline   Reply With Quote
Old 07-30-2010, 10:28 AM   #748
Starson17
Wizard
Starson17 can program the VCR without an owner's manual.Starson17 can program the VCR without an owner's manual.Starson17 can program the VCR without an owner's manual.Starson17 can program the VCR without an owner's manual.Starson17 can program the VCR without an owner's manual.Starson17 can program the VCR without an owner's manual.Starson17 can program the VCR without an owner's manual.Starson17 can program the VCR without an owner's manual.Starson17 can program the VCR without an owner's manual.Starson17 can program the VCR without an owner's manual.Starson17 can program the VCR without an owner's manual.
 
Posts: 4,004
Karma: 177841
Join Date: Dec 2009
Device: WinMo: IPAQ; Android: HTC HD2, Archos 7o; Java:Gravity T
Quote:
Originally Posted by Phil_C View Post
Why can't Calibre see a blank line and just leave it there?
I can't answer this, and I have no idea what the problem is. I'm sure it's quite obvious to you and to those who experience your problem, but not to others (at least not to me). Of course, you have no obligation to clearly explain what happens and why you don't like it, but there are some developers out there, and some of them may be willing to give you a hand by at least looking at the issue to see if it has a simple solution.

Even if there's no one who can help you, I'm interested in what the problem is, if you feel like giving more detail.
Starson17 is offline   Reply With Quote
Old 07-30-2010, 11:36 AM   #749
Phil_C
Addict
Phil_C ought to be getting tired of karma fortunes by now.Phil_C ought to be getting tired of karma fortunes by now.Phil_C ought to be getting tired of karma fortunes by now.Phil_C ought to be getting tired of karma fortunes by now.Phil_C ought to be getting tired of karma fortunes by now.Phil_C ought to be getting tired of karma fortunes by now.Phil_C ought to be getting tired of karma fortunes by now.Phil_C ought to be getting tired of karma fortunes by now.Phil_C ought to be getting tired of karma fortunes by now.Phil_C ought to be getting tired of karma fortunes by now.Phil_C ought to be getting tired of karma fortunes by now.
 
Phil_C's Avatar
 
Posts: 274
Karma: 391602
Join Date: Oct 2009
Location: Chicago, IL USA
Device: Sony PRS-350; Kobo Clara HD; Kobo Clara 2E; Kobo Clara BW
Quote:
Originally Posted by Starson17 View Post
I can't answer this, and I have no idea what the problem is. I'm sure it's quite obvious to you and to those who experience your problem, but not to others (at least not to me). Of course, you have no obligation to clearly explain what happens and why you don't like it, but there are some developers out there, and some of them may be willing to give you a hand by at least looking at the issue to see if it has a simple solution.

Even if there's no one who can help you, I'm interested in what the problem is, if you feel like giving more detail.
starrigger explained it above, but Ill try again.

There are certain blank lines in most any novel, e.g. to denote a change in scene, or after an epigraph at the beginning of a chapter, or after a chapter title.

Calibre has only two choices for paragraph spacing: ALL or NONE.

So when converting lrf to epub, Calibre either: 1) places blank lines between ALL paragraphs of the novel, or 2) removes ALL blank lines including the ones I want to keep as in my examples above.

What I want is to keep the original paragraph spacing --- none, except for special cases as above.

The Calibre manual says something about editing the HTML code in each individual ebook to account for this. That is no solution when I want to convert hundreds of books from lrf to epub for use on future readers.

It seems to me that if a blank line exists in my lrf, it must somehow be coded as such (how else could it be there?), so Calibre ought to be able to leave it as is.

In the Calibre Look and Feel conversion choices, there is a box for removing spaces between paragraphs, and a box for adding blank lines between paragraphs. I don't want either. If I leave both unchecked, the converted epub SHOULD retain the original spacing from the original ebook. Instead, the result is the same as if I checked the add blank lines box.

If this could be corrected, I could easily convert my hundreds of files to epub. All help is appreciated.
Phil_C is offline   Reply With Quote
Old 07-30-2010, 11:55 AM   #750
Starson17
Wizard
Starson17 can program the VCR without an owner's manual.Starson17 can program the VCR without an owner's manual.Starson17 can program the VCR without an owner's manual.Starson17 can program the VCR without an owner's manual.Starson17 can program the VCR without an owner's manual.Starson17 can program the VCR without an owner's manual.Starson17 can program the VCR without an owner's manual.Starson17 can program the VCR without an owner's manual.Starson17 can program the VCR without an owner's manual.Starson17 can program the VCR without an owner's manual.Starson17 can program the VCR without an owner's manual.
 
Posts: 4,004
Karma: 177841
Join Date: Dec 2009
Device: WinMo: IPAQ; Android: HTC HD2, Archos 7o; Java:Gravity T
Quote:
Originally Posted by Phil_C View Post
starrigger explained it above, but Ill try again.
That was clear, and I appreciate it.

Quote:
If this could be corrected, I could easily convert my hundreds of files to epub. All help is appreciated.
I still don't know if I can help. I particularly am not interested in working on lrf format (sorry, it's deprecated and I don't use it), but if your problem lies elsewhere, I might be interested. To find out, turn on debug and convert a problem file to EPUB. Then look in the debug folders and advise when the problem appears. Is it in the very first folder, or later? Is this an lrf problem only, or a conversion problem in general? Does the problem appear when going to epub from HTML, LIT or any other formats?
Starson17 is offline   Reply With Quote
Reply


Forum Jump

Similar Threads
Thread Thread Starter Forum Replies Last Post
[Old Thread] Epub Output: Line Height greenapple Conversion 20 01-27-2013 09:27 AM
EPUB output justification toki08 Calibre 10 01-08-2011 04:14 PM
Calibre epub output details and Nook squidward Calibre 6 11-24-2010 03:21 PM
epub output metadata troymc Calibre 5 05-22-2010 12:23 AM
Problem with epub output in Cybook Gen3 fjf Calibre 3 02-03-2010 02:23 AM


All times are GMT -4. The time now is 06:57 AM.


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