04-01-2011, 06:11 PM | #1 |
Junior Member
Posts: 7
Karma: 20
Join Date: Apr 2011
Device: Kindle
|
Preserving Indentation
To Whom it may concern!
I've been trying to convert "The C Programming Language Ritchie & kernighan" from PDF to mobi and all the time I get the code blocks stripped of the indentation - really ugly. Finaly I came up with some sort of solution Settings->Conversion->Common Options->Search and replace Search: [\s]{2} Replace: It may not be very elegant but it works )) Now this: Code:
main() 21 { int c, nl; nl = 0; while ((c = getchar()) != EOF) if (c == '\n') ++nl; printf("%d\n", nl); } Code:
main() 21 { int c, nl; nl = 0; while ((c = getchar()) != EOF) if (c == '\n') ++nl; printf("%d\n", nl); } Table of contents in pdf files turns to something like this: 1.5.2 Character Counting.......................................... ........................................19 1.5.3 Line Counting.......................................... .......................................20 1.5.4 Word Counting.......................................... ..................................21 which gets carried over 2 lines.. very ugly So, put another replacement: Search: \.\.\.\.\.\.\.\.\.\.\.\.\.\.\. Repace: <EMPTY> Cheerz zaph0d |
04-02-2011, 08:42 AM | #2 |
Junior Member
Posts: 7
Karma: 20
Join Date: Apr 2011
Device: Kindle
|
Okay, PDF->EPUB(calibre), Sigil, than calibre again EPUB->MOBI seems to be a bit better, I cleared page numbers and generated proper TOC in Sigil, but its kinda too exhaustive for a personal conversion... and Im not publisher/writer
I hope, the new PDF engine is coming soon, are there alpha/beta builds I can download for personal use? |
04-02-2011, 12:54 PM | #3 |
Sigil & calibre developer
Posts: 2,488
Karma: 1063785
Join Date: Jan 2009
Location: Florida, USA
Device: Nook STR
|
No. It is stalled. Meaning no one is currently working on it.
No, it is not yet in a usable state. With a little work it can be used to produce XML output but the code to turn that into something usable is missing. |
04-02-2011, 08:52 PM | #4 |
Junior Member
Posts: 7
Karma: 20
Join Date: Apr 2011
Device: Kindle
|
Can I help?
|
04-02-2011, 08:58 PM | #5 |
Sigil & calibre developer
Posts: 2,488
Karma: 1063785
Join Date: Jan 2009
Location: Florida, USA
Device: Nook STR
|
Of course. Take a look at http://bazaar.launchpad.net/~kovid/c...re/ebooks/pdf/ Post on the https://launchpad.net/~calibre-devs mailing list for help. Kovid is the one working on the C code so he's the most knowledgable about it.
|
05-30-2011, 04:41 PM | #6 |
Junior Member
Posts: 1
Karma: 10
Join Date: Jul 2010
Device: Android
|
Thanks for the tip Zaph0d, worked like a charm.
|
Thread Tools | Search this Thread |
|
Similar Threads | ||||
Thread | Thread Starter | Forum | Replies | Last Post |
Convert epub that has hard margin / indentation? | planetthoughtful | Conversion | 5 | 02-08-2011 05:37 AM |
PDF to epub convertion grief; keeping indentation | Aia | Calibre | 2 | 10-31-2010 05:09 PM |
Preserving Formatting through conversion? | Ham88 | 16 | 08-31-2009 02:22 AM | |
Epub and negative indentation | Nate the great | ePub | 6 | 04-27-2009 11:48 AM |
PDF conversion & indentation | Shiren | Calibre | 5 | 12-11-2008 02:09 PM |