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 05-09-2009, 01:40 AM   #1
Colaveare
Member
Colaveare began at the beginning.
 
Posts: 22
Karma: 10
Join Date: Apr 2009
Device: iphone
<pre> tag issue while converting to epub

Greetings,

I was just wondering if there was a way to strip all <pre> tags when converting from .lit to .epub with calibre

The reason why is that I use calibre as a server to have my ebooks anywhere on my iphone.
But some of the lit files that I have that contain <pre> tags completely play havoc with my iphone text layout.

I have managed to find the following CSS to enter while doing a conversion to at least add line wrap functionality (also adds line wrap to the default epub reader of calibre)

pre {
white-space: pre-wrap;
}


The problem is that all the other layout function that my iphone usually handles do not seem to work (like paragraph indent, line spacing, font type, etc).

Any help would be greatly appreciated.

Last edited by Colaveare; 05-09-2009 at 03:19 PM.
Colaveare is offline   Reply With Quote
Old 05-09-2009, 01:54 AM   #2
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: 25,820
Karma: 5006091
Join Date: Oct 2006
Location: Mumbai, India
Device: Various
just add

pre {display: none }

to override css
kovidgoyal is offline   Reply With Quote
 
Enthusiast
Old 05-09-2009, 03:17 PM   #3
Colaveare
Member
Colaveare began at the beginning.
 
Posts: 22
Karma: 10
Join Date: Apr 2009
Device: iphone
Yeah the problem is that by adding

Quote:
pre {display: none }
to overide the CSS it converts it into a blank epub file (literally removed all text that was targeted by the <pre> tag)

Instead I've been using this little workaround for now.
It seems to be working but sadly it stops me from having layouts that can auto-configure paragraph indent, line spacing between paragraphs and other things like default ereader browser fonts and so forth...

Quote:
pre {
white-space: pre-line;
font-family: Georgia;
}
At least this seems to be doing a line wrap and line justification for both the iphone and the calibre reader.

Last edited by Colaveare; 05-09-2009 at 03:19 PM.
Colaveare is offline   Reply With Quote
Old 05-09-2009, 03:29 PM   #4
DaleDe
Grand Sorcerer
DaleDe ought to be getting tired of karma fortunes by now.DaleDe ought to be getting tired of karma fortunes by now.DaleDe ought to be getting tired of karma fortunes by now.DaleDe ought to be getting tired of karma fortunes by now.DaleDe ought to be getting tired of karma fortunes by now.DaleDe ought to be getting tired of karma fortunes by now.DaleDe ought to be getting tired of karma fortunes by now.DaleDe ought to be getting tired of karma fortunes by now.DaleDe ought to be getting tired of karma fortunes by now.DaleDe ought to be getting tired of karma fortunes by now.DaleDe ought to be getting tired of karma fortunes by now.
 
DaleDe's Avatar
 
Posts: 9,583
Karma: 5071748
Join Date: Aug 2007
Location: Grass Valley, CA
Device: EB 1150, EZ Reader, Literati, iPad 2
Quote:
Originally Posted by Colaveare View Post
Yeah the problem is that by adding



to overide the CSS it converts it into a blank epub file (literally removed all text that was targeted by the <pre> tag)

Instead I've been using this little workaround for now.
It seems to be working but sadly it stops me from having layouts that can auto-configure paragraph indent, line spacing between paragraphs and other things like default ereader browser fonts and so forth...



At least this seems to be doing a line wrap and line justification for both the iphone and the calibre reader.
Good tip, thanks

Dale
DaleDe is offline   Reply With Quote
Old 05-09-2009, 03:29 PM   #5
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: 25,820
Karma: 5006091
Join Date: Oct 2006
Location: Mumbai, India
Device: Various
Opena ticket to request a feature to "reflow" <pre> tags
kovidgoyal is offline   Reply With Quote
Old 05-15-2009, 06:40 AM   #6
Colaveare
Member
Colaveare began at the beginning.
 
Posts: 22
Karma: 10
Join Date: Apr 2009
Device: iphone
Ticket 2446 openned.
Thanks
Colaveare is offline   Reply With Quote
Old 10-08-2010, 10:46 PM   #7
sergio blum
Member
sergio blum began at the beginning.
 
Posts: 11
Karma: 10
Join Date: Aug 2009
Device: SONY READER
Quote:
Originally Posted by kovidgoyal View Post
Opena ticket to request a feature to "reflow" <pre> tags
I'm not familiar with this XTML/CSS stuff, but have learnt some in the last 30 hours or so of trial and horrors.

Could a kind soul pleeease (please) explain step by step how to manually remove pre tags

I'd rather have my code reflow like body text -- courier or no courier

Have Sony Reader PRS-700. Been using Calibreand Sigil

Thanks in advance



Found what I think may be a bug:
In Sigil, text stops reflowing (when you narrow/enlarge the width of the bookm viewer window) after ANY edit in the CSS.

Sigil will be back to normal, though, after save - close - and reopen file.
sergio blum is offline   Reply With Quote
Old 10-08-2010, 11:10 PM   #8
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: 8,811
Karma: 12535517
Join Date: Feb 2009
Location: North Carolina
Device: Nexus 7
Update: I was once again suckered into responding to an old thread. I guess the Old Thread Warning wasn't enough. I have now modified this post to make it seem as though I was responding to the recent poster (instead of the original poster).

Old Thread Warning
Quote:
This thread is quite old and may contain outdated information. We recommend that you begin a new discussion if you like to talk about a similar topic. Of course, you may also proceed and reply here.
@sergio blum please start a new thread in the future (See attached).

Quote:
Originally Posted by sergio blum View Post
Could a kind soul pleeease (please) explain step by step how to manually remove pre tags
Did you try selecting preprocess input file during conversion (see attached)? In this thread, ldolse stated the following about preprocess and lit files in reference to a lit to epub conversion utilizing preprocessing that worked out for me.

Quote:
Originally Posted by ldolse View Post
Some lit files are more or less text files wrapped in html with <pre> tags - sounds like this may be one of those. These come out exaclty as you describe with Calibre's default lit conversion pipeline. Preprocessing looks for those as a special case and runs them through the text input process before applying normal preprocessing.
Give it a try, let us know if it helps.
Attached Thumbnails
Click image for larger version

Name:	preprocess.jpg
Views:	128
Size:	89.2 KB
ID:	59589   Click image for larger version

Name:	newthread.jpg
Views:	108
Size:	106.4 KB
ID:	59590  

Last edited by DoctorOhh; 10-08-2010 at 11:53 PM.
DoctorOhh is offline   Reply With Quote
Old 10-09-2010, 12:02 AM   #9
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
By the way, if someone has a file with multiple <pre> tags, please attach it to the linked bug. All the examples I found just had a single set of <pre> tags wrapping the entire document, so that's the only case I accounted for. I wasn't sure if multiple sets was a common real-life occurrence to worry about.
ldolse 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
TAG - A Techno Thriller set in the near future simonroyle Self-Promotions by Authors and Publishers 160 06-15-2012 12:17 AM
<pre> tags and no text reflow in EPUB sergio blum Calibre 24 10-14-2010 08:07 PM
ePub files do not center a custom <hr /> tag! Haidon ePub 2 08-21-2010 04:29 AM
LRF to EPUB: Each line is a paragraph tag wudaben Calibre 5 07-14-2010 07:04 PM
ebook-convert HTML to EPUB and problem with <pre><code> mikegr Calibre 2 03-09-2010 02:27 PM


All times are GMT -4. The time now is 01:40 PM.


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