|
|
#16 |
|
Fanatic
![]() ![]() ![]() ![]() ![]() ![]() ![]() ![]() ![]() ![]() ![]() Posts: 531
Karma: 10000000
Join Date: Aug 2013
Location: Hamden, CT
Device: Kindle Paperwhite (11th gen), Scribe, Kindle 4 Touch
|
pre isn't required to do fixed formatting
I just re-formatted a book I bought, and hit this same issue. Here's what I used for some source code:
Code:
.div-indent {
margin-left: 2em;
}
.div-computer {
margin-top: 4%;
margin-bottom: 4%;
margin-left: 2em;
margin-right: 2em;
font-size: 90%;
font-family: "Consolas", "Courier New", "Courier Std", "Courier", "DejaVu Sans Mono", monospace;
}
.para-left {
text-align: left;
}
Code:
<div class="div-computer">
<p class="para-left">void main (void)</p>
<div class="div-indent">
<p class="para-left">{</p>
<p class="para-left">char keyfile = fopen("108952.jpg");</p>
<p class="para-left">char extract;</p>
<p class="para-left">while (infile)</p>
<div class="div-indent">
<p class="para-left">{</p>
<p class="para-left">extract = asc(least_sig_bit(keyfile) / 2)^6;</p>
<p class="para-left">stdoutput(extract);</p>
<p class="para-left">}</p>
</div>
<p class="para-left">}</p>
</div>
</div>
|
|
|
|
|
|
#17 |
|
Resident Curmudgeon
![]() ![]() ![]() ![]() ![]() ![]() ![]() ![]() ![]() ![]() ![]() Posts: 80,655
Karma: 150249619
Join Date: Nov 2006
Location: Roslindale, Massachusetts
Device: Kobo Libra 2, Kobo Aura H2O, PRS-650, PRS-T1, nook STR, PW3
|
Sorry, but I just have to say go return that book. The code is awful. I would not trust the author.
|
|
|
|
|
|
#18 |
|
Fanatic
![]() ![]() ![]() ![]() ![]() ![]() ![]() ![]() ![]() ![]() ![]() Posts: 531
Karma: 10000000
Join Date: Aug 2013
Location: Hamden, CT
Device: Kindle Paperwhite (11th gen), Scribe, Kindle 4 Touch
|
|
|
|
|
|
|
#19 |
|
Junior Member
![]() Posts: 2
Karma: 10
Join Date: Feb 2017
Device: Kindle
|
Hi CBSA,
I think that I have the answer for you on that same ePub. Do a replace all of "</code> " (think that it was two spaces, may have been more) with "</code>" (no spaces). Do this in each html file; don't do anything to the CSS file. I used Calibre to edit the book to do this. You will see it auto correct as you do the replace all. Let me know if it works for you. G Last edited by GaryVe; 02-27-2017 at 09:35 AM. |
|
|
|
|
|
#20 |
|
Junior Member
![]() Posts: 2
Karma: 10
Join Date: Feb 2017
Device: Kindle
|
Correction to the above: copy and paste the offending code from the html script, which I have to be: (ignore the quotes)
"</code> <" and replace this with just "</code> <" and then replace "</code> <" with "</code><" Works perfectly for me. G Last edited by GaryVe; 02-25-2017 at 02:45 PM. |
|
|
|
![]() |
|
Similar Threads
|
||||
| Thread | Thread Starter | Forum | Replies | Last Post |
| find badly formatted ebooks | alexxxm | Calibre | 3 | 05-29-2016 12:33 PM |
| The Adventures of Joe Nobody and the Badly Formatted Epub | mklynds | Sigil | 44 | 01-30-2013 02:43 PM |
| Badly formatted eBooks | Katsunami | General Discussions | 27 | 02-03-2012 11:49 AM |
| Touch A badly formatted book or bad Kobo Touch rendering? | jswinden | Kobo Reader | 16 | 07-07-2011 07:19 PM |
| Classic Bought a Badly Formatted Book From B&N | lionel47 | Barnes & Noble NOOK | 11 | 05-22-2010 04:31 PM |