Register Guidelines E-Books Search Today's Posts Mark Forums Read

Go Back   MobileRead Forums > E-Book Software > Calibre > Conversion

Notices

Reply
 
Thread Tools Search this Thread
Old 05-02-2014, 03:48 AM   #1
xerwin
Junior Member
xerwin began at the beginning.
 
Posts: 1
Karma: 10
Join Date: May 2014
Device: kindle
Keep code formated in programming books?

I use Calibre a lot to convert classic books. But sometimes I come across some freebies programming books. Being a software developer I naturally download them and read them.

However when I convert them, say from PDF to MOBI, the code in them is not formated as it should.

This is how the code looks in a PDF book, and if you are software developer you are familiar with this kind of indentation.

Code:
public class Part {
    private String m_dsc; // The textual description
    
    void setName(String name) {
        m_dsc = name;
    }
}
When converted to MOBI or any other format, the code above turns to

Code:
public class Part {
private String m_dsc; // The textual description
void setName(String name) {
m_dsc = name;
}
}
Which makes it very hard to read when you have multiple blocks nested inside each other and the code snippet is long.


Is there any setting that could preserve the code formating? I tried googling but couldn't find anything.
xerwin is offline   Reply With Quote
Old 05-02-2014, 03:54 AM   #2
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,800
Karma: 12528001
Join Date: Feb 2009
Location: North Carolina
Device: Nexus 7
Quote:
Originally Posted by xerwin View Post
Is there any setting that could preserve the code formating?
No.

Sticky posts at the top of each calibre forum have a wealth of information. Here is the sticky post covering PDF as a source format for conversions: Read this before Posting PDF Questions.
DoctorOhh is offline   Reply With Quote
 
Enthusiast
Reply

Thread Tools Search this Thread
Search this Thread:

Advanced Search

Forum Jump

Similar Threads
Thread Thread Starter Forum Replies Last Post
Amazon Kindle formated books jbcohen Amazon Kindle 6 01-29-2014 04:32 AM
[O'Reilly] 50% off programming/code books (till 16.10.2012) Cyberman tM Deals, Freebies, and Resources (No Self-Promotion) 0 10-09-2012 09:18 AM
Convert PDF to EPUB with source code in Courier and formated as it was MRi Conversion 2 11-14-2011 02:02 AM
Programming language code snippets in ebooks? Connochaetes Writers' Corner 7 10-18-2010 02:43 PM
Options to show programming source code in ePub pedgarcia ePub 2 07-21-2010 10:41 AM


All times are GMT -4. The time now is 10:07 AM.


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