<pre> tags and no text reflow in EPUB
Since the previous post was my very first one, I supposed I was not entitled — or it would not be appropriate — to create a new thread myself. I thought this was for advanced users of Mobileread.
Thanks to dwanthny’s reccomendation I have now done this and here I am. I hope the previous respondents — both dwanthny and ldolse will see me here.
After people become cognizant they forget how baffled they were when ignorant. Please be patient. The day before before yesterday I still did not know what a CSS is. Now I know already know the meaning of karma, ticket, <pre>, white-space (and what characters are collectively called whitespaces) etc. Also, I have made so many (thirty... forty) round trips between calibre and sigil that I am now relatively familiarized with the calibre in its basic aspects. So I believe I have the minimum requirements to implement suggestions from people willing to help me.
Let me begin by quoting my own first post in the old thread.
= = =
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 text reflow like body text -- courier or no courier.
Have Sony Reader PRS-700. Been using Calibre and Sigil.
Thanks in advance
= = =
I failed to say that the conversions I am trying to do are from CHM to EPUB.
The CHM contains body text and examples of ActionScript code.
Below, this is what I mean by code text.
ldolse, you said: “By the way, if someone has a file with multiple <pre> tags, please attach it to the linked bug”. I’m sorry, I dont understand what you mean by “linked bug”, but since the sentence contains “please attach”, I am attaching a small sample EPUB file. Maybe, just maybe, having a look a the XTML and the CSS will immediately convey more information than me trying describe the issues. So, please have a look at the file.
dwanthny also wrote:
/QUOTE
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
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
/UNQUOTE
I only now found where the preprocessing option is in calibre’s conversion options... but am unure on how to proceed, for idolse also said:
/QUOTE
Preprocess won't work for epub, but if you rename the epub from .epub to .zip and add the zip version back to the book record Calibre treats it identically to compressed html, which means preprocessing will work. You shouldn't have to go from epub to rtf and back.
/UNQUOTE
Idolse, what do you mean by “book record”. Are you instructing me to change the extension to zip and then bring it into Calibre by clicking in the icon “Add books” and then going on to convert?
If so, I will try this, but I think it was kovidgoyal himself who said that this kind of problem was NOT due to bad conversion. In effect, it was said somewhere, the conversion was CORRECTLY replacing whatever flags/tags exists in CHM that purposefully tell text in a block not to reflow.
Oh, I will wait until you people have a look into my askforHELP.epub file.
But again, is it no possible to manually remove <pre> tags manually? Why is that?
I am very familiarized with writing macros in Word? Could anything useful be done in Word? Although I have never used them before, I have also installed both Dreamwaver and Adobre Acrobat Pro in my PC. Can they be useful in this context?
I also read somewhere a suggestion to convert <pre> tags into <p> tags. Does this mean just substitue <p for <pre in the XHTML? I did this and the individual lines of code text all bunched up in a single paragraph. Or must it be done in tandem with other changes?
Am I expressisng myself clearly? Is there any info I left out?
I just want — at the very least — have the code text converted into body text. The best would be to be able to specify different font sizes for body text and code text.
I cannot contemplate going to bed this one more day without learning how to solve this issue.
Please forgive for not being able to be more concise. It is a steep learning curve in the beginning. Thanks indeed in advance.
SB
|